The Roommate Agreement

 was written by Sheldon Cooper and was signed by Leonard Hofstadter when they became roommates. These events were shown during a flashback in The Staircase Implementation. Sheldon starts mentioning paragraphs from the Roommate Agreement in the episode The Cooper-Nowitzki Theorem and continues to do so through out the series usually during someone's valiation. Eventually it was revamped to benefit Sheldon better during The Agreement Dissection episode. It was only agreed upon when Sheldon set up a one minute timer which will blackmail Priya Koothrappali in telling her parents about her relationship with Leonard.

Articles of the Roommate Agreement

 * Skynet Clause: Leonard will help Sheldon destroy an artificial intelligence that Sheldon has created that is taking over the earth. (S2 Ep6 )
 * Body Snatchers Clause: Leonard will help Sheldon destroy someone who they know that has been replaced by an alien pod. (S2 Ep6 )
 * Godzilla Clause: Presumably, Leonard will help Sheldon destroy a monster that has destroyed Tokyo. (S2 Ep6 )
 * Article 1, Section C: Sheldon can call for an emergency meeting. (S2 Ep10 )
 * Cohabitation Rider:
 * Provisions that are activated when the term of the Rider is fulfilled:
 * In the refrigerator as opposed to them having two separate shelves and one communal shelf, the three of us now get individual shelves and the door becomes communal.
 * Apartment vacuuming shall be increased from two to three times a week to accommodate the increased accumulation of dead skin cells.
 * The bathroom schedule shall be changed to accommodate the the third person.
 * Terms that must be met to activate the Rider: A girlfriend shall be deemed "living with" Leonard when she has stayed over for (a): ten consecutive nights or (b) more than nine nights in a three week period or (c) all the weekend of a given month plus three weeknights. (S2 Ep10 )
 * Unnamed Clause: Leonard will name Sheldon as his sidekick if Leonard obtains superpowers. (S2 Ep10 )
 * Section 9: The apartment's flag is a gold lion rampant on a field of azure and should never fly upside down,unless the apartment’s in distress (S3 Ep22 )
 * Section 9: If one of the roommates ever invents time travel, the first stop has to aim exactly five seconds after this clause of the Roommate Agreement was signed (S3 Ep22 )
 * Section 8.c: Roommates shall give each other 12 hours notice of impending coitus(S3 Ep22)
 * Section 74c: Leonard must assist Sheldon if he ever becomes a robot (S4 Ep2)

Trivia

 * The Agreement says nothing about regulations when one of them gets a girlfriend, because both never thought it would happen.(S3 Ep15)