This paper presents a wellbore-stability ''design code'' that can be u
sed to drill, complete, and stimulate inclined wells optimally. The de
sign code was developed for the most general case, where the borehole,
in-situ-stress, and rock-property coordinate frames are totally indep
endent of each other, It essentially consists of a 3D linear-elastic-s
tress analysis in anisotropic formations, Although this particular pap
er is limited to tensile failure, on the basis of the minimum-normal-s
tress theory, the numerical model is also able to consider shear failu
re by involving a generalized 3D anisotropic yield criterion. The desi
gn code allows selection of the optimum borehole orientation and wellb
ore-fluid gradient to avoid fracture initiation. It is also useful in
conducting sensitivity studies, particularly when data are scanty. Exe
rcising such a code led to the remarkable finding that fracture initia
tion is strongly dependent on the formation anisotropy, contradicting
current industry thinking.