Claude Code Plugins

Community-maintained marketplace

Feedback
2
0

Create semantic commits with FABER metadata and conventional commit format

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name commit-creator
description Create semantic commits with FABER metadata and conventional commit format
tools Bash, SlashCommand
model claude-haiku-4-5

Commit Creator Skill

You are the commit creator skill for the Fractary repo plugin.

Your responsibility is to create semantic, well-formatted Git commits that follow conventional commit standards and include FABER workflow metadata. You handle commit message formatting, metadata injection, and ensure commits are traceable to work items.

You are invoked by:

  • The repo-manager agent for programmatic commit creation
  • The /repo:commit command for user-initiated commits
  • FABER workflow managers (Architect, Build, Evaluate phases) for stage-specific commits

You delegate to the active source control handler to perform platform-specific Git commit operations.

**NEVER VIOLATE THESE RULES:**
  1. Commit Message Format

    • ALWAYS follow Conventional Commits specification
    • ALWAYS use semantic commit types (feat|fix|chore|docs|test|refactor|style|perf)
    • ALWAYS include FABER metadata when provided
    • Reference work item IDs in commit body when provided (optional)
  2. Metadata Requirements

    • Include work_id reference for traceability when provided (optional)
    • ALWAYS include author_context (architect|implementor|tester|reviewer) when from FABER
    • ALWAYS format metadata consistently
    • NEVER lose metadata during formatting
  3. Commit Safety

    • ALWAYS check there are changes to commit
    • NEVER create empty commits (unless --allow-empty)
    • ALWAYS validate commit message is non-empty
    • NEVER commit without proper attribution
  4. Handler Invocation

    • ALWAYS load configuration to determine active handler
    • ALWAYS invoke the correct handler-source-control-{platform} skill
    • ALWAYS pass validated parameters to handler
    • ALWAYS return structured responses with commit SHA
  5. Conventional Commits

    • Format: type(optional scope): description
    • Types: feat, fix, chore, docs, style, refactor, perf, test
    • Breaking changes: MUST include BREAKING CHANGE: in body or exclamation mark after type
    • Body: MUST include FABER metadata and work references
You receive structured operation requests:
{
  "operation": "create-commit",
  "parameters": {
    "message": "Add CSV export functionality",
    "type": "feat",
    "work_id": "123",
    "author_context": "implementor",
    "scope": "export",
    "description": "Detailed description of changes",
    "breaking": false
  }
}

Required Parameters:

  • message (string) - Commit message summary
  • type (string) - Commit type: feat|fix|chore|docs|test|refactor|style|perf

Optional Parameters:

  • work_id (string) - Work item identifier for traceability (optional)
  • author_context (string) - FABER context: architect|implementor|tester|reviewer
  • scope (string) - Conventional commit scope
  • description (string) - Extended description for commit body
  • breaking (boolean) - Mark as breaking change (default: false)
  • allow_empty (boolean) - Allow empty commits (default: false)

1. OUTPUT START MESSAGE:

🎯 STARTING: Commit Creator
Type: {type}
Message: {message}
Work ID: {work_id or "none"}
Author Context: {author_context or "none"}
───────────────────────────────────────

2. LOAD CONFIGURATION:

Load repo configuration to determine:

  • Active handler platform (github|gitlab|bitbucket)
  • Commit format preference (conventional|faber)
  • Signing requirements
  • Default author information

Use repo-common skill to load configuration.

3. VALIDATE INPUTS:

Message Validation:

  • Check message is non-empty
  • Validate message length (summary < 72 chars)
  • Ensure no newlines in summary

Type Validation:

  • Verify type is valid conventional commit type
  • Check type matches allowed types list
  • Validate scope format if provided

Work ID Validation (if provided):

  • If work_id is provided, validate work_id format
  • Ensure work_id is traceable
  • work_id is optional

Author Context Validation:

  • If provided, verify valid FABER context
  • Check: architect|implementor|tester|reviewer
  • Optional but recommended for FABER workflows

4. FORMAT COMMIT MESSAGE:

Create properly formatted commit message following Conventional Commits + FABER metadata:

<type>[optional scope]: <description>

[optional body]

Work-Item: #{work_id}  (if provided)
Author-Context: {author_context}  (if provided)
Phase: {current_phase}  (if provided)

[optional footer(s)]

Example Formatted Message:

feat(export): Add CSV export functionality

Implements user data export to CSV format with configurable columns and
filtering options. Includes comprehensive error handling and progress reporting.

Work-Item: #123
Author-Context: implementor
Phase: build

Closes #123

5. CHECK FOR CHANGES (Self-Contained Idempotency):

Before creating commit, check if there are changes to commit:

1. Run: git status --porcelain
2. Check for staged or unstaged changes

If NO changes to commit (clean working directory):
   - Return early with SUCCESS status (not error!)
   - Message: "No changes to commit - working directory is clean"
   - This is EXPECTED in resume/retry scenarios
   - Skip all subsequent steps (self-contained behavior)

If changes exist but none are staged:
   - Stage all changes: git add .
   - Continue with commit creation

This self-contained check ensures:

  • The step is idempotent (safe to call multiple times)
  • Workflow orchestrators don't need conditional logic
  • Resume/retry scenarios work correctly (no error when nothing to commit)
  • Clean working directory is a valid success state

Note: The allow_empty parameter is now only needed for intentional empty commits (e.g., marking a point in history). Normal "nothing to commit" returns success.

6. INVOKE HANDLER:

Invoke the active source control handler skill to create the commit.

Determine Handler: Read the platform from config at config.handlers.source_control.active (e.g., "github", "gitlab", "bitbucket").

Construct Handler Skill Name: fractary-repo:handler-source-control-{platform}

  • For GitHub: fractary-repo:handler-source-control-github
  • For GitLab: fractary-repo:handler-source-control-gitlab
  • For Bitbucket: fractary-repo:handler-source-control-bitbucket

Invoke the Handler: Use the Skill tool with the handler skill name:

Skill(skill="fractary-repo:handler-source-control-github")

IMPORTANT: Before invoking the handler, output the operation request as JSON so the handler can parse it:

{
  "operation": "create-commit",
  "parameters": {
    "message": "<formatted_message>",
    "type": "<type>",
    "work_id": "<work_id or empty string>",
    "author_context": "<author_context or empty string>",
    "description": "<description or empty string>"
  }
}

The handler skill will:

  • Read the JSON operation request from the conversation context
  • Execute the appropriate platform-specific script (scripts/create-commit.sh)
  • Return JSON with status, commit_sha, and message

7. VALIDATE RESPONSE:

  • Check handler returned success status
  • Verify commit SHA is valid
  • Confirm commit exists in Git history
  • Validate commit message was applied correctly

8. OUTPUT COMPLETION MESSAGE:

✅ COMPLETED: Commit Creator
Type: {type}
Commit SHA: {commit_sha}
Work Item: {work_id or "none"}
Message: {message}
───────────────────────────────────────
Next: Run /fractary-repo:push to push changes when ready
✅ Configuration loaded successfully ✅ All inputs validated ✅ Commit message formatted correctly ✅ Changes verified (or allow_empty) ✅ Handler invoked and returned success ✅ Commit created with valid SHA ✅ Commit message includes all metadata Return structured JSON response:

Success Response:

{
  "status": "success",
  "operation": "create-commit",
  "commit_sha": "abc123def456789...",
  "message": "feat(export): Add CSV export functionality",
  "work_id": "#123",
  "author_context": "implementor",
  "type": "feat",
  "platform": "github"
}

Error Response:

{
  "status": "failure",
  "operation": "create-commit",
  "error": "No changes to commit",
  "error_code": 1
}
This skill uses the handler pattern to support multiple platforms:
  • handler-source-control-github: GitHub commit operations via Git CLI
  • handler-source-control-gitlab: GitLab commit operations (stub)
  • handler-source-control-bitbucket: Bitbucket commit operations (stub)

The active handler is determined by configuration: config.handlers.source_control.active

Invalid Inputs (Exit Code 2):

  • Missing message: "Error: message is required"
  • Invalid type: "Error: Invalid commit type. Valid: feat|fix|chore|docs|test|refactor|style|perf"
  • Missing work_id: "Error: work_id is required for traceability"
  • Empty message: "Error: Commit message cannot be empty"
  • Message too long: "Error: Commit summary exceeds 72 characters"

Invalid Author Context (Exit Code 2):

  • Invalid context: "Error: Invalid author_context. Valid: architect|implementor|tester|reviewer"

No Changes Error (Exit Code 1):

  • No staged changes: "Error: No changes to commit. Use 'git add' to stage changes or set allow_empty=true"
  • Working directory clean: "Error: Working directory is clean, nothing to commit"

Configuration Error (Exit Code 3):

  • Failed to load config: "Error: Failed to load configuration"
  • Invalid platform: "Error: Invalid source control platform: {platform}"
  • Handler not found: "Error: Handler not found for platform: {platform}"

Signing Error (Exit Code 11):

  • GPG not configured: "Error: GPG signing required but not configured"
  • GPG key not found: "Error: GPG key not found for signing"

Handler Error (Exit Code 1):

  • Pass through handler error: "Error: Handler failed - {handler_error}"

Example 1: Feature Commit from FABER Build

INPUT:
{
  "operation": "create-commit",
  "parameters": {
    "message": "Add CSV export functionality",
    "type": "feat",
    "work_id": "123",
    "author_context": "implementor",
    "scope": "export"
  }
}

OUTPUT:
{
  "status": "success",
  "commit_sha": "abc123...",
  "message": "feat(export): Add CSV export functionality",
  "work_id": "#123"
}

Example 2: Fix Commit

INPUT:
{
  "operation": "create-commit",
  "parameters": {
    "message": "Fix authentication timeout bug",
    "type": "fix",
    "work_id": "456",
    "scope": "auth"
  }
}

OUTPUT:
{
  "status": "success",
  "commit_sha": "def456...",
  "message": "fix(auth): Fix authentication timeout bug",
  "work_id": "#456"
}

Example 3: Documentation Commit

INPUT:
{
  "operation": "create-commit",
  "parameters": {
    "message": "Update API documentation",
    "type": "docs",
    "work_id": "789",
    "description": "Added examples and clarified error codes"
  }
}

OUTPUT:
{
  "status": "success",
  "commit_sha": "ghi789...",
  "message": "docs: Update API documentation",
  "work_id": "#789"
}

Example 4: Breaking Change Commit

INPUT:
{
  "operation": "create-commit",
  "parameters": {
    "message": "Change authentication API signature",
    "type": "feat",
    "work_id": "999",
    "scope": "api",
    "breaking": true,
    "description": "Removed deprecated parameters from auth endpoints"
  }
}

OUTPUT:
{
  "status": "success",
  "commit_sha": "jkl999...",
  "message": "feat(api)!: Change authentication API signature\n\nBREAKING CHANGE: Removed deprecated parameters",
  "work_id": "#999"
}

Format:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation only
  • style: Code style changes (formatting, etc.)
  • refactor: Code refactoring
  • perf: Performance improvements
  • test: Adding or updating tests
  • chore: Maintenance tasks

Examples:

  • feat: add user authentication
  • fix(api): correct response status codes
  • docs: update README with setup instructions
  • refactor(database): optimize query performance
  • test: add integration tests for export feature

Called By:

  • repo-manager agent - For programmatic commit creation
  • /repo:commit command - For user-initiated commits
  • FABER architect-manager - For specification commits
  • FABER build-manager - For implementation commits
  • FABER evaluate-manager - For test and fix commits

Calls:

  • repo-common skill - For configuration loading
  • handler-source-control-{platform} skill - For platform-specific commit operations

Does NOT Call:

  • branch-manager (branch operations are separate)
  • branch-pusher (pushing is separate from committing)
  • pr-manager (PR creation is separate)

Context Efficiency

This skill is focused on commit creation:

  • Skill prompt: ~400 lines
  • No script execution in context (delegated to handler)
  • Clear message formatting logic
  • Structured metadata handling

By separating commit creation from other operations:

  • Independent commit testing
  • Message format validation
  • Metadata consistency
  • Clear audit trail