plugins/development-harness/skills/forensic-review/SKILL.md
Use when SAM Stage 5 Execution has completed and task results need independent verification against acceptance criteria. Dispatches a separate reviewer agent to fact-check implementation outputs and returns COMPLETE or NEEDS_WORK with specific findings and remediation tasks.
npx skillsauth add jamie-bitflight/claude_skills forensic-reviewInstall 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.
SAM Stage 6 delegates the concrete review work to @dh:code-reviewer. This skill is the
orchestration wrapper: it resolves the task context, dispatches the agent, and maps its
structured output back to the SAM pipeline verdict.
Producer and reviewer must always be different agents — never invoke this skill from the same agent that executed the task.
AI cannot reliably self-evaluate. The agent that wrote the code cannot objectively assess its own work. Forensic review uses a separate agent with fresh context to verify claims against observable evidence.
flowchart TD
Start([ARTIFACT:EXECUTION + ARTIFACT:PLAN]) --> R1[1. Resolve task context]
R1 --> R2[2. Dispatch @dh:code-reviewer]
R2 --> R3[3. Consume verdict from STATUS output]
R3 --> R4[4. Read codebase-analysis artifact]
R4 --> Decide{Verdict?}
Decide -->|PASS| Complete[Verdict — COMPLETE]
Decide -->|NEEDS-WORK or FAIL| NeedsWork[Verdict — NEEDS_WORK]
Complete --> Done([ARTIFACT:REVIEW registered by agent])
NeedsWork --> Remediate[Create remediation tasks from blocking findings]
Remediate --> Done
Read the task via MCP:
sam_task(plan="{plan_id}", task="{task_id}", config={"action": "read"})
Extract:
task_file_path — the path to the task YAML file (e.g., plan/P{id}-{slug}.yaml)issue_number — required for artifact registration; if absent, BLOCK immediatelyexpected_outputs — the implementation files produced by Stage 5 (listed in the task's
"Files Changed" or "Expected Outputs" section)acceptance_criteria — the explicit success conditions to verifyDelegate the concrete S6 review work with subagent_type="dh:code-reviewer".
Context to include in the prompt:
task_file_path — path to the SAM task fileimplementation_files — the files from the task's Expected Outputsissue_number — required for artifact_register inside the agentTask is S6 forensic review with subagent_type="dh:code-reviewer"
Context: task_file_path={task_file_path}, issue_number={issue_number},
implementation_files={expected_outputs}
Output: STATUS block containing Verdict (PASS / FAIL / NEEDS-WORK) and ARTIFACTS
section confirming codebase-analysis artifact registered on issue #{issue_number}
The agent independently reads the task, detects the stack, verifies acceptance criteria,
applies universal and stack-specific quality dimensions, and registers the review report
as a codebase-analysis artifact via artifact_register.
Parse the agent's STATUS output:
Verdict: PASS → map to SAM verdict COMPLETEVerdict: NEEDS-WORK or Verdict: FAIL → map to SAM verdict NEEDS_WORKIf the agent returns STATUS: BLOCKED, propagate the block upstream with the agent's NEEDED section as the reason.
Retrieve the registered review report:
artifact_read(issue_number={issue_number}, artifact_type="codebase-analysis")
Use this to populate the SAM task's Review Results section and to extract blocking findings for remediation task creation.
Append review results to the task:
sam_task(
plan="{plan_id}",
task="{task_id}",
config={"action": "update", "append_section": "Review Results", "section_content": "{artifact_content}"}
)
ARTIFACT:EXECUTION + ARTIFACT:TASK via sam_task(plan="{plan_id}", task="{task_id}", config={"action": "read"})issue_number — must be present; used by @dh:code-reviewer for artifact_register and
by this skill for artifact_readWhen the verdict is NEEDS_WORK or FAIL, extract blocking findings from the
codebase-analysis artifact's "Required changes (blocking)" or "Blocking" section.
flowchart TD
NW([NEEDS_WORK verdict]) --> Extract[Extract blocking findings from codebase-analysis artifact]
Extract --> Create[Create remediation TASK files — one per blocking finding]
Create --> Stage5[Stage 5 — Execute remediation tasks]
Stage5 --> Stage6[Stage 6 — Re-review via @dh:code-reviewer]
Stage6 --> Q{PASS?}
Q -->|Yes| Done([Proceed to next task or Stage 7])
Q -->|No| Extract
Remediation tasks follow the same CLEAR format as original tasks. They:
@dh:code-reviewer STATUS output — do not invent itcodebase-analysis artifact — do not
invent them from the agent's STATUS summary@dh:code-reviewer agent for the
full classification rule)@dh:code-reviewer returns STATUS: DONE with a PASS, FAIL, or NEEDS-WORK verdictcodebase-analysis artifact is registered on issue #{issue_number}sam_task(action='update')development
When an application needs to store config, data, cache, or state files. When designing where user-specific files should live. When code writes to ~/.appname or hardcoded home paths. When implementing cross-platform file storage with platformdirs.
testing
Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or action targets different system than hypothesis identified. Critical for preventing cognitive dissonance where correct diagnosis leads to wrong implementation.
tools
Reference guide for the Twelve-Factor App methodology — 15 principles (12 original + 3 modern extensions) for building portable, resilient, cloud-native applications. Use when evaluating application architecture, designing cloud-native services, reviewing codebases for methodology compliance, advising on configuration, scaling, observability, security, and deployment patterns. Incorporates the 2025 open-source community evolution and cloud-native reinterpretations of each factor.
tools
Converts user-facing documentation (how-to guides, tutorials, API references, examples) in any format — Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, TOML/YAML/JSON configs, and plain text — into Claude Code skill directories with SKILL.md plus thematically grouped references/*.md files. Use when given a docs directory or mixed-format documentation to transform into an AI skill. Uses MCP file-reader server for binary formats.