Agent skill
commit
Git workflow operations with Conventional Commits. Supports subcommands - branch (create feature branch), commit (stage and commit changes), pr (create pull request), merge (merge PR). Automatically available when the current directory is a git repository. Use when user needs git operations during development workflow.
Install this agent skill to your Project
npx add-skill https://github.com/sofer/.agents/tree/main/skills/commit
SKILL.md
Git workflow
Git operations following Conventional Commits and configurable branching strategies.
Subcommands
Invoke with subcommand argument:
commit branch- Create feature branchcommit commitor justcommit- Stage and commit changescommit pr- Create pull requestcommit merge- Merge pull request
When invoked without subcommand, default to commit behaviour.
branch
Create a feature branch for a story or task.
Input
- Story ID and title/slug (from orchestrator or user)
- Git strategy:
feature-branchortrunk-based - Branch pattern (default:
story/{id}-{slug})
Process
-
Ensure working directory is clean:
bashgit status --porcelainIf not clean, ask user to stash or commit changes first.
-
Fetch latest from remote:
bashgit fetch origin -
Determine base branch:
- Default:
mainormaster(whichever exists) - For trunk-based: always use main branch
- For feature-branch: use main or specified base
- Default:
-
Create and checkout branch:
bashgit checkout -b story/US-001-user-login origin/main
Branch naming
Generate slug from story title:
- Lowercase
- Replace spaces with hyphens
- Remove special characters
- Truncate to 50 characters
Examples:
story/US-001-user-registrationstory/US-042-fix-login-timeoutfeature/US-103-dashboard-charts
Output
- Branch created and checked out
- Report branch name to user/orchestrator
commit
Stage changes and create commit with Conventional Commits format.
Process
-
Review changes:
bashgit status git diff git diff --cached # staged changes -
Stage changes (if not already staged):
- Ask user which files to stage, or
- Stage all with
git add -Aif user confirms - Never stage user-test artifacts (formatted test scripts,
.sdlc/stories/*/user-test-results.yaml). These are pipeline-internal files and must not be committed. If staged accidentally, unstage them before committing.
-
Determine commit type from changes:
- feat: New features
- fix: Bug fixes
- docs: Documentation changes
- style: Code style (formatting, semicolons)
- refactor: Code restructuring without feature changes
- test: Adding or updating tests
- chore: Maintenance (build, dependencies)
-
Format commit message:
<type>(<scope>): <description>
Guidelines
- Use lowercase for type and description
- Keep description under 50 characters
- Use imperative mood: "add feature" not "added feature"
- Scope is optional but recommended (component/module name)
- Reference story ID when available:
feat(auth): add login (US-001) - No attribution footers (no "Generated with...", no "Co-Authored-By")
Examples
feat(user): add registration endpoint (US-001)
fix(auth): resolve token expiry issue (US-023)
test(user): add unit tests for validation
refactor(api): extract common middleware
docs: update API documentation
chore(deps): upgrade typescript to 5.0
Execution
- Propose message to user
- On approval:
git commit -m "message" - Confirm success
pr
Create a pull request for the current branch.
Process
-
Ensure commits are pushed:
bashgit push -u origin HEAD -
Verify no user-test artifacts are committed:
- Check that no
.sdlc/stories/*/user-test-results.yamlor formatted test script files are in the commit history - If found, remove them from tracking before pushing
- Check that no
-
Gather PR context:
- Story ID and title (from manifest or branch name)
- Summary of changes (from commits)
- Acceptance criteria (from story)
-
Generate PR description:
markdown## Summary Brief description of what this PR does. ## Story US-001: User Registration ## Changes - Added user registration endpoint - Implemented email validation - Added unit tests ## Acceptance criteria - [x] User can register with email and password - [x] Invalid emails are rejected - [x] Duplicate emails return appropriate error ## Testing - Unit tests added and passing - User testing passedDo not include manual test scripts, formatted test scenarios, or user-test result details in the PR description. The Testing section should only confirm that tests passed, not reproduce test content.
-
Create PR:
bashgh pr create --title "feat(user): add registration (US-001)" --body "..."Or if
ghnot available, provide URL:https://github.com/{owner}/{repo}/compare/{branch}?expand=1
PR title format
Follow Conventional Commits:
<type>(<scope>): <description> (<story-id>)
Output
- PR URL
- Update manifest with PR reference
merge
Merge an approved pull request.
Process
-
Check PR status:
bashgh pr status gh pr checks -
Verify approval:
- PR must be approved
- All checks must pass
- No merge conflicts
-
Merge with appropriate strategy:
bash# Squash merge (default for feature branches) gh pr merge --squash --delete-branch # Merge commit (preserves history) gh pr merge --merge --delete-branch # Rebase (linear history) gh pr merge --rebase --delete-branch -
Update local:
bashgit checkout main git pull origin main
Merge strategy selection
- Squash: Default for feature branches, clean history
- Merge: When preserving individual commits matters
- Rebase: For linear history preference
Ask user or check project config for preference.
Output
- Confirm merge complete
- Report merged commit SHA
- Update manifest: mark story as merged
Configuration
When used with orchestrator, read from manifest:
project:
git:
strategy: "feature-branch"
pattern: "story/{id}-{slug}"
auto_pr: true
merge_strategy: "squash"
Notes
- Follows Conventional Commits (conventionalcommits.org)
- Platform-agnostic (works with GitHub, GitLab, Bitbucket)
- Uses
ghCLI when available for GitHub operations - Falls back to manual instructions when CLI not available
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
meeting-context
Determine why a meeting is happening and what should be discussed
reconcile
Analyse and resolve divergences between SDLC manifest and actual development state (git commits, branches, uncommitted files). Use when manifest and reality have drifted apart, or before picking next story to ensure clean state.
readme-review
Review the project README to understand what it does and suggest a recommended next step. Use when starting work on an unfamiliar project.
init-override
Create a symlink from AGENTS.md to CLAUDE.md in the current project directory. Use when the user wants to initialise a project to use AGENTS.md as the memory file instead of CLAUDE.md.
contact-research
Research a person given their name and email, returning a brief profile with role, company, LinkedIn summary, and previous interactions
design
Plan architecture and components for a single user story. Use after spec phase to create a technical design before implementation. Produces design documents that guide stubs and implementation.
Didn't find tool you were looking for?