agent-skillboard 0.1.2 → 0.2.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.
Files changed (57) hide show
  1. package/README.md +154 -631
  2. package/docs/adapters.md +96 -96
  3. package/docs/ai-skill-routing-goal.md +112 -0
  4. package/docs/capabilities.md +6 -0
  5. package/docs/install.md +155 -105
  6. package/docs/plans/skillboard-variant-lifecycle-handoff.md +56 -0
  7. package/docs/policy-model.md +266 -214
  8. package/docs/positioning.md +94 -94
  9. package/docs/reference.md +349 -0
  10. package/docs/routing.md +85 -0
  11. package/docs/user-flow.md +75 -16
  12. package/docs/value-proof.md +190 -0
  13. package/docs/variant-lifecycle.md +86 -0
  14. package/docs/versioning.md +149 -138
  15. package/examples/multi-source-skills/anthropic/docx/SKILL.md +8 -8
  16. package/examples/multi-source-skills/anthropic/skill-creator/SKILL.md +8 -8
  17. package/examples/multi-source-skills/matt/grill-me/SKILL.md +8 -8
  18. package/examples/multi-source-skills/matt/tdd/SKILL.md +8 -8
  19. package/examples/multi-source-skills/omo/review-work/SKILL.md +8 -8
  20. package/examples/multi-source-skills/omo/ulw-plan/SKILL.md +8 -8
  21. package/examples/multi-source-skills/private/tdd-work-continuity/SKILL.md +8 -8
  22. package/examples/multi-source-skills/private/workflow-router/SKILL.md +8 -8
  23. package/examples/multi-source-skills/wshobson/python-testing/SKILL.md +8 -8
  24. package/examples/multi-source-skills/wshobson/security-review/SKILL.md +8 -8
  25. package/examples/skills/grill-me/SKILL.md +9 -9
  26. package/examples/skills/grill-with-docs/SKILL.md +9 -9
  27. package/examples/skills/requirement-intake/SKILL.md +9 -9
  28. package/examples/skills/tdd/SKILL.md +8 -8
  29. package/package.json +7 -3
  30. package/src/advisor/guidance.mjs +232 -0
  31. package/src/advisor/schema.mjs +2 -0
  32. package/src/advisor/skills.mjs +2 -0
  33. package/src/advisor.mjs +36 -7
  34. package/src/brief-cli.mjs +6 -5
  35. package/src/brief-renderer.mjs +225 -8
  36. package/src/cli.mjs +574 -27
  37. package/src/config-helpers.mjs +34 -18
  38. package/src/conflicts.mjs +70 -0
  39. package/src/control/can-use-guard.mjs +8 -3
  40. package/src/control/skill-crud.mjs +142 -0
  41. package/src/control/skill-variants.mjs +221 -0
  42. package/src/control/source-trust.mjs +1 -0
  43. package/src/control/variant-files.mjs +265 -0
  44. package/src/control/variant-lifecycle-config.mjs +156 -0
  45. package/src/control/variant-reset.mjs +171 -0
  46. package/src/control/variant-status.mjs +75 -0
  47. package/src/control.mjs +13 -1
  48. package/src/domain/rules/skills.mjs +60 -0
  49. package/src/domain/rules/workflows.mjs +13 -0
  50. package/src/impact.mjs +21 -12
  51. package/src/index.mjs +13 -1
  52. package/src/lifecycle-cli.mjs +18 -7
  53. package/src/lifecycle-content.mjs +29 -22
  54. package/src/route.mjs +537 -0
  55. package/src/source-verification.mjs +7 -3
  56. package/src/workspace.mjs +141 -43
  57. package/tsconfig.lsp.json +1 -1
package/docs/user-flow.md CHANGED
@@ -1,10 +1,30 @@
1
1
  # First-Time Skill Control Flow
2
2
 
3
- This flow assumes a user installed SkillBoard because they want to see and
4
- control which agent skills can affect a workflow.
3
+ This flow assumes a user installed SkillBoard because they want to ask their AI
4
+ which skills are safe to use and approve changes without learning the control
5
+ plane internals.
6
+
7
+ When you ask your AI "what skills can you use here?" or "make this reviewed
8
+ skill available for this workflow," the AI should read the current brief, show
9
+ the relevant choice, ask only before applying one current action id when policy
10
+ would change, and run the final guard automatically before invocation. For an
11
+ already-allowed skill, the AI should state which skill it is about to use and
12
+ which skill it used when reporting the result, not ask for another approval.
13
+ That disclosure is an audit trace, not a permission prompt. You do not need to
14
+ memorize the SkillBoard command loop. The command examples below are
15
+ AI/automation/operator details for the agent, scripts, or people maintaining the
16
+ setup.
17
+
18
+ Before changing this routing or workflow UX, read
19
+ [`docs/ai-skill-routing-goal.md`](ai-skill-routing-goal.md). The goal is to keep
20
+ SkillBoard non-blocking: observe the request, route to the current best skill,
21
+ work normally, explain briefly, ask after use only when a policy preference would
22
+ help, and remember that usage policy without rewriting skill bodies.
5
23
 
6
24
  ## 1. Bootstrap The Control Plane
7
25
 
26
+ AI/automation/operator details:
27
+
8
28
  ```bash
9
29
  skillboard init
10
30
  skillboard doctor
@@ -25,23 +45,49 @@ safety". Use
25
45
  `skillboard doctor --strict` when review-needed safe-mode warnings should fail
26
46
  automation.
27
47
 
28
- When the user asks the agent what it can use, the agent should run
29
- `skillboard brief --json` first and answer from the brief rather than reading
30
- skill files directly. The user-facing text output uses sections such as "What
31
- your AI can use now", "Needs your decision", and "Blocked for safety"; text
32
- briefs include previewable action cards by default, while the JSON form keeps
33
- action cards opt-in. For large skill sets, the default text brief stays compact:
34
- counts, top categories, next safe action, short previews per section, and short
35
- action summaries. Use `skillboard brief --verbose` when you need every skill and
36
- full copyable command details. Those action cards are suggestions only: the
37
- agent should pick one current action id from the brief, request confirmation
38
- before applying risk-bearing changes, then run
48
+ When the user asks the agent what it can use, the agent should read the current
49
+ brief with `skillboard brief --json` first and answer from the brief rather than
50
+ reading skill files directly. The user-facing text output uses sections such as
51
+ "What your AI can use now", "Needs your decision", and "Blocked for safety";
52
+ text briefs include previewable action cards by default, while the JSON form
53
+ keeps action cards opt-in. For large skill sets, the default text brief stays
54
+ compact: counts, top categories, next safe action, short previews per section,
55
+ and short action summaries. Use `skillboard brief --verbose` when an operator
56
+ needs every skill and full copyable command details. Those action cards are
57
+ suggestions only: the agent should pick one current action id from the brief,
58
+ request confirmation before applying risk-bearing changes, then run
39
59
  `skillboard apply-action <action-id> --config skillboard.config.yaml --skills skills --yes --json`
40
60
  with `--workflow <name>` when a workflow is selected. The agent should read the
41
61
  returned post-apply brief before making the next availability claim.
42
62
  `apply-action` re-resolves the current brief and refuses stale action ids instead
43
63
  of replaying cached action-card shell text.
44
64
 
65
+ When the user asks which skill fits a task, the agent can keep the same brief
66
+ flow and include the user request as intent:
67
+
68
+ ```bash
69
+ skillboard brief --intent "write tests before implementation" --workflow daily-workflow --config skillboard.config.yaml --skills skills --json
70
+ ```
71
+
72
+ The returned `assistant_guidance.route` maps the request to a declared workflow
73
+ capability or a workflow-bound skill metadata match, returns the recommended
74
+ skill and fallbacks, and includes `match_source`, `matched_terms`,
75
+ `recommendation_reason`, `route_candidates`, `post_use_policy_suggestion`, and the
76
+ `skillboard guard use ...` command that still needs to pass immediately before
77
+ invocation. `route_candidates` is the per-skill decision trace: it shows which
78
+ matching skill was selected, which candidates were denied, and the guard reason
79
+ when a preferred skill was skipped for an allowed fallback.
80
+ `post_use_policy_suggestion` is the ask-after-use hook: if it is present, the
81
+ agent should use the allowed routed skill first, then ask after completion
82
+ whether to remember the suggested preference. Metadata matching can
83
+ use declared skill id, path, category, and `SKILL.md` frontmatter
84
+ name/description; it does not semantically rank raw skill bodies. If a
85
+ recommended skill is already allowed, the agent should disclose it at the start
86
+ and completion rather than ask for another approval. If no capability or
87
+ workflow-bound skill matches, the agent should ask a clarifying question instead
88
+ of guessing from raw `SKILL.md` text. Operators can still call
89
+ `skillboard route ...` directly when they only need the recommendation payload.
90
+
45
91
  Run this again after installing agent packages, plugins, workflow bundles, or
46
92
  harnesses:
47
93
 
@@ -52,6 +98,8 @@ skillboard inventory refresh
52
98
 
53
99
  ## 2. Add A User-Owned Skill
54
100
 
101
+ AI/automation/operator details:
102
+
55
103
  Create the skill under the project `skills/` directory:
56
104
 
57
105
  ```bash
@@ -97,6 +145,8 @@ does not grant automatic model invocation.
97
145
 
98
146
  ## 3. Inspect Influence Before Use
99
147
 
148
+ AI/automation/operator details:
149
+
100
150
  ```bash
101
151
  skillboard explain user.helper \
102
152
  --config skillboard.config.yaml \
@@ -119,8 +169,11 @@ shows which workflows and required outputs would be affected before disabling or
119
169
  removing a skill.
120
170
 
121
171
  For an actual invocation, `brief` is not the final permission check. Agents
122
- should run `skillboard guard use ...` immediately before calling a skill so
123
- state changes made after the brief cannot slip through.
172
+ should run `skillboard guard use ...` automatically immediately before calling a
173
+ skill so state changes made after the brief cannot slip through. A passing guard
174
+ does not require another user prompt; the agent should disclose the skill use at
175
+ the start and in the final result. That disclosure is an audit trace, not a
176
+ permission prompt.
124
177
 
125
178
  When wiring a guard hook from an action card, keep `apply-action` as the
126
179
  action-card primary flow:
@@ -130,7 +183,7 @@ skillboard apply-action <action-id> --workflow daily-workflow --config skillboar
130
183
  ```
131
184
 
132
185
  The raw hook commands are underlying manual operator detail for previewing and
133
- materializing an executable guard hook outside the action-card approval loop:
186
+ materializing an executable guard hook outside the action-card control loop:
134
187
 
135
188
  ```bash
136
189
  skillboard hook install --workflow daily-workflow --config skillboard.config.yaml --skills skills --out .skillboard/hooks/daily-workflow-guard.sh --dry-run --json
@@ -142,6 +195,8 @@ before an operator materializes the matching non-dry-run hook command.
142
195
 
143
196
  ## 4. Enable, Disable, Or Prefer
144
197
 
198
+ AI/automation/operator details:
199
+
145
200
  Enable the skill only for the workflow that should see it:
146
201
 
147
202
  ```bash
@@ -176,6 +231,8 @@ skillboard prefer user.helper \
176
231
 
177
232
  ## 5. Remove Governance Without Deleting User Files
178
233
 
234
+ AI/automation/operator details:
235
+
179
236
  First try the safe remove:
180
237
 
181
238
  ```bash
@@ -206,6 +263,8 @@ This removes SkillBoard policy references only. It does not delete
206
263
 
207
264
  ## 6. Stop Using SkillBoard Safely
208
265
 
266
+ AI/automation/operator details:
267
+
209
268
  ```bash
210
269
  skillboard uninstall --dry-run
211
270
  skillboard uninstall
@@ -0,0 +1,190 @@
1
+ # SkillBoard Value Proof
2
+
3
+ This is the README-facing proof that SkillBoard gives a user more useful control
4
+ than manually inspecting `/skills` or a raw workflow skill list.
5
+
6
+ The proof is executable:
7
+
8
+ ```bash
9
+ node --test test/readme-value-proof.test.mjs
10
+ ```
11
+
12
+ The test uses repository fixtures, not a mocked string. It drives the same CLI
13
+ surfaces a user or agent would use.
14
+
15
+ ## GitHub-reader takeaway
16
+
17
+ The raw list answers inventory questions: which skill declarations are connected
18
+ to this workflow?
19
+
20
+ SkillBoard answers operational safety questions: which skills can actually run
21
+ now, why are others blocked, which skill fits the user's current request, and
22
+ what approved action changes the next state?
23
+
24
+ In the tested fixture, the raw list can make the workflow look ready because it
25
+ shows `matt.tdd active workflow-auto`. SkillBoard refuses that unsafe claim and
26
+ reports 0 usable skills, 8 blocked skills, 2 policy errors, and 1 policy warning
27
+ before invocation.
28
+
29
+ ## Case 1: Raw skill list vs SkillBoard brief
30
+
31
+ Fixture:
32
+
33
+ ```bash
34
+ examples/skillboard.config.yaml
35
+ examples/skills
36
+ ```
37
+
38
+ Workflow:
39
+
40
+ ```bash
41
+ codex-night-workflow
42
+ ```
43
+
44
+ Raw skill list command:
45
+
46
+ ```bash
47
+ node bin/skillboard.mjs list skills \
48
+ --config examples/skillboard.config.yaml \
49
+ --skills examples/skills \
50
+ --workflow codex-night-workflow
51
+ ```
52
+
53
+ Observed raw-list result:
54
+
55
+ - Raw skill list: 4 workflow-linked rows.
56
+ - It includes `matt.tdd active workflow-auto`.
57
+ - It does not include policy health.
58
+
59
+ SkillBoard brief command:
60
+
61
+ ```bash
62
+ node bin/skillboard.mjs brief \
63
+ --config examples/skillboard.config.yaml \
64
+ --skills examples/skills \
65
+ --workflow codex-night-workflow
66
+ ```
67
+
68
+ Observed brief result:
69
+
70
+ - SkillBoard brief: 0 usable skills.
71
+ - 8 blocked skills.
72
+ - Policy errors: 2.
73
+ - Policy warnings: 1.
74
+ - The policy diagnostics identify `matt.grill-with-docs` as a non-callable
75
+ fallback in `requirement-review`.
76
+
77
+ What this proves:
78
+
79
+ - The raw list can make a workflow look usable because it reports declared
80
+ state such as `active` and `workflow-auto`.
81
+ - The SkillBoard brief checks policy health before use and refuses the unsafe
82
+ availability claim.
83
+
84
+ ## Case 2: Approved action-card flow
85
+
86
+ Fixture:
87
+
88
+ ```bash
89
+ examples/multi-source.config.yaml
90
+ examples/multi-source-skills
91
+ ```
92
+
93
+ The test copies this fixture to a temporary project, including `AGENTS.md` and
94
+ `CLAUDE.md`, then runs:
95
+
96
+ ```bash
97
+ node bin/skillboard.mjs brief ... --include-actions --json
98
+ node bin/skillboard.mjs apply-action activate-skill:anthropic.docx ... --yes --json
99
+ node bin/skillboard.mjs brief ... --json
100
+ ```
101
+
102
+ Observed action-card flow result:
103
+
104
+ - Before apply, usable skills: 2.
105
+ - The current action list includes `activate-skill:anthropic.docx`.
106
+ - Applying that one approved action returns `changed: true`.
107
+ - After apply, usable skills: 2 -> 3.
108
+ - `anthropic.docx` appears in `manual_allowed`.
109
+ - The final brief has 0 policy errors.
110
+
111
+ What this proves:
112
+
113
+ - SkillBoard is not just a catalog. It gives a current action id, applies one
114
+ approved change, then re-resolves the next availability state.
115
+ - The user does not need to hand-edit YAML or infer enable/disable impact from
116
+ raw `SKILL.md` files.
117
+
118
+ ## Case 3: AI-mediated approved action proof
119
+
120
+ The test also simulates the product path without calling an external LLM:
121
+
122
+ ```bash
123
+ node bin/skillboard.mjs brief ... --include-actions --json
124
+ node bin/skillboard.mjs apply-action <current-action-id> ... --yes --json
125
+ node bin/skillboard.mjs guard use anthropic.docx ... --json
126
+ node bin/skillboard.mjs guard use matt.grill-me ... --json
127
+ ```
128
+
129
+ Observed AI-mediated result:
130
+
131
+ - The simulated user asks for `anthropic.docx` to be made available.
132
+ - The AI reads `assistant_guidance.choices` from the current brief.
133
+ - The chosen confirmation maps to the current
134
+ `activate-skill:anthropic.docx` action id.
135
+ - `apply-action --yes --json` returns a post-apply brief.
136
+ - The returned brief no longer offers the stale activate action and now offers
137
+ the matching disable action.
138
+ - `guard use anthropic.docx --workflow codex-night-workflow` fails before the
139
+ approved action and succeeds after it.
140
+ - `guard use matt.grill-me --workflow codex-night-workflow` stays denied
141
+ because the workflow blocks that skill.
142
+
143
+ What this proves:
144
+
145
+ - The proof uses the current `assistant_guidance` action id instead of cached
146
+ output.
147
+ - SkillBoard keeps the guard as the final boundary before invocation.
148
+ - Blocked skills still produce a non-zero, machine-readable denial.
149
+
150
+ ## Case 4: AI route picks the right allowed skill
151
+
152
+ The same fixture also proves that SkillBoard can help the AI choose the right
153
+ skill before invocation:
154
+
155
+ ```bash
156
+ node bin/skillboard.mjs route "write tests before implementation" \
157
+ --config examples/multi-source.config.yaml \
158
+ --skills examples/multi-source-skills \
159
+ --workflow codex-night-workflow \
160
+ --json
161
+ ```
162
+
163
+ Observed route result:
164
+
165
+ - Matched capability: `test-first-implementation`.
166
+ - Match source: `capability`.
167
+ - Confidence: `high`.
168
+ - Recommended skill: `matt.tdd`.
169
+ - Fallback skill: `private.tdd-work-continuity`.
170
+ - Guard command: `skillboard guard use matt.tdd ...`.
171
+ - Guard result for `matt.tdd`: allowed.
172
+ - Start disclosure: `I will use matt.tdd for this request.`
173
+ - Finish disclosure: `I used matt.tdd for this request.`
174
+
175
+ The proof also checks `brief --intent "write tests before implementation"` so
176
+ the recommendation appears inside `assistant_guidance.route`, not only through
177
+ the standalone `route` command.
178
+
179
+ For a request outside the workflow's declared capability, such as "ship a
180
+ powerpoint deck", SkillBoard returns no recommended skill and tells the AI to:
181
+ Ask a clarifying question before choosing a skill.
182
+
183
+ What this proves:
184
+
185
+ - The AI can ask SkillBoard which skill fits a normal user request instead of
186
+ guessing from raw `SKILL.md` text.
187
+ - Allowed skill use stays low-friction: the AI discloses use at start and
188
+ finish instead of asking for redundant approval.
189
+ - No-match results are explicit, so the AI can ask a clarifying question rather
190
+ than forcing a poor skill choice.
@@ -0,0 +1,86 @@
1
+ # Skill Variant Lifecycle
2
+
3
+ SkillBoard treats a skill variant as a reviewed policy relationship plus a file snapshot trail. This is a manual adaptation lifecycle for cases such as `a -> claude.a`, where a human adapts a base skill for a specific agent or workflow and then asks SkillBoard to record, review, approve, or reset that relationship.
4
+
5
+ Variant lifecycle is policy registration. SkillBoard records metadata, snapshots, digests, and workflow preference changes; it does not convert skill bodies, does not rewrite skill bodies, and does not guarantee semantic equivalence of skill bodies.
6
+
7
+ ## Lifecycle commands
8
+
9
+ All examples use the global `skillboard` command. From a clone, replace `skillboard ` with `node bin/skillboard.mjs `.
10
+
11
+ ```bash
12
+ skillboard variant add <variant-id> --from <base-id> --capability <name> --workflow <name> --config <path> --skills <dir> [--path <relative-skill-path>] [--mode manual-only|router-only|workflow-auto] [--category <name>] [--owner-install-unit <unit-id>] [--dry-run] [--json]
13
+ skillboard variant fork <variant-id> --from <base-id> --capability <name> --workflow <name> --path <relative-skill-path> --config <path> --skills <dir> [--adapted-for <label>] [--category <name>] [--owner-install-unit <unit-id>] [--dry-run] [--json]
14
+ skillboard variant status <variant-id> --config <path> --skills <dir> [--json]
15
+ skillboard variant approve <variant-id> --config <path> --skills <dir> [--mode manual-only|router-only|workflow-auto] [--dry-run] [--json]
16
+ skillboard variant reset <variant-id> --to-base|--to-approved --config <path> --skills <dir> [--yes] [--dry-run] [--mode manual-only|router-only|workflow-auto] [--json]
17
+ ```
18
+
19
+ Use `--json` in scripts. Success payloads return the command-specific lifecycle fields such as `message`, `dryRun`, `changed`, `plan`, `filePlan`, `skill`, `variant`, and `warnings`. Errors include `ok: false` with a stable `error.code` and `error.message`. Usage errors exit with code `2` in both plain and JSON modes.
20
+
21
+ ## Recommended review flow
22
+
23
+ 1. Register or fork the variant from a known base:
24
+
25
+ ```bash
26
+ skillboard variant fork claude.a --from a --capability task-review --workflow claude-workflow --path claude/a --config skillboard.config.yaml --skills skills --json
27
+ ```
28
+
29
+ Fork creates a draft relationship and raw snapshot records without promoting the variant for automatic workflow use.
30
+
31
+ 2. Edit the variant `SKILL.md` by hand. This is where the actual adaptation happens.
32
+
33
+ 3. Inspect computed drift before approval:
34
+
35
+ ```bash
36
+ skillboard variant status claude.a --config skillboard.config.yaml --skills skills --json
37
+ ```
38
+
39
+ `variant.status` is the stored lifecycle state. `computedStatus` is derived from the live digest, the base digest, and the approved digest. A changed live file that differs from the base snapshot and has no matching approved snapshot is a draft candidate.
40
+
41
+ 4. Approve the reviewed variant:
42
+
43
+ ```bash
44
+ skillboard variant approve claude.a --config skillboard.config.yaml --skills skills --mode router-only --json
45
+ ```
46
+
47
+ Approval writes an approved snapshot, records the live digest, updates the skill metadata, and promotes the workflow preference/fallback policy for the chosen capability.
48
+
49
+ 5. Reset deliberately when needed:
50
+
51
+ ```bash
52
+ skillboard variant reset claude.a --to-base --config skillboard.config.yaml --skills skills --yes --json
53
+ skillboard variant reset claude.a --to-approved --config skillboard.config.yaml --skills skills --yes --json
54
+ ```
55
+
56
+ `--to-base` restores the base draft file and demotes workflow preference back to the base skill. `--to-approved` restores the approved snapshot and policy. Without `--yes`, mutating reset is rejected; use `--dry-run --json` to inspect the plan first.
57
+
58
+ ## Metadata and snapshots
59
+
60
+ Variant metadata lives with the skill declaration in `skillboard.config.yaml`:
61
+
62
+ ```yaml
63
+ skills:
64
+ claude.a:
65
+ variant:
66
+ of: a
67
+ capability: task-review
68
+ workflow: claude-workflow
69
+ status: approved
70
+ adapted_for: claude
71
+ base:
72
+ content_digest: sha256:...
73
+ snapshot: .skillboard/variant-snapshots/claude.a/base.md
74
+ approved:
75
+ content_digest: sha256:...
76
+ snapshot: .skillboard/variant-snapshots/claude.a/approved.md
77
+ ```
78
+
79
+ Snapshots are raw file records under `.skillboard/variant-snapshots/<encoded-skill-id>/`. That directory is created lazily by lifecycle commands such as `variant fork` and `variant approve`; `skillboard init` does not need to pre-create snapshot directories. A reset can restore the base or approved content safely from those records. The lifecycle helpers verify that snapshot and live paths stay inside the configured workspace before writing files.
80
+
81
+ ## Safety boundaries
82
+
83
+ - `variant fork` and `variant add` create policy metadata; they do not make a newly edited skill equivalent to the base.
84
+ - `variant approve` should happen only after human review of the live `SKILL.md` body and the `variant status` digest output.
85
+ - `variant reset` writes files only through the safe replacement helper and refuses ambiguous reset targets.
86
+ - A variant is still governed by normal capability, workflow, exposure, install-unit, and invocation checks.