REQUIRED Phase 5 of /dev workflow. Orchestrates per-task ralph loops with delegated TDD implementation.
/plugin marketplace add edwinhu/workflows/plugin install workflows@edwinhu-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Announce: "I'm using dev-implement (Phase 5) to orchestrate implementation."
Main Chat (you) Task Agent
─────────────────────────────────────────────────────
dev-implement (this skill)
→ dev-ralph-loop (per-task loops)
→ dev-delegate (spawn agents)
→ Task agent ──────────────→ follows dev-tdd
uses dev-test tools
Main chat orchestrates. Task agents implement.
Do NOT start implementation without these:
.claude/SPEC.md exists with final requirements.claude/PLAN.md exists with chosen approachIf any prerequisite is missing, STOP and complete the earlier phases.
Check PLAN.md for: files to modify, implementation order, testing strategy. </EXTREMELY-IMPORTANT>
<EXTREMELY-IMPORTANT> ## The Iron Law of DelegationMAIN CHAT MUST NOT WRITE CODE. This is not negotiable.
Main chat orchestrates. Subagents implement. If you catch yourself about to use Write or Edit on a code file, STOP.
| Allowed in Main Chat | NOT Allowed in Main Chat |
|---|---|
| Spawn Task agents | Write/Edit code files |
| Review Task agent output | Direct implementation |
| Write to .claude/*.md files | "Quick fixes" |
| Run git commands | Any code editing |
| Start ralph loops | Bypassing delegation |
If you're about to edit code directly, STOP and spawn a Task agent instead.
These thoughts mean STOP—you're rationalizing:
| Thought | Reality |
|---|---|
| "It's just a small fix" | Small fixes become big mistakes. Delegate. |
| "I'll be quick" | Quick means sloppy. Delegate. |
| "The subagent will take too long" | Subagent time is cheap. Your context is expensive. |
| "I already know what to do" | Knowing ≠ doing it well. Delegate. |
| "Let me just do this one thing" | One thing leads to another. Delegate. |
| "This is too simple for a subagent" | Simple is exactly when delegation works best. |
| "I'm already here in the code" | Being there ≠ writing there. Delegate. |
| "The user is waiting" | User wants DONE, not fast. They won't debug your shortcuts. |
| "This is just porting/adapting code" | Porting = writing = code. Delegate. |
| "I already have context loaded" | Fresh context per task is the point. Delegate. |
| "It's config, not real code" | JSON/YAML/TOML = code. Delegate. |
| "I need to set things up first" | Setup IS implementation. Delegate. |
| "This is boilerplate" | Boilerplate = code = delegate. |
| "PLAN.md is detailed, just executing" | Execution IS implementation. Delegate. |
If you're treating these rules as "guidelines for complex work" rather than "invariants for ALL work", you've already failed.
Simple work is EXACTLY when discipline matters most—because that's when you're most tempted to skip it. </EXTREMELY-IMPORTANT>
For each task N in PLAN.md:
1. Start ralph loop for task N
→ Skill(skill="workflows:dev-ralph-loop")
2. Inside loop: spawn Task agent
→ Skill(skill="workflows:dev-delegate")
3. Task agent follows TDD (dev-tdd) using testing tools (dev-test)
4. Verify tests pass, output promise
5. Move to task N+1, start NEW ralph loop
REQUIRED SUB-SKILL:
Skill(skill="workflows:dev-ralph-loop")
Key points from dev-ralph-loop:
REQUIRED SUB-SKILL:
Skill(skill="workflows:dev-delegate")
Key points from dev-delegate:
After Task agent returns, verify:
If ALL pass → output the promise. If ANY fail → iterate.
| Skill | Purpose | Used By |
|---|---|---|
dev-ralph-loop | Per-task loop pattern | Main chat |
dev-delegate | Task agent templates | Main chat |
dev-tdd | TDD protocol (RED-GREEN-REFACTOR) | Task agent |
dev-test | Testing tools (pytest, Playwright, etc.) | Task agent |
Pattern from oh-my-opencode: After 3 consecutive implementation failures, escalate.
If you attempt 3 implementations and ALL fail tests:
Iteration 1: Implement approach A → tests fail
Iteration 2: Implement approach B → tests fail
Iteration 3: Implement approach C → tests fail
→ TRIGGER RECOVERY PROTOCOL
STOP all further implementation attempts
REVERT to last known working state
git checkout <last-passing-commit>.claude/RECOVERY.mdDOCUMENT what was attempted
CONSULT with user BEFORE continuing
ASK USER for direction
NO PASSING TESTS = NOT COMPLETE (hard rule)
Before continuing after multiple failures:
DON'T:
DO:
Loop 1: Implement with synchronous approach → Tests timeout
Loop 2: Implement with async/await → Tests hang
Loop 3: Implement with promises → Tests fail assertion
→ RECOVERY PROTOCOL:
1. STOP (no loop 4)
2. REVERT: git checkout HEAD -- src/feature.ts tests/
3. DOCUMENT in .claude/RECOVERY.md:
- Pattern: All async implementations cause timing issues
- Tests expect synchronous behavior
- Hypothesis: Requirements may need async, tests don't handle it
4. ASK USER:
"I've tried 3 async implementations. All cause timing issues.
Tests expect synchronous behavior.
This suggests either:
A) Feature should actually be synchronous (simpler)
B) Tests need updating for async behavior
Which direction should I take?"
Trigger after 3 failures when:
Don't wait for max iterations - trigger early when pattern emerges.
Ralph exits after max iterations. Still do NOT ask user to manually test.
Main chat should:
Never default to "please test manually". Always exhaust automation first.
| Thought | Reality |
|---|---|
| "Task done, let me check in with user" | NO. User wants ALL tasks done. Keep going. |
| "User might want to review" | User will review at the END. Continue. |
| "Natural pause point" | Only pause when ALL tasks complete or blocked. |
| "Let me summarize progress" | Summarize AFTER all tasks. Keep moving. |
| "User has been waiting" | User is waiting for COMPLETION, not updates. |
The promise signals task completion. After outputting promise, IMMEDIATELY start next task's loop.
Pausing between tasks is procrastination disguised as courtesy. </EXTREMELY-IMPORTANT>
REQUIRED SUB-SKILL: After ALL tasks complete with passing tests:
Skill(skill="workflows:dev-review")
Do NOT proceed until automated tests pass for every task.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.