gemiterm 2.0.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 (184) hide show
  1. package/.env +2 -0
  2. package/.github/workflows/manual-release.yml +34 -0
  3. package/.github/workflows/release.yml +198 -0
  4. package/.github/workflows/test.yml +29 -0
  5. package/.opencode/commands/opsx-apply.md +152 -0
  6. package/.opencode/commands/opsx-archive.md +157 -0
  7. package/.opencode/commands/opsx-explore.md +169 -0
  8. package/.opencode/commands/opsx-propose.md +104 -0
  9. package/.opencode/commands/opsx-sync.md +140 -0
  10. package/.opencode/commands/search-intelligently.md +9 -0
  11. package/.opencode/opencode.json +20 -0
  12. package/.opencode/skills/intellisearch/.version +1 -0
  13. package/.opencode/skills/intellisearch/SKILL.md +84 -0
  14. package/.opencode/skills/intellisearch/references/brave-search.md +67 -0
  15. package/.opencode/skills/intellisearch/references/ddg-search.md +79 -0
  16. package/.opencode/skills/intellisearch/references/deepwiki-tools.md +246 -0
  17. package/.opencode/skills/intellisearch/references/examples.md +97 -0
  18. package/.opencode/skills/intellisearch/references/gh-cli.md +143 -0
  19. package/.opencode/skills/intellisearch/references/google-search.md +40 -0
  20. package/.opencode/skills/intellisearch/references/search-workflow.md +143 -0
  21. package/.opencode/skills/intellisearch/references/workflow.md +115 -0
  22. package/.opencode/skills/openspec-apply-change/SKILL.md +159 -0
  23. package/.opencode/skills/openspec-archive-change/SKILL.md +117 -0
  24. package/.opencode/skills/openspec-explore/SKILL.md +287 -0
  25. package/.opencode/skills/openspec-propose/SKILL.md +111 -0
  26. package/.opencode/skills/openspec-sync-specs/SKILL.md +147 -0
  27. package/.serena/project.yml +133 -0
  28. package/AGENTS.md +136 -0
  29. package/CHANGELOG.md +3 -0
  30. package/README.md +245 -0
  31. package/bun.lock +105 -0
  32. package/docs/INSTALL.md +185 -0
  33. package/docs/PLAYWRIGHT_CLI_API.md +306 -0
  34. package/docs/python-release-for-reference.md +175 -0
  35. package/examples/sample_json_export.json +32 -0
  36. package/examples/sample_markdown_export.md +221 -0
  37. package/examples/usage_examples.sh +222 -0
  38. package/install.ps1 +264 -0
  39. package/install.sh +275 -0
  40. package/openspec/MAESTRO_MIGRATION.md +180 -0
  41. package/openspec/changes/archive/2026-06-08-command-spec-conformance/.openspec.yaml +2 -0
  42. package/openspec/changes/archive/2026-06-08-command-spec-conformance/design.md +194 -0
  43. package/openspec/changes/archive/2026-06-08-command-spec-conformance/proposal.md +52 -0
  44. package/openspec/changes/archive/2026-06-08-command-spec-conformance/specs/multi-profile-conversations/spec.md +133 -0
  45. package/openspec/changes/archive/2026-06-08-command-spec-conformance/tasks.md +95 -0
  46. package/openspec/changes/archive/2026-06-09-refactor-interactive-prompt-loop/.openspec.yaml +2 -0
  47. package/openspec/changes/archive/2026-06-09-refactor-interactive-prompt-loop/design.md +28 -0
  48. package/openspec/changes/archive/2026-06-09-refactor-interactive-prompt-loop/proposal.md +22 -0
  49. package/openspec/changes/archive/2026-06-09-refactor-interactive-prompt-loop/specs/interactive-prompt-loop/spec.md +35 -0
  50. package/openspec/changes/archive/2026-06-09-refactor-interactive-prompt-loop/tasks.md +28 -0
  51. package/openspec/changes/archive/2026-06-09-replace-gemini-api-placeholder-with-gemini-reverse/.openspec.yaml +2 -0
  52. package/openspec/changes/archive/2026-06-09-replace-gemini-api-placeholder-with-gemini-reverse/design.md +323 -0
  53. package/openspec/changes/archive/2026-06-09-replace-gemini-api-placeholder-with-gemini-reverse/proposal.md +122 -0
  54. package/openspec/changes/archive/2026-06-09-replace-gemini-api-placeholder-with-gemini-reverse/specs/no-capability-changes/spec.md +29 -0
  55. package/openspec/changes/archive/2026-06-09-replace-gemini-api-placeholder-with-gemini-reverse/tasks.md +172 -0
  56. package/openspec/changes/archive/2026-06-09-v2-install-migration/.openspec.yaml +2 -0
  57. package/openspec/changes/archive/2026-06-09-v2-install-migration/design.md +241 -0
  58. package/openspec/changes/archive/2026-06-09-v2-install-migration/proposal.md +41 -0
  59. package/openspec/changes/archive/2026-06-09-v2-install-migration/specs/v2-installer/spec.md +205 -0
  60. package/openspec/changes/archive/2026-06-09-v2-install-migration/tasks.md +97 -0
  61. package/openspec/changes/commander-cli-parser/.openspec.yaml +2 -0
  62. package/openspec/changes/commander-cli-parser/design.md +107 -0
  63. package/openspec/changes/commander-cli-parser/proposal.md +31 -0
  64. package/openspec/changes/commander-cli-parser/specs/cli/spec.md +48 -0
  65. package/openspec/changes/commander-cli-parser/tasks.md +33 -0
  66. package/openspec/changes/cross-platform-build-and-ci/.openspec.yaml +2 -0
  67. package/openspec/changes/cross-platform-build-and-ci/design.md +213 -0
  68. package/openspec/changes/cross-platform-build-and-ci/proposal.md +50 -0
  69. package/openspec/changes/cross-platform-build-and-ci/specs/path-and-file-mediation/spec.md +335 -0
  70. package/openspec/changes/cross-platform-build-and-ci/specs/release-pipeline/spec.md +95 -0
  71. package/openspec/changes/cross-platform-build-and-ci/tasks.md +164 -0
  72. package/openspec/config.yaml +20 -0
  73. package/openspec/specs/auth/spec.md +394 -0
  74. package/openspec/specs/cli/spec.md +108 -0
  75. package/openspec/specs/commands/spec.md +409 -0
  76. package/openspec/specs/configuration/spec.md +130 -0
  77. package/openspec/specs/conversations/spec.md +139 -0
  78. package/openspec/specs/domain-model/spec.md +128 -0
  79. package/openspec/specs/formatters/spec.md +158 -0
  80. package/openspec/specs/install-browser/spec.md +146 -0
  81. package/openspec/specs/interactive-prompt-loop/spec.md +41 -0
  82. package/openspec/specs/logger/spec.md +71 -0
  83. package/openspec/specs/mediator/spec.md +72 -0
  84. package/openspec/specs/multi-profile-conversations/spec.md +145 -0
  85. package/openspec/specs/path-utils/spec.md +101 -0
  86. package/openspec/specs/profiles/spec.md +94 -0
  87. package/openspec/specs/storage/spec.md +198 -0
  88. package/openspec/specs/testing/spec.md +237 -0
  89. package/openspec/specs/v2-installer/spec.md +205 -0
  90. package/openspec/specs/validators/spec.md +65 -0
  91. package/package.json +45 -0
  92. package/scripts/build.ts +88 -0
  93. package/scripts/clean-build.ps1 +4 -0
  94. package/scripts/clean-build.sh +5 -0
  95. package/scripts/install-browser.ps1 +5 -0
  96. package/scripts/install-browser.sh +6 -0
  97. package/scripts/lint-path-mediation.ps1 +65 -0
  98. package/scripts/lint-path-mediation.sh +40 -0
  99. package/src/cli/.gitkeep +0 -0
  100. package/src/cli/command-registry.ts +62 -0
  101. package/src/cli/commands/auth-command.ts +179 -0
  102. package/src/cli/commands/continue-command.ts +158 -0
  103. package/src/cli/commands/delete-command.ts +163 -0
  104. package/src/cli/commands/export-all-command.ts +243 -0
  105. package/src/cli/commands/export-command.ts +156 -0
  106. package/src/cli/commands/fetch-command.ts +176 -0
  107. package/src/cli/commands/help.ts +45 -0
  108. package/src/cli/commands/install-browser-command.ts +33 -0
  109. package/src/cli/commands/list-command.ts +226 -0
  110. package/src/cli/commands/new-command.ts +147 -0
  111. package/src/cli/commands/profile-command.ts +226 -0
  112. package/src/cli/commands/status-command.ts +59 -0
  113. package/src/cli/index.ts +213 -0
  114. package/src/cli/utils/interactive-prompt.ts +64 -0
  115. package/src/core/.gitkeep +0 -0
  116. package/src/core/command-handlers.ts +240 -0
  117. package/src/core/errors.ts +41 -0
  118. package/src/core/mediator.ts +58 -0
  119. package/src/core/query-handlers.ts +163 -0
  120. package/src/core/types.ts +43 -0
  121. package/src/infrastructure/.gitkeep +0 -0
  122. package/src/infrastructure/cli-table.ts +45 -0
  123. package/src/infrastructure/config.ts +52 -0
  124. package/src/infrastructure/formatters.ts +130 -0
  125. package/src/infrastructure/io.ts +161 -0
  126. package/src/infrastructure/logger.ts +41 -0
  127. package/src/infrastructure/path-utils.ts +157 -0
  128. package/src/infrastructure/storage.ts +209 -0
  129. package/src/infrastructure/validators.ts +28 -0
  130. package/src/services/.gitkeep +0 -0
  131. package/src/services/auth-service.ts +135 -0
  132. package/src/services/cookie-monitor.ts +159 -0
  133. package/src/services/cookie-storage-service.ts +74 -0
  134. package/src/services/gemini-client-wrapper.ts +239 -0
  135. package/src/services/install-browser-service.ts +205 -0
  136. package/src/services/playwright-cli-driver.ts +269 -0
  137. package/src/services/profile-auth-manager.ts +65 -0
  138. package/src/services/profile-service.ts +121 -0
  139. package/tests/cli/auth-command.test.ts +220 -0
  140. package/tests/cli/command-registry.test.ts +67 -0
  141. package/tests/cli/continue-command.test.ts +100 -0
  142. package/tests/cli/delete-command.test.ts +128 -0
  143. package/tests/cli/export-all-command.test.ts +375 -0
  144. package/tests/cli/install-browser-command.test.ts +48 -0
  145. package/tests/cli/list-command.test.ts +179 -0
  146. package/tests/cli/new-command.test.ts +139 -0
  147. package/tests/cli/status-command.test.ts +106 -0
  148. package/tests/core/query-handlers.test.ts +187 -0
  149. package/tests/fixtures/auth-fixtures.ts +98 -0
  150. package/tests/fixtures/chat-fixtures.ts +87 -0
  151. package/tests/infrastructure/cli-table.test.ts +107 -0
  152. package/tests/infrastructure/formatters.test.ts +202 -0
  153. package/tests/infrastructure/io.test.ts +197 -0
  154. package/tests/infrastructure/logger.test.ts +74 -0
  155. package/tests/infrastructure/storage.test.ts +335 -0
  156. package/tests/infrastructure/validators.test.ts +67 -0
  157. package/tests/integration/commands/auth.test.ts +186 -0
  158. package/tests/integration/commands/continue.test.ts +130 -0
  159. package/tests/integration/commands/delete.test.ts +140 -0
  160. package/tests/integration/commands/export.test.ts +266 -0
  161. package/tests/integration/commands/fetch.test.ts +238 -0
  162. package/tests/integration/commands/list.test.ts +281 -0
  163. package/tests/integration/commands/profile.test.ts +258 -0
  164. package/tests/integration/commands/status.test.ts +223 -0
  165. package/tests/integration/installer-script-shape.test.ts +67 -0
  166. package/tests/parity/compare-outputs.ts +359 -0
  167. package/tests/parity/test-commands-parity.ps1 +82 -0
  168. package/tests/parity/test-commands-parity.sh +61 -0
  169. package/tests/services/auth-service.test.ts +315 -0
  170. package/tests/services/cookie-monitor.test.ts +229 -0
  171. package/tests/services/cookie-storage-service.test.ts +230 -0
  172. package/tests/services/gemini-client-wrapper.test.ts +688 -0
  173. package/tests/services/install-browser-service.test.ts +83 -0
  174. package/tests/services/playwright-cli-driver.test.ts +468 -0
  175. package/tests/services/profile-auth-manager.test.ts +334 -0
  176. package/tests/services/profile-service.test.ts +224 -0
  177. package/tests/setup.ts +95 -0
  178. package/tests/smoke/smoke.test.ts +52 -0
  179. package/tests/unit/config.test.ts +159 -0
  180. package/tests/unit/errors.test.ts +119 -0
  181. package/tests/unit/formatters.test.ts +316 -0
  182. package/tests/unit/mediator.test.ts +152 -0
  183. package/tests/unit/path-utils.test.ts +289 -0
  184. package/tsconfig.json +16 -0
@@ -0,0 +1,246 @@
1
+ # DeepWiki Tools Reference
2
+
3
+ Complete reference for DeepWiki MCP server tools for repository documentation Q&A.
4
+
5
+ ## MCP Configuration Requirement
6
+
7
+ DeepWiki MCP tools require configuration in `.opencode/opencode.json`:
8
+
9
+ ```json
10
+ {
11
+ "mcp": {
12
+ "deepwiki": {
13
+ "type": "remote",
14
+ "url": "https://mcp.deepwiki.com/mcp",
15
+ "enabled": true
16
+ }
17
+ }
18
+ }
19
+ ```
20
+
21
+ <critical_rules priority="highest">
22
+ <rule>Validate repo name against blocked list before calling</rule>
23
+ <rule>Use string for single repo: `repoName="owner/repo"`</rule>
24
+ <rule>Use array for multiple repos: `repoName=["owner1/repo1", "owner2/repo2"]` (2+ items)</rule>
25
+ <rule>NEVER use single-item array: `repoName=["owner/repo"]` (causes failure)</rule>
26
+ <rule>If deepwiki tools aren't available, use direct HTTP calls via `curl`. See Fallback section below.</rule>
27
+ <rule>"OpenCode" never refers to the archived and deprecated "opencode-ai/opencode" github repo. "OpenCode" always refers to "anomalyco/opencode" owned by "anomalyco" in github.</rule>
28
+ </critical_rules>
29
+
30
+ ## Fallback: Missing DeepWiki MCP
31
+
32
+ When MCP tools are not configured, use direct HTTP calls via curl:
33
+
34
+ ### ask_question
35
+
36
+ <bash_command name="ask_question">
37
+ ```bash
38
+ curl -s -X POST https://mcp.deepwiki.com/mcp \
39
+ -H "Content-Type: application/json" \
40
+ -H "Accept: application/json, text/event-stream" \
41
+ -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "ask_question", "arguments": {"repoName": "OWNER/REPO", "question": "YOUR_QUESTION"}}}' | grep -oP '(?<="text":")[^"]*' | sed 's/\\n/\n/g'
42
+ ```
43
+ </bash_command>
44
+
45
+ ### read_wiki_structure
46
+
47
+ <bash_command name="read_wiki_structure">
48
+ ```bash
49
+ curl -s -X POST https://mcp.deepwiki.com/mcp \
50
+ -H "Content-Type: application/json" \
51
+ -H "Accept: application/json, text/event-stream" \
52
+ -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "read_wiki_structure", "arguments": {"repoName": "OWNER/REPO"}}}' | grep -oP '(?<="text":")[^"]*' | sed 's/\\n/\n/g'
53
+ ```
54
+ </bash_command>
55
+
56
+ ### read_wiki_contents
57
+
58
+ <bash_command name="read_wiki_contents">
59
+ ```bash
60
+ curl -s -X POST https://mcp.deepwiki.com/mcp \
61
+ -H "Content-Type: application/json" \
62
+ -H "Accept: application/json, text/event-stream" \
63
+ -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "read_wiki_contents", "arguments": {"repoName": "OWNER/REPO"}}}' | grep -oP '(?<="text":")[^"]*' | sed 's/\\n/\n/g'
64
+ ```
65
+ </bash_command>
66
+
67
+ ### Critical Notes for Fallback Execution
68
+
69
+ <fallback_notes>
70
+ - **Argument Key**: Always use `repoName` (not `repo`)
71
+ - **Headers**: The `Accept` header must include `text/event-stream` or the server will reject the request
72
+ - **Output Parsing**: The `grep` and `sed` suffix is useful to extract clean text from the JSON-RPC stream but may sometimes need to be omitted.
73
+ </fallback_notes>
74
+
75
+ ## Repository Name Validation
76
+
77
+ Before calling DeepWiki, validate that the repository name is legitimate and not a GitHub website path.
78
+
79
+ ### Blocked First Segments
80
+
81
+ <blocked_owners>
82
+ Reject any `owner/repo` where the owner (first segment) matches these:
83
+
84
+ ```
85
+ about, accelerator, apps, archiveprogram, blog, careers, changelog,
86
+ collections, community, contact, customer-stories, docs, enterprise,
87
+ events, explore, features, gist, github, github-apps, issues, login,
88
+ maintainers, marketplace, mcp, notifications, oauth-apps, orgs,
89
+ organizations, password_reset, press, pricing, pull_requests, pulls,
90
+ resources, security, securitylab, sessions, settings, site-policy,
91
+ skills, solutions, sponsors, support, team, topics, trending,
92
+ trust-center, whitepapers, why-github
93
+ ```
94
+ </blocked_owners>
95
+
96
+ ### Validation Rules
97
+
98
+ | Check | Rule | Example |
99
+ |-------|------|---------|
100
+ | Owner format | Alphanumeric, `-`, `_` only | `npm`, `node-js` ✅ |
101
+ | Repo format | Alphanumeric, `-`, `_`, `.` only | `node-semver`, `lib.js` ✅ |
102
+ | Not blocked | Owner not in blocked list | `npm/node-semver` ✅ |
103
+ | Blocked path | Owner in blocked list | `features/spark` ❌ |
104
+
105
+ ### Examples
106
+
107
+ | Input | Verdict | Reason |
108
+ |-------|---------|--------|
109
+ | `npm/node-semver` | ✅ Valid | `npm` not blocked |
110
+ | `graphology/graphology` | ✅ Valid | `graphology` not blocked |
111
+ | `features/spark` | ❌ Invalid | `features` is GitHub product page |
112
+ | `topics/database` | ❌ Invalid | `topics` is GitHub topic page |
113
+ | `enterprise/startups` | ❌ Invalid | `enterprise` is GitHub marketing |
114
+ | `resources/articles` | ❌ Invalid | `resources` is GitHub content |
115
+ | `github/explore` | ❌ Invalid | `github` is org page, not repo |
116
+ | `site-policy/terms` | ❌ Invalid | `site-policy` is GitHub legal |
117
+ | `orgs/community` | ❌ Invalid | `orgs` is GitHub navigation |
118
+
119
+ ## Available Tools
120
+
121
+ ### deepWiki_read_wiki_structure
122
+
123
+ <tool name="deepWiki_read_wiki_structure">
124
+ <params>
125
+ - `repoName` (required): Repository in `owner/repo` format
126
+ </params>
127
+ <returns>List of available documentation sections and topics</returns>
128
+ <use_when>Exploring what documentation is available before asking specific questions</use_when>
129
+ </tool>
130
+
131
+ ### deepWiki_read_wiki_contents
132
+
133
+ <tool name="deepWiki_read_wiki_contents">
134
+ <params>
135
+ - `repoName` (required): Repository in `owner/repo` format
136
+ </params>
137
+ <returns>Complete documentation content</returns>
138
+ <use_when>You need comprehensive documentation overview or when `ask_question` doesn't provide enough detail</use_when>
139
+ </tool>
140
+
141
+ ### deepWiki_ask_question
142
+
143
+ <tool name="deepWiki_ask_question">
144
+ <params>
145
+ - `repoName` (required): Repository in `owner/repo` format
146
+ - **Single repo**: Use string: `"owner/repo"`
147
+ - **Multiple repos**: Use array: `["owner1/repo1", "owner2/repo2"]`
148
+ - **Critical**: Do not pass single-item array like `["owner/repo"]` for one repo
149
+ - `question` (required): Specific question about the repository
150
+ </params>
151
+ <returns>Targeted answer based on repository documentation</returns>
152
+ <use_when>You have a specific question and want a direct answer</use_when>
153
+ </tool>
154
+
155
+ <format_rules>
156
+ - Single repository: `repoName="anomalyco/opencode"`
157
+ - Multiple repositories: `repoName=["anomalyco/opencode", "vercel/next.js"]`
158
+ - ❌ Wrong: `repoName=["anomalyco/opencode"]` (single-item array causes search failure)
159
+ </format_rules>
160
+
161
+ ## When to Use DeepWiki
162
+
163
+ <use_cases>
164
+ - Query is about a **specific GitHub repository**
165
+ - You need **authoritative code answers** (from official docs)
166
+ - The question involves **implementation details** of a library/framework
167
+ - You want **installation/setup instructions** for a specific tool
168
+ - The query is about **API usage patterns** for a known package
169
+ </use_cases>
170
+
171
+ ## repoName Format
172
+
173
+ Always use `owner/repo` format:
174
+
175
+ | Repository | Correct | Incorrect |
176
+ |------------|---------|-----------|
177
+ | React | `facebook/react` | `react`, `React` |
178
+ | Next.js | `vercel/next.js` | `nextjs`, `next` |
179
+ | TypeScript | `microsoft/TypeScript` | `typescript`, `ts` |
180
+ | Vue | `vuejs/core` | `vue`, `Vue.js` |
181
+
182
+ ## Example Workflows
183
+
184
+ ### Getting Started with a Library
185
+
186
+ ```json
187
+ // Step 1: Check documentation structure
188
+ {
189
+ "tool": "deepwiki:deepWiki_read_wiki_structure",
190
+ "params": {
191
+ "repoName": "vercel/next.js"
192
+ }
193
+ }
194
+
195
+ // Step 2: Ask specific question
196
+ {
197
+ "tool": "deepwiki:deepWiki_ask_question",
198
+ "params": {
199
+ "repoName": "vercel/next.js",
200
+ "question": "How do I create a dynamic route with parameters?"
201
+ }
202
+ }
203
+ ```
204
+
205
+ ### Troubleshooting
206
+
207
+ ```json
208
+ {
209
+ "tool": "deepwiki:deepWiki_ask_question",
210
+ "params": {
211
+ "repoName": "facebook/react",
212
+ "question": "Why am I getting the 'rules of hooks' warning?"
213
+ }
214
+ }
215
+ ```
216
+
217
+ ### Installation Questions
218
+
219
+ ```json
220
+ {
221
+ "tool": "deepwiki:deepWiki_ask_question",
222
+ "params": {
223
+ "repoName": "tailwindlabs/tailwindcss",
224
+ "question": "How do I install and configure Tailwind with Vite?"
225
+ }
226
+ }
227
+ ```
228
+
229
+ ## Best Practices
230
+
231
+ <best_practices>
232
+ 1. **Validate repo name** against blocked list before calling
233
+ 2. **Use `ask_question`** for specific queries (most efficient)
234
+ 3. **Use `read_wiki_contents`** only when you need the full documentation
235
+ 4. **Check `read_wiki_structure`** first when exploring unfamiliar repos
236
+ 5. **Use string for single repo, array for multiple repos** in `repoName` parameter
237
+ </best_practices>
238
+
239
+ ## Limitations
240
+
241
+ <limitations>
242
+ - Only works for **public GitHub repositories**
243
+ - Documentation must be **indexed by DeepWiki**
244
+ - Very new or obscure repos may not be available
245
+ - Cannot access private repositories
246
+ </limitations>
@@ -0,0 +1,97 @@
1
+ # Few-Shot Examples
2
+
3
+ Real-world patterns for IntelliSearch skill execution.
4
+
5
+ ## Example 1: Library Discovery
6
+
7
+ **Query:** "Find a TypeScript library for semantic versioning validation"
8
+
9
+ <execution>
10
+ <step name="search" tool="gh search repos">
11
+ CMD: `gh search repos "semver validation typescript" --language=typescript --json fullName,stargazersCount,createdAt,updatedAt,description --limit 10`
12
+ RESULT: [npm/node-semver: 4.5K★, mattfarina/semver: 892★, ...]
13
+ </step>
14
+
15
+ <step name="filter" action="Top 3 by stars">
16
+ SELECTED: [npm/node-semver, mattfarina/semver, ieee802js/node-semver]
17
+ </step>
18
+
19
+ <step name="query" tool="DeepWiki_ask_question">
20
+ PAYLOAD: {
21
+ repoName: ["npm/node-semver", "mattfarina/semver", "ieee802js/node-semver"],
22
+ question: "Which is best for TypeScript semver validation?"
23
+ }
24
+ </step>
25
+
26
+ <step name="synthesize">
27
+ OUTPUT: npm/node-semver recommended (most stars, active maintenance, TypeScript typings included)
28
+ </step>
29
+ </execution>
30
+
31
+ ---
32
+
33
+ ## Example 2: Framework Comparison
34
+
35
+ **Query:** "Compare React state management libraries: Zustand vs Jotai vs Valtio"
36
+
37
+ <execution>
38
+ <step name="search" tool="gh search repos (parallel)">
39
+ CMDS:
40
+ - `gh search repos "zustand" --json fullName,stargazersCount,createdAt,updatedAt --limit 5`
41
+ - `gh search repos "jotai" --json fullName,stargazersCount,createdAt,updatedAt --limit 5`
42
+ - `gh search repos "valtio" --json fullName,stargazersCount,createdAt,updatedAt --limit 5`
43
+ RESULT: [pmndrs/zustand: 47K★, pmndrs/jotai: 18K★, pmndrs/valtio: 7K★]
44
+ </step>
45
+
46
+ <step name="filter" action="Exact matches only">
47
+ SELECTED: [pmndrs/zustand, pmndrs/jotai, pmndrs/valtio]
48
+ </step>
49
+
50
+ <step name="query" tool="DeepWiki_ask_question">
51
+ PAYLOAD: {
52
+ repoName: ["pmndrs/zustand", "pmndrs/jotai", "pmndrs/valtio"],
53
+ question: "Compare these React state management libraries: API design, performance, bundle size, learning curve"
54
+ }
55
+ </step>
56
+
57
+ <step name="synthesize">
58
+ OUTPUT: Zustand (simplest API, largest), Jotai (atomic, smallest), Valtio (proxy-based, mutable patterns)
59
+ </step>
60
+ </execution>
61
+
62
+ ---
63
+
64
+ ## Example 3: Fallback Chain
65
+
66
+ **Query:** "Is there a browser-based WebGL physics engine?"
67
+
68
+ <execution>
69
+ <step name="search" tool="gh search repos" status="failed">
70
+ CMD: `gh search repos "webgl physics engine browser" --language=javascript --limit 10`
71
+ ERROR: gh CLI not authenticated
72
+ </step>
73
+
74
+ <step name="fallback" tool="google_search">
75
+ PAYLOAD: {query: "webgl physics engine javascript npm github"}
76
+ RESULT: Snippets mentioning cannon-es, ammo.js, Oimo.js
77
+ </step>
78
+
79
+ <step name="extract" action="owner/repo patterns">
80
+ EXTRACTED: [pmndrs/cannon-es, kripken/ammo.js, lo-th/Oimo.js]
81
+ </step>
82
+
83
+ <step name="filter" action="Top 3 by relevance">
84
+ SELECTED: [pmndrs/cannon-es, kripken/ammo.js, lo-th/Oimo.js]
85
+ </step>
86
+
87
+ <step name="query" tool="DeepWiki_ask_question">
88
+ PAYLOAD: {
89
+ repoName: ["pmndrs/cannon-es", "kripken/ammo.js", "lo-th/Oimo.js"],
90
+ question: "Which is best for browser WebGL physics with Three.js integration?"
91
+ }
92
+ </step>
93
+
94
+ <step name="synthesize">
95
+ OUTPUT: cannon-es recommended (ES modules, maintained fork of cannon.js, Three.js examples available)
96
+ </step>
97
+ </execution>
@@ -0,0 +1,143 @@
1
+ # GitHub CLI Search
2
+
3
+ Using `gh` CLI for direct GitHub repository search.
4
+
5
+ <detection>
6
+ ```bash
7
+ gh auth status
8
+ ```
9
+ - Exit code 0: gh is available and authenticated
10
+ - Exit code non-zero: gh not available or not authenticated
11
+ </detection>
12
+
13
+ ## Search Command
14
+
15
+ ```bash
16
+ gh search repos [query] [flags]
17
+ ```
18
+
19
+ ## Query Strategy
20
+
21
+ <approach>
22
+ 1. **Topics + Language** (preferred when topics identifiable)
23
+ 2. **Keywords only** (fallback)
24
+ </approach>
25
+
26
+ <topic_detection>
27
+ Infer topics from user query context:
28
+ - Framework names → topics (react, vue, express)
29
+ - Library names → topics (lodash, axios, moment)
30
+ - Concepts → topics (semver, validation, authentication)
31
+ </topic_detection>
32
+
33
+ <language_inference>
34
+ Extract programming language from:
35
+ - Explicit mention: "in TypeScript", "Python library"
36
+ - File extensions: ".ts", ".py", ".go"
37
+ - Context: "npm package" → JavaScript/TypeScript
38
+ </language_inference>
39
+
40
+ ## Examples
41
+
42
+ <examples>
43
+ <example category="topic_language">
44
+ ```bash
45
+ # Query: "semver validation in TypeScript"
46
+ gh search repos --topic=semver,validation --language=typescript --json fullName,stargazersCount,createdAt,updatedAt,description --limit 10
47
+ ```
48
+ </example>
49
+
50
+ <example category="keyword">
51
+ ```bash
52
+ # Query: "cli shell terminal"
53
+ gh search repos cli shell terminal --json fullName,stargazersCount,createdAt,updatedAt,description --limit 10
54
+ ```
55
+ </example>
56
+
57
+ <example category="combined">
58
+ ```bash
59
+ # Topics with additional keywords
60
+ gh search repos "release automation" --topic=semver,versioning --language=typescript --json fullName,stargazersCount,createdAt,updatedAt,description --limit 10
61
+ ```
62
+ </example>
63
+ </examples>
64
+
65
+ ## Output Format
66
+
67
+ ```bash
68
+ --json fullName,stargazersCount,createdAt,updatedAt,description --limit 10
69
+ ```
70
+
71
+ <example_output>
72
+ ```json
73
+ [
74
+ {"createdAt":"2020-03-17T21:23:36Z","description":"SEMVER validation Github Action","fullName":"rubenesp87/semver-validation-action","stargazersCount":8,"updatedAt":"2024-03-29T19:31:00Z"},
75
+ {"createdAt":"2024-10-07T16:18:55Z","description":"An example to prove semverValidate Helm function","fullName":"lucabaggi/helm-semver-validation","stargazersCount":0,"updatedAt":"2024-10-07T16:24:06Z"}
76
+ ]
77
+ ```
78
+ </example_output>
79
+
80
+ ## Result Processing
81
+
82
+ <process>
83
+ 1. Get top 10 results from gh
84
+ 2. Sort by `stargazersCount` descending
85
+ 3. Return top 5 for DeepWiki queries
86
+ </process>
87
+
88
+ ## Common Flags
89
+
90
+ | Flag | Purpose | Example |
91
+ |------|---------|---------|
92
+ | `--topic` | Filter by topics | `--topic=react,hooks` |
93
+ | `--language` | Filter by language | `--language=typescript` |
94
+ | `--owner` | Filter by owner | `--owner=facebook` |
95
+ | `--stars` | Min stars | `--stars=">100"` |
96
+ | `--sort` | Sort field | `--sort=stars` |
97
+ | `--order` | Sort order | `--order=desc` |
98
+ | `--limit` | Max results | `--limit=10` |
99
+ | `--json` | Output format | `--json fullName,stargazersCount` |
100
+ | `--archived` | Exclude archived | `--archived=false` |
101
+
102
+ ## JSON Available Fields
103
+ - createdAt
104
+ - defaultBranch
105
+ - description
106
+ - forksCount
107
+ - fullName
108
+ - hasDownloads
109
+ - hasIssues
110
+ - hasPages
111
+ - hasProjects
112
+ - hasWiki
113
+ - homepage
114
+ - id
115
+ - isArchived
116
+ - isDisabled
117
+ - isFork
118
+ - isPrivate
119
+ - language
120
+ - license
121
+ - name
122
+ - openIssuesCount
123
+ - owner
124
+ - pushedAt
125
+ - size
126
+ - stargazersCount
127
+ - updatedAt
128
+ - url
129
+ - visibility
130
+ - watchersCount
131
+
132
+ ## Error Handling
133
+
134
+ ```yaml
135
+ IF gh auth status fails:
136
+ → Fall back to search_tool or fetch_tool
137
+ IF gh search repos fails:
138
+ → Fall back to search_tool or fetch_tool
139
+ ```
140
+
141
+ ## Permission Opt-Out
142
+
143
+ Users can deny `gh` tool permission in OpenCode to opt out of this search method. The skill will automatically fall back to web search tools.
@@ -0,0 +1,40 @@
1
+ # Google Search Operators
2
+
3
+ Source: https://support.google.com/websearch/answer/2466433?hl=en
4
+
5
+ ## Essential Operators
6
+
7
+ | Operator | Syntax | Example | Purpose |
8
+ |----------|--------|---------|---------|
9
+ | Exact match | `"phrase"` | `"tallest building"` | Exact phrase match |
10
+ | Site search | `site:domain.com` | `site:youtube.com cat videos` | Search specific domain |
11
+ | Exclude | `-word` | `jaguar speed -car` | Exclude word from results |
12
+
13
+ ## Usage Notes
14
+
15
+ <important>
16
+ - No spaces between operator and search term: `site:nytimes.com` works, `site: nytimes.com` does not
17
+ - Operators can be combined: `"typescript" tutorial -paid`
18
+ - Quotes are useful for exact phrases like `"order of the phoenix"`
19
+ </important>
20
+
21
+ ## Common Patterns for Technical Search
22
+
23
+ <patterns>
24
+ ```bash
25
+ # Find libraries
26
+ typescript validation library npm
27
+
28
+ # Exact phrase
29
+ "semantic versioning" nodejs package
30
+
31
+ # Exclude results
32
+ graph database python -javascript
33
+
34
+ # Combined
35
+ semver typescript validation -test
36
+
37
+ # Package search
38
+ npm package semver compare
39
+ ```
40
+ </patterns>
@@ -0,0 +1,143 @@
1
+ # Search Workflow
2
+
3
+ Tool detection and search strategy for finding GitHub repositories.
4
+
5
+ <critical_rules priority="highest">
6
+ <rule>NEVER use `site:github.com` with search tools - returns full URLs that get misparsed</rule>
7
+ <rule>Only fetch EXTERNAL search engines, NEVER github.com URLs</rule>
8
+ <rule>Cycle through engines on failure: Brave → DuckDuckGo → Google</rule>
9
+ </critical_rules>
10
+
11
+ ## Tool Priority
12
+
13
+ ```yaml
14
+ detection:
15
+ IF gh auth status succeeds:
16
+ → Use gh search repos (PREFERRED - direct API)
17
+ ELSE IF search_tool exists:
18
+ → Use search tool with keywords (NOT site:github.com)
19
+ ELSE IF fetch_tool exists:
20
+ → Use URI-based search with engine cycling
21
+ ELSE:
22
+ → Report: "No search capability available"
23
+ → fallback to internal knowledge
24
+ ```
25
+
26
+ ## GitHub CLI (Preferred)
27
+
28
+ <detection>
29
+ ```bash
30
+ gh auth status # Exit 0 = available
31
+ ```
32
+ </detection>
33
+
34
+ <search_patterns priority="try_in_order">
35
+ ```bash
36
+ # 1. Full query with topics and language
37
+ gh search repos "{query}" --topic={topics} --language={lang} --json fullName,stargazersCount,createdAt,updatedAt,description --limit 10
38
+
39
+ # 2. Query with language only
40
+ gh search repos "{query}" --language={lang} --json fullName,stargazersCount,createdAt,updatedAt,description --limit 10
41
+
42
+ # 3. Topic-based search (no query string)
43
+ gh search repos --topic={topics} --language={lang} --json fullName,stargazersCount,createdAt,updatedAt,description --limit 10
44
+
45
+ # 4. Broader keyword search
46
+ gh search repos "{query}" --json fullName,stargazersCount,createdAt,updatedAt,description --limit 10
47
+ ```
48
+ </search_patterns>
49
+
50
+ <process>
51
+ 1. Infer topics from query (framework/library names → topics)
52
+ 2. Infer language if mentioned
53
+ 3. Sort by stargazersCount, return top 5
54
+ 4. Skip to DeepWiki query
55
+ </process>
56
+
57
+ See @gh-cli.md for detailed syntax.
58
+
59
+ ## Search Tool (Fallback #1)
60
+
61
+ <constraint>DO NOT use `site:github.com` - it returns full GitHub URLs that get misparsed as repos.</constraint>
62
+
63
+ <query_format>
64
+ ```json
65
+ { "query": "{technology} {feature} {language} library package" }
66
+ ```
67
+ </query_format>
68
+
69
+ <example>
70
+ ```json
71
+ { "query": "typescript semver validation library npm package" }
72
+ ```
73
+ </example>
74
+
75
+ <result_processing>
76
+ - Look for package names in snippets
77
+ - Find `github.com/owner/repo` references in descriptions
78
+ - Ignore navigation/ads
79
+ </result_processing>
80
+
81
+ ## URI-Based Search (Fallback #2)
82
+
83
+ When only fetch tools available, cycle through engines:
84
+
85
+ | Priority | Engine | URL |
86
+ |----------|--------|-----|
87
+ | 1 | Brave | `https://search.brave.com/search?q={terms}` |
88
+ | 2 | DuckDuckGo | `https://duckduckgo.com/?q={terms}` |
89
+ | 3 | Google | `https://www.google.com/search?q={terms}` |
90
+
91
+ <error_handling>
92
+ ```yaml
93
+ FOR each engine IN [brave, duckduckgo, google]:
94
+ result = fetch(engine_url)
95
+ IF success AND has_search_results:
96
+ RETURN result
97
+ CONTINUE
98
+ RETURN error: all engines failed
99
+ ```
100
+ </error_handling>
101
+
102
+ <failure_causes>
103
+ - JavaScript redirects (Google)
104
+ - Captchas (DuckDuckGo)
105
+ - HTML parsing issues
106
+ </failure_causes>
107
+
108
+ <example>
109
+ ```json
110
+ {
111
+ "url": "https://search.brave.com/search?q=typescript%20semver%20validation%20library",
112
+ "format": "markdown",
113
+ "timeout": 10
114
+ }
115
+ ```
116
+ </example>
117
+
118
+ ## Query Construction
119
+
120
+ <keyword_based>
121
+ ```
122
+ {technology} {feature} {language} library package
123
+ ```
124
+ </keyword_based>
125
+
126
+ <examples>
127
+ - `react hooks typescript library`
128
+ - `semver validation nodejs package`
129
+ - `graph database python library`
130
+ </examples>
131
+
132
+ <result_extraction>
133
+ - Look for `github.com/owner/repo` in snippet descriptions
134
+ - Find package names that map to known repos
135
+ - Follow links in documentation references
136
+ </result_extraction>
137
+
138
+ ## References
139
+
140
+ - @gh-cli.md - GitHub CLI syntax
141
+ - @google-search.md - Google operators
142
+ - @brave-search.md - Brave operators
143
+ - @ddg-search.md - DuckDuckGo operators