mindforge-cc 11.5.1 → 11.7.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 (214) 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/mindforge/wf-catalog.md +37 -0
  5. package/.agent/mindforge/wf-code-audit.md +31 -0
  6. package/.agent/mindforge/wf-competitive-analysis.md +31 -0
  7. package/.agent/mindforge/wf-deep-research.md +32 -0
  8. package/.agent/mindforge/wf-feature-planner.md +31 -0
  9. package/.agent/mindforge/wf-incident-response.md +31 -0
  10. package/.agent/mindforge/wf-onboard-codebase.md +31 -0
  11. package/.agent/mindforge/wf-perf-optimize.md +31 -0
  12. package/.agent/mindforge/wf-pr-review.md +31 -0
  13. package/.agent/mindforge/wf-refactor-plan.md +31 -0
  14. package/.agent/mindforge/wf-release-prep.md +31 -0
  15. package/.agent/mindforge/wf-tdd-sprint.md +31 -0
  16. package/.agent/mindforge/wf-tech-evaluation.md +31 -0
  17. package/.agent/skills/1password-skill/SKILL.md +156 -0
  18. package/.agent/skills/1password-skill/references/cli-examples.md +31 -0
  19. package/.agent/skills/1password-skill/references/get-started.md +21 -0
  20. package/.agent/skills/article-illustrator/SKILL.md +199 -0
  21. package/.agent/skills/article-illustrator/references/prompt-construction.md +426 -0
  22. package/.agent/skills/article-illustrator/references/style-presets.md +80 -0
  23. package/.agent/skills/article-illustrator/references/styles.md +224 -0
  24. package/.agent/skills/article-illustrator/references/usage.md +50 -0
  25. package/.agent/skills/article-illustrator/references/workflow.md +332 -0
  26. package/.agent/skills/arxiv/SKILL.md +275 -0
  27. package/.agent/skills/blogwatcher/SKILL.md +130 -0
  28. package/.agent/skills/code-wiki/SKILL.md +438 -0
  29. package/.agent/skills/code-wiki/templates/README.md +31 -0
  30. package/.agent/skills/code-wiki/templates/architecture.md +30 -0
  31. package/.agent/skills/code-wiki/templates/getting-started.md +47 -0
  32. package/.agent/skills/code-wiki/templates/module.md +38 -0
  33. package/.agent/skills/codebase-inspection/SKILL.md +109 -0
  34. package/.agent/skills/comic-creator/SKILL.md +240 -0
  35. package/.agent/skills/comic-creator/references/analysis-framework.md +176 -0
  36. package/.agent/skills/comic-creator/references/auto-selection.md +71 -0
  37. package/.agent/skills/comic-creator/references/base-prompt.md +98 -0
  38. package/.agent/skills/comic-creator/references/character-template.md +180 -0
  39. package/.agent/skills/comic-creator/references/ohmsha-guide.md +85 -0
  40. package/.agent/skills/comic-creator/references/partial-workflows.md +106 -0
  41. package/.agent/skills/comic-creator/references/storyboard-template.md +143 -0
  42. package/.agent/skills/comic-creator/references/workflow.md +401 -0
  43. package/.agent/skills/concept-diagrams/SKILL.md +355 -0
  44. package/.agent/skills/concept-diagrams/references/dashboard-patterns.md +43 -0
  45. package/.agent/skills/concept-diagrams/references/infrastructure-patterns.md +144 -0
  46. package/.agent/skills/concept-diagrams/references/physical-shape-cookbook.md +42 -0
  47. package/.agent/skills/creative-ideation/SKILL.md +144 -0
  48. package/.agent/skills/creative-ideation/references/full-prompt-library.md +110 -0
  49. package/.agent/skills/devops-cli/SKILL.md +149 -0
  50. package/.agent/skills/devops-cli/references/app-discovery.md +112 -0
  51. package/.agent/skills/devops-cli/references/authentication.md +59 -0
  52. package/.agent/skills/devops-cli/references/cli-reference.md +104 -0
  53. package/.agent/skills/devops-cli/references/running-apps.md +171 -0
  54. package/.agent/skills/devops-watchers/SKILL.md +103 -0
  55. package/.agent/skills/docker-management/SKILL.md +273 -0
  56. package/.agent/skills/domain-intel/SKILL.md +96 -0
  57. package/.agent/skills/duckduckgo-search/SKILL.md +230 -0
  58. package/.agent/skills/github-auth/SKILL.md +240 -0
  59. package/.agent/skills/github-code-review/SKILL.md +474 -0
  60. package/.agent/skills/github-code-review/references/review-output-template.md +74 -0
  61. package/.agent/skills/github-issues/SKILL.md +363 -0
  62. package/.agent/skills/github-issues/templates/bug-report.md +35 -0
  63. package/.agent/skills/github-issues/templates/feature-request.md +31 -0
  64. package/.agent/skills/github-pr-workflow/SKILL.md +360 -0
  65. package/.agent/skills/github-pr-workflow/references/ci-troubleshooting.md +183 -0
  66. package/.agent/skills/github-pr-workflow/references/conventional-commits.md +71 -0
  67. package/.agent/skills/github-pr-workflow/templates/pr-body-bugfix.md +35 -0
  68. package/.agent/skills/github-pr-workflow/templates/pr-body-feature.md +33 -0
  69. package/.agent/skills/github-repo-management/SKILL.md +509 -0
  70. package/.agent/skills/github-repo-management/references/github-api-cheatsheet.md +161 -0
  71. package/.agent/skills/godmode/SKILL.md +396 -0
  72. package/.agent/skills/godmode/references/jailbreak-templates.md +128 -0
  73. package/.agent/skills/godmode/references/refusal-detection.md +142 -0
  74. package/.agent/skills/hyperframes/SKILL.md +182 -0
  75. package/.agent/skills/hyperframes/references/cli.md +185 -0
  76. package/.agent/skills/hyperframes/references/composition.md +129 -0
  77. package/.agent/skills/hyperframes/references/features.md +289 -0
  78. package/.agent/skills/hyperframes/references/gsap.md +136 -0
  79. package/.agent/skills/hyperframes/references/troubleshooting.md +137 -0
  80. package/.agent/skills/hyperframes/references/website-to-video.md +145 -0
  81. package/.agent/skills/jupyter-live-kernel/SKILL.md +160 -0
  82. package/.agent/skills/kanban-orchestrator/SKILL.md +209 -0
  83. package/.agent/skills/kanban-worker/SKILL.md +188 -0
  84. package/.agent/skills/llm-wiki/SKILL.md +499 -0
  85. package/.agent/skills/meme-generation/SKILL.md +122 -0
  86. package/.agent/skills/node-inspect-debugger/SKILL.md +312 -0
  87. package/.agent/skills/obsidian/SKILL.md +60 -0
  88. package/.agent/skills/osint-investigation/SKILL.md +269 -0
  89. package/.agent/skills/osint-investigation/templates/source-template.md +59 -0
  90. package/.agent/skills/oss-forensics/SKILL.md +422 -0
  91. package/.agent/skills/oss-forensics/references/evidence-types.md +89 -0
  92. package/.agent/skills/oss-forensics/references/github-archive-guide.md +184 -0
  93. package/.agent/skills/oss-forensics/references/investigation-templates.md +131 -0
  94. package/.agent/skills/oss-forensics/references/recovery-techniques.md +164 -0
  95. package/.agent/skills/oss-forensics/templates/forensic-report.md +151 -0
  96. package/.agent/skills/oss-forensics/templates/malicious-package-report.md +43 -0
  97. package/.agent/skills/parallel-cli/SKILL.md +384 -0
  98. package/.agent/skills/pinggy-tunnel/SKILL.md +302 -0
  99. package/.agent/skills/pixel-art/SKILL.md +209 -0
  100. package/.agent/skills/pixel-art/references/palettes.md +49 -0
  101. package/.agent/skills/plan/SKILL.md +331 -0
  102. package/.agent/skills/polymarket/SKILL.md +75 -0
  103. package/.agent/skills/polymarket/references/api-endpoints.md +220 -0
  104. package/.agent/skills/python-debugpy/SKILL.md +368 -0
  105. package/.agent/skills/requesting-code-review/SKILL.md +273 -0
  106. package/.agent/skills/research-paper-writing/SKILL.md +2367 -0
  107. package/.agent/skills/research-paper-writing/references/autoreason-methodology.md +394 -0
  108. package/.agent/skills/research-paper-writing/references/checklists.md +434 -0
  109. package/.agent/skills/research-paper-writing/references/citation-workflow.md +563 -0
  110. package/.agent/skills/research-paper-writing/references/experiment-patterns.md +728 -0
  111. package/.agent/skills/research-paper-writing/references/human-evaluation.md +476 -0
  112. package/.agent/skills/research-paper-writing/references/paper-types.md +481 -0
  113. package/.agent/skills/research-paper-writing/references/reviewer-guidelines.md +433 -0
  114. package/.agent/skills/research-paper-writing/references/sources.md +191 -0
  115. package/.agent/skills/research-paper-writing/references/writing-guide.md +474 -0
  116. package/.agent/skills/research-paper-writing/templates/README.md +251 -0
  117. package/.agent/skills/rest-graphql-debug/SKILL.md +507 -0
  118. package/.agent/skills/s6-container-supervision/SKILL.md +171 -0
  119. package/.agent/skills/scrapling/SKILL.md +328 -0
  120. package/.agent/skills/sherlock/SKILL.md +186 -0
  121. package/.agent/skills/simplify-code/SKILL.md +168 -0
  122. package/.agent/skills/skill-authoring/SKILL.md +158 -0
  123. package/.agent/skills/spike/SKILL.md +190 -0
  124. package/.agent/skills/subagent-driven-development/SKILL.md +345 -0
  125. package/.agent/skills/subagent-driven-development/references/context-budget-discipline.md +53 -0
  126. package/.agent/skills/subagent-driven-development/references/gates-taxonomy.md +93 -0
  127. package/.agent/skills/systematic-debugging/SKILL.md +360 -0
  128. package/.agent/skills/test-driven-development/SKILL.md +336 -0
  129. package/.agent/skills/video-orchestrator/SKILL.md +194 -0
  130. package/.agent/skills/video-orchestrator/references/examples.md +227 -0
  131. package/.agent/skills/video-orchestrator/references/intake.md +166 -0
  132. package/.agent/skills/video-orchestrator/references/kanban-setup.md +278 -0
  133. package/.agent/skills/video-orchestrator/references/monitoring.md +180 -0
  134. package/.agent/skills/video-orchestrator/references/role-archetypes.md +298 -0
  135. package/.agent/skills/video-orchestrator/references/tool-matrix.md +317 -0
  136. package/.agent/skills/web-pentest/SKILL.md +332 -0
  137. package/.agent/skills/web-pentest/references/bypass-techniques.md +133 -0
  138. package/.agent/skills/web-pentest/references/exploitation-techniques.md +204 -0
  139. package/.agent/skills/web-pentest/references/scope-enforcement.md +110 -0
  140. package/.agent/skills/web-pentest/references/vuln-taxonomy.md +81 -0
  141. package/.agent/skills/web-pentest/templates/authorization.md +69 -0
  142. package/.agent/skills/web-pentest/templates/pentest-report.md +178 -0
  143. package/.claude/commands/mindforge/skill-tdd.md +53 -0
  144. package/.claude/commands/mindforge/skills-index.md +118 -0
  145. package/.claude/commands/mindforge/systematic-debug.md +60 -0
  146. package/.claude/commands/mindforge/wf-catalog.md +37 -0
  147. package/.claude/commands/mindforge/wf-code-audit.md +31 -0
  148. package/.claude/commands/mindforge/wf-competitive-analysis.md +31 -0
  149. package/.claude/commands/mindforge/wf-deep-research.md +32 -0
  150. package/.claude/commands/mindforge/wf-feature-planner.md +31 -0
  151. package/.claude/commands/mindforge/wf-incident-response.md +31 -0
  152. package/.claude/commands/mindforge/wf-onboard-codebase.md +31 -0
  153. package/.claude/commands/mindforge/wf-perf-optimize.md +31 -0
  154. package/.claude/commands/mindforge/wf-pr-review.md +31 -0
  155. package/.claude/commands/mindforge/wf-refactor-plan.md +31 -0
  156. package/.claude/commands/mindforge/wf-release-prep.md +31 -0
  157. package/.claude/commands/mindforge/wf-tdd-sprint.md +31 -0
  158. package/.claude/commands/mindforge/wf-tech-evaluation.md +31 -0
  159. package/.mindforge/config.json +2 -2
  160. package/.mindforge/dynamic-workflows/REGISTRY.md +65 -0
  161. package/.mindforge/dynamic-workflows/index.json +171 -0
  162. package/.mindforge/dynamic-workflows/scripts/code-audit.js +103 -0
  163. package/.mindforge/dynamic-workflows/scripts/competitive-analysis.js +85 -0
  164. package/.mindforge/dynamic-workflows/scripts/deep-research.js +151 -0
  165. package/.mindforge/dynamic-workflows/scripts/feature-planner.js +104 -0
  166. package/.mindforge/dynamic-workflows/scripts/incident-response.js +106 -0
  167. package/.mindforge/dynamic-workflows/scripts/onboard-codebase.js +102 -0
  168. package/.mindforge/dynamic-workflows/scripts/perf-optimize.js +128 -0
  169. package/.mindforge/dynamic-workflows/scripts/pr-review.js +87 -0
  170. package/.mindforge/dynamic-workflows/scripts/refactor-plan.js +121 -0
  171. package/.mindforge/dynamic-workflows/scripts/release-prep.js +102 -0
  172. package/.mindforge/dynamic-workflows/scripts/tdd-sprint.js +103 -0
  173. package/.mindforge/dynamic-workflows/scripts/tech-evaluation.js +72 -0
  174. package/.mindforge/memory/sync-manifest.json +1 -1
  175. package/.mindforge/skills/arxiv/SKILL.md +294 -0
  176. package/.mindforge/skills/blogwatcher/SKILL.md +147 -0
  177. package/.mindforge/skills/code-wiki/SKILL.md +457 -0
  178. package/.mindforge/skills/codebase-inspection/SKILL.md +126 -0
  179. package/.mindforge/skills/concept-diagrams/SKILL.md +373 -0
  180. package/.mindforge/skills/creative-ideation/SKILL.md +162 -0
  181. package/.mindforge/skills/domain-intel/SKILL.md +116 -0
  182. package/.mindforge/skills/duckduckgo-search/SKILL.md +249 -0
  183. package/.mindforge/skills/github-code-review/SKILL.md +493 -0
  184. package/.mindforge/skills/github-issues/SKILL.md +382 -0
  185. package/.mindforge/skills/github-pr-workflow/SKILL.md +379 -0
  186. package/.mindforge/skills/jupyter-live-kernel/SKILL.md +179 -0
  187. package/.mindforge/skills/kanban-orchestrator/SKILL.md +227 -0
  188. package/.mindforge/skills/kanban-worker/SKILL.md +206 -0
  189. package/.mindforge/skills/meme-generation/SKILL.md +141 -0
  190. package/.mindforge/skills/obsidian/SKILL.md +80 -0
  191. package/.mindforge/skills/osint-investigation/SKILL.md +288 -0
  192. package/.mindforge/skills/oss-forensics/SKILL.md +421 -0
  193. package/.mindforge/skills/pixel-art/SKILL.md +228 -0
  194. package/.mindforge/skills/plan/SKILL.md +350 -0
  195. package/.mindforge/skills/requesting-code-review/SKILL.md +292 -0
  196. package/.mindforge/skills/research-paper-writing/SKILL.md +2384 -0
  197. package/.mindforge/skills/scrapling/SKILL.md +345 -0
  198. package/.mindforge/skills/sherlock/SKILL.md +203 -0
  199. package/.mindforge/skills/simplify-code/SKILL.md +187 -0
  200. package/.mindforge/skills/spike/SKILL.md +209 -0
  201. package/.mindforge/skills/subagent-driven-development/SKILL.md +364 -0
  202. package/.mindforge/skills/systematic-debugging/SKILL.md +379 -0
  203. package/.mindforge/skills/test-driven-development/SKILL.md +355 -0
  204. package/.mindforge/skills/web-pentest/SKILL.md +327 -0
  205. package/CHANGELOG.md +71 -0
  206. package/MINDFORGE.md +2 -2
  207. package/README.md +72 -3
  208. package/RELEASENOTES.md +109 -0
  209. package/bin/installer-core.js +6 -2
  210. package/bin/mindforge-cli.js +7 -0
  211. package/bin/workflows/workflow-runner.js +110 -0
  212. package/docs/commands-reference.md +25 -0
  213. package/docs/getting-started.md +42 -5
  214. package/package.json +2 -1
@@ -0,0 +1,509 @@
1
+ ---
2
+ name: github-repo-management
3
+ description: "Clone/create/fork repos; manage remotes, releases."
4
+ version: 1.1.0
5
+ ---
6
+
7
+ # GitHub Repository Management
8
+
9
+ Create, clone, fork, configure, and manage GitHub repositories. Each section shows `gh` first, then the `git` + `curl` fallback.
10
+
11
+ ## Prerequisites
12
+
13
+ - Authenticated with GitHub (see `github-auth` skill)
14
+
15
+ ### Setup
16
+
17
+ ```bash
18
+ if command -v gh &>/dev/null && gh auth status &>/dev/null; then
19
+ AUTH="gh"
20
+ else
21
+ AUTH="git"
22
+ if [ -z "$GITHUB_TOKEN" ]; then
23
+ if _agent_env="${AGENT_HOME:-$HOME/.agent}/.env"; [ -f "$_agent_env" ] && grep -q "^GITHUB_TOKEN=" "$_agent_env"; then
24
+ GITHUB_TOKEN=$(grep "^GITHUB_TOKEN=" "$_agent_env" | head -1 | cut -d= -f2 | tr -d '\n\r')
25
+ elif grep -q "github.com" ~/.git-credentials 2>/dev/null; then
26
+ GITHUB_TOKEN=$(grep "github.com" ~/.git-credentials 2>/dev/null | head -1 | sed 's|https://[^:]*:\([^@]*\)@.*|\1|')
27
+ fi
28
+ fi
29
+ fi
30
+
31
+ # Get your GitHub username (needed for several operations)
32
+ if [ "$AUTH" = "gh" ]; then
33
+ GH_USER=$(gh api user --jq '.login')
34
+ else
35
+ GH_USER=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user | python3 -c "import sys,json; print(json.load(sys.stdin)['login'])")
36
+ fi
37
+ ```
38
+
39
+ If you're inside a repo already:
40
+
41
+ ```bash
42
+ REMOTE_URL=$(git remote get-url origin)
43
+ OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||')
44
+ OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1)
45
+ REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)
46
+ ```
47
+
48
+ ---
49
+
50
+ ## 1. Cloning Repositories
51
+
52
+ Cloning is pure `git` — works identically either way:
53
+
54
+ ```bash
55
+ # Clone via HTTPS (works with credential helper or token-embedded URL)
56
+ git clone https://github.com/owner/repo-name.git
57
+
58
+ # Clone into a specific directory
59
+ git clone https://github.com/owner/repo-name.git ./my-local-dir
60
+
61
+ # Shallow clone (faster for large repos)
62
+ git clone --depth 1 https://github.com/owner/repo-name.git
63
+
64
+ # Clone a specific branch
65
+ git clone --branch develop https://github.com/owner/repo-name.git
66
+
67
+ # Clone via SSH (if SSH is configured)
68
+ git clone git@github.com:owner/repo-name.git
69
+ ```
70
+
71
+ **With gh (shorthand):**
72
+
73
+ ```bash
74
+ gh repo clone owner/repo-name
75
+ gh repo clone owner/repo-name -- --depth 1
76
+ ```
77
+
78
+ ## 2. Creating Repositories
79
+
80
+ **With gh:**
81
+
82
+ ```bash
83
+ # Create a public repo and clone it
84
+ gh repo create my-new-project --public --clone
85
+
86
+ # Private, with description and license
87
+ gh repo create my-new-project --private --description "A useful tool" --license MIT --clone
88
+
89
+ # Under an organization
90
+ gh repo create my-org/my-new-project --public --clone
91
+
92
+ # From existing local directory
93
+ cd /path/to/existing/project
94
+ gh repo create my-project --source . --public --push
95
+ ```
96
+
97
+ **With git + curl:**
98
+
99
+ ```bash
100
+ # Create the remote repo via API
101
+ curl -s -X POST \
102
+ -H "Authorization: token $GITHUB_TOKEN" \
103
+ https://api.github.com/user/repos \
104
+ -d '{
105
+ "name": "my-new-project",
106
+ "description": "A useful tool",
107
+ "private": false,
108
+ "auto_init": true,
109
+ "license_template": "mit"
110
+ }'
111
+
112
+ # Clone it
113
+ git clone https://github.com/$GH_USER/my-new-project.git
114
+ cd my-new-project
115
+
116
+ # -- OR -- push an existing local directory to the new repo
117
+ cd /path/to/existing/project
118
+ git init
119
+ git add .
120
+ git commit -m "Initial commit"
121
+ git remote add origin https://github.com/$GH_USER/my-new-project.git
122
+ git push -u origin main
123
+ ```
124
+
125
+ To create under an organization:
126
+
127
+ ```bash
128
+ curl -s -X POST \
129
+ -H "Authorization: token $GITHUB_TOKEN" \
130
+ https://api.github.com/orgs/my-org/repos \
131
+ -d '{"name": "my-new-project", "private": false}'
132
+ ```
133
+
134
+ ### From a Template
135
+
136
+ **With gh:**
137
+
138
+ ```bash
139
+ gh repo create my-new-app --template owner/template-repo --public --clone
140
+ ```
141
+
142
+ **With curl:**
143
+
144
+ ```bash
145
+ curl -s -X POST \
146
+ -H "Authorization: token $GITHUB_TOKEN" \
147
+ https://api.github.com/repos/owner/template-repo/generate \
148
+ -d '{"owner": "'"$GH_USER"'", "name": "my-new-app", "private": false}'
149
+ ```
150
+
151
+ ## 3. Forking Repositories
152
+
153
+ **With gh:**
154
+
155
+ ```bash
156
+ gh repo fork owner/repo-name --clone
157
+ ```
158
+
159
+ **With git + curl:**
160
+
161
+ ```bash
162
+ # Create the fork via API
163
+ curl -s -X POST \
164
+ -H "Authorization: token $GITHUB_TOKEN" \
165
+ https://api.github.com/repos/owner/repo-name/forks
166
+
167
+ # Wait a moment for GitHub to create it, then clone
168
+ sleep 3
169
+ git clone https://github.com/$GH_USER/repo-name.git
170
+ cd repo-name
171
+
172
+ # Add the original repo as "upstream" remote
173
+ git remote add upstream https://github.com/owner/repo-name.git
174
+ ```
175
+
176
+ ### Keeping a Fork in Sync
177
+
178
+ ```bash
179
+ # Pure git — works everywhere
180
+ git fetch upstream
181
+ git checkout main
182
+ git merge upstream/main
183
+ git push origin main
184
+ ```
185
+
186
+ **With gh (shortcut):**
187
+
188
+ ```bash
189
+ gh repo sync $GH_USER/repo-name
190
+ ```
191
+
192
+ ## 4. Repository Information
193
+
194
+ **With gh:**
195
+
196
+ ```bash
197
+ gh repo view owner/repo-name
198
+ gh repo list --limit 20
199
+ gh search repos "machine learning" --language python --sort stars
200
+ ```
201
+
202
+ **With curl:**
203
+
204
+ ```bash
205
+ # View repo details
206
+ curl -s \
207
+ -H "Authorization: token $GITHUB_TOKEN" \
208
+ https://api.github.com/repos/$OWNER/$REPO \
209
+ | python3 -c "
210
+ import sys, json
211
+ r = json.load(sys.stdin)
212
+ print(f\"Name: {r['full_name']}\")
213
+ print(f\"Description: {r['description']}\")
214
+ print(f\"Stars: {r['stargazers_count']} Forks: {r['forks_count']}\")
215
+ print(f\"Default branch: {r['default_branch']}\")
216
+ print(f\"Language: {r['language']}\")"
217
+
218
+ # List your repos
219
+ curl -s \
220
+ -H "Authorization: token $GITHUB_TOKEN" \
221
+ "https://api.github.com/user/repos?per_page=20&sort=updated" \
222
+ | python3 -c "
223
+ import sys, json
224
+ for r in json.load(sys.stdin):
225
+ vis = 'private' if r['private'] else 'public'
226
+ print(f\" {r['full_name']:40} {vis:8} {r.get('language', ''):10} ★{r['stargazers_count']}\")"
227
+
228
+ # Search repos
229
+ curl -s \
230
+ "https://api.github.com/search/repositories?q=machine+learning+language:python&sort=stars&per_page=10" \
231
+ | python3 -c "
232
+ import sys, json
233
+ for r in json.load(sys.stdin)['items']:
234
+ print(f\" {r['full_name']:40} ★{r['stargazers_count']:6} {r['description'][:60] if r['description'] else ''}\")"
235
+ ```
236
+
237
+ ## 5. Repository Settings
238
+
239
+ **With gh:**
240
+
241
+ ```bash
242
+ gh repo edit --description "Updated description" --visibility public
243
+ gh repo edit --enable-wiki=false --enable-issues=true
244
+ gh repo edit --default-branch main
245
+ gh repo edit --add-topic "machine-learning,python"
246
+ gh repo edit --enable-auto-merge
247
+ ```
248
+
249
+ **With curl:**
250
+
251
+ ```bash
252
+ curl -s -X PATCH \
253
+ -H "Authorization: token $GITHUB_TOKEN" \
254
+ https://api.github.com/repos/$OWNER/$REPO \
255
+ -d '{
256
+ "description": "Updated description",
257
+ "has_wiki": false,
258
+ "has_issues": true,
259
+ "allow_auto_merge": true
260
+ }'
261
+
262
+ # Update topics
263
+ curl -s -X PUT \
264
+ -H "Authorization: token $GITHUB_TOKEN" \
265
+ -H "Accept: application/vnd.github.mercy-preview+json" \
266
+ https://api.github.com/repos/$OWNER/$REPO/topics \
267
+ -d '{"names": ["machine-learning", "python", "automation"]}'
268
+ ```
269
+
270
+ ## 6. Branch Protection
271
+
272
+ ```bash
273
+ # View current protection
274
+ curl -s \
275
+ -H "Authorization: token $GITHUB_TOKEN" \
276
+ https://api.github.com/repos/$OWNER/$REPO/branches/main/protection
277
+
278
+ # Set up branch protection
279
+ curl -s -X PUT \
280
+ -H "Authorization: token $GITHUB_TOKEN" \
281
+ https://api.github.com/repos/$OWNER/$REPO/branches/main/protection \
282
+ -d '{
283
+ "required_status_checks": {
284
+ "strict": true,
285
+ "contexts": ["ci/test", "ci/lint"]
286
+ },
287
+ "enforce_admins": false,
288
+ "required_pull_request_reviews": {
289
+ "required_approving_review_count": 1
290
+ },
291
+ "restrictions": null
292
+ }'
293
+ ```
294
+
295
+ ## 7. Secrets Management (GitHub Actions)
296
+
297
+ **With gh:**
298
+
299
+ ```bash
300
+ gh secret set API_KEY --body "your-secret-value"
301
+ gh secret set SSH_KEY < ~/.ssh/id_rsa
302
+ gh secret list
303
+ gh secret delete API_KEY
304
+ ```
305
+
306
+ **With curl:**
307
+
308
+ Secrets require encryption with the repo's public key — more involved via API:
309
+
310
+ ```bash
311
+ # Get the repo's public key for encrypting secrets
312
+ curl -s \
313
+ -H "Authorization: token $GITHUB_TOKEN" \
314
+ https://api.github.com/repos/$OWNER/$REPO/actions/secrets/public-key
315
+
316
+ # Encrypt and set (requires Python with PyNaCl)
317
+ python3 -c "
318
+ from base64 import b64encode
319
+ from nacl import encoding, public
320
+ import json, sys
321
+
322
+ # Get the public key
323
+ key_id = '<key_id_from_above>'
324
+ public_key = '<base64_key_from_above>'
325
+
326
+ # Encrypt
327
+ sealed = public.SealedBox(
328
+ public.PublicKey(public_key.encode('utf-8'), encoding.Base64Encoder)
329
+ ).encrypt('your-secret-value'.encode('utf-8'))
330
+ print(json.dumps({
331
+ 'encrypted_value': b64encode(sealed).decode('utf-8'),
332
+ 'key_id': key_id
333
+ }))"
334
+
335
+ # Then PUT the encrypted secret
336
+ curl -s -X PUT \
337
+ -H "Authorization: token $GITHUB_TOKEN" \
338
+ https://api.github.com/repos/$OWNER/$REPO/actions/secrets/API_KEY \
339
+ -d '<output from python script above>'
340
+
341
+ # List secrets (names only, values hidden)
342
+ curl -s \
343
+ -H "Authorization: token $GITHUB_TOKEN" \
344
+ https://api.github.com/repos/$OWNER/$REPO/actions/secrets \
345
+ | python3 -c "
346
+ import sys, json
347
+ for s in json.load(sys.stdin)['secrets']:
348
+ print(f\" {s['name']:30} updated: {s['updated_at']}\")"
349
+ ```
350
+
351
+ Note: For secrets, `gh secret set` is dramatically simpler. If setting secrets is needed and `gh` isn't available, recommend installing it for just that operation.
352
+
353
+ ## 8. Releases
354
+
355
+ **With gh:**
356
+
357
+ ```bash
358
+ gh release create v1.0.0 --title "v1.0.0" --generate-notes
359
+ gh release create v2.0.0-rc1 --draft --prerelease --generate-notes
360
+ gh release create v1.0.0 ./dist/binary --title "v1.0.0" --notes "Release notes"
361
+ gh release list
362
+ gh release download v1.0.0 --dir ./downloads
363
+ ```
364
+
365
+ **With curl:**
366
+
367
+ ```bash
368
+ # Create a release
369
+ curl -s -X POST \
370
+ -H "Authorization: token $GITHUB_TOKEN" \
371
+ https://api.github.com/repos/$OWNER/$REPO/releases \
372
+ -d '{
373
+ "tag_name": "v1.0.0",
374
+ "name": "v1.0.0",
375
+ "body": "## Changelog\n- Feature A\n- Bug fix B",
376
+ "draft": false,
377
+ "prerelease": false,
378
+ "generate_release_notes": true
379
+ }'
380
+
381
+ # List releases
382
+ curl -s \
383
+ -H "Authorization: token $GITHUB_TOKEN" \
384
+ https://api.github.com/repos/$OWNER/$REPO/releases \
385
+ | python3 -c "
386
+ import sys, json
387
+ for r in json.load(sys.stdin):
388
+ tag = r.get('tag_name', 'no tag')
389
+ print(f\" {tag:15} {r['name']:30} {'draft' if r['draft'] else 'published'}\")"
390
+
391
+ # Upload a release asset (binary file)
392
+ RELEASE_ID=<id_from_create_response>
393
+ curl -s -X POST \
394
+ -H "Authorization: token $GITHUB_TOKEN" \
395
+ -H "Content-Type: application/octet-stream" \
396
+ "https://uploads.github.com/repos/$OWNER/$REPO/releases/$RELEASE_ID/assets?name=binary-amd64" \
397
+ --data-binary @./dist/binary-amd64
398
+ ```
399
+
400
+ ## 9. GitHub Actions Workflows
401
+
402
+ **With gh:**
403
+
404
+ ```bash
405
+ gh workflow list
406
+ gh run list --limit 10
407
+ gh run view <RUN_ID>
408
+ gh run view <RUN_ID> --log-failed
409
+ gh run rerun <RUN_ID>
410
+ gh run rerun <RUN_ID> --failed
411
+ gh workflow run ci.yml --ref main
412
+ gh workflow run deploy.yml -f environment=staging
413
+ ```
414
+
415
+ **With curl:**
416
+
417
+ ```bash
418
+ # List workflows
419
+ curl -s \
420
+ -H "Authorization: token $GITHUB_TOKEN" \
421
+ https://api.github.com/repos/$OWNER/$REPO/actions/workflows \
422
+ | python3 -c "
423
+ import sys, json
424
+ for w in json.load(sys.stdin)['workflows']:
425
+ print(f\" {w['id']:10} {w['name']:30} {w['state']}\")"
426
+
427
+ # List recent runs
428
+ curl -s \
429
+ -H "Authorization: token $GITHUB_TOKEN" \
430
+ "https://api.github.com/repos/$OWNER/$REPO/actions/runs?per_page=10" \
431
+ | python3 -c "
432
+ import sys, json
433
+ for r in json.load(sys.stdin)['workflow_runs']:
434
+ print(f\" Run {r['id']} {r['name']:30} {r['conclusion'] or r['status']}\")"
435
+
436
+ # Download failed run logs
437
+ RUN_ID=<run_id>
438
+ curl -s -L \
439
+ -H "Authorization: token $GITHUB_TOKEN" \
440
+ https://api.github.com/repos/$OWNER/$REPO/actions/runs/$RUN_ID/logs \
441
+ -o /tmp/ci-logs.zip
442
+ cd /tmp && unzip -o ci-logs.zip -d ci-logs
443
+
444
+ # Re-run a failed workflow
445
+ curl -s -X POST \
446
+ -H "Authorization: token $GITHUB_TOKEN" \
447
+ https://api.github.com/repos/$OWNER/$REPO/actions/runs/$RUN_ID/rerun
448
+
449
+ # Re-run only failed jobs
450
+ curl -s -X POST \
451
+ -H "Authorization: token $GITHUB_TOKEN" \
452
+ https://api.github.com/repos/$OWNER/$REPO/actions/runs/$RUN_ID/rerun-failed-jobs
453
+
454
+ # Trigger a workflow manually (workflow_dispatch)
455
+ WORKFLOW_ID=<workflow_id_or_filename>
456
+ curl -s -X POST \
457
+ -H "Authorization: token $GITHUB_TOKEN" \
458
+ https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/dispatches \
459
+ -d '{"ref": "main", "inputs": {"environment": "staging"}}'
460
+ ```
461
+
462
+ ## 10. Gists
463
+
464
+ **With gh:**
465
+
466
+ ```bash
467
+ gh gist create script.py --public --desc "Useful script"
468
+ gh gist list
469
+ ```
470
+
471
+ **With curl:**
472
+
473
+ ```bash
474
+ # Create a gist
475
+ curl -s -X POST \
476
+ -H "Authorization: token $GITHUB_TOKEN" \
477
+ https://api.github.com/gists \
478
+ -d '{
479
+ "description": "Useful script",
480
+ "public": true,
481
+ "files": {
482
+ "script.py": {"content": "print(\"hello\")"}
483
+ }
484
+ }'
485
+
486
+ # List your gists
487
+ curl -s \
488
+ -H "Authorization: token $GITHUB_TOKEN" \
489
+ https://api.github.com/gists \
490
+ | python3 -c "
491
+ import sys, json
492
+ for g in json.load(sys.stdin):
493
+ files = ', '.join(g['files'].keys())
494
+ print(f\" {g['id']} {g['description'] or '(no desc)':40} {files}\")"
495
+ ```
496
+
497
+ ## Quick Reference Table
498
+
499
+ | Action | gh | git + curl |
500
+ |--------|-----|-----------|
501
+ | Clone | `gh repo clone o/r` | `git clone https://github.com/o/r.git` |
502
+ | Create repo | `gh repo create name --public` | `curl POST /user/repos` |
503
+ | Fork | `gh repo fork o/r --clone` | `curl POST /repos/o/r/forks` + `git clone` |
504
+ | Repo info | `gh repo view o/r` | `curl GET /repos/o/r` |
505
+ | Edit settings | `gh repo edit --...` | `curl PATCH /repos/o/r` |
506
+ | Create release | `gh release create v1.0` | `curl POST /repos/o/r/releases` |
507
+ | List workflows | `gh workflow list` | `curl GET /repos/o/r/actions/workflows` |
508
+ | Rerun CI | `gh run rerun ID` | `curl POST /repos/o/r/actions/runs/ID/rerun` |
509
+ | Set secret | `gh secret set KEY` | `curl PUT /repos/o/r/actions/secrets/KEY` (+ encryption) |
@@ -0,0 +1,161 @@
1
+ # GitHub REST API Cheatsheet
2
+
3
+ Base URL: `https://api.github.com`
4
+
5
+ All requests need: `-H "Authorization: token $GITHUB_TOKEN"`
6
+
7
+ Use the `gh-env.sh` helper to set `$GITHUB_TOKEN`, `$GH_OWNER`, `$GH_REPO` automatically:
8
+ ```bash
9
+ source "${AGENT_HOME:-$HOME/.agent}/skills/github/github-auth/scripts/gh-env.sh"
10
+ ```
11
+
12
+ ## Repositories
13
+
14
+ | Action | Method | Endpoint |
15
+ |--------|--------|----------|
16
+ | Get repo info | GET | `/repos/{owner}/{repo}` |
17
+ | Create repo (user) | POST | `/user/repos` |
18
+ | Create repo (org) | POST | `/orgs/{org}/repos` |
19
+ | Update repo | PATCH | `/repos/{owner}/{repo}` |
20
+ | Delete repo | DELETE | `/repos/{owner}/{repo}` |
21
+ | List your repos | GET | `/user/repos?per_page=30&sort=updated` |
22
+ | List org repos | GET | `/orgs/{org}/repos` |
23
+ | Fork repo | POST | `/repos/{owner}/{repo}/forks` |
24
+ | Create from template | POST | `/repos/{owner}/{template}/generate` |
25
+ | Get topics | GET | `/repos/{owner}/{repo}/topics` |
26
+ | Set topics | PUT | `/repos/{owner}/{repo}/topics` |
27
+
28
+ ## Pull Requests
29
+
30
+ | Action | Method | Endpoint |
31
+ |--------|--------|----------|
32
+ | List PRs | GET | `/repos/{owner}/{repo}/pulls?state=open` |
33
+ | Create PR | POST | `/repos/{owner}/{repo}/pulls` |
34
+ | Get PR | GET | `/repos/{owner}/{repo}/pulls/{number}` |
35
+ | Update PR | PATCH | `/repos/{owner}/{repo}/pulls/{number}` |
36
+ | List PR files | GET | `/repos/{owner}/{repo}/pulls/{number}/files` |
37
+ | Merge PR | PUT | `/repos/{owner}/{repo}/pulls/{number}/merge` |
38
+ | Request reviewers | POST | `/repos/{owner}/{repo}/pulls/{number}/requested_reviewers` |
39
+ | Create review | POST | `/repos/{owner}/{repo}/pulls/{number}/reviews` |
40
+ | Inline comment | POST | `/repos/{owner}/{repo}/pulls/{number}/comments` |
41
+
42
+ ### PR Merge Body
43
+
44
+ ```json
45
+ {"merge_method": "squash", "commit_title": "feat: description (#N)"}
46
+ ```
47
+
48
+ Merge methods: `"merge"`, `"squash"`, `"rebase"`
49
+
50
+ ### PR Review Events
51
+
52
+ `"APPROVE"`, `"REQUEST_CHANGES"`, `"COMMENT"`
53
+
54
+ ## Issues
55
+
56
+ | Action | Method | Endpoint |
57
+ |--------|--------|----------|
58
+ | List issues | GET | `/repos/{owner}/{repo}/issues?state=open` |
59
+ | Create issue | POST | `/repos/{owner}/{repo}/issues` |
60
+ | Get issue | GET | `/repos/{owner}/{repo}/issues/{number}` |
61
+ | Update issue | PATCH | `/repos/{owner}/{repo}/issues/{number}` |
62
+ | Add comment | POST | `/repos/{owner}/{repo}/issues/{number}/comments` |
63
+ | Add labels | POST | `/repos/{owner}/{repo}/issues/{number}/labels` |
64
+ | Remove label | DELETE | `/repos/{owner}/{repo}/issues/{number}/labels/{name}` |
65
+ | Add assignees | POST | `/repos/{owner}/{repo}/issues/{number}/assignees` |
66
+ | List labels | GET | `/repos/{owner}/{repo}/labels` |
67
+ | Search issues | GET | `/search/issues?q={query}+repo:{owner}/{repo}` |
68
+
69
+ Note: The Issues API also returns PRs. Filter with `"pull_request" not in item` when parsing.
70
+
71
+ ## CI / GitHub Actions
72
+
73
+ | Action | Method | Endpoint |
74
+ |--------|--------|----------|
75
+ | List workflows | GET | `/repos/{owner}/{repo}/actions/workflows` |
76
+ | List runs | GET | `/repos/{owner}/{repo}/actions/runs?per_page=10` |
77
+ | List runs (branch) | GET | `/repos/{owner}/{repo}/actions/runs?branch={branch}` |
78
+ | Get run | GET | `/repos/{owner}/{repo}/actions/runs/{run_id}` |
79
+ | Download logs | GET | `/repos/{owner}/{repo}/actions/runs/{run_id}/logs` |
80
+ | Re-run | POST | `/repos/{owner}/{repo}/actions/runs/{run_id}/rerun` |
81
+ | Re-run failed | POST | `/repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs` |
82
+ | Trigger dispatch | POST | `/repos/{owner}/{repo}/actions/workflows/{id}/dispatches` |
83
+ | Commit status | GET | `/repos/{owner}/{repo}/commits/{sha}/status` |
84
+ | Check runs | GET | `/repos/{owner}/{repo}/commits/{sha}/check-runs` |
85
+
86
+ ## Releases
87
+
88
+ | Action | Method | Endpoint |
89
+ |--------|--------|----------|
90
+ | List releases | GET | `/repos/{owner}/{repo}/releases` |
91
+ | Create release | POST | `/repos/{owner}/{repo}/releases` |
92
+ | Get release | GET | `/repos/{owner}/{repo}/releases/{id}` |
93
+ | Delete release | DELETE | `/repos/{owner}/{repo}/releases/{id}` |
94
+ | Upload asset | POST | `https://uploads.github.com/repos/{owner}/{repo}/releases/{id}/assets?name={filename}` |
95
+
96
+ ## Secrets
97
+
98
+ | Action | Method | Endpoint |
99
+ |--------|--------|----------|
100
+ | List secrets | GET | `/repos/{owner}/{repo}/actions/secrets` |
101
+ | Get public key | GET | `/repos/{owner}/{repo}/actions/secrets/public-key` |
102
+ | Set secret | PUT | `/repos/{owner}/{repo}/actions/secrets/{name}` |
103
+ | Delete secret | DELETE | `/repos/{owner}/{repo}/actions/secrets/{name}` |
104
+
105
+ ## Branch Protection
106
+
107
+ | Action | Method | Endpoint |
108
+ |--------|--------|----------|
109
+ | Get protection | GET | `/repos/{owner}/{repo}/branches/{branch}/protection` |
110
+ | Set protection | PUT | `/repos/{owner}/{repo}/branches/{branch}/protection` |
111
+ | Delete protection | DELETE | `/repos/{owner}/{repo}/branches/{branch}/protection` |
112
+
113
+ ## User / Auth
114
+
115
+ | Action | Method | Endpoint |
116
+ |--------|--------|----------|
117
+ | Get current user | GET | `/user` |
118
+ | List user repos | GET | `/user/repos` |
119
+ | List user gists | GET | `/gists` |
120
+ | Create gist | POST | `/gists` |
121
+ | Search repos | GET | `/search/repositories?q={query}` |
122
+
123
+ ## Pagination
124
+
125
+ Most list endpoints support:
126
+ - `?per_page=100` (max 100)
127
+ - `?page=2` for next page
128
+ - Check `Link` header for `rel="next"` URL
129
+
130
+ ## Rate Limits
131
+
132
+ - Authenticated: 5,000 requests/hour
133
+ - Check remaining: `curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/rate_limit`
134
+
135
+ ## Common curl Patterns
136
+
137
+ ```bash
138
+ # GET
139
+ curl -s -H "Authorization: token $GITHUB_TOKEN" \
140
+ https://api.github.com/repos/$GH_OWNER/$GH_REPO
141
+
142
+ # POST with JSON body
143
+ curl -s -X POST \
144
+ -H "Authorization: token $GITHUB_TOKEN" \
145
+ https://api.github.com/repos/$GH_OWNER/$GH_REPO/issues \
146
+ -d '{"title": "...", "body": "..."}'
147
+
148
+ # PATCH (update)
149
+ curl -s -X PATCH \
150
+ -H "Authorization: token $GITHUB_TOKEN" \
151
+ https://api.github.com/repos/$GH_OWNER/$GH_REPO/issues/42 \
152
+ -d '{"state": "closed"}'
153
+
154
+ # DELETE
155
+ curl -s -X DELETE \
156
+ -H "Authorization: token $GITHUB_TOKEN" \
157
+ https://api.github.com/repos/$GH_OWNER/$GH_REPO/issues/42/labels/bug
158
+
159
+ # Parse JSON response with python3
160
+ curl -s ... | python3 -c "import sys,json; data=json.load(sys.stdin); print(data['field'])"
161
+ ```