一键导入
branch-discipline
Enforce one branch per issue, small focused commits, and clean git history. Use with /branch command.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Enforce one branch per issue, small focused commits, and clean git history. Use with /branch command.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Build immersive, scroll-driven websites with GSAP ScrollTrigger, Lenis smooth scroll, parallax effects, and cinematic page transitions. Use when building premium corporate sites, landing pages, or marketing microsites that need motion and polish beyond static designs.
Use when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.
Use when reviewing pull requests, conducting code quality audits, or identifying security vulnerabilities. Invoke for PR reviews, code quality checks, refactoring suggestions.
Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.
Use when investigating errors, analyzing stack traces, or finding root causes of unexpected behavior. Invoke for error investigation, troubleshooting, log analysis, root cause analysis.
Use when setting up CI/CD pipelines, containerizing applications, or managing infrastructure as code. Invoke for pipelines, Docker, Kubernetes, cloud platforms, GitOps.
| name | branch-discipline |
| description | Enforce one branch per issue, small focused commits, and clean git history. Use with /branch command. |
Principles for clean git history: one issue per branch, small commits, clear scope.
Every branch addresses exactly ONE issue, feature, or bug fix.
✓ feature/123-fix-login-validation
✓ feature/456-add-user-export
✗ feature/misc-fixes # Too vague
✗ feature/login-and-export # Two issues
Each commit is a single logical change that could be reverted independently.
✓ "fix(#123): validate email format"
✓ "fix(#123): add error message for invalid email"
✓ "test(#123): add email validation tests"
✗ "fix stuff"
✗ "WIP"
✗ "fix login, add export, refactor auth"
If you find another issue while working:
Working on #123 (login validation)
Found #789 (password reset bug)
✗ Fix both in same branch
✓ Note #789, continue with #123, branch for #789 later
Use git worktrees when you need to:
# Main repo stays on main
/project/ # main branch
# Each issue gets its own worktree
/project-123/ # feature/123 branch
/project-456/ # feature/456 branch
/branch [issue-id] [description] # Create branch + checklist
/branch [issue-id] [description] -w # + worktree for parallel work
Then immediately:
/mentor review requirements for #[id]: [description]
This catches unclear requirements and flawed approaches BEFORE you write code. Record findings in the checklist.
Before each commit, ask:
Incorporate mentor advice from initial review
Check progress:
/branch-status
Found unrelated issue?
/mentor review my implementation for #[id]
This catches blind spots and edge cases before team review. Record findings in the checklist.
/branch-done # Verify checklist, create PR
type(#issue): description
[optional body]
Types:
feat - new featurefix - bug fixrefactor - code restructuretest - add/update testsdocs - documentationchore - maintenanceExamples:
feat(#123): add email validation to login form
fix(#456): prevent duplicate user exports
refactor(#789): extract auth logic to service
test(#123): add unit tests for email validator
When using multiple agents simultaneously:
# Create worktrees for each agent/issue
git worktree add ../project-123 -b feature/123-task-a
git worktree add ../project-456 -b feature/456-task-b
git worktree add ../project-789 -b feature/789-task-c
../project-123/ → Issue #123../project-456/ → Issue #456../project-789/ → Issue #789# After merging
git worktree remove ../project-123
git branch -d feature/123-task-a
✗ "implement user management" # 50 files, 2000 lines
Break into:
✓ "feat(#100): add user model"
✓ "feat(#100): add user repository"
✓ "feat(#100): add user service"
✓ "feat(#100): add user controller"
✓ "test(#100): add user management tests"
✗ Branch for #123 contains fixes for #456 and #789
Keep branches focused:
✓ feature/123-login-fix → only #123 changes
✓ feature/456-export-bug → only #456 changes
✓ feature/789-auth-refactor → only #789 changes
✗ "WIP"
✗ "fix"
✗ "stuff"
Write meaningful messages:
✓ "fix(#123): handle null email input"
Each branch should have a checklist (created by /branch):
# Issue #[ID]: [Description]
## Scope
- What this branch WILL do
- What this branch will NOT do
## Checklist
### Before Starting
- [ ] Requirements understood
- [ ] Mentor review: `/mentor review requirements for #[ID]`
### During Work
- [ ] Changes limited to scope
- [ ] Mentor advice incorporated
- [ ] Tests added
### Before PR
- [ ] Mentor review: `/mentor review implementation for #[ID]`
- [ ] Tests passing
- [ ] Commits logical (max 3-5)
## Mentor Reviews
### Initial (before starting)
**Findings:** [mentor feedback]
**Action:** [what you changed]
### Final (before PR)
**Findings:** [mentor feedback]
**Action:** [what you changed]
## Commits
| Hash | Message |
|------|---------|
## Out-of-Scope Issues Found
- #XXX: [description] - branch later
| Command | Purpose |
|---|---|
/branch [id] [desc] | Create focused branch + checklist |
/branch [id] [desc] -w | + create worktree |
/branch-status | Check progress on current branch |
/branch-done | Complete branch, create PR |
/branch-list | List all active branches/worktrees |
Works with:
git-workflow skill - general git practicesgit-worktrees skill - worktree detailscode-review skill - before merging