In a previous edition of Daily Halacha, we noted that the four Parashiyot of the Tefillin must be written in the sequence in which they appear in the Torah: "Kadesh Li," "Ve’haya Ki Yebi’acha," "Shema," "Ve’haya Im Shamoa." We emphasized that as this cannot be detected once the Tefillin are completed, it is imperative that one purchases Tefillin from a G-d-fearing Sofer who can be trusted to write the Tefillin properly. If the Parashiyot are written in the wrong sequence, the Tefillin are Pasul.
The question arises as to whether this Halacha also applies to Tefillin Rabbenu Tam, which many people have the custom of wearing in addition to the regular Tefillin. In Tefillin Rabbenu Tam, the Parashiyot are arranged differently, with Ve’haya Im Shamoa placed before the section of Shema Yisrael. The sequence is thus "Kadesh Li," "Ve’haya Ki Yebi’acha," "Ve’haya Im Shamoa," "Shema." Must the Sofer write the Parashiyot in this sequence, or must he write them in the sequence in which they appear in the Torah, with "Shema" before "Ve’haya Im Shamoa"? (We refer here specifically to the Tefillin Shel Yad, in which the Parashiyot are all written on a single piece of parchment.)
The Halacha regarding Tefillin Rabbenu Tam is that they, too, must be written in the sequence in which the Parashiyot appear in the Torah. This means that after writing "Kadesh Li" and "Ve’haya Ki Yebi’acha," the Sofer must leave empty space, and then write the Parasha of "Shema." Afterward he goes back and writes "Ve’haya Im Shamoa" in the empty space. This way, the writing is done in the sequence in which the Parashiyot appear in the Torah, but they are arranged on the parchment in the sequence advocated by Rabbenu Tam, whereby the two sections that begin with the word "Ve’haya" are juxtaposed.
Furthermore, all letters and words of the Tefillin must also be written in the proper sequence. If the Sofer completed writing the Tefillin and then realized he forgot a letter, if he goes back to add the missing letter the Tefillin are Pasul, since a letter was written out of order. There is thus no possibility of fixing a parchment of Tefillin which is missing a letter. (This applies to Mezuzot, as well.)
There is a difference of opinion as to whether the Sofer should first write the Shel Yad or the Shel Rosh. The Shulhan Aruch rules that the Sofer should follow the sequence of the Torah’s command of Tefillin, and thus write the Shel Yad before the Shel Rosh ("U’kshartam Le’ot Al Yadecha Ve’hayu Le’totafot Ben Enecha"). The Arizal (Rav Yishak Luria of Safed, 1534-1572), however, in Sha’ar Ha’kavanot, rules that the Shel Rosh should be written first because it has a higher level of sanctity. According to both views, this sequence is not "Me’akeb" – that is, according to all opinions the Tefillin are valid regardless of whether the Shel Rosh or Shel Yad was written first. The other Halachot discussed, however, concerning the sequence of the writing of the text, indeed affect the validity of the Tefillin.
When one goes to a Sofer to purchase Tefillin, he needs to be an "educated consumer," knowing which questions to ask, and one must also know that he can trust that the Sofer is honest and G-d-fearing. As we have seen, Tefillin can look perfectly valid but still be Pasul for the Misva, and we must therefore ensure to purchase Tefillin from an honest and G-d-fearing Sofer. Of course, as the Sages teach, "the Torah was not given to angels," and we have a right to rely on and place our faith in a Sofer, but we must take reasonable measures to ensure that he is trustworthy.
Summary: When a Sofer writes Tefllin Rabbenu Tam, he writes the sections of "Kadesh Li" and "Ve’haya Ki Yebi’acha," and then leaves a blank space and writes "Shema" after the space. Then, he writes "Ve’haya Im Shamoa" in the blank space. All the words and letters of the text must be written in order. There is a difference of opinion as to whether the Shel Yad must be written before the Shel Rosh or vice versa; the Tefillin are valid either way.