@hasna/skills 0.6.3 → 0.7.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.
- package/README.md +239 -23
- package/bin/index.js +23139 -29332
- package/bin/mcp.js +15000 -23335
- package/bin/migrate.js +4 -4
- package/bin/server.js +7719 -689
- package/bin/worker.js +7593 -604
- package/dist/admin-contract.js +15 -34
- package/dist/index.d.ts +1 -0
- package/dist/index.js +21175 -28093
- package/dist/lib/agent-adapters.d.ts +45 -0
- package/dist/lib/agent-bridge.d.ts +6 -0
- package/dist/lib/agent-discovery-bytes.d.ts +6 -0
- package/dist/lib/agent-discovery-directories.d.ts +8 -0
- package/dist/lib/agent-discovery.d.ts +44 -0
- package/dist/lib/agent-hermes.d.ts +30 -0
- package/dist/lib/agent-integration.d.ts +34 -1
- package/dist/lib/agent-policy-limits.d.ts +18 -0
- package/dist/lib/dependency-preparation.d.ts +9 -0
- package/dist/lib/managed-policy.d.ts +9 -1
- package/dist/lib/portable-skills.d.ts +2 -0
- package/dist/lib/preparation-process.d.ts +13 -0
- package/dist/lib/prepare-skill.d.ts +22 -0
- package/dist/lib/profile-limits.d.ts +15 -0
- package/dist/lib/selection-aliases.d.ts +6 -0
- package/dist/lib/selection-resolver.d.ts +1 -0
- package/dist/lib/skillinfo.d.ts +1 -3
- package/dist/sdk/index.js +10075 -1383
- package/dist/types/skill-selection.d.ts +2 -0
- package/docs/skill-standard.md +78 -5
- package/package.json +3 -3
package/docs/skill-standard.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Portable skills live in one folder each:
|
|
4
4
|
|
|
5
5
|
```text
|
|
6
|
-
~/.hasna/skills/<skill-name>/
|
|
6
|
+
~/.hasna/skills/installed/<skill-name>/
|
|
7
7
|
├── SKILL.md
|
|
8
8
|
├── skill.json
|
|
9
9
|
├── AGENTS.md
|
|
@@ -13,10 +13,51 @@ Portable skills live in one folder each:
|
|
|
13
13
|
└── index.ts
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
`skills new <name>` creates this layout. `skills scaffold <name>` is an alias
|
|
16
|
+
`skills new <name>` creates this layout. `skills scaffold <name>` is an alias,
|
|
17
|
+
and `skills create <name>` uses the same authoring corpus. Both creation commands
|
|
18
|
+
accept `--kind instruction` for a prose skill; the default is `executable`.
|
|
19
|
+
An owner layout migrated by Skills uses `~/.hasna/skills/skills/<skill-name>/`.
|
|
17
20
|
`skills port <path>` and `skills add <path>` copy an existing skill folder into
|
|
18
21
|
this layout and add missing standard files.
|
|
19
22
|
|
|
23
|
+
## Edit, prepare and publish
|
|
24
|
+
|
|
25
|
+
Edit the local draft's instructions, resources, code and metadata, then choose a
|
|
26
|
+
new semantic version and review preparation before publication:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
skills create release-guide --kind instruction
|
|
30
|
+
# Edit the SKILL.md in the path reported by create.
|
|
31
|
+
skills prepare release-guide --version 0.2.0 --dry-run --json
|
|
32
|
+
skills prepare release-guide --version 0.2.0 --json
|
|
33
|
+
skills validate release-guide
|
|
34
|
+
skills push release-guide --dry-run
|
|
35
|
+
skills push release-guide
|
|
36
|
+
# On another station using the same configured instance:
|
|
37
|
+
skills pull release-guide@0.2.0
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`prepare` validates a private candidate before updating only `skill.json`'s
|
|
41
|
+
authoritative version, declared kind and canonical content hash. It preserves
|
|
42
|
+
other manifest fields and does not rewrite `SKILL.md`, `package.json`, code or
|
|
43
|
+
resources, execute helpers, install dependencies, or call an API. Review any
|
|
44
|
+
separate package version yourself when the skill also publishes a package.
|
|
45
|
+
Changed canonical content requires a higher semantic version; build metadata
|
|
46
|
+
alone is not a version bump. Preparing an already valid, unchanged version is
|
|
47
|
+
idempotent. Dry-run leaves the authoring corpus and configuration unchanged.
|
|
48
|
+
|
|
49
|
+
An existing manifest without `kind` requires an explicit `--kind instruction`
|
|
50
|
+
or `--kind executable` during preparation. Instruction skills may contain
|
|
51
|
+
helpers, so their presence does not decide the kind. Invalid candidates and
|
|
52
|
+
conflicting kind declarations are refused: when deliberately changing kind,
|
|
53
|
+
align any explicit `SKILL.md` kind with the candidate `skill.json` kind and
|
|
54
|
+
provide the required executable files before preparing. Preparation never
|
|
55
|
+
rewrites that frontmatter. Source
|
|
56
|
+
symlinks at the selected skill root or its included descendants are refused
|
|
57
|
+
without changing the draft; existing HOME/corpus ancestor aliases remain
|
|
58
|
+
supported. `push` validates and
|
|
59
|
+
uploads the reviewed bytes; it never silently repairs a stale manifest hash.
|
|
60
|
+
|
|
20
61
|
## The manifest split
|
|
21
62
|
|
|
22
63
|
Two metadata surfaces exist, with one rule: **portable metadata lives in
|
|
@@ -46,7 +87,7 @@ A skill declares its artifact class with the `kind` field in `skill.json`
|
|
|
46
87
|
(`kind` may also appear in `SKILL.md` frontmatter for compatibility with
|
|
47
88
|
existing Codewith conventions):
|
|
48
89
|
|
|
49
|
-
- `kind: executable`
|
|
90
|
+
- `kind: executable` — a runnable skill folder with
|
|
50
91
|
`package.json`, a non-empty `bin`, and `src/index.ts`. `skills run` executes it.
|
|
51
92
|
- `kind: instruction` — a `SKILL.md`-primary prose skill for coding agents.
|
|
52
93
|
`package.json`, `bin`, and `src/` are all optional. Instruction skills may still
|
|
@@ -55,8 +96,10 @@ existing Codewith conventions):
|
|
|
55
96
|
instruction skill returns a clear "not runnable — instruction skill" error
|
|
56
97
|
instead of executing a stub.
|
|
57
98
|
|
|
58
|
-
|
|
59
|
-
|
|
99
|
+
New scaffolds always record their selected kind. Legacy local readers retain
|
|
100
|
+
their executable fallback, while the legacy publication API retains its
|
|
101
|
+
instruction fallback for omitted kinds. `prepare` removes that ambiguity
|
|
102
|
+
through the author's explicit selection without changing old API behavior.
|
|
60
103
|
|
|
61
104
|
## Naming
|
|
62
105
|
|
|
@@ -125,6 +168,7 @@ incomplete, invalid, or whose `content_hash` does not match the bundle.
|
|
|
125
168
|
"name": "my-skill",
|
|
126
169
|
"description": "What this skill does and when to use it.",
|
|
127
170
|
"version": "0.1.0",
|
|
171
|
+
"kind": "executable",
|
|
128
172
|
"displayName": "My Skill",
|
|
129
173
|
"category": "Development Tools",
|
|
130
174
|
"tags": ["custom"],
|
|
@@ -354,3 +398,32 @@ Invalid selections fail before any apply write. Prune requires the marker
|
|
|
354
398
|
deletion authority. Adoption also leaves every already-marked directory alone.
|
|
355
399
|
Rollback records contain identities, hashes and markers, not backups of removed
|
|
356
400
|
file content.
|
|
401
|
+
|
|
402
|
+
## Recovering interrupted dependency preparation
|
|
403
|
+
|
|
404
|
+
Local executable skills prepare missing dependencies before running their entry,
|
|
405
|
+
including when `--help` is forwarded to that entry. Preparation has a 60-second
|
|
406
|
+
default deadline; callers of the public root `runSkill` export can set
|
|
407
|
+
`preparationTimeoutMs`. Installer diagnostics are drained without exposing
|
|
408
|
+
registry URLs or lifecycle output. A failed preparation returns a nonzero result
|
|
409
|
+
and the CLI records a failed run.
|
|
410
|
+
|
|
411
|
+
The selected skill directory temporarily contains `.skills-dependency-preparation`.
|
|
412
|
+
Successful preparation removes this marker. A confirmed failure keeps a retryable
|
|
413
|
+
failed state, so a later invocation prepares again even if `node_modules` was
|
|
414
|
+
partially created. Existing dependencies are preserved.
|
|
415
|
+
|
|
416
|
+
An interrupted, active, malformed, or symlinked marker refuses execution. To recover:
|
|
417
|
+
|
|
418
|
+
1. Identify the selected skill directory and confirm that no dependency installer
|
|
419
|
+
or lifecycle child is still running for it. Do not terminate a process based on
|
|
420
|
+
a PID found in a skill directory.
|
|
421
|
+
2. Review the skill's package and lifecycle scripts, then run `bun install --no-save`
|
|
422
|
+
in that exact directory with the intended environment. Require a successful exit.
|
|
423
|
+
3. Remove only that directory's `.skills-dependency-preparation` marker, then retry
|
|
424
|
+
the original Skills command. Preserve `node_modules` and all other skill files.
|
|
425
|
+
|
|
426
|
+
Do not remove an incomplete marker merely to bypass preparation. If the directory
|
|
427
|
+
is read-only, prepare it through its owner before running it.
|
|
428
|
+
|
|
429
|
+
The root `.skills-dependency-preparation` directory is local runtime state. Bundles, portable copies, and authoring snapshots exclude it; a nested directory with that name remains authored content. Moving an existing local corpus preserves its dependency tree and preparation state together.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/skills",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Skills library for AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
"url": "https://github.com/hasna/apps.git",
|
|
120
120
|
"directory": "apps/skills"
|
|
121
121
|
},
|
|
122
|
-
"homepage": "https://github.com/hasna/skills",
|
|
122
|
+
"homepage": "https://github.com/hasna/apps/tree/main/apps/skills",
|
|
123
123
|
"bugs": {
|
|
124
|
-
"url": "https://github.com/hasna/
|
|
124
|
+
"url": "https://github.com/hasna/apps/issues"
|
|
125
125
|
}
|
|
126
126
|
}
|