Development Workflow Patterns
Quick Reference
| Task | Command | What It Does |
|---|---|---|
| Commit | /commit |
Stage changes, write conventional commit message |
| Review | /review |
Analyze branch changes for bugs, security, quality |
| Test | /test |
Detect test framework, run tests, diagnose failures |
| Fix | /fix |
Trace root cause, implement minimal fix, verify |
| PR | /pr |
Create pull request with summary and test plan |
| Status | /status |
Full repo overview: branches, PRs, CI, sync state |
| Check PR | /check-pr |
CI status, reviews, comments, merge readiness |
Commit Workflow
- Run
git statusandgit diffto understand changes - Run
git log --oneline -5to match the repo's commit style - Stage only relevant files (never stage .env, credentials, binaries)
- Write a conventional commit message:
- Format:
type: short description - Types:
feat,fix,refactor,docs,test,chore,style,perf - Focus on WHY, not WHAT
- Keep first line under 72 chars
- Format:
- Never push unless explicitly asked
Code Review Checklist
When reviewing branch changes (git diff main...HEAD):
| Category | Check For |
|---|---|
| Logic | Bugs, off-by-one errors, null handling |
| Security | Injection, XSS, secrets exposure, CORS |
| Performance | N+1 queries, unnecessary loops, missing indexes |
| Error handling | Unhandled exceptions, missing edge cases |
| Style | Consistency with surrounding code |
| Tests | New code covered? Edge cases tested? |
| API | Breaking changes to public interfaces? |
Provide: overall assessment (ship it / needs changes / major issues), specific issues with file:line references, suggested fixes.
Test Runner
Detect the framework and run tests:
| Config File | Framework | Command |
|---|---|---|
package.json (scripts.test) |
npm/yarn/pnpm | npm test / pnpm test |
pytest.ini / pyproject.toml |
pytest | pytest |
Cargo.toml |
cargo | cargo test |
go.mod |
go | go test ./... |
Makefile (test target) |
make | make test |
On failure: parse output, identify the failing test, show the assertion, suggest a fix (don't auto-fix unless asked).
Bug Fix Workflow
- Understand: Read error messages, identify failing file and line
- Root cause: Trace execution path, check
git log --oneline -10for recent changes - Fix: Make the minimal change needed - no refactoring, no unrelated improvements
- Verify: Run related tests, check nothing else broke
- Explain: Show what changed and why
PR Creation
- Run
git logandgit diffagainst base branch - Check if PR already exists (
gh pr view) - if so, show URL instead - Draft title (under 70 chars, conventional commit style)
- Create PR with:
## Summary- 2-3 bullet points## Test plan- checklist of what was tested
- Push branch if needed, return PR URL
- Never force push
Repo Status Dashboard
Gather and present:
git status- working tree stategit log --oneline -5- recent commitsgit branch -a- all branchesgit stash list- stashed changesgh pr list --state open- open PRs- CI status on current branch
- Behind/ahead of remote
- Merge conflicts with main
PR Health Check
For a given PR number:
- Get state, mergeable status, review decision, CI checks
- Read new comments and review feedback
- For failures: fetch logs, identify root cause, suggest fixes
- Summary: PR state, CI status (green/failing), review status, action items