Skip to content

Instantly share code, notes, and snippets.

@hrishioa
Created August 13, 2023 22:02
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hrishioa/e375af7adacad05b5fb5c26b20d77a65 to your computer and use it in GitHub Desktop.
Save hrishioa/e375af7adacad05b5fb5c26b20d77a65 to your computer and use it in GitHub Desktop.
Contextual Decomposition Prompts and Examples
// Hrishi Olickel, 14 Aug 2023.
// Simple example and prompt template for context decomposition, described here:
// https://twitter.com/hrishioa/status/1690453115471040512
const applyContextDecomp = {
systemPrompt: (documentPurpose: string, documentContent: string) => `You are converting a document into a simpler, intermediate step that can be used by someone else to derive an answer.
DOCUMENT_PURPOSE:
"""
${documentPurpose}
"""
DOCUMENT:
"""
${documentContent}
"""`,
userPrompt: (goal: string, intermediateDesc: string) => `GOAL:
"""
${goal}
"""
INTERMEDIATE_FORMAT:
"""
${intermediateDesc}
"""
Convert DOCUMENT into an intermediate, simplified form specifying only the information from DOCUMENT needed to achieve GOAL. Remove anything that isn't relevant.`
}
const SAFE_EXAMPLE_MESSAGES = [
{
"role": "system",
"content": "You are converting a document into a simpler, intermediate step that can be used by someone else to derive an answer.\n\nDOCUMENT_PURPOSE:\n\"\"\"\nSimple agreement for future equity, governing the rules of investment through a convertible note\n\"\"\"\n\nDOCUMENT:\n\"\"\"\nTHIS INSTRUMENT AND ANY SECURITIES ISSUABLE PURSUANT HERETO HAVE NOT BEEN REGISTERED UNDER THE SECURITIES ACT OF 1933, AS AMENDED (THE “SECURITIES ACT”), OR UNDER THE SECURITIES LAWS OF CERTAIN STATES. THESE SECURITIES MAY NOT BE OFFERED, SOLD OR OTHERWISE TRANSFERRED, PLEDGED OR HYPOTHECATED EXCEPT AS PERMITTED IN THIS SAFE AND UNDER THE ACT AND APPLICABLE STATE SECURITIES LAWS PURSUANT TO AN EFFECTIVE REGISTRATION STATEMENT OR AN EXEMPTION THEREFROM. \n\n[COMPANY NAME]\n\nSAFE \n(Simple Agreement for Future Equity)\nTHIS CERTIFIES THAT in exchange for the payment by [Investor Name] (the “Investor”) of $[_____________] (the “Purchase Amount”) on or about [Date of Safe], [Company Name], a [State of Incorporation] corporation (the “Company”), issues to the Investor the right to certain shares of the Company’s Capital Stock, subject to the terms described below.\nThis Safe is one of the forms available at http://ycombinator.com/documents and the Company and the Investor agree that neither one has modified the form, except to fill in blanks and bracketed terms. \nThe “Post-Money Valuation Cap” is $[_____________]. See Section 2 for certain additional defined terms.\n1.\tEvents\n\t(a)\tEquity Financing. If there is an Equity Financing before the termination of this Safe, on the initial closing of such Equity Financing, this Safe will automatically convert into the greater of: (1) the number of shares of Standard Preferred Stock equal to the Purchase Amount divided by the lowest price per share of the Standard Preferred Stock; or (2) the number of shares of Safe Preferred Stock equal to the Purchase Amount divided by the Safe Price. \n\tIn connection with the automatic conversion of this Safe into shares of Standard Preferred Stock or Safe Preferred Stock, the Investor will execute and deliver to the Company all of the transaction documents related to the Equity Financing; provided, that such documents (i) are the same documents to be entered into with the purchasers of Standard Preferred Stock, with appropriate variations for the Safe Preferred Stock if applicable, and (ii) have customary exceptions to any drag-along applicable to the Investor, including (without limitation) limited representations, warranties, liability and indemnification obligations for the Investor.\n\t(b)\tLiquidity Event. If there is a Liquidity Event before the termination of this Safe, the Investor will automatically be entitled (subject to the liquidation priority set forth in Section 1(d) below) to receive a portion of Proceeds, due and payable to the Investor immediately prior to, or concurrent with, the consummation of such Liquidity Event, equal to the greater of (i) the Purchase Amount (the “Cash-Out Amount”) or (ii) the amount payable on the number of shares of Common Stock equal to the Purchase Amount divided by the Liquidity Price (the “Conversion Amount”). If any of the Company’s securityholders are given a choice as to the form and amount of Proceeds to be received in a Liquidity Event, the Investor will be given the same choice, provided that the Investor may not choose to receive a form of consideration that the Investor would be ineligible to receive as a result of the Investor’s failure to satisfy any requirement or limitation generally applicable to the Company’s securityholders, or under any applicable laws.\n\tNotwithstanding the foregoing, in connection with a Change of Control intended to qualify as a tax-free reorganization, the Company may reduce the cash portion of Proceeds payable to the Investor by the amount determined by its board of directors in good faith for such Change of Control to qualify as a tax-free reorganization for U.S. federal income tax purposes, provided that such reduction (A) does not reduce the total Proceeds payable to such Investor and (B) is applied in the same manner and on a pro rata basis to all securityholders who have equal priority to the Investor under Section 1(d).\n\t(c)\tDissolution Event. If there is a Dissolution Event before the termination of this Safe, the Investor will automatically be entitled (subject to the liquidation priority set forth in Section 1(d) below) to receive a portion of Proceeds equal to the Cash-Out Amount, due and payable to the Investor immediately prior to the consummation of the Dissolution Event. \n(d)\tLiquidation Priority. In a Liquidity Event or Dissolution Event, this Safe is intended to operate like standard non-participating Preferred Stock. The Investor’s right to receive its Cash-Out Amount is:\n(i)\tJunior to payment of outstanding indebtedness and creditor claims, including contractual claims for payment and convertible promissory notes (to the extent such convertible promissory notes are not actually or notionally converted into Capital Stock);\n(ii)\tOn par with payments for other Safes and/or Preferred Stock, and if the applicable Proceeds are insufficient to permit full payments to the Investor and such other Safes and/or Preferred Stock, the applicable Proceeds will be distributed pro rata to the Investor and such other Safes and/or Preferred Stock in proportion to the full payments that would otherwise be due; and \n(iii)\tSenior to payments for Common Stock.\nThe Investor’s right to receive its Conversion Amount is (A) on par with payments for Common Stock and other Safes and/or Preferred Stock who are also receiving Conversion Amounts or Proceeds on a similar as-converted to Common Stock basis, and (B) junior to payments described in clauses (i) and (ii) above (in the latter case, to the extent such payments are Cash-Out Amounts or similar liquidation preferences). \n(e)\tTermination. This Safe will automatically terminate (without relieving the Company of any obligations arising from a prior breach of or non-compliance with this Safe) immediately following the earliest to occur of: (i) the issuance of Capital Stock to the Investor pursuant to the automatic conversion of this Safe under Section 1(a); or (ii) the payment, or setting aside for payment, of amounts due the Investor pursuant to Section 1(b) or Section 1(c).\n2.\tDefinitions\n\t“Capital Stock” means the capital stock of the Company, including, without limitation, the “Common Stock” and the “Preferred Stock.” \n\t“Change of Control” means (i) a transaction or series of related transactions in which any “person” or “group” (within the meaning of Section 13(d) and 14(d) of the Securities Exchange Act of 1934, as amended), becomes the “beneficial owner” (as defined in Rule 13d-3 under the Securities Exchange Act of 1934, as amended), directly or indirectly, of more than 50% of the outstanding voting securities of the Company having the right to vote for the election of members of the Company’s board of directors, (ii) any reorganization, merger or consolidation of the Company, other than a transaction or series of related transactions in which the holders of the voting securities of the Company outstanding immediately prior to such transaction or series of related transactions retain, immediately after such transaction or series of related transactions, at least a majority of the total voting power represented by the outstanding voting securities of the Company or such other surviving or resulting entity or (iii) a sale, lease or other disposition of all or substantially all of the assets of the Company.\n“Company Capitalization” is calculated as of immediately prior to the Equity Financing and (without double-counting, in each case calculated on an as-converted to Common Stock basis):\n•\tIncludes all shares of Capital Stock issued and outstanding;\n•\tIncludes all Converting Securities;\n•\tIncludes all (i) issued and outstanding Options and (ii) Promised Options; and\n•\tIncludes the Unissued Option Pool, except that any increase to the Unissued Option Pool in connection with the Equity Financing will only be included to the extent that the number of Promised Options exceeds the Unissued Option Pool prior to such increase.\n“Converting Securities” includes this Safe and other convertible securities issued by the Company, including but not limited to: (i) other Safes; (ii) convertible promissory notes and other convertible debt instruments; and (iii) convertible securities that have the right to convert into shares of Capital Stock. \n\t“Direct Listing” means the Company’s initial listing of its Common Stock (other than shares of Common Stock not eligible for resale under Rule 144 under the Securities Act) on a national securities exchange by means of an effective registration statement on Form S-1 filed by the Company with the SEC that registers shares of existing capital stock of the Company for resale, as approved by the Company’s board of directors. For the avoidance of doubt, a Direct Listing will not be deemed to be an underwritten offering and will not involve any underwriting services. \n\t“Dissolution Event” means (i) a voluntary termination of operations, (ii) a general assignment for the benefit of the Company’s creditors or (iii) any other liquidation, dissolution or winding up of the Company (excluding a Liquidity Event), whether voluntary or involuntary.\n\t“Dividend Amount” means, with respect to any date on which the Company pays a dividend on its outstanding Common Stock, the amount of such dividend that is paid per share of Common Stock multiplied by (x) the Purchase Amount divided by (y) the Liquidity Price (treating the dividend date as a Liquidity Event solely for purposes of calculating such Liquidity Price).\n\t“Equity Financing” means a bona fide transaction or series of transactions with the principal purpose of raising capital, pursuant to which the Company issues and sells Preferred Stock at a fixed valuation, including but not limited to, a pre-money or post-money valuation.\n\t“Initial Public Offering” means the closing of the Company’s first firm commitment underwritten initial public offering of Common Stock pursuant to a registration statement filed under the Securities Act.\n\t“Liquidity Capitalization” is calculated as of immediately prior to the Liquidity Event, and (without double- counting, in each case calculated on an as-converted to Common Stock basis): \n•\tIncludes all shares of Capital Stock issued and outstanding;\n•\tIncludes all (i) issued and outstanding Options and (ii) to the extent receiving Proceeds, Promised Options;\n•\tIncludes all Converting Securities, other than any Safes and other convertible securities (including without limitation shares of Preferred Stock) where the holders of such securities are receiving Cash-Out Amounts or similar liquidation preference payments in lieu of Conversion Amounts or similar “as-converted” payments; and\n•\tExcludes the Unissued Option Pool.\n\n\t“Liquidity Event” means a Change of Control, a Direct Listing or an Initial Public Offering.\n\t“Liquidity Price” means the price per share equal to the Post-Money Valuation Cap divided by the Liquidity Capitalization.\t\n\t“Options” includes options, restricted stock awards or purchases, RSUs, SARs, warrants or similar securities, vested or unvested.\n“Proceeds” means cash and other assets (including without limitation stock consideration) that are proceeds from the Liquidity Event or the Dissolution Event, as applicable, and legally available for distribution. \n“Promised Options” means promised but ungranted Options that are the greater of those (i) promised pursuant to agreements or understandings made prior to the execution of, or in connection with, the term sheet or letter of intent for the Equity Financing or Liquidity Event, as applicable (or the initial closing of the Equity Financing or consummation of the Liquidity Event, if there is no term sheet or letter of intent), (ii) in the case of an Equity Financing, treated as outstanding Options in the calculation of the Standard Preferred Stock’s price per share, or (iii) in the case of a Liquidity Event, treated as outstanding Options in the calculation of the distribution of the Proceeds.\n\t“Safe” means an instrument containing a future right to shares of Capital Stock, similar in form and content to this instrument, purchased by investors for the purpose of funding the Company’s business operations. References to “this Safe” mean this specific instrument. \n\t“Safe Preferred Stock” means the shares of the series of Preferred Stock issued to the Investor in an Equity Financing, having the identical rights, privileges, preferences, seniority, liquidation multiple and restrictions as the shares of Standard Preferred Stock, except that any price-based preferences (such as the per share liquidation amount, initial conversion price and per share dividend amount) will be based on the Safe Price. \n\t“Safe Price” means the price per share equal to the Post-Money Valuation Cap divided by the Company Capitalization.\n\t“Standard Preferred Stock” means the shares of the series of Preferred Stock issued to the investors investing new money in the Company in connection with the initial closing of the Equity Financing.\n\t“Unissued Option Pool” means all shares of Capital Stock that are reserved, available for future grant and not subject to any outstanding Options or Promised Options (but in the case of a Liquidity Event, only to the extent Proceeds are payable on such Promised Options) under any equity incentive or similar Company plan.\n3.\tCompany Representations\n\t(a)\tThe Company is a corporation duly organized, validly existing and in good standing under the laws of its state of incorporation, and has the power and authority to own, lease and operate its properties and carry on its business as now conducted.\n\t(b)\tThe execution, delivery and performance by the Company of this Safe is within the power of the Company and has been duly authorized by all necessary actions on the part of the Company (subject to section 3(d)). This Safe constitutes a legal, valid and binding obligation of the Company, enforceable against the Company in accordance with its terms, except as limited by bankruptcy, insolvency or other laws of general application relating to or affecting the enforcement of creditors’ rights generally and general principles of equity. To its knowledge, the Company is not in violation of (i) its current certificate of incorporation or bylaws, (ii) any material statute, rule or regulation applicable to the Company or (iii) any material debt or contract to which the Company is a party or by which it is bound, where, in each case, such violation or default, individually, or together with all such violations or defaults, could reasonably be expected to have a material adverse effect on the Company.\n\t(c)\tThe performance and consummation of the transactions contemplated by this Safe do not and will not: (i) violate any material judgment, statute, rule or regulation applicable to the Company; (ii) result in the acceleration of any material debt or contract to which the Company is a party or by which it is bound; or (iii) result in the creation or imposition of any lien on any property, asset or revenue of the Company or the suspension, forfeiture, or nonrenewal of any material permit, license or authorization applicable to the Company, its business or operations.\n\t(d)\tNo consents or approvals are required in connection with the performance of this Safe, other than: (i) the Company’s corporate approvals; (ii) any qualifications or filings under applicable securities laws; and (iii) necessary corporate approvals for the authorization of Capital Stock issuable pursuant to Section 1.\n\t(e)\tTo its knowledge, the Company owns or possesses (or can obtain on commercially reasonable terms) sufficient legal rights to all patents, trademarks, service marks, trade names, copyrights, trade secrets, licenses, information, processes and other intellectual property rights necessary for its business as now conducted and as currently proposed to be conducted, without any conflict with, or infringement of the rights of, others.\n4.\tInvestor Representations\n\t(a)\tThe Investor has full legal capacity, power and authority to execute and deliver this Safe and to perform its obligations hereunder. This Safe constitutes a valid and binding obligation of the Investor, enforceable in accordance with its terms, except as limited by bankruptcy, insolvency or other laws of general application relating to or affecting the enforcement of creditors’ rights generally and general principles of equity.\n\t(b)\tThe Investor is an accredited investor as such term is defined in Rule 501 of Regulation D under the Securities Act, and acknowledges and agrees that if not an accredited investor at the time of an Equity Financing, the Company may void this Safe and return the Purchase Amount. The Investor has been advised that this Safe and the underlying securities have not been registered under the Securities Act, or any state securities laws and, therefore, cannot be resold unless they are registered under the Securities Act and applicable state securities laws or unless an exemption from such registration requirements is available. The Investor is purchasing this Safe and the securities to be acquired by the Investor hereunder for its own account for investment, not as a nominee or agent, and not with a view to, or for resale in connection with, the distribution thereof, and the Investor has no present intention of selling, granting any participation in, or otherwise distributing the same. The Investor has such knowledge and experience in financial and business matters that the Investor is capable of evaluating the merits and risks of such investment, is able to incur a complete loss of such investment without impairing the Investor’s financial condition and is able to bear the economic risk of such investment for an indefinite period of time. \n5.\tMiscellaneous\n\t(a)\tAny provision of this Safe may be amended, waived or modified by written consent of the Company and either (i) the Investor or (ii) the majority-in-interest of all then-outstanding Safes with the same “Post-Money Valuation Cap” and “Discount Rate” as this Safe (and Safes lacking one or both of such terms will be considered to be the same with respect to such term(s)), provided that with respect to clause (ii): (A) the Purchase Amount may not be amended, waived or modified in this manner, (B) the consent of the Investor and each holder of such Safes must be solicited (even if not obtained), and (C) such amendment, waiver or modification treats all such holders in the same manner. “Majority-in-interest” refers to the holders of the applicable group of Safes whose Safes have a total Purchase Amount greater than 50% of the total Purchase Amount of all of such applicable group of Safes.\n\t(b)\tAny notice required or permitted by this Safe will be deemed sufficient when delivered personally or by overnight courier or sent by email to the relevant address listed on the signature page, or 48 hours after being deposited in the U.S. mail as certified or registered mail with postage prepaid, addressed to the party to be notified at such party’s address listed on the signature page, as subsequently modified by written notice.\n\t(c)\tThe Investor is not entitled, as a holder of this Safe, to vote or be deemed a holder of Capital Stock for any purpose other than tax purposes, nor will anything in this Safe be construed to confer on the Investor, as such, any rights of a Company stockholder or rights to vote for the election of directors or on any matter submitted to Company stockholders, or to give or withhold consent to any corporate action or to receive notice of meetings, until shares have been issued on the terms described in Section 1. However, if the Company pays a dividend on outstanding shares of Common Stock (that is not payable in shares of Common Stock) while this Safe is outstanding, the Company will pay the Dividend Amount to the Investor at the same time.\n\t(d)\tNeither this Safe nor the rights in this Safe are transferable or assignable, by operation of law or otherwise, by either party without the prior written consent of the other; provided, however, that this Safe and/or its rights may be assigned without the Company’s consent by the Investor (i) to the Investor’s estate, heirs, executors, administrators, guardians and/or successors in the event of Investor’s death or disability, or (ii) to any other entity who directly or indirectly, controls, is controlled by or is under common control with the Investor, including, without limitation, any general partner, managing member, officer or director of the Investor, or any venture capital fund now or hereafter existing which is controlled by one or more general partners or managing members of, or shares the same management company with, the Investor.\n\t(e)\tIn the event any one or more of the provisions of this Safe is for any reason held to be invalid, illegal or unenforceable, in whole or in part or in any respect, or in the event that any one or more of the provisions of this Safe operate or would prospectively operate to invalidate this Safe, then and in any such event, such provision(s) only will be deemed null and void and will not affect any other provision of this Safe and the remaining provisions of this Safe will remain operative and in full force and effect and will not be affected, prejudiced, or disturbed thereby.\n\t(f)\tAll rights and obligations hereunder will be governed by the laws of the State of [Governing Law Jurisdiction], without regard to the conflicts of law provisions of such jurisdiction.\n\t(g)\tThe parties acknowledge and agree that for United States federal and state income tax purposes this Safe is, and at all times has been, intended to be characterized as stock, and more particularly as common stock for purposes of Sections 304, 305, 306, 354, 368, 1036 and 1202 of the Internal Revenue Code of 1986, as amended. Accordingly, the parties agree to treat this Safe consistent with the foregoing intent for all United States federal and state income tax purposes (including, without limitation, on their respective tax returns or other informational statements).\n(Signature page follows)\n \nIN WITNESS WHEREOF, the undersigned have caused this Safe to be duly executed and delivered.\n\n[COMPANY]\n\nBy:\t\t\t\t\t\n\t[name]\n[title]\n\t\t\tAddress: \t\n\t\t\t\t\t\n\t\t\tEmail:\t\n\t\t\tINVESTOR:\n\t\t\tBy:\t\t\n\t\t\tName:\t\n\t\t\tTitle:\t\n\n\t\t\tAddress:\t\n\t\t\t\t\t\n\t\t\t\t\t\tEmail:\t\t\t\t\t\t\n\n\n\"\"\""
},
{
"role": "user",
"content": "GOAL:\n\"\"\"\nCalculate the number of shares post conversion, and the resulting cap table.\n\"\"\"\n\nINTERMEDIATE_FORMAT:\n\"\"\"\nRules concerning GOAL\n\"\"\"\n\nConvert DOCUMENT into an intermediate, simplified form specifying only the information from DOCUMENT needed to achieve GOAL. Remove anything that isn't relevant."
}
]
const SIDE_LETTER_EXAMPLE = [
{
"role": "system",
"content": "You are converting a document into a simpler, intermediate step that can be used by someone else to derive an answer.\n\nDOCUMENT_PURPOSE:\n\"\"\"\nSide letter layering on top of a SAFE.\n\"\"\"\n\nDOCUMENT:\n\"\"\"\n[COMPANY NAME]\nPRO RATA AGREEMENT\n\nThis agreement (this “Agreement”) is entered into on or about [Date of Safe] in connection with the purchase by [Investor Name] (the “Investor”) of that certain simple agreement for future equity with a “Post-Money Valuation Cap” (the “Investor’s Safe”) issued by [Company Name] (the “Company”) on or about the date of this Agreement. As a material inducement to the Investor’s investment, the Company agrees to the provisions set forth in this Agreement. Capitalized terms used herein shall have the meanings set forth in the Investor’s Safe.\nThe Investor shall have the right to purchase its pro rata share of Standard Preferred Stock being sold in the Equity Financing (the “Pro Rata Right”). Pro rata share for purposes of this Pro Rata Right is the ratio of (x) the number of shares of Capital Stock issued from the conversion of all of the Investor’s Safes with a “Post-Money Valuation Cap” to (y) the Company Capitalization. The Pro Rata Right described above shall automatically terminate upon the earlier of (i) the initial closing of the Equity Financing; (ii) immediately prior to the closing of a Liquidity Event; or (iii) immediately prior to the Dissolution Event. \nNeither this Agreement nor the rights contained herein may be assigned, by operation of law or otherwise, by Investor without the prior written consent of the Company; provided, however, that this Agreement and/or the rights contained herein may be assigned without the Company’s consent by the Investor to any other entity who directly or indirectly, controls, is controlled by or is under common control with the Investor, including, without limitation, any general partner, managing member, officer or director of the Investor, or any venture capital fund now or hereafter existing which is controlled by one or more general partners or managing members of, or shares the same management company with, the Investor. \nAny provision of this Agreement may be amended, waived or modified upon the written consent of the Company and either (i) the holders of a majority of shares of Capital Stock issued from all Safes converted in connection with the Equity Financing held by the Investor and other Safe holders with Pro Rata Rights pursuant to agreements on the same form as this Agreement (available at http://ycombinator.com/documents), provided that such amendment, waiver or modification treats all such holders in the same manner, or (ii) the Investor. The Company will promptly notify the Investor of any amendment, waiver or modification that the Investor did not consent to. This Agreement is the form available at http://ycombinator.com/documents and the Company and the Investor agree that neither one has modified the form, except to fill in blanks and bracketed terms. The choice of law governing any dispute or claim arising out of or in connection with this Agreement shall be consistent with that set forth in the Investor’s Safe. \n\nIN WITNESS WHEREOF, the undersigned have caused this Agreement to be duly executed and delivered.\n\n[COMPANY NAME]\n\nBy:\t\t\t\t\t\n\t[name]\n[title]\n\t\t\t[INVESTOR NAME]\n\t\t\tBy:\t\t\n\t\t\t\tName:\t\n\t\t\tTitle:\t\n\n\n\"\"\""
},
{
"role": "user",
"content": "GOAL:\n\"\"\"\nCalculate the number of shares post conversion, and the resulting cap table.\n\"\"\"\n\nINTERMEDIATE_FORMAT:\n\"\"\"\nRules concerning GOAL\n\"\"\"\n\nConvert DOCUMENT into an intermediate, simplified form specifying only the information from DOCUMENT needed to achieve GOAL. Remove anything that isn't relevant."
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment