mindforge-cc 11.5.1 → 11.6.0

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 (170) hide show
  1. package/.agent/mindforge/skill-tdd.md +53 -0
  2. package/.agent/mindforge/skills-index.md +118 -0
  3. package/.agent/mindforge/systematic-debug.md +60 -0
  4. package/.agent/skills/1password-skill/SKILL.md +156 -0
  5. package/.agent/skills/1password-skill/references/cli-examples.md +31 -0
  6. package/.agent/skills/1password-skill/references/get-started.md +21 -0
  7. package/.agent/skills/article-illustrator/SKILL.md +199 -0
  8. package/.agent/skills/article-illustrator/references/prompt-construction.md +426 -0
  9. package/.agent/skills/article-illustrator/references/style-presets.md +80 -0
  10. package/.agent/skills/article-illustrator/references/styles.md +224 -0
  11. package/.agent/skills/article-illustrator/references/usage.md +50 -0
  12. package/.agent/skills/article-illustrator/references/workflow.md +332 -0
  13. package/.agent/skills/arxiv/SKILL.md +275 -0
  14. package/.agent/skills/blogwatcher/SKILL.md +130 -0
  15. package/.agent/skills/code-wiki/SKILL.md +438 -0
  16. package/.agent/skills/code-wiki/templates/README.md +31 -0
  17. package/.agent/skills/code-wiki/templates/architecture.md +30 -0
  18. package/.agent/skills/code-wiki/templates/getting-started.md +47 -0
  19. package/.agent/skills/code-wiki/templates/module.md +38 -0
  20. package/.agent/skills/codebase-inspection/SKILL.md +109 -0
  21. package/.agent/skills/comic-creator/SKILL.md +240 -0
  22. package/.agent/skills/comic-creator/references/analysis-framework.md +176 -0
  23. package/.agent/skills/comic-creator/references/auto-selection.md +71 -0
  24. package/.agent/skills/comic-creator/references/base-prompt.md +98 -0
  25. package/.agent/skills/comic-creator/references/character-template.md +180 -0
  26. package/.agent/skills/comic-creator/references/ohmsha-guide.md +85 -0
  27. package/.agent/skills/comic-creator/references/partial-workflows.md +106 -0
  28. package/.agent/skills/comic-creator/references/storyboard-template.md +143 -0
  29. package/.agent/skills/comic-creator/references/workflow.md +401 -0
  30. package/.agent/skills/concept-diagrams/SKILL.md +355 -0
  31. package/.agent/skills/concept-diagrams/references/dashboard-patterns.md +43 -0
  32. package/.agent/skills/concept-diagrams/references/infrastructure-patterns.md +144 -0
  33. package/.agent/skills/concept-diagrams/references/physical-shape-cookbook.md +42 -0
  34. package/.agent/skills/creative-ideation/SKILL.md +144 -0
  35. package/.agent/skills/creative-ideation/references/full-prompt-library.md +110 -0
  36. package/.agent/skills/devops-cli/SKILL.md +149 -0
  37. package/.agent/skills/devops-cli/references/app-discovery.md +112 -0
  38. package/.agent/skills/devops-cli/references/authentication.md +59 -0
  39. package/.agent/skills/devops-cli/references/cli-reference.md +104 -0
  40. package/.agent/skills/devops-cli/references/running-apps.md +171 -0
  41. package/.agent/skills/devops-watchers/SKILL.md +103 -0
  42. package/.agent/skills/docker-management/SKILL.md +273 -0
  43. package/.agent/skills/domain-intel/SKILL.md +96 -0
  44. package/.agent/skills/duckduckgo-search/SKILL.md +230 -0
  45. package/.agent/skills/github-auth/SKILL.md +240 -0
  46. package/.agent/skills/github-code-review/SKILL.md +474 -0
  47. package/.agent/skills/github-code-review/references/review-output-template.md +74 -0
  48. package/.agent/skills/github-issues/SKILL.md +363 -0
  49. package/.agent/skills/github-issues/templates/bug-report.md +35 -0
  50. package/.agent/skills/github-issues/templates/feature-request.md +31 -0
  51. package/.agent/skills/github-pr-workflow/SKILL.md +360 -0
  52. package/.agent/skills/github-pr-workflow/references/ci-troubleshooting.md +183 -0
  53. package/.agent/skills/github-pr-workflow/references/conventional-commits.md +71 -0
  54. package/.agent/skills/github-pr-workflow/templates/pr-body-bugfix.md +35 -0
  55. package/.agent/skills/github-pr-workflow/templates/pr-body-feature.md +33 -0
  56. package/.agent/skills/github-repo-management/SKILL.md +509 -0
  57. package/.agent/skills/github-repo-management/references/github-api-cheatsheet.md +161 -0
  58. package/.agent/skills/godmode/SKILL.md +396 -0
  59. package/.agent/skills/godmode/references/jailbreak-templates.md +128 -0
  60. package/.agent/skills/godmode/references/refusal-detection.md +142 -0
  61. package/.agent/skills/hyperframes/SKILL.md +182 -0
  62. package/.agent/skills/hyperframes/references/cli.md +185 -0
  63. package/.agent/skills/hyperframes/references/composition.md +129 -0
  64. package/.agent/skills/hyperframes/references/features.md +289 -0
  65. package/.agent/skills/hyperframes/references/gsap.md +136 -0
  66. package/.agent/skills/hyperframes/references/troubleshooting.md +137 -0
  67. package/.agent/skills/hyperframes/references/website-to-video.md +145 -0
  68. package/.agent/skills/jupyter-live-kernel/SKILL.md +160 -0
  69. package/.agent/skills/kanban-orchestrator/SKILL.md +209 -0
  70. package/.agent/skills/kanban-worker/SKILL.md +188 -0
  71. package/.agent/skills/llm-wiki/SKILL.md +499 -0
  72. package/.agent/skills/meme-generation/SKILL.md +122 -0
  73. package/.agent/skills/node-inspect-debugger/SKILL.md +312 -0
  74. package/.agent/skills/obsidian/SKILL.md +60 -0
  75. package/.agent/skills/osint-investigation/SKILL.md +269 -0
  76. package/.agent/skills/osint-investigation/templates/source-template.md +59 -0
  77. package/.agent/skills/oss-forensics/SKILL.md +422 -0
  78. package/.agent/skills/oss-forensics/references/evidence-types.md +89 -0
  79. package/.agent/skills/oss-forensics/references/github-archive-guide.md +184 -0
  80. package/.agent/skills/oss-forensics/references/investigation-templates.md +131 -0
  81. package/.agent/skills/oss-forensics/references/recovery-techniques.md +164 -0
  82. package/.agent/skills/oss-forensics/templates/forensic-report.md +151 -0
  83. package/.agent/skills/oss-forensics/templates/malicious-package-report.md +43 -0
  84. package/.agent/skills/parallel-cli/SKILL.md +384 -0
  85. package/.agent/skills/pinggy-tunnel/SKILL.md +302 -0
  86. package/.agent/skills/pixel-art/SKILL.md +209 -0
  87. package/.agent/skills/pixel-art/references/palettes.md +49 -0
  88. package/.agent/skills/plan/SKILL.md +331 -0
  89. package/.agent/skills/polymarket/SKILL.md +75 -0
  90. package/.agent/skills/polymarket/references/api-endpoints.md +220 -0
  91. package/.agent/skills/python-debugpy/SKILL.md +368 -0
  92. package/.agent/skills/requesting-code-review/SKILL.md +273 -0
  93. package/.agent/skills/research-paper-writing/SKILL.md +2367 -0
  94. package/.agent/skills/research-paper-writing/references/autoreason-methodology.md +394 -0
  95. package/.agent/skills/research-paper-writing/references/checklists.md +434 -0
  96. package/.agent/skills/research-paper-writing/references/citation-workflow.md +563 -0
  97. package/.agent/skills/research-paper-writing/references/experiment-patterns.md +728 -0
  98. package/.agent/skills/research-paper-writing/references/human-evaluation.md +476 -0
  99. package/.agent/skills/research-paper-writing/references/paper-types.md +481 -0
  100. package/.agent/skills/research-paper-writing/references/reviewer-guidelines.md +433 -0
  101. package/.agent/skills/research-paper-writing/references/sources.md +191 -0
  102. package/.agent/skills/research-paper-writing/references/writing-guide.md +474 -0
  103. package/.agent/skills/research-paper-writing/templates/README.md +251 -0
  104. package/.agent/skills/rest-graphql-debug/SKILL.md +507 -0
  105. package/.agent/skills/s6-container-supervision/SKILL.md +171 -0
  106. package/.agent/skills/scrapling/SKILL.md +328 -0
  107. package/.agent/skills/sherlock/SKILL.md +186 -0
  108. package/.agent/skills/simplify-code/SKILL.md +168 -0
  109. package/.agent/skills/skill-authoring/SKILL.md +158 -0
  110. package/.agent/skills/spike/SKILL.md +190 -0
  111. package/.agent/skills/subagent-driven-development/SKILL.md +345 -0
  112. package/.agent/skills/subagent-driven-development/references/context-budget-discipline.md +53 -0
  113. package/.agent/skills/subagent-driven-development/references/gates-taxonomy.md +93 -0
  114. package/.agent/skills/systematic-debugging/SKILL.md +360 -0
  115. package/.agent/skills/test-driven-development/SKILL.md +336 -0
  116. package/.agent/skills/video-orchestrator/SKILL.md +194 -0
  117. package/.agent/skills/video-orchestrator/references/examples.md +227 -0
  118. package/.agent/skills/video-orchestrator/references/intake.md +166 -0
  119. package/.agent/skills/video-orchestrator/references/kanban-setup.md +278 -0
  120. package/.agent/skills/video-orchestrator/references/monitoring.md +180 -0
  121. package/.agent/skills/video-orchestrator/references/role-archetypes.md +298 -0
  122. package/.agent/skills/video-orchestrator/references/tool-matrix.md +317 -0
  123. package/.agent/skills/web-pentest/SKILL.md +332 -0
  124. package/.agent/skills/web-pentest/references/bypass-techniques.md +133 -0
  125. package/.agent/skills/web-pentest/references/exploitation-techniques.md +204 -0
  126. package/.agent/skills/web-pentest/references/scope-enforcement.md +110 -0
  127. package/.agent/skills/web-pentest/references/vuln-taxonomy.md +81 -0
  128. package/.agent/skills/web-pentest/templates/authorization.md +69 -0
  129. package/.agent/skills/web-pentest/templates/pentest-report.md +178 -0
  130. package/.claude/commands/mindforge/skill-tdd.md +53 -0
  131. package/.claude/commands/mindforge/skills-index.md +118 -0
  132. package/.claude/commands/mindforge/systematic-debug.md +60 -0
  133. package/.mindforge/config.json +2 -2
  134. package/.mindforge/memory/sync-manifest.json +1 -1
  135. package/.mindforge/skills/arxiv/SKILL.md +294 -0
  136. package/.mindforge/skills/blogwatcher/SKILL.md +147 -0
  137. package/.mindforge/skills/code-wiki/SKILL.md +457 -0
  138. package/.mindforge/skills/codebase-inspection/SKILL.md +126 -0
  139. package/.mindforge/skills/concept-diagrams/SKILL.md +373 -0
  140. package/.mindforge/skills/creative-ideation/SKILL.md +162 -0
  141. package/.mindforge/skills/domain-intel/SKILL.md +116 -0
  142. package/.mindforge/skills/duckduckgo-search/SKILL.md +249 -0
  143. package/.mindforge/skills/github-code-review/SKILL.md +493 -0
  144. package/.mindforge/skills/github-issues/SKILL.md +382 -0
  145. package/.mindforge/skills/github-pr-workflow/SKILL.md +379 -0
  146. package/.mindforge/skills/jupyter-live-kernel/SKILL.md +179 -0
  147. package/.mindforge/skills/kanban-orchestrator/SKILL.md +227 -0
  148. package/.mindforge/skills/kanban-worker/SKILL.md +206 -0
  149. package/.mindforge/skills/meme-generation/SKILL.md +141 -0
  150. package/.mindforge/skills/obsidian/SKILL.md +80 -0
  151. package/.mindforge/skills/osint-investigation/SKILL.md +288 -0
  152. package/.mindforge/skills/oss-forensics/SKILL.md +421 -0
  153. package/.mindforge/skills/pixel-art/SKILL.md +228 -0
  154. package/.mindforge/skills/plan/SKILL.md +350 -0
  155. package/.mindforge/skills/requesting-code-review/SKILL.md +292 -0
  156. package/.mindforge/skills/research-paper-writing/SKILL.md +2384 -0
  157. package/.mindforge/skills/scrapling/SKILL.md +345 -0
  158. package/.mindforge/skills/sherlock/SKILL.md +203 -0
  159. package/.mindforge/skills/simplify-code/SKILL.md +187 -0
  160. package/.mindforge/skills/spike/SKILL.md +209 -0
  161. package/.mindforge/skills/subagent-driven-development/SKILL.md +364 -0
  162. package/.mindforge/skills/systematic-debugging/SKILL.md +379 -0
  163. package/.mindforge/skills/test-driven-development/SKILL.md +355 -0
  164. package/.mindforge/skills/web-pentest/SKILL.md +327 -0
  165. package/CHANGELOG.md +43 -0
  166. package/MINDFORGE.md +2 -2
  167. package/README.md +39 -3
  168. package/RELEASENOTES.md +55 -0
  169. package/docs/getting-started.md +42 -5
  170. package/package.json +1 -1
@@ -0,0 +1,379 @@
1
+ ---
2
+ name: github-pr-workflow
3
+ description: "GitHub PR lifecycle: branch, commit, open, CI, merge."
4
+ version: 1.1.0
5
+ status: stable
6
+ min_mindforge_version: 11.5.1
7
+ triggers: github pr workflow, pull request lifecycle, open PR, merge PR, create pull request, github pull request, pr workflow, pr process, pull request process, github merge, submit pull request, pr lifecycle
8
+ ---
9
+
10
+ # GitHub Pull Request Workflow
11
+
12
+ Complete guide for managing the PR lifecycle. Each section shows the `gh` way first, then the `git` + `curl` fallback for machines without `gh`.
13
+
14
+ ## Prerequisites
15
+
16
+ - Authenticated with GitHub (see `github-auth` skill)
17
+ - Inside a git repository with a GitHub remote
18
+
19
+ ### Quick Auth Detection
20
+
21
+ ```bash
22
+ # Determine which method to use throughout this workflow
23
+ if command -v gh &>/dev/null && gh auth status &>/dev/null; then
24
+ AUTH="gh"
25
+ else
26
+ AUTH="git"
27
+ # Ensure we have a token for API calls
28
+ if [ -z "$GITHUB_TOKEN" ]; then
29
+ if _agent_env="${AGENT_HOME:-$HOME/.agent}/.env"; [ -f "$_agent_env" ] && grep -q "^GITHUB_TOKEN=" "$_agent_env"; then
30
+ GITHUB_TOKEN=$(grep "^GITHUB_TOKEN=" "$_agent_env" | head -1 | cut -d= -f2 | tr -d '\n\r')
31
+ elif grep -q "github.com" ~/.git-credentials 2>/dev/null; then
32
+ GITHUB_TOKEN=$(grep "github.com" ~/.git-credentials 2>/dev/null | head -1 | sed 's|https://[^:]*:\([^@]*\)@.*|\1|')
33
+ fi
34
+ fi
35
+ fi
36
+ echo "Using: $AUTH"
37
+ ```
38
+
39
+ ### Extracting Owner/Repo from the Git Remote
40
+
41
+ Many `curl` commands need `owner/repo`. Extract it from the git remote:
42
+
43
+ ```bash
44
+ # Works for both HTTPS and SSH remote URLs
45
+ REMOTE_URL=$(git remote get-url origin)
46
+ OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||')
47
+ OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1)
48
+ REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)
49
+ echo "Owner: $OWNER, Repo: $REPO"
50
+ ```
51
+
52
+ ---
53
+
54
+ ## 1. Branch Creation
55
+
56
+ This part is pure `git` — identical either way:
57
+
58
+ ```bash
59
+ # Make sure you're up to date
60
+ git fetch origin
61
+ git checkout main && git pull origin main
62
+
63
+ # Create and switch to a new branch
64
+ git checkout -b feat/add-user-authentication
65
+ ```
66
+
67
+ Branch naming conventions:
68
+ - `feat/description` — new features
69
+ - `fix/description` — bug fixes
70
+ - `refactor/description` — code restructuring
71
+ - `docs/description` — documentation
72
+ - `ci/description` — CI/CD changes
73
+
74
+ ## 2. Making Commits
75
+
76
+ Use the agent's file tools (`write_file`, `patch`) to make changes, then commit:
77
+
78
+ ```bash
79
+ # Stage specific files
80
+ git add src/auth.py src/models/user.py tests/test_auth.py
81
+
82
+ # Commit with a conventional commit message
83
+ git commit -m "feat: add JWT-based user authentication
84
+
85
+ - Add login/register endpoints
86
+ - Add User model with password hashing
87
+ - Add auth middleware for protected routes
88
+ - Add unit tests for auth flow"
89
+ ```
90
+
91
+ Commit message format (Conventional Commits):
92
+ ```
93
+ type(scope): short description
94
+
95
+ Longer explanation if needed. Wrap at 72 characters.
96
+ ```
97
+
98
+ Types: `feat`, `fix`, `refactor`, `docs`, `test`, `ci`, `chore`, `perf`
99
+
100
+ ## 3. Pushing and Creating a PR
101
+
102
+ ### Push the Branch (same either way)
103
+
104
+ ```bash
105
+ git push -u origin HEAD
106
+ ```
107
+
108
+ ### Create the PR
109
+
110
+ **With gh:**
111
+
112
+ ```bash
113
+ gh pr create \
114
+ --title "feat: add JWT-based user authentication" \
115
+ --body "## Summary
116
+ - Adds login and register API endpoints
117
+ - JWT token generation and validation
118
+
119
+ ## Test Plan
120
+ - [ ] Unit tests pass
121
+
122
+ Closes #42"
123
+ ```
124
+
125
+ Options: `--draft`, `--reviewer user1,user2`, `--label "enhancement"`, `--base develop`
126
+
127
+ **With git + curl:**
128
+
129
+ ```bash
130
+ BRANCH=$(git branch --show-current)
131
+
132
+ curl -s -X POST \
133
+ -H "Authorization: token $GITHUB_TOKEN" \
134
+ -H "Accept: application/vnd.github.v3+json" \
135
+ https://api.github.com/repos/$OWNER/$REPO/pulls \
136
+ -d "{
137
+ \"title\": \"feat: add JWT-based user authentication\",
138
+ \"body\": \"## Summary\nAdds login and register API endpoints.\n\nCloses #42\",
139
+ \"head\": \"$BRANCH\",
140
+ \"base\": \"main\"
141
+ }"
142
+ ```
143
+
144
+ The response JSON includes the PR `number` — save it for later commands.
145
+
146
+ To create as a draft, add `"draft": true` to the JSON body.
147
+
148
+ ## 4. Monitoring CI Status
149
+
150
+ ### Check CI Status
151
+
152
+ **With gh:**
153
+
154
+ ```bash
155
+ # One-shot check
156
+ gh pr checks
157
+
158
+ # Watch until all checks finish (polls every 10s)
159
+ gh pr checks --watch
160
+ ```
161
+
162
+ **With git + curl:**
163
+
164
+ ```bash
165
+ # Get the latest commit SHA on the current branch
166
+ SHA=$(git rev-parse HEAD)
167
+
168
+ # Query the combined status
169
+ curl -s \
170
+ -H "Authorization: token $GITHUB_TOKEN" \
171
+ https://api.github.com/repos/$OWNER/$REPO/commits/$SHA/status \
172
+ | python3 -c "
173
+ import sys, json
174
+ data = json.load(sys.stdin)
175
+ print(f\"Overall: {data['state']}\")
176
+ for s in data.get('statuses', []):
177
+ print(f\" {s['context']}: {s['state']} - {s.get('description', '')}\")"
178
+
179
+ # Also check GitHub Actions check runs (separate endpoint)
180
+ curl -s \
181
+ -H "Authorization: token $GITHUB_TOKEN" \
182
+ https://api.github.com/repos/$OWNER/$REPO/commits/$SHA/check-runs \
183
+ | python3 -c "
184
+ import sys, json
185
+ data = json.load(sys.stdin)
186
+ for cr in data.get('check_runs', []):
187
+ print(f\" {cr['name']}: {cr['status']} / {cr['conclusion'] or 'pending'}\")"
188
+ ```
189
+
190
+ ### Poll Until Complete (git + curl)
191
+
192
+ ```bash
193
+ # Simple polling loop — check every 30 seconds, up to 10 minutes
194
+ SHA=$(git rev-parse HEAD)
195
+ for i in $(seq 1 20); do
196
+ STATUS=$(curl -s \
197
+ -H "Authorization: token $GITHUB_TOKEN" \
198
+ https://api.github.com/repos/$OWNER/$REPO/commits/$SHA/status \
199
+ | python3 -c "import sys,json; print(json.load(sys.stdin)['state'])")
200
+ echo "Check $i: $STATUS"
201
+ if [ "$STATUS" = "success" ] || [ "$STATUS" = "failure" ] || [ "$STATUS" = "error" ]; then
202
+ break
203
+ fi
204
+ sleep 30
205
+ done
206
+ ```
207
+
208
+ ## 5. Auto-Fixing CI Failures
209
+
210
+ When CI fails, diagnose and fix. This loop works with either auth method.
211
+
212
+ ### Step 1: Get Failure Details
213
+
214
+ **With gh:**
215
+
216
+ ```bash
217
+ # List recent workflow runs on this branch
218
+ gh run list --branch $(git branch --show-current) --limit 5
219
+
220
+ # View failed logs
221
+ gh run view <RUN_ID> --log-failed
222
+ ```
223
+
224
+ **With git + curl:**
225
+
226
+ ```bash
227
+ BRANCH=$(git branch --show-current)
228
+
229
+ # List workflow runs on this branch
230
+ curl -s \
231
+ -H "Authorization: token $GITHUB_TOKEN" \
232
+ "https://api.github.com/repos/$OWNER/$REPO/actions/runs?branch=$BRANCH&per_page=5" \
233
+ | python3 -c "
234
+ import sys, json
235
+ runs = json.load(sys.stdin)['workflow_runs']
236
+ for r in runs:
237
+ print(f\"Run {r['id']}: {r['name']} - {r['conclusion'] or r['status']}\")"
238
+
239
+ # Get failed job logs (download as zip, extract, read)
240
+ RUN_ID=<run_id>
241
+ curl -s -L \
242
+ -H "Authorization: token $GITHUB_TOKEN" \
243
+ https://api.github.com/repos/$OWNER/$REPO/actions/runs/$RUN_ID/logs \
244
+ -o /tmp/ci-logs.zip
245
+ cd /tmp && unzip -o ci-logs.zip -d ci-logs && cat ci-logs/*.txt
246
+ ```
247
+
248
+ ### Step 2: Fix and Push
249
+
250
+ After identifying the issue, use file tools (`patch`, `write_file`) to fix it:
251
+
252
+ ```bash
253
+ git add <fixed_files>
254
+ git commit -m "fix: resolve CI failure in <check_name>"
255
+ git push
256
+ ```
257
+
258
+ ### Step 3: Verify
259
+
260
+ Re-check CI status using the commands from Section 4 above.
261
+
262
+ ### Auto-Fix Loop Pattern
263
+
264
+ When asked to auto-fix CI, follow this loop:
265
+
266
+ 1. Check CI status → identify failures
267
+ 2. Read failure logs → understand the error
268
+ 3. Use `read_file` + `patch`/`write_file` → fix the code
269
+ 4. `git add . && git commit -m "fix: ..." && git push`
270
+ 5. Wait for CI → re-check status
271
+ 6. Repeat if still failing (up to 3 attempts, then ask the user)
272
+
273
+ ## 6. Merging
274
+
275
+ **With gh:**
276
+
277
+ ```bash
278
+ # Squash merge + delete branch (cleanest for feature branches)
279
+ gh pr merge --squash --delete-branch
280
+
281
+ # Enable auto-merge (merges when all checks pass)
282
+ gh pr merge --auto --squash --delete-branch
283
+ ```
284
+
285
+ **With git + curl:**
286
+
287
+ ```bash
288
+ PR_NUMBER=<number>
289
+
290
+ # Merge the PR via API (squash)
291
+ curl -s -X PUT \
292
+ -H "Authorization: token $GITHUB_TOKEN" \
293
+ https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER/merge \
294
+ -d "{
295
+ \"merge_method\": \"squash\",
296
+ \"commit_title\": \"feat: add user authentication (#$PR_NUMBER)\"
297
+ }"
298
+
299
+ # Delete the remote branch after merge
300
+ BRANCH=$(git branch --show-current)
301
+ git push origin --delete $BRANCH
302
+
303
+ # Switch back to main locally
304
+ git checkout main && git pull origin main
305
+ git branch -d $BRANCH
306
+ ```
307
+
308
+ Merge methods: `"merge"` (merge commit), `"squash"`, `"rebase"`
309
+
310
+ ### Enable Auto-Merge (curl)
311
+
312
+ ```bash
313
+ # Auto-merge requires the repo to have it enabled in settings.
314
+ # This uses the GraphQL API since REST doesn't support auto-merge.
315
+ PR_NODE_ID=$(curl -s \
316
+ -H "Authorization: token $GITHUB_TOKEN" \
317
+ https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER \
318
+ | python3 -c "import sys,json; print(json.load(sys.stdin)['node_id'])")
319
+
320
+ curl -s -X POST \
321
+ -H "Authorization: token $GITHUB_TOKEN" \
322
+ https://api.github.com/graphql \
323
+ -d "{\"query\": \"mutation { enablePullRequestAutoMerge(input: {pullRequestId: \\\"$PR_NODE_ID\\\", mergeMethod: SQUASH}) { clientMutationId } }\"}"
324
+ ```
325
+
326
+ ## 7. Complete Workflow Example
327
+
328
+ ```bash
329
+ # 1. Start from clean main
330
+ git checkout main && git pull origin main
331
+
332
+ # 2. Branch
333
+ git checkout -b fix/login-redirect-bug
334
+
335
+ # 3. (Agent makes code changes with file tools)
336
+
337
+ # 4. Commit
338
+ git add src/auth/login.py tests/test_login.py
339
+ git commit -m "fix: correct redirect URL after login
340
+
341
+ Preserves the ?next= parameter instead of always redirecting to /dashboard."
342
+
343
+ # 5. Push
344
+ git push -u origin HEAD
345
+
346
+ # 6. Create PR (picks gh or curl based on what's available)
347
+ # ... (see Section 3)
348
+
349
+ # 7. Monitor CI (see Section 4)
350
+
351
+ # 8. Merge when green (see Section 6)
352
+ ```
353
+
354
+ ## Useful PR Commands Reference
355
+
356
+ | Action | gh | git + curl |
357
+ |--------|-----|-----------|
358
+ | 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"` |
359
+ | View PR diff | `gh pr diff` | `git diff main...HEAD` (local) or `curl -H "Accept: application/vnd.github.diff" ...` |
360
+ | Add comment | `gh pr comment N --body "..."` | `curl -X POST .../issues/N/comments -d '{"body":"..."}'` |
361
+ | Request review | `gh pr edit N --add-reviewer user` | `curl -X POST .../pulls/N/requested_reviewers -d '{"reviewers":["user"]}'` |
362
+ | Close PR | `gh pr close N` | `curl -X PATCH .../pulls/N -d '{"state":"closed"}'` |
363
+ | Check out someone's PR | `gh pr checkout N` | `git fetch origin pull/N/head:pr-N && git checkout pr-N` |
364
+
365
+ ## Mandatory actions when this skill is active
366
+
367
+ Before applying this skill:
368
+ - [ ] Read the task requirements fully before acting
369
+ - [ ] Confirm you understand the goal and constraints
370
+ - [ ] Check for existing work or prior context in the codebase
371
+
372
+ While working:
373
+ - [ ] Follow the methodology described above step by step
374
+ - [ ] Document any decisions or findings as you go
375
+
376
+ After completing:
377
+ - [ ] Self-check: does the output satisfy the original requirement?
378
+ - [ ] Verify no regressions or unintended side effects
379
+
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: jupyter-live-kernel
3
+ description: "Iterative Python via live Jupyter kernel (hamelnb)."
4
+ version: 1.0.0
5
+ status: stable
6
+ min_mindforge_version: 11.5.1
7
+ triggers: jupyter kernel, live jupyter, run jupyter, interactive notebook, jupyter notebook, jupyter live, notebook kernel, run notebook, jupyter interactive, live kernel, notebook execution, jupyter execution
8
+ ---
9
+
10
+ # Jupyter Live Kernel (hamelnb)
11
+
12
+ Gives you a **stateful Python REPL** via a live Jupyter kernel. Variables persist
13
+ across executions. Use this instead of `execute_code` when you need to build up
14
+ state incrementally, explore APIs, inspect DataFrames, or iterate on complex code.
15
+
16
+ ## When to Use This vs Other Tools
17
+
18
+ | Tool | Use When |
19
+ |------|----------|
20
+ | **This skill** | Iterative exploration, state across steps, data science, ML, "let me try this and check" |
21
+ | `execute_code` | One-shot scripts needing hermes tool access (web_search, file ops). Stateless. |
22
+ | `terminal` | Shell commands, builds, installs, git, process management |
23
+
24
+ **Rule of thumb:** If you'd want a Jupyter notebook for the task, use this skill.
25
+
26
+ ## Prerequisites
27
+
28
+ 1. **uv** must be installed (check: `which uv`)
29
+ 2. **JupyterLab** must be installed: `uv tool install jupyterlab`
30
+ 3. A Jupyter server must be running (see Setup below)
31
+
32
+ ## Setup
33
+
34
+ The hamelnb script location:
35
+ ```
36
+ SCRIPT="$HOME/.agent-skills/hamelnb/skills/jupyter-live-kernel/scripts/jupyter_live_kernel.py"
37
+ ```
38
+
39
+ If not cloned yet:
40
+ ```
41
+ git clone https://github.com/hamelsmu/hamelnb.git ~/.agent-skills/hamelnb
42
+ ```
43
+
44
+ ### Starting JupyterLab
45
+
46
+ Check if a server is already running:
47
+ ```
48
+ uv run "$SCRIPT" servers
49
+ ```
50
+
51
+ If no servers found, start one:
52
+ ```
53
+ jupyter-lab --no-browser --port=8888 --notebook-dir=$HOME/notebooks \
54
+ --IdentityProvider.token='' --ServerApp.password='' > /tmp/jupyter.log 2>&1 &
55
+ sleep 3
56
+ ```
57
+
58
+ Note: Token/password disabled for local agent access. The server runs headless.
59
+
60
+ ### Creating a Notebook for REPL Use
61
+
62
+ If you just need a REPL (no existing notebook), create a minimal notebook file:
63
+ ```
64
+ mkdir -p ~/notebooks
65
+ ```
66
+ Write a minimal .ipynb JSON file with one empty code cell, then start a kernel
67
+ session via the Jupyter REST API:
68
+ ```
69
+ curl -s -X POST http://127.0.0.1:8888/api/sessions \
70
+ -H "Content-Type: application/json" \
71
+ -d '{"path":"scratch.ipynb","type":"notebook","name":"scratch.ipynb","kernel":{"name":"python3"}}'
72
+ ```
73
+
74
+ ## Core Workflow
75
+
76
+ All commands return structured JSON. Always use `--compact` to save tokens.
77
+
78
+ ### 1. Discover servers and notebooks
79
+
80
+ ```
81
+ uv run "$SCRIPT" servers --compact
82
+ uv run "$SCRIPT" notebooks --compact
83
+ ```
84
+
85
+ ### 2. Execute code (primary operation)
86
+
87
+ ```
88
+ uv run "$SCRIPT" execute --path <notebook.ipynb> --code '<python code>' --compact
89
+ ```
90
+
91
+ State persists across execute calls. Variables, imports, objects all survive.
92
+
93
+ Multi-line code works with $'...' quoting:
94
+ ```
95
+ uv run "$SCRIPT" execute --path scratch.ipynb --code $'import os\nfiles = os.listdir(".")\nprint(f"Found {len(files)} files")' --compact
96
+ ```
97
+
98
+ ### 3. Inspect live variables
99
+
100
+ ```
101
+ uv run "$SCRIPT" variables --path <notebook.ipynb> list --compact
102
+ uv run "$SCRIPT" variables --path <notebook.ipynb> preview --name <varname> --compact
103
+ ```
104
+
105
+ ### 4. Edit notebook cells
106
+
107
+ ```
108
+ # View current cells
109
+ uv run "$SCRIPT" contents --path <notebook.ipynb> --compact
110
+
111
+ # Insert a new cell
112
+ uv run "$SCRIPT" edit --path <notebook.ipynb> insert \
113
+ --at-index <N> --cell-type code --source '<code>' --compact
114
+
115
+ # Replace cell source (use cell-id from contents output)
116
+ uv run "$SCRIPT" edit --path <notebook.ipynb> replace-source \
117
+ --cell-id <id> --source '<new code>' --compact
118
+
119
+ # Delete a cell
120
+ uv run "$SCRIPT" edit --path <notebook.ipynb> delete --cell-id <id> --compact
121
+ ```
122
+
123
+ ### 5. Verification (restart + run all)
124
+
125
+ Only use when the user asks for a clean verification or you need to confirm
126
+ the notebook runs top-to-bottom:
127
+
128
+ ```
129
+ uv run "$SCRIPT" restart-run-all --path <notebook.ipynb> --save-outputs --compact
130
+ ```
131
+
132
+ ## Practical Tips from Experience
133
+
134
+ 1. **First execution after server start may timeout** — the kernel needs a moment
135
+ to initialize. If you get a timeout, just retry.
136
+
137
+ 2. **The kernel Python is JupyterLab's Python** — packages must be installed in
138
+ that environment. If you need additional packages, install them into the
139
+ JupyterLab tool environment first.
140
+
141
+ 3. **--compact flag saves significant tokens** — always use it. JSON output can
142
+ be very verbose without it.
143
+
144
+ 4. **For pure REPL use**, create a scratch.ipynb and don't bother with cell editing.
145
+ Just use `execute` repeatedly.
146
+
147
+ 5. **Argument order matters** — subcommand flags like `--path` go BEFORE the
148
+ sub-subcommand. E.g.: `variables --path nb.ipynb list` not `variables list --path nb.ipynb`.
149
+
150
+ 6. **If a session doesn't exist yet**, you need to start one via the REST API
151
+ (see Setup section). The tool can't execute without a live kernel session.
152
+
153
+ 7. **Errors are returned as JSON** with traceback — read the `ename` and `evalue`
154
+ fields to understand what went wrong.
155
+
156
+ 8. **Occasional websocket timeouts** — some operations may timeout on first try,
157
+ especially after a kernel restart. Retry once before escalating.
158
+
159
+ ## Timeout Defaults
160
+
161
+ The script has a 30-second default timeout per execution. For long-running
162
+ operations, pass `--timeout 120`. Use generous timeouts (60+) for initial
163
+ setup or heavy computation.
164
+
165
+ ## Mandatory actions when this skill is active
166
+
167
+ Before applying this skill:
168
+ - [ ] Read the task requirements fully before acting
169
+ - [ ] Confirm you understand the goal and constraints
170
+ - [ ] Check for existing work or prior context in the codebase
171
+
172
+ While working:
173
+ - [ ] Follow the methodology described above step by step
174
+ - [ ] Document any decisions or findings as you go
175
+
176
+ After completing:
177
+ - [ ] Self-check: does the output satisfy the original requirement?
178
+ - [ ] Verify no regressions or unintended side effects
179
+