winter-super-cli 2026.6.26 → 2026.6.28

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +28 -5
  2. package/README.md +66 -0
  3. package/package.json +5 -1
  4. package/resources/local/gsap-skills/.claude-plugin/marketplace.json +20 -0
  5. package/resources/local/gsap-skills/.claude-plugin/plugin.json +6 -0
  6. package/resources/local/gsap-skills/.cursor-plugin/marketplace.json +13 -0
  7. package/resources/local/gsap-skills/.cursor-plugin/plugin.json +22 -0
  8. package/resources/local/gsap-skills/.github/copilot-instructions.md +17 -0
  9. package/resources/local/gsap-skills/.github/instructions/react.instructions.md +15 -0
  10. package/resources/local/gsap-skills/.github/instructions/scrolltrigger.instructions.md +18 -0
  11. package/resources/local/gsap-skills/AGENTS.md +27 -0
  12. package/resources/local/gsap-skills/CLAUDE.md +1 -0
  13. package/resources/local/gsap-skills/GEMINI.md +1 -0
  14. package/resources/local/gsap-skills/LICENSE +21 -0
  15. package/resources/local/gsap-skills/README.md +163 -0
  16. package/resources/local/gsap-skills/assets/gsap-green.svg +7 -0
  17. package/resources/local/gsap-skills/assets/gsap-icon-inverted.svg +15 -0
  18. package/resources/local/gsap-skills/assets/gsap-icon-square.svg +1 -0
  19. package/resources/local/gsap-skills/assets/gsap-white.svg +7 -0
  20. package/resources/local/gsap-skills/examples/README.md +29 -0
  21. package/resources/local/gsap-skills/examples/nuxt/app/app.vue +3 -0
  22. package/resources/local/gsap-skills/examples/nuxt/app/composables/useGSAP.ts +91 -0
  23. package/resources/local/gsap-skills/examples/nuxt/app/pages/index.vue +55 -0
  24. package/resources/local/gsap-skills/examples/nuxt/nuxt.config.ts +4 -0
  25. package/resources/local/gsap-skills/examples/nuxt/package.json +18 -0
  26. package/resources/local/gsap-skills/examples/react/App.jsx +46 -0
  27. package/resources/local/gsap-skills/examples/react/index.html +12 -0
  28. package/resources/local/gsap-skills/examples/react/main.jsx +9 -0
  29. package/resources/local/gsap-skills/examples/react/package.json +21 -0
  30. package/resources/local/gsap-skills/examples/react/vite.config.js +7 -0
  31. package/resources/local/gsap-skills/examples/vanilla/index.html +33 -0
  32. package/resources/local/gsap-skills/examples/vanilla/main.js +36 -0
  33. package/resources/local/gsap-skills/examples/vue/app.vue +47 -0
  34. package/resources/local/gsap-skills/examples/vue/index.html +15 -0
  35. package/resources/local/gsap-skills/examples/vue/main.js +9 -0
  36. package/resources/local/gsap-skills/examples/vue/package.json +19 -0
  37. package/resources/local/gsap-skills/examples/vue/vite.config.js +7 -0
  38. package/resources/local/gsap-skills/skills/gsap-core/SKILL.md +254 -0
  39. package/resources/local/gsap-skills/skills/gsap-frameworks/SKILL.md +266 -0
  40. package/resources/local/gsap-skills/skills/gsap-performance/SKILL.md +79 -0
  41. package/resources/local/gsap-skills/skills/gsap-plugins/SKILL.md +433 -0
  42. package/resources/local/gsap-skills/skills/gsap-react/SKILL.md +136 -0
  43. package/resources/local/gsap-skills/skills/gsap-scrolltrigger/SKILL.md +296 -0
  44. package/resources/local/gsap-skills/skills/gsap-timeline/SKILL.md +107 -0
  45. package/resources/local/gsap-skills/skills/gsap-utils/SKILL.md +284 -0
  46. package/resources/local/gsap-skills/skills/llms.txt +39 -0
  47. package/resources/local/hermes-agent-core/AGENTS.md +1132 -0
  48. package/resources/local/hermes-agent-core/LICENSE +21 -0
  49. package/resources/local/hermes-agent-core/README.md +215 -0
  50. package/resources/local/hermes-agent-core/docs/2026-05-07-s6-overlay-dynamic-subagent-gateways.md +434 -0
  51. package/resources/local/hermes-agent-core/hermes-already-has-routines.md +160 -0
  52. package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/DESCRIPTION.md +3 -0
  53. package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/claude-code/SKILL.md +745 -0
  54. package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/codex/SKILL.md +130 -0
  55. package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/hermes-agent/SKILL.md +1021 -0
  56. package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/kanban-codex-lane/SKILL.md +277 -0
  57. package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/kanban-codex-lane/templates/pmb-codex-lane-prompt.md +57 -0
  58. package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/opencode/SKILL.md +219 -0
  59. package/resources/local/hermes-agent-core/skills/github/DESCRIPTION.md +3 -0
  60. package/resources/local/hermes-agent-core/skills/github/codebase-inspection/SKILL.md +116 -0
  61. package/resources/local/hermes-agent-core/skills/github/github-auth/SKILL.md +247 -0
  62. package/resources/local/hermes-agent-core/skills/github/github-auth/scripts/gh-env.sh +66 -0
  63. package/resources/local/hermes-agent-core/skills/github/github-code-review/SKILL.md +481 -0
  64. package/resources/local/hermes-agent-core/skills/github/github-code-review/references/review-output-template.md +74 -0
  65. package/resources/local/hermes-agent-core/skills/github/github-issues/SKILL.md +370 -0
  66. package/resources/local/hermes-agent-core/skills/github/github-issues/templates/bug-report.md +35 -0
  67. package/resources/local/hermes-agent-core/skills/github/github-issues/templates/feature-request.md +31 -0
  68. package/resources/local/hermes-agent-core/skills/github/github-pr-workflow/SKILL.md +367 -0
  69. package/resources/local/hermes-agent-core/skills/github/github-pr-workflow/references/ci-troubleshooting.md +183 -0
  70. package/resources/local/hermes-agent-core/skills/github/github-pr-workflow/references/conventional-commits.md +71 -0
  71. package/resources/local/hermes-agent-core/skills/github/github-pr-workflow/templates/pr-body-bugfix.md +35 -0
  72. package/resources/local/hermes-agent-core/skills/github/github-pr-workflow/templates/pr-body-feature.md +33 -0
  73. package/resources/local/hermes-agent-core/skills/github/github-repo-management/SKILL.md +516 -0
  74. package/resources/local/hermes-agent-core/skills/github/github-repo-management/references/github-api-cheatsheet.md +161 -0
  75. package/resources/local/hermes-agent-core/skills/mcp/DESCRIPTION.md +3 -0
  76. package/resources/local/hermes-agent-core/skills/mcp/native-mcp/SKILL.md +357 -0
  77. package/resources/local/hermes-agent-core/skills/software-development/debugging-hermes-tui-commands/SKILL.md +152 -0
  78. package/resources/local/hermes-agent-core/skills/software-development/hermes-agent-skill-authoring/SKILL.md +165 -0
  79. package/resources/local/hermes-agent-core/skills/software-development/hermes-s6-container-supervision/SKILL.md +176 -0
  80. package/resources/local/hermes-agent-core/skills/software-development/node-inspect-debugger/SKILL.md +319 -0
  81. package/resources/local/hermes-agent-core/skills/software-development/plan/SKILL.md +58 -0
  82. package/resources/local/hermes-agent-core/skills/software-development/python-debugpy/SKILL.md +375 -0
  83. package/resources/local/hermes-agent-core/skills/software-development/requesting-code-review/SKILL.md +280 -0
  84. package/resources/local/hermes-agent-core/skills/software-development/spike/SKILL.md +197 -0
  85. package/resources/local/hermes-agent-core/skills/software-development/subagent-driven-development/SKILL.md +352 -0
  86. package/resources/local/hermes-agent-core/skills/software-development/subagent-driven-development/references/context-budget-discipline.md +53 -0
  87. package/resources/local/hermes-agent-core/skills/software-development/subagent-driven-development/references/gates-taxonomy.md +93 -0
  88. package/resources/local/hermes-agent-core/skills/software-development/systematic-debugging/SKILL.md +367 -0
  89. package/resources/local/hermes-agent-core/skills/software-development/test-driven-development/SKILL.md +343 -0
  90. package/resources/local/hermes-agent-core/skills/software-development/writing-plans/SKILL.md +297 -0
  91. package/resources/local/manifest.json +12 -0
  92. package/rule.md +2 -0
  93. package/scripts/audit-pack.js +5 -0
  94. package/scripts/smoke-browser.js +53 -0
  95. package/scripts/smoke-package.js +38 -4
  96. package/skill.md +36 -4
  97. package/skills/gsap.md +26 -0
  98. package/skills/hermes-agent.md +17 -0
  99. package/src/agent/agent-definitions.js +4 -4
  100. package/src/agent/runtime.js +206 -5
  101. package/src/agent/subagent-child.js +44 -0
  102. package/src/ai/capability-scorecard.js +193 -14
  103. package/src/ai/hermes-core.js +77 -0
  104. package/src/ai/model-capabilities.js +42 -2
  105. package/src/ai/prompts/system-prompt.js +16 -2
  106. package/src/ai/small-model-amplifier.js +35 -7
  107. package/src/ai/workflow-selector.js +22 -1
  108. package/src/cli/commands.js +21 -1
  109. package/src/cli/config.js +42 -4
  110. package/src/cli/context-loader.js +253 -9
  111. package/src/cli/conversation-format.js +5 -0
  112. package/src/cli/input-controller.js +79 -10
  113. package/src/cli/prompt-builder.js +45 -8
  114. package/src/cli/repl-commands.js +123 -2
  115. package/src/cli/repl.js +183 -87
  116. package/src/cli/slash-commands.js +3 -1
  117. package/src/cli/tui.js +133 -37
  118. package/src/mcp/client.js +46 -5
  119. package/src/tools/agent.js +316 -25
  120. package/src/tools/executor.js +314 -11
  121. package/src/tools/permission.js +20 -17
  122. package/winter.d.ts +112 -10
@@ -0,0 +1,367 @@
1
+ ---
2
+ name: github-pr-workflow
3
+ description: "GitHub PR lifecycle: branch, commit, open, CI, merge."
4
+ version: 1.1.0
5
+ author: Hermes Agent
6
+ license: MIT
7
+ platforms: [linux, macos, windows]
8
+ metadata:
9
+ hermes:
10
+ tags: [GitHub, Pull-Requests, CI/CD, Git, Automation, Merge]
11
+ related_skills: [github-auth, github-code-review]
12
+ ---
13
+
14
+ # GitHub Pull Request Workflow
15
+
16
+ Complete guide for managing the PR lifecycle. Each section shows the `gh` way first, then the `git` + `curl` fallback for machines without `gh`.
17
+
18
+ ## Prerequisites
19
+
20
+ - Authenticated with GitHub (see `github-auth` skill)
21
+ - Inside a git repository with a GitHub remote
22
+
23
+ ### Quick Auth Detection
24
+
25
+ ```bash
26
+ # Determine which method to use throughout this workflow
27
+ if command -v gh &>/dev/null && gh auth status &>/dev/null; then
28
+ AUTH="gh"
29
+ else
30
+ AUTH="git"
31
+ # Ensure we have a token for API calls
32
+ if [ -z "$GITHUB_TOKEN" ]; then
33
+ if [ -f ~/.hermes/.env ] && grep -q "^GITHUB_TOKEN=" ~/.hermes/.env; then
34
+ GITHUB_TOKEN=$(grep "^GITHUB_TOKEN=" ~/.hermes/.env | head -1 | cut -d= -f2 | tr -d '\n\r')
35
+ elif grep -q "github.com" ~/.git-credentials 2>/dev/null; then
36
+ GITHUB_TOKEN=$(grep "github.com" ~/.git-credentials 2>/dev/null | head -1 | sed 's|https://[^:]*:\([^@]*\)@.*|\1|')
37
+ fi
38
+ fi
39
+ fi
40
+ echo "Using: $AUTH"
41
+ ```
42
+
43
+ ### Extracting Owner/Repo from the Git Remote
44
+
45
+ Many `curl` commands need `owner/repo`. Extract it from the git remote:
46
+
47
+ ```bash
48
+ # Works for both HTTPS and SSH remote URLs
49
+ REMOTE_URL=$(git remote get-url origin)
50
+ OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||')
51
+ OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1)
52
+ REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)
53
+ echo "Owner: $OWNER, Repo: $REPO"
54
+ ```
55
+
56
+ ---
57
+
58
+ ## 1. Branch Creation
59
+
60
+ This part is pure `git` — identical either way:
61
+
62
+ ```bash
63
+ # Make sure you're up to date
64
+ git fetch origin
65
+ git checkout main && git pull origin main
66
+
67
+ # Create and switch to a new branch
68
+ git checkout -b feat/add-user-authentication
69
+ ```
70
+
71
+ Branch naming conventions:
72
+ - `feat/description` — new features
73
+ - `fix/description` — bug fixes
74
+ - `refactor/description` — code restructuring
75
+ - `docs/description` — documentation
76
+ - `ci/description` — CI/CD changes
77
+
78
+ ## 2. Making Commits
79
+
80
+ Use the agent's file tools (`write_file`, `patch`) to make changes, then commit:
81
+
82
+ ```bash
83
+ # Stage specific files
84
+ git add src/auth.py src/models/user.py tests/test_auth.py
85
+
86
+ # Commit with a conventional commit message
87
+ git commit -m "feat: add JWT-based user authentication
88
+
89
+ - Add login/register endpoints
90
+ - Add User model with password hashing
91
+ - Add auth middleware for protected routes
92
+ - Add unit tests for auth flow"
93
+ ```
94
+
95
+ Commit message format (Conventional Commits):
96
+ ```
97
+ type(scope): short description
98
+
99
+ Longer explanation if needed. Wrap at 72 characters.
100
+ ```
101
+
102
+ Types: `feat`, `fix`, `refactor`, `docs`, `test`, `ci`, `chore`, `perf`
103
+
104
+ ## 3. Pushing and Creating a PR
105
+
106
+ ### Push the Branch (same either way)
107
+
108
+ ```bash
109
+ git push -u origin HEAD
110
+ ```
111
+
112
+ ### Create the PR
113
+
114
+ **With gh:**
115
+
116
+ ```bash
117
+ gh pr create \
118
+ --title "feat: add JWT-based user authentication" \
119
+ --body "## Summary
120
+ - Adds login and register API endpoints
121
+ - JWT token generation and validation
122
+
123
+ ## Test Plan
124
+ - [ ] Unit tests pass
125
+
126
+ Closes #42"
127
+ ```
128
+
129
+ Options: `--draft`, `--reviewer user1,user2`, `--label "enhancement"`, `--base develop`
130
+
131
+ **With git + curl:**
132
+
133
+ ```bash
134
+ BRANCH=$(git branch --show-current)
135
+
136
+ curl -s -X POST \
137
+ -H "Authorization: token $GITHUB_TOKEN" \
138
+ -H "Accept: application/vnd.github.v3+json" \
139
+ https://api.github.com/repos/$OWNER/$REPO/pulls \
140
+ -d "{
141
+ \"title\": \"feat: add JWT-based user authentication\",
142
+ \"body\": \"## Summary\nAdds login and register API endpoints.\n\nCloses #42\",
143
+ \"head\": \"$BRANCH\",
144
+ \"base\": \"main\"
145
+ }"
146
+ ```
147
+
148
+ The response JSON includes the PR `number` — save it for later commands.
149
+
150
+ To create as a draft, add `"draft": true` to the JSON body.
151
+
152
+ ## 4. Monitoring CI Status
153
+
154
+ ### Check CI Status
155
+
156
+ **With gh:**
157
+
158
+ ```bash
159
+ # One-shot check
160
+ gh pr checks
161
+
162
+ # Watch until all checks finish (polls every 10s)
163
+ gh pr checks --watch
164
+ ```
165
+
166
+ **With git + curl:**
167
+
168
+ ```bash
169
+ # Get the latest commit SHA on the current branch
170
+ SHA=$(git rev-parse HEAD)
171
+
172
+ # Query the combined status
173
+ curl -s \
174
+ -H "Authorization: token $GITHUB_TOKEN" \
175
+ https://api.github.com/repos/$OWNER/$REPO/commits/$SHA/status \
176
+ | python3 -c "
177
+ import sys, json
178
+ data = json.load(sys.stdin)
179
+ print(f\"Overall: {data['state']}\")
180
+ for s in data.get('statuses', []):
181
+ print(f\" {s['context']}: {s['state']} - {s.get('description', '')}\")"
182
+
183
+ # Also check GitHub Actions check runs (separate endpoint)
184
+ curl -s \
185
+ -H "Authorization: token $GITHUB_TOKEN" \
186
+ https://api.github.com/repos/$OWNER/$REPO/commits/$SHA/check-runs \
187
+ | python3 -c "
188
+ import sys, json
189
+ data = json.load(sys.stdin)
190
+ for cr in data.get('check_runs', []):
191
+ print(f\" {cr['name']}: {cr['status']} / {cr['conclusion'] or 'pending'}\")"
192
+ ```
193
+
194
+ ### Poll Until Complete (git + curl)
195
+
196
+ ```bash
197
+ # Simple polling loop — check every 30 seconds, up to 10 minutes
198
+ SHA=$(git rev-parse HEAD)
199
+ for i in $(seq 1 20); do
200
+ STATUS=$(curl -s \
201
+ -H "Authorization: token $GITHUB_TOKEN" \
202
+ https://api.github.com/repos/$OWNER/$REPO/commits/$SHA/status \
203
+ | python3 -c "import sys,json; print(json.load(sys.stdin)['state'])")
204
+ echo "Check $i: $STATUS"
205
+ if [ "$STATUS" = "success" ] || [ "$STATUS" = "failure" ] || [ "$STATUS" = "error" ]; then
206
+ break
207
+ fi
208
+ sleep 30
209
+ done
210
+ ```
211
+
212
+ ## 5. Auto-Fixing CI Failures
213
+
214
+ When CI fails, diagnose and fix. This loop works with either auth method.
215
+
216
+ ### Step 1: Get Failure Details
217
+
218
+ **With gh:**
219
+
220
+ ```bash
221
+ # List recent workflow runs on this branch
222
+ gh run list --branch $(git branch --show-current) --limit 5
223
+
224
+ # View failed logs
225
+ gh run view <RUN_ID> --log-failed
226
+ ```
227
+
228
+ **With git + curl:**
229
+
230
+ ```bash
231
+ BRANCH=$(git branch --show-current)
232
+
233
+ # List workflow runs on this branch
234
+ curl -s \
235
+ -H "Authorization: token $GITHUB_TOKEN" \
236
+ "https://api.github.com/repos/$OWNER/$REPO/actions/runs?branch=$BRANCH&per_page=5" \
237
+ | python3 -c "
238
+ import sys, json
239
+ runs = json.load(sys.stdin)['workflow_runs']
240
+ for r in runs:
241
+ print(f\"Run {r['id']}: {r['name']} - {r['conclusion'] or r['status']}\")"
242
+
243
+ # Get failed job logs (download as zip, extract, read)
244
+ RUN_ID=<run_id>
245
+ curl -s -L \
246
+ -H "Authorization: token $GITHUB_TOKEN" \
247
+ https://api.github.com/repos/$OWNER/$REPO/actions/runs/$RUN_ID/logs \
248
+ -o /tmp/ci-logs.zip
249
+ cd /tmp && unzip -o ci-logs.zip -d ci-logs && cat ci-logs/*.txt
250
+ ```
251
+
252
+ ### Step 2: Fix and Push
253
+
254
+ After identifying the issue, use file tools (`patch`, `write_file`) to fix it:
255
+
256
+ ```bash
257
+ git add <fixed_files>
258
+ git commit -m "fix: resolve CI failure in <check_name>"
259
+ git push
260
+ ```
261
+
262
+ ### Step 3: Verify
263
+
264
+ Re-check CI status using the commands from Section 4 above.
265
+
266
+ ### Auto-Fix Loop Pattern
267
+
268
+ When asked to auto-fix CI, follow this loop:
269
+
270
+ 1. Check CI status → identify failures
271
+ 2. Read failure logs → understand the error
272
+ 3. Use `read_file` + `patch`/`write_file` → fix the code
273
+ 4. `git add . && git commit -m "fix: ..." && git push`
274
+ 5. Wait for CI → re-check status
275
+ 6. Repeat if still failing (up to 3 attempts, then ask the user)
276
+
277
+ ## 6. Merging
278
+
279
+ **With gh:**
280
+
281
+ ```bash
282
+ # Squash merge + delete branch (cleanest for feature branches)
283
+ gh pr merge --squash --delete-branch
284
+
285
+ # Enable auto-merge (merges when all checks pass)
286
+ gh pr merge --auto --squash --delete-branch
287
+ ```
288
+
289
+ **With git + curl:**
290
+
291
+ ```bash
292
+ PR_NUMBER=<number>
293
+
294
+ # Merge the PR via API (squash)
295
+ curl -s -X PUT \
296
+ -H "Authorization: token $GITHUB_TOKEN" \
297
+ https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER/merge \
298
+ -d "{
299
+ \"merge_method\": \"squash\",
300
+ \"commit_title\": \"feat: add user authentication (#$PR_NUMBER)\"
301
+ }"
302
+
303
+ # Delete the remote branch after merge
304
+ BRANCH=$(git branch --show-current)
305
+ git push origin --delete $BRANCH
306
+
307
+ # Switch back to main locally
308
+ git checkout main && git pull origin main
309
+ git branch -d $BRANCH
310
+ ```
311
+
312
+ Merge methods: `"merge"` (merge commit), `"squash"`, `"rebase"`
313
+
314
+ ### Enable Auto-Merge (curl)
315
+
316
+ ```bash
317
+ # Auto-merge requires the repo to have it enabled in settings.
318
+ # This uses the GraphQL API since REST doesn't support auto-merge.
319
+ PR_NODE_ID=$(curl -s \
320
+ -H "Authorization: token $GITHUB_TOKEN" \
321
+ https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER \
322
+ | python3 -c "import sys,json; print(json.load(sys.stdin)['node_id'])")
323
+
324
+ curl -s -X POST \
325
+ -H "Authorization: token $GITHUB_TOKEN" \
326
+ https://api.github.com/graphql \
327
+ -d "{\"query\": \"mutation { enablePullRequestAutoMerge(input: {pullRequestId: \\\"$PR_NODE_ID\\\", mergeMethod: SQUASH}) { clientMutationId } }\"}"
328
+ ```
329
+
330
+ ## 7. Complete Workflow Example
331
+
332
+ ```bash
333
+ # 1. Start from clean main
334
+ git checkout main && git pull origin main
335
+
336
+ # 2. Branch
337
+ git checkout -b fix/login-redirect-bug
338
+
339
+ # 3. (Agent makes code changes with file tools)
340
+
341
+ # 4. Commit
342
+ git add src/auth/login.py tests/test_login.py
343
+ git commit -m "fix: correct redirect URL after login
344
+
345
+ Preserves the ?next= parameter instead of always redirecting to /dashboard."
346
+
347
+ # 5. Push
348
+ git push -u origin HEAD
349
+
350
+ # 6. Create PR (picks gh or curl based on what's available)
351
+ # ... (see Section 3)
352
+
353
+ # 7. Monitor CI (see Section 4)
354
+
355
+ # 8. Merge when green (see Section 6)
356
+ ```
357
+
358
+ ## Useful PR Commands Reference
359
+
360
+ | Action | gh | git + curl |
361
+ |--------|-----|-----------|
362
+ | List my PRs | `gh pr list --author @me` | `curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$OWNER/$REPO/pulls?state=open"` |
363
+ | View PR diff | `gh pr diff` | `git diff main...HEAD` (local) or `curl -H "Accept: application/vnd.github.diff" ...` |
364
+ | Add comment | `gh pr comment N --body "..."` | `curl -X POST .../issues/N/comments -d '{"body":"..."}'` |
365
+ | Request review | `gh pr edit N --add-reviewer user` | `curl -X POST .../pulls/N/requested_reviewers -d '{"reviewers":["user"]}'` |
366
+ | Close PR | `gh pr close N` | `curl -X PATCH .../pulls/N -d '{"state":"closed"}'` |
367
+ | Check out someone's PR | `gh pr checkout N` | `git fetch origin pull/N/head:pr-N && git checkout pr-N` |
@@ -0,0 +1,183 @@
1
+ # CI Troubleshooting Quick Reference
2
+
3
+ Common CI failure patterns and how to diagnose them from the logs.
4
+
5
+ ## Reading CI Logs
6
+
7
+ ```bash
8
+ # With gh
9
+ gh run view <RUN_ID> --log-failed
10
+
11
+ # With curl — download and extract
12
+ curl -sL -H "Authorization: token $GITHUB_TOKEN" \
13
+ https://api.github.com/repos/$GH_OWNER/$GH_REPO/actions/runs/<RUN_ID>/logs \
14
+ -o /tmp/ci-logs.zip && unzip -o /tmp/ci-logs.zip -d /tmp/ci-logs
15
+ ```
16
+
17
+ ## Common Failure Patterns
18
+
19
+ ### Test Failures
20
+
21
+ **Signatures in logs:**
22
+ ```
23
+ FAILED tests/test_foo.py::test_bar - AssertionError
24
+ E assert 42 == 43
25
+ ERROR tests/test_foo.py - ModuleNotFoundError
26
+ ```
27
+
28
+ **Diagnosis:**
29
+ 1. Find the test file and line number from the traceback
30
+ 2. Use `read_file` to read the failing test
31
+ 3. Check if it's a logic error in the code or a stale test assertion
32
+ 4. Look for `ModuleNotFoundError` — usually a missing dependency in CI
33
+
34
+ **Common fixes:**
35
+ - Update assertion to match new expected behavior
36
+ - Add missing dependency to requirements.txt / pyproject.toml
37
+ - Fix flaky test (add retry, mock external service, fix race condition)
38
+
39
+ ---
40
+
41
+ ### Lint / Formatting Failures
42
+
43
+ **Signatures in logs:**
44
+ ```
45
+ src/auth.py:45:1: E302 expected 2 blank lines, got 1
46
+ src/models.py:12:80: E501 line too long (95 > 88 characters)
47
+ error: would reformat src/utils.py
48
+ ```
49
+
50
+ **Diagnosis:**
51
+ 1. Read the specific file:line numbers mentioned
52
+ 2. Check which linter is complaining (flake8, ruff, black, isort, mypy)
53
+
54
+ **Common fixes:**
55
+ - Run the formatter locally: `black .`, `isort .`, `ruff check --fix .`
56
+ - Fix the specific style violation by editing the file
57
+ - If using `patch`, make sure to match existing indentation style
58
+
59
+ ---
60
+
61
+ ### Type Check Failures (mypy / pyright)
62
+
63
+ **Signatures in logs:**
64
+ ```
65
+ src/api.py:23: error: Argument 1 to "process" has incompatible type "str"; expected "int"
66
+ src/models.py:45: error: Missing return statement
67
+ ```
68
+
69
+ **Diagnosis:**
70
+ 1. Read the file at the mentioned line
71
+ 2. Check the function signature and what's being passed
72
+
73
+ **Common fixes:**
74
+ - Add type cast or conversion
75
+ - Fix the function signature
76
+ - Add `# type: ignore` comment as last resort (with explanation)
77
+
78
+ ---
79
+
80
+ ### Build / Compilation Failures
81
+
82
+ **Signatures in logs:**
83
+ ```
84
+ ModuleNotFoundError: No module named 'some_package'
85
+ ERROR: Could not find a version that satisfies the requirement foo==1.2.3
86
+ npm ERR! Could not resolve dependency
87
+ ```
88
+
89
+ **Diagnosis:**
90
+ 1. Check requirements.txt / package.json for the missing or incompatible dependency
91
+ 2. Compare local vs CI Python/Node version
92
+
93
+ **Common fixes:**
94
+ - Add missing dependency to requirements file
95
+ - Pin compatible version
96
+ - Update lockfile (`pip freeze`, `npm install`)
97
+
98
+ ---
99
+
100
+ ### Permission / Auth Failures
101
+
102
+ **Signatures in logs:**
103
+ ```
104
+ fatal: could not read Username for 'https://github.com': No such device or address
105
+ Error: Resource not accessible by integration
106
+ 403 Forbidden
107
+ ```
108
+
109
+ **Diagnosis:**
110
+ 1. Check if the workflow needs special permissions (token scopes)
111
+ 2. Check if secrets are configured (missing `GITHUB_TOKEN` or custom secrets)
112
+
113
+ **Common fixes:**
114
+ - Add `permissions:` block to workflow YAML
115
+ - Verify secrets exist: `gh secret list` or check repo settings
116
+ - For fork PRs: some secrets aren't available by design
117
+
118
+ ---
119
+
120
+ ### Timeout Failures
121
+
122
+ **Signatures in logs:**
123
+ ```
124
+ Error: The operation was canceled.
125
+ The job running on runner ... has exceeded the maximum execution time
126
+ ```
127
+
128
+ **Diagnosis:**
129
+ 1. Check which step timed out
130
+ 2. Look for infinite loops, hung processes, or slow network calls
131
+
132
+ **Common fixes:**
133
+ - Add timeout to the specific step: `timeout-minutes: 10`
134
+ - Fix the underlying performance issue
135
+ - Split into parallel jobs
136
+
137
+ ---
138
+
139
+ ### Docker / Container Failures
140
+
141
+ **Signatures in logs:**
142
+ ```
143
+ docker: Error response from daemon
144
+ failed to solve: ... not found
145
+ COPY failed: file not found in build context
146
+ ```
147
+
148
+ **Diagnosis:**
149
+ 1. Check Dockerfile for the failing step
150
+ 2. Verify the referenced files exist in the repo
151
+
152
+ **Common fixes:**
153
+ - Fix path in COPY/ADD command
154
+ - Update base image tag
155
+ - Add missing file to `.dockerignore` exclusion or remove from it
156
+
157
+ ---
158
+
159
+ ## Auto-Fix Decision Tree
160
+
161
+ ```
162
+ CI Failed
163
+ ├── Test failure
164
+ │ ├── Assertion mismatch → update test or fix logic
165
+ │ └── Import/module error → add dependency
166
+ ├── Lint failure → run formatter, fix style
167
+ ├── Type error → fix types
168
+ ├── Build failure
169
+ │ ├── Missing dep → add to requirements
170
+ │ └── Version conflict → update pins
171
+ ├── Permission error → update workflow permissions (needs user)
172
+ └── Timeout → investigate perf (may need user input)
173
+ ```
174
+
175
+ ## Re-running After Fix
176
+
177
+ ```bash
178
+ git add <fixed_files> && git commit -m "fix: resolve CI failure" && git push
179
+
180
+ # Then monitor
181
+ gh pr checks --watch 2>/dev/null || \
182
+ echo "Poll with: curl -s -H 'Authorization: token ...' https://api.github.com/repos/.../commits/$(git rev-parse HEAD)/status"
183
+ ```
@@ -0,0 +1,71 @@
1
+ # Conventional Commits Quick Reference
2
+
3
+ Format: `type(scope): description`
4
+
5
+ ## Types
6
+
7
+ | Type | When to use | Example |
8
+ |------|------------|---------|
9
+ | `feat` | New feature or capability | `feat(auth): add OAuth2 login flow` |
10
+ | `fix` | Bug fix | `fix(api): handle null response from /users endpoint` |
11
+ | `refactor` | Code restructuring, no behavior change | `refactor(db): extract query builder into separate module` |
12
+ | `docs` | Documentation only | `docs: update API usage examples in README` |
13
+ | `test` | Adding or updating tests | `test(auth): add integration tests for token refresh` |
14
+ | `ci` | CI/CD configuration | `ci: add Python 3.12 to test matrix` |
15
+ | `chore` | Maintenance, dependencies, tooling | `chore: upgrade pytest to 8.x` |
16
+ | `perf` | Performance improvement | `perf(search): add index on users.email column` |
17
+ | `style` | Formatting, whitespace, semicolons | `style: run black formatter on src/` |
18
+ | `build` | Build system or external deps | `build: switch from setuptools to hatch` |
19
+ | `revert` | Reverts a previous commit | `revert: revert "feat(auth): add OAuth2 login flow"` |
20
+
21
+ ## Scope (optional)
22
+
23
+ Short identifier for the area of the codebase: `auth`, `api`, `db`, `ui`, `cli`, etc.
24
+
25
+ ## Breaking Changes
26
+
27
+ Add `!` after type or `BREAKING CHANGE:` in footer:
28
+
29
+ ```
30
+ feat(api)!: change authentication to use bearer tokens
31
+
32
+ BREAKING CHANGE: API endpoints now require Bearer token instead of API key header.
33
+ Migration guide: https://docs.example.com/migrate-auth
34
+ ```
35
+
36
+ ## Multi-line Body
37
+
38
+ Wrap at 72 characters. Use bullet points for multiple changes:
39
+
40
+ ```
41
+ feat(auth): add JWT-based user authentication
42
+
43
+ - Add login/register endpoints with input validation
44
+ - Add User model with argon2 password hashing
45
+ - Add auth middleware for protected routes
46
+ - Add token refresh endpoint with rotation
47
+
48
+ Closes #42
49
+ ```
50
+
51
+ ## Linking Issues
52
+
53
+ In the commit body or footer:
54
+
55
+ ```
56
+ Closes #42 ← closes the issue when merged
57
+ Fixes #42 ← same effect
58
+ Refs #42 ← references without closing
59
+ Co-authored-by: Name <email>
60
+ ```
61
+
62
+ ## Quick Decision Guide
63
+
64
+ - Added something new? → `feat`
65
+ - Something was broken and you fixed it? → `fix`
66
+ - Changed how code is organized but not what it does? → `refactor`
67
+ - Only touched tests? → `test`
68
+ - Only touched docs? → `docs`
69
+ - Updated CI/CD pipelines? → `ci`
70
+ - Updated dependencies or tooling? → `chore`
71
+ - Made something faster? → `perf`
@@ -0,0 +1,35 @@
1
+ ## Bug Description
2
+
3
+ <!-- What was happening? -->
4
+
5
+ Fixes #
6
+
7
+ ## Root Cause
8
+
9
+ <!-- What was causing the bug? -->
10
+
11
+ ## Fix
12
+
13
+ <!-- What does this PR change to fix it? -->
14
+
15
+ -
16
+
17
+ ## How to Verify
18
+
19
+ <!-- Steps a reviewer can follow to confirm the fix -->
20
+
21
+ 1.
22
+ 2.
23
+ 3.
24
+
25
+ ## Test Plan
26
+
27
+ - [ ] Added regression test for this bug
28
+ - [ ] Existing tests still pass
29
+ - [ ] Manual verification of the fix
30
+
31
+ ## Risk Assessment
32
+
33
+ <!-- Could this fix break anything else? What's the blast radius? -->
34
+
35
+ Low / Medium / High — <!-- explanation -->
@@ -0,0 +1,33 @@
1
+ ## Summary
2
+
3
+ <!-- 1-3 bullet points describing what this PR does -->
4
+
5
+ -
6
+
7
+ ## Motivation
8
+
9
+ <!-- Why is this change needed? Link to issue if applicable -->
10
+
11
+ Closes #
12
+
13
+ ## Changes
14
+
15
+ <!-- Detailed list of changes made -->
16
+
17
+ -
18
+
19
+ ## Test Plan
20
+
21
+ <!-- How was this tested? Checklist of verification steps -->
22
+
23
+ - [ ] Unit tests pass (`pytest`)
24
+ - [ ] Manual testing of new functionality
25
+ - [ ] No regressions in existing behavior
26
+
27
+ ## Screenshots / Examples
28
+
29
+ <!-- If UI changes or new output, show before/after -->
30
+
31
+ ## Notes for Reviewers
32
+
33
+ <!-- Anything reviewers should pay special attention to -->