That which we learned, the principal categories of labor are forty less one, corresponding to what? Rabbi Chanina said, corresponding to the services of the Sanctuary. Rabbi Shimon ben Yose ben Lakunya said, corresponding to the [occurrences of the word] "labor" in the Torah. Rav Yosef inquired, this verse "And he came into the house to do his work" (Genesis 39:11) - is it counted in the number or not? It was doubtful to him, because it is written (Exodus 36:7), "And the work was sufficient for them," and how so? Like the one who says he entered to attend to his needs, or perhaps "And he came into the house to do his work" is counted, and this "And the work was sufficient" means thus, that the labor was completed for them. Let it stand [unresolved]. It was taught in accordance with the one who says, corresponding to the services of the Sanctuary, for it was taught, one is liable only for a labor that had its like in the Sanctuary. They sowed, you shall not sow; they reaped, you shall not reap; they raised the boards from the ground onto the wagon, you shall not bring in from the public domain to the private domain; they passed the boards from wagon to wagon, you shall not pass from one private domain to another private domain where there is a public domain in between. The laws of Shabbat are like mountains hanging by a hair, for the Torah forbade purposeful labor, and "purposeful labor" is not written concerning the Shabbat.
The Thirty-Nine Labors of Shabbat Drawn From the Mishkan
Yalkut Shimoni on Torah 408:4
הָא דִּתְנַן אֲבוֹת מְלָאכוֹת אַרְבָּעִים חָסֵר אַחַת, כְּנֶגֶד מִי. אֲמַר רַבִּי חֲנִינָא. כְּנֶגֶד עֲבוֹדוֹת הַמִּשְׁכָּן. רַבִּי שִׁמְעוֹן בֶּן יוֹסֵי בֶּן לָקוּנְיָא אֲמַר. כְּנֶגֶד מְלָאכוֹת שֶׁבַּתּוֹרָה. בָּעֵי רַב יוֹסֵף. הַאי "וַיָּבֹא הַבַּיְתָה לַעֲשׂוֹת מְלַאכְתּוֹ", מִמִּנְיָנָא הוּא אוֹ לָא. מִסַּפְּקָא לֵיהּ מִשּׁוּם דִּכְתִיב (שמות לו, ז) "וְהַמְּלָאכָה הָיְתָה דַּיָּם", וְהֵיאַךְ, כְּמַאן דַּאֲמַר לַעֲשׂוֹת צְרָכָיו נִכְנַס, אוֹ דִלְמָא "וַיָּבֹא הַבַּיְתָה לַעֲשׂוֹת מְלַאכְתּוֹ" מִמִּנְיָנָא, וְהַאי "וְהַמְּלָאכָה הָיְתָה דַּיָּם" הָכֵי קָאֲמַר דִּשְׁלִימָא לֵיהּ עֲבִידְתָא. תֵּיקוּ. תַּנְיָא כְּמַאן דַּאֲמַר כְּנֶגֶד עֲבוֹדוֹת הַמִּשְׁכָּן, דְּתַנְיָא, אֵין חַיָּבִין אֶלָּא עַל מְלָאכָה שֶׁכַּיּוֹצֵא בָּהּ הָיְתָה בַמִּשְׁכָּן, הֵם זָרְעוּ, אַתֶּם לֹא תִּזְרְעוּ, הֵם קָצְרוּ, וְאַתֶּם לֹא תִּקְצְרוּ, הֵם הֶעֱלוּ אֶת הַקְּרָשִׁים מִקַּרְקַע לַעֲגָלָה, אַתֶּם לֹא תַכְנִיסוּ מֵרָשׁוּת הָרַבִּים לְרָשׁוּת הַיָּחִיד, הֵם הוֹשִׁיטוּ אֶת הַקְּרָשִׁים מֵעֲגָלָה לַעֲגָלָה, וְאַתֶּם לֹא תוֹשִׁיטוּ מֵרָשׁוּת הַיָּחִיד לְרָשׁוּת הַיָּחִיד הֵיכָא דְּאִיכָּא בָּאֶמְצַע רָשׁוּת הָרַבִּים. הִלְכוֹת שַׁבָּת כַּהֲרָרִין הַתְּלוּיִין בִּשְׂעָרָה, מְלֶאכֶת מַחֲשֶׁבֶת אָסְרָה תוֹרָה וּמְלֶאכֶת מַחֲשֶׁבֶת בְּשַׁבָּת לָא כְתִיבָא. שֵׁשֶׁת יָמִים תֵּעָשֶׂה מְלָאכָה. וּבַיּוֹם הַשְּׁבִיעִי יִהְיֶה לָכֶם קֹדֶשׁ. לֹא יְהוּ יִשְׂרָאֵל אוֹמְרִים, הוֹאִיל וְאָנוּ מֻתָּרִין לַעֲשׂוֹת מְלָאכָה בְּבֵית הַמִּקְדָּשׁ נְהֵא מֻתָּרִין לַעֲשׂוֹת מְלָאכָה בַּגְּבוּלִין, תַּלְמוּד לוֹמַר וּבַיּוֹם הַשְּׁבִיעִי יִהְיֶה לָכֶם קֹדֶשׁ, לָכֶם יִהְיֶה קֹדֶשׁ וְלַמָּקוֹם חֹל. כָּל הָעֹשֶׂה בוֹ מְלָאכָה יוּמָת. וְלֹא בּוֹ וּבַחֲבֵרוֹ. וַהֲרֵי שֶׁחָל יוֹם הַכִּפּוּרִים לִהְיוֹת עֶרֶב שַׁבָּת וְעָשָׂה מְלָאכָה בֵּין הַשְּׁמָשׁוֹת, שׁוֹמֵעַ אֲנִי יְהֵא חַיָּב, תַּלְמוּד לוֹמַר (כִּי) כָּל הָעֹשֶׂה בוֹ מְלָאכָה יוּמָת, "בּוֹ" וְלֹא בּוֹ וּבַחֲבֵרוֹ.