mindforge-cc 11.5.0 → 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 (177) 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 +88 -0
  166. package/MINDFORGE.md +3 -3
  167. package/README.md +38 -3
  168. package/RELEASENOTES.md +100 -0
  169. package/bin/dashboard/api-router.js +10 -1
  170. package/bin/governance/approve.js +5 -1
  171. package/bin/memory/federated-sync.js +11 -2
  172. package/bin/memory/knowledge-capture.js +10 -1
  173. package/bin/memory/pillar-health-tracker.js +9 -1
  174. package/bin/review/ads-engine.js +2 -2
  175. package/bin/security/trust-boundaries.js +5 -0
  176. package/docs/getting-started.md +42 -5
  177. package/package.json +1 -1
@@ -0,0 +1,230 @@
1
+ ---
2
+ name: duckduckgo-search
3
+ description: Free web search via DuckDuckGo — text, news, images, videos. No API key needed. Prefer the `ddgs` CLI when installed; use the Python DDGS library only after verifying that `ddgs` is available in the current runtime.
4
+ version: 1.3.0
5
+ ---
6
+
7
+ # DuckDuckGo Search
8
+
9
+ Free web search using DuckDuckGo. **No API key required.**
10
+
11
+ Preferred when `web_search` is unavailable or unsuitable (for example when `FIRECRAWL_API_KEY` is not set). Can also be used as a standalone search path when DuckDuckGo results are specifically desired.
12
+
13
+ ## Detection Flow
14
+
15
+ Check what is actually available before choosing an approach:
16
+
17
+ ```bash
18
+ # Check CLI availability
19
+ command -v ddgs >/dev/null && echo "DDGS_CLI=installed" || echo "DDGS_CLI=missing"
20
+ ```
21
+
22
+ Decision tree:
23
+ 1. If `ddgs` CLI is installed, prefer `terminal` + `ddgs`
24
+ 2. If `ddgs` CLI is missing, do not assume `execute_code` can import `ddgs`
25
+ 3. If the user wants DuckDuckGo specifically, install `ddgs` first in the relevant environment
26
+ 4. Otherwise fall back to built-in web/browser tools
27
+
28
+ Important runtime note:
29
+ - Terminal and `execute_code` are separate runtimes
30
+ - A successful shell install does not guarantee `execute_code` can import `ddgs`
31
+ - Never assume third-party Python packages are preinstalled inside `execute_code`
32
+
33
+ ## Installation
34
+
35
+ Install `ddgs` only when DuckDuckGo search is specifically needed and the runtime does not already provide it.
36
+
37
+ ```bash
38
+ # Python package + CLI entrypoint
39
+ pip install ddgs
40
+
41
+ # Verify CLI
42
+ ddgs --help
43
+ ```
44
+
45
+ If a workflow depends on Python imports, verify that same runtime can import `ddgs` before using `from ddgs import DDGS`.
46
+
47
+ ## Method 1: CLI Search (Preferred)
48
+
49
+ Use the `ddgs` command via `terminal` when it exists. This is the preferred path because it avoids assuming the `execute_code` sandbox has the `ddgs` Python package installed.
50
+
51
+ ```bash
52
+ # Text search
53
+ ddgs text -q "python async programming" -m 5
54
+
55
+ # News search
56
+ ddgs news -q "artificial intelligence" -m 5
57
+
58
+ # Image search
59
+ ddgs images -q "landscape photography" -m 10
60
+
61
+ # Video search
62
+ ddgs videos -q "python tutorial" -m 5
63
+
64
+ # With region filter
65
+ ddgs text -q "best restaurants" -m 5 -r us-en
66
+
67
+ # Recent results only (d=day, w=week, m=month, y=year)
68
+ ddgs text -q "latest AI news" -m 5 -t w
69
+
70
+ # JSON output for parsing
71
+ ddgs text -q "fastapi tutorial" -m 5 -o json
72
+ ```
73
+
74
+ ### CLI Flags
75
+
76
+ | Flag | Description | Example |
77
+ |------|-------------|---------|
78
+ | `-q` | Query — **required** | `-q "search terms"` |
79
+ | `-m` | Max results | `-m 5` |
80
+ | `-r` | Region | `-r us-en` |
81
+ | `-t` | Time limit | `-t w` (week) |
82
+ | `-s` | Safe search | `-s off` |
83
+ | `-o` | Output format | `-o json` |
84
+
85
+ ## Method 2: Python API (Only After Verification)
86
+
87
+ Use the `DDGS` class in `execute_code` or another Python runtime only after verifying that `ddgs` is installed there. Do not assume `execute_code` includes third-party packages by default.
88
+
89
+ Safe wording:
90
+ - "Use `execute_code` with `ddgs` after installing or verifying the package if needed"
91
+
92
+ Avoid saying:
93
+ - "`execute_code` includes `ddgs`"
94
+ - "DuckDuckGo search works by default in `execute_code`"
95
+
96
+ **Important:** `max_results` must always be passed as a **keyword argument** — positional usage raises an error on all methods.
97
+
98
+ ### Text Search
99
+
100
+ Best for: general research, companies, documentation.
101
+
102
+ ```python
103
+ from ddgs import DDGS
104
+
105
+ with DDGS() as ddgs:
106
+ for r in ddgs.text("python async programming", max_results=5):
107
+ print(r["title"])
108
+ print(r["href"])
109
+ print(r.get("body", "")[:200])
110
+ print()
111
+ ```
112
+
113
+ Returns: `title`, `href`, `body`
114
+
115
+ ### News Search
116
+
117
+ Best for: current events, breaking news, latest updates.
118
+
119
+ ```python
120
+ from ddgs import DDGS
121
+
122
+ with DDGS() as ddgs:
123
+ for r in ddgs.news("AI regulation 2026", max_results=5):
124
+ print(r["date"], "-", r["title"])
125
+ print(r.get("source", ""), "|", r["url"])
126
+ print(r.get("body", "")[:200])
127
+ print()
128
+ ```
129
+
130
+ Returns: `date`, `title`, `body`, `url`, `image`, `source`
131
+
132
+ ### Image Search
133
+
134
+ Best for: visual references, product images, diagrams.
135
+
136
+ ```python
137
+ from ddgs import DDGS
138
+
139
+ with DDGS() as ddgs:
140
+ for r in ddgs.images("semiconductor chip", max_results=5):
141
+ print(r["title"])
142
+ print(r["image"])
143
+ print(r.get("thumbnail", ""))
144
+ print(r.get("source", ""))
145
+ print()
146
+ ```
147
+
148
+ Returns: `title`, `image`, `thumbnail`, `url`, `height`, `width`, `source`
149
+
150
+ ### Video Search
151
+
152
+ Best for: tutorials, demos, explainers.
153
+
154
+ ```python
155
+ from ddgs import DDGS
156
+
157
+ with DDGS() as ddgs:
158
+ for r in ddgs.videos("FastAPI tutorial", max_results=5):
159
+ print(r["title"])
160
+ print(r.get("content", ""))
161
+ print(r.get("duration", ""))
162
+ print(r.get("provider", ""))
163
+ print(r.get("published", ""))
164
+ print()
165
+ ```
166
+
167
+ Returns: `title`, `content`, `description`, `duration`, `provider`, `published`, `statistics`, `uploader`
168
+
169
+ ### Quick Reference
170
+
171
+ | Method | Use When | Key Fields |
172
+ |--------|----------|------------|
173
+ | `text()` | General research, companies | title, href, body |
174
+ | `news()` | Current events, updates | date, title, source, body, url |
175
+ | `images()` | Visuals, diagrams | title, image, thumbnail, url |
176
+ | `videos()` | Tutorials, demos | title, content, duration, provider |
177
+
178
+ ## Workflow: Search then Extract
179
+
180
+ DuckDuckGo returns titles, URLs, and snippets — not full page content. To get full page content, search first and then extract the most relevant URL with `web_extract`, browser tools, or curl.
181
+
182
+ CLI example:
183
+
184
+ ```bash
185
+ ddgs text -q "fastapi deployment guide" -m 3 -o json
186
+ ```
187
+
188
+ Python example, only after verifying `ddgs` is installed in that runtime:
189
+
190
+ ```python
191
+ from ddgs import DDGS
192
+
193
+ with DDGS() as ddgs:
194
+ results = list(ddgs.text("fastapi deployment guide", max_results=3))
195
+ for r in results:
196
+ print(r["title"], "->", r["href"])
197
+ ```
198
+
199
+ Then extract the best URL with `web_extract` or another content-retrieval tool.
200
+
201
+ ## Limitations
202
+
203
+ - **Rate limiting**: DuckDuckGo may throttle after many rapid requests. Add a short delay between searches if needed.
204
+ - **No content extraction**: `ddgs` returns snippets, not full page content. Use `web_extract`, browser tools, or curl for the full article/page.
205
+ - **Results quality**: Generally good but less configurable than Firecrawl's search.
206
+ - **Availability**: DuckDuckGo may block requests from some cloud IPs. If searches return empty, try different keywords or wait a few seconds.
207
+ - **Field variability**: Return fields may vary between results or `ddgs` versions. Use `.get()` for optional fields to avoid `KeyError`.
208
+ - **Separate runtimes**: A successful `ddgs` install in terminal does not automatically mean `execute_code` can import it.
209
+
210
+ ## Troubleshooting
211
+
212
+ | Problem | Likely Cause | What To Do |
213
+ |---------|--------------|------------|
214
+ | `ddgs: command not found` | CLI not installed in the shell environment | Install `ddgs`, or use built-in web/browser tools instead |
215
+ | `ModuleNotFoundError: No module named 'ddgs'` | Python runtime does not have the package installed | Do not use Python DDGS there until that runtime is prepared |
216
+ | Search returns nothing | Temporary rate limiting or poor query | Wait a few seconds, retry, or adjust the query |
217
+ | CLI works but `execute_code` import fails | Terminal and `execute_code` are different runtimes | Keep using CLI, or separately prepare the Python runtime |
218
+
219
+ ## Pitfalls
220
+
221
+ - **`max_results` is keyword-only**: `ddgs.text("query", 5)` raises an error. Use `ddgs.text("query", max_results=5)`.
222
+ - **Do not assume the CLI exists**: Check `command -v ddgs` before using it.
223
+ - **Do not assume `execute_code` can import `ddgs`**: `from ddgs import DDGS` may fail with `ModuleNotFoundError` unless that runtime was prepared separately.
224
+ - **Package name**: The package is `ddgs` (previously `duckduckgo-search`). Install with `pip install ddgs`.
225
+ - **Don't confuse `-q` and `-m`** (CLI): `-q` is for the query, `-m` is for max results count.
226
+ - **Empty results**: If `ddgs` returns nothing, it may be rate-limited. Wait a few seconds and retry.
227
+
228
+ ## Validated With
229
+
230
+ Validated examples against `ddgs==9.11.2` semantics. Skill guidance now treats CLI availability and Python import availability as separate concerns so the documented workflow matches actual runtime behavior.
@@ -0,0 +1,240 @@
1
+ ---
2
+ name: github-auth
3
+ description: "GitHub auth setup: HTTPS tokens, SSH keys, gh CLI login."
4
+ version: 1.1.0
5
+ ---
6
+
7
+ # GitHub Authentication Setup
8
+
9
+ This skill sets up authentication so the agent can work with GitHub repositories, PRs, issues, and CI. It covers two paths:
10
+
11
+ - **`git` (always available)** — uses HTTPS personal access tokens or SSH keys
12
+ - **`gh` CLI (if installed)** — richer GitHub API access with a simpler auth flow
13
+
14
+ ## Detection Flow
15
+
16
+ When a user asks you to work with GitHub, run this check first:
17
+
18
+ ```bash
19
+ # Check what's available
20
+ git --version
21
+ gh --version 2>/dev/null || echo "gh not installed"
22
+
23
+ # Check if already authenticated
24
+ gh auth status 2>/dev/null || echo "gh not authenticated"
25
+ git config --global credential.helper 2>/dev/null || echo "no git credential helper"
26
+ ```
27
+
28
+ **Decision tree:**
29
+ 1. If `gh auth status` shows authenticated → you're good, use `gh` for everything
30
+ 2. If `gh` is installed but not authenticated → use "gh auth" method below
31
+ 3. If `gh` is not installed → use "git-only" method below (no sudo needed)
32
+
33
+ ---
34
+
35
+ ## Method 1: Git-Only Authentication (No gh, No sudo)
36
+
37
+ This works on any machine with `git` installed. No root access needed.
38
+
39
+ ### Option A: HTTPS with Personal Access Token (Recommended)
40
+
41
+ This is the most portable method — works everywhere, no SSH config needed.
42
+
43
+ **Step 1: Create a personal access token**
44
+
45
+ Tell the user to go to: **https://github.com/settings/tokens**
46
+
47
+ - Click "Generate new token (classic)"
48
+ - Give it a name like "
49
+ - Select scopes:
50
+ - `repo` (full repository access — read, write, push, PRs)
51
+ - `workflow` (trigger and manage GitHub Actions)
52
+ - `read:org` (if working with organization repos)
53
+ - Set expiration (90 days is a good default)
54
+ - Copy the token — it won't be shown again
55
+
56
+ **Step 2: Configure git to store the token**
57
+
58
+ ```bash
59
+ # Set up the credential helper to cache credentials
60
+ # "store" saves to ~/.git-credentials in plaintext (simple, persistent)
61
+ git config --global credential.helper store
62
+
63
+ # Now do a test operation that triggers auth — git will prompt for credentials
64
+ # Username: <their-github-username>
65
+ # Password: <paste the personal access token, NOT their GitHub password>
66
+ git ls-remote https://github.com/<their-username>/<any-repo>.git
67
+ ```
68
+
69
+ After entering credentials once, they're saved and reused for all future operations.
70
+
71
+ **Alternative: cache helper (credentials expire from memory)**
72
+
73
+ ```bash
74
+ # Cache in memory for 8 hours (28800 seconds) instead of saving to disk
75
+ git config --global credential.helper 'cache --timeout=28800'
76
+ ```
77
+
78
+ **Alternative: set the token directly in the remote URL (per-repo)**
79
+
80
+ ```bash
81
+ # Embed token in the remote URL (avoids credential prompts entirely)
82
+ git remote set-url origin https://<username>:<token>@github.com/<owner>/<repo>.git
83
+ ```
84
+
85
+ **Step 3: Configure git identity**
86
+
87
+ ```bash
88
+ # Required for commits — set name and email
89
+ git config --global user.name "Their Name"
90
+ git config --global user.email "their-email@example.com"
91
+ ```
92
+
93
+ **Step 4: Verify**
94
+
95
+ ```bash
96
+ # Test push access (this should work without any prompts now)
97
+ git ls-remote https://github.com/<their-username>/<any-repo>.git
98
+
99
+ # Verify identity
100
+ git config --global user.name
101
+ git config --global user.email
102
+ ```
103
+
104
+ ### Option B: SSH Key Authentication
105
+
106
+ Good for users who prefer SSH or already have keys set up.
107
+
108
+ **Step 1: Check for existing SSH keys**
109
+
110
+ ```bash
111
+ ls -la ~/.ssh/id_*.pub 2>/dev/null || echo "No SSH keys found"
112
+ ```
113
+
114
+ **Step 2: Generate a key if needed**
115
+
116
+ ```bash
117
+ # Generate an ed25519 key (modern, secure, fast)
118
+ ssh-keygen -t ed25519 -C "their-email@example.com" -f ~/.ssh/id_ed25519 -N ""
119
+
120
+ # Display the public key for them to add to GitHub
121
+ cat ~/.ssh/id_ed25519.pub
122
+ ```
123
+
124
+ Tell the user to add the public key at: **https://github.com/settings/keys**
125
+ - Click "New SSH key"
126
+ - Paste the public key content
127
+ - Give it a title like "
128
+
129
+ **Step 3: Test the connection**
130
+
131
+ ```bash
132
+ ssh -T git@github.com
133
+ # Expected: "Hi <username>! You've successfully authenticated..."
134
+ ```
135
+
136
+ **Step 4: Configure git to use SSH for GitHub**
137
+
138
+ ```bash
139
+ # Rewrite HTTPS GitHub URLs to SSH automatically
140
+ git config --global url."git@github.com:".insteadOf "https://github.com/"
141
+ ```
142
+
143
+ **Step 5: Configure git identity**
144
+
145
+ ```bash
146
+ git config --global user.name "Their Name"
147
+ git config --global user.email "their-email@example.com"
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Method 2: gh CLI Authentication
153
+
154
+ If `gh` is installed, it handles both API access and git credentials in one step.
155
+
156
+ ### Interactive Browser Login (Desktop)
157
+
158
+ ```bash
159
+ gh auth login
160
+ # Select: GitHub.com
161
+ # Select: HTTPS
162
+ # Authenticate via browser
163
+ ```
164
+
165
+ ### Token-Based Login (Headless / SSH Servers)
166
+
167
+ ```bash
168
+ echo "<THEIR_TOKEN>" | gh auth login --with-token
169
+
170
+ # Set up git credentials through gh
171
+ gh auth setup-git
172
+ ```
173
+
174
+ ### Verify
175
+
176
+ ```bash
177
+ gh auth status
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Using the GitHub API Without gh
183
+
184
+ When `gh` is not available, you can still access the full GitHub API using `curl` with a personal access token. This is how the other GitHub skills implement their fallbacks.
185
+
186
+ ### Setting the Token for API Calls
187
+
188
+ ```bash
189
+ # Option 1: Export as env var (preferred — keeps it out of commands)
190
+ export GITHUB_TOKEN="<token>"
191
+
192
+ # Then use in curl calls:
193
+ curl -s -H "Authorization: token $GITHUB_TOKEN" \
194
+ https://api.github.com/user
195
+ ```
196
+
197
+ ### Extracting the Token from Git Credentials
198
+
199
+ If git credentials are already configured (via credential.helper store), the token can be extracted:
200
+
201
+ ```bash
202
+ # Read from git credential store
203
+ grep "github.com" ~/.git-credentials 2>/dev/null | head -1 | sed 's|https://[^:]*:\([^@]*\)@.*|\1|'
204
+ ```
205
+
206
+ ### Helper: Detect Auth Method
207
+
208
+ Use this pattern at the start of any GitHub workflow:
209
+
210
+ ```bash
211
+ # Try gh first, fall back to git + curl
212
+ if command -v gh &>/dev/null && gh auth status &>/dev/null; then
213
+ echo "AUTH_METHOD=gh"
214
+ elif [ -n "$GITHUB_TOKEN" ]; then
215
+ echo "AUTH_METHOD=curl"
216
+ elif _agent_env="${AGENT_HOME:-$HOME/.agent}/.env"; [ -f "$_agent_env" ] && grep -q "^GITHUB_TOKEN=" "$_agent_env"; then
217
+ export GITHUB_TOKEN=$(grep "^GITHUB_TOKEN=" "$_agent_env" | head -1 | cut -d= -f2 | tr -d '\n\r')
218
+ echo "AUTH_METHOD=curl"
219
+ elif grep -q "github.com" ~/.git-credentials 2>/dev/null; then
220
+ export GITHUB_TOKEN=$(grep "github.com" ~/.git-credentials | head -1 | sed 's|https://[^:]*:\([^@]*\)@.*|\1|')
221
+ echo "AUTH_METHOD=curl"
222
+ else
223
+ echo "AUTH_METHOD=none"
224
+ echo "Need to set up authentication first"
225
+ fi
226
+ ```
227
+
228
+ ---
229
+
230
+ ## Troubleshooting
231
+
232
+ | Problem | Solution |
233
+ |---------|----------|
234
+ | `git push` asks for password | GitHub disabled password auth. Use a personal access token as the password, or switch to SSH |
235
+ | `remote: Permission to X denied` | Token may lack `repo` scope — regenerate with correct scopes |
236
+ | `fatal: Authentication failed` | Cached credentials may be stale — run `git credential reject` then re-authenticate |
237
+ | `ssh: connect to host github.com port 22: Connection refused` | Try SSH over HTTPS port: add `Host github.com` with `Port 443` and `Hostname ssh.github.com` to `~/.ssh/config` |
238
+ | Credentials not persisting | Check `git config --global credential.helper` — must be `store` or `cache` |
239
+ | Multiple GitHub accounts | Use SSH with different keys per host alias in `~/.ssh/config`, or per-repo credential URLs |
240
+ | `gh: command not found` + no sudo | Use git-only Method 1 above — no installation needed |