EXECUTION INSTRUCTIONS
When this skill is invoked, follow these steps in order:
Step 0: Parse the arguments and initialize
-
Parse the command to extract:
- Flags:
--auto,--review,--tests,--resume - Feature description: everything after the flags
Exemple : "/apex --auto --tests Ajouter un dark mode" → flags: { auto: true, review: false, tests: true, resume: false } → feature: "Ajouter un dark mode" - Flags:
-
Determine the mode :
- If
--auto: autonomous mode (no confirmation between steps) - Otherwise: interactive mode (confirmation with AskUserQuestion before each step)
- In autonomous mode:
--reviewand--testscontrol whether these steps are executed - In interactive mode: all steps are proposed
- If
-
Create the todo list with TodoWrite:
1. [pending] Vérifications git et création branche 2. [pending] Analyse du codebase 3. [pending] Planification de l'implémentation 4. [pending] Implémentation du code 5. [pending] Validation (build/lint/types) 6. [pending] Code review (si activé) 7. [pending] Correction des issues (si nécessaire) 8. [pending] Écriture des tests (si activé) 9. [pending] Vérification des tests (si activé) 10. [pending] Création de la Pull Request -
Display the header :
🚀 APEX - Autonomous Development Workflow ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Feature: {feature_description} Mode: {Interactif | Autonome} {flags actifs}
Step 1: Init Branch
Mark todo 1 as in_progress
- Check that we are in a git repo:
git rev-parse --git-dir - Check the working tree:
git status --porcelain- If not empty → ask the user: commit/stash/abort
- Identify the main branch: look for
main,master, ordevelop - Pull the latest changes:
git checkout {main} && git pull - Generate the branch name:
- Extract keywords from the feature → kebab-case
- Prefix with
feature/ - Limit to 50 characters
- Create the branch:
git checkout -b feature/{nom} - Create the folder
.apex/for the workflow artifacts
Mark todo 1 as completed
Step 2: Analyze Code (Agent Explore)
Mark todo 2 as in_progress
In interactive mode: ask for confirmation with AskUserQuestion before launching
Use the Task tool with subagent_type: "Explore" :
Prompt: Explore ce codebase pour comprendre comment implémenter la feature suivante :
"{feature_description}"
Analyse demandée :
1. Structure générale du projet (dossiers, architecture)
2. Patterns utilisés (state management, routing, styling, etc.)
3. Fichiers pertinents pour cette feature (avec chemins)
4. Conventions de code observées (naming, structure)
5. Technologies et frameworks détectés
Retourne un rapport structuré avec ces informations.
Store the result for the next step.
Mark todo 2 as completed
Step 3: Plan Feature (Agent Plan)
Mark todo 3 as in_progress
In interactive mode: ask for confirmation with AskUserQuestion
Use the Task tool with subagent_type: "Plan" :
Prompt: En te basant sur l'analyse ci-dessous, crée un plan d'implémentation pour :
"{feature_description}"
Analyse du codebase :
{résultat_étape_2}
Le plan doit inclure :
1. Stratégie d'implémentation
2. Liste des fichiers à créer (avec chemins complets)
3. Liste des fichiers à modifier (avec changements spécifiques)
4. Séquence d'implémentation ordonnée
5. Points d'attention et risques
Write the plan in .apex/plan.md
Mark todo 3 as completed
Step 4: Execute (Implementation)
Mark todo 4 as in_progress
In interactive mode: ask for confirmation with AskUserQuestion
Read .apex/plan.md and for each task in the plan:
- Read the relevant file (if modified)
- Implement the change
- Atomic commit with conventional message:
git commit -m "type(scope): description Co-Authored-By: Claude <noreply@anthropic.com>"
Commit types:
feat: new featurefix: bug fixrefactor: refactoringtest: testsdocs: documentation
Mark todo 4 as completed
Step 5: Validate
Mark todo 5 as in_progress
-
Detect the project type by looking for:
package.json→ Node.jsCargo.toml→ Rustgo.mod→ Gopyproject.toml/requirements.txt→ Python
-
For Node.js, read
package.jsonand identify:- Package manager: pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm
- Available scripts:
build,lint,typecheck,type-check,tsc
-
Run the available validations :
Project Build Lint Types Node.js {pm} run build{pm} run lint{pm} run typecheckortsc --noEmitRust cargo buildcargo clippy(included) Go go build ./...go vet ./...(included) Python - ruff check .mypy . -
If error :
- Parse the error message
- Fix the affected file
- Commit:
fix(scope): resolve {type} error - Retry (max 3 times)
-
If no validation scripts : note and continue
Mark todo 5 as completed
Step 6: Review (if enabled)
Skip if mode --auto without --review
Mark todo 6 as in_progress
In interactive mode: ask for confirmation with AskUserQuestion
-
Get the full diff:
git diff main...HEAD -
Perform a code review by analyzing:
- Bugs : logic errors, edge cases
- Security : injections, XSS, exposed data
- Performance : N+1, unnecessary renders
- Conventions : adherence to project patterns
-
Categorize the issues:
- 🔴 Critical : must be fixed (blocking)
- 🟡 Warning : should be fixed
- 🔵 Suggestion : optional improvement
-
Write the report in
.apex/review.md
Mark todo 6 as completed
Step 7: Fix Issues (if necessary)
Skip if no Critical/Warning issues in review.md
Mark todo 7 as in_progress
- Read
.apex/review.md - For each Critical and Warning issue:
- Locate the file and line
- Apply the fix
- Commit:
fix(scope): resolve review issue {id}
- Re-run step 5 (Validate)
Mark todo 7 as completed
Step 8: Add Tests (if enabled)
Skip if mode --auto without --tests
Mark todo 8 as in_progress
In interactive mode: ask for confirmation with AskUserQuestion
-
Detect the test framework :
jest.config.*or"jest"in package.json → Jestvitest.config.*→ Vitestpytest.iniorpyproject.tomlwith pytest → Pytest*_test.goexisting → Go testingCargo.toml→ Rust tests
-
Find examples of existing tests for style reference
-
Write the tests :
- Unit tests for the new functions
- Edge case tests (null, empty, errors)
- Place in the right folder according to the project conventions
-
Commit :
test(scope): add tests for {feature}
Mark todo 8 as completed
Step 9: Verify Tests (if enabled)
Skip if step 8 skipped
Mark todo 9 as in_progress
-
Run the tests :
- Jest/Vitest:
{pm} testornpx jest - Pytest:
pytest - Go:
go test ./... - Rust:
cargo test
- Jest/Vitest:
-
If failure :
- Analyze whether the bug is in the code or the test
- Fix
- Commit:
fix(test): correct {test_name} - Retry (max 3 times)
Mark todo 9 as completed
Step 10: Create PR
Mark todo 10 as in_progress
-
Push the branch :
git push -u origin feature/{nom} -
Generate the title :
{type}: {description courte en anglais} -
Generate the body :
## Summary {Description de la feature} ## Changes {Liste des changements extraite des commits} ## Testing - [x] Build passes - [x] Lint passes - [x] Type check passes - [x] Unit tests pass --- 🤖 Generated with [Claude Code](https://claude.ai/claude-code) using /apex -
Create the PR :
gh pr create --title "{titre}" --body "{body}" -
Display the result :
🎉 Pipeline complete! PR: {url}
Mark todo 10 as completed
ERROR HANDLING
Interactive mode
On each error, use AskUserQuestion:
options: ["Retry", "Skip cette étape", "Abort le workflow"]
Autonomous mode
- Automatic retry (max 2 times)
- If persistent failure → ask the user with AskUserQuestion
Blocking errors (always abort)
- Not a git repo
- No origin remote
- Push fails (permissions)
HANDLING THE --resume FLAG
If --resume is present:
- Check if a branch
feature/*exists locally - Checkout this branch
- Analyze the state:
.apex/plan.mdexists → step 3 completed.apex/review.mdexists → step 6 completed- Count the commits since main → estimate progress
- Resume at the next step
CONVENTIONS
Artifact structure
.apex/
├── plan.md # Plan d'implémentation (étape 3)
└── review.md # Rapport de review (étape 6)
Branch naming
feature/{mots-clés-kebab-case} (max 50 chars)
Commit format
type(scope): description en anglais
Co-Authored-By: Claude <noreply@anthropic.com>
QUICK REFERENCE
| Mode | Command | Review | Tests |
|---|---|---|---|
| Fully interactive | /apex {feature} |
✓ | ✓ |
| Minimal autonomous | /apex --auto {feature} |
✗ | ✗ |
| Autonomous + review | /apex --auto --review {feature} |
✓ | ✗ |
| Autonomous + tests | /apex --auto --tests {feature} |
✗ | ✓ |
| Fully autonomous | /apex --auto --review --tests {feature} |
✓ | ✓ |
| Resume | /apex --resume |
- | - |
Detailed reference
For more details on each step: references/workflow.md