@robosoft/skillhub-cli 0.1.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.
@@ -0,0 +1,145 @@
1
+ # SkillHub CLI Logic
2
+
3
+ ## Goal
4
+
5
+ The CLI installs reusable project skills into any repository, similar to how package managers install dependencies.
6
+
7
+ A SkillHub skill is a folder that contains:
8
+
9
+ ```txt
10
+ skill.json
11
+ SKILL.md
12
+ rules/
13
+ templates/
14
+ checklist/
15
+ examples/
16
+ ```
17
+
18
+ ## Commands
19
+
20
+ ### `skillhub init`
21
+
22
+ Creates project-level SkillHub files:
23
+
24
+ ```txt
25
+ skillhub.json
26
+ skillhub.lock.json
27
+ .ai/skills/
28
+ ```
29
+
30
+ ### `skillhub install <skill[@version]>`
31
+
32
+ Flow:
33
+
34
+ 1. Read `skillhub.json`.
35
+ 2. Resolve the registry from `--registry`, `SKILLHUB_REGISTRY`, or `skillhub.json`.
36
+ 3. Load the skill package from local registry or remote API.
37
+ 4. Validate `skill.json` and `SKILL.md`.
38
+ 5. Copy files into `.ai/skills/<skill-name>`.
39
+ 6. Update `skillhub.json`.
40
+ 7. Update `skillhub.lock.json` with version, source, checksum, and install path.
41
+ 8. Update adapters such as `AGENTS.md` and `.cursor/rules/skillhub.mdc`.
42
+
43
+ ### `skillhub sync`
44
+
45
+ Reinstalls all skills listed in `skillhub.json`.
46
+
47
+ ### `skillhub list`
48
+
49
+ Reads `skillhub.lock.json` and prints installed skills.
50
+
51
+ ### `skillhub remove <skill>`
52
+
53
+ Deletes the installed skill folder, removes it from config and lock, then refreshes adapters.
54
+
55
+ ### `skillhub create <skill>`
56
+
57
+ Scaffolds a new local skill package into the registry.
58
+
59
+ ### `skillhub validate <skill|path>`
60
+
61
+ Checks whether a skill has valid metadata and required files.
62
+
63
+ ### `skillhub generate <skill> <template> <name>`
64
+
65
+ Generates project files from an installed skill template.
66
+
67
+ Example:
68
+
69
+ ```bash
70
+ skillhub install shadcn-crud-generator
71
+ skillhub generate shadcn-crud-generator feature products --out src/features/products
72
+ ```
73
+
74
+ Template files can use variables like:
75
+
76
+ ```txt
77
+ {{name}}
78
+ {{kebabName}}
79
+ {{camelName}}
80
+ {{pascalName}}
81
+ {{title}}
82
+ ```
83
+
84
+ ## Local Registry Format
85
+
86
+ ```txt
87
+ skillhub-registry/
88
+ nextjs-clean-architecture/
89
+ 1.0.0/
90
+ skill.json
91
+ SKILL.md
92
+ rules/
93
+ checklist/
94
+ ```
95
+
96
+ ## Remote Registry Contract
97
+
98
+ The CLI supports remote registries with this endpoint pattern:
99
+
100
+ ```txt
101
+ GET /skills/:name/:version
102
+ GET /skills/:name/latest
103
+ ```
104
+
105
+ Expected response:
106
+
107
+ ```json
108
+ {
109
+ "manifest": {
110
+ "name": "nextjs-clean-architecture",
111
+ "version": "1.0.0",
112
+ "entry": "SKILL.md"
113
+ },
114
+ "files": [
115
+ {
116
+ "path": "SKILL.md",
117
+ "content": "# Next.js Clean Architecture"
118
+ }
119
+ ]
120
+ }
121
+ ```
122
+
123
+ ## Adapter Output
124
+
125
+ The CLI can update these files:
126
+
127
+ ```txt
128
+ AGENTS.md
129
+ .cursor/rules/skillhub.mdc
130
+ CLAUDE.md
131
+ .github/copilot-instructions.md
132
+ ```
133
+
134
+ The enabled adapters are controlled in `skillhub.json`:
135
+
136
+ ```json
137
+ {
138
+ "adapters": {
139
+ "agentsMd": true,
140
+ "cursorRules": true,
141
+ "claude": false,
142
+ "githubCopilot": false
143
+ }
144
+ }
145
+ ```
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@robosoft/skillhub-cli",
3
+ "version": "0.1.0",
4
+ "description": "Standalone SkillHub CLI for installing reusable AI/project skills into any codebase.",
5
+ "type": "module",
6
+ "bin": {
7
+ "skillhub": "./bin/skillhub.mjs"
8
+ },
9
+ "scripts": {
10
+ "skillhub": "node ./bin/skillhub.mjs",
11
+ "start": "node ./bin/skillhub.mjs",
12
+ "test:help": "node ./bin/skillhub.mjs --help",
13
+ "demo:init": "node ./bin/skillhub.mjs init",
14
+ "demo:install": "node ./bin/skillhub.mjs install nextjs-clean-architecture --registry ./skillhub-registry",
15
+ "demo:list": "node ./bin/skillhub.mjs list",
16
+ "demo:validate": "node ./bin/skillhub.mjs validate nextjs-clean-architecture --registry ./skillhub-registry",
17
+ "prepublishOnly": "node ./bin/skillhub.mjs --help",
18
+ "pack:dry-run": "npm pack --dry-run",
19
+ "publish:public": "npm publish --access public"
20
+ },
21
+ "engines": {
22
+ "node": ">=20"
23
+ },
24
+ "files": [
25
+ "bin",
26
+ "docs",
27
+ "skillhub-registry",
28
+ "README.md",
29
+ "LICENSE",
30
+ "CHANGELOG.md"
31
+ ],
32
+ "keywords": [
33
+ "ai",
34
+ "skills",
35
+ "cli",
36
+ "agents",
37
+ "cursor",
38
+ "claude",
39
+ "developer-tools",
40
+ "templates"
41
+ ],
42
+ "author": "Vikram Rajput",
43
+ "license": "MIT",
44
+ "homepage": "https://github.com/robosoft/skillhub-cli#readme",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/robosoft/skillhub-cli.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/robosoft/skillhub-cli/issues"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ }
55
+ }
@@ -0,0 +1,23 @@
1
+ # SkillHub Local Registry
2
+
3
+ This folder acts as a local skill registry for the demo CLI.
4
+
5
+ Each skill package follows this structure:
6
+
7
+ ```txt
8
+ skillhub-registry/
9
+ skill-name/
10
+ 1.0.0/
11
+ skill.json
12
+ SKILL.md
13
+ rules/
14
+ templates/
15
+ checklist/
16
+ ```
17
+
18
+ Install a skill into any project from the repository root:
19
+
20
+ ```bash
21
+ node packages/@robosoft/skillhub-cli/bin/skillhub.mjs init
22
+ node packages/@robosoft/skillhub-cli/bin/skillhub.mjs install nextjs-clean-architecture
23
+ ```
@@ -0,0 +1,22 @@
1
+ # Accessibility Review
2
+
3
+ ## Purpose
4
+
5
+ Use this skill when reviewing UI components, navigation flows, forms, dialogs, carousels, and data-heavy screens.
6
+
7
+ ## Review Rules
8
+
9
+ 1. Every interactive element must be reachable by keyboard.
10
+ 2. Focus order must match visual order.
11
+ 3. Dialogs must trap focus and restore it on close.
12
+ 4. Buttons need meaningful accessible names.
13
+ 5. Form inputs need labels, validation messaging, and error association.
14
+ 6. Dynamic updates should announce meaningful changes when needed.
15
+ 7. Color contrast should pass WCAG AA for normal text.
16
+
17
+ ## Common Failure Points
18
+
19
+ - Icon-only buttons without labels.
20
+ - Divs pretending to be buttons, the classic costume party of broken UX.
21
+ - Modals that lose focus.
22
+ - Carousels that auto-rotate without pause controls.
@@ -0,0 +1,8 @@
1
+ # UI Accessibility Checklist
2
+
3
+ - [ ] Keyboard-only navigation works.
4
+ - [ ] Visible focus indicator is present.
5
+ - [ ] Screen reader labels are meaningful.
6
+ - [ ] Form errors are announced or associated.
7
+ - [ ] Dialog focus is trapped and restored.
8
+ - [ ] Color contrast is acceptable.
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "accessibility-review",
3
+ "version": "1.0.0",
4
+ "description": "Accessibility checklist for reviewing UI, keyboard behavior, focus states, and screen-reader output.",
5
+ "category": "quality",
6
+ "tags": ["a11y", "accessibility", "ui", "review"],
7
+ "entry": "SKILL.md",
8
+ "compatibleWith": ["cursor", "claude", "chatgpt", "github-copilot"]
9
+ }
@@ -0,0 +1,37 @@
1
+ # Next.js Clean Architecture
2
+
3
+ ## Purpose
4
+
5
+ Use this skill when building or reviewing a scalable Next.js App Router project with TypeScript, server components, server actions, and reusable UI components.
6
+
7
+ ## Core Rules
8
+
9
+ 1. Keep business logic out of React components.
10
+ 2. Prefer feature-based folders for domain code.
11
+ 3. Use server components by default and client components only where browser APIs, state, or events are required.
12
+ 4. Keep data access inside services, repositories, or server actions.
13
+ 5. Model request and response types clearly.
14
+ 6. Every user-facing view needs loading, empty, error, and success states.
15
+ 7. Accessibility cannot be treated like decoration added after the building collapses.
16
+
17
+ ## Recommended Folder Pattern
18
+
19
+ ```txt
20
+ src/
21
+ app/
22
+ features/
23
+ users/
24
+ components/
25
+ actions/
26
+ services/
27
+ schema/
28
+ types/
29
+ components/
30
+ ui/
31
+ lib/
32
+ db/
33
+ ```
34
+
35
+ ## Output Expectations
36
+
37
+ When generating code, include the relevant file paths, TypeScript types, validation rules, and integration steps.
@@ -0,0 +1,9 @@
1
+ # Definition of Done
2
+
3
+ - [ ] TypeScript types are explicit where needed.
4
+ - [ ] Loading state is handled.
5
+ - [ ] Empty state is handled.
6
+ - [ ] Error state is handled.
7
+ - [ ] Server/client boundary is intentional.
8
+ - [ ] Accessibility labels and keyboard paths are checked.
9
+ - [ ] Code is easy to delete or refactor later.
@@ -0,0 +1,7 @@
1
+ # Folder Structure Rules
2
+
3
+ - Use `features/<feature-name>` for domain-specific code.
4
+ - Use `components/ui` only for generic reusable UI primitives.
5
+ - Use `lib` for shared helpers and platform clients.
6
+ - Use `db` for database configuration and schema exports.
7
+ - Avoid dumping everything into `utils`, the drawer of forgotten sins.
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "nextjs-clean-architecture",
3
+ "version": "1.0.0",
4
+ "description": "Next.js App Router architecture rules, folder patterns, and delivery checklist.",
5
+ "category": "frontend",
6
+ "tags": ["nextjs", "react", "typescript", "architecture"],
7
+ "entry": "SKILL.md",
8
+ "compatibleWith": ["cursor", "claude", "chatgpt", "github-copilot"]
9
+ }
@@ -0,0 +1,25 @@
1
+ # Shadcn CRUD Generator
2
+
3
+ ## Purpose
4
+
5
+ Use this skill when creating admin CRUD modules with Next.js, TypeScript, server actions, Shadcn UI, and a predictable folder structure.
6
+
7
+ ## CRUD Rules
8
+
9
+ 1. Each module must include list, create, edit, delete, and view patterns where applicable.
10
+ 2. Use schema validation before mutation.
11
+ 3. Keep table column definitions separate from page composition when the table grows.
12
+ 4. Add confirmation before destructive actions.
13
+ 5. Show toast or visible feedback after mutation.
14
+ 6. Never hide errors in `console.log`, because that is not observability, that is denial.
15
+
16
+ ## Generated Files
17
+
18
+ ```txt
19
+ features/<module>/
20
+ components/
21
+ actions/
22
+ schema/
23
+ types/
24
+ data/
25
+ ```
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "shadcn-crud-generator",
3
+ "version": "1.0.0",
4
+ "description": "CRUD scaffolding guidance and templates for Next.js + Shadcn admin panels.",
5
+ "category": "generator",
6
+ "tags": ["shadcn", "crud", "nextjs", "admin"],
7
+ "entry": "SKILL.md",
8
+ "compatibleWith": ["cursor", "claude", "chatgpt", "github-copilot"]
9
+ }
@@ -0,0 +1,16 @@
1
+ "use server";
2
+
3
+ export async function create{{pascalName}}Action(input: unknown) {
4
+ // Validate input, persist data, then revalidate affected paths.
5
+ return { success: true };
6
+ }
7
+
8
+ export async function update{{pascalName}}Action(id: string, input: unknown) {
9
+ // Validate id + input, update data, then revalidate affected paths.
10
+ return { success: true };
11
+ }
12
+
13
+ export async function delete{{pascalName}}Action(id: string) {
14
+ // Validate id, delete safely, then revalidate affected paths.
15
+ return { success: true };
16
+ }
@@ -0,0 +1,13 @@
1
+ import { {{pascalName}}Table } from "@/features/{{kebabName}}/components/{{kebabName}}-table";
2
+
3
+ export default async function {{pascalName}}Page() {
4
+ return (
5
+ <main className="space-y-6">
6
+ <div>
7
+ <h1 className="text-2xl font-semibold">{{title}}</h1>
8
+ <p className="text-muted-foreground">Manage {{title}} records.</p>
9
+ </div>
10
+ <{{pascalName}}Table />
11
+ </main>
12
+ );
13
+ }