@robosoft/skillhub-cli 0.1.1 → 0.3.2

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 (53) hide show
  1. package/CHANGELOG.md +21 -21
  2. package/README.md +166 -184
  3. package/bin/skillhub.mjs +734 -364
  4. package/docs/skillhub-cli-logic.md +115 -83
  5. package/package.json +8 -5
  6. package/skillhub-registry/CHANGELOG.md +65 -0
  7. package/skillhub-registry/CLAUDE.md +108 -0
  8. package/skillhub-registry/README.md +196 -16
  9. package/skillhub-registry/docs/cheat-sheet.md +272 -0
  10. package/skillhub-registry/docs/contributing.md +166 -0
  11. package/skillhub-registry/docs/cost-hygiene.md +175 -0
  12. package/skillhub-registry/docs/customization.md +321 -0
  13. package/skillhub-registry/docs/exception-process.md +194 -0
  14. package/skillhub-registry/docs/installation.md +277 -0
  15. package/skillhub-registry/domain/api.md +303 -0
  16. package/skillhub-registry/domain/frontend/web-app.md +17 -0
  17. package/skillhub-registry/domain/frontend-app.md +46 -0
  18. package/skillhub-registry/domain/frontend-architecture.md +126 -0
  19. package/skillhub-registry/rules/anti-patterns.md +95 -0
  20. package/skillhub-registry/rules/code-standards.md +182 -0
  21. package/skillhub-registry/rules/frontend/antipattern.md +21 -0
  22. package/skillhub-registry/rules/frontend/component-standards.md +10 -0
  23. package/skillhub-registry/rules/frontend-app.md +24 -0
  24. package/skillhub-registry/rules/general.md +51 -0
  25. package/skillhub-registry/skills/api/SKILL.md +167 -0
  26. package/skillhub-registry/skills/build/SKILL.md +114 -0
  27. package/skillhub-registry/skills/fast/SKILL.md +56 -0
  28. package/skillhub-registry/skills/feature-dev/SKILL.md +166 -0
  29. package/skillhub-registry/skills/frontend/app/SKILL.md +28 -0
  30. package/skillhub-registry/skills/frontend/app/rules/main.md +6 -0
  31. package/skillhub-registry/skills/frontend/app/skill.json +10 -0
  32. package/skillhub-registry/skills/frontend/app/templates/feature/{{kebabName}}.tsx.hbs +11 -0
  33. package/skillhub-registry/skills/frontend-app/SKILL.md +48 -0
  34. package/skillhub-registry/skills/frontend-app/rules/main.md +6 -0
  35. package/skillhub-registry/skills/frontend-app/skill.json +11 -0
  36. package/skillhub-registry/skills/frontend-app/templates/feature/{{kebabName}}.tsx.hbs +11 -0
  37. package/skillhub-registry/skills/performance/SKILL.md +168 -0
  38. package/skillhub-registry/skills/react/SKILL.md +224 -0
  39. package/skillhub-registry/skills/refactor/SKILL.md +149 -0
  40. package/skillhub-registry/skills/review/SKILL.md +199 -0
  41. package/skillhub-registry/skills/strict/SKILL.md +74 -0
  42. package/skillhub-registry/skills/testing/SKILL.md +132 -0
  43. package/skillhub-registry/accessibility-review/1.0.0/SKILL.md +0 -22
  44. package/skillhub-registry/accessibility-review/1.0.0/checklist/ui-review.md +0 -8
  45. package/skillhub-registry/accessibility-review/1.0.0/skill.json +0 -9
  46. package/skillhub-registry/nextjs-clean-architecture/1.0.0/SKILL.md +0 -37
  47. package/skillhub-registry/nextjs-clean-architecture/1.0.0/checklist/definition-of-done.md +0 -9
  48. package/skillhub-registry/nextjs-clean-architecture/1.0.0/rules/folder-structure.md +0 -7
  49. package/skillhub-registry/nextjs-clean-architecture/1.0.0/skill.json +0 -9
  50. package/skillhub-registry/shadcn-crud-generator/1.0.0/SKILL.md +0 -25
  51. package/skillhub-registry/shadcn-crud-generator/1.0.0/skill.json +0 -9
  52. package/skillhub-registry/shadcn-crud-generator/1.0.0/templates/feature/actions.ts.hbs +0 -16
  53. package/skillhub-registry/shadcn-crud-generator/1.0.0/templates/feature/page.tsx.hbs +0 -13
package/CHANGELOG.md CHANGED
@@ -1,29 +1,29 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.1
3
+ ## 0.3.2
4
4
 
5
- - Added configurable install targets: `ai`, `cursor`, and `claude`.
6
- - Added `skillhub target` command.
7
- - Added `--target` / `--to` support for `init`, `install`, and `sync`.
8
- - Cursor skills now install under `.cursor/skills` and update `.cursor/rules/skillhub.mdc`.
9
- - Claude skills now install under `.claude/skills` and update `CLAUDE.md` plus `.claude/skillhub.md`.
10
- - Added `cloude` alias for `claude`.
5
+ - Changed Cursor rule attachment path from `.cursor/rules/skillhub/<name>.md` to `.cursor/rules/<name>.md`.
6
+ - Added migration for old Cursor config that still points rules to `.cursor/rules/skillhub`.
7
+ - Kept the generated adapter file as `.cursor/rules/skillhub.md` so Cursor has one index file listing attached knowledge.
11
8
 
12
- # Changelog
9
+ ## 0.3.1
10
+
11
+ - Treat registry/category prefixes like `frontend/` as lookup-only identifiers.
12
+ - Install local files using the last path segment, for example `frontend/antipattern` -> `antipattern.md`.
13
+ - Store source name, local name, version, and install path in `skillhub.json`.
14
+ - Make `skillhub add` with no arguments restore/reinstall all entries from `skillhub.json`.
15
+ - Allow removal by source path or local name.
13
16
 
14
- ## 0.1.0
17
+ ## 0.3.0
15
18
 
16
- Initial publishable release of SkillHub CLI.
19
+ - Added short fetch commands: `skillhub skill`, `skillhub rule`, and `skillhub domain`.
20
+ - Added nested path support such as `skillhub rule frontend/antipattern`.
21
+ - Cursor adapter output now uses `.md` files only.
22
+ - Added remote web-app registry contract: `/api/skillhub/:section/:path/:version`.
23
+ - Repositioned CLI as the consumer/fetcher while the SkillHub web app is the authoring system.
24
+ - Added bundled examples for `frontend/app`, `frontend/antipattern`, and `frontend/web-app`.
17
25
 
18
- ### Added
26
+ ## 0.2.0
19
27
 
20
- - `skillhub init`
21
- - `skillhub install <skill[@version]>`
22
- - `skillhub sync`
23
- - `skillhub list`
24
- - `skillhub remove <skill>`
25
- - `skillhub create <skill>`
26
- - `skillhub validate <skill|path>`
27
- - `skillhub generate <skill> <template> <name>`
28
- - Local demo registry with sample skills
29
- - `AGENTS.md` and Cursor rule adapter generation
28
+ - Added skills, rules, and domain knowledge sections.
29
+ - Added Cursor, Claude, and generic AI targets.
package/README.md CHANGED
@@ -1,263 +1,245 @@
1
1
  # SkillHub CLI
2
2
 
3
- Install reusable AI/project skills into any codebase, similar to installing packages with npm.
3
+ Fetch reusable SkillHub knowledge from a web app or registry and attach it to an IDE project.
4
4
 
5
- A SkillHub skill can include AI instructions, coding rules, templates, checklists, examples, and generator files.
5
+ SkillHub has three knowledge sections:
6
6
 
7
- ## Package Name
7
+ - **Skills**: capability/workflow packages, usually folders with `SKILL.md`, templates, examples, and supporting rules.
8
+ - **Rules**: focused `.md` rule files such as `frontend/antipattern.md` or `backend/security.md`.
9
+ - **Domain**: product, business, architecture, or platform knowledge in `.md` files.
8
10
 
9
- ```json
10
- {
11
- "name": "@robosoft/skillhub-cli",
12
- "bin": {
13
- "skillhub": "./bin/skillhub.mjs"
14
- }
15
- }
16
- ```
11
+ The web frontend is the authoring system. Teams create and maintain skills, rules, and domain knowledge there. The CLI is the consumer used inside projects to fetch and attach that knowledge to Cursor, Claude, or a generic `.ai` folder. Yes, finally, the prompts are leaving sticky notes and becoming infrastructure.
17
12
 
18
- The npm package is `@robosoft/skillhub-cli`, but the terminal command is still:
19
-
20
- ```bash
21
- skillhub
22
- ```
23
-
24
- ## Requirements
25
-
26
- - Node.js 20+
27
-
28
- ## Global Install After Publishing
13
+ ## Install
29
14
 
30
15
  ```bash
31
16
  npm install -g @robosoft/skillhub-cli
32
- skillhub --help
33
- ```
34
-
35
- ## Publish to npm
36
-
37
- This zip is prepared for public npm publishing as `@robosoft/skillhub-cli`.
38
-
39
- You must own or have access to the npm scope/organization `@robosoft`.
40
-
41
- ```bash
42
- npm login
43
- npm whoami
44
- npm org ls robosoft
45
- npm pack --dry-run
46
- npm publish --access public
47
- ```
48
-
49
- If you do not own the `@robosoft` npm scope, update the `name` field in `package.json` before publishing.
50
-
51
- Example fallback:
52
-
53
- ```json
54
- {
55
- "name": "@vikramrajput1987/skillhub-cli"
56
- }
57
- ```
58
-
59
- ## Local Usage
60
-
61
- From this folder:
62
-
63
- ```bash
64
- npm run skillhub -- --help
65
- ```
66
-
67
- Or run directly:
68
-
69
- ```bash
70
- node ./bin/skillhub.mjs --help
71
17
  ```
72
18
 
73
- ## Use in Any Project
74
-
75
- Create SkillHub config inside your target project. The CLI can now ask where to place skill files:
19
+ If your Mac blocks global install with `EACCES`, set a user-owned npm global directory:
76
20
 
77
21
  ```bash
78
- skillhub init
22
+ mkdir -p ~/.npm-global
23
+ npm config set prefix "$HOME/.npm-global"
24
+ echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.zshrc
25
+ source ~/.zshrc
26
+ npm install -g @robosoft/skillhub-cli
79
27
  ```
80
28
 
81
- Or pass the target directly:
29
+ ## Quick Start
82
30
 
83
31
  ```bash
84
32
  skillhub init --target cursor
85
- skillhub init --target claude
86
- skillhub init --target ai
33
+ skillhub skill frontend/app
34
+ skillhub rule frontend/antipattern
35
+ skillhub domain frontend/web-app
36
+ skillhub list
87
37
  ```
88
38
 
89
- Targets:
39
+ Cursor output uses only `.md` files. Registry/category prefixes like `frontend/` are used only for lookup. Locally the CLI installs by the last path segment:
90
40
 
91
41
  ```txt
92
- ai -> .ai/skills + AGENTS.md
93
- cursor -> .cursor/skills + .cursor/rules/skillhub.mdc
94
- claude -> .claude/skills + CLAUDE.md + .claude/skillhub.md
95
- ```
42
+ .cursor/
43
+ skills/
44
+ app/
45
+ SKILL.md
46
+ skill.json
47
+ rules/
48
+ templates/
49
+ rules/
50
+ skillhub.md
51
+ antipattern.md
52
+ domain/
53
+ web-app.md
54
+ ```
55
+
56
+ Claude output:
96
57
 
97
- Install a skill from a local registry:
98
-
99
- ```bash
100
- skillhub install nextjs-clean-architecture --registry ./skillhub-registry
58
+ ```txt
59
+ .claude/
60
+ skills/
61
+ rules/
62
+ domain/
63
+ CLAUDE.md
101
64
  ```
102
65
 
103
- Install directly into Cursor skill location:
66
+ Generic AI output:
104
67
 
105
- ```bash
106
- skillhub install nextjs-clean-architecture --target cursor --registry ./skillhub-registry
68
+ ```txt
69
+ .ai/
70
+ skills/
71
+ rules/
72
+ domain/
73
+ AGENTS.md
107
74
  ```
108
75
 
109
- Install directly into Claude skill location:
76
+ ## Commands
110
77
 
111
78
  ```bash
112
- skillhub install nextjs-clean-architecture --target claude --registry ./skillhub-registry
113
- ```
79
+ skillhub init --target cursor
80
+ skillhub target claude
114
81
 
115
- Install a specific version:
82
+ # Short commands
83
+ skillhub skill frontend/app
84
+ skillhub rule frontend/antipattern
85
+ skillhub domain frontend/web-app
116
86
 
117
- ```bash
118
- skillhub install shadcn-crud-generator@1.0.0 --registry ./skillhub-registry
119
- ```
87
+ # Equivalent attach syntax
88
+ skillhub attach skill frontend/app
89
+ skillhub attach rule frontend/antipattern
90
+ skillhub attach domain frontend/web-app
120
91
 
121
- List installed skills:
92
+ # Backward compatible install syntax
93
+ skillhub install frontend/app
94
+ skillhub install rule frontend/antipattern
95
+ skillhub install domain frontend/web-app
122
96
 
123
- ```bash
97
+ skillhub search frontend
98
+ skillhub sync
99
+ skillhub add # restore everything listed in skillhub.json
124
100
  skillhub list
101
+ skillhub remove rule frontend/antipattern
125
102
  ```
126
103
 
127
- Change target later:
104
+ ## Web App Registry Usage
128
105
 
129
- ```bash
130
- skillhub target cursor
131
- skillhub target claude
132
- skillhub target ai
133
- ```
134
-
135
- Sync all skills from `skillhub.json`:
106
+ Point the CLI to your SkillHub web app registry:
136
107
 
137
108
  ```bash
138
- skillhub sync
109
+ skillhub init --target cursor --registry https://skillhub.your-company.com
110
+ skillhub rule frontend/antipattern
111
+ skillhub skill frontend/app
112
+ skillhub domain frontend/web-app
139
113
  ```
140
114
 
141
- Remove a skill:
115
+ The recommended web API contract is:
142
116
 
143
- ```bash
144
- skillhub remove nextjs-clean-architecture
117
+ ```txt
118
+ GET /api/skillhub/:section/:path/:version
145
119
  ```
146
120
 
147
- Create a new skill package:
121
+ Examples:
148
122
 
149
- ```bash
150
- skillhub create api-security-rules --category security --version 1.0.0
123
+ ```txt
124
+ GET /api/skillhub/rules/frontend/antipattern/latest
125
+ GET /api/skillhub/skills/frontend/app/latest
126
+ GET /api/skillhub/domain/frontend/web-app/latest
151
127
  ```
152
128
 
153
- Validate a skill:
129
+ Expected response:
154
130
 
155
- ```bash
156
- skillhub validate api-security-rules --registry ./skillhub-registry
131
+ ```json
132
+ {
133
+ "manifest": {
134
+ "name": "frontend/antipattern",
135
+ "version": "1.0.0",
136
+ "type": "rule",
137
+ "section": "rules",
138
+ "entry": "RULE.md"
139
+ },
140
+ "files": [
141
+ {
142
+ "path": "RULE.md",
143
+ "content": "# Frontend Anti-Patterns\n..."
144
+ }
145
+ ]
146
+ }
157
147
  ```
158
148
 
159
- Generate code from an installed template:
149
+ The CLI also supports a registry-only URL style:
160
150
 
161
- ```bash
162
- skillhub install shadcn-crud-generator --registry ./skillhub-registry
163
- skillhub generate shadcn-crud-generator feature products --out src/features/products
151
+ ```txt
152
+ GET /rules/frontend/antipattern/latest
153
+ GET /skills/frontend/app/latest
154
+ GET /domain/frontend/web-app/latest
164
155
  ```
165
156
 
166
- ## Demo Registry
157
+ ## Local Registry Shape
167
158
 
168
- This standalone project includes a demo local registry:
159
+ Useful for local development or bundled examples:
169
160
 
170
161
  ```txt
171
162
  skillhub-registry/
172
- nextjs-clean-architecture/
173
- shadcn-crud-generator/
174
- accessibility-review/
175
- ```
176
-
177
- For testing inside this package:
178
-
179
- ```bash
180
- npm run demo:init
181
- npm run demo:install
182
- npm run demo:list
183
- npm run demo:validate
163
+ skills/
164
+ frontend/
165
+ app/
166
+ skill.json
167
+ SKILL.md
168
+ rules/
169
+ templates/
170
+ rules/
171
+ frontend/
172
+ antipattern.md
173
+ component-standards.md
174
+ domain/
175
+ frontend/
176
+ web-app.md
184
177
  ```
185
178
 
186
- ## Project Output
179
+ If `./skillhub-registry` does not exist in your project, the CLI falls back to the bundled registry shipped inside the package.
187
180
 
188
- After installing skills, the target project gets files based on the selected target.
181
+ ## Project Manifest and Restore
189
182
 
190
- For `--target cursor`:
183
+ Every attached item is stored in `skillhub.json`, using the source path from the web app/registry and the local install name.
191
184
 
192
- ```txt
193
- .cursor/skills/<skill-name>/
194
- .cursor/rules/skillhub.mdc
195
- skillhub.json
196
- skillhub.lock.json
197
- ```
185
+ Example after running:
198
186
 
199
- For `--target claude`:
200
-
201
- ```txt
202
- .claude/skills/<skill-name>/
203
- .claude/skillhub.md
204
- CLAUDE.md
205
- skillhub.json
206
- skillhub.lock.json
187
+ ```bash
188
+ skillhub rule frontend/antipattern
189
+ skillhub skill frontend/app
190
+ skillhub domain frontend/web-app
207
191
  ```
208
192
 
209
- For `--target ai`:
193
+ `skillhub.json` stores:
210
194
 
211
- ```txt
212
- .ai/skills/<skill-name>/
213
- AGENTS.md
214
- skillhub.json
215
- skillhub.lock.json
195
+ ```json
196
+ {
197
+ "installed": {
198
+ "skills": {
199
+ "frontend/app": {
200
+ "name": "frontend/app",
201
+ "localName": "app",
202
+ "version": "1.0.0",
203
+ "installTo": ".cursor/skills/app"
204
+ }
205
+ },
206
+ "rules": {
207
+ "frontend/antipattern": {
208
+ "name": "frontend/antipattern",
209
+ "localName": "antipattern",
210
+ "version": "1.0.0",
211
+ "installTo": ".cursor/rules/antipattern.md"
212
+ }
213
+ },
214
+ "domain": {
215
+ "frontend/web-app": {
216
+ "name": "frontend/web-app",
217
+ "localName": "web-app",
218
+ "version": "1.0.0",
219
+ "installTo": ".cursor/domain/web-app.md"
220
+ }
221
+ }
222
+ }
223
+ }
216
224
  ```
217
225
 
218
- ## Supported Commands
226
+ If someone deletes `.cursor/skills/app` or `.cursor/rules/antipattern.md`, run:
219
227
 
220
- ```txt
221
- skillhub init [--target ai|cursor|claude]
222
- skillhub target [ai|cursor|claude]
223
- skillhub install <skill[@version]> [--target ai|cursor|claude]
224
- skillhub sync
225
- skillhub list
226
- skillhub remove <skill>
227
- skillhub create <skill>
228
- skillhub validate <skill|path>
229
- skillhub generate <skill> <template> <name>
228
+ ```bash
229
+ skillhub add
230
230
  ```
231
231
 
232
- ## Remote Registry Contract
232
+ The CLI re-fetches and restores everything listed in `skillhub.json`.
233
233
 
234
- The CLI also supports remote registries:
234
+ Use `--as` only when you want a custom local name:
235
235
 
236
236
  ```bash
237
- skillhub install nextjs-clean-architecture --registry https://your-registry.com/api
238
- ```
239
-
240
- Expected endpoint format:
241
-
242
- ```txt
243
- GET /skills/:name/:version
244
- GET /skills/:name/latest
237
+ skillhub rule frontend/antipattern --as frontend-antipattern
245
238
  ```
246
239
 
247
- Expected response:
240
+ ## Publishing
248
241
 
249
- ```json
250
- {
251
- "manifest": {
252
- "name": "nextjs-clean-architecture",
253
- "version": "1.0.0",
254
- "entry": "SKILL.md"
255
- },
256
- "files": [
257
- {
258
- "path": "SKILL.md",
259
- "content": "# Next.js Clean Architecture"
260
- }
261
- ]
262
- }
242
+ ```bash
243
+ npm login
244
+ npm publish --access public
263
245
  ```