home / skills / dkyazzentwatwa / chatgpt-skills / contract-generator

contract-generator skill

/contract-generator

This skill generates professional legal contracts from templates with variable substitution, formatting, validation, and workflow automation.

npx playbooks add skill dkyazzentwatwa/chatgpt-skills --skill contract-generator

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
1.7 KB
---
name: contract-generator
description: Use when asked to generate legal contracts, agreements, or documents from templates with variable substitution and formatting.
---

# Contract Generator

Generate professional legal contracts and agreements from templates with variable substitution, formatting, and validation.

## Purpose

Contract generation for:
- Employment agreements and NDAs
- Service contracts and SOWs
- Sales and purchase agreements
- Lease and rental contracts
- Partnership and operating agreements

## Features

- **Template System**: Pre-built contract templates
- **Variable Substitution**: Replace placeholders with actual values
- **Conditional Sections**: Include/exclude based on variables
- **Formatting**: Professional DOCX output
- **Validation**: Check for missing required fields
- **Batch Generation**: Create multiple contracts from CSV

## Quick Start

```python
from contract_generator import ContractGenerator

# Generate from template
generator = ContractGenerator()
generator.load_template('templates/nda.docx')
generator.set_variables({
    'party1_name': 'Acme Corp',
    'party2_name': 'John Smith',
    'effective_date': '2024-03-14',
    'jurisdiction': 'California'
})
generator.save('nda_acme_smith.docx')
```

## CLI Usage

```bash
# Generate single contract
python contract_generator.py --template nda.docx --vars vars.json --output contract.docx

# Batch generate from CSV
python contract_generator.py --template nda.docx --csv parties.csv --output-dir contracts/
```

## Limitations

- Templates must be in DOCX format
- Not a substitute for legal review
- Does not provide legal advice
- Complex conditional logic may require custom templates

Overview

This skill generates professional legal contracts and agreements from reusable DOCX templates with variable substitution and conditional sections. It is designed to automate repetitive document creation for common contract types while producing formatted, ready-to-review output. Use it to speed drafting and reduce manual editing when contract terms repeat across parties.

How this skill works

The generator loads a DOCX template containing placeholders and optional conditional blocks, then substitutes variables you supply (single or batch via CSV). It can include or omit conditional sections based on variable values and validates required fields before export. Final output is a formatted DOCX file suitable for review or signature; batch mode produces multiple contracts from a CSV of party data.

When to use it

  • Creating NDAs, employment agreements, service contracts, leases, or sales contracts from standard templates
  • Producing multiple personalized contracts quickly using a CSV or programmatic variables
  • Ensuring required fields are present before sending drafts for legal review
  • Generating DOCX output that preserves formatting for signatures or printing

Best practices

  • Maintain a library of well-structured DOCX templates with clear placeholder names
  • Define required fields in each template and validate inputs before generation
  • Use conditional sections sparingly and test templates with representative data
  • Run a legal review on templates and final outputs; this tool automates drafting but does not replace counsel
  • Keep a CSV sample and unit tests for batch generation to catch formatting or substitution errors

Example use cases

  • Generate an NDA for a new vendor by filling party names, dates, and jurisdiction variables
  • Batch-produce employment offer letters from HR data in a CSV to speed onboarding
  • Create a standard service agreement with optional SOW sections included only when relevant
  • Produce lease agreements for multiple tenants by substituting rent, term, and property details
  • Export finalized DOCX contracts for electronic signature or internal record keeping

FAQ

Does this skill provide legal advice?

No. It automates contract drafting and validates required fields but does not replace legal review or advice.

What file formats are supported?

Templates must be DOCX and output is DOCX to preserve professional formatting.

Can I generate many contracts at once?

Yes. Batch generation accepts a CSV with one row per contract and produces multiple DOCX files.