diff --git a/.agent/skills/git-semantic-commits/SKILL.md b/.agent/skills/git-semantic-commits/SKILL.md new file mode 100644 index 000000000..8fa8c42c0 --- /dev/null +++ b/.agent/skills/git-semantic-commits/SKILL.md @@ -0,0 +1,48 @@ +--- +name: git-semantic-commits +description: Expertise in generating semantic, context-aware, and highly organized git commits. Follows Conventional Commits 1.0.0. +--- + +# Git Semantic Commits Skill + +Directives for analyzing changes and generating professional commit messages. + +## 🔴 CORE PRINCIPLES + +1. **Semantic Typing**: Use standard prefixes (`feat:`, `fix:`, `refactor:`, `style:`, `docs:`, `chore:`, `test:`, `perf:`, `ci:`). +2. **Context-Aware**: Analyze the *intent* beyond just file changes. +3. **Imperative Mood**: Use "add", "fix", "change", not "added", "fixed", "changed". +4. **Conciseness First**: Prefer a single-line `(): ` for simple changes. +5. **Impact Summary**: Group related changes into logical units only if a single line is insufficient. +6. **Body Only if Necessary**: Only include a body if the changes are complex and need more detail than a single line. +7. **Breaking Changes**: Use `!` (e.g., `feat!:`) and describe the breaking change in the footer. + +## 🛠️ THE SEMANTIC MAP + +| Type | When to Use | +|------|-------------| +| `feat` | New feature or functionality | +| `fix` | Bug fix | +| `refactor` | Code change that neither fixes a bug nor adds a feature | +| `style` | Formatting, missing semi-colons, etc. (no logic change) | +| `docs` | Documentation changes only | +| `test` | Adding missing tests or correcting existing tests | +| `perf` | Code change that improves performance | +| `chore` | Maintenance tasks, library updates, config changes | +| `ci` | Changes to CI/CD configuration files and scripts | + +## 📋 WORKFLOW (FOR AGENT) + +1. **Analyze Diff**: Run `git diff --cached` to see staged changes. +2. **Summarize Intent**: Determine the primary goal (e.g., "Standardizing buttons in dashboard"). +3. **Draft Message**: + - **Subject**: `(): ` (max 50-72 chars) + - **Body**: (Optional) Bulleted list of specific changes if complex. +4. **Execute**: Propose or run `git commit -m "[message]"`. + +## 🛑 BANS + +- ❌ NO vague subjects like "update files" or "fix things". +- ❌ NO long subjects (keep under 72 characters). +- ❌ NO redundant descriptions in the body if the subject is clear enough. +- ❌ NO passive voice. diff --git a/.agent/workflows/git-commit.md b/.agent/workflows/git-commit.md new file mode 100644 index 000000000..1d91d51ed --- /dev/null +++ b/.agent/workflows/git-commit.md @@ -0,0 +1,43 @@ +--- +description: Automated semantic git commit workflow +--- + +# /git-commit - Automated Semantic Commits + +This workflow automates the process of staging changes and committing them with a context-aware semantic message. + +## 🔴 PREREQUISITES + +1. The `git-semantic-commits` skill must be loaded. +2. The agent must have permission to run `git` commands. + +--- + +## 📋 STEPS + +1. **Check Status** + Run `git status` to see what changes are available. + +2. **Stage Changes** + // turbo + Run `git add -A` (or ask the user if they want to stage specific files). + +3. **Analyze & Propose** + - Run `git diff --cached` to analyze the staged changes. + - Using the `git-semantic-commits` skill, formulate a **concise, single-line** semantic message by default. + - Present the message to the user for approval (mentioning they can ask for more detail if needed). + +4. **Execute Commit** + // turbo + Once approved, run `git commit -m "[message]"`. + +5. **Final Status** + Show the user the result: `[OK] Committed: [message]`. + +--- + +## 🛠️ USAGE + +``` +/git-commit +```