From 45ac9f176b32786aab43d16d507803e9264f3408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Jes=C3=BAs=20Pe=C3=B1a=20Rodr=C3=ADguez?= Date: Wed, 21 Jan 2026 14:04:52 +0100 Subject: [PATCH] feat(skills): add prowler-commit skill - Create commit guidelines following conventional-commits - Register skill in AGENTS.md --- AGENTS.md | 5 + api/AGENTS.md | 4 + mcp_server/AGENTS.md | 4 + skills/prowler-commit/SKILL.md | 179 +++++++++++++++++++++++++++++++++ ui/AGENTS.md | 4 + 5 files changed, 196 insertions(+) create mode 100644 skills/prowler-commit/SKILL.md diff --git a/AGENTS.md b/AGENTS.md index a5d7d6c20e..fb1a55ed5a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -40,6 +40,7 @@ Use these skills for detailed patterns on-demand: | `prowler-provider` | Add new cloud providers | [SKILL.md](skills/prowler-provider/SKILL.md) | | `prowler-changelog` | Changelog entries (keepachangelog.com) | [SKILL.md](skills/prowler-changelog/SKILL.md) | | `prowler-ci` | CI checks and PR gates (GitHub Actions) | [SKILL.md](skills/prowler-ci/SKILL.md) | +| `prowler-commit` | Professional commits (conventional-commits) | [SKILL.md](skills/prowler-commit/SKILL.md) | | `prowler-pr` | Pull request conventions | [SKILL.md](skills/prowler-pr/SKILL.md) | | `prowler-docs` | Documentation style guide | [SKILL.md](skills/prowler-docs/SKILL.md) | | `skill-creator` | Create new AI agent skills | [SKILL.md](skills/skill-creator/SKILL.md) | @@ -50,17 +51,21 @@ When performing these actions, ALWAYS invoke the corresponding skill FIRST: | Action | Skill | |--------|-------| +| -- | `prowler-commit` | | Add changelog entry for a PR or feature | `prowler-changelog` | | Adding DRF pagination or permissions | `django-drf` | | Adding new providers | `prowler-provider` | | Adding services to existing providers | `prowler-provider` | +| After completing code changes | `prowler-commit` | | After creating/modifying a skill | `skill-sync` | | App Router / Server Actions | `nextjs-15` | | Building AI chat features | `ai-sdk-5` | +| Committing changes | `prowler-commit` | | Create PR that requires changelog entry | `prowler-changelog` | | Create a PR with gh pr create | `prowler-pr` | | Creating ViewSets, serializers, or filters in api/ | `django-drf` | | Creating Zod schemas | `zod-4` | +| Creating a git commit | `prowler-commit` | | Creating new checks | `prowler-sdk-check` | | Creating new skills | `skill-creator` | | Creating/modifying Prowler UI components | `prowler-ui` | diff --git a/api/AGENTS.md b/api/AGENTS.md index 6a159094c2..4bc04a350d 100644 --- a/api/AGENTS.md +++ b/api/AGENTS.md @@ -12,10 +12,14 @@ When performing these actions, ALWAYS invoke the corresponding skill FIRST: | Action | Skill | |--------|-------| +| -- | `prowler-commit` | | Add changelog entry for a PR or feature | `prowler-changelog` | | Adding DRF pagination or permissions | `django-drf` | +| After completing code changes | `prowler-commit` | +| Committing changes | `prowler-commit` | | Create PR that requires changelog entry | `prowler-changelog` | | Creating ViewSets, serializers, or filters in api/ | `django-drf` | +| Creating a git commit | `prowler-commit` | | Creating/modifying models, views, serializers | `prowler-api` | | Implementing JSON:API endpoints | `django-drf` | | Review changelog format and conventions | `prowler-changelog` | diff --git a/mcp_server/AGENTS.md b/mcp_server/AGENTS.md index 24621c2755..484110386f 100644 --- a/mcp_server/AGENTS.md +++ b/mcp_server/AGENTS.md @@ -8,8 +8,12 @@ When performing these actions, ALWAYS invoke the corresponding skill FIRST: | Action | Skill | |--------|-------| +| -- | `prowler-commit` | | Add changelog entry for a PR or feature | `prowler-changelog` | +| After completing code changes | `prowler-commit` | +| Committing changes | `prowler-commit` | | Create PR that requires changelog entry | `prowler-changelog` | +| Creating a git commit | `prowler-commit` | | Review changelog format and conventions | `prowler-changelog` | | Update CHANGELOG.md in any component | `prowler-changelog` | | Working on MCP server tools | `prowler-mcp` | diff --git a/skills/prowler-commit/SKILL.md b/skills/prowler-commit/SKILL.md new file mode 100644 index 0000000000..3bf3171065 --- /dev/null +++ b/skills/prowler-commit/SKILL.md @@ -0,0 +1,179 @@ +--- +name: prowler-commit +description: > + Creates professional git commits following conventional-commits format. + Trigger: When creating commits, after completing code changes, when user asks to commit. +license: Apache-2.0 +metadata: + author: prowler-cloud + version: "1.0.0" + scope: [root, api, ui, prowler, mcp_server] + auto_invoke: + - "Creating a git commit" + - "Committing changes" + - "After completing code changes" +--- + +## Critical Rules + +- ALWAYS use conventional-commits format: `type(scope): description` +- ALWAYS keep the first line under 72 characters +- ALWAYS ask for user confirmation before committing +- NEVER be overly specific (avoid counts like "6 subsections", "3 files") +- NEVER include implementation details in the title +- NEVER use `-n` flag unless user explicitly requests it + +--- + +## Commit Format + +``` +type(scope): concise description + +- Key change 1 +- Key change 2 +- Key change 3 +``` + +### Types + +| Type | Use When | +|------|----------| +| `feat` | New feature or functionality | +| `fix` | Bug fix | +| `docs` | Documentation only | +| `chore` | Maintenance, dependencies, configs | +| `refactor` | Code change without feature/fix | +| `test` | Adding or updating tests | +| `perf` | Performance improvement | +| `style` | Formatting, no code change | + +### Scopes + +| Scope | When | +|-------|------| +| `api` | Changes in `api/` | +| `ui` | Changes in `ui/` | +| `sdk` | Changes in `prowler/` | +| `mcp` | Changes in `mcp_server/` | +| `skills` | Changes in `skills/` | +| `ci` | Changes in `.github/` | +| `docs` | Changes in `docs/` | +| *omit* | Multiple scopes or root-level | + +--- + +## Good vs Bad Examples + +### Title Line + +``` +# GOOD - Concise and clear +feat(api): add provider connection retry logic +fix(ui): resolve dashboard loading state +chore(skills): add Celery documentation +docs: update installation guide + +# BAD - Too specific or verbose +feat(api): add provider connection retry logic with exponential backoff and jitter (3 retries max) +chore(skills): add comprehensive Celery documentation covering 8 topics +fix(ui): fix the bug in dashboard component on line 45 +``` + +### Body (Bullet Points) + +``` +# GOOD - High-level changes +- Add retry mechanism for failed connections +- Document task composition patterns +- Expand configuration reference + +# BAD - Too detailed +- Add retry with max_retries=3, backoff=True, jitter=True +- Add 6 subsections covering chain, group, chord +- Update lines 45-67 in dashboard.tsx +``` + +--- + +## Workflow + +1. **Analyze changes** + ```bash + git status + git diff --stat HEAD + git log -3 --oneline # Check recent commit style + ``` + +2. **Draft commit message** + - Choose appropriate type and scope + - Write concise title (< 72 chars) + - Add 2-5 bullet points for significant changes + +3. **Present to user for confirmation** + - Show files to be committed + - Show proposed message + - Wait for explicit confirmation + +4. **Execute commit** + ```bash + git add + git commit -m "$(cat <<'EOF' + type(scope): description + + - Change 1 + - Change 2 + EOF + )" + ``` + +--- + +## Decision Tree + +``` +Single file changed? +├─ Yes → May omit body, title only +└─ No → Include body with key changes + +Multiple scopes affected? +├─ Yes → Omit scope: `feat: description` +└─ No → Include scope: `feat(api): description` + +Fixing a bug? +├─ User-facing → fix(scope): description +└─ Internal/dev → chore(scope): fix description + +Adding documentation? +├─ Code docs (docstrings) → Part of feat/fix +└─ Standalone docs → docs: or docs(scope): +``` + +--- + +## Commands + +```bash +# Check current state +git status +git diff --stat HEAD + +# Standard commit +git add +git commit -m "type(scope): description" + +# Multi-line commit +git commit -m "$(cat <<'EOF' +type(scope): description + +- Change 1 +- Change 2 +EOF +)" + +# Amend last commit (same message) +git commit --amend --no-edit + +# Amend with new message +git commit --amend -m "new message" +``` diff --git a/ui/AGENTS.md b/ui/AGENTS.md index 94c3fab23e..336738facc 100644 --- a/ui/AGENTS.md +++ b/ui/AGENTS.md @@ -18,11 +18,15 @@ When performing these actions, ALWAYS invoke the corresponding skill FIRST: | Action | Skill | |--------|-------| +| -- | `prowler-commit` | | Add changelog entry for a PR or feature | `prowler-changelog` | +| After completing code changes | `prowler-commit` | | App Router / Server Actions | `nextjs-15` | | Building AI chat features | `ai-sdk-5` | +| Committing changes | `prowler-commit` | | Create PR that requires changelog entry | `prowler-changelog` | | Creating Zod schemas | `zod-4` | +| Creating a git commit | `prowler-commit` | | Creating/modifying Prowler UI components | `prowler-ui` | | Review changelog format and conventions | `prowler-changelog` | | Update CHANGELOG.md in any component | `prowler-changelog` |