HDR templates used to create specific mutations or insert new elements into a gene require a certain amount of homology surrounding the target sequence that will be modified. Scientists have been most successful using homology arms that start at the CRISPR-induced DSB; however, there may be some wiggle room. In general, the insertion sites of the modification should be no more than 100bp away from the DSB, ideally less than 10bp away if possible, and the overall length of the homology arm is an important factor to consider when designing these (more on this below). Longer distances of up to 200bp may work, but the efficiency will likely be lower and you may need to introduce a selection marker to ensure the modification is present.
One important point to note is that the CRISPR/Cas9 system does not stop once a DSB is introduced and repaired. As long as the gRNA target site/ PAM site remain intact, the Cas9 endonuclease will keep cutting and the DSB will keep getting repaired through either NHEJ or HDR. This could be problematic if you are trying to introduce a very specific mutation or sequence. To get around this, one may consider designing the HDR template in such a way that will ultimately block further Cas9 targeting after the initial DSB is repaired.
The size of your intended mutation is a big factor in deciding on a single- or double-stranded DNA repair template. Historically plasmids have been used as dsDNA templates when creating gene-targeting vectors; however, ssDNA templates (ssODNs) have come into common use for smaller modifications as they tend to have a higher efficiency. As a basic guideline, small mutations of up to ~50bp or single point mutations can successfully be introduced using ssODN templates, while dsDNA plasmid-based templates should be used for larger inserts such as fluorescent proteins or selection cassettes.
For ssODNs, the templates should be as long as possible with the Cas9-induced break point centered within the template. Scientists have been successful with template lengths of ~100-200bp in total, with at least 40bp (but usually closer to 50-80bp) homology arms on either side of your intended mutation. Because target sequence placement is PAM-dependent, it is not always possible to have the insertion site right next to the cut site; however, they should be reasonably close (within ~20bp) to each other.
For larger inserts, dsDNA encompassing homology arms of 800bp each or larger should be used. Plasmids are the most common source for providing dsDNA targets; however, they will need to be linearized before transfection. This webpage is a great resource for designing a gene targeting vector: http://ko.cwru.edu/info/targvectdesign.html.
Roxane,