Notre avis
Permet de modifier le dernier commit en ajoutant des modifications staged ou en mettant à jour le message, conformément à la spécification Conventional Commits.
Points forts
- Gère en toute sécurité l'ajout de fichiers oubliés ou la correction de messages.
- Valide automatiquement le format Conventional Commits.
- Avertit si le commit a déjà été pushé ou s'il s'agit d'un commit de merge.
Limites
- Ne peut pas modifier les commits de merge.
- Nécessite une confirmation explicite pour forcer le push si le commit est déjà sur le remote.
- Ne modifie que le dernier commit de la branche.
Utilisez cette compétence lorsque vous devez corriger rapidement le dernier commit sans en créer un nouveau.
Évitez de l'utiliser si le commit a déjà été pushé et que vous ne voulez pas forcer le push, ou s'il s'agit d'un commit de merge.
Analyse de sécurité
SûrThe skill only uses standard git commands for amending commits, with safety checks to prevent amending pushed/merge commits. No destructive, exfiltrating, or obfuscated actions.
Aucun point d'attention détecté
Exemples
I forgot to include the README changes in my last commit. Can you amend it to add those staged changes?git:amend fixCan you amend the last commit to have a new message: 'feat(api): add login endpoint'name: git:amend description: Amend Commit - modifies the last commit with staged changes or new message
Amend Commit
Modifies the most recent commit by adding staged changes, updating the message, or both. Follows Conventional Commits specification for message formatting.
When to use
Use this skill when the user needs to:
- Add forgotten files to the last commit
- Fix a typo in the last commit message
- Combine small fixes into the previous commit
- Update commit message to follow conventions
Instructions
Step 1: Check Current State
- Run
git log -1 --pretty=format:"%h %s"to show the last commit - Run
git diff --cached --statto see if there are staged changes - Run
git diff --statto see unstaged changes
Display to user:
Last commit: a1b2c3d feat(auth): add login form
Staged changes: 2 files
Unstaged changes: 1 file
Step 2: Determine Amend Type
Based on state and user intent:
| Scenario | Action | |----------|--------| | Staged changes, no message provided | Add changes, keep message | | No staged changes, message provided | Update message only | | Staged changes + message provided | Add changes + update message | | No staged changes, no message | Ask what user wants to do |
Step 3: Handle Staged Changes
If there are staged changes to add:
- Show the diff summary
- Confirm these should be added to the last commit
- Warn if changes seem unrelated to the original commit
Step 4: Handle Message Update
If updating the message:
- Parse current message - Extract type, scope, description
- Apply changes:
- If user provides full message → use it
- If user provides partial (e.g., just type) → merge with existing
- Validate format - Ensure Conventional Commits compliance
Quick fixes:
git:amend fix→ Change type tofix, keep restgit:amend (api)→ Change scope toapi, keep restgit:amend "better description"→ Update description only
Step 5: Confirm and Execute
Show the planned changes:
Amending commit a1b2c3d
Current: feat(auth): add login form
New: fix(auth): add login form validation
Adding: 2 files (+15, -3 lines)
Proceed? [Y/n]
If approved, run:
# Message change only
git commit --amend -m "<new message>"
# Changes only (keep message)
git commit --amend --no-edit
# Both
git commit --amend -m "<new message>"
Important: Do NOT add Co-Authored-By, Signed-off-by, or any other trailers to the commit message.
Step 6: Safety Checks
Before amending, verify:
-
Not pushed - Warn if commit exists on remote:
⚠️ Warning: This commit appears to be pushed to origin. Amending will require force push. Continue? [y/N] -
Not a merge commit - Refuse to amend merge commits:
❌ Cannot amend merge commits. Use git revert instead. -
Clean working tree - If there are unstaged changes, ask:
You have unstaged changes. Options: 1. Stage all and include in amend 2. Amend with only currently staged changes 3. Cancel
Error Handling
- If amend fails, show the error and suggest fixes
- If there's nothing to amend (no changes, same message), inform user
- If in rebase/merge state, refuse and explain
Arguments
<args>- Optional. Can include:- New type:
feat,fix,docs, etc. - New scope:
(auth),(api) - New message:
"full commit message" --no-edit- Keep current message, just add staged changes
- New type:
Examples:
git:amend- Interactive: ask what to changegit:amend --no-edit- Add staged changes, keep messagegit:amend fix- Change commit type to fixgit:amend (api)- Change scope to apigit:amend "feat(auth): add login validation"- Replace entire message
Expert Next.js App Router
Developpement
Un skill qui transforme Claude en expert Next.js App Router.
Générateur de README
Developpement
Crée des README.md professionnels et complets pour vos projets.
Rédacteur de Documentation API
Developpement
Génère de la documentation API complète au format OpenAPI/Swagger.