@robosoft/skillhub-cli 0.1.2 → 0.3.3

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 (51) hide show
  1. package/CHANGELOG.md +26 -25
  2. package/README.md +162 -182
  3. package/bin/skillhub.mjs +722 -365
  4. package/docs/skillhub-cli-logic.md +114 -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/skill.json +10 -0
  31. package/skillhub-registry/skills/frontend/app/templates/feature/{{kebabName}}.tsx.hbs +11 -0
  32. package/skillhub-registry/skills/frontend-app/SKILL.md +48 -0
  33. package/skillhub-registry/skills/frontend-app/skill.json +11 -0
  34. package/skillhub-registry/skills/frontend-app/templates/feature/{{kebabName}}.tsx.hbs +11 -0
  35. package/skillhub-registry/skills/performance/SKILL.md +168 -0
  36. package/skillhub-registry/skills/react/SKILL.md +224 -0
  37. package/skillhub-registry/skills/refactor/SKILL.md +149 -0
  38. package/skillhub-registry/skills/review/SKILL.md +199 -0
  39. package/skillhub-registry/skills/strict/SKILL.md +74 -0
  40. package/skillhub-registry/skills/testing/SKILL.md +132 -0
  41. package/skillhub-registry/accessibility-review/1.0.0/SKILL.md +0 -22
  42. package/skillhub-registry/accessibility-review/1.0.0/checklist/ui-review.md +0 -8
  43. package/skillhub-registry/accessibility-review/1.0.0/skill.json +0 -9
  44. package/skillhub-registry/nextjs-clean-architecture/1.0.0/SKILL.md +0 -37
  45. package/skillhub-registry/nextjs-clean-architecture/1.0.0/checklist/definition-of-done.md +0 -9
  46. package/skillhub-registry/nextjs-clean-architecture/1.0.0/rules/folder-structure.md +0 -7
  47. package/skillhub-registry/nextjs-clean-architecture/1.0.0/skill.json +0 -9
  48. package/skillhub-registry/shadcn-crud-generator/1.0.0/SKILL.md +0 -25
  49. package/skillhub-registry/shadcn-crud-generator/1.0.0/skill.json +0 -9
  50. package/skillhub-registry/shadcn-crud-generator/1.0.0/templates/feature/actions.ts.hbs +0 -16
  51. package/skillhub-registry/shadcn-crud-generator/1.0.0/templates/feature/page.tsx.hbs +0 -13
package/CHANGELOG.md CHANGED
@@ -1,35 +1,36 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.2
3
+ ## 0.3.3
4
4
 
5
- - Fixed `skillhub init --target cursor` when `skillhub.json` already exists.
6
- - Existing projects now update `target`, `skillsDir`, and adapters instead of continuing to create `.ai/skills`.
7
- - Added clearer init output showing the active target.
5
+ - Changed skill attach output so skill packages do not copy internal `rules/` folders into `.cursor/skills/<name>` or other target skill folders.
6
+ - Kept rules as explicit top-level artifacts installed by `skillhub rule <category/name>`.
7
+ - Updated local skill creation so `skillhub create skill <name>` creates `SKILL.md`, `skill.json`, and `templates/`, but not `rules/`.
8
8
 
9
- ## 0.1.1
10
9
 
11
- - Added configurable install targets: `ai`, `cursor`, and `claude`.
12
- - Added `skillhub target` command.
13
- - Added `--target` / `--to` support for `init`, `install`, and `sync`.
14
- - Cursor skills now install under `.cursor/skills` and update `.cursor/rules/skillhub.mdc`.
15
- - Claude skills now install under `.claude/skills` and update `CLAUDE.md` plus `.claude/skillhub.md`.
16
- - Added `cloude` alias for `claude`.
10
+ ## 0.3.2
17
11
 
18
- # Changelog
12
+ - Changed Cursor rule attachment path from `.cursor/rules/skillhub/<name>.md` to `.cursor/rules/<name>.md`.
13
+ - Added migration for old Cursor config that still points rules to `.cursor/rules/skillhub`.
14
+ - Kept the generated adapter file as `.cursor/rules/skillhub.md` so Cursor has one index file listing attached knowledge.
15
+
16
+ ## 0.3.1
17
+
18
+ - Treat registry/category prefixes like `frontend/` as lookup-only identifiers.
19
+ - Install local files using the last path segment, for example `frontend/antipattern` -> `antipattern.md`.
20
+ - Store source name, local name, version, and install path in `skillhub.json`.
21
+ - Make `skillhub add` with no arguments restore/reinstall all entries from `skillhub.json`.
22
+ - Allow removal by source path or local name.
19
23
 
20
- ## 0.1.0
24
+ ## 0.3.0
21
25
 
22
- Initial publishable release of SkillHub CLI.
26
+ - Added short fetch commands: `skillhub skill`, `skillhub rule`, and `skillhub domain`.
27
+ - Added nested path support such as `skillhub rule frontend/antipattern`.
28
+ - Cursor adapter output now uses `.md` files only.
29
+ - Added remote web-app registry contract: `/api/skillhub/:section/:path/:version`.
30
+ - Repositioned CLI as the consumer/fetcher while the SkillHub web app is the authoring system.
31
+ - Added bundled examples for `frontend/app`, `frontend/antipattern`, and `frontend/web-app`.
23
32
 
24
- ### Added
33
+ ## 0.2.0
25
34
 
26
- - `skillhub init`
27
- - `skillhub install <skill[@version]>`
28
- - `skillhub sync`
29
- - `skillhub list`
30
- - `skillhub remove <skill>`
31
- - `skillhub create <skill>`
32
- - `skillhub validate <skill|path>`
33
- - `skillhub generate <skill> <template> <name>`
34
- - Local demo registry with sample skills
35
- - `AGENTS.md` and Cursor rule adapter generation
35
+ - Added skills, rules, and domain knowledge sections.
36
+ - Added Cursor, Claude, and generic AI targets.
package/README.md CHANGED
@@ -1,263 +1,243 @@
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`, `skill.json`, templates, and examples. Rules are attached separately with `skillhub rule ...`.
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
17
  ```
34
18
 
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`.
19
+ If your Mac blocks global install with `EACCES`, set a user-owned npm global directory:
40
20
 
41
21
  ```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
- ```
72
-
73
- ## Use in Any Project
74
-
75
- Create SkillHub config inside your target project. The CLI can now ask where to place skill files:
76
-
77
- ```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
42
+ .cursor/
43
+ skills/
44
+ app/
45
+ SKILL.md
46
+ skill.json
47
+ templates/
48
+ rules/
49
+ skillhub.md
50
+ antipattern.md
51
+ domain/
52
+ web-app.md
95
53
  ```
96
54
 
97
- Install a skill from a local registry:
55
+ Claude output:
98
56
 
99
- ```bash
100
- skillhub install nextjs-clean-architecture --registry ./skillhub-registry
57
+ ```txt
58
+ .claude/
59
+ skills/
60
+ rules/
61
+ domain/
62
+ CLAUDE.md
101
63
  ```
102
64
 
103
- Install directly into Cursor skill location:
65
+ Generic AI output:
104
66
 
105
- ```bash
106
- skillhub install nextjs-clean-architecture --target cursor --registry ./skillhub-registry
67
+ ```txt
68
+ .ai/
69
+ skills/
70
+ rules/
71
+ domain/
72
+ AGENTS.md
107
73
  ```
108
74
 
109
- Install directly into Claude skill location:
75
+ ## Commands
110
76
 
111
77
  ```bash
112
- skillhub install nextjs-clean-architecture --target claude --registry ./skillhub-registry
113
- ```
78
+ skillhub init --target cursor
79
+ skillhub target claude
114
80
 
115
- Install a specific version:
81
+ # Short commands
82
+ skillhub skill frontend/app
83
+ skillhub rule frontend/antipattern
84
+ skillhub domain frontend/web-app
116
85
 
117
- ```bash
118
- skillhub install shadcn-crud-generator@1.0.0 --registry ./skillhub-registry
119
- ```
86
+ # Equivalent attach syntax
87
+ skillhub attach skill frontend/app
88
+ skillhub attach rule frontend/antipattern
89
+ skillhub attach domain frontend/web-app
120
90
 
121
- List installed skills:
91
+ # Backward compatible install syntax
92
+ skillhub install frontend/app
93
+ skillhub install rule frontend/antipattern
94
+ skillhub install domain frontend/web-app
122
95
 
123
- ```bash
96
+ skillhub search frontend
97
+ skillhub sync
98
+ skillhub add # restore everything listed in skillhub.json
124
99
  skillhub list
100
+ skillhub remove rule frontend/antipattern
125
101
  ```
126
102
 
127
- Change target later:
103
+ ## Web App Registry Usage
128
104
 
129
- ```bash
130
- skillhub target cursor
131
- skillhub target claude
132
- skillhub target ai
133
- ```
134
-
135
- Sync all skills from `skillhub.json`:
105
+ Point the CLI to your SkillHub web app registry:
136
106
 
137
107
  ```bash
138
- skillhub sync
108
+ skillhub init --target cursor --registry https://skillhub.your-company.com
109
+ skillhub rule frontend/antipattern
110
+ skillhub skill frontend/app
111
+ skillhub domain frontend/web-app
139
112
  ```
140
113
 
141
- Remove a skill:
114
+ The recommended web API contract is:
142
115
 
143
- ```bash
144
- skillhub remove nextjs-clean-architecture
116
+ ```txt
117
+ GET /api/skillhub/:section/:path/:version
145
118
  ```
146
119
 
147
- Create a new skill package:
120
+ Examples:
148
121
 
149
- ```bash
150
- skillhub create api-security-rules --category security --version 1.0.0
122
+ ```txt
123
+ GET /api/skillhub/rules/frontend/antipattern/latest
124
+ GET /api/skillhub/skills/frontend/app/latest
125
+ GET /api/skillhub/domain/frontend/web-app/latest
151
126
  ```
152
127
 
153
- Validate a skill:
128
+ Expected response:
154
129
 
155
- ```bash
156
- skillhub validate api-security-rules --registry ./skillhub-registry
130
+ ```json
131
+ {
132
+ "manifest": {
133
+ "name": "frontend/antipattern",
134
+ "version": "1.0.0",
135
+ "type": "rule",
136
+ "section": "rules",
137
+ "entry": "RULE.md"
138
+ },
139
+ "files": [
140
+ {
141
+ "path": "RULE.md",
142
+ "content": "# Frontend Anti-Patterns\n..."
143
+ }
144
+ ]
145
+ }
157
146
  ```
158
147
 
159
- Generate code from an installed template:
148
+ The CLI also supports a registry-only URL style:
160
149
 
161
- ```bash
162
- skillhub install shadcn-crud-generator --registry ./skillhub-registry
163
- skillhub generate shadcn-crud-generator feature products --out src/features/products
150
+ ```txt
151
+ GET /rules/frontend/antipattern/latest
152
+ GET /skills/frontend/app/latest
153
+ GET /domain/frontend/web-app/latest
164
154
  ```
165
155
 
166
- ## Demo Registry
156
+ ## Local Registry Shape
167
157
 
168
- This standalone project includes a demo local registry:
158
+ Useful for local development or bundled examples:
169
159
 
170
160
  ```txt
171
161
  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
162
+ skills/
163
+ frontend/
164
+ app/
165
+ skill.json
166
+ SKILL.md
167
+ templates/
168
+ rules/
169
+ frontend/
170
+ antipattern.md
171
+ component-standards.md
172
+ domain/
173
+ frontend/
174
+ web-app.md
184
175
  ```
185
176
 
186
- ## Project Output
177
+ If `./skillhub-registry` does not exist in your project, the CLI falls back to the bundled registry shipped inside the package.
187
178
 
188
- After installing skills, the target project gets files based on the selected target.
179
+ ## Project Manifest and Restore
189
180
 
190
- For `--target cursor`:
181
+ Every attached item is stored in `skillhub.json`, using the source path from the web app/registry and the local install name.
191
182
 
192
- ```txt
193
- .cursor/skills/<skill-name>/
194
- .cursor/rules/skillhub.mdc
195
- skillhub.json
196
- skillhub.lock.json
197
- ```
183
+ Example after running:
198
184
 
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
185
+ ```bash
186
+ skillhub rule frontend/antipattern
187
+ skillhub skill frontend/app
188
+ skillhub domain frontend/web-app
207
189
  ```
208
190
 
209
- For `--target ai`:
191
+ `skillhub.json` stores:
210
192
 
211
- ```txt
212
- .ai/skills/<skill-name>/
213
- AGENTS.md
214
- skillhub.json
215
- skillhub.lock.json
193
+ ```json
194
+ {
195
+ "installed": {
196
+ "skills": {
197
+ "frontend/app": {
198
+ "name": "frontend/app",
199
+ "localName": "app",
200
+ "version": "1.0.0",
201
+ "installTo": ".cursor/skills/app"
202
+ }
203
+ },
204
+ "rules": {
205
+ "frontend/antipattern": {
206
+ "name": "frontend/antipattern",
207
+ "localName": "antipattern",
208
+ "version": "1.0.0",
209
+ "installTo": ".cursor/rules/antipattern.md"
210
+ }
211
+ },
212
+ "domain": {
213
+ "frontend/web-app": {
214
+ "name": "frontend/web-app",
215
+ "localName": "web-app",
216
+ "version": "1.0.0",
217
+ "installTo": ".cursor/domain/web-app.md"
218
+ }
219
+ }
220
+ }
221
+ }
216
222
  ```
217
223
 
218
- ## Supported Commands
224
+ If someone deletes `.cursor/skills/app` or `.cursor/rules/antipattern.md`, run:
219
225
 
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>
226
+ ```bash
227
+ skillhub add
230
228
  ```
231
229
 
232
- ## Remote Registry Contract
230
+ The CLI re-fetches and restores everything listed in `skillhub.json`.
233
231
 
234
- The CLI also supports remote registries:
232
+ Use `--as` only when you want a custom local name:
235
233
 
236
234
  ```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
235
+ skillhub rule frontend/antipattern --as frontend-antipattern
245
236
  ```
246
237
 
247
- Expected response:
238
+ ## Publishing
248
239
 
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
- }
240
+ ```bash
241
+ npm login
242
+ npm publish --access public
263
243
  ```