.claude/skills/legal-drafting-workflow/SKILL.md
# SKILL: legal-drafting-workflow ## Purpose Execution guide for the drafting pipeline. v5.1 is running. v11.0 is target. ## Architecture Reference - CLAUDE.md: `.claude/CLAUDE.md` (v11.0 target architecture) - Skills: `/v9-architecture`, `/schema-builder`, `/lkb-enrichment`, `/prompt-builder` --- ## How to Run ### Run single draft ```bash agent_steer/Scripts/python.exe research/run_draft_live.py ``` ### Unit tests ```bash agent_steer/Scripts/python.exe -m pytest tests/drafting/ -v ``` ###
npx skillsauth add itmegirish/boardingmcp-server .claude/skills/legal-drafting-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Execution guide for the drafting pipeline. v5.1 is running. v11.0 is target.
.claude/CLAUDE.md (v11.0 target architecture)/v9-architecture, /schema-builder, /lkb-enrichment, /prompt-builderagent_steer/Scripts/python.exe research/run_draft_live.py
agent_steer/Scripts/python.exe -m pytest tests/drafting/ -v
agent_steer/Scripts/python.exe research/run_draft_benchmark.py --draft
agent_steer/Scripts/python.exe research/run_draft_benchmark.py --compare
STAGE 1: CONTEXT GATHERING (~12-15s, 1 LLM call)
intake_classify (qwen3.5:cloud)
-> domain_router -> enrichment (LKB lookup, 0 LLM, 0 API)
STAGE 2: FREE-TEXT DRAFTING (~30-50s, 1 LLM call)
draft_freetext (qwen3.5:cloud, reasoning=True)
LKB-guided, outputs complete court-ready document
STAGE 3: DETERMINISTIC VALIDATION (~0.1s, zero LLM)
evidence_anchoring -> lkb_compliance -> postprocess -> citation_validator
STAGE 4: REVIEW (~40-70s, 1 LLM call — slim payload, optional)
review (OpenAI gpt-5.2)
Slim context: draft text + gate errors + user request (~7K tokens)
STAGE 1: CONTEXT GATHERING (~12-15s, 1 LLM call)
intake_classify (cause_type + document_type)
-> domain_router -> enrichment (LKB + document schema)
STAGE 2: DRAFTING (~30-50s, 1 LLM call)
draft (structured prompt: schema + LKB Layer 1 + Layer 2 + facts)
LLM drafts complete document from structured context
STAGE 3: DETERMINISTIC VALIDATION (~0.1s, zero LLM)
evidence_anchoring -> lkb_compliance -> postprocess -> citation_validator
STAGE 4: REVIEW (optional)
review (OpenAI gpt-5.2)
lkb/causes/*.py — LKB entries Layer 1 + Layer 2 (legal data + document components)schemas/*.py — document schemas (section order + instructions)prompts/draft_prompt.py — structured prompt buildernodes/draft_single_call.py — _build_lkb_brief_context() (to be replaced by prompt builder)lkb/causes/{file}.py — add entry with Layer 1 + Layer 2 fieldslkb/__init__.py — add aliases if neededschemas/{file}.py — add schema with section order + instructionsapp/config/settings.py — OLLAMA_DRAFT_MODEL, OLLAMA_REVIEW_MODELnodes/evidence_anchoring.py — fact → intake tracingnodes/lkb_compliance.py — act citation + superseded lawnodes/postprocess.py — formattingnodes/citation_validator.py — provision verificationnodes/civil_decision.py — family consistency gates (7 families)When a draft scores below target:
[INTAKE+CLASSIFY] log[LKB] miss. Check aliases[ENRICHMENT] log_build_lkb_brief_context output[REVIEW] blocking_issues| Symptom | Cause | Fix |
|---------|-------|-----|
| Thin facts | Missing facts_must_cover in LKB | Add to LKB entry |
| Missing sections | LLM decides structure | Add document schema (v11.0) |
| Wrong limitation | Wrong article in LKB | Fix LKB entry, verify against Limitation Act |
| Wrong prayer | Missing available_reliefs | Add Layer 2 data to LKB |
| Fabricated citations | LLM hallucinated | Check verified_provisions in enrichment |
| Facts cite statutes | No anti-constraint | Add "Do NOT cite sections in FACTS" to red_flags |
| Phase | What | Status | |-------|------|--------| | 1 | Enrich LKB with Layer 2 | Pending | | 2 | Create 3 schemas (plaint, WS, interim app) | Pending | | 3 | Rewrite prompt builder | Pending | | 4 | Add document_type to intake | Pending | | 5 | Add remaining 9 schemas | Pending | | 6 | Remove engine.py | Pending |
development
# SKILL: v9-architecture Use when: planning, building, or reviewing v11.0 architecture components (LKB 2-layer model, document schemas, structured prompt builder, gates, family migrations). ## v11.0 Architecture — Scalable Context-Driven Pipeline ### Core Principles 1. **Better context to LLM = better draft** — no complex engine needed 2. **Separate law from structure** — cause type (92) × document type (12) = 1,104 combinations 3. **Decide law before drafting, enforce law after drafting** #
development
# SKILL: test-draft-pipeline ## Purpose Run the drafting pipeline, evaluate output quality, and verify all 4 gates + review work correctly. ## When to Use - After modifying any pipeline node, gate, or prompt - After creating or updating an exemplar or LKB entry - For regression testing across multiple scenarios - For debugging pipeline failures ## Test Runners ### Quick Test (single scenario) ```bash agent_steer/Scripts/python.exe research/run_draft_live.py ``` ### Unit Tests ```bash agent_
development
# SKILL: exemplar-builder ## Purpose Create, validate, and maintain document schemas and LKB Layer 2 data for the v11.0 scalable drafting pipeline. **v11.0 approach:** No exemplar documents in prompts. Instead: LKB 2-layer data + document schema → structured prompt → LLM drafts. ## When to Use - Creating a new document schema (e.g., written_statement, appeal_memo) - Enriching LKB entries with Layer 2 data (available_reliefs, jurisdiction_basis) - Reviewing schema quality against CPC rules - A
development
# SKILL: section-validator ## Purpose Build and maintain the 4 deterministic verification gates (Stage 3). Gates run on the full draft text with zero LLM calls. They validate, auto-fix formatting, and flag issues for review. ## When to Use - Building or modifying any gate - Adding new entity extraction patterns - Debugging false positives / false negatives - Extending verified provisions coverage ## Architecture Context (v5.1 — what's running) 4 gates run sequentially on `draft.draft_artifac