From discover
Methodical 5-pass workflow (existing-system analysis, external research, filter/prioritize, adversarial+ccg cross-model stress test, ralplan implementation plan, autonomous execution with verification and git push) for adding new features to existing software or automation systems with high success rate and zero redundancy. Composes OMC and superpowers skills rather than reimplementing them. ONLY trigger when one of four hard triggers is present in the user's message — the `/discover` slash command, a message starting with `discover` followed by a colon (including `discover: resume <name>` for resuming Pass 5 in a fresh session), or the literal phrase "discover skill" anywhere in the message. Words like "add", "build", "feature", "extend", or "improve" alone are NEVER sufficient. If none of the four hard triggers is present, do NOT activate even if the request seems like a perfect fit; let the normal flow handle it. The user has chosen explicit-invocation-only because this skill is intentionally heavyweight.
How this skill is triggered — by the user, by Claude, or both
Slash command
/discover:discoverThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A workflow that takes a feature idea for an existing system and runs it through a structured pipeline: understand what already exists, research what's possible, filter to what's high-impact and non-redundant, stress-test under adversarial conditions, produce a build-ready plan, and then execute it autonomously.
A workflow that takes a feature idea for an existing system and runs it through a structured pipeline: understand what already exists, research what's possible, filter to what's high-impact and non-redundant, stress-test under adversarial conditions, produce a build-ready plan, and then execute it autonomously.
The point: cut the failure rate of "throw a feature at the codebase and hope" by enforcing a research and validation gate before code gets written, and by leaning on existing battle-tested skills (OMC's agents, ralplan, ccg, ralph, external-context, sciomc; superpowers' brainstorming) rather than reinventing them.
Only on one of four explicit triggers:
/discover slash commanddiscover: (e.g. discover: add reddit sentiment to the trade bot)discover: resume <run-name> — re-enters Pass 5 in a fresh session using artifacts saved from Pass 4use the discover skill to add reddit sentiment)If none of those four triggers is in the message, this skill does NOT activate — even if the request looks like a perfect fit. Phrases like "add a feature", "extend my system", "build me X", or "improve the bot" alone are never enough. The user has chosen explicit-invocation-only on purpose to avoid heavyweight workflows for simple changes.
Before kicking off Pass 0, verify these are available. If any are missing, tell the user what to install and stop — don't try to limp along without them.
Agent / Task dispatch instead and does not require tmux at all. Check with command -v tmux; if missing, the native layout is your path forward.~/.claude/plugins/oh-my-claudecode or running /oh-my-claudecode:omc-doctor if the user wants a deeper check.~/.claude/plugins/superpowers.command -v git.If running on a fresh project with no git remote, that's fine — just note it; the Pass 5 push step will be skipped automatically.
Each invocation creates a run directory at .claude/discover/<run-name>/ (relative to the project root). This is where every pass's output lands, and it's what survives a context compaction or a fresh terminal session.
.claude/discover/<run-name>/
├── state.json # current pass, agent assignments, mode, decisions
├── pass-0-system-map.md # output of Pass 0 (skipped on greenfield)
├── pass-1-candidates.md # output of Pass 1
├── pass-2-filtered.md # output of Pass 2
├── pass-3-stress-tested.md # output of Pass 3 (includes ccg synthesis)
├── final-plan.md # output of Pass 4 — the build-ready plan
├── EXECUTE.md # kickoff prompt to paste in a fresh session
└── pass-5-execution-log.md # populated during Pass 5
The <run-name> should be a short kebab-case slug derived from the feature idea (e.g. reddit-sentiment, csv-export, wallet-attribution). Ask the user to confirm the auto-generated slug — it's the key for the entire run.
When the skill triggers, do these things in order:
Read state.json if it exists. If the user is resuming a previous run (i.e. they invoked discover: and a state file exists for the same feature), offer to resume from the last completed pass. Don't silently overwrite.
Ask the setup questions below — REQUIRED, even under "always proceed" / no-confirmation user instructions.
These are parameter inputs, not "shall I proceed?" confirmations. They cannot be auto-defaulted because each one materially changes what the run does (filesystem key, token budget, parallelism, review checkpoints). A user-level rule like "never ask for confirmation" / "always proceed without asking" does NOT apply here — those rules govern yes/no gates on already-specified work. Setup parameters for a heavyweight workflow are a different category, and the user explicitly opted into this skill's heavyweight nature by triggering it.
Ask all of them in a single message, then wait for the answer. Do not pick defaults silently. Do not infer from CLAUDE.md / GEMINI.md / AGENTS.md. If the user replies with partial answers, ask only for the missing ones — don't fill in the rest.
.claude/discover/<run-name>/ where every artifact for this run lives (state.json + per-pass markdown + EXECUTE.md), it's the resume key if context compacts or the terminal dies (re-invoking discover: with the same name picks up from the last completed pass), and EXECUTE.md (the Pass 5 kickoff prompt) embeds the absolute path containing this slug — so renaming mid-run is awkward. Show them the auto-suggested slug and ask them to confirm or replace it. Example phrasing: "Run name — I'll use reddit-sentiment as the slug for this run. All artifacts (state.json, pass-.md, EXECUTE.md) will live at .claude/discover/reddit-sentiment/, and that name is the key you'd re-use to resume if context compacts or you reopen the session later. Confirm, or give me a different short kebab-case name."*discover: resume <run-name>; Pass 5 runs there with clean context.
Frame the tradeoff: separate-session is best for large or research-heavy plans, where Passes 0–4 burned a lot of context and the build benefits from a clean slate; build-now / review-then-build are best for small-to-medium features where switching sessions is more hassle than it's worth. Recommend separate-session as the safe default, but do not pick silently — ask.discover.sh. Requires tmux to be installed. Good when you want visible parallel panes or are resuming a layout that's already running.Agent / Task tool calls from superpowers:dispatching-parallel-agents. No tmux needed. Recommended on systems without tmux or when you want the skill to manage parallelism internally. Works identically to tmux from the perspective of the workflow; final-plan.md schema is the same regardless.Agent calls are dispatched per pass. Do not pick a default silently.Only after the user answers all three do you proceed to step 3 (greenfield detection). If the user types something that bypasses the questions ("just go", "do it"), still answer the parameter questions yourself with explicit defaults stated in the chat — never silently — so the user can see and correct what you picked.
Detect greenfield. Run git ls-files | head -50 and find . -maxdepth 2 -type f \( -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.go" -o -name "*.rs" \) | head -20 (adjust extensions to context). If the project has fewer than ~10 source files or no recognizable structure, it's greenfield. In greenfield, skip Pass 0 and proceed to Pass 1 with a one-line note in state.json. Tell the user this is happening and why.
Set up the agent layout.
discover.sh <run-name> --layout <agent-count> where <agent-count> is the number chosen in question 3. The script creates the named tmux session with the right number of panes and writes per-pane .env files. See references/tmux-layout.md for layout details and dispatch helpers.superpowers:dispatching-parallel-agents to establish the dispatch pattern. Write per-agent .env files to ${RUN_DIR}/.agent-<n>.env (same format as tmux pane env files). No tmux session is created. Agents will be dispatched as parallel Agent tool calls rather than tmux send-keys commands. Record layout: "native" and agent_count: <n> in state.json.Initialize state.json with the run name, mode, execution handoff (build-now / review-then-build / separate-session), layout type (tmux or native), agent count, current pass = 0 (or 1 if greenfield), agent slots, and a creation timestamp.
Save state.json after every meaningful step. It's the recovery point.
This skill supports two layout types. Pick at startup (see Initial Setup). Both produce identical final-plan.md output and use the same per-pass workflow; the only difference is how agents are dispatched.
Agents run in separate terminal panes created by discover.sh. Requires tmux.
Role mapping (scales with agent count):
| Agent slot | Role | Model |
|---|---|---|
orchestrator | Owns the run, dispatches work, reads/writes state.json | opus |
architect | System design, integration points, trade-offs | opus |
planner | Task sequencing, plan structure | opus |
critic | Adversarial review, gap analysis | opus |
researcher-N (one per remaining agent slot) | External + codebase research | sonnet |
With fewer agents, the orchestrator combines roles sequentially (e.g. 3 agents → orchestrator + architect-critic + researcher; 2 agents → orchestrator + architect-critic-researcher). With more agents, dedicated researcher panes run in parallel. The discover.sh script handles pane creation for any count from 2 to 6.
Researchers are sonnet because the work is breadth-heavy and output is reviewed by an opus synthesizer. Reasoning roles (architect, planner, critic) are opus because their decisions propagate downstream.
Agents are dispatched as parallel Agent tool calls from the orchestrator using the pattern in superpowers:dispatching-parallel-agents. No tmux session is created. The orchestrator is the current Claude Code session itself; parallel work is sent as multiple simultaneous Agent / Task invocations in a single message. See references/tmux-layout.md for the native dispatch pattern and how it maps to the tmux pane model.
The native layout supports the same agent count range (2–6) as the tmux layout. Each "slot" becomes a named parallel Agent invocation instead of a tmux pane.
Goal: Build a faithful map of what's already implemented so later passes don't propose redundant features.
Skip condition: Greenfield (detected during Initial Setup). Note in state.json and proceed to Pass 1.
Approach:
Dispatch parallel explore agents (haiku tier where available, sonnet otherwise) to cover the codebase. Split coverage by directory or concern (e.g., one researcher covers src/data/ + src/signals/, the other covers src/output/ + src/config/). Each writes findings to a scratch file in the run directory.
tmux send-keys to each researcher-N pane.Agent tool calls in a single message — don't send them sequentially.While researchers run, the orchestrator reads README.md, top-level config files, package.json/Cargo.toml/pyproject.toml, and any obvious entrypoints to build a high-level mental model.
Once researchers report back, dispatch architect (opus) in its pane to synthesize their findings into the system map. The architect should explicitly mark anything as "inferred but not verified" if it's based on naming conventions rather than actual code reading.
Output to pass-0-system-map.md:
Anti-pattern to avoid: Inferring functionality from filenames. If sentiment.py exists but only contains a stub, that's a gap, not a feature. Researchers MUST read source, not just list files.
If pause-for-review mode: stop here, present the system map, ask the user to confirm or correct before continuing.
Goal: Surface a wide net of candidate features grounded in how real systems solve the same problem.
Approach:
Optionally invoke superpowers:brainstorming if the user's feature ask is fuzzy ("make the bot smarter"). Brainstorming asks one clarifying question at a time and gets to a sharp design intent — feed that intent into the rest of Pass 1.
Dispatch /oh-my-claudecode:external-context for parallel document-specialist research on the feature domain (papers, blog posts, public datasets, similar open-source projects). This populates external knowledge fast.
In parallel, dispatch /oh-my-claudecode:sciomc if the feature involves data analysis, statistical methods, or anything where multiple analytical angles help. sciomc runs parallel scientist agents — useful for "what are the 5 ways people approach X" questions.
The researcher panes (sonnet) consolidate findings into a candidate list. Each candidate must include:
Constraints (preserve from the original 4-pass philosophy):
Output to pass-1-candidates.md: the full candidate list, unfiltered. Pass 2 does the filtering.
If pause-for-review: stop, present the candidate list, ask the user if anything's missing or off-base.
Goal: Cut the candidate list down to the high-impact, non-redundant, feasible subset.
Approach:
Dispatch analyst (opus) in the architect pane (or a dedicated analyst pane if you want to keep architect free) to compare Pass 1 candidates against Pass 0's system map and remove anything redundant or already implemented.
Dispatch critic (opus) on the remaining set to identify failure modes per feature: false signals, manipulation vectors, latency issues, crowded-trade dynamics, race conditions, integration friction — whatever applies.
The architect adds safeguards per feature: confirmation logic, thresholds, source weighting, time decay, fallback behavior.
Rank surviving features along three axes: signal quality improvement, practical edge / impact, feasibility. Drop the bottom tier.
Output to pass-2-filtered.md:
If pause-for-review: present the filtered set; the user gets a chance to drop or add features before stress-testing.
Goal: Catch features that look good on paper but break under adversarial or real-world conditions, then validate the survivors against multiple AI models for diverse-perspective robustness.
Approach:
Step 1 — Local adversarial review:
critic (opus) to attack the filtered feature set: where do signals become misleading? What structural weaknesses exist (noise, crowding, delayed data, lack of edge)? What scenarios cause the feature to fail or be exploited?/oh-my-claudecode:security-reviewer (sonnet) on any feature touching auth, external input, or sensitive data flows.Step 2 — Cross-model synthesis (final step of Pass 3):
/oh-my-claudecode:ccg (Claude-Codex-Gemini) on the post-adversarial feature set with the prompt: "Here are N proposed features for [system X]. For each, identify: (a) the strongest reason to keep it, (b) the strongest reason to drop it, (c) hidden risks not yet considered."ccg queries Codex and Gemini in parallel and Claude synthesizes. The output should explicitly call out: where all three models agreed, where they disagreed, and which features have only single-model support (these are the riskiest — flag, don't necessarily drop).Output to pass-3-stress-tested.md:
If pause-for-review: this is an important checkpoint. Show the user the cross-model synthesis especially — features only one model supports are decision points.
Goal: Convert the validated feature set into a build-ready design that integrates cleanly with the existing system.
Approach:
This pass is largely delegated to /oh-my-claudecode:ralplan — its Planner + Architect + Critic consensus loop is exactly what's needed here, and reimplementing it would be silly.
ralplan with that bundle and the directive: "Produce an implementation plan that integrates these features into the existing system without duplicating functionality or creating redundant components."ralplan reaches consensus, the orchestrator reviews the output for completeness against the required sections (below) and adds any missing pieces.Required sections in final-plan.md:
Always write final-plan.md — it's the build spec Pass 5 reads in every mode. EXECUTE.md is only the handoff file a fresh session reads on discover: resume, so write it only in separate-session mode (see below). The same-session modes never read it; if a same-session build is interrupted, the run is still fully resumable from state.json + final-plan.md, which together hold everything Pass 5 needs.
Then branch on the Execution handoff choice from setup:
separate-session (default): Write EXECUTE.md using the template at references/kickoff-prompt.md, filling in all placeholders (run-name, absolute path to final-plan.md, activation summary, git remote). Then this is where the skill stops. Print to chat with a clear marker:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Plan saved to: <abs-path>/final-plan.md
✅ Pass 5 context saved to: <abs-path>/EXECUTE.md
Open a fresh Claude Code session and type:
discover: resume <run-name>
The skill will re-activate and read EXECUTE.md from disk.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The prompt the user types must be exactly one short line — discover: resume <run-name>. Do NOT ask them to copy-paste the contents of EXECUTE.md; the skill re-activates from the one-liner and reads the file from disk itself. Why a separate session: Passes 0–4 burn a lot of context on research and synthesis, and Pass 5 (execution-heavy) benefits from a clean slate.
review-then-build: Present the plan in chat — show final-plan.md's System Overview and the Verification Checklist (section 8), and say where the full file lives on disk. Ask the user to approve or request changes. Do NOT start Pass 5 until they say go. Once approved, continue straight to Pass 5 below in this same session — do not make them type discover: resume.
build-now: Do not pause. State that the plan is saved and you're proceeding to the build, then continue straight to Pass 5 below in this same session.
This pass builds the feature. How you arrive here depends on the Execution handoff choice from setup:
separate-session: the user typed discover: resume <run-name> into a fresh Claude Code session. The skill re-activates, locates the run directory at .claude/discover/<run-name>/, reads EXECUTE.md, state.json, and final-plan.md, then runs the flow below. The user does NOT paste EXECUTE.md contents — they type only the one-line trigger; the skill reads the file from disk. (If EXECUTE.md is absent — e.g. recovering a build-now/review-then-build run that was interrupted mid-build — read state.json + final-plan.md instead; they hold everything needed.)build-now / review-then-build: you arrived here directly from Pass 4 in the same session (for review-then-build, only after the user approved the plan). final-plan.md and any decisions captured during earlier pauses are already in context; just re-read state.json to confirm the run parameters and proceed.Either way, the execution flow below is identical.
Goal: Implement, verify, activate, and (if applicable) push. Minimize human input — only ask when genuinely stuck on direction.
Approach:
Read context. Load final-plan.md, state.json, and any decisions captured during earlier pauses. If anything is missing or contradictory, ask once for clarification.
Implement. Use /oh-my-claudecode:ralph with the directive: "Execute the implementation plan at <abs-path>/final-plan.md. Loop until the verification checklist passes." ralph's loop-until-verified semantics are exactly what's wanted here — it won't stop at "looks done", it'll keep going until the verifier agent confirms.
ralph, executor (sonnet) does the code changes, test-engineer (sonnet) writes/runs tests, verifier (sonnet) checks the verification checklist from Pass 4.Activate features. Once the code is in and tests pass, perform the Feature Activation Plan from final-plan.md:
Verify before committing. Invoke superpowers:verification-before-completion now. This skill enforces "no completion claim without fresh evidence in the same message" — a stronger gate than the verifier loop alone. It must confirm the verification checklist from final-plan.md section 8 is fully satisfied before the commit step runs. If it raises any open items, resolve them first (loop back to ralph) before proceeding.
Commit and push.
git remote -v. If there's a remote pointing at github.com, proceed; otherwise skip with a note.final-plan.md).Final report. Append to pass-5-execution-log.md:
When to stop and ask the user:
Otherwise, plow through.
| Pass | Primary skills/agents used | Why |
|---|---|---|
| 0 | explore (parallel), architect | Fast, faithful codebase mapping |
| 1 | external-context, sciomc, optional superpowers:brainstorming | Wide-net research + clarifying intent |
| 2 | analyst, critic | Filtering against reality + failure-mode discovery |
| 3 | critic, security-reviewer, ccg | Adversarial + cross-model robustness |
| 4 | ralplan | Consensus-based implementation planning (Planner+Architect+Critic) |
| 5 | ralph, executor, test-engineer, verifier, superpowers:verification-before-completion, git-master | Loop-until-verified execution; explicit verification gate before commit |
If any of these skills is unavailable on the user's system, fall back gracefully: use direct tool calls instead, but note the degradation in state.json so the user knows the run was less rigorous than the full pipeline.
references/tmux-layout.md — exact tmux session layout, pane naming, dispatch helpersreferences/pass-templates.md — output structure templates for each pass filereferences/kickoff-prompt.md — template for EXECUTE.mddiscover.sh — tmux setup helperRead these as needed; don't preload them.
state.json + per-pass markdown files are the recovery point. On resume, read them and continue from the last completed pass. Don't re-run completed passes unless the user asks.discover.sh is idempotent — re-running it attaches if the session exists, creates if not.state.json is corrupted, refuse and tell them to re-run from Pass 4. Don't try to reconstruct.state.json intact with a status: "aborted" field. Re-invoking discover: on the same run name should offer resume.mode, execution handoff, layout type, and agent count — silently strips the user's ability to control token budget, review checkpoints, and whether the build runs in this session or a fresh one. Always ask.Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub chopra2007/claude-discover --plugin discover