name: dev description: "E2E development: investigate → dig → decompose → implement → test → review → PR" argument-hint: "[issue number or ID, e.g. #42 or PGR-1234]" user-invocable: true disable-model-invocation: true allowed-tools:
- Bash(git checkout:*)
- Bash(git add:*)
- Bash(git commit:*)
- Bash(git push:*)
- Bash(git diff:*)
- Bash(git log:*)
- Bash(git status)
- Bash(git branch:*)
- Bash(gh pr create:*)
- Bash(gh issue view:*)
- Glob
- Grep
- Read
- Edit
- Write
- Agent
- Skill
- TaskCreate
- TaskUpdate
- TaskList
- TaskGet
- ToolSearch
- AskUserQuestion
/dev — E2E Development Workflow
Resolve Issue $ARGUMENTS from investigation to PR creation.
Target: $ARGUMENTS
Setup: Create Task Tracker
Use TaskCreate to create a task for each phase. This provides progress visibility and persistence across /compact.
- "Gather context from issue"
- "Investigate codebase"
- "Resolve ambiguities (/dig)"
- "Decompose into subtasks (/decompose)"
- "Implement changes"
- "Run quality gate"
- "Review changes"
- "Commit & create PR"
Use TaskUpdate to mark each task in_progress when starting and completed when done.
Workflow
Phase 1: Issue Understanding
↓
Phase 2: Investigation (← Explore subagent)
↓
Phase 3: Ambiguity Resolution (/dig)
↓
Phase 4: Task Decomposition (/decompose)
↓
── AskUserQuestion: confirm approach + task list ──
↓
Phase 5: Branch & Implement
↓
Phase 6: Quality Gate (build + test + lint from CLAUDE.md)
↓
Phase 7: Review (/review)
↓
── AskUserQuestion: commit + PR confirmation ──
↓
Phase 8: Commit & PR Creation
Phase 1: Issue Understanding
Mark task 1 in_progress.
Detect the issue source from "$ARGUMENTS":
GitHub Issue (starts with # or is a number):
gh issue view <number> --json number,title,body,labels,assignees,comments- Extract: title, description, acceptance criteria, labels
Linear Issue (matches XXX-1234 pattern):
- Use
ToolSearchwith+linearto load the Linear MCP - Call
mcp__linear__get_issuewith the issue ID
Figma links in the issue description (figma.com/design/...):
- Use
ToolSearchwith+figma-remoteto load Figma MCP - Fetch design context and screenshot
Branch naming (from labels or issue type):
- Bug →
fix/{issue-ref}-{kebab-case-short-desc} - Otherwise →
feat/{issue-ref}-{kebab-case-short-desc}
Read CLAUDE.md for project architecture and conventions.
Migration Detection
If the issue involves library/framework updates, version bumps, or API deprecations:
- Check labels for
migration,upgrade,dependency, orbreaking-change - If Android/KMP project and
androidCLI is available: runandroid docs search "{migration topic}"to get latest official migration guidance - Note migration-specific risks (breaking changes, deprecated APIs) for Phase 3 (/dig)
Mark task 1 completed.
Phase 2: Investigation (Subagent)
Mark task 2 in_progress.
Delegate to Explore agent:
Agent(
subagent_type: "Explore",
prompt: <include issue details, keywords, ask for "very thorough" investigation>
)
The investigator must:
- Find relevant code with Grep/Glob
- Actually read every involved file — no speculation
- Trace the data flow end-to-end
- Check existing tests
- List files needing changes, callers, downstream dependencies
Think Twice
After receiving the report:
- Did the investigator actually read the code?
- Are there other possible causes not considered?
- Is impact analysis complete?
If anything is ambiguous, use AskUserQuestion. Never assume.
Mark task 2 completed.
Phase 3: Ambiguity Resolution
Mark task 3 in_progress.
Use the /dig skill with investigation results to resolve decision points.
Mark task 3 completed.
Phase 4: Task Decomposition
Mark task 4 in_progress.
Use the /decompose skill to break the work into ordered subtasks.
Mark task 4 completed.
── AskUserQuestion: Approach Confirmation ──
Present to the user:
- Decision Matrix (from /dig)
- Task List (from /decompose, with dependencies)
- Investigation summary (key findings)
Ask the user to confirm before implementation.
Phase 5: Branch & Implement
Mark task 5 in_progress.
5a. Create Branch
git checkout -b {branch-name}
5b. Implement
TDD mode (when issue has tdd label, or test changes are the primary goal):
LOOP for each subtask:
1. TaskUpdate → in_progress
2. Read target code
3. Write/update tests FIRST (use test-writer agent if needed)
4. Run tests — confirm they FAIL (red)
5. Implement the minimal code to pass
6. Run tests — confirm they PASS (green)
7. Refactor if needed (keep tests passing)
8. TaskUpdate → completed
Standard mode (default):
LOOP for each subtask (in dependency order):
1. TaskUpdate → in_progress
2. Read target code (MUST read before editing)
3. Implement changes (Edit/Write)
4. Self-verify (run Verify step from task description)
5. TaskUpdate → completed
INTERRUPT conditions:
- Unexpected problem → AskUserQuestion
- 3 consecutive failures → STOP and report
Guidelines:
- Follow existing code patterns (read surrounding code first)
- Follow CLAUDE.md conventions
- Keep changes minimal and focused
Mark task 5 completed.
Phase 6: Quality Gate
Mark task 6 in_progress.
Run the project's build, test, and lint commands as defined in CLAUDE.md's Commands section.
If CLAUDE.md doesn't specify commands, detect from project files:
build.gradle.kts/gradlew→./gradlew build,./gradlew test,./gradlew detektpackage.json→npm test,npm run lintCargo.toml→cargo build,cargo test,cargo clippypyproject.toml/setup.py→pytest,ruff check
Failure Handling
- Analyze the failure
- Fix the issue
- Re-run the failing check
- Maximum 3 fix attempts — if still failing, report to user and stop
Mark task 6 completed.
Phase 7: Review
Mark task 7 in_progress.
Use the /review skill to run multi-agent parallel review.
Review Result Handling
- Critical: STOP. Report to user. Do NOT proceed.
- Warning: Fix, re-run Quality Gate (Phase 6)
- Suggestion: Note but don't block
Mark task 7 completed.
── AskUserQuestion: Commit + PR Confirmation ──
Show the user:
- Summary of all changes
- Quality gate results
- Review findings and resolutions
- Proposed commit message (single line, no AI stamps)
Phase 8: Commit & PR Creation
Mark task 8 in_progress.
8a. Commit
git add {specific files}
git commit -m "{concise message}"
- Explicit file staging (no
git add .) - No Co-Authored-By, no AI stamps
8b. Push & PR
git push -u origin {branch-name}
Use the project's pull_request_template.md if available. Only fill in Description and Related Issues.
gh pr create --title "#{issue} {description}" --body "$(cat <<'EOF'
## Description
- {bullet point summary}
## Related Issues
Closes #{issue}
EOF
)"
Report PR URL to the user.
Mark task 8 completed.
Error Handling
| Situation | Action |
|---|---|
| Issue not found | Report error, stop |
| Figma fetch fails | Warn, continue without design |
| Investigation unclear | AskUserQuestion before proceeding |
| Tests fail (≤3 attempts) | Fix and retry |
| Tests fail (>3 attempts) | Report to user, stop |
| Critical review finding | Report to user, stop |
| Warning review finding | Fix, re-run quality gate |
| Git/PR creation fails | Report error, stop |