Use when a draft spec is ready for adversarial review from multiple critical perspectives — requires completed draft phase.
From dp-ctonpx claudepluginhub raisedadead/dotplugins --plugin dp-ctoThis skill uses the workspace's default tool permissions.
references/adversarial-lenses.mdreferences/anti-rationalization.mdreferences/findings-template.mdreferences/pre-mortem-template.mdreferences/red-flags.mdreferences/severity-levels.mdDesigns and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Implements structured self-debugging workflow for AI agent failures: capture errors, diagnose patterns like loops or context overflow, apply contained recoveries, and generate introspection reports.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Running: challenge — Adversarial review of the draft from multiple critical lenses. Expect: A findings table with severity ratings, a pre-mortem summary, and an approve/revise/reject gate.
Read references/anti-rationalization.md before proceeding.
Stage must be drafted (document authored by /dp-cto:draft). The stage machine hook enforces this.
.claude/dp-cto/*.spec-stage.json) to find the current session contextdocs/, specs/, rfcs/, or project root)/dp-cto:draft first." STOP.Read references/adversarial-lenses.md to discover the available lenses, contradiction detection protocol, pre-mortem format, and finding format.
Determine which lenses to apply:
challenge scale security): run only those lenses. Validate each name against the lenses defined in adversarial-lenses.md. If any name does not match, report the invalid name and list the available lenses. STOP.adversarial-lenses.md.Spawn exactly 1 dp-cto:challenger named Agent with a prompt constructed from:
The agent prompt must include:
After the agent completes:
[CRITICAL], [WARNING], and [SUGGESTION] findingsreferences/findings-template.md for the consolidated findings table format.Review pre-mortem scenarios from the agent output. Read references/pre-mortem-template.md for the scenario format. If the agent did not produce scenarios, synthesize them from the findings.
Present the consolidated findings table, pre-mortem scenarios, and a summary:
## Challenge Complete
**Document**: {document_path}
**Lenses applied**: {comma-separated list of lenses applied}
**Findings**: {critical_count} critical, {warning_count} warnings, {suggestion_count} suggestions
**Pre-mortem scenarios**: {scenario_count} identified
Use AskUserQuestion with exactly three options:
If the user selects Reject, stop and print: "Challenge rejected. Run /dp-cto:draft to revise the document."
If the user selects Approve, print: "Challenge complete. Run /dp-cto:handoff to produce the implementation-ready package."
Do NOT invoke handoff. The user decides when to proceed.
<CHAIN> Challenge complete. The next step is /dp-cto:handoff. The user decides when to run it. </CHAIN>| # | Rule |
|---|---|
| 1 | NEVER review the document yourself — the agent applies the lenses |
| 2 | NEVER skip default lenses unless user explicitly passes a lens subset |
| 3 | NEVER accept all findings uncritically — present for user approval |
| 4 | NEVER dismiss all findings — each was found for a reason |
| 5 | NEVER skip the pre-mortem — it catches systemic risks lenses miss |
| 6 | NEVER auto-invoke handoff — the user decides when to proceed |
| 7 | NEVER allow more than 2 revision rounds — after 2, only approve or reject |
Read references/red-flags.md before proceeding. It contains the stop conditions for this skill.