From b15620926263c183bf6e88366d920c83e417210b Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:27:11 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 ++ README.md | 3 + plugin.lock.json | 45 ++++++ skills/helping-with-commits/SKILL.md | 196 +++++++++++++++++++++++++++ 4 files changed, 256 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 plugin.lock.json create mode 100644 skills/helping-with-commits/SKILL.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..2f3c2d7 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "leapmultix-skill-helping-with-commits", + "description": "Skill helping-with-commits from LeapMultix", + "version": "1.0.0", + "author": { + "name": "Julien LE SAUX", + "email": "contact@jls42.org" + }, + "skills": [ + "./skills" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..779cba8 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# leapmultix-skill-helping-with-commits + +Skill helping-with-commits from LeapMultix diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..10806ab --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:jls42/leapmultix:leapmultix-marketplace/skills/helping-with-commits", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "cbd2317c050ccdb7b037a5f3325700df33540029", + "treeHash": "fba6b24ac0f645754fbf71346fb10da90956f4a853e74a2bc51dbb7416805169", + "generatedAt": "2025-11-28T10:19:12.940351Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "leapmultix-skill-helping-with-commits", + "description": "Skill helping-with-commits from LeapMultix", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "2b691130a1c3ec882bb5a53a03c4820887b20ea25443a3112553c7fb2497888d" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "fe472825ce7f6e4d65307233cd79eb020536ddbb12905b7875cf3bc4c34c0f32" + }, + { + "path": "skills/helping-with-commits/SKILL.md", + "sha256": "a6a01d1893f6a8ca2c457fb5ebf80f38b43c8af7cf59a9441e1971fb21549a73" + } + ], + "dirSha256": "fba6b24ac0f645754fbf71346fb10da90956f4a853e74a2bc51dbb7416805169" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/helping-with-commits/SKILL.md b/skills/helping-with-commits/SKILL.md new file mode 100644 index 0000000..8bd94f1 --- /dev/null +++ b/skills/helping-with-commits/SKILL.md @@ -0,0 +1,196 @@ +--- +name: helping-with-commits +description: Automates Git commit creation with conventional messages. Use when user wants to commit changes with automatic diff analysis +allowed-tools: Read, Grep, Glob, Bash +--- + +# Commit Helper + +Automatise la création de commits Git avec messages conformes Conventional Commits. + +## Table des matières + +- [Quand utiliser ce Skill](#quand-utiliser-ce-skill) +- [Convention Conventional Commits](#convention-conventional-commits) +- [Workflow de création](#workflow-de-création) +- [Exemples](#exemples) +- [Cas d'usage](#cas-dusage) +- [Gestion erreurs](#gestion-erreurs) +- [Checklist avant commit](#checklist-avant-commit) +- [En cas de doute](#en-cas-de-doute) + +## Quand utiliser ce Skill + +- Utilisateur demande de "commit" ou "committer" +- Après feature, fix, ou refactoring terminé +- Avant de créer une Pull Request + +## Convention Conventional Commits + +### Format + +``` +(): +``` + +**Types :** feat, fix, refactor, perf, test, docs, style, chore, ci + +**Scopes leapmultix :** arcade, i18n, ui, a11y, perf, pwa, test, deps + +**Description :** + +- Verbe impératif minuscule (add, fix, update, remove) +- Pas de majuscule, pas de point +- Max 72 caractères +- Spécifique (pas "update code") + +## Workflow de création + +### 1. Analyser état Git + +```bash +git status +git diff --staged +git diff +git log --oneline -5 # Style existant +``` + +### 2. Déterminer type et scope + +**Type :** + +- Nouveaux fichiers/fonctions → feat +- Corrections bugs → fix +- Restructuration → refactor +- Tests uniquement → test +- package.json → chore(deps) + +**Scope :** + +- Examine chemins fichiers +- Identifie domaine principal +- Omets si générique/multiple + +### 3. Générer description + +- Verbe impératif minuscule +- QUOI pas COMMENT +- Spécifique < 72 chars + +### 4. Valider qualité + +```bash +npm run format:check # Si échec → format +npm run lint # Si échec → lint:fix +npm test +npm run i18n:compare # Si i18n modifié +``` + +### 5. Créer commit + +```bash +git add +git commit -m "type(scope): description" +``` + +**Avec body si nécessaire :** + +```bash +git commit -m "$(cat <<'EOF' +type(scope): description + +Optional body explaining details. +EOF +)" +``` + +## Exemples + +**Bons :** + +``` +feat(arcade): add power-up system to Multimiam +fix(arcade): correct collision detection +refactor(arcade): extract rendering logic +chore(deps): update jest to 29.7.0 +feat(i18n): add Spanish translations +``` + +**Mauvais :** + +``` +fix: bug fixes # Trop vague +Add new feature # Pas de type +feat: added feature # Pas impératif +``` + +## Cas d'usage + +### Multiples fichiers, même feature + +Un seul commit avec tous les fichiers. + +### Multiples types (feat + fix + refactor) + +Créer PLUSIEURS commits séparés. Chaque commit = 1 objectif. + +### i18n modifié + +```bash +npm run i18n:compare # Vérifie sync +# Puis commit +``` + +### Dépendances + +```bash +chore(deps): add playwright +chore(deps): update jest to 29.7.0 +fix(deps): update minimatch (CVE-2022-3517) +``` + +## Gestion erreurs + +### Tests échouent + +NE PAS committer ! Fix d'abord ou WIP avec `--no-verify` (précaution). + +### Lint/Format échoue + +```bash +npm run lint:fix +npm run format +git add . +# Puis commit +``` + +## Checklist avant commit + +- [ ] Type correct (feat/fix/refactor/test/chore/docs/style/perf/ci) +- [ ] Scope pertinent (ou vide) +- [ ] Description impérative < 72 chars +- [ ] `npm run format:check` passe +- [ ] `npm run lint` passe +- [ ] `npm test` passe +- [ ] `npm run i18n:compare` si i18n +- [ ] Pas secrets/keys + +## En cas de doute + +**Source :** CLAUDE.md et `git log` (exemples) + +**Règles absolues :** + +1. Vérifier qualité avant commit +2. Conventional Commits obligatoire +3. Jamais commit si tests échouent (sauf WIP) +4. Jamais secrets/keys +5. Jamais mentionner l'IA (pas de 'Generated with Claude' ou 'Co-Authored-By: Claude') + +**Workflow :** + +```bash +npm run verify +git add +git commit -m "type(scope): description" +```