The Laws of Designing and Building Sukkot
סֻכָּה שֶׁהִיא גְבוֹהָה לְמַעְלָה מֵעֶשְׂרִים אַמָּה, פְּסוּלָה. רַבִּי יְהוּדָה מַכְשִׁיר. וְשֶׁאֵינָהּ גְּבוֹהָה עֲשָׂרָה טְפָחִים, וְשֶׁאֵין לָהּ שְׁלֹשָׁה דְּפָנוֹת, וְשֶׁחַמָּתָהּ מְרֻבָּה מִצִּלָּתָהּ, פְּסוּלָה. סֻכָּה יְשָׁנָה, בֵּית שַׁמַּאי פּוֹסְלִין, וּבֵית הִלֵּל מַכְשִׁירִין. וְאֵיזוֹ הִיא סֻכָּה יְשָׁנָה, כָּל שֶׁעֲשָׂאָהּ קֹדֶם לֶחָג שְׁלשִׁים יוֹם. אֲבָל אִם עֲשָׂאָהּ לְשֵׁם חָג, אֲפִלּוּ מִתְּחִלַּת הַשָּׁנָה, כְּשֵׁרָה:
A sukkah taller than twenty cubits is invalid. Rabbi Yehudah validates it. And one which is not ten hand-breadths tall, or does not contain three walls, or whose whose [area of] sun is greater than its shade is invalid. Regarding an old sukkah, Beit Shammai invalidate it, and Beit Hillel validate it. What is an old sukkah? Any [sukkah] which one made it thirty days before the festival. But if one made it for the sake of the festival, even [if he made it] from the beginning of the year, it is valid.
הָעוֹשֶׂה סֻכָּתוֹ תַחַת הָאִילָן, כְּאִלּוּ עֲשָׂאָהּ בְּתוֹךְ הַבָּיִת. סֻכָּה עַל גַּבֵּי סֻכָּה, הָעֶלְיוֹנָה כְשֵׁרָה, וְהַתַּחְתּוֹנָה פְּסוּלָה. רַבִּי יְהוּדָה אוֹמֵר, אִם אֵין דִּיּוּרִין בָּעֶלְיוֹנָה, הַתַּחְתּוֹנָה כְּשֵׁרָה:
One who makes his sukkah beneath a tree, it is as though he made it inside a house [and is thus invalid]. Regarding a sukkah on top of a sukkah, the top one is valid, and the bottom one invalid. Rabbi Yehudah says: if there is no lodging in the top one, the bottom one is valid.
הִדְלָה עָלֶיהָ אֶת הַגֶּפֶן וְאֶת הַדְּלַעַת וְאֶת הַקִּסּוֹם וְסִכֵּךְ עַל גַּבָּהּ, פְּסוּלָה. וְאִם הָיָה סִכּוּךְ הַרְבֵּה מֵהֶן, אוֹ שֶׁקְּצָצָן, כְּשֵׁרָה. זֶה הַכְּלָל, כֹּל שֶׁהוּא מְקַבֵּל טֻמְאָה וְאֵין גִּדּוּלוֹ מִן הָאָרֶץ, אֵין מְסַכְּכִין בּוֹ. וְכָל דָּבָר שֶׁאֵינוֹ מְקַבֵּל טֻמְאָה וְגִדּוּלוֹ מִן הָאָרֶץ, מְסַכְּכִין בּוֹ:
If one raised a grapevine, a gourd, or and ivy upon it, and placed the sekhakh [the leafy roof covering of a sukkah] on top of it, it is invalid. But if there was a greater amount of sekhakh than them, or if one trimmed them [the plants, such that they were not longer attached], it is valid. This is the rule: anything that can be rendered impure or does not grow from the ground cannot be used for sekhakh; and anything that cannot be rendered impure and that grows from the ground can be used for sekhakh.
חֲבִילֵי קַשׁ וַחֲבִילֵי עֵצִים וַחֲבִילֵי זְרָדִין, אֵין מְסַכְּכִין בָּהֶן. וְכֻלָּן שֶׁהִתִּירָן, כְּשֵׁרוֹת. וְכֻלָּן כְּשֵׁרוֹת לַדְּפָנוֹת:
Bundles of straw, bundles of wood, or bundles of shoots may not be used for sekhakh. And all of them, if they are untied [from their bundles], are valid. And they are all valid for use as walls [of a sukkah].
מְסַכְּכִין בִּנְסָרִים, דִּבְרֵי רַבִּי יְהוּדָה. וְרַבִּי מֵאִיר אוֹסֵר. נָתַן עָלֶיהָ נֶסֶר שֶׁהוּא רָחָב אַרְבָּעָה טְפָחִים, כְּשֵׁרָה, וּבִלְבַד שֶׁלֹא יִישַׁן תַּחְתָּיו:
One may use [wooden] planks for sekhakh, according to Rabbi Yehudah. And Rabbi Meir forbids it. If one placed a plank four hand-breadths wide on top [of his sukkah], it is valid, as long as one does not sleep directly beneath it.
הַמְקָרֶה סֻכָּתוֹ בְשַׁפּוּדִין אוֹ בַאֲרֻכּוֹת הַמִּטָּה, אִם יֵשׁ רֶוַח בֵּינֵיהֶן כְּמוֹתָן, כְּשֵׁרָה. הַחוֹטֵט בְּגָדִישׁ לַעֲשׂוֹת בּוֹ סֻכָּה, אֵינָהּ סֻכָּה:
One who covers the top of his sukkah with spits or bed slats, if there is space between them as wide as they are [and that space is then filled with valid sekhakh], it is valid. If one digs out a haystack to make a sukkah in it, it is not a [valid] sukkah.
הַמְשַׁלְשֵׁל דְּפָנוֹת מִלְמַעְלָה לְמַטָּה, אִם גָּבוֹהַּ מִן הָאָרֶץ שְׁלֹשָׁה טְפָחִים, פְּסוּלָה. מִלְּמַטָּה לְמַעְלָה, אִם גָּבוֹהַּ מִן הָאָרֶץ עֲשָׂרָה טְפָחִים, כְּשֵׁרָה. רַבִּי יוֹסֵי אוֹמֵר, כְּשֵׁם שֶׁמִּלְּמַטָּה לְמַעְלָה עֲשָׂרָה טְפָחִים, כָּךְ מִלְמַעְלָה לְמַטָּה עֲשָׂרָה טְפָחִים. הִרְחִיק אֶת הַסִּכּוּךְ מִן הַדְּפָנוֹת שְׁלשָׁה טְפָחִים, פְּסוּלָה:
If [in constructing one's sukkah] one lowers the walls from the top down, if it [the wall] remains three hand-breaths above the ground, it is invalid. If [one raises the walls] from the bottom up, if it rises ten hand-breadths above the ground, it is valid [regardless of any gap between it and the sekhakh]. Rabbi Yose says: just as [a wall built] from the bottom up is [valid provided it has a height of] ten hand-breadths, so too [a wall built] from the top down is [valid provided it has a height of] ten hand-breadths. If one distanced the sekhakh material three hand-breadths from the wall [leaving a gap of at least that size], it is invalid.
הָעוֹשֶׂה סֻכָּתוֹ כְּמִין צְרִיף, אוֹ שֶׁסְּמָכָהּ לְכֹתֶל, רַבִּי אֱלִיעֶזֶר פּוֹסֵל, מִפְּנֵי שֶׁאֵין לָהּ גָּג, וַחֲכָמִים מַכְשִׁירִין. מַחְצֶלֶת קָנִים גְּדוֹלָה, עֲשָׂאָהּ לִשְׁכִיבָה, מְקַבֶּלֶת טֻמְאָה וְאֵין מְסַכְּכִין בָּהּ. לְסִכּוּךְ, מְסַכְּכִין בָּהּ וְאֵינָהּ מְקַבֶּלֶת טֻמְאָה. רַבִּי אֱלִיעֶזֶר אוֹמֵר, אַחַת קְטַנָּה וְאַחַת גְּדוֹלָה, עֲשָׂאָהּ לִשְׁכִיבָה, מְקַבֶּלֶת טֻמְאָה וְאֵין מְסַכְּכִין בָּהּ. לְסִכּוּךְ, מְסַכְּכִין בָּהּ וְאֵינָהּ מְקַבֶּלֶת טֻמְאָה:
If one makes his sukkah like a shed [i.e. with a sloping roof that meets at a line], or leaned it against a wall, Rabbi Eliezer invalidates [both] because it has no roof, and the Sages validate [them]. Regarding a large reed mat, if one made it for lying upon, it may be rendered impure and it cannot be used as sekhakh; if [one made it] for use as sekhakh, it may be used as sekhakh and it cannot be rendered impure. Rabbi Eliezer says: whether it is small or large, if one made it for lying upon, it may be rendered impure and it cannot be used as sekhakh; if [one made it] for use as sekhakh, it may be used as sekhakh and it cannot be rendered impure.
מתני׳ העושה סוכתו בראש העגלה או בראש הספינה כשרה ועולין לה ביום טוב בראש האילן או על גבי גמל כשרה ואין עולין לה בי"ט
Mishnah 1) One who makes his sukkah on the top of a wagon, or on the deck of a ship, it is valid and one may go up into it on the festival. 2) If he made it on the top of a tree, or on the back of a camel, it is valid, but one may not go up into it on the festival.
או על גבי גמל כו': מתני' מני רבי מאיר היא דתניא העושה סוכתו על גבי בהמה ר"מ מכשיר ורבי יהודה פוסל מ"ט דרבי יהודה אמר קרא (דברים טז, יג) חג הסוכות תעשה לך שבעת ימים סוכה הראויה לשבעה שמה סוכה סוכה שאינה ראויה לשבעה לא שמה סוכה
Or on the back of a camel etc. According to whom is [this part of] our Mishnah? According to R. Meir, as it has been taught, If he makes his Sukkah upon the back of an animal, R. Meir declares it valid and R. Judah invalid. What is the reasoning of R. Judah? Scripture says, "You shall keep the festival of Sukkot for seven days:" a Sukkah which is suitable for seven days is called a Sukkah; if it is unsuitable for seven days it is not called a Sukkah.
עשאה לבהמה דופן לסוכה ר"מ פוסל ור' יהודה מכשיר שהיה רבי מאיר אומר כל דבר שיש בו רוח חיים אין עושין אותו לא דופן לסוכה ולא לחי למבוי ולא פסין לביראות ולא גולל לקבר משום רבי יוסי הגלילי אמרו אף אין כותבין עליו גיטי נשים
If he used an animal as a wall of the Sukkah: R. Meir declares it invalid and R. Judah valid, for R. Meir used to say, Whatever contains the breath of life cannot be used as a wall for a Sukkah, nor a side-post for an alley nor boards around wells, nor a covering stone for a grave n the name of R. Yose the Galilean they said, Nor may a get be written upon it.
מ"ט דר' מאיר אביי אמר שמא תמות רבי זירא אמר שמא תברח בפיל קשור כולי עלמא לא פליגי דאי נמי מיית יש בנבלתו י' כי פליגי בפיל שאינו קשור למאן דאמר שמא תמות לא חיישינן למאן דאמר גזרה שמא תברח חיישינן

What is the reason of R. Meir? Abaye said: Lest it die. R. Zera said: Lest it escape. Concerning an elephant securely bound, all agree [that the Sukkah is valid], since even if it dies, there is still ten [handbreadths height] in its carcass. Regarding what then do they dispute? Regarding an elephant which is not tied up. According to the one who says: Lest it die, we are not concerned; According to him who says, We fear lest it escape, we are concerned.

מתני׳ סוכה שהיא גבוהה למעלה מעשרים אמה פסולה ורבי יהודה מכשיר
Mishnah: A sukkah that is taller than twenty amos is invalid. Rabbi Yehudah permits it.
ושאינה גבוהה עשרה טפחים ושאין לה (שלשה) דפנות ושחמתה מרובה מצלתה פסולה:
Or if it is less than ten tefachim tall, or if it does not have (three) walls, or if it has more sunlight than shade, it is invalid.
מתני׳ העושה סוכתו כמין צריף או שסמכה לכותל ר' אליעזר פוסל מפני שאין לה גג וחכמים מכשירין:
Mishnah: One who makes his sukkah like a cone-shaped hut or leans it against a wall: Rabbi Eliezer invalidates it since it has no roof, But the sages declare it valid.

יכול לעשות מחבירו דופן לסוכה להכשירה ואפילו ביום טוב ובלבד שלא ידע אותו שהועמד שם שבשביל מחיצה הועמד שם אבל בחול אפי' אם הוא יודע שפיר דמי: הגה ואפי' בי"ט אינו אסור אלא באותן ג' דפנות המתירים הסוכה אבל בדופן רביעית שרי (השגת הראב"ד והמגיד פרק ד' דסוכה) וע' לעיל סי' שס"ב סעיף ה':

One can utilize a friend to be a wall of the sukkah and it will be a kosher sukkah. Even on Yom Tov, so long as that person doesn't know they are a sukkah wall (which would violate the prohibition of building on Yom Tov). On the intermediate days, one can know they are the wall, and it is fine.