Skip to content
Automation
Skill

/subcontract-writer

Generate a complete subcontract from a firm's template, awarded bid, and project specs. Outputs a Word document. Triggers: 'subcontract', 'sub agreement', 'write contract', 'draft subcontract'. Requires awarded bid.

From plugin
construction
6014 skills

Claude Code

$ npx -y skills add dleerdefi/claude-code-construction --skill subcontract-writer --agent claude-code

SKILL.md

subcontract-writer.SKILL.md
name: subcontract-writer
description: >
  Generate a complete subcontract from a firm's template, awarded bid, and
  project specs. Outputs a Word document. Triggers: 'subcontract', 'sub
  agreement', 'write contract', 'draft subcontract'. Requires awarded bid.
argument-hint: "<scope_of_work>"
disable-model-invocation: true

Subcontract Writer

Generates a complete, execution-ready subcontract agreement from a firm's template, the awarded bid, and project specifications. **You are the intelligence layer** — you read every document, extract all data, generate every article's text, make legal/commercial judgments, and write fully-populated JSON files. The Python formatter is a thin rendering utility that makes no content decisions.

**Output:** Word document (.docx) matching the firm's template structure.

**Dependency:** Requires `python-docx` in the construction Python environment.

**Key principle:** The bid document is the PRIMARY input. It establishes what was priced, at what rates, with what inclusions and exclusions. Specifications inform scope descriptions and technical requirements. The template provides article structure and standard boilerplate.

---

Pipeline Position

This skill can be invoked directly when the user has an awarded bid and wants to generate a subcontract, or as the final step of the bid pipeline:

/bid-tabulator → /bid-evaluator → user confirms → THIS SKILL

Either way, the awarded bid document (Slot B) is the mandatory input.

Mode Detection

Read `.construction/project.yaml` at the project root: present and readable means AgentCM mode (note its `contract_version`), absent means flat-file mode. A listing that shows the file does not decide it: read it.

  • **AgentCM mode**: Read each spec section from `.construction/specs/<section>.txt` (`09 65 13` is `09-65-13.txt`; each line starts with its page), listed in `.construction/INDEX.md`: it is the section's text, and a section's pages are never extracted again from the PDF. A read manual's pages in no section (INDEX.md lists them) are read in the PDF, those pages only. Only for a manual INDEX.md lists under "Spec manuals not read", read spec-splitter's `.construction/skills/spec_text/` instead. Use sheet index from `.construction/index/sheet_index.yaml` for drawing references. Read project metadata from `.construction/CLAUDE.md`. Follow `${CLAUDE_PLUGIN_ROOT}/reference/agentcm-mode.md` (which source wins, missing files).
  • **Flat File mode**: Discover spec PDFs via project `CLAUDE.md` paths or directory search. Read drawing sheets directly from PDF.

---

Architecture: Five Phases in Order

Execute in five sequential phases. Each phase has a defined output that must be completed before the next begins. **Do not skip phases or combine them.** The most common failure mode is attempting Phase 4 (writing) before Phase 3 (validation) is complete.

Subcontract Writer Progress:
Phase 1  →  Phase 2  →  Phase 3  →  USER CHECKPOINT  →  Phase 4  →  Phase 5
Triage     Extract     Validate      Confirm data         Write       Verify

---

Phase 1 — Document Triage and Slot Assignment

Before reading any document substantively, assign each uploaded file to its slot. State the assignments to the user before proceeding.

| Slot | Role | Source | What It Provides | |------|------|--------|-----------------| | A | Template | Subcontract PDF/DOCX | Article structure, boilerplate language, required sections | | B | Awarded bid | Subcontractor bid PDF | **Contract sum, quantities, unit rates, inclusions, exclusions, VE alternates** | | C | Specifications | Spec section PDFs; in AgentCM mode `.construction/specs/<section>.txt` | Scope descriptions, submittal requirements, warranty clauses, installer qualifications | | D | Drawings | Finish schedule, floor plans | Room codes, area takeoffs, scope boundaries |

**Slot B is mandatory.** If missing, stop and output:

I need the awarded subcontractor's bid document before I can generate this
subcontract. The bid is the source of truth for the contract sum, quantities,
and unit rates. Which file is the awarded bid?

Read Slot A first to understand the required article structure. Note every article heading. Flag any article that requires project-specific content (not just boilerplate) — these become required extraction targets in Phase 2.

If no template is provided, ask: "Do you have a standard subcontract template?" If none available, use AIA A401-style structure as fallback.

---

Phase 2 — Structured Extraction, One Slot at a Time

Run a separate extraction pass for each slot. Write extracted data to `.construction/skills/subcontract-writer/scope_data.json` incrementally. Do not combine slots in a single read.

A text dump is working data: take `pdf_text.py`'s output directly, or, to search it more than once, save it with `--output` under `.construction/skills/subcontract-writer/text/`, never in `/tmp` or any other folder outside the project.

Slot B Extraction (Bid Document) — Run First

Dump the bid's text first; read TEXT pages from the dump and rasterize VISION pages for vision reading:

"${CLAUDE_PLUGIN_ROOT}/bin/construction-python" "${CLAUDE_PLUGIN_ROOT}/scripts/pdf/pdf_text.py" "{bid.pdf}"

Extract every field below. Mark any field not found as `MISSING` — do not infer or estimate.

**Commercial data:**

  • Subcontractor company name (exact legal name from letterhead)
  • Address, phone, email
  • License/registration number
  • Estimator/contact name
  • Proposal number and date
  • Bid validity period (if stated)
  • Total contract sum (exact dollar amount)

**Scope data:**

  • Line items with: spec section, description, quantity, unit, unit rate, extended amount
  • Inclusions list (verbatim from bid)
  • Exclusions list (verbatim from bid — critical for scope gap prevention)
  • Value engineering alternates with VE ID, description, and deduct amount
  • Qualifications or clarifications

**Verify:** Line item amounts must sum to the total contr

Read more
@dleerdefi
Ships withconstruction

Open-source skills that give Claude Code the working knowledge of a Project Engineer.

Stars on GitHub

Momentum

stars in total
60
Star history of dleerdefi/claude-code-construction on GitHub, a chart by star-history.com

Other skills on construction.

bid-evaluator

bid-evaluator

Evaluate tabulated subcontractor bids against specs and drawings — scope gap analysis, exclusion risk scoring, award…

bid-tabulator

bid-tabulator

Extract data from subcontractor bid PDFs and produce a comparison spreadsheet. Feeds into /bid-evaluator. Triggers: 'tabulate…

code-researcher

code-researcher

Researches which building codes, accessibility standards and authority requirements (health department, fire marshal, state…

construction-guide

construction-guide

Operating guide for construction project documents — load before reading drawings, specs, schedules, RFIs, submittals or bids.…

pe-review

pe-review

Checks construction drawings and specs for what's missing, cross-trade coordination conflicts and scope gaps, with PE judgment.…

project-setup

project-setup

Set up a construction project — inventories files, classifies drawings/specs/schedules/registers and appends construction context…

More skills from other plugins.

agent-builder

agent-builder

Load immediately after an Agent intent, before the first agent_builder_* call. Governs how you create, configure, test, and…

n8n2w209k
@n8n-io@n8n-ioInstall Skill
browser-use

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…

@browser-use@browser-useInstall Skill
add-anydoc

add-anydoc

Add local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when…

@nanocoai@nanocoaiInstall Skill

Questions about subcontract-writer.

Which coding agents can use subcontract-writer?
subcontract-writer installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.