Intent in-tca-audit
TCA audit: execute component audits with sub-agents, track progress, manage context
git clone https://github.com/matthewsinclair/intent
T=$(mktemp -d) && git clone --depth=1 https://github.com/matthewsinclair/intent "$T" && mkdir -p ~/.claude/skills && cp -r "$T/intent/plugins/claude/skills/in-tca-audit" ~/.claude/skills/matthewsinclair-intent-in-tca-audit && rm -rf "$T"
intent/plugins/claude/skills/in-tca-audit/SKILL.mdTCA Audit
Executes the component audit phase (Phase 1) of a Total Codebase Audit. Manages sub-agent launches, progress tracking, context management, and commit discipline.
For reference:
intent/docs/total-codebase-audit.md
Procedure
1. Check progress
Run the progress script to see current state:
bash "$(find ~/.claude/skills/in-tca-audit -name tca-progress.sh 2>/dev/null | head -1)" \ --tca-dir intent/st/STXXXX
This shows which WPs are complete, pending, or in-progress, with violation counts.
2. Select next WP batch
From the batch ordering in
design.md, identify the next batch of WPs to audit. WPs within a batch can run in parallel if they don't share files.
3. Pre-flight checklist (per WP)
Before launching each sub-agent:
- Run
to reclaim context window space/compact - Verify file manifest -- confirm all files in the WP's
exist:info.mdfor f in $(grep "^- \`" WP/NN/info.md | sed 's/.*`\(.*\)`.*/\1/'); do [ -f "$f" ] || echo "MISSING: $f" done - Check context usage -- if above 70%, consider fresh session
- Verify previous WP committed -- no uncommitted audit files
4. Launch sub-agent
Use the prompt template with these required elements:
You are performing a forensic code audit of the **{Component Name}** subsystem in the {Project} application. ### Audit Rules | # | Rule | What to Check | | --- | ----------------------- | ------------------------------------------ | | R1 | {rule name} | {brief description of what to look for} | ... ### Files to Audit 1. `{path/to/file1}` 2. `{path/to/file2}` ... ### Special Focus {R-numbers and why they matter for this component} ### Cross-WP Highlander Check - vs. WP-XX: {what logic might be duplicated and why} - vs. WP-YY: {what logic might be duplicated and why} ### Instructions Read EVERY file listed above. For each file, check every function against all rules. Report violations in this exact format: #### V{N}: {short title} - **File**: `{path}:{line(s)}` - **Rule**: R{N} -- {rule name} - **Severity**: High | Medium | Low - **Confidence**: HIGH | MEDIUM | LOW - **Description**: {what the violation is} - **Remedy**: {how to fix it} After all violations, add a summary table: ### Summary | Severity | Count | | --------- | ----- | | High | X | | Medium | Y | | Low | Z | | **Total** | **T** | Write the complete audit to `{path/to/WP/NN/socrates.md}`. Be thorough. Do NOT skip files. Do NOT invent violations -- only report what you actually see in the code. If a file has no violations, say so explicitly.
Agent selection:
| Agent Type | Use For |
|---|---|
| Primary choice -- Socratic dialog, structured output |
| Large polyglot WPs where no specialized agent matches |
| Pre-audit reconnaissance if component boundaries unclear |
| Elixir-specific deep dives (post-audit) |
The prompt is the quality driver, not the agent type.
5. Post-WP
After each sub-agent completes:
- Record metadata at the top of
as the first non-heading line (or right after the H1 title). Format:WP/{NN}/socrates.md
. Example:**Agent**: {type}; **Turns**: N; **Raw hits**: N; **FPs**: N
. This line is queryable across audits and feeds directly into the "Sub-Agent Effectiveness" section of the final feedback report. Without it, cross-TCA comparisons have to record "not tracked" for agent effectiveness, which is exactly what happened on the Lamplight ST0121 run that motivated this rule.**Agent**: elixir; **Turns**: 24; **Raw hits**: 9; **FPs**: 2 - Commit immediately:
git add WP/{NN}/socrates.md && git commit -m "audit: WP-{NN} {component}" - Log the summary in your running tally
- Run progress check to update status
6. Repeat
Continue launching sub-agents for each WP in the current batch, then move to the next batch per the ordering in design.md.
7. Final check
After all component WPs are done, run the progress script one final time:
bash "$(find ~/.claude/skills/in-tca-audit -name tca-progress.sh 2>/dev/null | head -1)" \ --tca-dir intent/st/STXXXX
Exit code 0 confirms all WPs complete. Proceed to
/in-tca-synthesize.
Crash Prevention
| Risk | Mitigation |
|---|---|
| Context overflow | before each WP |
| Lost work | Commit after every WP (never batch) |
| Sub-agent stall | Set max_turns limit on large WPs |
| Session crash | Keep a running log outside the session |
| WP too large | Split WPs with >60 files into sub-WPs |
| File manifest | Verify files exist before each WP |
Important Notes
- Never batch commits -- commit after every single WP
- The anti-hallucination instruction is not optional
- Include the confidence field in every violation
- If context usage exceeds 70%, start a fresh session rather than risk truncation