
003-execute-tasks
by PaulCrossland1
Human-directed skill ecosystem for structured software project execution using Claude Code
SKILL.md
name: 003-execute-tasks description: Spawn a sub-agent using Claude, Gemini, or Codex CLI with selected model. Use when the user says "use /subagent to" followed by a task.
Subagent Spawner
Spawn sub-agents using different AI CLI providers. Supports two modes:
- Ad-hoc tasks — General purpose task execution
- Project tasks — Execute tasks from
.claude/tasks.jsonwith completion protocol
Mode Detection
Project mode if any of:
- User says "run task T005" or "run T005"
- User says "run next task" or "next task"
- User says "continue project" or "continue"
- Current directory has
.claude/tasks.json
Ad-hoc mode otherwise.
Ad-Hoc Mode (Simple Tasks)
For general tasks not part of a structured project.
Step 1: Capture Task
Everything after "use /subagent to" is the TASK.
Step 2: Provider Selection
{
"questions": [{
"question": "Which AI provider?",
"header": "Provider",
"options": [
{"label": "Claude (Recommended)", "description": "Anthropic Claude Code CLI"},
{"label": "Gemini", "description": "Google Gemini CLI"},
{"label": "Codex", "description": "OpenAI Codex CLI"}
],
"multiSelect": false
}]
}
Step 3: Model Selection
Claude:
- sonnet (Recommended) — Balanced
- haiku — Fast, cheap
- opus — Most capable
Gemini: Default model (no selection)
Codex:
- gpt-5.2-codex (Recommended)
- gpt-5.1-codex-mini — Lightweight
- gpt-5.1-codex-max — Maximum
Step 4: Permission Mode
Claude:
- Auto-approve edits →
--permission-mode acceptEdits - YOLO →
--dangerously-skip-permissions
Gemini:
- Auto-approve edits →
--approval-mode auto_edit - YOLO →
-y
Codex:
- Full-auto →
--full-auto - YOLO →
--dangerously-bypass-approvals-and-sandbox
Step 5: Execute
Write prompt to project history (avoids shell escaping, keeps history):
mkdir -p .claude/prompts
cat > .claude/prompts/{TASK_ID}.md << 'EOF'
[TASK PROMPT HERE]
EOF
Then pipe to subagent:
# Claude
cat .claude/prompts/{TASK_ID}.md | claude --model MODEL --permission-mode acceptEdits -p
# Gemini
cat .claude/prompts/{TASK_ID}.md | gemini --approval-mode auto_edit
# Codex
cat .claude/prompts/{TASK_ID}.md | codex exec --skip-git-repo-check --full-auto --model MODEL -
Project Mode (Structured Tasks)
For tasks from a /002-setup-project generated project.
Step 1: Detect Project
Check for .claude/tasks.json in current or specified directory.
If not found:
{
"questions": [{
"question": "No project found. What would you like to do?",
"header": "Project",
"options": [
{"label": "Specify path", "description": "I'll provide the project path"},
{"label": "Run ad-hoc", "description": "Execute without project context"}
],
"multiSelect": false
}]
}
Step 2: Determine Task
If user specified task ID (e.g., "run T005"):
- Load that specific task
If user said "next task" or "continue":
- Find first task with
status: pending - Verify dependencies are
completed
Step 3: Display Task Summary
Output a concise table — no prose explanation:
┌──────────────────────────────────────────────────────────┐
│ T003 — Set up client with Vite and React │
├─────────────┬────────────────────────────────────────────┤
│ Phase │ foundation │
│ Complexity │ simple │
│ Depends on │ T001 ✓, T002 ✓ │
│ Outputs │ client/, vite.config.ts, package.json │
└─────────────┴────────────────────────────────────────────┘
Then immediately proceed to model selection.
Step 4: Generate Task Prompt
Build prompt using template from task-prompt-template.md:
- Read
.claude/tasks.jsonfor task details - Read
.claude/CONTEXT.mdfor project state - Substitute into template
- Include completion signal instructions
Step 5: Provider, Model & Permission Selection
Follow the full ad-hoc flow (Steps 2-4) with complexity-based recommendations.
5a. Provider Selection:
{
"questions": [{
"question": "Task {TASK_ID} ({COMPLEXITY}). Which provider?",
"header": "Provider",
"options": [
{"label": "Claude (Recommended)", "description": "Anthropic Claude Code CLI"},
{"label": "Gemini", "description": "Google Gemini CLI"},
{"label": "Codex", "description": "OpenAI Codex CLI"}
],
"multiSelect": false
}]
}
5b. Model Selection (based on provider):
Recommend based on task complexity:
| Complexity | Claude | Codex |
|---|---|---|
trivial, simple | haiku | gpt-5.1-codex-mini |
moderate | sonnet | gpt-5.2-codex |
complex | opus | gpt-5.1-codex-max |
(Gemini uses default model — skip this step)
5c. Permission Mode:
- Claude:
acceptEditsordangerously-skip-permissions - Gemini:
auto_editor-y - Codex:
full-autoordangerously-bypass-approvals-and-sandbox
Step 6: Execute with Protocol
Run the subagent with the generated prompt.
The prompt instructs the subagent to:
- Read CONTEXT.md first
- Complete the task
- Run success criteria
- Update PROGRESS-NOTES.md
- Update CONTEXT.md
- Update tasks.json
- Emit completion signal
See project-protocol.md for full protocol.
Step 7: Parse Completion Signal
After subagent completes, find and parse:
--- TASK COMPLETION ---
task_id: T005
status: completed
...
next_task: T006
--- END COMPLETION ---
Step 8: Sweep & Enhance Documentation
After subagent completes, perform a documentation sweep. You (in the main Claude session) have broader project context than the subagent, so actively review and enhance:
- Read files created/modified by subagent
- Verify subagent updates to CONTEXT.md, PROGRESS-NOTES.md, tasks.json
- Enhance if needed — you have broader project context:
| File | Check | Enhance if... |
|---|---|---|
.claude/CONTEXT.md | Current state accurate? | Add context subagent missed, note dependency implications |
.claude/PROGRESS-NOTES.md | Entry complete? | Add cross-references to related tasks, implementation notes |
.claude/tasks.json | Status correct? | Update downstream task descriptions if scope changed |
.claude/ARCHITECTURE.md | Still accurate? | Document new patterns that emerged |
.claude/DECISIONS.md | New decisions made? | Log architectural choices subagent made |
- Skip sweep only if task was trivial and completion signal confirms all updates made
Step 8.5: Simplify & Polish Code
When the completion signal includes simplification_requested: true, apply code simplification to the modified files.
Read the files from files_created and files_modified, then apply:
-
Preserve Functionality — Only change HOW, not WHAT
-
Apply Project Standards — Draw from
.claude/ARCHITECTURE.mdand.claude/DECISIONS.md -
Enhance Clarity:
- Reduce unnecessary complexity and nesting
- Eliminate redundant code and abstractions
- Improve variable/function names for clarity
- Avoid nested ternaries — prefer switch/if-else
- Choose clarity over brevity
-
Maintain Balance — Don't over-simplify; prioritize readability
Skip simplification if:
- Task was trivial/simple complexity
- Code is already clean and follows project standards
- Files are configuration-only (no logic to simplify)
See simplifier-guidelines.md for detailed principles.
Step 9: Report & Continue
Report results to user:
✓ Task T005 completed successfully
Files created:
- src/models/User.ts
Success criteria: 3/3 passed
Next task: T006 — Create Genome model
Continue with next task?
If status: blocked:
⚠ Task T005 blocked
Blocker: Missing CLERK_SECRET_KEY environment variable
Required action:
1. Create Clerk account at clerk.dev
2. Add CLERK_SECRET_KEY to .env.local
See .claude/BLOCKERS.md for details.
Completion Signal Format
Subagents MUST emit this at response end:
--- TASK COMPLETION ---
task_id: T005
task_name: Create User model
status: completed | blocked | failed
duration_minutes: 15
files_created:
- path/to/file
files_modified:
- path/to/file
success_criteria:
- [PASS] file_exists: src/models/User.ts
- [PASS] command_succeeds: npx tsc --noEmit
blocker: none | "description"
notes: |
Summary of work done
context_updated: true
progress_notes_updated: true
tasks_json_updated: true
next_task: T006 | null
--- END COMPLETION ---
Quick Reference: Commands
Always write prompt to project history, then pipe:
# Write prompt to history (creates audit trail)
mkdir -p .claude/prompts
cat > .claude/prompts/T001.md << 'EOF'
[Your prompt here]
EOF
# Claude (recommended for most tasks)
cat .claude/prompts/T001.md | claude --model sonnet --permission-mode acceptEdits -p
cat .claude/prompts/T001.md | claude --model opus --dangerously-skip-permissions -p
# Gemini
cat .claude/prompts/T001.md | gemini --approval-mode auto_edit
cat .claude/prompts/T001.md | gemini -y
# Codex
cat .claude/prompts/T001.md | codex exec --skip-git-repo-check --full-auto --model gpt-5.2-codex -
References
- project-protocol.md — Completion signal spec, file update requirements
- task-prompt-template.md — Template for project task prompts
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です