/sd0x-dev-flow:deep-explorefrom sd0x-dev-flow
Orchestrates multi-wave parallel code exploration for large-scale codebase research. Uses multiple agents to investigate different areas simultaneously, producing a unified report with completeness scoring.
Ships in sd0x-dev-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Scenario | Alternative |
|---|---|
| Quick single-area lookup | /code-explore |
| Dual Claude+Codex confirmation | /code-investigate |
| Git history tracking | /git-investigate |
| Code review | /codex-review-fast |
flowchart TD
A[Phase 0: Intent Analysis] --> B{Files > 25?}
B -->|No| C[Redirect to /code-explore]
B -->|Yes| D[Wave 1: Breadth]
D --> E[Gather + Claim Registry]
E --> F[Wave 2: Depth]
F --> G{Completeness Gate}
G -->|score >= 80 + no critical Qs| H[Report]
G -->|score < 80 OR critical Qs| I[Wave 3: Cross-cutting]
I --> H
Grep for related keywords → count unique files/code-explore| Priority | Method | When |
|---|---|---|
| 1 | User-specified areas (--areas) | User knows what to split |
| 2 | Domain-based clustering | Auto-detect service/provider/hooks/rules boundaries |
| 3 | Directory-based fallback | When domain boundaries unclear |
Output: ownership matrix (shard → files).
Fan-out 2-3 Explore agents in parallel. Each agent explores one shard.
Agent({
description: "Wave 1 Shard A: <area description>",
subagent_type: "Explore",
run_in_background: true,
prompt: <agent-prompt template from references/agent-prompt.md>
});
All agents dispatched in a single message (parallel). Wait for all to complete.
| Allocation | Scope | Limit |
|---|---|---|
| 80% | Primary assigned shard | Unlimited findings |
| 20% | Peripheral vision (security, edge cases, cross-cutting) | Max 2 peripheral findings |
Peripheral findings must be evidence-backed (file:line) and tagged: cross-cutting | security | reliability | operability.
After each wave, the orchestrator:
references/synthesis.md)impact × uncertainty| Pass | Don't Pass |
|---|---|
| Evidence-backed facts (file:line) | Prior wave conclusions as truth |
| Open Qs ranked by impact × uncertainty | Narrative interpretations |
| Do-not-repeat ledger (explored files, executed queries) | Full raw findings dump |
| Contradiction list | Agent opinions without evidence |
Focus on top hotspots from Wave 1, ranked by impact × uncertainty × blast_radius.
After Wave 2 (and Wave 3 if run), compute completeness score.
score = round(100 × (0.7 × (1 - novelty_rate) + 0.3 × is_zero(critical_open)))
Where:
novelty_rate = unique_new_findings / max(1, total_valid_findings)
critical_open = count(questions where impact=high AND uncertainty=high)
is_zero(x) = 1 if x == 0, else 0
Zero findings → novelty_rate = 0 → score = 70 (below threshold → continue).
| Condition | Action |
|---|---|
score >= 80 AND critical_open == 0 | Stop, output report |
score >= 80 AND critical_open > 0 | Wave 3 (if not yet run) |
Wave 3 done AND score < 80 | Stop with Inconclusive + next actions |
--waves is hard ceiling)User --waves | Hard-fail active | Behavior |
|---|---|---|
--waves 2 | No | Stop after Wave 2 |
--waves 2 | Yes | Stop after Wave 2 with Inconclusive |
--waves 3 | No | Adaptive (stop early if score met) |
--waves 3 | Yes | Force Wave 3 |
User --waves never exceeded. Hard-fail emits Inconclusive with explanation.
Triggered only when:
If no trigger conditions met, skip Wave 3 even if score < 80.
Agents in Wave 3 follow 80/20 contract. If trigger is cross-cutting, one agent may operate as conditional scout with broader mandate.
// Primary: Agent tool with subagent_type=Explore
Agent({
description: "Wave N Shard X: <description>",
subagent_type: "Explore",
run_in_background: true,
prompt: `<from references/agent-prompt.md>`
});
Fallback (if Explore dispatch fails):
subagent_type: "general-purpose"See references/synthesis.md for full algorithm.
| Step | Action |
|---|---|
| 1. Normalize | {claim, evidence(file:line), shard, wave, confidence} |
| 2. Dedup | Key = canonical_file_path + canonical_claim_text (±5 line tolerance) |
| 3. Consensus | Same claim from 2+ shards → [consensus] |
| 4. Conflict | Contradicting claims → evidence-weight resolution |
| 5. Divergence | Unresolvable → explicit divergence section |
Evidence redaction: follow @rules/logging.md — no secrets, file:line refs only.
| Argument | Description | Default |
|---|---|---|
<query> | Research topic/question | Required |
--agents N | Agents per wave (1-3) | 3 |
--waves N | Max waves (2-3) | 3 (adaptive) |
--areas "a, b, c" | Manual shard specification | Auto-detect |
--quick | Redirect to /code-explore | Off |
See references/synthesis.md for report template.
## Deep Exploration Report: <query>
### Completeness
- Score: <N>/100
- Waves executed: <N>
- Agents dispatched: <N>
### Executive Summary
<2-3 sentence answer to user's question>
### Per-Wave Findings
| Wave | Focus | Key Findings | Open Qs |
|------|-------|-------------|---------|
### Claim Registry
| # | Claim | Evidence | Source | Confidence | Consensus |
|---|-------|----------|--------|------------|-----------|
### Coverage Matrix
| Shard | Files Explored | Ownership |
|-------|---------------|-----------|
### Proactive Discoveries (from 20% peripheral)
| # | Finding | Tag | Evidence |
|---|---------|-----|----------|
### Divergence (if any)
| # | Claim A | Claim B | Source Agents | Status |
|---|---------|---------|--------------|--------|
### Residual Risks
- <remaining unknowns and suggested follow-up commands>
git add/commit/push executedreferences/agent-prompt.mdreferences/synthesis.mdInput: /deep-explore "How does the review pipeline work end-to-end?"
Action: Phase 0 → Wave 1 (hooks, skills/review, rules/auto-loop) → Wave 2 (state machine, gate logic) → Report
Input: /deep-explore --areas "hooks, skills/codex-code-review, rules" "Review system architecture"
Action: Phase 0 (user shards) → Wave 1 (3 agents) → Wave 2 (hotspots) → Report
Input: /deep-explore --quick "How does review-state.js work?"
Action: Redirect to /code-explore (small scope)
Input: /deep-explore --agents 2 --waves 2 "Plugin install flow"
Action: Phase 0 → Wave 1 (2 agents) → Wave 2 (2 agents) → Report (max 2 waves)
What SKILL.md sets; muted values are Claude Code's defaults
102 skills in this plugin
/adrWrite an Architecture Decision Record (ADR) for a feature — Context / Decision / Status / Consequences / Alternatives, filed as docs/features/<feature>/adr-<NNN>-<title>.md with a 3-digit zero-padded number. Handles the Superseded case: bidirectional linking when a new ADR replaces an old one. Use when: recording why an architectural approach was chosen, documenting a decision so it doesn't get re-litigated, marking a prior decision as superseded. Not for: feature-level technical design (use /tech-spec), task progress tracking (use /create-request), bulk backfill of historical decisions (a separate request — this skill writes one ADR at a time)./agentctl-setupInstall and set up the optional agentctl mod (task scope, refusal before execution, evidence that goes stale, model-free hand-over) — checks the environment, installs after approval, builds the first task line, optional deny rules, uninstall/architectureArchitecture design and documentation. Produces 3-architecture.md with component diagrams, data flow, integration points, and architecture decisions. Reads existing tech-spec as input. Use when: designing system architecture, documenting component interactions, creating architecture docs, producing 3-architecture.md. Not for: tech spec writing (use tech-spec), code implementation (use feature-dev), architecture consulting only (use codex-architect)./askContext-aware Q&A with auto context gathering. Use when: user has a quick question about codebase, git history, rules, docs, or skills during development. Not for: code changes (use feature-dev), code review (use codex-review-fast), deep research (use deep-research), full code trace (use code-explore). Output: structured answer with source attribution./best-practicesIndustry best practices conformance audit with mandatory adversarial debate. Produces audit artifact: verdict (OK/WARN/FAIL) + gap roadmap + debate proof. Use when: auditing current implementation against industry standards, checking compliance with best practices, benchmarking implementation quality, verifying a codebase meets a standard. Not for: broad research/discovery without audit target (use /deep-research), code review (use /codex-review), architecture design (use /codex-architect)./bug-fixBug fix workflow. Use when: fixing bugs, resolving issues, regression fixes. Not for: new features (use feature-dev), understanding code (use code-explore). Output: fix + regression test + review gate.npx claudepluginhub sd0xdev/sd0x-harness --plugin sd0x-dev-flowOther plugins' skills for the same job