כִּ֤י תִבְנֶה֙ בַּ֣יִת חָדָ֔שׁ וְעָשִׂ֥יתָ מַעֲקֶ֖ה לְגַגֶּ֑ךָ וְלֹֽא־תָשִׂ֤ים דָּמִים֙ בְּבֵיתֶ֔ךָ כִּֽי־יִפֹּ֥ל הַנֹּפֵ֖ל מִמֶּֽנּוּ׃
When you build a new house, you shall make a parapet for your roof, so that you do not bring bloodguilt on your house if anyone should fall from it.

מצות עשה להסיר כל מכשול שיש בו סכנת נפשות ועשיית מעקה לגגו. ובו י' סעיפים:
מצות עשה לעשות אדם מעקה לגגו, שנא' "ועשית מעקה לגגך". והוא שיהיה בית דירה, אבל בית אוצרות ובית הבקר וכיוצא בהן, אינו זקוק לו:

It is a positive commandment to make a fence on one's roof as it says "and you shall make a fence for your roof". This applies if it is a dwelling place, but a storage house or a cattle house and the like do not require one.

לעשות אדם מעקה. וכתב הרמב"ם פי"א מה' ברכות דצריך לברך אקב"ו לעשות מעקה, ושם כתב דמברך ג"כ שהחיינו ע"ש. אך בספר נשמת אדם כלל ט"ו כתב דהרמב"ם לשיטתו, דכתב דגם על ציצית ותפילין מברכין שהחיינו. אבל למאן דקיי"ל בא"ח סי' כ"ב גבי ציצית דאין מברכין, ה"ה במעקה אין מברכין "שהחיינו" רק "לעשות מעקה" ע"ש...

ועיין בספר מחנה אפרים ה' שלוחין סימן י"א במי שרוצה לעשות מעקה ע"י אומן גוי אי יברך עליו ומצדד שם דשפיר יכול לברך כיון דיד פועל כיד בעה"ב...

דירה. תימא על המחבר! דגבי מזוזה ביו"ד ר"ס רפ"ו סתם וכת' דרפת בקר ולולין ובית אוצרות שמן ויין חייבים במזוזה וכדעת הרי"ף והרא"ש ודלא כהרמב"ם וכמ"ש שם, וכאן במעקה סתם דאינן חייבין במעקה ודין מעקה נלמד מדין מזוזה וכמ"ש הכ"מ. ונראה דהמחבר הכריע וס"ל דלענין מעקה כיון דאין דרך בני אדם להיות להן בית תשמיש ע"ג בית הבקר ובית האוצר ובית העצים מש"ה אף אם לפעמים יקרה דידור שם אדם מ"מ אין שם יוצאים ונכנסים כל כך למיחש שיפול משם ולהצטרך מעקה. משא"כ במזוזה דחייבה התורה בשביל הדר להיות מצות ה' נגד עיניו בביאתו וביציאתו בזה פסק דהדר שם צריך לקבוע מזוזה באותו פתח עכ"ל הסמ"ע:

כל בית שאין בו ד' אמות על ד' אמות פטור ממעקה:
Any house that is not at least 4 cubits by 4 cubits is exempt from making a fence.

בית של שני שותפים חייבים במעקה שנאמר "כי יפול הנופל ממנו", לא תלה אלא בנופל. א"כ למה נאמר "גגך"? למעט בתי כנסיות ובתי מדרשות, לפי שאינם עשוים לדירה:

A house of two partners is obligated to have a fence around its roof, as it says “lest any one fall from it”. This is applicable whenever someone is liable to fall. If so, why does it say “your roof”? To exclude synagogues and study halls, since they are not made for residence.

היתה רשות הרבים גבוה מגגו, אינו זקוק למעקה, שנאמר "כי יפול הנופל ממנו":

If a public road is higher than the roof, a fence is not required. As it says: "lest the one who falls will fall from it".

גובה המעקה אין פחות מי' טפחים, כדי שלא יפול ממנו הנופל. וצריך להיות המחיצה חזקה כדי שישען אדם עליה ולא תפול:

The fence must not be shorter than ten handbreadths so that one will not fall from the roof, and the fence must be strong so that a man can lean on it and will not fall.

כל המניח גגו בלא מעקה ביטל מצות עשה, ועבר על לא תעשה, שנא' "ולא תשים דמים בביתך":

All that do not build a fence on their roof violates a positive commandment and a negative commandment. As it says, "do not place blood in your home".

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

Both a roof or anything dangerous where it's probable that someone will stumble upon and fall, for example if there was a well or a hole in his yard, whether there is water in it or not, one is obligated to make an embankment ten-handbreadths high, or to cover it, lest a person fall into it and die.

וכן כל מכשול שיש בו סכנת נפשות, מצות עשה להסירו ולהשמר ממנו ולהזהר בדבר יפה, שנאמר "השמר לך ושמור נפשך". ואם לא הסיר, והניח המכשולות המביאים לידי סכנה, ביטל מצות עשה ועובר ב"לא תשים דמים":

Likewise, one has a positive duty to remove and guard oneself of any life-threatening obstacle, as it is said "beware and guard your soul". If one did not removed said obstacles, one has cancelled a positive commandment and transgressed "do not bring bloodguilt" (Deut. 22:8).

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

The sages prohibited many things because of danger to a person. And some of them are explained in the Tur. Additionally, there are other things and these are they: A person must never put his mouth to a pipe spouting water and drink; he must not drink from rivers or ponds at night, for fear that he might swallow a leech without seeing. Rama: I have already written these in Shulchan Arukh, Yoreh De'ah 116:5

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

One must refrain from putting coins in one's mouth, lest it's covered with dried saliva of those afflicted with boils. He should not put the palm of his hand in his arm pit, lest his hand touched a metzorah or a harmful poison. He should not put a loaf of bread under his armpit, because of the sweat. He should not put a cooked item or drinks under the bed, since an evil spirit rests on them. He should not stick a knife in an esrog or a radish, lest one fall on its edge and die. Hagah: Similarly, he should be careful of all things that cause danger, because danger is stricter than transgressions, and one should be more careful with an uncertain danger than with an uncertain issur. They also prohibited to go in a dangerous place, such as under a leaning wall, or alone at night. They also prohibited to drink water from rivers at night or to put one's mouth on a stream of water and drink, because these matters have a concern of danger. It is the widespread custom not to drink water during the equinox, and the early ones wrote this and it is not to be changed. They also wrote to flee from the city when a plague is in the city, and one should leave at the beginning of the plague and not at the end. And all of these things are because of the danger, and a person who guards his soul will distance himself from them and it is prohibited to rely on a miracle in all of these matters.

כל העובר על דברים אלו וכיוצא בהם, ואמר "הריני מסכן בעצמי ומה לאחרים עלי בכך?" או "איני מקפיד בכך", מכין אותו מכת מרדות. והנזהר מהם, עליו תבא ברכת טוב :