@hasna/skills 0.1.43 → 0.1.45

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.
package/README.md CHANGED
@@ -83,6 +83,7 @@ requirements explicitly document local provider use.
83
83
  | `skills list` | `ls` | List available skills (filter with `-c`, `--pinned`, `-t`, `--brief`) |
84
84
  | `skills search <query>` | `s` | Search by name, description, or tags |
85
85
  | `skills info <name>` | | Show metadata, env vars, and system dependencies |
86
+ | `skills show <name>` | | Show bundled or portable skill details |
86
87
  | `skills docs <name>` | | Show documentation (SKILL.md > README.md > CLAUDE.md) |
87
88
  | `skills requires <name>` | | Show env vars, system deps, and npm dependencies |
88
89
  | `skills run <name> [args]` | | Execute a skill directly |
@@ -105,12 +106,16 @@ requirements explicitly document local provider use.
105
106
  | `skills export` | | Export pinned skills as JSON |
106
107
  | `skills import <file>` | | Pin skills from a JSON export |
107
108
  | `skills config set <key> <value>` | | Set default agent, scope, or output format |
109
+ | `skills new <name>` | `scaffold` | Scaffold a portable skill under `~/.hasna/skills/<name>` |
110
+ | `skills port <path>` | `add` | Import an existing skill folder into the portable standard |
108
111
  | `skills create <name>` | | Scaffold a new custom skill directory |
109
112
  | `skills sync --to claude` | | Disabled by design; use `skills mcp --register <agent|all>` |
110
113
  | `skills sync --from claude` | | Disabled by design; agent skill folders are not used |
111
114
  | `skills validate <name>` | | Check a skill's directory structure |
112
115
  | `skills schedule add <skill> <cron>` | | Set up recurring skill execution |
113
116
  | `skills schedule list` | | List all schedules (enabled/disabled/last run) |
117
+ | `skills storage status` | | Show local state paths and optional repo-native storage readiness |
118
+ | `skills storage sync-plan` | | Plan `.skills` Postgres/S3 snapshot sync without network access |
114
119
  | `skills mcp` | | Start MCP server on stdio |
115
120
  | `skills mcp --register claude` | | Register the Skills MCP server in an agent config (also `codex`, `gemini`, `opencode`, `all`) |
116
121
  | `skills self-update` | | Update this package to the latest version |
@@ -138,8 +143,8 @@ Stable command shapes:
138
143
  - Skill details: `info`, `docs`, `requires`, `validate`, `diff`, `test`,
139
144
  `doctor`, `auth`, `whoami`, and `outdated` return command-specific objects or
140
145
  arrays documented by their field names.
141
- - Project state: `pin`, `unpin`, `update`, `init`, `import`, `create`, and
142
- `sync` return result objects/arrays; `--dry-run --json` returns
146
+ - Project state: `pin`, `unpin`, `update`, `init`, `import`, `create`, `new`,
147
+ `scaffold`, `port`, `add`, and `sync` return result objects/arrays; `--dry-run --json` returns
143
148
  `{ "dryRun": true, "actions": [...] }` where applicable.
144
149
  - Runtime: `run --json <skill> ...` returns
145
150
  `{ "skill", "args", "exitCode", "stdout", "stderr", "error", "run" }`.
@@ -149,6 +154,9 @@ Stable command shapes:
149
154
  `skills exports download <run-id>`.
150
155
  - Config and schedules: `config * --json` and `schedule * --json` return
151
156
  machine-readable status objects.
157
+ - Storage: `storage status --json` returns local `.skills` paths and optional
158
+ repo-native remote readiness; `storage sync-plan --json` returns a no-network
159
+ snapshot plan.
152
160
  - MCP registration: `mcp --register <agent> --json` returns
153
161
  `{ "registered": number, "results": [...] }`.
154
162
 
@@ -178,6 +186,25 @@ or the credential saved by `skills auth login`.
178
186
  For the reusable upstream contract, see
179
187
  `docs/architecture/reusable-skills-engine.md`.
180
188
 
189
+ ## Portable Skills
190
+
191
+ Portable skills live directly under `~/.hasna/skills/<name>/` and follow the
192
+ standard documented in `docs/skill-standard.md`.
193
+
194
+ ```bash
195
+ skills new my-skill
196
+ skills validate my-skill
197
+ skills run my-skill --help
198
+ skills show my-skill
199
+
200
+ skills port ./existing-skill
201
+ ```
202
+
203
+ The scaffold includes `SKILL.md`, `skill.json`, `AGENTS.md`, `package.json`,
204
+ `tsconfig.json`, and `src/index.ts`. `AGENTS.md` is written for coding agents:
205
+ after `skills new my-skill`, an agent can open that file, implement the skill,
206
+ update the manifest, run tests, and verify with `skills validate`.
207
+
181
208
  ## MCP Server
182
209
 
183
210
  ```bash
@@ -202,7 +229,11 @@ Endpoints: `GET /health` → `{"status":"ok","name":"skills"}`, MCP at `/mcp`.
202
229
  Uses stateless `StreamableHTTPServerTransport` (shared process, many clients).
203
230
  `skills-mcp` without flags still uses stdio (unchanged).
204
231
 
205
- The MCP server exposes 20+ tools including `list_skills`, `search_skills`, `pin_skill`, `unpin_skill`, `pin_category`, `list_pinned_skills`, `get_skill_info`, `get_skill_docs`, `get_requirements`, `run_skill`, `get_run_status`, `schedule_skill`, `detect_project_skills`, `validate_skill`, and more.
232
+ The MCP server exposes 20+ tools including `list_skills`, `search_skills`,
233
+ `scaffold_skill`, `port_skill`, `pin_skill`, `unpin_skill`, `pin_category`,
234
+ `list_pinned_skills`, `get_skill_info`, `get_skill_docs`, `get_requirements`,
235
+ `run_skill`, `get_run_status`, `schedule_skill`, `detect_project_skills`,
236
+ `validate_skill`, and more.
206
237
 
207
238
  ### Register with an Agent
208
239
 
@@ -223,6 +254,37 @@ Hosted account, billing, and credit management use the configured hosted API.
223
254
  The public package only stores local configuration and CLI credentials; Stripe,
224
255
  customer records, and hosted execution remain platform concerns.
225
256
 
257
+ ## Storage Boundary
258
+
259
+ Open Skills is local-first. Project runtime state stays in `.skills/`; global
260
+ config and auth stay under `~/.hasna/skills/`.
261
+
262
+ Optional repo-native sync can be configured without a hosted SaaS account:
263
+
264
+ ```bash
265
+ HASNA_SKILLS_STORAGE_MODE=hybrid # local | remote | hybrid
266
+ HASNA_SKILLS_DATABASE_URL=postgres://...
267
+ HASNA_SKILLS_S3_BUCKET=skills-artifacts
268
+ HASNA_SKILLS_S3_PREFIX=opensource/prod/skills
269
+
270
+ skills storage status
271
+ skills storage sync-plan --schema-sql
272
+ ```
273
+
274
+ Wrappers and deployment tooling can import the storage-only surface without
275
+ pulling in CLI/runtime helpers:
276
+
277
+ ```ts
278
+ import { getStorageStatus, resolveStorageConfig } from "@hasna/skills/storage";
279
+ ```
280
+
281
+ Plain `SKILLS_DATABASE_URL`, `SKILLS_STORAGE_MODE`, and `SKILLS_S3_BUCKET`
282
+ fallbacks are accepted for local development. Hosted wrappers must keep their
283
+ private SaaS `DATABASE_URL`, tenant tables, billing state, workers, and artifact
284
+ buckets separate; if they expose open-core storage, they should map explicit
285
+ wrapper envs into `HASNA_SKILLS_*` rather than passing the private SaaS database
286
+ implicitly.
287
+
226
288
  ## Project Structure
227
289
 
228
290
  ```
@@ -278,15 +340,17 @@ bun run typecheck # TypeScript type checking
278
340
 
279
341
  1. Create `skills/{name}/` with `src/index.ts`, `package.json`, `tsconfig.json`, `SKILL.md`
280
342
  2. Add an entry to the `SKILLS` array in `src/lib/registry.ts`
281
- 3. Run `skills validate <name> --json` to check package metadata, bin entries,
282
- docs, and SKILL.md frontmatter
343
+ 3. Run `skills validate <name> --json` to check package metadata, portable
344
+ manifests, bin entries, docs, and SKILL.md frontmatter
283
345
  4. Run `bun test` to verify registry-wide validation passes
284
346
 
285
347
  Premium hosted skills should add public contracts, pricing, docs, and tests
286
348
  without adding private provider routing, hosted worker code, or secrets to the
287
349
  OSS package.
288
350
 
289
- Custom skill directories are auto-discovered from `~/.hasna/skills/custom/`.
351
+ Portable skill directories are auto-discovered from `~/.hasna/skills/<name>/`.
352
+ Legacy custom skill directories are still discovered from
353
+ `~/.hasna/skills/custom/`.
290
354
  Project `.skills/` is reserved for runtime state and outputs.
291
355
 
292
356
  ## Data Directory