Agent skill
unknown-plannededge-codebook
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/unknown-plannededge-codebook
SKILL.md
Git Workflow Skill
[!FIXED!]
Purpose
This skill provides procedures for Git operations in the development workflow. It covers branching, commits, and pull requests.
When to use:
- Creating branches for new work
- Making commits
- Creating pull requests
- Merging changes [!FIXED!]
=== PREREQUISITES ===
Before using this skill:
- Git is installed
- Repository is cloned locally
- Commit message standard exists (@ref(CB-STD-COMMITS-001))
- You have push access (or will create PR)
=== PROCEDURE: CREATE BRANCH ===
Branch Naming Convention
<type>/<description>
Types:
- feature/ : New features
- bugfix/ : Bug fixes
- hotfix/ : Urgent production fixes
- refactor/ : Code refactoring
- docs/ : Documentation only
- test/ : Test additions
- chore/ : Maintenance tasks
Steps
-
Ensure you're on main/develop
bashgit checkout main git pull origin main -
Create and checkout new branch
bashgit checkout -b feature/add-user-authentication -
Log in buildlog
markdown| HH:MM | #micro-decision | Created branch feature/add-user-authentication | - |
Branch Naming Examples
| Good | Bad |
|---|---|
feature/add-oauth-login |
new-login |
bugfix/fix-null-pointer-123 |
fix |
docs/update-api-docs |
documentation |
=== PROCEDURE: MAKE COMMITS ===
Commit Message Format
<type>(<scope>): <description>
[optional body]
[optional footer]
Types
| Type | Purpose |
|---|---|
| feat | New feature |
| fix | Bug fix |
| docs | Documentation |
| style | Formatting (no code change) |
| refactor | Code restructuring |
| test | Adding tests |
| chore | Maintenance |
| perf | Performance improvement |
Steps
-
Stage changes
bashgit add <files> # or for all changes: git add . -
Review staged changes
bashgit status git diff --staged -
Commit with message
bashgit commit -m "feat(auth): add OAuth2 login support" -
Log in buildlog
markdown| HH:MM | #commit | feat(auth): add OAuth2 login support | PR #XX |
Commit Message Examples
| Good | Bad |
|---|---|
feat(auth): add OAuth2 login support |
added login |
fix(api): handle null response from endpoint |
fix bug |
docs(readme): add installation instructions |
update docs |
refactor(utils): extract date formatting logic |
refactoring |
Commit Frequency
- Commit logical chunks of work
- Each commit should be independently functional
- Don't bundle unrelated changes
- Can be squashed later if needed
=== PROCEDURE: CREATE PULL REQUEST ===
Before Creating PR
-
Ensure all commits are pushed
bashgit push origin <branch-name> -
Run pre-merge checks
- All tests pass
- Linter passes
- Code reviewed by self
- Documentation updated if needed
PR Title Format
<type>(<scope>): <description>
Same format as commit messages.
PR Description Template
## Summary
Brief description of what this PR does.
## Changes
- List of significant changes
- Bullet points preferred
## Testing
- How was this tested?
- Test coverage info
## Related Issues
Closes #123
Related to #456
## Checklist
- [ ] Tests pass
- [ ] Documentation updated
- [ ] No breaking changes (or documented)
Steps
-
Push branch
bashgit push -u origin feature/add-user-authentication -
Create PR via GitHub/GitLab/etc.
- Use PR title format
- Fill in description template
- Add reviewers
- Add labels
-
Log in buildlog
markdown| HH:MM | #micro-decision | Created PR #42 for feature/add-user-authentication | PR #42 |
=== PROCEDURE: MERGE CHANGES ===
Merge Strategies
| Strategy | When to Use |
|---|---|
| Squash and Merge | Feature branches, clean history |
| Rebase and Merge | Linear history preferred |
| Merge Commit | Preserve branch history |
Steps
-
Ensure PR is approved
- Required reviews complete
- CI checks pass
- No merge conflicts
-
Merge using preferred strategy
- Via GitHub UI, or:
bashgit checkout main git merge --squash feature/add-user-authentication git commit -m "feat(auth): add OAuth2 login support (#42)" git push origin main -
Delete branch
bashgit branch -d feature/add-user-authentication git push origin --delete feature/add-user-authentication -
Log in buildlog
markdown| HH:MM | #commit | Merged feat(auth): add OAuth2 login support | PR #42 |
=== PROCEDURE: HANDLE CONFLICTS ===
Steps
-
Update main and rebase
bashgit checkout main git pull origin main git checkout feature/your-branch git rebase main -
Resolve conflicts
- Open conflicting files
- Resolve conflict markers
- Test resolution
bashgit add <resolved-files> git rebase --continue -
Force push (if rebased)
bashgit push --force-with-lease origin feature/your-branch -
Log in buildlog
markdown| HH:MM | #resolution | Resolved merge conflicts in <files> | PR #42 |
Conflict Prevention
- Rebase frequently against main
- Communicate about files being modified
- Break large changes into smaller PRs
=== PROCEDURE: REVERT CHANGES ===
Revert a Commit
# Revert last commit (creates new commit)
git revert HEAD
# Revert specific commit
git revert <commit-hash>
# Revert without auto-commit
git revert -n <commit-hash>
Log in Buildlog
| HH:MM | #resolution | Reverted commit <hash> due to <reason> | - |
AI-Assisted Commit
When committing AI-generated or AI-assisted code, follow APS (Agentic Provenance Standard).
Prerequisites:
- Agent registered in
.aps/registry.yaml(if using APS) - Git hooks installed (optional but recommended)
- Code has been human-reviewed
Steps:
- Set APS environment variables:
# Required
export APS_AGENT_ID="anthropic:claude-code@1.5.0+sk7b2c#a7b3c9d2"
export APS_HUMAN_REVIEWED="true"
# Recommended
export APS_MODEL="claude-sonnet-4-5-20250929"
export APS_KERNEL="claude-code@1.5.0"
export APS_SESSION="sess_feature_001"
export APS_SKILLS="code-generator@2.1.0, security-check@1.5.0"
export APS_CONTRIBUTION="generate"
export APS_TOKENS_IN="12450"
export APS_TOKENS_OUT="3280"
- Stage changes:
git add <files>
- Commit with conventional format:
git commit -m "feat(auth): implement OAuth2 PKCE flow
Implements secure OAuth2 authorization code flow with PKCE for mobile
clients. Includes token refresh logic and secure storage integration."
- Verify trailers were added:
git log -1 --format='%(trailers)'
Expected output:
AI-Agent: anthropic:claude-code@1.5.0+sk7b2c#a7b3c9d2
AI-Model: claude-sonnet-4-5-20250929
AI-Kernel: claude-code@1.5.0
AI-Session: sess_feature_001
AI-Skills: code-generator@2.1.0, security-check@1.5.0
AI-Tokens-In: 12450
AI-Tokens-Out: 3280
AI-Contribution: generate
AI-Human-Reviewed: true
- Clear environment variables (optional):
unset APS_AGENT_ID APS_HUMAN_REVIEWED APS_MODEL APS_KERNEL APS_SESSION APS_SKILLS APS_CONTRIBUTION APS_TOKENS_IN APS_TOKENS_OUT
Without Git Hooks:
If hooks aren't installed, manually add trailers:
git commit -m "feat(auth): implement OAuth2 PKCE flow
Implements secure OAuth2 authorization code flow.
AI-Agent: anthropic:claude-code@1.5.0+sk7b2c#a7b3c9d2
AI-Human-Reviewed: true"
Multi-Agent Workflow:
When multiple agents contribute:
export APS_AGENT_ID="anthropic:coder@1.0.0+sk123#abc12345"
export APS_SUBAGENTS="security-reviewer#def456 (review), test-runner#ghi789 (validation)"
export APS_CONTRIBUTION_GRAPH="main→security-reviewer→test-runner"
export APS_HUMAN_REVIEWED="true"
git commit -m "feat(api): refactor authentication middleware"
Log in Buildlog
| HH:MM | #commit | feat(auth): implement OAuth2 PKCE flow | AI-assisted (anthropic:claude-code@1.5.0), human-reviewed |
See: @ref(CB-STD-APS-001) for complete APS specification
=== ANTI-PATTERNS ===
| Anti-Pattern | Why Bad | Alternative |
|---|---|---|
| Force push to main | Destroys history | Never force push shared branches |
| Giant commits | Hard to review/revert | Break into logical chunks |
| Vague commit messages | No context | Use conventional format |
| Committing secrets | Security risk | Use .gitignore, env vars |
| Long-lived branches | Merge conflicts | Merge frequently |
| AI commits without review | Quality/security risk | Always set AI-Human-Reviewed: true |
| Missing AI attribution | Audit trail gaps | Use APS trailers for AI work |
=== RELATED DOCUMENTS ===
| Document | Codebook ID | Relationship |
|---|---|---|
| commit-messages.md | CB-STD-COMMITS-001 | Message format |
| agentic-provenance.md | CB-STD-APS-001 | AI attribution |
| pr.template.md | CB-TPL-PR-001 | PR description |
| git-flow.md | CB-WF-GITFLOW-001 | Full workflow |
Didn't find tool you were looking for?