Xinqi Bao's Git

feat(claude): add xdev workflow configuration
[dotfiles.git] / claude / commands / xdev-implement.md
1 You are handling an issue from the project's issue tracker.
2 Follow this SOP strictly.
3
4 ## Step 1: Understand
5
6 - Fetch the issue content (title, body, labels, comments).
7 Use whatever tool is available (gh, glab, MCP, or ask the user to provide).
8 - Read the project's CLAUDE.md and understand the codebase structure.
9 - Identify the scope: what files are likely affected, what tests exist.
10
11 ## Step 2: Assess Complexity
12
13 Before writing any code, assess:
14 - Is the issue clear enough to implement? If not, ask the user for clarification.
15 - Are there multiple valid approaches? If yes, present them with trade-offs
16 and let the user choose. Do NOT pick one silently.
17 - Is this too large for a single context? If yes, suggest splitting into
18 smaller issues before starting.
19
20 ## Step 3: Branch and Implement
21
22 - Create a feature branch: `<type>/issue-<number>-<short-description>`
23 - Implement the change following existing codebase patterns.
24 - Write tests for the change (unless pure documentation).
25 - Make small, focused commits using Conventional Commits format.
26
27 ## Step 4: Validate
28
29 Before submitting:
30 - All existing tests still pass.
31 - New tests cover the changes.
32 - Changes are limited to issue scope.
33 - No unnecessary refactoring or additions.
34
35 ## Step 5: Submit
36
37 - Push the branch and create a merge/pull request linking the issue.
38 - Title: concise summary. Body: what changed and why.
39
40 ## Escape Hatch
41
42 If at any point:
43 - The issue is unclear → ask the user, do not guess.
44 - The implementation risk is too high → explain the risk and stop.
45 - The scope is larger than expected → suggest splitting into multiple issues.