By petekp
Multi-phase workflows for Claude Code that survive session crashes, enforce review gates, and resume exactly where they stopped.
Build features, scoped refactors, docs, tests, or mixed changes.
Investigate, understand, choose among options, or shape an execution plan.
Core lifecycle primitive.
Large-scale migrations: framework swaps, dependency replacements, architecture transitions, incremental rewrites.
Fix bugs, regressions, flaky behavior, and incidents.
Build features, scoped refactors, docs, tests, or mixed changes. The doing workflow. Phases: Frame -> Plan -> Act -> Verify -> Review -> Close. Docs and tests are first-class outputs, not afterthoughts. If architecture uncertainty appears, transfers to Explore rather than muddling through.
Investigate, understand, choose among options, or shape an execution plan. Covers codebase exploration, architectural investigation, RFC/PRD review, and decision-making. Absorbs the old researched, adversarial, spec-review, and crucible modes. Rigor profiles: Lite (quick look), Standard (evidence + options), Deep (+ seam proof), Tournament (bounded adversarial evaluation), Autonomous (Standard with auto-resolved checkpoints).
Core lifecycle primitive. Save session state to disk so a fresh session can resume automatically. Use when context is getting heavy, the user asks for a handoff, or you need to preserve progress before a session boundary. Also supports `/circuit:handoff done` to clear a pending handoff. Works alongside active-run.md (automatic continuity) as the intentional high-quality continuity path.
Large-scale migrations: framework swaps, dependency replacements, architecture transitions, incremental rewrites. Coexistence and rollback are first-class. Phases: Frame -> Inventory -> Coexistence plan -> Batch execution -> Verify -> Cutover review -> Close. Uses Build as the inner executor for batches, with plan/execute/review loops controlled by the circuit.
Fix bugs, regressions, flaky behavior, and incidents. Test-first discipline. Phases: Frame -> Analyze -> Fix -> Verify -> Review -> Close. The analyze phase covers both reproduction and root-cause isolation. Forces expected vs actual behavior, repro recipe, and regression-proof mindset. fix: routes here at Lite rigor. repair: routes here at Deep rigor.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Automate your Claude Code workflows with a single command.
Just enter /circuit:run and describe your task. It'll pick the most suitable workflow from the core set -- or from ones you've created -- and
execute it, making sure each step's output is valid before moving onto the next.
Install from the plugin marketplace:
/plugin marketplace add petekp/circuit
/plugin install circuit@petekp
/reload-plugins
Start a new Claude Code session and run:
/circuit:run {{your task}}
Circuit classifies your task, picks the right workflow, and runs it.
Circuit replaces ad-hoc skill invocation and having to copy-paste or re-type the same instructions over and over (and over). Instead, just use /circuit:run or select a specific circuit. You can optionally provide a level of autonomy and rigor for more control.
Core Workflows:
These workflows are included and ready to use. You can create your own by following the guide in CUSTOM-CIRCUITS.md.
| Workflow | Purpose |
|---|---|
| Explore | Investigate, understand, choose among options, shape a plan |
| Build | Features, refactors, docs, tests, mixed changes |
| Repair | Bugs, regressions, flaky behavior |
| Migrate | Framework swaps, dependency replacements, architecture transitions |
| Sweep | Cleanup, quality passes, coverage improvements |
Rigor Levels:
| Rigor | Budget |
|---|---|
| Lite | Plan and do. |
| Standard | Plan, do, independent review. One fix loop. |
| Deep | Research phase, seam proof. Workflows that include review still run it. |
| Tournament | Competing proposals, adversarial evaluation, convergence. |
| Autonomous | Checkpoints auto-resolve. Good for actually getting some sleep for once. |
Every workflow follows these phases: Frame, Analyze, Plan, Act, Verify, Review, Close, Pause. Not every workflow goes through every phase, but the order remains consistent.
The router classifies your task. Circuit matches your task to a workflow and rigor profile. Quiet by default: it routes and proceeds unless something is genuinely ambiguous.
Steps run in the right order. Research before decisions. Decisions before implementation. Implementation gets an independent review from a separate session. Every step saves progress to disk.
Progress survives session clearing and crashes. Active run state (active-run.md) is updated after every phase. Session handoff state lives in ~/.claude/projects/ so fresh sessions resume where the last one stopped.
Stay in the loop. Circuit pauses at checkpoints to gather input (scope confirmation, tradeoff decisions). Everything else runs autonomously. Fully autonomous mode is also supported.
Using the router:
| You type | What happens |
|---|---|
/circuit:run <task> | Router picks the best workflow and rigor |
/circuit:run fix: <bug> | Repair Lite -- test-first bug fix |
/circuit:run repair: <issue> | Repair Deep -- broad investigation |
/circuit:run develop: <feature> | Build Standard -- plan, implement, review |
/circuit:run decide: <choice> | Explore Tournament -- adversarial evaluation |
/circuit:run migrate: <target> | Migrate Deep -- inventory, coexistence plan, batches |
/circuit:run cleanup: <target> | Sweep Standard -- cleanup by confidence/risk |
/circuit:run overnight: <scope> | Sweep Autonomous -- unattended quality pass |
Direct circuits:
| You type | What happens |
|---|---|
/circuit:explore | Investigation, decisions, planning |
/circuit:build | Features, refactors, docs, tests |
/circuit:repair | Bug fixes with regression contracts |
/circuit:migrate | Migrations with coexistence planning |
/circuit:sweep | Cleanup and quality sweeps |
/circuit:review | Standalone fresh-context code review |
/circuit:handoff | Save session state for the next session |
See CIRCUITS.md for the full catalog with phase breakdowns and usage examples.
Automatic workflow selection. Describe your task. Circuit picks the right workflow and rigor level.
Independent review. For Standard rigor and above, implementation and review run in separate sessions. The reviewer starts fresh with no knowledge of the implementation choices. Lite skips independent review where documented.
npx claudepluginhub petekp/circuit --plugin circuitCompile a plain-language task into a concise, auditable Codex or Claude Code /goal with a clear definition of done, transcript-visible proof, constraints, bounded stop conditions, and risk-based review depth
Structured, resumable, multi-stage developer flows for Claude Code. /circuit:run selects the best flow for a natural-language task and invokes /circuit:explore, /circuit:review, /circuit:migrate, /circuit:fix, /circuit:build, or /circuit:sweep; /circuit:create and /circuit:handoff cover custom flows and continuity.
Software engineering workflows with skills for planning, implementation, quality review, and structured thinking, plus a suite of specialist agents
Research-backed orchestration for Claude Code. Structured workflow from idea to production with parallel execution, session memory, 70-point validation, autonomous mode, and adversarial review. 51 commands, 15 agents across 7 departments.
Agentic workflow mechanics: CLAUDE.md instruction quality and structured context handoff
Claude Code workflow patterns: prompting, CLAUDE.md maintenance, multi-agent orchestration
Implementation of the babysitter technique - continuous orchestration loops for deterministic development. Run Claude in a loop with orchestration steps based on the babysitter-sdk and technique.
Core planning and workflow infrastructure for the Claudikins ecosystem