Home
cd ../playbooks
Legal & ComplianceIntermediate

Contract Template Generator

Create smart, legally enforceable contract templates with embedded logic using the Accord Project framework.

10 minutes
By communitySource
#contract#template#legal#accord

Every new deal means copying an old contract, manually changing names and dates, and hoping you didn't leave the wrong client's name in section 7. Your templates have no logic — they're just Word docs with highlighted blanks.

Who it's for: legal ops teams standardizing contract workflows, law firms automating template generation, procurement departments streamlining vendor agreements, startups building their first contract library, SaaS companies creating customer agreements

Example

"Create a smart SaaS subscription agreement template" → Machine-readable contract template with embedded logic for auto-calculating dates, pricing tiers, and SLA terms using the Accord Project framework — fill in variables and it's ready to sign

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# Contract Template

## Overview

This workflow enables creation of smart contract templates using **Accord Project** - an open-source framework for legally enforceable, machine-readable contracts. Create templates with embedded logic that can automate contract execution.

## How to Use

1. Describe the contract type and terms
2. Specify variables and logic rules
3. I'll generate Accord Project template

**Example prompts:**
- "Create an NDA template with variable terms"
- "Build a service agreement with payment milestones"
- "Generate a rental agreement template"
- "Design a consulting contract with termination clauses"

## Domain Knowledge

### Template Structure

```
contract-template/
├── package.json           # Metadata
├── grammar/
│   └── template.tem.md    # Natural language template
├── model/
│   └── model.cto          # Data model
├── logic/
│   └── logic.ergo         # Business logic
└── text/
    └── sample.md          # Sample contract
```

### Template Syntax (TemplateMark)

```markdown
# Service Agreement

This Agreement is made between [{supplier}] ("Supplier") 
and [{buyer}] ("Buyer").

## Services
The Supplier agrees to provide [{serviceDescription}].

## Payment
The Buyer shall pay [{paymentAmount}] within 
[{paymentDays}] days of invoice.

## Term
This Agreement begins on [{startDate as "MMMM DD, YYYY"}] 
and continues for [{termMonths}] months.

{{#if latePenalty}}
## Late Payment
A penalty of [{penaltyPercent}]% applies to late payments.
{{/if}}
```

### Data Model (Concerto)

```cto
namespace org.example.service

import org.accordproject.time.*

asset ServiceAgreement extends Contract {
  o String supplier
  o String buyer
  o String serviceDescription
  o Double paymentAmount
  o Integer paymentDays
  o DateTime startDate
  o Integer termMonths
  o Boolean latePenalty optional
  o Double penaltyPercent optional
}

transaction PaymentRequest {
  o Double amount
  o DateTime dueDate
}

transaction PaymentResponse {
  o Double amount
  o Double penalty
  o DateTime paymentDue
}
```

### Business Logic (Ergo)

```ergo
namespace org.example.service

import org.accordproject.time.*

contract ServiceContract over ServiceAgreement {
  
  clause payment(request : PaymentRequest) : PaymentResponse {
    let dueDate = addDuration(request.dueDate, 
                              Duration{ amount: contract.paymentDays, unit: ~org.accordproject.time.TemporalUnit.days });
    
    let penalty = 
      if contract.latePenalty
      then request.amount * contract.penaltyPercent / 100.0
      else 0.0;
    
    return PaymentResponse{
      amount: request.amount,
      penalty: penalty,
      paymentDue: dueDate
    }
  }
}
```

### Using Cicero CLI

```bash
# Install
npm install -g @accordproject/cicero-cli

# Parse contract
cicero parse --template ./contract-template --sample ./text/sample.md

# Execute logic
cicero trigger --template ./contract-template \
  --sample ./text/sample.md \
  --request ./request.json

# Draft new contract
cicero draft --template ./contract-template --data ./data.json
```

## Example: NDA Template

### template.tem.md
```markdown
# Non-Disclosure Agreement

This Non-Disclosure Agreement ("Agreement") is entered into 
as of [{effectiveDate as "MMMM DD, YYYY"}] by and between:

**Disclosing Party:** [{disclosingParty}]
**Receiving Party:** [{receivingParty}]

## 1. Confidential Information

"Confidential Information" means all non-public information 
disclosed by the Disclosing Party, including but not limited to:
[{confidentialScope}].

## 2. Obligations

The Receiving Party agrees to:
- Maintain confidentiality for [{termYears}] years
- Use information only for [{permittedPurpose}]
- Not disclose to third parties without written consent

## 3. Exclusions

This Agreement does not apply to information that:
{{#if hasExclusions}}
[{exclusions}]
{{else}}
- Is or becomes publicly available
- Was known prior to disclosure
- Is independently developed
{{/if}}

## 4. Return of Materials

Upon termination, the Receiving Party shall return or destroy 
all Confidential Information within [{returnDays}] days.

## 5. Remedies

{{#if monetaryPenalty}}
Breach of this Agreement shall result in liquidated damages 
of [{penaltyAmount}].
{{else}}
The Disclosing Party shall be entitled to seek injunctive relief.
{{/if}}

**SIGNATURES**

Disclosing Party: ____________________
Date: ____________________

Receiving Party: ____________________
Date: ____________________
```

### data.json
```json
{
  "effectiveDate": "2024-01-15",
  "disclosingParty": "Tech Corp",
  "receivingParty": "Consultant LLC",
  "confidentialScope": "trade secrets, customer lists, and technical specifications",
  "termYears": 3,
  "permittedPurpose": "evaluating a potential business relationship",
  "hasExclusions": false,
  "returnDays": 30,
  "monetaryPenalty": true,
  "penaltyAmount": "$50,000"
}
```

## Resources

- [Accord Project](https://accordproject.org/)
- [GitHub Organization](https://github.com/accordproject)
- [Template Library](https://templates.accordproject.org/)
README.md

What This Does

This workflow enables creation of smart contract templates using Accord Project - an open-source framework for legally enforceable, machine-readable contracts. Create templates with embedded logic that can automate contract execution.


Quick Start

Step 1: Create a Project Folder

mkdir -p ~/Documents/ContractTemplate

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ~/Documents/ContractTemplate/

Step 3: Start Working

cd ~/Documents/ContractTemplate
claude

How to Use

  1. Describe the contract type and terms
  2. Specify variables and logic rules
  3. I'll generate Accord Project template

Example prompts:

  • "Create an NDA template with variable terms"
  • "Build a service agreement with payment milestones"
  • "Generate a rental agreement template"
  • "Design a consulting contract with termination clauses"

$Related Playbooks

Legal & Compliance

DocuSign Automation

Automate document signing workflows, envelope management, and e-signature processes

10 minutes
Advanced
Legal & Compliance

Contract Redlining Assistant

Review contracts against your standard terms, flag risky clauses, and suggest alternative language.

15 minutes
Advanced
Legal & Compliance

Due Diligence Automator

Review data room documents across contracts, litigation, IP, compliance, and employment with systematic risk flagging.

15 minutes
Advanced
Legal & Compliance

EU AI Act Advisor

Classify AI systems across the EU AI Act's four risk tiers, check the prohibited practices, map provider/deployer and GPAI obligations, plan conformity assessment and CE marking, and handle Art. 50 transparency.

10 minutes
Advanced
Legal & Compliance

GDPR Compliance Advisor

Audit code and systems for GDPR violations, draft privacy policies and DPAs, answer GDPR questions with article citations, and review data flows and PII handling.

10 minutes
Intermediate
Legal & Compliance

HIPAA Compliance Advisor

Review systems and documents for HIPAA compliance, draft privacy notices, BAAs, and policies, run security risk assessments, and get technical-safeguard guidance for PHI/ePHI.

10 minutes
Intermediate
Legal & Compliance

GDPR Privacy Expert

Run GDPR compliance assessments, generate DPIAs, map data processing activities, build breach protocols, and create privacy policies with consent frameworks.

10 minutes
Intermediate
Legal & Compliance

HR Operations Pro

Draft HR policies, build employee handbooks, generate onboarding plans, create performance review frameworks, and analyze compensation benchmarks.

10 minutes
Intermediate
Legal & Compliance

Immigration Document Tracker

Track complex immigration cases with deadline management, document checklists, and status updates for visa processes.

10 minutes
Intermediate
Legal & Compliance

ISO 27701 Privacy Advisor

Build and certify a Privacy Information Management System (PIMS) under ISO/IEC 27701 — controller/processor controls, privacy SoA, privacy risk assessment, DPIA, and GDPR alignment.

10 minutes
Advanced
Legal & Compliance

ITAR Compliance Advisor

Navigate ITAR (22 CFR 120-130) — USML jurisdiction, DDTC registration, export licenses (DSP-5/73/94), TAAs/MLAs, brokering, deemed exports, technology control plans, and voluntary disclosures.

10 minutes
Advanced
Legal & Compliance

Legal Memo Drafting Assistant

Draft structured, objective IRAC-format legal memoranda — question presented, brief answer, statement of facts, IRAC discussion, and a practical recommendation.

10 minutes
Intermediate

Browse all Legal & Compliance playbooks →