@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 +70 -6
- package/bin/index.js +52303 -10365
- package/bin/mcp.js +2279 -1281
- package/dist/cli/commands/portable-skills.d.ts +2 -0
- package/dist/cli/commands/storage.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5268 -3853
- package/dist/lib/cli-mcp-parity.d.ts +14 -0
- package/dist/lib/mcp-contracts.d.ts +1 -1
- package/dist/lib/native-storage.d.ts +251 -0
- package/dist/lib/portable-skills.d.ts +79 -0
- package/dist/lib/registry.d.ts +1 -1
- package/dist/lib/skill-validation.d.ts +2 -0
- package/dist/mcp/storage-tools.d.ts +2 -0
- package/dist/storage.d.ts +1 -0
- package/dist/storage.js +854 -0
- package/docs/skill-standard.md +126 -0
- package/package.json +9 -3
- package/skills/apidocs/.claude/settings.json +5 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Portable Skill Standard
|
|
2
|
+
|
|
3
|
+
Portable skills live in one folder each:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
~/.hasna/skills/<skill-name>/
|
|
7
|
+
├── SKILL.md
|
|
8
|
+
├── skill.json
|
|
9
|
+
├── AGENTS.md
|
|
10
|
+
├── package.json
|
|
11
|
+
├── tsconfig.json
|
|
12
|
+
└── src/
|
|
13
|
+
└── index.ts
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`skills new <name>` creates this layout. `skills scaffold <name>` is an alias.
|
|
17
|
+
`skills port <path>` and `skills add <path>` copy an existing skill folder into
|
|
18
|
+
this layout and add missing standard files.
|
|
19
|
+
|
|
20
|
+
## Naming
|
|
21
|
+
|
|
22
|
+
Skill names are lowercase slugs: letters, numbers, dots, underscores, and
|
|
23
|
+
hyphens. The folder name, `SKILL.md` frontmatter `name`, `skill.json` `name`,
|
|
24
|
+
and `package.json` `name` should match.
|
|
25
|
+
|
|
26
|
+
## Manifest
|
|
27
|
+
|
|
28
|
+
Every portable skill needs a manifest. `skill.json` is the machine-readable
|
|
29
|
+
manifest. `SKILL.md` frontmatter stays compatible with existing Codewith
|
|
30
|
+
`SKILL.md` conventions and can be used by agents for skill discovery.
|
|
31
|
+
|
|
32
|
+
Minimum `SKILL.md` frontmatter:
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
---
|
|
36
|
+
name: my-skill
|
|
37
|
+
description: What this skill does and when to use it.
|
|
38
|
+
version: 0.1.0
|
|
39
|
+
source: custom
|
|
40
|
+
category: Development Tools
|
|
41
|
+
tags:
|
|
42
|
+
- custom
|
|
43
|
+
---
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Minimum `skill.json`:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"$schema": "https://hasna.dev/schemas/skill.v1.json",
|
|
51
|
+
"standard": "hasna.skill.v1",
|
|
52
|
+
"name": "my-skill",
|
|
53
|
+
"description": "What this skill does and when to use it.",
|
|
54
|
+
"version": "0.1.0",
|
|
55
|
+
"inputs": [
|
|
56
|
+
{
|
|
57
|
+
"name": "args",
|
|
58
|
+
"type": "string[]",
|
|
59
|
+
"required": false,
|
|
60
|
+
"description": "Arguments passed after `skills run my-skill`."
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"commands": [
|
|
64
|
+
{
|
|
65
|
+
"name": "my-skill",
|
|
66
|
+
"entry": "src/index.ts",
|
|
67
|
+
"description": "Run my-skill.",
|
|
68
|
+
"args": ["...args"]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If `skill.json` is absent, the CLI can infer a portable manifest from
|
|
75
|
+
`SKILL.md` frontmatter plus `package.json` `bin`, but scaffolded and ported
|
|
76
|
+
skills should keep `skill.json` checked in.
|
|
77
|
+
|
|
78
|
+
## Agent Handoff
|
|
79
|
+
|
|
80
|
+
`AGENTS.md` is required for portable skills created or ported by the CLI. It
|
|
81
|
+
tells a coding agent where to put logic, how to update the manifest, how to test
|
|
82
|
+
the skill, and how to verify it with:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
skills validate my-skill
|
|
86
|
+
skills run my-skill --help
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Runtime
|
|
90
|
+
|
|
91
|
+
The first command in `skill.json.commands` is the default for:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
skills run my-skill [args...]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
For Bun/TypeScript skills, point `entry` at `src/index.ts`. The CLI runs the
|
|
98
|
+
entry from the skill folder, passes through arguments, and records run metadata
|
|
99
|
+
under the caller project’s `.skills/runs` and `.skills/exports` directories.
|
|
100
|
+
|
|
101
|
+
## Validation
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
skills validate my-skill --json
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Validation checks:
|
|
108
|
+
|
|
109
|
+
- folder and name safety;
|
|
110
|
+
- `SKILL.md` frontmatter compatibility;
|
|
111
|
+
- `skill.json` standard, version, inputs, and commands;
|
|
112
|
+
- `AGENTS.md` presence;
|
|
113
|
+
- `package.json` and command entrypoint safety;
|
|
114
|
+
- no reserved files such as `.env` or symlinks.
|
|
115
|
+
|
|
116
|
+
## Porting Existing Skills
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
skills port ./old-skill
|
|
120
|
+
skills add ./old-skill --name new-name
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Porting copies the folder into `~/.hasna/skills/<name>/`, skips generated and
|
|
124
|
+
dependency directories such as `node_modules`, `dist`, and `.git`, then adds or
|
|
125
|
+
normalizes `skill.json`, `AGENTS.md`, `package.json`, `tsconfig.json`, and an
|
|
126
|
+
entrypoint when they are missing.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.45",
|
|
4
4
|
"description": "Skills library for AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
".": {
|
|
12
12
|
"import": "./dist/index.js",
|
|
13
13
|
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./storage": {
|
|
16
|
+
"import": "./dist/storage.js",
|
|
17
|
+
"types": "./dist/storage.d.ts"
|
|
14
18
|
}
|
|
15
19
|
},
|
|
16
20
|
"files": [
|
|
@@ -19,6 +23,7 @@
|
|
|
19
23
|
"!dist/platform",
|
|
20
24
|
"!dist/server",
|
|
21
25
|
"bin/",
|
|
26
|
+
"docs/skill-standard.md",
|
|
22
27
|
"skills/",
|
|
23
28
|
"!skills/**/node_modules",
|
|
24
29
|
"!skills/scaffold-project/my-app",
|
|
@@ -30,7 +35,7 @@
|
|
|
30
35
|
"types": "./dist/index.d.ts",
|
|
31
36
|
"scripts": {
|
|
32
37
|
"clean": "rm -rf bin/ dist/",
|
|
33
|
-
"build": "bun run clean && bun build ./src/cli/index.tsx --outdir ./bin --target bun
|
|
38
|
+
"build": "bun run clean && bun build ./src/cli/index.tsx --outdir ./bin --target bun && bun build ./src/mcp/index.ts --outfile ./bin/mcp.js --target bun && bun build ./src/index.ts ./src/storage.ts --outdir ./dist --target bun && tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
34
39
|
"test": "bun test",
|
|
35
40
|
"dev": "bun run ./src/cli/index.tsx",
|
|
36
41
|
"dev:watch": "bun --watch run ./src/cli/index.tsx",
|
|
@@ -60,10 +65,11 @@
|
|
|
60
65
|
"devDependencies": {
|
|
61
66
|
"@types/bun": "latest",
|
|
62
67
|
"@types/react": "^18.2.0",
|
|
68
|
+
"react-devtools-core": "^7.0.1",
|
|
63
69
|
"typescript": "^5"
|
|
64
70
|
},
|
|
65
71
|
"dependencies": {
|
|
66
|
-
"@hasna/events": "^0.1.
|
|
72
|
+
"@hasna/events": "^0.1.3",
|
|
67
73
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
68
74
|
"chalk": "^5.3.0",
|
|
69
75
|
"commander": "^12.1.0",
|