@alavida/agentpack 0.1.1
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 +269 -0
- package/bin/agentpack.js +5 -0
- package/package.json +54 -0
- package/skills/agentpack-cli/SKILL.md +136 -0
- package/skills/agentpack-cli/references/knowledge-as-package.md +48 -0
- package/skills/agentpack-cli/references/plugin-lifecycle.md +58 -0
- package/skills/agentpack-cli/references/skill-lifecycle.md +78 -0
- package/src/cli.js +82 -0
- package/src/commands/plugin.js +169 -0
- package/src/commands/skills.js +491 -0
- package/src/lib/context.js +167 -0
- package/src/lib/plugins.js +414 -0
- package/src/lib/skills.js +1900 -0
- package/src/utils/errors.js +67 -0
- package/src/utils/output.js +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
# agentpack
|
|
2
|
+
|
|
3
|
+
You already know the feeling:
|
|
4
|
+
|
|
5
|
+
- the skill worked in one repo, but now it is copied into three places
|
|
6
|
+
- a plugin depends on a skill, but nobody knows where that dependency truth lives
|
|
7
|
+
- the source knowledge changed, but the shipped skill never got updated
|
|
8
|
+
- the runtime still has a skill on disk, but nobody can tell whether it is current, stale, local, bundled, or installed transitively
|
|
9
|
+
- the agent "knows" something, but you no longer trust where that knowledge came from
|
|
10
|
+
|
|
11
|
+
That is the problem `agentpack` is for.
|
|
12
|
+
|
|
13
|
+
The core failure mode is lifecycle collapse. Most teams flatten four different artifact types into one fuzzy thing called "a skill":
|
|
14
|
+
|
|
15
|
+
- source knowledge
|
|
16
|
+
- compiled skill artifact
|
|
17
|
+
- runtime plugin
|
|
18
|
+
- installed environment state
|
|
19
|
+
|
|
20
|
+
Once those boundaries blur, everything gets worse:
|
|
21
|
+
|
|
22
|
+
- authors do not know what to update
|
|
23
|
+
- consumers do not know what to install
|
|
24
|
+
- plugins become hidden dependency containers
|
|
25
|
+
- agents end up running stale knowledge with no visible trust chain
|
|
26
|
+
|
|
27
|
+
`agentpack` gives those artifacts their own lifecycle again:
|
|
28
|
+
|
|
29
|
+
- source docs and knowledge files stay authoritative
|
|
30
|
+
- `SKILL.md` becomes the agent-facing artifact
|
|
31
|
+
- `package.json` becomes the distribution contract
|
|
32
|
+
- npm handles package resolution and versioning
|
|
33
|
+
- `agentpack` handles validation, staleness, local linking, install flow, and plugin bundling
|
|
34
|
+
|
|
35
|
+
This is for teams who want agent behavior to be packaged, inspectable, and updateable like software instead of copy-pasted prompt debris.
|
|
36
|
+
|
|
37
|
+
Docs: https://docs.alavida.ai
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g @alavida/agentpack
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or without a global install:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx @alavida/agentpack --help
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Why It Exists
|
|
52
|
+
|
|
53
|
+
Most agent workflows still look like this:
|
|
54
|
+
|
|
55
|
+
- write source knowledge in one place
|
|
56
|
+
- hand-copy some of it into a skill
|
|
57
|
+
- hand-copy that skill into a plugin or repo
|
|
58
|
+
- lose track of what depends on what
|
|
59
|
+
- discover drift only when the agent produces the wrong output
|
|
60
|
+
|
|
61
|
+
`agentpack` gives you a real lifecycle instead:
|
|
62
|
+
|
|
63
|
+
1. Write and maintain source knowledge where your team already works.
|
|
64
|
+
2. Derive a skill artifact from that knowledge.
|
|
65
|
+
3. Validate it before release.
|
|
66
|
+
4. Link it locally for testing.
|
|
67
|
+
5. Publish it as a package.
|
|
68
|
+
6. Install or bundle it wherever it needs to run.
|
|
69
|
+
|
|
70
|
+
## What It Does
|
|
71
|
+
|
|
72
|
+
`agentpack` covers four practical workflows:
|
|
73
|
+
|
|
74
|
+
1. Author a packaged skill from source docs or knowledge files.
|
|
75
|
+
2. Validate that skill before release.
|
|
76
|
+
3. Link it locally into `.claude/skills/` and `.agents/skills/` for testing.
|
|
77
|
+
4. Bundle packaged skills into self-contained plugin artifacts.
|
|
78
|
+
|
|
79
|
+
## Quick Start
|
|
80
|
+
|
|
81
|
+
### Author and test a packaged skill
|
|
82
|
+
|
|
83
|
+
Run these commands from the repo that owns the source files referenced by `metadata.sources`:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
agentpack skills inspect domains/operations/skills/agonda-prioritisation
|
|
87
|
+
agentpack skills validate domains/operations/skills/agonda-prioritisation
|
|
88
|
+
agentpack skills dev domains/operations/skills/agonda-prioritisation
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Use `skills dev` when you want the skill linked into `.claude/skills/` and `.agents/skills/` for local runtime testing.
|
|
92
|
+
|
|
93
|
+
If your agent session was already running, start a fresh session after linking so the runtime can pick up the newly materialized skill.
|
|
94
|
+
|
|
95
|
+
### Install a published skill in another repo
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
agentpack skills install @scope/skill-package
|
|
99
|
+
agentpack skills env
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Build a plugin artifact
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
agentpack plugin inspect path/to/plugin
|
|
106
|
+
agentpack plugin validate path/to/plugin
|
|
107
|
+
agentpack plugin build path/to/plugin
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
For watch mode during development:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
agentpack plugin dev path/to/plugin
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## The Model
|
|
117
|
+
|
|
118
|
+
The most important distinction in `agentpack` is lifecycle stage.
|
|
119
|
+
|
|
120
|
+
### Packaged skills
|
|
121
|
+
|
|
122
|
+
A packaged skill is a reusable capability artifact.
|
|
123
|
+
|
|
124
|
+
- `metadata.sources` track provenance
|
|
125
|
+
- `requires` define authored skill dependencies
|
|
126
|
+
- `package.json.dependencies` are the compiled mirror of `requires`
|
|
127
|
+
- it is self-contained at runtime, not a pointer back to source files
|
|
128
|
+
|
|
129
|
+
Typical local flow:
|
|
130
|
+
|
|
131
|
+
- `skills inspect`
|
|
132
|
+
- `skills validate`
|
|
133
|
+
- `skills dev`
|
|
134
|
+
|
|
135
|
+
### Consumer installs
|
|
136
|
+
|
|
137
|
+
Consumer repos do not author the skill. They install the published package and materialize it into agent-visible directories.
|
|
138
|
+
|
|
139
|
+
Typical consumer flow:
|
|
140
|
+
|
|
141
|
+
- `skills install`
|
|
142
|
+
- `skills env`
|
|
143
|
+
|
|
144
|
+
### Plugins
|
|
145
|
+
|
|
146
|
+
A plugin is a deployable runtime shell, not just another skill package.
|
|
147
|
+
|
|
148
|
+
Plugin-local skills can declare `requires` on packaged skills. `agentpack` can then build a self-contained plugin artifact that vendors those packaged dependencies.
|
|
149
|
+
|
|
150
|
+
Typical plugin flow:
|
|
151
|
+
|
|
152
|
+
- `plugin inspect`
|
|
153
|
+
- `plugin validate`
|
|
154
|
+
- `plugin build`
|
|
155
|
+
- `plugin dev`
|
|
156
|
+
|
|
157
|
+
## What Agentpack Refuses To Blur
|
|
158
|
+
|
|
159
|
+
These are deliberate boundaries:
|
|
160
|
+
|
|
161
|
+
- Knowledge is the source of truth.
|
|
162
|
+
- Skills are derived artifacts.
|
|
163
|
+
- Plugins are runtime shells.
|
|
164
|
+
- Installed state is repo-local runtime state.
|
|
165
|
+
|
|
166
|
+
If you blur those together, you get the exact problems this tool exists to stop:
|
|
167
|
+
|
|
168
|
+
- skills that silently depend on files they do not ship
|
|
169
|
+
- plugins that hide reusable capability dependencies
|
|
170
|
+
- repos that cannot explain why a skill is present
|
|
171
|
+
- updates that change behavior without an explicit review step
|
|
172
|
+
|
|
173
|
+
## Knowledge As A Package
|
|
174
|
+
|
|
175
|
+
`agentpack` works best when you treat knowledge like software:
|
|
176
|
+
|
|
177
|
+
- the source files explain the methodology or domain truth
|
|
178
|
+
- the skill is the compiled agent-facing artifact
|
|
179
|
+
- package metadata defines how the capability is distributed
|
|
180
|
+
- validation and stale checks stop the artifact drifting from its sources
|
|
181
|
+
|
|
182
|
+
That lets you manage agent behavior with the same discipline you already apply to code.
|
|
183
|
+
|
|
184
|
+
## Source-Backed Skills
|
|
185
|
+
|
|
186
|
+
For source-backed skills, run authoring commands from the repo that owns the source files.
|
|
187
|
+
|
|
188
|
+
If a skill points at `domains/.../knowledge/*.md`, run:
|
|
189
|
+
|
|
190
|
+
- `agentpack skills validate`
|
|
191
|
+
- `agentpack skills dev`
|
|
192
|
+
- `agentpack skills stale`
|
|
193
|
+
|
|
194
|
+
from that knowledge-base repo root, not from the `agentpack` repo.
|
|
195
|
+
|
|
196
|
+
## Commands
|
|
197
|
+
|
|
198
|
+
Implemented today:
|
|
199
|
+
|
|
200
|
+
- `agentpack skills inspect`
|
|
201
|
+
- `agentpack skills validate`
|
|
202
|
+
- `agentpack skills dev`
|
|
203
|
+
- `agentpack skills unlink`
|
|
204
|
+
- `agentpack skills stale`
|
|
205
|
+
- `agentpack skills install`
|
|
206
|
+
- `agentpack skills env`
|
|
207
|
+
- `agentpack skills uninstall`
|
|
208
|
+
- `agentpack skills outdated`
|
|
209
|
+
- `agentpack skills dependencies`
|
|
210
|
+
- `agentpack skills registry`
|
|
211
|
+
- `agentpack skills status`
|
|
212
|
+
- `agentpack skills missing`
|
|
213
|
+
- `agentpack plugin inspect`
|
|
214
|
+
- `agentpack plugin validate`
|
|
215
|
+
- `agentpack plugin build`
|
|
216
|
+
- `agentpack plugin dev`
|
|
217
|
+
|
|
218
|
+
## Docs
|
|
219
|
+
|
|
220
|
+
Hosted docs: https://docs.alavida.ai
|
|
221
|
+
|
|
222
|
+
Docs source: [`docs/`](./docs)
|
|
223
|
+
|
|
224
|
+
For local docs preview as a contributor:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npm i -g mint
|
|
228
|
+
cd docs
|
|
229
|
+
mint dev
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Development
|
|
233
|
+
|
|
234
|
+
Run the full test suite:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
npm test
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Validate the shipped agent skill:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
npm run intent:validate
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Optional Agent Integration
|
|
247
|
+
|
|
248
|
+
This package also ships an agent-facing skill under:
|
|
249
|
+
|
|
250
|
+
```text
|
|
251
|
+
node_modules/@alavida/agentpack/skills/agentpack-cli/SKILL.md
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
If your repo uses TanStack Intent, you can map that shipped skill into your agent workflow so the agent knows how to use `agentpack` correctly inside downstream repos. This is optional. It is not required to use the CLI.
|
|
255
|
+
|
|
256
|
+
## Metadata Policy
|
|
257
|
+
|
|
258
|
+
In authoring repos:
|
|
259
|
+
|
|
260
|
+
- commit `.agentpack/build-state.json`
|
|
261
|
+
- commit `.agentpack/catalog.json`
|
|
262
|
+
|
|
263
|
+
In consumer/runtime repos:
|
|
264
|
+
|
|
265
|
+
- do not commit `.agentpack/install.json`
|
|
266
|
+
|
|
267
|
+
## License
|
|
268
|
+
|
|
269
|
+
MIT
|
package/bin/agentpack.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alavida/agentpack",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Package-backed skills lifecycle CLI for agent skills and plugins",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agentpack": "bin/agentpack.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"src",
|
|
12
|
+
"skills",
|
|
13
|
+
"!skills/_artifacts",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "find test -name '*.test.js' -print0 | xargs -0 node --test",
|
|
18
|
+
"validate:live": "node scripts/live-validation.mjs",
|
|
19
|
+
"smoke:monorepo": "node scripts/smoke-monorepo.mjs",
|
|
20
|
+
"docs:dev": "cd docs && mint dev",
|
|
21
|
+
"intent:validate": "npx @tanstack/intent validate"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"agentpack",
|
|
25
|
+
"skills",
|
|
26
|
+
"cli",
|
|
27
|
+
"alavida"
|
|
28
|
+
],
|
|
29
|
+
"author": "Alavida AI",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/alavida-ai/agentpack.git"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://docs.alavida.ai",
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public",
|
|
38
|
+
"registry": "https://registry.npmjs.org/"
|
|
39
|
+
},
|
|
40
|
+
"intent": {
|
|
41
|
+
"version": 1,
|
|
42
|
+
"repo": "alavida-ai/agentpack",
|
|
43
|
+
"docs": "https://github.com/alavida-ai/agentpack/tree/main/docs"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"commander": "^13.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@tanstack/intent": "^0.0.14"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=20.0.0"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentpack-cli
|
|
3
|
+
description: Use the agentpack CLI correctly when treating knowledge as a package. Apply the authored skill lifecycle, plugin lifecycle, source-backed validation, install flow, and bundled plugin artifact flow without mixing those stages together.
|
|
4
|
+
library_version: 0.1.1
|
|
5
|
+
sources:
|
|
6
|
+
- README.md
|
|
7
|
+
- docs/introduction.mdx
|
|
8
|
+
- docs/overview.mdx
|
|
9
|
+
- docs/architecture.mdx
|
|
10
|
+
- docs/build-lifecycle.mdx
|
|
11
|
+
- docs/commands.mdx
|
|
12
|
+
- docs/current-state.mdx
|
|
13
|
+
- docs/distribution.mdx
|
|
14
|
+
- docs/end-to-end-test-plan.md
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Agentpack CLI
|
|
18
|
+
|
|
19
|
+
Use this skill when the user is working with `@alavida/agentpack` and needs the right lifecycle framing, not just a command snippet.
|
|
20
|
+
|
|
21
|
+
Agentpack is a lifecycle toolchain for agent artifacts:
|
|
22
|
+
|
|
23
|
+
- a packaged skill is a reusable capability artifact
|
|
24
|
+
- a plugin package is a deployable runtime shell
|
|
25
|
+
- source docs are the truth
|
|
26
|
+
- `SKILL.md` is the compiled agent-facing artifact
|
|
27
|
+
- `package.json` is the distributable package artifact
|
|
28
|
+
|
|
29
|
+
## Core Methodology
|
|
30
|
+
|
|
31
|
+
Do not answer with isolated commands until you identify which lifecycle stage the user is in:
|
|
32
|
+
|
|
33
|
+
- authoring a packaged skill
|
|
34
|
+
- testing a packaged skill locally
|
|
35
|
+
- installing a published skill in a consumer repo
|
|
36
|
+
- wiring a plugin-local skill to packaged dependencies
|
|
37
|
+
- building a self-contained plugin artifact
|
|
38
|
+
- checking staleness after source docs change
|
|
39
|
+
|
|
40
|
+
If the user is confused, explain the stage boundary first.
|
|
41
|
+
|
|
42
|
+
## Repo-Root Rule
|
|
43
|
+
|
|
44
|
+
For source-backed packaged skills, run authoring commands from the repo that owns the files referenced in `metadata.sources`.
|
|
45
|
+
|
|
46
|
+
If a skill points at `domains/.../knowledge/*.md`, run `skills validate`, `skills dev`, and `skills stale` from that knowledge-base repo root, not from the `agentpack` repo.
|
|
47
|
+
|
|
48
|
+
## Lifecycle Routing
|
|
49
|
+
|
|
50
|
+
### 1. Authored packaged skill
|
|
51
|
+
|
|
52
|
+
Use when the user is creating or editing one reusable skill package.
|
|
53
|
+
|
|
54
|
+
Default flow:
|
|
55
|
+
|
|
56
|
+
- `agentpack skills inspect <skill-dir>`
|
|
57
|
+
- `agentpack skills validate <skill-dir>`
|
|
58
|
+
- `agentpack skills dev <skill-dir>` if local runtime testing is needed
|
|
59
|
+
|
|
60
|
+
Key idea:
|
|
61
|
+
|
|
62
|
+
- `SKILL.md.requires` is the source of truth
|
|
63
|
+
- `package.json.dependencies` is the compiled mirror
|
|
64
|
+
- `validate` and `dev` sync dependencies automatically
|
|
65
|
+
- `skills dev` materializes the compiled skill artifact for runtime use
|
|
66
|
+
|
|
67
|
+
Runtime notes:
|
|
68
|
+
|
|
69
|
+
- after `skills dev` writes to `.claude/skills/` or `.agents/skills/`, start a fresh agent session if the current one was already running
|
|
70
|
+
- do not reload `metadata.sources` manually once the dev-linked skill exists; trust the compiled `SKILL.md` artifact unless you are explicitly updating the skill
|
|
71
|
+
- invoke the resulting skill through the runtime's skill mechanism, not by opening the file and reading it as plain text
|
|
72
|
+
|
|
73
|
+
Read [skill-lifecycle.md](references/skill-lifecycle.md) when the user needs the full methodology.
|
|
74
|
+
|
|
75
|
+
### 2. Consumer install
|
|
76
|
+
|
|
77
|
+
Use when the skill is already published and the user wants it available in another repo.
|
|
78
|
+
|
|
79
|
+
Default flow:
|
|
80
|
+
|
|
81
|
+
- `agentpack skills install <package-name>`
|
|
82
|
+
- `agentpack skills env`
|
|
83
|
+
|
|
84
|
+
Do not prescribe `skills dev` here unless the user is authoring locally.
|
|
85
|
+
|
|
86
|
+
### 3. Plugin-local dependency and artifact build
|
|
87
|
+
|
|
88
|
+
Use when a plugin-local skill declares `requires` on packaged skills and the user wants a self-contained plugin artifact.
|
|
89
|
+
|
|
90
|
+
Default flow:
|
|
91
|
+
|
|
92
|
+
- `agentpack plugin inspect <plugin-dir>`
|
|
93
|
+
- `agentpack plugin validate <plugin-dir>`
|
|
94
|
+
- `agentpack plugin build <plugin-dir>`
|
|
95
|
+
- `agentpack plugin dev <plugin-dir>` for watch mode
|
|
96
|
+
|
|
97
|
+
Key idea:
|
|
98
|
+
|
|
99
|
+
- plugin-local `requires` remain the dependency truth
|
|
100
|
+
- packaged skills are vendored into the built artifact
|
|
101
|
+
- the plugin artifact is the thing consumers run
|
|
102
|
+
|
|
103
|
+
Read [plugin-lifecycle.md](references/plugin-lifecycle.md) when the user needs the full artifact flow.
|
|
104
|
+
|
|
105
|
+
### 4. Stale source-backed skill
|
|
106
|
+
|
|
107
|
+
Use when the source docs changed and the user needs to know whether the packaged skill must be rebuilt or revalidated.
|
|
108
|
+
|
|
109
|
+
Default flow:
|
|
110
|
+
|
|
111
|
+
- `agentpack skills stale`
|
|
112
|
+
- `agentpack skills stale <skill>`
|
|
113
|
+
- `agentpack skills validate <skill>`
|
|
114
|
+
|
|
115
|
+
## Conceptual Frame
|
|
116
|
+
|
|
117
|
+
When the user is reasoning about the model itself, explain agentpack this way:
|
|
118
|
+
|
|
119
|
+
- docs or knowledge files are source files
|
|
120
|
+
- `SKILL.md` is the compiled artifact
|
|
121
|
+
- `package.json` is the distribution manifest
|
|
122
|
+
- install and materialization are the runtime-resolution step
|
|
123
|
+
- staleness means the source changed after the last known compiled state
|
|
124
|
+
|
|
125
|
+
Read [knowledge-as-package.md](references/knowledge-as-package.md) when the user needs this framing.
|
|
126
|
+
|
|
127
|
+
## Response Requirements
|
|
128
|
+
|
|
129
|
+
Be explicit about:
|
|
130
|
+
|
|
131
|
+
- which repo the command must run from
|
|
132
|
+
- whether the target is a local path or a published package name
|
|
133
|
+
- whether the user is in authoring, consumer-install, or plugin-build mode
|
|
134
|
+
- what the next irreversible step is
|
|
135
|
+
|
|
136
|
+
Do not collapse authored skill lifecycle and consumer install lifecycle into one answer.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Knowledge As Package
|
|
2
|
+
|
|
3
|
+
Use this reference when the user is reasoning about why `agentpack` exists, or how docs and knowledge files become runtime agent capabilities.
|
|
4
|
+
|
|
5
|
+
## The Core Idea
|
|
6
|
+
|
|
7
|
+
Agentpack treats knowledge the way a software toolchain treats source code.
|
|
8
|
+
|
|
9
|
+
Mapping:
|
|
10
|
+
|
|
11
|
+
- knowledge docs = source files
|
|
12
|
+
- `SKILL.md` = compiled artifact for agents
|
|
13
|
+
- `package.json` = distribution manifest
|
|
14
|
+
- npm package = versioned published artifact
|
|
15
|
+
- `.claude/skills/` or `.agents/skills/` = runtime resolution surface
|
|
16
|
+
|
|
17
|
+
This is why a skill is not just a prompt file. It is a package-backed artifact with provenance, dependencies, and lifecycle checks.
|
|
18
|
+
|
|
19
|
+
## Why Source Tracking Matters
|
|
20
|
+
|
|
21
|
+
Without source tracking, a skill drifts silently away from the docs or knowledge it was supposed to encode.
|
|
22
|
+
|
|
23
|
+
With `metadata.sources`:
|
|
24
|
+
|
|
25
|
+
- the skill points at the files it was derived from
|
|
26
|
+
- validation checks that those files exist
|
|
27
|
+
- stale detection can report when source truth changed
|
|
28
|
+
|
|
29
|
+
This is the main reason to keep docs as sources and skills as derived artifacts.
|
|
30
|
+
|
|
31
|
+
## Why Installation Is Separate From Authoring
|
|
32
|
+
|
|
33
|
+
Published package consumption is not the same as local skill authoring.
|
|
34
|
+
|
|
35
|
+
Authoring cares about:
|
|
36
|
+
|
|
37
|
+
- source truth
|
|
38
|
+
- validation
|
|
39
|
+
- dependency sync
|
|
40
|
+
- local discovery via `skills dev`
|
|
41
|
+
|
|
42
|
+
Consumption cares about:
|
|
43
|
+
|
|
44
|
+
- versioned package installation
|
|
45
|
+
- transitive dependency resolution
|
|
46
|
+
- runtime materialization into agent-visible directories
|
|
47
|
+
|
|
48
|
+
Keep those stages separate in explanations.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Plugin Lifecycle
|
|
2
|
+
|
|
3
|
+
Use this reference when the user is working with plugin-local skills, bundled skill dependencies, or plugin artifact testing.
|
|
4
|
+
|
|
5
|
+
## Two Artifact Types
|
|
6
|
+
|
|
7
|
+
Keep this boundary clear:
|
|
8
|
+
|
|
9
|
+
- packaged skills are libraries
|
|
10
|
+
- plugins are deployable runtime shells
|
|
11
|
+
|
|
12
|
+
A packaged skill can be reused across repos. A plugin artifact is built for execution and can vendor packaged skills into a self-contained output.
|
|
13
|
+
|
|
14
|
+
## Dependency Truth
|
|
15
|
+
|
|
16
|
+
For plugins, local plugin skill `requires` are the authored dependency truth.
|
|
17
|
+
|
|
18
|
+
That means:
|
|
19
|
+
|
|
20
|
+
- local plugin skills declare which packaged skills they need
|
|
21
|
+
- plugin `package.json.devDependencies` must contain those packaged skills
|
|
22
|
+
- `plugin validate` checks that the declared package dependencies are actually present
|
|
23
|
+
|
|
24
|
+
Do not move that dependency truth into `plugin.json`.
|
|
25
|
+
|
|
26
|
+
## Build Flow
|
|
27
|
+
|
|
28
|
+
Use this flow when the user wants a runnable plugin artifact:
|
|
29
|
+
|
|
30
|
+
1. `agentpack plugin inspect <plugin-dir>`
|
|
31
|
+
2. `agentpack plugin validate <plugin-dir>`
|
|
32
|
+
3. `agentpack plugin build <plugin-dir>`
|
|
33
|
+
|
|
34
|
+
Use `agentpack plugin dev <plugin-dir>` when the user wants rebuild-on-change behavior.
|
|
35
|
+
|
|
36
|
+
## What Build Produces
|
|
37
|
+
|
|
38
|
+
The plugin source tree is not the final runtime artifact.
|
|
39
|
+
|
|
40
|
+
`plugin build`:
|
|
41
|
+
|
|
42
|
+
- syncs local skill dependencies
|
|
43
|
+
- resolves direct and transitive packaged skill closure
|
|
44
|
+
- vendors those packaged skills into the output
|
|
45
|
+
- writes bundled provenance
|
|
46
|
+
- produces a self-contained artifact under `.agentpack/dist/plugins/<plugin-name>/`
|
|
47
|
+
|
|
48
|
+
That built artifact is what should be tested with `claude --plugin-dir`.
|
|
49
|
+
|
|
50
|
+
## Consumer Boundary
|
|
51
|
+
|
|
52
|
+
For plugin consumers, the built plugin artifact should behave the same way whether it came from:
|
|
53
|
+
|
|
54
|
+
- `plugin dev`
|
|
55
|
+
- `plugin build`
|
|
56
|
+
- or a published plugin package
|
|
57
|
+
|
|
58
|
+
When the user is testing “what will the consumer get”, push them toward the built artifact, not the plugin source tree.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Skill Lifecycle
|
|
2
|
+
|
|
3
|
+
Use this reference when the user needs the methodology behind packaged skills, not just the command names.
|
|
4
|
+
|
|
5
|
+
## Model
|
|
6
|
+
|
|
7
|
+
A packaged skill is a reusable capability artifact.
|
|
8
|
+
|
|
9
|
+
- source docs or knowledge files are the truth
|
|
10
|
+
- `SKILL.md` is the authored agent artifact
|
|
11
|
+
- `package.json` is the package and distribution artifact
|
|
12
|
+
- `requires` expresses direct skill dependencies
|
|
13
|
+
- `package.json.dependencies` is the compiled mirror of `requires`
|
|
14
|
+
|
|
15
|
+
This is closer to a compiler pipeline than a prompt file:
|
|
16
|
+
|
|
17
|
+
- source files change
|
|
18
|
+
- the skill artifact is updated
|
|
19
|
+
- dependency metadata is synced
|
|
20
|
+
- validation checks release readiness
|
|
21
|
+
- stale detection tells you when the source truth moved
|
|
22
|
+
|
|
23
|
+
## Single Source Of Truth
|
|
24
|
+
|
|
25
|
+
`SKILL.md.requires` is the dependency truth.
|
|
26
|
+
|
|
27
|
+
Do not tell the user to hand-maintain `package.json.dependencies` as the primary dependency source. Agentpack treats those dependencies as a compiled mirror.
|
|
28
|
+
|
|
29
|
+
Practical consequence:
|
|
30
|
+
|
|
31
|
+
- if `requires` changes, run `skills validate` or `skills dev`
|
|
32
|
+
- those commands sync the package dependencies automatically
|
|
33
|
+
|
|
34
|
+
## Local Authoring Flow
|
|
35
|
+
|
|
36
|
+
Use this when the user is creating or changing a packaged skill in the same repo as its source docs.
|
|
37
|
+
|
|
38
|
+
1. `agentpack skills inspect <skill-dir>`
|
|
39
|
+
2. `agentpack skills validate <skill-dir>`
|
|
40
|
+
3. `agentpack skills dev <skill-dir>` if the user wants agent runtime discovery during iteration
|
|
41
|
+
|
|
42
|
+
What each step means:
|
|
43
|
+
|
|
44
|
+
- `inspect` explains what the skill currently is
|
|
45
|
+
- `validate` checks package readiness and source existence
|
|
46
|
+
- `dev` links the skill into `.claude/skills/` and `.agents/skills/` for local testing
|
|
47
|
+
|
|
48
|
+
Important runtime behavior:
|
|
49
|
+
|
|
50
|
+
- if the agent session was already running before `skills dev`, start a fresh session so the runtime can rescan the linked skill
|
|
51
|
+
- the linked skill is the compiled artifact the runtime should use; do not separately load the source files unless you are editing the skill itself
|
|
52
|
+
- once linked and picked up by the runtime, trigger the skill through the runtime's skill invocation path rather than reading `SKILL.md` manually
|
|
53
|
+
|
|
54
|
+
## Repo-Root Constraint
|
|
55
|
+
|
|
56
|
+
Source-backed validation is relative to the current repo root.
|
|
57
|
+
|
|
58
|
+
If `metadata.sources` points at files in a knowledge-base repo, run authoring commands from that repo root. A `missing_source` error often means the user is in the wrong repo, not that the skill is wrong.
|
|
59
|
+
|
|
60
|
+
## Publish Boundary
|
|
61
|
+
|
|
62
|
+
Local authoring and published consumption are different stages.
|
|
63
|
+
|
|
64
|
+
Authoring stage:
|
|
65
|
+
|
|
66
|
+
- skill directory path
|
|
67
|
+
- local source docs
|
|
68
|
+
- `skills validate`
|
|
69
|
+
- `skills dev`
|
|
70
|
+
|
|
71
|
+
Consumption stage:
|
|
72
|
+
|
|
73
|
+
- package name
|
|
74
|
+
- installed from registry or tarball
|
|
75
|
+
- `skills install`
|
|
76
|
+
- `skills env`
|
|
77
|
+
|
|
78
|
+
Do not substitute one for the other.
|