Complete development workflow for Claude Code
Complete development workflow for Claude Code. Defines philosophy, hard requirements, anti-patterns, and 9-gate development process.
This codebase will outlive you. Every shortcut you take becomes someone else's burden. Every hack compounds into technical debt that slows the whole team down.
You are not just writing code. You are shaping the future of this project. The patterns you establish will be copied. The corners you cut will be cut again.
Fight entropy. Leave the codebase better than you found it.
Would a senior engineer say this is overcomplicated? If yes, simplify.
trash over rm.Every implementation task follows the same 9-gate workflow. Create all gate tasks at the start.
Execution Mode: Check CLAUDE_CODE_REMOTE env var. If true → Remote Mode (autonomous). See Hard Requirements for adjustments.
Agent Legend:
| Agent | Type | Description |
|-------|------|-------------|
| main | orchestrator | You (the orchestrating agent) |
| test-engineer | custom | TDD workflows (.claude/agents/test-engineer.md) |
| cleanup-agent | custom | Cleanup phase (.claude/agents/cleanup-agent.md) |
| reviewer | custom | Code review (.claude/agents/reviewer.md) |
| systems-architect | custom | Architecture decisions (.claude/agents/systems-architect.md) |
| Bash | built-in | CLI commands |
| Explore | built-in | Codebase exploration |
| general-purpose | built-in | General tasks, skill execution |
Execution order: [P] = can run in parallel, [S] = must run sequentially
// Phase 1: Planning [P] - parallel research
TaskCreate({ subject: "Planning gate", description: "Agent: main + Explore + general-purpose. GATE: Research complete.", activeForm: "Planning" })
// Phase 2: Refinement [P] - parallel questions + review
TaskCreate({ subject: "Dispatch parallel refinement", description: "Agent: main. Dispatches: general-purpose. Questions + codex plan review.", activeForm: "Dispatching refinement" })
TaskCreate({ subject: "Refinement gate", description: "Agent: main. GATE: Questions asked, concerns addressed.", activeForm: "Refining" })
// Phase 3: Implementation [S] - sequential TDD cycle
TaskCreate({ subject: "Write failing tests (TDD red)", description: "Agent: test-engineer. [S] Write test that fails.", activeForm: "Writing failing tests" })
TaskCreate({ subject: "Implementation", description: "Agent: main. [S] Write the implementation code. Can parallelize across independent files.", activeForm: "Implementing" })
TaskCreate({ subject: "Make tests pass (TDD green)", description: "Agent: test-engineer. [S] Run tests and verify they pass.", activeForm: "Making tests pass" })
// Phase 4: Cleanup [P] - parallel cleanup tools
TaskCreate({ subject: "Dispatch parallel cleanup", description: "Agent: main. Dispatches: cleanup-agent. [P] Run deslop, code-simplifier, knip.", activeForm: "Dispatching cleanup" })
TaskCreate({ subject: "Cleanup gate", description: "Agent: main. GATE: All cleanup tools run with evidence.", activeForm: "Cleaning up" })
// Phase 5: Testing [S]
TaskCreate({ subject: "Testing gate", description: "Agent: Bash. [S] GATE: Run bun run ci, show exit code.", activeForm: "Testing" })
// Phase 6: Review [P] reviews → [P] fixes → [P] re-run
TaskCreate({ subject: "Dispatch parallel reviewers", description: "Agent: main. Dispatches: Bash, reviewer, general-purpose. [P] Run all 6 reviewers.", activeForm: "Dispatching reviewers" })
TaskCreate({ subject: "Dispatch parallel fixes", description: "Agent: main. Dispatches: general-purpose. [P] Fix codex, codeql, reviewer findings.", activeForm: "Dispatching fixes" })
TaskCreate({ subject: "Re-run failed reviewers", description: "Agent: main. Dispatches: Bash, reviewer, general-purpose. [P] Re-run until PASS.", activeForm: "Re-running reviewers" })
TaskCreate({ subject: "Review gate", description: "Agent: main. GATE: All review checks pass.", activeForm: "Reviewing" })
// Phase 7-9: Verification chain [S]
TaskCreate({ subject: "Run verification commands", description: "Agent: Bash. [S] Execute verification-before-completion.", activeForm: "Running verification" })
TaskCreate({ subject: "Verification gate", description: "Agent: main. [S] GATE: All checks pass with exit code 0.", activeForm: "Verifying" })
TaskCreate({ subject: "CI gate", description: "Agent: Bash. [S] GATE: Run bun run ci with exit code 0.", activeForm: "Running CI" })
TaskCreate({ subject: "Integration gate", description: "Agent: Bash. [S] GATE: Run bun run test:integration.", activeForm: "Running integration tests" })
// Phase 10: Session end [S]
TaskCreate({ subject: "Run workflow-improver analysis", description: "Agent: main. Skill: workflow-improver. [S] Analyze session.", activeForm: "Running workflow analysis" })
After creating all tasks, establish the sequential dependencies:
// Phase transitions (each phase blocked by previous)
TaskUpdate({ taskId: refinement-gate-id, addBlockedBy: [planning-gate-id] })
TaskUpdate({ taskId: tdd-red-id, addBlockedBy: [refinement-gate-id] })
// TDD cycle is sequential
TaskUpdate({ taskId: implementation-id, addBlockedBy: [tdd-red-id] })
TaskUpdate({ taskId: tdd-green-id, addBlockedBy: [implementation-id] })
// Cleanup after implementation
TaskUpdate({ taskId: cleanup-dispatch-id, addBlockedBy: [tdd-green-id] })
TaskUpdate({ taskId: cleanup-gate-id, addBlockedBy: [cleanup-dispatch-id] })
// Testing after cleanup
TaskUpdate({ taskId: testing-gate-id, addBlockedBy: [cleanup-gate-id] })
// Review chain
TaskUpdate({ taskId: dispatch-reviewers-id, addBlockedBy: [testing-gate-id] })
TaskUpdate({ taskId: dispatch-fixes-id, addBlockedBy: [dispatch-reviewers-id] })
TaskUpdate({ taskId: rerun-reviewers-id, addBlockedBy: [dispatch-fixes-id] })
TaskUpdate({ taskId: review-gate-id, addBlockedBy: [rerun-reviewers-id] })
// Verification chain
TaskUpdate({ taskId: verification-commands-id, addBlockedBy: [review-gate-id] })
TaskUpdate({ taskId: verification-gate-id, addBlockedBy: [verification-commands-id] })
TaskUpdate({ taskId: ci-gate-id, addBlockedBy: [verification-gate-id] })
TaskUpdate({ taskId: integration-gate-id, addBlockedBy: [ci-gate-id] })
// Session end
TaskUpdate({ taskId: workflow-improver-id, addBlockedBy: [integration-gate-id] })
Execution tasks require evidence: Each execution task must show command output, diff, or scan results before marking complete.
Task status updates:
// Before starting work on a task:
TaskUpdate({ taskId: "task-id", status: "in_progress" })
// After completing with evidence:
TaskUpdate({ taskId: "task-id", status: "completed" })
// To set dependencies (task B blocked by task A):
TaskUpdate({ taskId: "task-B-id", addBlockedBy: ["task-A-id"] })
TaskCreate({ subject: "Planning gate", description: "Agent: main + Explore. GATE: Research complete.", activeForm: "Planning" })
TaskCreate({ subject: "Refinement gate", description: "Agent: main. GATE: Plan written and reviewed.", activeForm: "Refining" })
// After plan approval, create remaining gates + execution tasks
Check CLAUDE_CODE_REMOTE environment variable at session start:
CLAUDE_CODE_REMOTE=true → Remote Mode (autonomous, minimal interaction)Remote Mode Adjustments:
ask-questions-if-underspecified skill: load but only act if ambiguity score > 7/10ALWAYS
TaskCreate to create tasks, TaskUpdate({ status: "in_progress" }) before starting work.TaskUpdate({ status: "completed" }) after each task is done.TaskUpdate({ addBlockedBy: [...] }) to establish task ordering.AskUserQuestion tool for ALL clarifying questions - never plain text questions.AskUserQuestion tool for ALL decision-seeking questions - phrases that seek user input MUST use the tool:
mode parameter appropriately: plan for risky changes, bypassPermissions for trusted autonomous work.blockedBy can run in parallel via multiple Task() calls in one message. See dispatching-parallel-agents skill.NEVER
AskUserQuestion tool.AskUserQuestion tool instead of inline text.Text checklists don't work. Claude forgets requirements that aren't tracked as Tasks.
Every required action MUST be a TaskCreate item. Never state requirements only in prose or markdown checkboxes.
Wrong:
- [ ] Run codex review
- [ ] Fix issues
Right:
TaskCreate({ subject: "Dispatch codex review", description: "Agent: Bash. Run: codex review --uncommitted.", activeForm: "Dispatching codex review" })
TaskCreate({ subject: "Fix codex issues", description: "Agent: general-purpose. Fix all P1, P2, P3 issues found.", activeForm: "Fixing codex issues" })
Execution tasks require evidence: Each task must show command output, diff, or results before marking complete.
When modifying existing code:
Create all gate tasks AND execution tasks via TaskCreate at the start. See Gate Tasks section for the complete list.
Key principle: If it's not a TaskCreate item, it won't happen.
| Status | When | Description | |--------|------|-------------| | pending | Not started | — | | in_progress | Working on it | — | | completed | Done with proof | — |
Before each phase, update the corresponding gate task. Do not proceed if BLOCKED. Do not skip gates.
⚠️ Gate task neglect is a failure mode. You must update EVERY applicable gate task, not just early ones.
⚠️ Gate rushing is a failure mode. Each gate completed requires proof in the description.
Gate requirements (gate cannot complete until execution tasks show evidence):
Planning: PASS: Research=[tools used]
Refinement: PASS: Questions=[count or N/A if Remote]
AskUserQuestion tool used. Remote: questions optional unless genuinely ambiguous.Implementation: PASS: TDD=[red+green done] | Backfill=[done/N/A]
Cleanup: PASS: Deslop=[done] | Simplifier=[done]
Testing: PASS: Tests=[N passed, N failed] | Exit=[code]
Review: PASS: Reviewers=[dispatched] | Fixes=[dispatched] | Rerun=[done or N/A]
Verification: PASS: Commands=[run] | Exit=[0]
CI: PASS: CI=[command] | Exit=[0]
bun run ci executed with exit code 0 shown.bun dev:up.package.json does not exist (non-Node repos), substitute: shellcheck for .sh files, markdownlint for .md files. Document the substitution.Integration: PASS: Integration=[Exit 0 or N/A]
bun run test:integration executed with exit code 0 (or N/A if unavailable).package.json does not exist, document N/A with justification.Session End: PASS: Workflow-improver=[done]
Execution ≠ Loading: Calling Skill() just loads instructions. The execution task tracks actually DOING what the skill documents.
Before claiming done, the task list must show all gate tasks as completed. No exceptions.
Banned phrases: "looks good", "should work", "Done!", "it's just a port", "manual review", "pre-existing", "not related to my changes"
Failure deflection (ZERO TOLERANCE): Any claim that failures are "pre-existing" or "not related to my changes" is FORBIDDEN. Main always passes. If anything fails, you broke it.
When system-reminder indicates "Plan mode is active":
Plan Mode maps to workflow phases:
Plan Mode does NOT exempt you from:
TaskCreate + TaskUpdate({ status: "in_progress" }) first.TaskUpdate({ addBlockedBy: [...] }) for dependent tasks.Text checklists don't work. Claude forgets requirements that aren't tracked as Tasks.
- [ ] Do X without calling TaskCreate → call TaskCreate, not markdownSkill() but not doing what it documents → TaskCreate tracks EXECUTION, not loadingThe rule: If it's not a TaskCreate item, it won't happen. Period.
AskUserQuestion tool → FORBIDDENThese phrases in assistant messages = VIOLATION if not using the tool:
Would you like me to...? → Use AskUserQuestion with optionsShould we...? / Should I...? → Use AskUserQuestion with yes/no or optionsDo you want...? → Use AskUserQuestion with optionsWhich would you prefer...? → Use AskUserQuestion with the options listedCould you clarify...? → Use AskUserQuestionWhat should I...? → Use AskUserQuestion with optionsALLOWED without tool (rhetorical/explanatory):
status: completed without proof in description -> add PASS: [key]=[evidence] | ... to description.BLOCKED: [reason] in description.bun run ci exit code 0 shown → CI must pass.dispatching-parallel-agents.name parameter -> use names for tracking (e.g., name: "test-runner").mode: "bypassPermissions" for risky/security tasks -> use mode: "plan" for changes requiring review.mode based on task risk level.THIS IS THE MOST SEVERE ANTI-PATTERN. ZERO TOLERANCE.
Applies to: CI failures, test failures, lint errors, type errors, build failures, ANY verification failure.
npx skills add settlemint-archive/crew-claude下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer