Ai-agent-skills git-os
Enforces conventional commits, atomic changes, and GIT-OS workflow for Wednesday Solutions projects. Every agent that generates a commit must read this skill first.
git clone https://github.com/wednesday-solutions/ai-agent-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/wednesday-solutions/ai-agent-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/git-os" ~/.claude/skills/wednesday-solutions-ai-agent-skills-git-os && rm -rf "$T"
skills/git-os/SKILL.mdGIT-OS — Automation-First Git Workflow
Trigger
Load this skill before any of the following actions — do not proceed without reading it first:
- Creating a branch
- Writing a commit message
- Running
git commit - Running
git push - Creating or updating a PR title
Do NOT use this skill for: reviewing PR comments (use
pr-review), creating a PR (use pr-create), planning a project (use greenfield).
My Git history powers automation. Commits drive version bumps, changelogs, release notes, deployments, and CI behavior. If commits are wrong → automation breaks.
1. Branching Model
| Branch | From | PR target | Purpose |
|---|---|---|---|
| | | New feature |
| | | Bug fix |
| | | Tooling / config |
| | | Test additions |
| | | Urgent prod fix |
<target> is project-specific (main, develop, etc.). Never commit directly to target. All changes enter via PR.
Stacked PRs: When PRs depend on each other, stack them bottom-up.
feat/b branches from feat/a, targets feat/a. Merge order: a → b → c.
2. Commit Format
type(scope?): Description (optional body) (optional footer)
Allowed types
feat | fix | refactor | perf | docs | style | test | chore
Do NOT invent types. Do NOT skip colon. Do NOT capitalize the type. Do NOT add emoji.
Subject line rules
- Imperative mood: "Add login" not "Added login"
- Under 50 characters
- No trailing period
- Lowercase type, capitalized description
Body rules (when needed)
- Blank line after subject
- Wrap at 72 characters
- Explain WHY first, then WHAT changed
Breaking changes
refactor: Remove legacy user endpoint BREAKING CHANGE: /v1/users removed. Use /v2/users
3. Atomic Commit Rule
One logical change per commit. If unsure → split it.
# Good feat: Add login endpoint test: Add login integration tests # Bad feat: Add login and fix navbar and update readme
4. Pre-Push Checklist
Before pushing any branch, all must pass:
npm run lintnpm run format:checknpm run testnpm run build
CI is a safety net, not the first line of defense.
5. Pull Request Rules
- Max 5–6 files per PR
- PR title follows the same conventional commit format
- Use this PR description template:
### Ticket Link --- ### Description --- ### Steps to Test --- ### GIFs ---
6. Tool Usage
| Action | Tool | Notes |
|---|---|---|
| Run git commands | | , , , etc. |
| Read a file before editing | | Always read first — never edit blind |
| Edit a file | | Never use with or to modify files |
| Search file contents | | Never use |
| Find files | | Never use |
7. What Never To Do
- Commit without a type
- Bundle multiple concerns in one commit
- Force push the target branch
- Rewrite shared history
- Include AI attribution — no
lines, no AI tool mentionsCo-Authored-By
Commits should look human-authored. No fingerprints.
8. Agent Commit Format
When an agent generates a commit for a fix from a review comment:
fix(scope): description from review comment Resolves review comment #N
9. Commit-Lint Hook (Claude Code)
Add this to
.claude/settings.json in the project to enforce commit format automatically before every git commit:
{ "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "echo \"$CLAUDE_TOOL_INPUT\" | grep -q '\"git commit' && npx --no-install commitlint --edit || true" } ] } ] } }
This intercepts any Bash tool call containing
git commit and runs commitlint against the message before the commit lands. Requires .commitlintrc.json to be present (copied automatically by ws-skills install).