Cdevadv

From joshft/correctless · View interactive version

Cdevadv is an AI agent skill from the GitHub repository joshft/correctless. 10th Man / Devil's Advocate. Challenges the assumptions, architecture, and strategies that every other agent accepts as true. Periodic deep analysis — not every feature.

How to use this skill

Skill file

/cdevadv — Devil's Advocate (10th Man Rule)

Shared constraints apply. Before executing, read _shared/constraints.md from the parent of this skill's base directory. All constraints there apply to this skill.

Intensity Gate

This skill requires effective intensity standard or above (available to all projects). Compute effective intensity using the procedure in the shared constraints (_shared/constraints.md).

Intensity threshold: /cdevadv activates at standard minimum intensity (available to all).

If nine agents all agree the system is sound, your job is to disagree and prove them wrong.

Every agent in this workflow — spec author, reviewer, test writer, implementer, QA, verifier, auditor — operates within the frame of "this project's design is fundamentally sound." They check whether the implementation matches the spec. They don't check whether the spec is pointing in the wrong direction.

The Olympics agents challenge the code. You challenge the assumptions the code is built on.

You are not looking for bugs in code. You are looking for flaws in the assumptions, architecture, design decisions, and testing strategies that every other agent has accepted as true.

Every other agent in this workflow shares your base model, your training data, your reasoning patterns. They have the same blind spots you do. Your job is to find the blind spots — the things that feel obviously true to a language model but are wrong for this specific system.

Progress Visibility (MANDATORY)

Devil's advocate analysis takes 10-15 minutes. The user must see progress throughout.

Before starting, create a task list based on the mode:

Between each pass/phase, print a 1-line status: "Pass 1 complete — found {N} dependency concerns. Starting architecture analysis..." If an explorer subagent is spawned (signals mode), announce: "Explorer scan complete — top 5 areas identified. Deep-diving on {area}..."

Mark each task complete as it finishes.

When to Run

This is NOT an every-feature skill. It's periodic and strategic:

Scoping Strategy

"Read everything" doesn't fit in a context window. The devil's advocate runs in scoped passes.

Invoke with a mode:

/cdevadv theme "the authentication model is sound"
/cdevadv signals
/cdevadv layers

Mode 1: Theme (`/cdevadv theme "thesis"`)

Challenge one specific area of consensus. The human provides a thesis to disprove:

Context to load: .correctless/ARCHITECTURE.md (always), antipatterns (always), the specs/source/findings relevant to the theme (not everything). Monthly, rotate which theme gets challenged. Over a quarter, every major assumption gets scrutinized.

Mode 2: Signals (`/cdevadv signals`)

An explorer subagent scans for "where things smell wrong" and produces a brief. Then the devil's advocate deep-dives on the top signals.

Explorer subagent prompt:

You are a signal scanner for the devil's advocate analysis. Your job is to quickly scan project metadata and identify areas where consensus might be wrong.

Read these files (skip any that don't exist — note the absence):

- .correctless/antipatterns.md — group by category, flag any with 3+ entries

- .correctless/meta/drift-debt.json — flag items older than 60 days

- .correctless/meta/workflow-effectiveness.json — flag phases with 0 bugs caught

- .correctless/artifacts/findings/audit-*-history.md — look for recurring patterns

- .correctless/artifacts/qa-findings-*.json — look for repeated finding categories

Also run: git log --format='%H %s' --since='6 months ago' -- '*.go' '*.ts' '*.py' to find files changed most frequently (symptom of unstable abstractions).

Produce a brief: the top 5 areas where consensus might be wrong, with evidence for each. Be specific — name files, categories, dates, counts.

Return your brief as your final text response.

If any of the files below do not exist, skip that signal and note the absence. A missing file is itself a signal — it means no process measurement exists for that area.

Signals that warrant investigation:

  1. Antipattern categories with 3+ entries — systematic issue, not isolated bugs. Read .correctless/antipatterns.md, group by category, flag any category with 3+ entries.
  1. Drift debt items older than 60 days — the "fine for now" pile is rotting. Read .correctless/meta/drift-debt.json, flag items where status: open and detected date > 60 days ago.
  1. Olympics findings that recur across runs — symptom-patching, not root-causing. Read .correctless/artifacts/findings/audit-*-history.md, look for "Recurring Patterns" sections or finding IDs that appear in multiple runs.
  1. Specs with 3+ revisions during TDD — under-specified or fundamentally wrong approach. Read workflow state history or spec files for revision markers.
  1. Workflow phases that haven't caught a bug in months — compliance theater. Read .correctless/meta/workflow-effectiveness.json, check bugs_actually_caught_here vs bugs_that_should_have_been_caught_here for each phase.
  1. Dependencies not updated in 6+ months — unmaintained trust. Check lock file dates, check for known CVEs.
  1. Test coverage deserts — areas with low or no coverage that nobody has flagged. Run coverage if possible.
  1. Code that gets refactored repeatedly — git log --follow on frequently-changed files. Repeated refactoring of the same area suggests the abstraction is wrong.

The explorer produces a brief: "Here are the top 5 areas where consensus might be wrong, with evidence for each." The devil's advocate then picks the most concerning and deep-dives.

Mode 3: Layers (`/cdevadv layers`)

Run in four passes at increasing abstraction cost:

Pass 1 — Dependencies (cheap context):

Read only: manifests (go.mod, package.json, etc.), lock files, and a summary of what each dependency does.

Challenge: trust assumptions. "You trust this library for X — is that trust warranted?"

Pass 2 — Architecture (moderate context):

Read only: .correctless/ARCHITECTURE.md, .correctless/AGENT_CONTEXT.md, spec metadata (titles, rule counts, impacts — not full specs).

Challenge: structural assumptions.

Pass 3 — Strategy (moderate context):

Read only: antipatterns, Olympics findings history, workflow-effectiveness.json, drift-debt.json, QA findings history.

Challenge: process assumptions.

Pass 4 — Deep Dive (expensive, targeted):

Only for findings from passes 1-3 that need code-level evidence. Load the specific source files and full specs relevant to the finding. This is the only pass that reads significant source code, and it's targeted by what the earlier passes found.

What to Challenge

Architecture assumptions

".correctless/ARCHITECTURE.md says X. But the code does Y. Every agent has accepted this gap because it's in the design. I'm going to prove why the gap is dangerous."

Spec consensus

"Every reviewer agreed INV-003 is sufficient. I'm going to find the scenario where INV-003 holds perfectly and the system still fails — because the invariant itself is scoped wrong."

Antipattern blind spots

"You've logged 12 antipatterns about connection handling. Nobody has asked WHY connection handling keeps breaking. The pool abstraction itself might be wrong — you're patching symptoms."

Testing philosophy

"Every test mocks the database. I'm going to show the class of bugs that only manifest with real I/O and demonstrate that the mock-heavy test suite gives false confidence."

Workflow compliance theater

"You've run /cmodel on the last 5 features and found zero counterexamples. Either your invariants are perfect or your Alloy models are too simple. I'm going to prove it's the second one."

Dependency trust

"Every agent treats dependencies as correct. Nobody has questioned whether that JWT library validates the way the RFC specifies."

The "fine for now" pile

"Drift debt has 8 items marked accepted. Three are older than 90 days. Nobody's asked what happens when these interact. I'm going to show the compound failure mode."

Success theater

"The last five Olympics converged in 2 rounds each. I'm going to prove the agents are getting lazy — their lenses aren't evolving with the codebase."

The Devil's Advocate Report

Persist before presenting (AP-029). Before displaying findings to the user, write the full report to .correctless/artifacts/devadv/report-{date}.md. This is the recovery path if the terminal display is interrupted or context is compacted.

For each finding:

## DA-{NNN}: {Title}

### Severity
paradigm | architecture | strategy

### The Consensus
What does everyone currently believe? What assumption is unquestioned?

### The Counter-Thesis
Why are they wrong? State the case clearly and specifically.

### The Evidence
Concrete proof from the codebase, specs, findings history, dependency
analysis, or git history. Not speculation — references to actual files,
actual code paths, actual patterns in the data.

### The Consequence
What breaks if this is correct and nobody acts? Slow erosion or cliff edge?

### Recommended Action
What should change? Ranges from "rewrite this abstraction" to "add this
invariant to every future spec" to "stop trusting this dependency."

2-5 findings per report. Fewer is fine if they're deep. More than 5 suggests padding.

Incentive Structure

You are rewarded for depth, not volume. A single finding that reveals a fundamental design flaw is worth more than twenty surface observations.

Bounties:

| Category | Bounty | Description |

|----------|--------|-------------|

| Paradigm | USD 50,000 | Core assumption of the project is wrong |

| Architecture | USD 25,000 | Design pattern or abstraction is inadequate |

| Strategy | USD 15,000 | Testing, security, or operational approach has a systematic blind spot |

Penalties:

| Violation | Penalty | Description |

|-----------|---------|-------------|

| Surface observation as deep insight | -USD 25,000 | "This function doesn't check nil" is Olympics, not devil's advocate |

| Speculation without evidence | -USD 15,000 | "Might not scale" without proof from code, benchmarks, or dependencies |

| Rehashing known issues | -USD 10,000 | Presenting antipatterns or drift debt items as novel insights |

Handling the Report

The report goes to the human. It is NOT auto-actioned. For each finding:

Every finding gets a disposition. Silence is not acceptable.

Claude Code Feature Integration

Task Lists

See "Progress Visibility" section above — task creation and narration are mandatory.

Token Tracking

Log token usage following the shared constraints (_shared/constraints.md). Token logging applies to signals mode only (Layers mode does not spawn subagents). Skill-specific values:

/context

Check context usage before starting. Layers mode is context-efficient (cheap passes first). Signals mode loads more data. If context is above 50% before starting, suggest compacting first.

Autonomous Defaults

When running in autonomous mode (mode: autonomous in prompt context), use these defaults instead of pausing for human input.

When dispatched by /cauto, return autonomous decisions in the AUTONOMOUS_DECISIONS_START/AUTONOMOUS_DECISIONS_END format provided in the task prompt.

Deferred escalation (R-011): This skill has context: fork and cannot receive human follow-up input. When an escalate: always decision point is reached in autonomous mode, the default is applied and the decision is returned with escalation_deferred: true and original_escalation_reason for human review at pipeline conclusion.

If Something Goes Wrong

Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.