First, let me explain shortly in words only. How is the chess problem composed?
Every composer has his very own approach. Personally, I am usually starting by choosing the idea that I plan to put into the problem. The theme of the theme tourney, or something I have seen in the other form in some other problem - yes, something I would like to work out. Then I am thinking for some time, shorter or longer, often without the chessboard, striving to find the suitable scheme expressing my idea, or rather the backbone of the idea.
Then, already with the chessboard I am trying whether my idea really works, I am considering various relationships between pieces, hidden possibilities, difficult points of the construction, and I am solving more and more specific questions. FInally I reach the position that can be tested by computer.
Then I test it and usually I find wealth of cooks, duals and other unwanted points. Then it becomes a kind of iterative process. I remove one or more issues at once and test again. Removing an issue sometimes creates three new ones, heh. Sometimes I manage to cope with them successfully, sometimes not, I am led astray and I have to return back, even far back in my research. Other situation happening quite often are crossroads with multiple possible ways to follow. Again and again.
It also often happens that I manage to notice another, until that point unwanted relationship or idea, it might just come by and be left, but then I try to incorporate it into my creation. It just needs this and that... And this way, having im mind the final aim, moving, adding and removing pieces I am looking for the way to the finish in the form of the correct and hopefully valuable composition. The final feeling of "Heureka" is fantastic.
For the demonstration of the composing process I have chosen the theme of twomover quick tourney from Subotica festival :
#2 with a key creating the indirect battery.
Let's compose such twomover together. :-)
Indirect battery is a configuration of pieces of the same side allowing the opening of the action line piece by the departure of another piece. This activated line should aim at the opposite king's (potential) flight. There is such configuration on the next diagram, wRb5 - wSc5, where departure of Sc5 opens the line of wR to e5, f5 and g5.

Let's imagine that we have here the position after the twomover's key, which was in fact arrival of wR to b5. What else do we have in the scheme? Sc5 has to guard pe4, that is why it cannot mate bK.
But if bBh7 captured white pawn, it would block e4 and therefore wS could mate. Of course, not to d3 as this square would be guarded by bB, thus only one mate would work, namely Se6#. (Of course, for this to work you have to imagine all relevant potential flights of bK are already guarded.By the way, e5, f5 anf g5 could be yet free as wS opens wR there.)
Similarly, of bRe1 captured white pawn, it would block e4 too, but the avoided and working mate would be swapped. Rook would guard e6 and Sd3# would be possible. Altogether two variations are sketched:
1…Bxe4 2.Se6# (not 2.Sd3+? Bxd3!)
1…Rxe4 2.Sd3# (not 2.Se6+? Rxe6!)
Now there is an important question: why the black pieces should capture at e4? The simplest answer is: to parry the white threat after the key. For example, if the position is shifted one column to the left, wQ and wP are added, the threat is created (we are still in the post-key position): 2.Qf3#.

This threat is banal, but well illustrates the possible defending motivation of white pawn captures. White pawn has to guard e5 in the threat mate, that is why capturing it parries the threat. It is also fine that this square is under possible fire from the thematic indirect battery, therefore mates after defences might work. Fine, the reason why captures would defend the threat might be unguard of the (potential) flight e5, guarded by wp after the key.
Let's put everything back, one column to the right.
The threat should be created by the supposed key, arrival of the white rook to b5. Which exact move, together with the configuration of other pieces, might create the threat, against which the unguard of f5 would defend?
Here I see multiple possibilities. For instance:
A. add wQa3 and the key 1.Rb3-b5 (threating e.g. 2.Qg3#),
B. add wQa6 and the key 1.Rb6-b5 (therating e.g. 2.Qh6#),
C. add wKb8, wSb6, bRb1 and the key 1.Ra5-b5 (unpinning wS and thus threating 2.Sd5#) - in this case they key however would not create the indirect battery.
Currently I prefer B., so I will follow this path. The diagram shows the position after they key, threating 2.Qh6#.

This threat might be defended also by 1...Bg6 with the closing of mating move line, so I have to keep in mind this possibility of black defence.
I return wR to b6, to its pre-key position and I investigate what else the position offers. wQ need not be activised only along the 6th rank. There is also possibility of diagonal move. What happens if white tries the other first move, e.g. 1.Qc4?

This move (among other important motifs) guards wpe4. This automatically brings into action potential double threat 2.Sd3# and 2.Se6#, the variation mates from the 1.Rb5! phase. What is interesting here, it is the fact that both defences capturing pe4, by rook and bishop, defend against both these threats by unguarding f5! Aren't there, by chance, any mates available to White?
I was very lucky to find immediately there are in fact some mates available:
1.Qc4 thr. 2.Sd3#, Se6#
1…Rxe4 2.Qf1# (black rook unguards f1 in the defence, the mating queen guards also f5)
1…Bxe4 2.Rf6# (black bishop selfpins in the defence, thus it does not guard f5 anymore, on the other hand, mating rook again reguard f5)
Having found this (for recreational twomover respectable) content, I have got the feeling it would be helpful to consider working lines that I had to keep clear:
- b6-h6 (for the threat by queen as well as rook mate),
- h6-f4 (for the threat by queen),
- a6-f1 (for the mate by queen),
- f1-f4 (again for the mate by queen),
- c4-e4 (for the guard of pawn as well as pinning of the selfpinned bishop),
- c5-f5 (for the working of the indirect battery)
To get more visual feeling, I have put circles to squares that have to remain empty.

Quite a few squares altogether, hm.
On the other hand, it is necessary to guard by white some squares in the bK neighbourhood, these are marked by black circles. (Squares that have to be both empty and guarded are marked by white-black circle.)

The square e5 seems to be the most problematic as it is in the middle of to-remain-empty squares, thus it cannot be guarded by wK nor wp. Let's try white Bh8.

The pair of white pieces Rg3 and Ph2 would take care of the rest of to-be-guarded squares.
In this moment I have everything necessary guarded and I might try the position by computer.
Oh well, there were some cooks (unwanted solutions) and other unwelcome difficulties. Here is the list of important findings:
1st cook 1.Se6+! K×e4 2.Qd3#
2nd cook 1.Rbg6! threats 2.R6g4#, 2.Qf6#, 2.Qd6# (it cannot be defended everything)
3rd cook 1.Rf6+! Ke5 3.Rf1#, Rf8# etc., 1…Bf5 2.Rxf5#, Qd6#
4th cook 1.Qc8! threats 2.Qb8#, Qc7#, Qg4# and no defence against all threats
5th cook 1.Rb4! threats 2.Sd3#, Se6#, Qh6#, Qd6#
1…B×e4 2.Qf6#
1…R×e4 2.Qf1#
There was expected solution with unwanted double threat:
1.Rb5! threats 2.Qh6#, Qd6#
1…B×e4 2.Se6#
1…R×e4 2.Sd3#
And also the second wanted phase is there, but with unexpectedly missing mate:
1.Qc4? threats 2.Sd3#, Se6#
1…R×e4 2.Qf1#
but 1…B×e4!
One could say it is hopeless, but in fact the result of the test is better than I expected. Sure, I have been running the test hurriedly, thus some easily seen points slipped from my attention and the defects are multiple. But on the other hand one can say I finally see points I have ignored and perhaps the difficult points of the construction are easier to discover now.

Let's start from the end. After 1.Qc4 one see the planned mate 2.Rf6# closes the line of the bishop. That is why I move Bh8 to b2, to see the effect.
Double threat in the solution. To make it single threat is not difficult, Qd6# might be eliminated by adding bPc7 or the threat Qh6# might be eliminated by moving Bh7 to g6. Of course, now I see that if I retained the threat Qd6#, then the defence 1...Rxe4 would have double defence motivation, both by unguard of f5 and also direct guarding of e5 by rook. In comparison with the defence by bishop, which would keep only one defence motif, this would mean lack of motivation unity. On the other hand, already mentioned defence 1...Bg6 would be eliminated. That is why I would choose to try it with the defence Qd6# for the time being.
The cooks 1.Rb4! and 1.Qc8! might be easily eliminated by adding white pawn to b4 and black pawn to h5, the other cooks require some deeper thinking, so let's see what we have got so far.

The cook 1.Se6+! Kxe4 2.Qd3# looks more difficult to cope with as both squares where White plays in the cook should not be guarded by Black - there are thematic mates by knights there. But in fact it is enough to eliminate the guarding of d3 by white Rg3 and then suddenly wQ is capturable by bK. So the construction of guards around bK has to be changed.
1.Rf6+! is more difficult as it automatically allows planned threat 2.Qd6# in any case. Perhaps one can try to move black bishop from g6 (originally at h7) even to f5, to remove check from 1.Rf6! and to give black some more time for defence preparation. This would also cope with already eliminated cook 1.Qc8! I have put there black ph5, so I can take it away.
However, Bf5 guards e6 and thus to have the play analogous with rook, let's move rook to e3 too (this will by the way resolve the 1.Se6+! too).
Fine, I test this position to see the result and I get...

I get total horror, suddenly almost nothing works as expected. Why? Because black pieces are now very strong, bR might capture wRg3, also 1...Bg4 is a strong defence giving flight g5. So this is not good direction, I should really try to guard bK flights the other way.
I try it the following way and I test it again:

(By the way, I have put wBf6 to this very square for multiple reasons. It guards g5 besides e5, it blocks f6 to eliminate cook 1.Rf6! and it even prevents unwanted threat 2.Qh6#)
Result: no solution.
It is however important, that there are all expected variations after 1.Rb5?, only there is unwanted defence 1...Rd3!
Of course, 1.Qc4? now carries no threat as bB and bR guard knight mates originally intended as threats after this queen move. So I have got an idea of the second phase introduced by key 1.Rb4. The idea is to have the same threat 2.Qd6# as in the solution and to mate in variations twice by queen (2.Qf6#, 2.Qf1#). Naturally, this means again removing white piece from f-file (here the composing is there-back-there-back iterative process) and to guard potential flights of bK the other way. Also beware of still unwanted mate 2.Qh6#...
So I will try:

This way the mostly empty board again allows unpleasant 1.Rf6+!, also a bit 1.Rg6!, on the hand I have to choose between 1.Rb4! and 1.Qc4! as possible keys of the other phase not employing the thematic indirect battery. Still with multiple threats that might be unavoidable after all...
The question is whether I am able to prevent the cook 1.Rf6+! by other means than placing the bB at f5.
Well, after some thinking I find that if I replace wSg4 by wBh8, then I should have no mate after 1.Rf6+ Ke5, of course, if I use the rook for 1.Rb4, expecting mate by queen at f6 after 1...Bxe4. So what do I get now?

It turns out I have not considered everything carefully enough. 1.Rf6+! Ke5 2.R anywhere on f-file mates. Why? Because white pawn e4 guards d5. If he would not...
So I employ the standard trick used often during composing: turning the board. This changes the direction of pawn moves and they suddenly may guard different squares and lines. This of course requires change of guards around bK, it is also necessary to prevent unwanted checks to wK and perhaps unwanted defences by black rook, let's try it this way:

So here it seems the square d4 is waiting for bK. But in fact black king is in the role of Godot now. 1.Rc6+! Kd5 2.Rd6#!! Black king will not reach d4, too bad. Doublecheck mate is difficult to defend (as many players know). Completely wrong idea to turn the board?
Not really. There is a new, still unconsidered possibility appearing after the board turning. Black pawn placed at e7 can additionaly guard d6, disabling rook mate after 1.Rc6+ Bd6! (This also allows removing ph7 that was preventing 1...Rh7!)

And now it almost works!
1.Rc6+? Bd6! 2.Rxd6+ exd6!
Still the computer says there is a cook 1.Qa3! with three threats 2.Qb3#, Qa2#, Qxe7#, but it is easy to cope with it. Do you see how to do it? No? So let's move the position one column to the left:

The full content is now as follows:
1.Rc2? hr. 2.Qb8#
1…R×d5 2.Se4#
1…B×d5 2.Sb5#
but 1…Bb7!
1.Rd2! hr. 2.Se4#, Sb5#, Qb8#
1…R×d5 2.Qg6#
1…B×d5 2.Qb6#
It is quite elegant, but there are two weak points here.
Firstly - the initially intended solution, namely the indirect battery creation 1.Rc2, is a try, not solution. This would disqualify the problem from the thematic competition where the indirect battery creation key would be required. Or you would have to find the other position satisfying the requirement. For me, now, in this demonstration exercise, it is not such an issue. For me the indirect battery creation was just a starting point. So no problem after all.
Secondly - and more importantly now - the solution has triple threat. It is not nice, even if variations work perfectly. Three is little too much, even one of threats repeats with no apparent reason. If there were only those with knight, may be, they are after all thematic in some sense. Is there any way to deal with 2.Qb8# threat in the solution?
Well, it might help to return to the first move (now) 1.Qd3. As 1.Rb6+! is not an issue thanks to bpd7, it can be tried.
Problém No. 169
Juraj Lörinc
original for blog, 20.5.2009

Mate in 2 moves (9+5)
E.g. this way. White bishop might be moved to the other side of c5 to avoid rook interference on b6, the wrong key 1.Rd2! might be disabled by placing white pawn at d2. Thus we get the new solution 1.Qd3! and the full content:
1.Rc2? hr. 2.Qb8#
1…R×d5 2.Se4#
1…B×d5 2.Sb5#
but 1…Bb7!
1.Qd3! hr. 2.Se4#, Sb5#
1…R×d5 2.Qg6#
1…B×d5 2.Rb6#
And that's it!
Such a twomover would be good performance for any beginner. Usually the composers start with something much easier, before they acquire the necessary basic composing skills. After all, the composition need not be difficult, it depends on the goals the composer sets to himself. If he just want to have fun, even miniature with single witty idea might satisfy him, on the other hand, if the composer wants to be competitive at the international level, make tasks or the most artistic works, he has to improve his skills all the time.
The other point is that the composition often does not run so smoothly as in this demonstration. I have noted above almost all important ideas in the process, but in fact I had a good deal of the good luck (or perhaps my own skills have already prevented me from entering hopeless paths, who knows?). In fact, composing one problem might take anything between a few minutes and many years. On the other hand, one could think about adding further content, making the position more economical, more unified, even in the published problem, many times, including the above diagrammed composition. Anyway, I think this is just enough for one article.
But as I happy user (:-)) of the huge database od chess problems with more than 300 000 compositions included, I have tried to search for composition with the similar scheme as the problem above, if not the same.
Did I find something? Yes, I did.
Problem No. 170
Jakov Rossomacho
1st Prize Moscow Tourney 1990

Mate in 2 moves (7+7)
Jakov Rossomacho has gained 21,5 points in FIDE Albums , so he is no beginner. Quite opposite, unlike myself, he is twomovers expert. That is probably the reason for his much superior resolving of technical difficulties I have been tackling above. His position has clearly the same basic idea as mine. I believe you would be able to solve it without any problems...
P.S. The diagram from the perex, marking all chess composition posts in my blog, is in fact my very first published problem. It is twomover too, much simpler than that composed today. :-)