Claude
Skills
Sign in
Back

Contract Drafter

Included with Lifetime
$97 forever

Generate legal contracts from templates with variable substitution and clause management

document-creationcontractslegalagreementstemplatesnda

What this skill does


# Contract Drafter

The Contract Drafter skill automates the generation of legal contracts and agreements from templates. It handles variable substitution, conditional clauses, signature blocks, and document formatting. This skill is essential for creating NDAs, service agreements, employment contracts, and other legal documents consistently and efficiently.

**IMPORTANT DISCLAIMER:** This skill generates documents from templates and does NOT provide legal advice. All generated contracts should be reviewed by a qualified attorney before use. The skill is designed to streamline document creation, not replace legal counsel.

## Core Workflows

### Workflow 1: Generate from Standard Template
**Purpose:** Create a contract from a pre-defined template with variable substitution

**Steps:**
1. Select contract type (NDA, Service Agreement, etc.)
2. Load template with placeholders
3. Collect required information (parties, dates, terms)
4. Validate all required fields are present
5. Substitute variables in template
6. Handle conditional clauses based on parameters
7. Generate final document (PDF or DOCX)
8. Add signature blocks and execution details

**Implementation:**
```javascript
const Docxtemplater = require('docxtemplater');
const PizZip = require('pizzip');
const fs = require('fs');

function generateContract(templatePath, contractData, outputPath) {
  // Load template
  const content = fs.readFileSync(templatePath, 'binary');
  const zip = new PizZip(content);

  const doc = new Docxtemplater(zip, {
    paragraphLoop: true,
    linebreaks: true
  });

  // Prepare data with defaults and calculations
  const data = {
    // Party information
    party1Name: contractData.party1.name,
    party1Address: contractData.party1.address,
    party1Email: contractData.party1.email,
    party2Name: contractData.party2.name,
    party2Address: contractData.party2.address,
    party2Email: contractData.party2.email,

    // Contract details
    effectiveDate: contractData.effectiveDate,
    expirationDate: contractData.expirationDate,
    term: contractData.term || 'one (1) year',

    // Financial terms (if applicable)
    paymentAmount: contractData.paymentAmount,
    paymentSchedule: contractData.paymentSchedule,
    currency: contractData.currency || 'USD',

    // Specific terms
    scope: contractData.scope,
    deliverables: contractData.deliverables,

    // Conditional clauses
    includeNonCompete: contractData.includeNonCompete || false,
    nonCompetePeriod: contractData.nonCompetePeriod || '12 months',
    nonCompeteRadius: contractData.nonCompeteRadius || '50 miles',

    includeConfidentiality: contractData.includeConfidentiality !== false,
    confidentialityPeriod: contractData.confidentialityPeriod || '5 years',

    // Governing law
    governingState: contractData.governingState || 'Delaware',
    governingCountry: contractData.governingCountry || 'United States',

    // Dates
    currentDate: new Date().toLocaleDateString(),
    currentYear: new Date().getFullYear()
  };

  // Render template
  doc.setData(data);
  doc.render();

  // Save output
  const buf = doc.getZip().generate({
    type: 'nodebuffer',
    compression: 'DEFLATE'
  });

  fs.writeFileSync(outputPath, buf);

  return {
    outputPath,
    contractType: contractData.contractType,
    parties: [data.party1Name, data.party2Name],
    effectiveDate: data.effectiveDate
  };
}
```

### Workflow 2: NDA Generator
**Purpose:** Create Non-Disclosure Agreements with standard or custom terms

**Steps:**
1. Identify NDA type (mutual or one-way)
2. Collect party information
3. Define confidential information scope
4. Set disclosure term and duration
5. Specify exclusions from confidentiality
6. Add remedies and jurisdiction clauses
7. Generate signature pages
8. Create final NDA document

**Implementation:**
```javascript
function generateNDA(ndaData, outputPath) {
  const templatePath = ndaData.type === 'mutual'
    ? './templates/mutual-nda.docx'
    : './templates/one-way-nda.docx';

  const contractData = {
    contractType: 'Non-Disclosure Agreement',

    // Parties
    party1: ndaData.disclosingParty,
    party2: ndaData.receivingParty,

    // NDA-specific terms
    effectiveDate: ndaData.effectiveDate || new Date().toISOString().split('T')[0],
    confidentialityPeriod: ndaData.confidentialityPeriod || '3 years',

    // Purpose of disclosure
    purpose: ndaData.purpose || 'evaluation of a potential business relationship',

    // Scope definition
    confidentialDefinition: ndaData.confidentialDefinition || `any non-public information disclosed by the Disclosing Party to the Receiving Party, whether orally, in writing, or in any other form`,

    // Exclusions
    exclusions: [
      'Information that is publicly available through no breach of this Agreement',
      'Information rightfully received from a third party without breach of any confidentiality obligation',
      'Information independently developed without use of Confidential Information',
      'Information required to be disclosed by law or court order'
    ],

    // Return of materials clause
    includeReturnClause: ndaData.includeReturnClause !== false,
    returnPeriod: ndaData.returnPeriod || '30 days',

    // Governing law
    governingState: ndaData.governingState,
    arbitration: ndaData.arbitration || false
  };

  return generateContract(templatePath, contractData, outputPath);
}

// Example usage:
const nda = generateNDA({
  type: 'mutual',
  disclosingParty: {
    name: 'Acme Corp',
    address: '123 Business St, City, State 12345',
    email: '[email protected]'
  },
  receivingParty: {
    name: 'Widget LLC',
    address: '456 Commerce Ave, City, State 67890',
    email: '[email protected]'
  },
  purpose: 'evaluation of potential partnership for joint product development',
  confidentialityPeriod: '5 years',
  governingState: 'California'
}, './output/nda-acme-widget.docx');
```

### Workflow 3: Service Agreement Generator
**Purpose:** Create service contracts with scope, deliverables, and payment terms

**Steps:**
1. Define service provider and client information
2. Specify scope of services in detail
3. List deliverables and timelines
4. Set payment terms (fixed, hourly, milestone-based)
5. Define intellectual property ownership
6. Add termination clauses
7. Include liability limitations
8. Generate agreement with all terms

**Implementation:**
```javascript
function generateServiceAgreement(serviceData, outputPath) {
  const contractData = {
    contractType: 'Service Agreement',

    party1: serviceData.serviceProvider,
    party2: serviceData.client,

    effectiveDate: serviceData.effectiveDate,
    term: serviceData.term || 'ongoing until completion',

    // Scope of services
    scope: serviceData.services.map(s => s.description).join('\n'),
    deliverables: serviceData.deliverables,

    // Payment terms
    paymentStructure: serviceData.paymentStructure, // 'fixed', 'hourly', 'milestone'
    totalAmount: serviceData.totalAmount,
    hourlyRate: serviceData.hourlyRate,
    milestones: serviceData.milestones || [],
    paymentSchedule: serviceData.paymentSchedule,
    paymentTerms: serviceData.paymentTerms || 'Net 30',

    // Intellectual property
    ipOwnership: serviceData.ipOwnership || 'client', // 'client', 'provider', 'shared'
    includeWorkForHire: serviceData.includeWorkForHire !== false,

    // Termination
    terminationNotice: serviceData.terminationNotice || '30 days',
    includeTerminationForConvenience: serviceData.includeTerminationForConvenience !== false,

    // Liability
    liabilityLimit: serviceData.liabilityLimit || 'total amount paid under this Agreement',
    includeIndemnification: serviceData.includeIndemnification !== false,

    // Confidentiality
    includeConfidentiality: true,
    confidentialityPeriod: '3 years',

    governingState: serviceData.governingState
  };

  return generateContract('./templates/service-agreement.docx', contractData, o

Related in document-creation