with one click
commit
Create conventional commits
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Create conventional commits
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Create formatted branches
Generate deployment summary
Contextual linting
Create pull requests
Pre-commit security validation
| description | Create conventional commits |
| name | commit |
| version | 1.0.0 |
Crée un commit suivant les Conventional Commits du projet avec validation automatique.
/commit
Format de commit : type(scope): sujet
feat, refactor, fix, chore, testapp, api, analytics, widget, jobs, ci(Voir AGENTS.md et commitlint.config.cjs pour détails)
# Fichiers modifiés/ajoutés/supprimés
git status --porcelain
# Diff détaillé (staged + unstaged)
git diff HEAD
# Diff stats
git diff HEAD --stat
Parser les chemins pour déterminer les domaines affectés :
api/** → scope apiapp/** → scope appanalytics/** → scope analyticswidget/** → scope widgetterraform/**, .github/workflows/** → scope ci**/jobs/**) → scope jobsDéterminer le scope principal :
# CRITIQUE : Exécuter /safety-check AVANT de continuer
/safety-check
Si /safety-check échoue (exit code 1) :
❌ Commit bloqué par safety checks
→ Voir les erreurs ci-dessus
→ Action : Corriger les erreurs et relancer /commit
STOP : Ne pas créer le commit.
Si warnings (exit code 0 avec warnings) : Demander confirmation utilisateur :
⚠️ Safety warnings détectés (voir ci-dessus)
→ Voulez-vous continuer le commit ? (y/n)
Basé sur les fichiers modifiés et le diff :
featfixrefactortestchoreHeuristiques :
TODO, FIXME, bug, error, fix*.test.ts, *.spec.ts, describe(, it(prisma/migrations/, analytics/migrations/package.json, .env.example, tsconfig.jsonFormat : type(scope): subject
Exemple de génération :
# Scope : api
# Fichiers : api/src/controllers/events.ts, api/src/services/tracking.ts
# Nouveaux : oui (feature)
# → Suggestion :
feat(api): add client tracking to stat events
Règles de génération du sujet :
Vérifier l'historique pour cohérence du style :
git log --oneline -n 10 --pretty=format:"%s"
Analyser les patterns de messages existants pour garder la cohérence.
# Tester avec commitlint (dry-run)
echo "feat(api): add client tracking" | npx commitlint --config commitlint.config.cjs
Si validation échoue :
❌ Message invalide selon commitlint
→ Erreur : [détails de l'erreur]
→ Suggestion : [message corrigé]
Proposer le message corrigé et redemander validation.
# Lister les fichiers non stagés
git status --porcelain | grep '^[ M?]'
Exclure automatiquement :
**/.env, **/.env.***/node_modules/****/dist/, **/build/, **/.next/# Stager les fichiers pertinents
git add <fichiers_pertinents>
Demander confirmation si fichiers sensibles détectés (ex: package-lock.json avec beaucoup de changements).
git commit -m "$(cat <<'EOF'
feat(api): add client tracking to stat events
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
EOF
)"
Format du commit :
type(scope): subjectCo-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com># Afficher le commit créé
git log -1 --pretty=format:"%h - %s (%an, %ar)"
# Afficher les fichiers commités
git show --name-only --pretty=format:"" HEAD
Suggérer prochaines actions :
✅ Commit créé avec succès : feat(api): add client tracking
→ Prochaines étapes suggérées :
1. Vérifier les tests : npm run test (ou /api/test)
2. Linter le code : npm run lint (ou /lint)
3. Pousser la branche : git push
4. Créer une PR : /pr
Fichiers modifiés :
- api/src/controllers/events.ts (+45 -10)
- api/src/services/tracking.ts (+120 -0)
- api/src/types/event.ts (+15 -5)
→ Scope : api
→ Type : feat (nouveaux fichiers + feature)
→ Message : feat(api): add client tracking to stat events
Fichiers modifiés :
- widget/components/DatePicker.tsx (+5 -5)
→ Scope : widget
→ Type : fix (correction de bug)
→ Message : fix(widget): correct date filter validation
Fichiers modifiés :
- package.json (+2 -2)
- api/package.json (+1 -1)
- widget/package.json (+1 -1)
→ Scope : ci (config globale)
→ Type : chore (maintenance)
→ Message : chore(ci): update dependencies
Fichiers modifiés :
- analytics/src/jobs/export.ts (+80 -120)
- analytics/src/utils/helpers.ts (+30 -60)
→ Scope : analytics
→ Type : refactor (restructuration sans changement comportemental)
→ Message : refactor(analytics): simplify export job logic
Si migrations Prisma détectées :
git diff --name-only | grep 'api/prisma/migrations/'
Ajouter dans le corps du commit :
feat(api): add client_id to stat_event table
Adds client_id column to track event origin.
Migration: 20260127_add_client_id_to_stat_event
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Si breaking change détecté (suppression de champs API, modification de schéma) :
feat(api)!: remove deprecated analytics endpoints
BREAKING CHANGE: /analytics/* endpoints removed, use /stats/* instead
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Si vraiment nécessaire (rare) :
feat(api,widget): add cross-origin event tracking
Mais préférer découper en plusieurs commits si possible.
Permissions requises dans .claude/settings.local.json :
Bash(git status:*)Bash(git diff:*)Bash(git log:*)Bash(git add:*)Bash(git commit:*)Bash(npx commitlint:*)Read(*)Ce skill est utilisé par :
/pr (pour valider les commits avant création de PR)/commit directement)/safety-check avant de créer le commitcommit-msg exécute commitlint en parallèle (validation supplémentaire)