From epic
Runs parallel code quality, security, and test audits with semantic dedup and per-dimension PASS/WARN/FAIL verdicts. Supports strict mode for trust-boundary isolation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/epic:auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**CRITICAL**: Run `HARNESS_DIR=$(epic path)` first. NEVER use `.harness/` in the project directory.
CRITICAL: Run HARNESS_DIR=$(epic path) first. NEVER use .harness/ in the project directory.
This skill has 3 internal modes that run in parallel:
--strict Mode (Trust Boundary Isolation)When invoked with --strict (or when .harness/engagement.md has mode: strict), the audit enforces independence between verification agents to prevent reward hacking:
audit:code and audit:security run without visibility into each other's findings. Results are combined only during synthesis (Step 4)./go), a different agent instance must run audit. The builder's session ID is checked and excluded.Use --strict for security-sensitive projects, compliance requirements, or when the build phase had ambiguous outcomes.
Confirm go has run:
git symbolic-ref --short HEAD # must NOT be main/master
Load the spec to know what was supposed to be built:
ls -t $HARNESS_DIR/specs/SPEC-*.md | head -1
Read the Requirements and Acceptance Criteria sections.
git diff --stat $(git merge-base HEAD main)
git diff --name-only $(git merge-base HEAD main)
| Pattern | Scope | Extra checks |
|---|---|---|
*.api.*, *route*, *controller*, *handler* | API | + Contract testing, request validation |
*.tsx, *.jsx, *.vue, *.svelte, *.css | Frontend | + Accessibility, semantic HTML |
*.sql, *migration*, *schema* | Database | + Migration safety, rollback plan |
*.rs, Cargo.toml, *.go, go.mod | Backend | + Build verification, type safety |
*.test.*, *.spec.*, __tests__/ | Tests | + Coverage delta, flaky test detection |
Dockerfile*, *.yml, *.yaml, Makefile | Infra | + Config validation, secret detection |
*.md, *.txt | Docs | + Link checking, freshness |
Launch all 3 modes with run_in_background: true.
--strict isolation protocol: When strict mode is active, each mode agent must be launched with:
This ensures each mode forms independent conclusions. Results are combined only in Step 4 synthesis.
## Code Review: <file or area>
- [BLOCKER] <description> (line X)
- [WARN] <description> (line Y)
- [NIT] <description> (line Z)
## Summary
- Blockers: N
- Warnings: N
- Verdict: APPROVE / REQUEST_CHANGES
.env files are in .gitignore## Security Audit
- [CRITICAL] SQL injection risk in <file>:<line>
- [HIGH] Hardcoded secret in <file>:<line>
- [MEDIUM] Missing rate limit on <endpoint>
## Performance Audit
- [HIGH] N+1 query in <file>:<line>
- [MEDIUM] Unbounded array growth in <file>:<line>
## Summary
- Security: PASS / FAIL (N critical, N high)
- Performance: PASS / WARN (N issues)
After all 3 modes complete, merge their findings and deduplicate:
Collection: Gather all findings from code, security, and test modes into a single pool.
Root-Cause Grouping: For each finding, identify the root cause. Findings sharing the same root cause (same file, same function, same underlying pattern) form a group.
Classification (per group):
| Classification | Meaning | Action |
|---|---|---|
NEW | First finding for this root cause | Include in report |
DUP_BETTER | Duplicate with better evidence or higher severity | Replace original with this |
DUP_SKIP | Duplicate with weaker or equal evidence | Drop; reference the NEW finding |
Severity Reassessment: The surviving finding in each group takes the highest severity across all modes. For example, if code review says [WARN] but security says [CRITICAL] for the same root cause, the deduped finding is [CRITICAL].
Output: Only deduplicated findings proceed to Step 4 synthesis. The report should note: "N findings deduplicated from M total (K groups collapsed)."
Combine deduplicated findings into a single report:
## Audit Report
- Spec: SPEC-{timestamp} ({goal_slug})
- Branch: {current branch}
### Change Scope
- Scopes detected: [API, Frontend, Backend, Database, Infra, Docs, Tests]
- Scope-specific checks: [list what ran]
### Code Quality: [PASS/WARN/FAIL]
### Security: [PASS/WARN/FAIL]
### Performance: [PASS/WARN/FAIL]
### Tests: [X/Y passing, Z% coverage]
### Deduplication
- Total findings: M
- Deduplicated: N (K groups collapsed)
### Spec Coverage
- R1: ✅/❌ addressed in diff
- R2: ✅/❌ addressed in diff
- AC1: ✅/❌ verified by test
- AC2: ✅/❌ verified by test
### Action Items
1. [blocker or warning]
/ship to create a PR."/go, then re-run /audit."| Excuse | Rebuttal | What to do instead |
|---|---|---|
| "It's a small change, skip security" | Small changes introduce big vulnerabilities | Always run the security checklist |
| "Tests are passing, that's enough" | Tests don't catch security or performance issues | Run all 3 modes |
| "I'll fix the warnings later" | Later never comes | Fix blockers now, warnings before merge |
| "Dedup is overkill for small audits" | Small audits can still have cross-mode overlap | Always dedup — the cost is trivial |
| "Strict mode is overkill" | Without isolation, the builder can influence reviewers via shared context | Use --strict for security-sensitive or compliance-driven projects |
| "The agents are independent enough" | Shared context creates anchoring bias — a clean code review inflates security scores | Strict mode ensures blind scoring until synthesis |
Creates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.
npx claudepluginhub epicsagas/epic-harness --plugin epic-harness