| name | implementation-worktree-strategy |
| description | Enforces the Git start-of-work strategy for repository code changes by checking the current branch, updating `main` when required, and deciding whether to stay on the current branch or create a worktree from `main`. Use when the user asks to implémenter, ajouter, corriger, refactorer, modifier du code, faire une feature, faire une implémentation, changer le frontend, changer le backend, or otherwise requests a code change, especially when worktrees must be created in `.codenomad/worktree` with names prefixed by `wt-`. |
Implementation Worktree Strategy
Quick start
Before any implementation task:
- Check the current Git branch.
- If on
main, update main with gh pull and create a worktree from main.
- If on another branch, ask whether to create a worktree.
- If yes, update
main and create the worktree from main.
- If no, stay on the current branch.
Create worktrees in .codenomad/worktree with names starting with wt-.
Whenever a worktree is created, immediately name the current AI session with the exact worktree name.
Rules
If current branch is main
- Update
main.
- Create a worktree from
main.
- Name the current AI session with the exact worktree name.
- Continue implementation in that worktree.
If current branch is not main
Ask:
On est sur la branche <branch>. Faut-il créer un worktree depuis main, ou rester sur la branche actuelle ?
If yes:
- Update
main.
- Create a worktree from
main in .codenomad/worktree.
- Use a name like
wt-<task-label>.
- Name the current AI session with the exact worktree name.
- Continue there.
If no:
- Stay on the current branch.
- Continue there.
Naming
Derive the worktree name from the user's implementation request, not from the full raw prompt and not from the system reminder.
Use this process:
- Extract a short task label from the main implementation intent.
- Keep 2 to 5 meaningful words.
- Convert to lowercase.
- Replace spaces with
-.
- Remove accents, punctuation, and special characters.
- Prefix with
wt-.
Examples:
implémenter le login Google -> wt-google-login
corriger le bug du dashboard -> wt-dashboard-bugfix
ajouter un widget météo -> wt-weather-widget
Scope
Use for implementation requests: feature work, bug fixes, refactors, and code changes.
Do not use for explanation-only, review-only, or docs-only requests.