$npx -y skills add dleerdefi/claude-code-construction --skill code-researcherScope-specific code gap analysis — extracts referenced codes from project docs, researches what should apply, surfaces the delta. Triggers: 'code research', 'what codes apply', 'code check', 'ADA requirements', 'egress'.
| 1 | # Code Researcher — Scope-Specific Gap Analysis |
| 2 | |
| 3 | ## What This Skill Does |
| 4 | |
| 5 | An engineer managing one or more scopes asks: *"Are there any code requirements |
| 6 | for this scope that I'm missing?"* |
| 7 | |
| 8 | This skill answers that question in three passes: |
| 9 | |
| 10 | **Pass 1 — What the scope already addresses** |
| 11 | Read the actual project documents — spec sections, drawings, schedules — and |
| 12 | extract every code citation, standard reference, and requirement already |
| 13 | incorporated by the design team. |
| 14 | |
| 15 | **Pass 2 — What should apply** |
| 16 | Research all codes and standards that apply to this type of work in this |
| 17 | jurisdiction, regardless of what the project documents say. |
| 18 | |
| 19 | **Pass 3 — The gap** |
| 20 | Diff Pass 1 against Pass 2. Present only what's in Pass 2 but absent from |
| 21 | Pass 1, with confidence levels and specific source citations from both the |
| 22 | code and the project documents. |
| 23 | |
| 24 | **This is a gap finder, not a code summary.** If the spec already addresses a |
| 25 | requirement correctly, it does not appear in the output. The engineer's time is |
| 26 | spent only on things that may actually be missing. |
| 27 | |
| 28 | --- |
| 29 | |
| 30 | ## Framing Rule (Non-Negotiable) |
| 31 | |
| 32 | Every finding is framed as: |
| 33 | > *"Code [X] requires [Y]. The project documents [address this at / do not |
| 34 | > appear to address this]. Confidence: [level]. Recommended action: [action]."* |
| 35 | |
| 36 | Never frame findings as COMPLIANT / NON-COMPLIANT. The licensed design |
| 37 | professional makes compliance determinations. This skill provides research. |
| 38 | |
| 39 | --- |
| 40 | |
| 41 | ## Research Philosophy |
| 42 | |
| 43 | This skill uses a document-grounded research approach: |
| 44 | - **Construction documents are ground truth.** Every claim about what the project does or does not address must trace to a specific document read in Pass 1. Never infer project status from memory or assumption. |
| 45 | - **Claude's domain knowledge drives topic discovery.** Use your training knowledge of construction codes, standards, and regulatory frameworks to identify what requirements SHOULD apply to this scope. The documents tell you what IS addressed; your knowledge tells you what to check for. |
| 46 | - **Web research confirms jurisdiction-specific requirements.** Building codes vary by jurisdiction and edition. Use web search to confirm which edition is adopted, retrieve exact code language, and discover jurisdiction-specific overlays. Do not rely on training knowledge alone for specific code section numbers or thresholds — verify via web. |
| 47 | - **Reference files verify numeric thresholds.** Shared reference files at `${CLAUDE_SKILL_DIR}/../../reference/` contain structured ADA and IBC data useful for quick verification of specific dimensions and capacities during research. |
| 48 | |
| 49 | --- |
| 50 | |
| 51 | ## Workflow Overview |
| 52 | |
| 53 | ``` |
| 54 | Phase 1 — Context and Scope Definition |
| 55 | 1a Gather project context (jurisdiction, occupancy, construction type) |
| 56 | 1b Define the research scope (which spec sections, which question) |
| 57 | 1c USER CHECKPOINT — confirm scope before any research begins |
| 58 | |
| 59 | Phase 2 — Project Document Extraction (Pass 1) |
| 60 | 2a Read all project documents in scope |
| 61 | 2b Extract every code citation, standard reference, requirement |
| 62 | 2c Build the "already addressed" inventory |
| 63 | |
| 64 | Phase 3 — Code Research (Pass 2) |
| 65 | 3a Research jurisdiction and adopted code editions |
| 66 | 3b Research applicable requirements for this scope and work type |
| 67 | 3c USER CHECKPOINT — interim findings, confirm continuation |
| 68 | |
| 69 | Phase 4 — Gap Analysis (Pass 3) |
| 70 | 4a Diff research findings against project document inventory |
| 71 | 4b Classify each gap by severity and confidence |
| 72 | 4c USER CHECKPOINT — review gaps before report is written |
| 73 | |
| 74 | Phase 5 — Report |
| 75 | 5a Generate structured gap report |
| 76 | 5b Write graph entry |
| 77 | ``` |
| 78 | |
| 79 | **Human checkpoints at 1c, 3c, and 4c.** Do not skip them. |
| 80 | |
| 81 | --- |
| 82 | |
| 83 | ## Phase 1 — Context and Scope Definition |
| 84 | |
| 85 | ### 1a — Gather Project Context |
| 86 | |
| 87 | Collect minimum required project parameters. Check in this order: |
| 88 | |
| 89 | **AgentCM project files (if `.construction/` exists):** |
| 90 | - `.construction/project.yaml` — location, occupancy, construction type |
| 91 | - `.construction/index/sheet_index.yaml` — drawing set composition |
| 92 | - Database (read `query_command` from `.construction/database.yaml`): |
| 93 | - `{query_command} -c "SELECT * FROM v_room_profile WHERE room_number = '...'"` — rooms with schedule data |
| 94 | - `{query_command} -c "SELECT * FROM v_sheet_contents WHERE sheet_number = '...'"` — elements on sheets |
| 95 | - Orientation: `{query_command} -c "SELECT COUNT(*) FROM sheets WHERE project_id = '...'; SELECT COUNT(*) FROM rooms WHERE project_id = '...'"` |
| 96 | |
| 97 | **Project documents (read directly):** |
| 98 | - Architectural title block — project name, location, jurisdiction |
| 99 | - Spec Section 01 10 00 (Summary of Work) — occupancy, construction type, |
| 100 | project descrip |