tribunal-kit 2.4.2 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/scripts/patch_skills_meta.py +177 -177
- package/.agent/scripts/patch_skills_output.py +285 -285
- package/.agent/scripts/strengthen_skills.py +220 -220
- package/.agent/skills/github-operations/SKILL.md +354 -354
- package/.agent/skills/readme-builder/SKILL.md +270 -270
- package/.agent/workflows/strengthen-skills.md +99 -99
- package/bin/tribunal-kit.js +547 -542
- package/package.json +53 -38
|
@@ -1,354 +1,354 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: github-operations
|
|
3
|
-
description: Complete Git and GitHub workflow orchestration. Handles branching, committing, pushing, pull requests, conflict resolution, and repository management. Use when working with Git repositories, GitHub Actions, or any version control operations.
|
|
4
|
-
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
|
|
5
|
-
version: 1.0.0
|
|
6
|
-
last-updated: 2026-03-19
|
|
7
|
-
applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# GitHub Operations Skill
|
|
11
|
-
|
|
12
|
-
> Git is a communication tool as much as a version control tool. Commit messages are letters to your future self and your team.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Ground Rules
|
|
17
|
-
|
|
18
|
-
1. **Never force-push to `main` or `master`** — use feature branches
|
|
19
|
-
2. **Always check `git status` before staging** — know what you are committing
|
|
20
|
-
3. **One logical change per commit** — atomic commits are easier to revert
|
|
21
|
-
4. **Pull before push** — always sync with remote first to avoid conflicts
|
|
22
|
-
5. **Never commit secrets** — use `.gitignore` and environment variables
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Core Workflow Patterns
|
|
27
|
-
|
|
28
|
-
### Standard Feature Branch Workflow
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
# 1. Always start from an up-to-date main
|
|
32
|
-
git checkout main
|
|
33
|
-
git pull origin main
|
|
34
|
-
|
|
35
|
-
# 2. Create a descriptive feature branch
|
|
36
|
-
git checkout -b feat/your-feature-name
|
|
37
|
-
|
|
38
|
-
# 3. Make changes, then stage selectively
|
|
39
|
-
git add -p # Interactive: review each hunk before staging
|
|
40
|
-
git add path/to/specific/file # Or stage specific files
|
|
41
|
-
|
|
42
|
-
# 4. Commit with a meaningful message
|
|
43
|
-
git commit -m "feat(scope): short summary of change
|
|
44
|
-
|
|
45
|
-
- Detail 1: what was added/changed and why
|
|
46
|
-
- Detail 2: any side effects or dependencies"
|
|
47
|
-
|
|
48
|
-
# 5. Push and create PR
|
|
49
|
-
git push -u origin feat/your-feature-name
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Commit Message Convention (Conventional Commits)
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
<type>(<scope>): <short summary>
|
|
56
|
-
|
|
57
|
-
[optional body: explain WHY, not what]
|
|
58
|
-
|
|
59
|
-
[optional footer: BREAKING CHANGE, closes #issue]
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**Types:**
|
|
63
|
-
| Type | Use When |
|
|
64
|
-
|------|----------|
|
|
65
|
-
| `feat` | New feature |
|
|
66
|
-
| `fix` | Bug fix |
|
|
67
|
-
| `docs` | Documentation only |
|
|
68
|
-
| `refactor` | Code restructure, no behavior change |
|
|
69
|
-
| `perf` | Performance improvement |
|
|
70
|
-
| `test` | Adding or fixing tests |
|
|
71
|
-
| `chore` | Build, CI, dependency updates |
|
|
72
|
-
| `style` | Formatting, whitespace (no logic) |
|
|
73
|
-
|
|
74
|
-
**Example commit messages:**
|
|
75
|
-
```
|
|
76
|
-
feat(auth): add JWT refresh token rotation
|
|
77
|
-
fix(api): handle null response from external service
|
|
78
|
-
docs(readme): add installation and usage sections
|
|
79
|
-
chore(deps): upgrade typescript to 5.4
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
## Common Operations
|
|
85
|
-
|
|
86
|
-
### Fast Git Status Check
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
git status --short # Compact view
|
|
90
|
-
git diff --stat # What changed and how much
|
|
91
|
-
git log --oneline -10 # Last 10 commits, one line each
|
|
92
|
-
git log --oneline --graph --all # Full branch graph
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Staging Strategies
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
# Stage everything (use only when you know all changes are correct)
|
|
99
|
-
git add -A
|
|
100
|
-
|
|
101
|
-
# Stage interactively — review each change hunk
|
|
102
|
-
git add -p
|
|
103
|
-
|
|
104
|
-
# Stage a full directory
|
|
105
|
-
git add src/
|
|
106
|
-
|
|
107
|
-
# Stage individual files
|
|
108
|
-
git add file1.ts file2.ts
|
|
109
|
-
|
|
110
|
-
# Unstage a file (keep changes, remove from staging)
|
|
111
|
-
git restore --staged file.ts
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Undoing Mistakes
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
# Undo last commit, keep changes staged
|
|
118
|
-
git reset --soft HEAD~1
|
|
119
|
-
|
|
120
|
-
# Undo last commit, keep changes unstaged
|
|
121
|
-
git reset HEAD~1
|
|
122
|
-
|
|
123
|
-
# Discard all local changes (DESTRUCTIVE — cannot undo)
|
|
124
|
-
git restore .
|
|
125
|
-
|
|
126
|
-
# Revert a commit (creates a new "undo" commit — safe for shared branches)
|
|
127
|
-
git revert <commit-hash>
|
|
128
|
-
|
|
129
|
-
# Remove a file from git tracking but keep it locally
|
|
130
|
-
git rm --cached file.txt
|
|
131
|
-
echo "file.txt" >> .gitignore
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Resolving Merge Conflicts
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
# Pull with rebase (cleaner history than merge)
|
|
138
|
-
git pull --rebase origin main
|
|
139
|
-
|
|
140
|
-
# If rebase conflicts occur:
|
|
141
|
-
# 1. Fix conflicts in editor (look for <<<<<<, =======, >>>>>>>)
|
|
142
|
-
# 2. Stage resolved files
|
|
143
|
-
git add resolved-file.ts
|
|
144
|
-
# 3. Continue rebase
|
|
145
|
-
git rebase --continue
|
|
146
|
-
|
|
147
|
-
# If rebase is a mess, abort and start over
|
|
148
|
-
git rebase --abort
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Working with Remotes
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
# Show all remotes
|
|
155
|
-
git remote -v
|
|
156
|
-
|
|
157
|
-
# Add a remote
|
|
158
|
-
git remote add origin https://github.com/user/repo.git
|
|
159
|
-
|
|
160
|
-
# Change remote URL
|
|
161
|
-
git remote set-url origin https://github.com/user/new-repo.git
|
|
162
|
-
|
|
163
|
-
# Fetch all remotes without merging
|
|
164
|
-
git fetch --all
|
|
165
|
-
|
|
166
|
-
# Push and set upstream tracking
|
|
167
|
-
git push -u origin branch-name
|
|
168
|
-
|
|
169
|
-
# Delete a remote branch
|
|
170
|
-
git push origin --delete branch-name
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### GitHub CLI (gh) Operations
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
# Create a pull request
|
|
177
|
-
gh pr create --title "feat: my feature" --body "Description of changes" --base main
|
|
178
|
-
|
|
179
|
-
# List open PRs
|
|
180
|
-
gh pr list
|
|
181
|
-
|
|
182
|
-
# Check PR status + reviews
|
|
183
|
-
gh pr status
|
|
184
|
-
|
|
185
|
-
# Merge PR (squash recommended for features)
|
|
186
|
-
gh pr merge --squash
|
|
187
|
-
|
|
188
|
-
# Create a release
|
|
189
|
-
gh release create v1.0.0 --title "v1.0.0 - Initial Release" --notes "Release notes here"
|
|
190
|
-
|
|
191
|
-
# Clone a repo
|
|
192
|
-
gh repo clone owner/repo-name
|
|
193
|
-
|
|
194
|
-
# View repo in browser
|
|
195
|
-
gh repo view --web
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## Advanced Patterns
|
|
201
|
-
|
|
202
|
-
### Stashing Work in Progress
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
# Stash changes with a label
|
|
206
|
-
git stash push -m "WIP: half-done auth feature"
|
|
207
|
-
|
|
208
|
-
# List all stashes
|
|
209
|
-
git stash list
|
|
210
|
-
|
|
211
|
-
# Apply most recent stash (keep it in stash list)
|
|
212
|
-
git stash apply
|
|
213
|
-
|
|
214
|
-
# Apply a specific stash
|
|
215
|
-
git stash apply stash@{2}
|
|
216
|
-
|
|
217
|
-
# Apply and drop at once
|
|
218
|
-
git stash pop
|
|
219
|
-
|
|
220
|
-
# Drop a specific stash
|
|
221
|
-
git stash drop stash@{0}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Tagging Releases
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
# Create an annotated tag (preferred for releases)
|
|
228
|
-
git tag -a v1.2.0 -m "Release version 1.2.0 — added X, fixed Y"
|
|
229
|
-
|
|
230
|
-
# Push tags to remote
|
|
231
|
-
git push origin --tags
|
|
232
|
-
|
|
233
|
-
# List existing tags
|
|
234
|
-
git tag -l
|
|
235
|
-
|
|
236
|
-
# Delete a tag locally and remotely
|
|
237
|
-
git tag -d v1.2.0
|
|
238
|
-
git push origin --delete v1.2.0
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
### Squashing Commits Before PR
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
# Interactive rebase to squash last N commits
|
|
245
|
-
git rebase -i HEAD~3
|
|
246
|
-
|
|
247
|
-
# In the editor: change 'pick' to 'squash' (or 's') for commits to merge
|
|
248
|
-
# Keep the first as 'pick', squash the rest into it
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
## README Generation (Quick Pattern)
|
|
254
|
-
|
|
255
|
-
When adding or updating a README, use this checklist:
|
|
256
|
-
|
|
257
|
-
```
|
|
258
|
-
## README Checklist
|
|
259
|
-
- [ ] Project name and one-line description at the top
|
|
260
|
-
- [ ] Badges: build status, version, license
|
|
261
|
-
- [ ] Quick demo or screenshot
|
|
262
|
-
- [ ] Requirements / prerequisites
|
|
263
|
-
- [ ] Installation (copy-paste commands, no ambiguity)
|
|
264
|
-
- [ ] Usage with examples
|
|
265
|
-
- [ ] Configuration / environment variables table
|
|
266
|
-
- [ ] Contributing guidelines link
|
|
267
|
-
- [ ] License declaration
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
---
|
|
271
|
-
|
|
272
|
-
## .gitignore Templates
|
|
273
|
-
|
|
274
|
-
### Node.js / TypeScript
|
|
275
|
-
|
|
276
|
-
```gitignore
|
|
277
|
-
node_modules/
|
|
278
|
-
dist/
|
|
279
|
-
build/
|
|
280
|
-
.env
|
|
281
|
-
.env.local
|
|
282
|
-
.env.*.local
|
|
283
|
-
*.log
|
|
284
|
-
.DS_Store
|
|
285
|
-
Thumbs.db
|
|
286
|
-
coverage/
|
|
287
|
-
.nyc_output/
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
### Python
|
|
291
|
-
|
|
292
|
-
```gitignore
|
|
293
|
-
__pycache__/
|
|
294
|
-
*.py[cod]
|
|
295
|
-
*.egg-info/
|
|
296
|
-
dist/
|
|
297
|
-
build/
|
|
298
|
-
.venv/
|
|
299
|
-
venv/
|
|
300
|
-
.env
|
|
301
|
-
*.log
|
|
302
|
-
.pytest_cache/
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
---
|
|
306
|
-
|
|
307
|
-
## Output Format
|
|
308
|
-
|
|
309
|
-
When this skill produces git operations or reviews them, structure your output as:
|
|
310
|
-
|
|
311
|
-
```
|
|
312
|
-
━━━ GitHub Operations Report ━━━━━━━━━━━━━━━━━━━━━━━
|
|
313
|
-
Skill: github-operations
|
|
314
|
-
Scope: [repo name / branch]
|
|
315
|
-
Operation: [commit / push / PR / merge / etc.]
|
|
316
|
-
─────────────────────────────────────────────────────
|
|
317
|
-
✅ Passed: [checks that passed, or "All clean"]
|
|
318
|
-
⚠️ Warnings: [non-blocking issues, or "None"]
|
|
319
|
-
❌ Blocked: [blocking issues requiring fix, or "None"]
|
|
320
|
-
─────────────────────────────────────────────────────
|
|
321
|
-
VBC status: PENDING → VERIFIED
|
|
322
|
-
Evidence: [git output / push confirmation / PR link]
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
**VBC (Verification-Before-Completion) is mandatory.**
|
|
326
|
-
Do not mark status as VERIFIED until concrete terminal evidence (e.g., push success, PR link) is provided.
|
|
327
|
-
|
|
328
|
-
---
|
|
329
|
-
|
|
330
|
-
## 🏛️ Tribunal Integration (Anti-Hallucination)
|
|
331
|
-
|
|
332
|
-
**Slash command: `/review` or `/audit`**
|
|
333
|
-
**Active reviewers: `logic` · `security` · `devops`**
|
|
334
|
-
|
|
335
|
-
### ❌ Forbidden AI Tropes in GitHub Operations
|
|
336
|
-
|
|
337
|
-
1. **Inventing commit hashes** — never fabricate SHA hashes; always use `git log` to retrieve real ones.
|
|
338
|
-
2. **Assuming branch names** — always confirm the current branch with `git branch --show-current` before operating.
|
|
339
|
-
3. **Silently force-pushing** — never suggest `git push --force` without explicitly warning about history rewrite risks.
|
|
340
|
-
4. **Hallucinating `gh` subcommands** — only use `gh` commands from the official GitHub CLI docs.
|
|
341
|
-
5. **Skipping `git pull` before push** — always sync with remote first, especially on shared branches.
|
|
342
|
-
|
|
343
|
-
### ✅ Pre-Flight Self-Audit
|
|
344
|
-
|
|
345
|
-
Review these questions before any git operation:
|
|
346
|
-
|
|
347
|
-
```
|
|
348
|
-
✅ Did I check `git status` before staging changes?
|
|
349
|
-
✅ Is the commit message following Conventional Commits format?
|
|
350
|
-
✅ Did I verify the correct branch is active with `git branch --show-current`?
|
|
351
|
-
✅ Did I pull from remote before pushing to avoid conflicts?
|
|
352
|
-
✅ Are there any secrets, API keys, or credentials in the staged diff?
|
|
353
|
-
✅ If force-pushing, did I explicitly warn the user about history rewrite?
|
|
354
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: github-operations
|
|
3
|
+
description: Complete Git and GitHub workflow orchestration. Handles branching, committing, pushing, pull requests, conflict resolution, and repository management. Use when working with Git repositories, GitHub Actions, or any version control operations.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
last-updated: 2026-03-19
|
|
7
|
+
applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# GitHub Operations Skill
|
|
11
|
+
|
|
12
|
+
> Git is a communication tool as much as a version control tool. Commit messages are letters to your future self and your team.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Ground Rules
|
|
17
|
+
|
|
18
|
+
1. **Never force-push to `main` or `master`** — use feature branches
|
|
19
|
+
2. **Always check `git status` before staging** — know what you are committing
|
|
20
|
+
3. **One logical change per commit** — atomic commits are easier to revert
|
|
21
|
+
4. **Pull before push** — always sync with remote first to avoid conflicts
|
|
22
|
+
5. **Never commit secrets** — use `.gitignore` and environment variables
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Core Workflow Patterns
|
|
27
|
+
|
|
28
|
+
### Standard Feature Branch Workflow
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# 1. Always start from an up-to-date main
|
|
32
|
+
git checkout main
|
|
33
|
+
git pull origin main
|
|
34
|
+
|
|
35
|
+
# 2. Create a descriptive feature branch
|
|
36
|
+
git checkout -b feat/your-feature-name
|
|
37
|
+
|
|
38
|
+
# 3. Make changes, then stage selectively
|
|
39
|
+
git add -p # Interactive: review each hunk before staging
|
|
40
|
+
git add path/to/specific/file # Or stage specific files
|
|
41
|
+
|
|
42
|
+
# 4. Commit with a meaningful message
|
|
43
|
+
git commit -m "feat(scope): short summary of change
|
|
44
|
+
|
|
45
|
+
- Detail 1: what was added/changed and why
|
|
46
|
+
- Detail 2: any side effects or dependencies"
|
|
47
|
+
|
|
48
|
+
# 5. Push and create PR
|
|
49
|
+
git push -u origin feat/your-feature-name
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Commit Message Convention (Conventional Commits)
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
<type>(<scope>): <short summary>
|
|
56
|
+
|
|
57
|
+
[optional body: explain WHY, not what]
|
|
58
|
+
|
|
59
|
+
[optional footer: BREAKING CHANGE, closes #issue]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Types:**
|
|
63
|
+
| Type | Use When |
|
|
64
|
+
|------|----------|
|
|
65
|
+
| `feat` | New feature |
|
|
66
|
+
| `fix` | Bug fix |
|
|
67
|
+
| `docs` | Documentation only |
|
|
68
|
+
| `refactor` | Code restructure, no behavior change |
|
|
69
|
+
| `perf` | Performance improvement |
|
|
70
|
+
| `test` | Adding or fixing tests |
|
|
71
|
+
| `chore` | Build, CI, dependency updates |
|
|
72
|
+
| `style` | Formatting, whitespace (no logic) |
|
|
73
|
+
|
|
74
|
+
**Example commit messages:**
|
|
75
|
+
```
|
|
76
|
+
feat(auth): add JWT refresh token rotation
|
|
77
|
+
fix(api): handle null response from external service
|
|
78
|
+
docs(readme): add installation and usage sections
|
|
79
|
+
chore(deps): upgrade typescript to 5.4
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Common Operations
|
|
85
|
+
|
|
86
|
+
### Fast Git Status Check
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
git status --short # Compact view
|
|
90
|
+
git diff --stat # What changed and how much
|
|
91
|
+
git log --oneline -10 # Last 10 commits, one line each
|
|
92
|
+
git log --oneline --graph --all # Full branch graph
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Staging Strategies
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Stage everything (use only when you know all changes are correct)
|
|
99
|
+
git add -A
|
|
100
|
+
|
|
101
|
+
# Stage interactively — review each change hunk
|
|
102
|
+
git add -p
|
|
103
|
+
|
|
104
|
+
# Stage a full directory
|
|
105
|
+
git add src/
|
|
106
|
+
|
|
107
|
+
# Stage individual files
|
|
108
|
+
git add file1.ts file2.ts
|
|
109
|
+
|
|
110
|
+
# Unstage a file (keep changes, remove from staging)
|
|
111
|
+
git restore --staged file.ts
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Undoing Mistakes
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Undo last commit, keep changes staged
|
|
118
|
+
git reset --soft HEAD~1
|
|
119
|
+
|
|
120
|
+
# Undo last commit, keep changes unstaged
|
|
121
|
+
git reset HEAD~1
|
|
122
|
+
|
|
123
|
+
# Discard all local changes (DESTRUCTIVE — cannot undo)
|
|
124
|
+
git restore .
|
|
125
|
+
|
|
126
|
+
# Revert a commit (creates a new "undo" commit — safe for shared branches)
|
|
127
|
+
git revert <commit-hash>
|
|
128
|
+
|
|
129
|
+
# Remove a file from git tracking but keep it locally
|
|
130
|
+
git rm --cached file.txt
|
|
131
|
+
echo "file.txt" >> .gitignore
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Resolving Merge Conflicts
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Pull with rebase (cleaner history than merge)
|
|
138
|
+
git pull --rebase origin main
|
|
139
|
+
|
|
140
|
+
# If rebase conflicts occur:
|
|
141
|
+
# 1. Fix conflicts in editor (look for <<<<<<, =======, >>>>>>>)
|
|
142
|
+
# 2. Stage resolved files
|
|
143
|
+
git add resolved-file.ts
|
|
144
|
+
# 3. Continue rebase
|
|
145
|
+
git rebase --continue
|
|
146
|
+
|
|
147
|
+
# If rebase is a mess, abort and start over
|
|
148
|
+
git rebase --abort
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Working with Remotes
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Show all remotes
|
|
155
|
+
git remote -v
|
|
156
|
+
|
|
157
|
+
# Add a remote
|
|
158
|
+
git remote add origin https://github.com/user/repo.git
|
|
159
|
+
|
|
160
|
+
# Change remote URL
|
|
161
|
+
git remote set-url origin https://github.com/user/new-repo.git
|
|
162
|
+
|
|
163
|
+
# Fetch all remotes without merging
|
|
164
|
+
git fetch --all
|
|
165
|
+
|
|
166
|
+
# Push and set upstream tracking
|
|
167
|
+
git push -u origin branch-name
|
|
168
|
+
|
|
169
|
+
# Delete a remote branch
|
|
170
|
+
git push origin --delete branch-name
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### GitHub CLI (gh) Operations
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Create a pull request
|
|
177
|
+
gh pr create --title "feat: my feature" --body "Description of changes" --base main
|
|
178
|
+
|
|
179
|
+
# List open PRs
|
|
180
|
+
gh pr list
|
|
181
|
+
|
|
182
|
+
# Check PR status + reviews
|
|
183
|
+
gh pr status
|
|
184
|
+
|
|
185
|
+
# Merge PR (squash recommended for features)
|
|
186
|
+
gh pr merge --squash
|
|
187
|
+
|
|
188
|
+
# Create a release
|
|
189
|
+
gh release create v1.0.0 --title "v1.0.0 - Initial Release" --notes "Release notes here"
|
|
190
|
+
|
|
191
|
+
# Clone a repo
|
|
192
|
+
gh repo clone owner/repo-name
|
|
193
|
+
|
|
194
|
+
# View repo in browser
|
|
195
|
+
gh repo view --web
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Advanced Patterns
|
|
201
|
+
|
|
202
|
+
### Stashing Work in Progress
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Stash changes with a label
|
|
206
|
+
git stash push -m "WIP: half-done auth feature"
|
|
207
|
+
|
|
208
|
+
# List all stashes
|
|
209
|
+
git stash list
|
|
210
|
+
|
|
211
|
+
# Apply most recent stash (keep it in stash list)
|
|
212
|
+
git stash apply
|
|
213
|
+
|
|
214
|
+
# Apply a specific stash
|
|
215
|
+
git stash apply stash@{2}
|
|
216
|
+
|
|
217
|
+
# Apply and drop at once
|
|
218
|
+
git stash pop
|
|
219
|
+
|
|
220
|
+
# Drop a specific stash
|
|
221
|
+
git stash drop stash@{0}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Tagging Releases
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# Create an annotated tag (preferred for releases)
|
|
228
|
+
git tag -a v1.2.0 -m "Release version 1.2.0 — added X, fixed Y"
|
|
229
|
+
|
|
230
|
+
# Push tags to remote
|
|
231
|
+
git push origin --tags
|
|
232
|
+
|
|
233
|
+
# List existing tags
|
|
234
|
+
git tag -l
|
|
235
|
+
|
|
236
|
+
# Delete a tag locally and remotely
|
|
237
|
+
git tag -d v1.2.0
|
|
238
|
+
git push origin --delete v1.2.0
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Squashing Commits Before PR
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Interactive rebase to squash last N commits
|
|
245
|
+
git rebase -i HEAD~3
|
|
246
|
+
|
|
247
|
+
# In the editor: change 'pick' to 'squash' (or 's') for commits to merge
|
|
248
|
+
# Keep the first as 'pick', squash the rest into it
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## README Generation (Quick Pattern)
|
|
254
|
+
|
|
255
|
+
When adding or updating a README, use this checklist:
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
## README Checklist
|
|
259
|
+
- [ ] Project name and one-line description at the top
|
|
260
|
+
- [ ] Badges: build status, version, license
|
|
261
|
+
- [ ] Quick demo or screenshot
|
|
262
|
+
- [ ] Requirements / prerequisites
|
|
263
|
+
- [ ] Installation (copy-paste commands, no ambiguity)
|
|
264
|
+
- [ ] Usage with examples
|
|
265
|
+
- [ ] Configuration / environment variables table
|
|
266
|
+
- [ ] Contributing guidelines link
|
|
267
|
+
- [ ] License declaration
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## .gitignore Templates
|
|
273
|
+
|
|
274
|
+
### Node.js / TypeScript
|
|
275
|
+
|
|
276
|
+
```gitignore
|
|
277
|
+
node_modules/
|
|
278
|
+
dist/
|
|
279
|
+
build/
|
|
280
|
+
.env
|
|
281
|
+
.env.local
|
|
282
|
+
.env.*.local
|
|
283
|
+
*.log
|
|
284
|
+
.DS_Store
|
|
285
|
+
Thumbs.db
|
|
286
|
+
coverage/
|
|
287
|
+
.nyc_output/
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Python
|
|
291
|
+
|
|
292
|
+
```gitignore
|
|
293
|
+
__pycache__/
|
|
294
|
+
*.py[cod]
|
|
295
|
+
*.egg-info/
|
|
296
|
+
dist/
|
|
297
|
+
build/
|
|
298
|
+
.venv/
|
|
299
|
+
venv/
|
|
300
|
+
.env
|
|
301
|
+
*.log
|
|
302
|
+
.pytest_cache/
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Output Format
|
|
308
|
+
|
|
309
|
+
When this skill produces git operations or reviews them, structure your output as:
|
|
310
|
+
|
|
311
|
+
```
|
|
312
|
+
━━━ GitHub Operations Report ━━━━━━━━━━━━━━━━━━━━━━━
|
|
313
|
+
Skill: github-operations
|
|
314
|
+
Scope: [repo name / branch]
|
|
315
|
+
Operation: [commit / push / PR / merge / etc.]
|
|
316
|
+
─────────────────────────────────────────────────────
|
|
317
|
+
✅ Passed: [checks that passed, or "All clean"]
|
|
318
|
+
⚠️ Warnings: [non-blocking issues, or "None"]
|
|
319
|
+
❌ Blocked: [blocking issues requiring fix, or "None"]
|
|
320
|
+
─────────────────────────────────────────────────────
|
|
321
|
+
VBC status: PENDING → VERIFIED
|
|
322
|
+
Evidence: [git output / push confirmation / PR link]
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**VBC (Verification-Before-Completion) is mandatory.**
|
|
326
|
+
Do not mark status as VERIFIED until concrete terminal evidence (e.g., push success, PR link) is provided.
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## 🏛️ Tribunal Integration (Anti-Hallucination)
|
|
331
|
+
|
|
332
|
+
**Slash command: `/review` or `/audit`**
|
|
333
|
+
**Active reviewers: `logic` · `security` · `devops`**
|
|
334
|
+
|
|
335
|
+
### ❌ Forbidden AI Tropes in GitHub Operations
|
|
336
|
+
|
|
337
|
+
1. **Inventing commit hashes** — never fabricate SHA hashes; always use `git log` to retrieve real ones.
|
|
338
|
+
2. **Assuming branch names** — always confirm the current branch with `git branch --show-current` before operating.
|
|
339
|
+
3. **Silently force-pushing** — never suggest `git push --force` without explicitly warning about history rewrite risks.
|
|
340
|
+
4. **Hallucinating `gh` subcommands** — only use `gh` commands from the official GitHub CLI docs.
|
|
341
|
+
5. **Skipping `git pull` before push** — always sync with remote first, especially on shared branches.
|
|
342
|
+
|
|
343
|
+
### ✅ Pre-Flight Self-Audit
|
|
344
|
+
|
|
345
|
+
Review these questions before any git operation:
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
✅ Did I check `git status` before staging changes?
|
|
349
|
+
✅ Is the commit message following Conventional Commits format?
|
|
350
|
+
✅ Did I verify the correct branch is active with `git branch --show-current`?
|
|
351
|
+
✅ Did I pull from remote before pushing to avoid conflicts?
|
|
352
|
+
✅ Are there any secrets, API keys, or credentials in the staged diff?
|
|
353
|
+
✅ If force-pushing, did I explicitly warn the user about history rewrite?
|
|
354
|
+
```
|