The so-called "ruki-rule" is a phonological change that affected the Indo-Iranian and Balto-Slavic branches. After *r *u *k or *i, the sibilant *s became Skt. ṣ and Av. š. In Slavic, *s became the voiceless velar fricative x. Baltic shows a similar development as Avestan, but the change doesn't appear to have spread throughout the whole language.
*r *u and *k are articulated in the back of the mouth and therefore caused *s to be articulated further back (for example, retroflex ṣ in Sanskrit). However, I am not sure why the front vowel *i would also cause such a change. The vowels *i and *u form a natural class in that they are both high vowels, so this seems to be the conditioning factor--not necessarily whether the vowel was front or back. In broader terms, the ruki-rule is simply an assimilatory process (see Wackernagel, Bd. 1, section 203).
In certain environments, however--such as at the seam of a compound, the seam of a verb and its prefix, reduplicated verbs with the sibilant, etc.--this change was not obligatory. Such is the case with the word bodhisattva-, where the s is not changed into a retroflex as we would expect if the ruki-rule were to be strictly applied. The processes underlying the ruki-rule and its exceptions are quite complex and probably deserve a more in-depth look. Wackernagel's treatment in section 203 is the most thorough explanation that I am aware of.
I plan on writing more about the behavior of s in later posts.
7 hours ago