octocode-cli 1.3.0 → 1.3.1

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.
@@ -0,0 +1,112 @@
1
+ # Install Reference
2
+
3
+ Use this only when the user chooses `Install a skill`.
4
+
5
+ ## Validate Against Repo
6
+
7
+ If install behavior is unclear or may have changed, check these files before acting:
8
+
9
+ ```text
10
+ packages/octocode-cli/docs/SKILLS_GUIDE.md
11
+ packages/octocode-cli/src/cli/commands/skills.ts
12
+ packages/octocode-cli/src/utils/skills.ts
13
+ packages/octocode-cli/src/utils/skills-fetch.ts
14
+ packages/octocode-cli/src/ui/skills-menu/marketplace.ts
15
+ ```
16
+
17
+ GitHub references:
18
+
19
+ ```text
20
+ https://github.com/bgauryy/octocode-mcp/blob/main/packages/octocode-cli/docs/SKILLS_GUIDE.md
21
+ https://github.com/bgauryy/octocode-mcp/blob/main/packages/octocode-cli/src/cli/commands/skills.ts
22
+ https://github.com/bgauryy/octocode-mcp/blob/main/packages/octocode-cli/src/utils/skills.ts
23
+ https://github.com/bgauryy/octocode-mcp/blob/main/packages/octocode-cli/src/utils/skills-fetch.ts
24
+ https://github.com/bgauryy/octocode-mcp/blob/main/packages/octocode-cli/src/ui/skills-menu/marketplace.ts
25
+ ```
26
+
27
+ What to verify:
28
+ - `SKILLS_GUIDE.md`: current CLI examples, target names, default destinations, and `skillsDestDir`.
29
+ - `skills.ts`: default destination resolution and custom `skillsDestDir` behavior.
30
+ - `commands/skills.ts`: supported target names, prompts, install modes, conflict handling, and `--force` behavior.
31
+ - `skills-fetch.ts`: how marketplace skills are downloaded and written to disk.
32
+ - `marketplace.ts`: interactive marketplace prompts and install confirmation wording.
33
+
34
+ ## Input
35
+
36
+ Install input is a GitHub skill path, not only a skill name.
37
+
38
+ Accepted forms:
39
+
40
+ ```text
41
+ owner/repo/path/to/skill
42
+ owner/repo/path/to/skill/SKILL.md
43
+ https://github.com/<owner>/<repo>/tree/<branch>/<path-to-skill-folder>
44
+ https://github.com/<owner>/<repo>/blob/<branch>/<path-to-skill-folder>/SKILL.md
45
+ ```
46
+
47
+ Normalize `.../SKILL.md` to the containing folder. Derive `skill-name` from the final folder segment.
48
+
49
+ ## Targets
50
+
51
+ Default skill directories:
52
+
53
+ ```text
54
+ claude-code: ~/.claude/skills/
55
+ claude-desktop: ~/.claude-desktop/skills/
56
+ cursor: ~/.cursor/skills/
57
+ codex: ~/.codex/skills/
58
+ opencode: ~/.opencode/skills/
59
+ ```
60
+
61
+ For project-scoped Claude Code installs, `~/.octocode/config.json` can set:
62
+
63
+ ```json
64
+ { "skillsDestDir": "/your/project/.claude/skills" }
65
+ ```
66
+
67
+ This customizes the `claude-code` destination only.
68
+
69
+ ## Install Steps
70
+
71
+ 1. Validate the source path resolves to a folder containing `SKILL.md`.
72
+ 2. Confirm source path, description, targets, and install mode.
73
+ 3. Prefer copy. Use symlink only when the source folder is stable.
74
+ 4. Check conflicts:
75
+
76
+ ```bash
77
+ ls "<dest>/<skill-name>"
78
+ ```
79
+
80
+ If the folder exists, ask: `Overwrite`, `Skip`, or `Cancel`.
81
+
82
+ 5. Download the skill folder:
83
+
84
+ ```text
85
+ githubGetFileContent(queries: [{
86
+ id: "download",
87
+ owner,
88
+ repo,
89
+ path: "<path-to-skill-folder>",
90
+ type: "directory"
91
+ }])
92
+ ```
93
+
94
+ 6. Verify the returned folder:
95
+
96
+ ```bash
97
+ ls "<localPath>/SKILL.md"
98
+ ```
99
+
100
+ 7. Install:
101
+
102
+ ```bash
103
+ cp -r "<localPath>" "<dest>/<skill-name>"
104
+ ```
105
+
106
+ 8. Verify every destination:
107
+
108
+ ```bash
109
+ ls "<dest>/<skill-name>/SKILL.md"
110
+ ```
111
+
112
+ Report success or failure per target.
@@ -0,0 +1,321 @@
1
+ ---
2
+ name: octocode-search-skill
3
+ description: Search for, preview, and install agent skills (SKILL.md files) from GitHub. Use when the user asks to find, browse, preview, or install skills.
4
+ ---
5
+
6
+ # Octocode Search Skill
7
+
8
+ A skill is a folder with a required `SKILL.md`. The file must have frontmatter with `name` and `description`, then usage instructions, workflow, gates, examples, and any supporting files.
9
+
10
+ Flow: `BROWSE -> SEARCH -> PREVIEW -> INSTALL`
11
+
12
+ ## Tool Rules
13
+
14
+ Use Octocode MCP only. Do not use web browsing for GitHub.
15
+
16
+ - Search by keyword: `githubSearchCode`
17
+ - Discover skill repos: `githubSearchRepositories`
18
+ - Browse repo skills: `githubViewRepoStructure`, then `githubGetFileContent`
19
+ - Preview a skill: `githubGetFileContent`
20
+ - Download a skill folder: `githubGetFileContent(type="directory")`
21
+
22
+ Quality rules:
23
+ - Identify skills by `(owner/repo, path-to-SKILL.md)`, not repo alone.
24
+ - Treat stars as context and a tiebreaker, not proof of quality.
25
+ - Recommend only skills whose `name`, `description`, path, or visible body matches the request.
26
+ - Dedup by `(owner/repo, path)`.
27
+ - Skip files without valid `name:` and `description:` frontmatter.
28
+ - Aggregate all confirmed results before ranking. Do not stop at the first good match.
29
+ - Search exact names, related subjects, and semantic capability terms.
30
+
31
+ ## Discover Marketplaces
32
+
33
+ Never use a hardcoded list. Discover live:
34
+
35
+ ```text
36
+ githubSearchRepositories(queries: [
37
+ { id: "mkts_topic", topicsToSearch: ["agent-skills"], sort: "stars", limit: 20 },
38
+ { id: "mkts_keyword", keywordsToSearch: ["agent", "skills", "SKILL.md"], sort: "stars", limit: 20 }
39
+ ])
40
+ ```
41
+
42
+ Find repos with `skills/` or root-level `SKILL.md` files. Present ranked results with repo, stars, description, and why to browse it. Let the user pick.
43
+
44
+ Fallback seeds only if discovery returns nothing: `bgauryy/octocode-mcp`, `addyosmani/agent-skills`, `anthropics/skills`.
45
+
46
+ ## Browse A Repo
47
+
48
+ Use when the user names a marketplace or repo.
49
+
50
+ Step 1: list skill folders.
51
+
52
+ ```text
53
+ githubViewRepoStructure(queries: [{
54
+ id: "browse",
55
+ owner,
56
+ repo,
57
+ path: "<skills-path>",
58
+ depth: 1,
59
+ entriesPerPage: 200
60
+ }])
61
+ ```
62
+
63
+ Step 2: fetch frontmatter in batches of 3 to 5.
64
+
65
+ ```text
66
+ githubGetFileContent(queries: [
67
+ {
68
+ id: "desc_1",
69
+ owner,
70
+ repo,
71
+ path: "<skills-path>/<name>/SKILL.md",
72
+ matchString: "---",
73
+ matchStringContextLines: 6
74
+ }
75
+ ])
76
+ ```
77
+
78
+ Show a clean numbered list ordered by fit rating, then stars descending. Include skill name, repo, exact path, stars, description, one short fit note, and a concrete reason the skill relates to the user's request. Then ask the user what to do next:
79
+
80
+ ```text
81
+ Choose next step:
82
+ 1. Search again with a new query
83
+ 2. Preview or deep-dive into a skill
84
+ 3. Install a skill
85
+ ```
86
+
87
+ ## Search By Keyword
88
+
89
+ Search is a loop: understand intent, fan out, confirm, aggregate, show all, ask next step.
90
+
91
+ 1. Understand what the user needs to find.
92
+
93
+ Extract:
94
+ - Exact skill name or phrase, if provided.
95
+ - Core task or capability.
96
+ - Related subjects and adjacent workflows.
97
+ - Tools, frameworks, agents, or domains mentioned.
98
+ - Constraints such as language, IDE, security, docs, design, install, or review.
99
+
100
+ If intent is usable, search immediately. Ask a clarifying question only when the request is too vague to form search angles.
101
+
102
+ 2. Build search angles.
103
+
104
+ Create 4 groups:
105
+ - Name: exact phrase, lowercase, hyphenated, likely folder name.
106
+ - Subject: core domain keywords.
107
+ - Related: synonyms, adjacent tasks, common workflow names.
108
+ - Semantic: capability words that may appear in descriptions, such as audit, review, install, generate, migrate, document, debug, optimize.
109
+
110
+ For each group, keep 1 to 3 concise queries. Prefer recall first; rank later.
111
+
112
+ 3. Run discovery in parallel.
113
+
114
+ A. Exact name and path search. Use `filename: "SKILL.md"`, not a keyword.
115
+
116
+ ```text
117
+ githubSearchCode(queries: [
118
+ {
119
+ id: "name_content",
120
+ filename: "SKILL.md",
121
+ keywordsToSearch: ["<exact-or-name-query>"],
122
+ match: "file",
123
+ limit: 30
124
+ },
125
+ {
126
+ id: "name_path",
127
+ filename: "SKILL.md",
128
+ keywordsToSearch: ["<hyphenated-or-folder-query>"],
129
+ match: "path",
130
+ limit: 30
131
+ }
132
+ ])
133
+ ```
134
+
135
+ If the query looks like a GitHub username, add:
136
+
137
+ ```text
138
+ { id: "owner", filename: "SKILL.md", owner: "<query>", match: "file", limit: 30 }
139
+ ```
140
+
141
+ B. Subject and semantic search. Run several concise queries from the Subject, Related, and Semantic groups.
142
+
143
+ ```text
144
+ githubSearchCode(queries: [
145
+ {
146
+ id: "subject_1",
147
+ filename: "SKILL.md",
148
+ keywordsToSearch: ["<subject-query>"],
149
+ match: "file",
150
+ limit: 30
151
+ },
152
+ {
153
+ id: "related_1",
154
+ filename: "SKILL.md",
155
+ keywordsToSearch: ["<related-query>"],
156
+ match: "file",
157
+ limit: 30
158
+ },
159
+ {
160
+ id: "semantic_1",
161
+ filename: "SKILL.md",
162
+ keywordsToSearch: ["<semantic-capability-query>"],
163
+ match: "file",
164
+ limit: 30
165
+ }
166
+ ])
167
+ ```
168
+
169
+ C. Repo discovery.
170
+
171
+ ```text
172
+ githubSearchRepositories(queries: [{
173
+ id: "repos",
174
+ keywordsToSearch: ["<query>"],
175
+ topicsToSearch: ["agent-skills"],
176
+ sort: "stars",
177
+ limit: 20
178
+ }])
179
+ ```
180
+
181
+ 4. Confirm candidates.
182
+
183
+ Merge all candidates from A, B, and C. Dedup by `(owner/repo, path)`. For repo discovery results, inspect likely skill paths with `githubViewRepoStructure` before fetching frontmatter.
184
+
185
+ Fetch frontmatter in batches of 3 to 5:
186
+
187
+ ```text
188
+ githubGetFileContent(queries: [
189
+ {
190
+ id: "skill_1",
191
+ owner,
192
+ repo,
193
+ path: "<path-from-search>",
194
+ matchString: "---",
195
+ matchStringContextLines: 6
196
+ }
197
+ ])
198
+ ```
199
+
200
+ If a candidate looks strong but frontmatter is missing from the fetched window, preview a small body window once. If still invalid, skip it.
201
+
202
+ Ranking:
203
+ - Exact skill name match: +3000
204
+ - Partial skill name match: +1000
205
+ - Subject/domain match: +300
206
+ - Description match: +150
207
+ - Related workflow match: +100
208
+ - Semantic capability match: +75
209
+ - Body or visible text match: +50
210
+ - Stars tiebreaker: `sqrt(stars) * 30`
211
+
212
+ Common paths: `skills/<name>/SKILL.md`, `skills/<ns>/<name>/SKILL.md`, `<name>/SKILL.md`.
213
+
214
+ 5. Show all confirmed results.
215
+
216
+ Show every confirmed skill from the search cycle. Group by `Strong matches`, `Partial matches`, and `Explore`. Within each group, sort by fit rating first (`High` > `Medium` > `Low`), then stars descending, then relevance. Do not rank a lower-rated skill above a higher-rated skill because it has more stars.
217
+
218
+ Use compact, readable cards. Keep the output nicely formatted: short headings, consistent field order, concise prose, and no raw search dumps. Every card MUST include a `Why this matches` field that ties the skill back to the user's exact request, using evidence from the skill name, description, path, frontmatter, or visible body.
219
+
220
+ ```text
221
+ ## <skill-name> [<stars> stars, <owner>/<repo>]
222
+
223
+ What it does: <description>
224
+ When to use it: <trigger/use case>
225
+ How it works: <workflow/tools/gates>
226
+ Why this matches: <specific reason this skill is related to the user's request, citing the matching capability/trigger>
227
+ Source: <owner>/<repo> <path-to-SKILL.md>
228
+ Fit score: High|Medium|Low - <short reason>
229
+ ```
230
+
231
+ If there are many results, still show all names and sources. Keep cards short and preserve the rating-then-stars ordering.
232
+
233
+ 6. Ask what to do next.
234
+
235
+ ```text
236
+ Choose next step:
237
+ 1. Search again with a new query
238
+ 2. Preview or deep-dive into a skill
239
+ 3. Install a skill
240
+ 4. Keep researching related skills
241
+ ```
242
+
243
+ If results are weak or sparse, say why and continue one more search pass with broader related or semantic terms before giving up.
244
+
245
+ ## Install Gates
246
+
247
+ Do not skip gates.
248
+
249
+ Install input is a skill path, not just a name.
250
+
251
+ Reference: `INSTALL_REFERENCE.md`.
252
+
253
+ 1. Normalize input.
254
+
255
+ Accept `owner/repo/path/to/skill`, `owner/repo/path/to/skill/SKILL.md`, GitHub `tree` URLs, and GitHub `blob` URLs. Convert `.../SKILL.md` to the containing folder. Derive `<skill-name>` from the final folder name.
256
+
257
+ 2. Confirm install.
258
+
259
+ ```text
260
+ Install this skill?
261
+ description: <frontmatter description>
262
+ source: <owner>/<repo>/<path-to-skill-folder>
263
+ y / n
264
+ ```
265
+
266
+ 3. Ask targets.
267
+
268
+ ```text
269
+ 1. Claude only: claude-code, claude-desktop
270
+ 2. All agents: claude-code, claude-desktop, cursor, codex, opencode
271
+ 3. Pick one agent
272
+ 4. Custom path
273
+ ```
274
+
275
+ 4. Ask install mode. Default to copy. Use symlink only for stable source paths.
276
+
277
+ ```text
278
+ 1. Copy
279
+ 2. Symlink
280
+ 3. Cancel
281
+ ```
282
+
283
+ 5. Check conflicts.
284
+
285
+ Run `ls "<dest>/<skill-name>"`. If it exists, ask: `Overwrite`, `Skip`, or `Cancel`.
286
+
287
+ 6. Download.
288
+
289
+ ```text
290
+ githubGetFileContent(queries: [{
291
+ id: "download",
292
+ owner,
293
+ repo,
294
+ path: "<path-to-skill-folder>",
295
+ type: "directory"
296
+ }])
297
+ ```
298
+
299
+ 7. Verify download and install.
300
+
301
+ Confirm `SKILL.md` exists in the returned folder, then copy or symlink that exact folder:
302
+
303
+ ```bash
304
+ ls "<localPath>/SKILL.md"
305
+ cp -r "<localPath>" "<dest>/<skill-name>"
306
+ ```
307
+
308
+ 8. Verify each destination.
309
+
310
+ ```bash
311
+ ls "<dest>/<skill-name>/SKILL.md"
312
+ ```
313
+
314
+ Report success or failure per target.
315
+
316
+ ## Recovery
317
+
318
+ - Zero MCP search results: try synonyms, add owner scope, or use `githubSearchRepositories`.
319
+ - Skill path not found: run `githubViewRepoStructure` at repo root.
320
+ - Download fails: verify owner, repo, branch, and path; retry directory download.
321
+ - Octocode MCP unavailable: stop and say Octocode MCP is required.