.claude/skills/draft-reviewer/SKILL.md
# SKILL: draft-reviewer ## Purpose Build and maintain the review node (Stage 4). Review validates draft quality and optionally applies inline fixes. Uses slim payload — only draft text + gate errors + user request. ## When to Use - Building or modifying the review node - Tuning the review prompt or skip conditions - Debugging review output quality - Changing review model assignment ## Architecture Context (v5.1 — what's running) Review runs after 4 deterministic gates. It receives a slim pay
npx skillsauth add itmegirish/boardingmcp-server .claude/skills/draft-reviewerInstall 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.
Build and maintain the review node (Stage 4). Review validates draft quality and optionally applies inline fixes. Uses slim payload — only draft text + gate errors + user request.
Review runs after 4 deterministic gates. It receives a slim payload (~3.5K tokens) and performs structured validation + optional inline fix.
Stage 3 gates (evidence_anchoring -> lkb_compliance -> postprocess -> citation_validator)
-> REVIEW (slim payload: draft text + gate errors + user request)
-> Phase 1: 7 conditional checks
-> Phase 2: inline fix (if blocking issues found)
-> END
Set DRAFTING_SKIP_REVIEW=True in .env to bypass review entirely (for speed testing).
Review receives ONLY:
draft.draft_artifacts[0].text_build_gate_errors_summary()Total: ~3.5K tokens (was ~15K before pruning)
NOT sent: RAG chunks, court fee context, legal research context, cited chunk IDs. Gates already verified all of that deterministically.
Review the generated draft for legal correctness and filing readiness.
USER_REQUEST:
{user_request}
DOC_TYPE: {doc_type}
LAW_DOMAIN: {law_domain}
GATE ERRORS (from deterministic validation gates — already verified):
{gate_errors}
DRAFT TEXT:
{draft_text}
_build_gate_errors_summary(state) collects errors from 3 sources:
evidence_anchoring_issues — fact tracing issuespostprocess_issues — formatting + LKB compliance issuescitation_issues — provision verification issuesIf no issues: returns "No gate errors — all deterministic checks passed."
The review system prompt (prompts/review.py) includes:
Output: structured JSON with review_pass, blocking_issues, non_blocking_issues, final_artifacts
When DRAFTING_REVIEW_INLINE_FIX=True (default), review generates a corrected final_artifacts[] alongside blocking_issues[]. This eliminates the separate pass-2 LLM call.
After inline fix, _fix_and_or() is applied (deterministic cleanup since LLM may reintroduce anti-patterns).
def _route_after_review(result, review_count, state, elapsed, inline_fix_enabled):
# Priority:
# 1. No legal blocking issues -> END (promote pass-1)
# 2. Legal issues + inline fix -> END (use corrected artifacts)
# 3. Legal issues + no fix + within cycles -> draft_freetext (pass-2)
# 4. Max cycles exceeded -> END regardless
severity="legal" — wrong citation, missing section, wrong limitationseverity="formatting" — numbering, heading style, annexure labels| File | What |
|------|------|
| nodes/reviews.py | Review node + routing + slim payload builder |
| prompts/review.py | System/user prompt (7 checks + Phase 2 suffix) |
| states/draftGraph.py | ReviewNode Pydantic model |
DRAFTING_MAX_REVIEW_CYCLES: int = 1
DRAFTING_REVIEW_INLINE_FIX: bool = True
DRAFTING_SKIP_REVIEW: bool = False
OLLAMA_REVIEW_MODEL: str = "glm-5:cloud"
OLLAMA_REVIEW_TEMPERATURE: float = 0.3
OLLAMA_REVIEW_REASONING: bool = True
REVIEW_LLM_MODEL: Optional[str] = None # OpenAI fallback
REVIEW_REASONING_EFFORT: Optional[str] = "medium"
with_structured_output(ReviewNode)extract_json_from_text() parsingAll 3 fail -> fallback result with review_pass=False + error logged, pipeline continues.
DRAFTING_MAX_REVIEW_CYCLES)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