GitHub Workflow
Automate the full GitHub development lifecycle: branches, commits, pushes, PRs, issues, and code review.
Quick Start
- User requests a git action (commit, PR, branch, push, issue)
- Check repo state:
git status, git branch, git log --oneline -5
- Execute the appropriate workflow below
- Confirm result to user
Workflows
1. Branching
# Create feature branch from main
git checkout main && git pull origin main
git checkout -b <type>/<name>
# Types: feature/, bugfix/, docs/, refactor/, test/, chore/
- Always branch from up-to-date
main
- Use conventional naming:
feature/add-jwt-testing, bugfix/fix-port-detection
2. Committing
# Stage specific files (never git add -A blindly)
git add <file1> <file2>
# Commit with conventional format
git commit -m "type(scope): description"
- Types:
feat, fix, docs, refactor, test, chore
- Message focuses on why, not what
- Never commit
.env, credentials, or secrets
- See reference/commit-conventions.md
3. Pushing
# First push (set upstream)
git push -u origin <branch-name>
# Subsequent pushes
git push
- Never force-push to
main/master without explicit user approval
- If push is rejected,
git pull --rebase first
4. Pull Requests
# Create PR linking to issue
gh pr create --title "Short title < 70 chars" --body "$(cat <<'EOF'
## Summary
- What changed and why
## Test plan
- [ ] How to verify
Fixes #<issue-number>
EOF
)"
- Title < 70 chars, details in body
- Always link to issue:
Fixes #N or Closes #N
- See reference/pr-workflow.md
5. Issues
gh issue create --title "type: description" --body "$(cat <<'EOF'
## Problem
What needs to change
## Proposed solution
How to fix it
## Acceptance criteria
- [ ] Criteria 1
EOF
)"
6. Code Review
# Review a PR
gh pr view <number>
gh pr diff <number>
gh pr checks <number>
# Comment or approve
gh pr review <number> --approve
gh pr review <number> --comment --body "feedback"
Reference
- commit-conventions.md — Commit message format and examples
- pr-workflow.md — PR creation, review, and merge workflow
- branch-strategy.md — Branching model and naming conventions
Critical Rules
- NEVER force-push to main/master without explicit user approval
- NEVER commit secrets,
.env files, or credentials
- NEVER use
git add -A without reviewing what's staged
- NEVER skip pre-commit hooks (
--no-verify) unless user explicitly asks
- NEVER amend published commits — create new commits instead
- ALWAYS use conventional commit format:
type(scope): description
- ALWAYS link PRs to issues
- ALWAYS check
git status before committing
- ALWAYS pull before pushing to avoid conflicts
- ALWAYS create branches from up-to-date main
1---2name: github-workflow3description: GitHub workflow automation — branching, committing, pushing, pull requests, issues, and code review. Use when asked to commit, push, create PRs/branches/issues, or manage git workflow.4---5
6# GitHub Workflow
7
8Automate the full GitHub development lifecycle: branches, commits, pushes, PRs, issues, and code review.
9
10## Quick Start
11
121. User requests a git action (commit, PR, branch, push, issue)
132. Check repo state: `git status`, `git branch`, `git log --oneline -5`
143. Execute the appropriate workflow below
154. Confirm result to user
16
17## Workflows
18
19### 1. Branching
20
21```bash
22# Create feature branch from main
23git checkout main && git pull origin main
24git checkout -b <type>/<name>
25# Types: feature/, bugfix/, docs/, refactor/, test/, chore/
26```
27
28- Always branch from up-to-date `main`
29- Use conventional naming: `feature/add-jwt-testing`, `bugfix/fix-port-detection`
30
31### 2. Committing
32
33```bash
34# Stage specific files (never git add -A blindly)
35git add <file1> <file2>
36# Commit with conventional format
37git commit -m "type(scope): description"
38```
39
40- **Types**: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`
41- Message focuses on **why**, not what
42- Never commit `.env`, credentials, or secrets
43- See [reference/commit-conventions.md](reference/commit-conventions.md)
44
45### 3. Pushing
46
47```bash
48# First push (set upstream)
49git push -u origin <branch-name>
50# Subsequent pushes
51git push
52```
53
54- Never force-push to `main`/`master` without explicit user approval
55- If push is rejected, `git pull --rebase` first
56
57### 4. Pull Requests
58
59```bash
60# Create PR linking to issue
61gh pr create --title "Short title < 70 chars" --body "$(cat <<'EOF'
62## Summary
63- What changed and why
64
65## Test plan
66- [ ] How to verify
67
68Fixes #<issue-number>
69EOF
70)"
71```
72
73- Title < 70 chars, details in body
74- Always link to issue: `Fixes #N` or `Closes #N`
75- See [reference/pr-workflow.md](reference/pr-workflow.md)
76
77### 5. Issues
78
79```bash
80gh issue create --title "type: description" --body "$(cat <<'EOF'
81## Problem
82What needs to change
83
84## Proposed solution
85How to fix it
86
87## Acceptance criteria
88- [ ] Criteria 1
89EOF
90)"
91```
92
93### 6. Code Review
94
95```bash
96# Review a PR
97gh pr view <number>
98gh pr diff <number>
99gh pr checks <number>
100# Comment or approve
101gh pr review <number> --approve
102gh pr review <number> --comment --body "feedback"
103```
104
105## Reference
106
107- [commit-conventions.md](reference/commit-conventions.md) — Commit message format and examples
108- [pr-workflow.md](reference/pr-workflow.md) — PR creation, review, and merge workflow
109- [branch-strategy.md](reference/branch-strategy.md) — Branching model and naming conventions
110
111## Critical Rules
112
113- **NEVER** force-push to main/master without explicit user approval
114- **NEVER** commit secrets, `.env` files, or credentials
115- **NEVER** use `git add -A` without reviewing what's staged
116- **NEVER** skip pre-commit hooks (`--no-verify`) unless user explicitly asks
117- **NEVER** amend published commits — create new commits instead
118- **ALWAYS** use conventional commit format: `type(scope): description`
119- **ALWAYS** link PRs to issues
120- **ALWAYS** check `git status` before committing
121- **ALWAYS** pull before pushing to avoid conflicts
122- **ALWAYS** create branches from up-to-date main