📖 Context Slice

SAFE Operations Guide

Detailed operational guidance for populating, converting, and sending SAFE agreements

Complete operational reference for generating SAFE documents including template population, PDF conversion, email drafting, and sending workflows.

Prerequisites

Requires company information in 🎨 Company Legal Information:

  • Company Name (legal entity name)
  • CEO Name (signing officer)
  • CEO Title (officer title)

Template must exist at slice:finance.safe.template with variable placeholders (YC post-money SAFE). Email sending requires draft approval (external action). PDF conversion requires document processing tools.

Template Variable Mapping

All placeholders in the SAFE template that must be replaced:

| Variable | Example Value | Notes |
|----------|--------------|-------|
| {Company Name} | "HeyDaily, Inc." | Appears 2x in template |
| {COMPANY} | "HEYDAILY, INC." | Uppercase for signature |
| {Investor Name} | "Sequoia Capital" | Investor/fund name |
| {Purchase Amount} | "$500,000" | Format with $ and commas |
| {Date of Safe} | "November 26, 2025" | Spelled-out month |
| {Valuation Cap} | "$2,000,000,000" | Format with $ and commas |
| {State of Incorporation} | "Delaware" | Standard value |
| {Governing Law Jurisdiction} | "Delaware" | Standard value |
| {name} | "Filip Kozera" | CEO name for signature |
| {title} | "Chief Executive Officer" | CEO title for signature |

Parameter Sources

From user input:

  • Investor Name - Investor or fund name
  • Valuation Cap - Post-money valuation cap (e.g., "$2,000,000,000")
  • Investment Amount - Purchase amount (e.g., "$500,000")
  • Recipient Email - Email address for sending

From 🎨 Company Legal Information:

  • Company Name - Legal entity name
  • CEO Name - Signing officer name
  • CEO Title - Officer title (e.g., "Chief Executive Officer")

Auto-generated:

  • Date of Safe - Today's date in long format (e.g., "November 26, 2025")
  • State of Incorporation - "Delaware" (standard)
  • Governing Law Jurisdiction - "Delaware" (standard)

Populate SAFE Template

Replace template variables with investment details and company information.

Critical steps:
1. Validate 🎨 Company Legal Information has required company fields
2. Copy template to documents/SAFEs/temp_[timestamp]_[investor]_SAFE.md
3. Replace all 10 template variables
4. Format currency values with $ and commas
5. Use spelled-out date format: "Month DD, YYYY"
6. Sanitize investor name for filename (spaces → underscores, remove special chars)

File operations example:

// Create output directory and copy template

await fs.mkdir('documents/SAFEs', { recursive: true });
const outputPath = 'documents/SAFEs/temp_2025-11-26_Sequoia_Capital_SAFE.md';
await fs.copyFile('path/to/template', outputPath);

Use file editing tools to replace all placeholders with actual values. Verify no placeholder variables remain in the document after substitution.

Deduce Investment Amount

Search workspace documents for investment amount when not provided by user.

When to use:

  • User provides investor name but not investment amount
  • Need to find deal terms from existing documents

Search strategy:

grep -ri "investor_name" documents/ | grep -E "\$[0-9,]+"

Steps:
1. Search recursively in documents/ directory
2. Filter for dollar amount patterns near investor name
3. If single clear match → use it
4. If multiple or none → ask user
5. Validate format (should have $ and be reasonable amount)

Convert to PDF

Convert populated markdown SAFE to PDF format after successfully populating template.

Conversion options:

Option 1: Using pandoc (command-line)

pandoc documents/SAFEs/temp_file.md \

-o documents/SAFEs/2025-11-26_Sequoia_Capital_SAFE.pdf

Option 2: Using reportlab (Python)

from reportlab.lib.pagesizes import letter

from reportlab.platypus import SimpleDocTemplate, Paragraph
import markdown

Read and convert

with open('documents/SAFEs/temp_file.md', 'r') as f:
md_content = f.read()

output_file = 'documents/SAFEs/2025-11-26_Sequoia_Capital_SAFE.pdf'

... conversion logic

Output format:

  • Filename: YYYY-MM-DD_Investor_Name_SAFE.pdf
  • Location: documents/SAFEs/

Critical steps:
1. Ensure output directory exists: documents/SAFEs/
2. Read populated markdown file
3. Convert to PDF using available tool
4. Save with standardized filename format
5. Delete temporary markdown file after successful conversion

Create Email Draft

Generate email draft with SAFE PDF attachment for user approval. Always use draft pattern - never auto-send (external action requirement).

Email components:

  • TO: recipientEmail (provided by user)
  • FROM: Authenticated Gmail account
  • SUBJECT: SAFE Agreement - [Investor] Investment in [Company]
  • ATTACHMENT: documents/SAFEs/[filename].pdf
  • BODY: Default template with variable substitution

Default template:

Dear [Investor Name],

Please find attached the SAFE (Simple Agreement for Future Equity) agreement for your [Investment Amount] investment in [Company Name] at a [Valuation Cap] post-money valuation cap.

The agreement has been prepared as of [Date of Safe]. Please review at your convenience and let me know if you have any questions.

Best regards,
[CEO Name]
[CEO Title]
[Company Name]

Example draft file:

---

_action:
label: "Send SAFE to Sequoia Capital"
prompt: "Send the email draft below with the attached SAFE PDF from documents/SAFEs/2025-11-26_Sequoia_Capital_SAFE.pdf to partner@sequoia.com"
isComplete: false
---

TO: partner@sequoia.com
FROM: tal@wordware.ai
SUBJECT: SAFE Agreement - Sequoia Capital Investment in HeyDaily, Inc.
ATTACHMENT: documents/SAFEs/2025-11-26_Sequoia_Capital_SAFE.pdf

---

Dear Sequoia Capital,

Please find attached the SAFE agreement for your $500,000 investment in HeyDaily, Inc. at a $2,000,000,000 post-money valuation cap.

The agreement has been prepared as of November 26, 2025. Please review at your convenience.

Best regards,
Filip Kozera
Chief Executive Officer
HeyDaily, Inc.

Critical steps:
1. Create draft file in session/ directory
2. Include _action frontmatter with label and prompt
3. Present draft to user for review
4. Wait for user approval (button click)
5. Execute send only after approval

Send Email with Attachment

Send the approved email draft with SAFE PDF attachment. Only execute after user has approved the draft.

Email format example (RFC 2822 with attachment):

// Create RFC 2822 formatted email with attachment

const boundary = "boundary_" + Date.now();
const emailContent = [
"From: tal@wordware.ai",
To: ${recipientEmail},
Subject: ${subject},
"MIME-Version: 1.0",
Content-Type: multipart/mixed; boundary="${boundary}",
"",
--${boundary},
"Content-Type: text/plain; charset=UTF-8",
"",
emailBody,
"",
--${boundary},
'Content-Type: application/pdf; name="SAFE.pdf"',
"Content-Transfer-Encoding: base64",
Content-Disposition: attachment; filename="${filename}",
"",
pdfBase64Content,
--${boundary}--
].join("\r\n");

Critical steps:
1. Read PDF file and encode as base64
2. Format email as RFC 2822 message with multipart boundary
3. Use Gmail API upload endpoint for files under 5MB
4. Verify successful send

Complete Workflow

End-to-end process for generating and sending a SAFE agreement:

Step 1: Validate prerequisites
Check 🎨 Company Legal Information for required fields (Company Name, CEO Name, CEO Title). If missing, prompt user to provide them.

Step 2: Gather parameters
Extract from user input or ask:

  • Investor name (required)
  • Valuation cap (required)
  • Recipient email (required for sending)
  • Investment amount (deduce from documents or ask)

Step 3: Populate template
1. Ensure output directory: mkdir -p documents/SAFEs
2. Copy template to temp file
3. Replace all variables using file operations
4. Verify no placeholders remain

Step 4: Convert to PDF
1. Choose conversion method (pandoc, reportlab, or markdown-pdf)
2. Convert temporary markdown to PDF
3. Save to documents/SAFEs/[YYYY-MM-DD]_[Investor]_SAFE.pdf
4. Delete temporary markdown file

Step 5: Create email draft
1. Generate email body with variable substitution
2. Create draft file in session/ with _action frontmatter
3. Present to user for review

Step 6: Send after approval
1. User clicks action button
2. Read PDF and encode as base64
3. Format RFC 2822 email with attachment
4. Send via Gmail API

Error Handling

| Error | Resolution |
|-------|-----------|
| Missing company info fields | Prompt user to provide Company Name, CEO Name, CEO Title |
| Template not found | Inform user that SAFE template is unavailable, exit task |
| Cannot deduce investment amount | Ask user: "What is the investment amount for [investor]?" |
| PDF conversion fails | Try alternate method or inform user about tool requirements |
| Email send fails | PDF saved successfully, user can send manually |