.claude/skills/v9-architecture/SKILL.md
# 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** #
npx skillsauth add itmegirish/boardingmcp-server .claude/skills/v9-architectureInstall 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.
Use when: planning, building, or reviewing v11.0 architecture components (LKB 2-layer model, document schemas, structured prompt builder, gates, family migrations).
_build_lkb_brief_context() dumps 13 instruction categories as flat text at equal priority (~400 lines).
LLM ignores half, hallucinates the rest. This is why drafts have thin facts, missing sections, wrong citations.
LKB Layer 1 (legal knowledge) + LKB Layer 2 (document components) + Document Schema
↓ ↓ ↓
COMBINE into ONE structured prompt with clear hierarchy
↓
LLM drafts complete document (1 call)
↓
Gates validate (0 LLM)
| Layer | Fields | Goes To |
|-------|--------|---------|
| Layer 1: Legal Knowledge | primary_acts, limitation, facts_must_cover, mandatory_averments, defensive_points, drafting_red_flags, coa_guidance | LLM prompt (guidance) |
| Layer 2: Document Components | available_reliefs (with prayer_text), jurisdiction_basis, valuation_basis, legal_basis_text | LLM prompt (structured data) |
Trial court: plaint, written_statement, rejoinder, counter_claim
Applications: interim_application, condonation_of_delay, set_aside_ex_parte, caveat
Appellate: appeal_memo, revision_petition, review_petition
Post-decree: execution_application
Each schema defines: section order, per-section instructions, filed_by, annexure_prefix, verification_type, filing_rules.
═══ DOCUMENT STRUCTURE (follow this section order exactly) ═══
[from document schema]
═══ LEGAL DATA (cite ONLY from this) ═══
[from LKB Layer 1 + Layer 2]
═══ FACTS GUIDANCE ═══
[from LKB facts_must_cover + red_flags]
═══ CLIENT FACTS ═══
[from user intake]
~1,500 tokens. Clear hierarchy. 3 sections, not 13.
intake_classify (cause_type + document_type)
→ enrichment (LKB + document schema)
→ draft (structured prompt → LLM → complete document)
→ gates (evidence_anchoring, lkb_compliance, postprocess, citation_validator)
→ review (optional)
→ END
New cause type: 1 LKB entry → works with ALL 12 doc types
New document type: 1 schema → works with ALL 92 cause types
New domain: N LKB entries + reuse schemas → 0 code changes
available_reliefs with prayer_text, jurisdiction_basis)_build_lkb_brief_context)document_type to intake classification| Family | Status | |--------|--------| | Possession | Done (resolver, compiler, gate) | | Injunction/Declaration | Done | | Contract/Commercial | Done | | Money/Debt | Done | | Partition/Co-ownership | Done | | Tenancy/Rent | Done | | Tort/Civil Wrong | Done | | Business/Fiduciary | Pending | | Succession/Estate | Pending |
nodes/draft_single_call.py (_build_lkb_brief_context)templates/engine.pylkb/causes/ (16 sub-group files, 92 entries)lkb/causes/_helpers.py (_entry() schema)schemas/ directorynodes/civil_decision.pystates/draftGraph.pydevelopment
# 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
development
# SKILL: draft-prompt ## Purpose Build and refine the draft prompt that produces a complete court-ready legal document in a single LLM call. v5.1 uses free-text drafting — the LLM outputs the entire document (not section-keyed JSON, not gap-fill). Exemplar-guided, LKB-informed. ## When to Use - Building or modifying `prompts/draft_prompt.py` - Debugging why draft quality is low - Tuning exemplars or context injection - Adapting prompt for a new cause type - Optimizing prompt token count ## Ar