| name | git-workflow |
| description | Use for branch management, commits, PRs, and git operations via gh CLI. |
Skill: git-workflow
This skill covers git operations using GitHub CLI (gh).
Branch Management
git checkout -b feature/my-feature
git branch -a
git branch -d feature/my-feature
git push origin --delete feature/my-feature
Commits
git add -A
git add src/model.py
git commit -m "feat: add new model layer"
git commit --amend
git log --oneline -10
Pull Requests (gh CLI)
gh pr create --title "feat: new feature" --body "## Summary
- Added new feature"
gh pr list
gh pr view <pr-number>
gh pr status
gh pr merge <pr-number> --squash
gh pr edit <pr-number> --reviewer username
Code Reviews
gh pr diff <pr-number>
gh pr checkout <pr-number>
gh pr review <pr-number> --approve
gh pr review <pr-number> --body "Please fix..."
Sync & Rebase
git fetch --all
git rebase main
git stash push -m "work in progress"
git stash pop
Common Patterns
git checkout -b fix/issue-123
git add -A && git commit -m "fix: resolve issue"
git push -u origin fix/issue-123
gh pr create --title "fix: resolve issue" --body "## Summary
- Fixed the bug"
git checkout main && git pull
git checkout -b feature/new-feature
git push -u origin feature/new-feature
gh pr create
Quality Gate
Run quality checks before every commit (ADR-014):
bash scripts/quality-gate.sh
This runs the same checks as GitHub Actions CI:
- Black format (88 chars)
- isort imports (88 chars)
- Ruff lint (E,F,W,I codes)
- Flake8 lint (reads
.flake8)
- Mypy type check
- Pytest tests
Configuration:
.flake8 - Flake8 config (single source of truth)
pyproject.toml - Black, isort, mypy config
Pre-commit Hook (Optional)
To run automatically before each commit:
cat > .git/hooks/pre-commit << 'EOF'
exec bash scripts/quality-gate.sh
EOF
chmod +x .git/hooks/pre-commit
Key Rules
- Never force push to main
- Never amend pushed commits
- Always run quality gate before commit:
bash scripts/quality-gate.sh
- Use conventional commits:
feat:, fix:, docs:, refactor:
- PR must pass CI before merge
- Local-CI Parity: What passes locally passes in CI (ADR-014)
Complete CI/CD Fix Workflow
After every commit, follow this atomic loop:
1. git commit → git push
2. gh run list → get run-id
3. gh run view <id> → identify failures
4. FOR EACH failure:
a. Analyze error type → determine skill needed
b. Spawn specialist agent with @skill
c. Agent fixes → commits → pushes
d. Repeat from step 2 until all pass
5. NEVER skip: each fix must go through full cycle
Check CI Status
gh run list --repo owner/tiny-cats-model
gh run view <run-id>
gh run view <run-id> --log | grep "^ERR"
gh run view <run-id> --json conclusion
Specialist Agent Selection
| Failure Type | Use Skill |
|---|
| Lint error | @skill code-quality |
| Test failure | @skill testing-workflow |
| Type error | @skill code-quality |
| CI/workflow | @skill gh-actions |
| Model/training | @skill model-training |
| Security | @skill security |
2026 Best Practices Integration
Before implementing fixes:
- Use
websearch for latest solutions
- Use
codesearch for API patterns
- Document in
plans/ADR-*.md if significant
- Update
plans/GOAP.md with action items
- Use
@skill goap for planning tasks
Example Fix Cycle
gh run list
gh run view <run-id>
gh run view <run-id>