lewibs/dark-factory/short-circuit-self-managed-route
Claude Code and agent skill by lewibs/dark-factory
- community
Checking that the SKILL.md file is still in the repository.
When a worker agent manages its own worktree, PR, and cleanup internally, the orchestrator must invoke it and stop before running prep-feature-dir.sh — not after.
Install
npx vskill@latest install lewibs/dark-factory/short-circuit-self-managed-routeSKILL.md
The same SKILL.md was published earlier as lewibs/dark-factory/short-circuit-self-managed-route.
When to use
Any time a new route is added to dark-factory-agent.md where the target agent is responsible for its own isolation (worktree creation), PR, and cleanup — rather than relying on the orchestrator to do those steps.
Steps
- Identify whether the new agent creates its own worktree (calls
prep-feature-dir.shinternally) and opens its own PR. - If yes, place the route check at the very top of the orchestration block — before the
prep-feature-dir.shcall in Step 2. - After invoking the self-managed agent, capture
prUrlfrom its return value andSTOPimmediately. Do not fall through to the worktree prep, code review, doc update, skill update, or cleanup steps. - The reason: if the orchestrator runs
prep-feature-dir.shfirst, a duplicate worktree will be created. When the self-managed agent also callsprep-feature-dir.shwith the sametaskName, it will collide or fail.
Notes
- Self-managed routes also intentionally skip code review, skill-update-agent, and the full doc cycle. Document these omissions explicitly in the route comment so future readers know the skips are deliberate, not accidental.
- Agents that do NOT manage their own worktree (feature-agent, debugger-agent, repair-agent) should not be placed before Step 2, because they rely on the orchestrator's worktree and cleanup.
- Historical note: repair-agent was previously a self-managed route (called
prep-feature-dir.shinternally and short-circuited the orchestrator). It was unified into the full orchestrator flow in April 2026. The repair-agent is no longer a self-managed route — it is invoked in Step 3 like any other worker and relies on the orchestrator for worktree, review, docs, skills, PR, and cleanup.
Inverse: unifying a self-managed route back into the orchestrator
When an agent that previously used the early-exit pattern is folded back into the full orchestrator flow, reverse all of the steps above:
- Remove the early-exit block from the orchestrator (the block that appears before Step 2 and ends with
STOP). - Add the route to the Step 3 routing table (alongside other workers).
- Update the brain.json
classificationfield comment to include the new classification value. - Update the worker agent's description (frontmatter and prose) to clarify that it no longer manages its own worktree, PR, or cleanup — the orchestrator does.
- Remove any
prep-feature-dir.shcall and PR/cleanup logic from the worker agent itself. - Verify the worker agent's
tools:list does not include tools it no longer needs (e.g. if it previously usedBashonly forprep-feature-dir.shand cleanup scripts, those can be removed if no other Bash usage remains).
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/short-circuit-self-managed-route/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lewibs/dark-factory/short-circuit-self-managed-route)