SuperAPI AI Directory

apex

Coding & development

View repository

Updated 10-15 20:28

About this skill

/apex - Autonomous Development Workflow

EXECUTION INSTRUCTIONS

When this skill is invoked, follow these steps in order:

Step 0: Parse the arguments and initialize

  1. 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"
    
  1. Determine the mode :

    • If --auto : autonomous mode (no confirmation between steps)
    • Otherwise: interactive mode (confirmation with AskUserQuestion before each step)
    • In autonomous mode: --review and --tests control whether these steps are executed
    • In interactive mode: all steps are proposed
  2. 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
    
  3. 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

  1. Check that we are in a git repo: git rev-parse --git-dir
  2. Check the working tree: git status --porcelain
    • If not empty → ask the user: commit/stash/abort
  3. Identify the main branch: look for main, master, or develop
  4. Pull the latest changes: git checkout {main} && git pull
  5. Generate the branch name:
    • Extract keywords from the feature → kebab-case
    • Prefix with feature/
    • Limit to 50 characters
  6. Create the branch: git checkout -b feature/{nom}
  7. 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:

  1. Read the relevant file (if modified)
  2. Implement the change
  3. Atomic commit with conventional message:
    git commit -m "type(scope): description
    
    Co-Authored-By: Claude <noreply@anthropic.com>"
    

Commit types:

  • feat: new feature
  • fix: bug fix
  • refactor: refactoring
  • test: tests
  • docs: documentation

Mark todo 4 as completed

Step 5: Validate

Mark todo 5 as in_progress

  1. Detect the project type by looking for:

    • package.json → Node.js
    • Cargo.toml → Rust
    • go.mod → Go
    • pyproject.toml / requirements.txt → Python
  2. For Node.js, read package.json and identify:

    • Package manager: pnpm-lock.yaml → pnpm, yarn.lock → yarn, otherwise npm
    • Available scripts: build, lint, typecheck, type-check, tsc
  3. Run the available validations :

    Project Build Lint Types
    Node.js {pm} run build {pm} run lint {pm} run typecheck or tsc --noEmit
    Rust cargo build cargo clippy (included)
    Go go build ./... go vet ./... (included)
    Python - ruff check . mypy .
  4. If error :

    • Parse the error message
    • Fix the affected file
    • Commit: fix(scope): resolve {type} error
    • Retry (max 3 times)
  5. 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

  1. Get the full diff: git diff main...HEAD

  2. 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
  3. Categorize the issues:

    • 🔴 Critical : must be fixed (blocking)
    • 🟡 Warning : should be fixed
    • 🔵 Suggestion : optional improvement
  4. 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

  1. Read .apex/review.md
  2. For each Critical and Warning issue:
    • Locate the file and line
    • Apply the fix
    • Commit: fix(scope): resolve review issue {id}
  3. 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

  1. Detect the test framework :

    • jest.config.* or "jest" in package.json → Jest
    • vitest.config.* → Vitest
    • pytest.ini or pyproject.toml with pytest → Pytest
    • *_test.go existing → Go testing
    • Cargo.toml → Rust tests
  2. Find examples of existing tests for style reference

  3. 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
  4. 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

  1. Run the tests :

    • Jest/Vitest: {pm} test or npx jest
    • Pytest: pytest
    • Go: go test ./...
    • Rust: cargo test
  2. 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

  1. Push the branch :

    git push -u origin feature/{nom}
    
  2. Generate the title : {type}: {description courte en anglais}

  3. 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
    
  4. Create the PR :

    gh pr create --title "{titre}" --body "{body}"
    
  5. 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

  1. Automatic retry (max 2 times)
  2. 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:

  1. Check if a branch feature/* exists locally
  2. Checkout this branch
  3. Analyze the state:
    • .apex/plan.md exists → step 3 completed
    • .apex/review.md exists → step 6 completed
    • Count the commits since main → estimate progress
  4. 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