@skill-map/spec 0.1.0

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 (43) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +105 -0
  3. package/architecture.md +218 -0
  4. package/cli-contract.md +336 -0
  5. package/conformance/README.md +140 -0
  6. package/conformance/cases/basic-scan.json +17 -0
  7. package/conformance/cases/kernel-empty-boot.json +24 -0
  8. package/conformance/fixtures/minimal-claude/agents/reviewer.md +16 -0
  9. package/conformance/fixtures/minimal-claude/commands/status.md +17 -0
  10. package/conformance/fixtures/minimal-claude/hooks/pre-commit.md +13 -0
  11. package/conformance/fixtures/minimal-claude/notes/architecture.md +11 -0
  12. package/conformance/fixtures/minimal-claude/skills/hello.md +22 -0
  13. package/conformance/fixtures/preamble-v1.txt +54 -0
  14. package/db-schema.md +359 -0
  15. package/dispatch-lifecycle.md +213 -0
  16. package/index.json +205 -0
  17. package/interfaces/security-scanner.md +233 -0
  18. package/job-events.md +322 -0
  19. package/package.json +49 -0
  20. package/plugin-kv-api.md +208 -0
  21. package/prompt-preamble.md +152 -0
  22. package/schemas/conformance-case.schema.json +185 -0
  23. package/schemas/execution-record.schema.json +88 -0
  24. package/schemas/frontmatter/agent.schema.json +22 -0
  25. package/schemas/frontmatter/base.schema.json +136 -0
  26. package/schemas/frontmatter/command.schema.json +39 -0
  27. package/schemas/frontmatter/hook.schema.json +29 -0
  28. package/schemas/frontmatter/note.schema.json +11 -0
  29. package/schemas/frontmatter/skill.schema.json +37 -0
  30. package/schemas/issue.schema.json +54 -0
  31. package/schemas/job.schema.json +75 -0
  32. package/schemas/link.schema.json +66 -0
  33. package/schemas/node.schema.json +95 -0
  34. package/schemas/plugins-registry.schema.json +99 -0
  35. package/schemas/project-config.schema.json +87 -0
  36. package/schemas/report-base.schema.json +41 -0
  37. package/schemas/scan-result.schema.json +71 -0
  38. package/schemas/summaries/agent.schema.json +46 -0
  39. package/schemas/summaries/command.schema.json +50 -0
  40. package/schemas/summaries/hook.schema.json +43 -0
  41. package/schemas/summaries/note.schema.json +37 -0
  42. package/schemas/summaries/skill.schema.json +57 -0
  43. package/versioning.md +94 -0
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://skill-map.dev/spec/v0/summaries/agent.schema.json",
4
+ "title": "SummaryAgent",
5
+ "description": "Report produced by `agent-summarizer` for a single `agent` node. Extends `report-base.schema.json`. Stability: experimental.",
6
+ "allOf": [
7
+ { "$ref": "../report-base.schema.json" }
8
+ ],
9
+ "type": "object",
10
+ "required": ["whatItDoes"],
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "confidence": true,
14
+ "safety": true,
15
+ "whatItDoes": {
16
+ "type": "string",
17
+ "description": "One-sentence summary of the agent's role. REQUIRED."
18
+ },
19
+ "whenToUse": {
20
+ "type": "string",
21
+ "description": "Situations or triggers where this agent should be selected over alternatives."
22
+ },
23
+ "capabilities": {
24
+ "type": "array",
25
+ "description": "Distinct things the agent can do, as inferred from the body and declared tools.",
26
+ "items": { "type": "string" }
27
+ },
28
+ "toolsObserved": {
29
+ "type": "array",
30
+ "description": "Tool names the summarizer observed referenced in the body. MAY differ from `metadata.tools` / frontmatter.tools; rules can emit drift issues.",
31
+ "items": { "type": "string" }
32
+ },
33
+ "interactionStyle": {
34
+ "type": "string",
35
+ "description": "Free-form: autonomous vs interactive, synchronous vs queued, reporting style."
36
+ },
37
+ "relatedNodes": {
38
+ "type": "array",
39
+ "description": "`node.path` values inferred as related.",
40
+ "items": { "type": "string" }
41
+ },
42
+ "qualityNotes": {
43
+ "type": "string"
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://skill-map.dev/spec/v0/summaries/command.schema.json",
4
+ "title": "SummaryCommand",
5
+ "description": "Report produced by `command-summarizer` for a single `command` node. Extends `report-base.schema.json`. Stability: experimental.",
6
+ "allOf": [
7
+ { "$ref": "../report-base.schema.json" }
8
+ ],
9
+ "type": "object",
10
+ "required": ["whatItDoes"],
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "confidence": true,
14
+ "safety": true,
15
+ "whatItDoes": {
16
+ "type": "string",
17
+ "description": "One-sentence summary of the command's effect. REQUIRED."
18
+ },
19
+ "invocationExample": {
20
+ "type": "string",
21
+ "description": "Canonical example invocation, including arguments. Opaque platform-formatted string."
22
+ },
23
+ "argsObserved": {
24
+ "type": "array",
25
+ "description": "Argument structure as inferred from the body. MAY differ from declared `frontmatter.args`; rules can emit drift issues.",
26
+ "items": {
27
+ "type": "object",
28
+ "required": ["name"],
29
+ "additionalProperties": false,
30
+ "properties": {
31
+ "name": { "type": "string" },
32
+ "type": { "type": "string" },
33
+ "description": { "type": "string" },
34
+ "required": { "type": "boolean" }
35
+ }
36
+ }
37
+ },
38
+ "sideEffects": {
39
+ "type": "array",
40
+ "items": { "type": "string" }
41
+ },
42
+ "relatedNodes": {
43
+ "type": "array",
44
+ "items": { "type": "string" }
45
+ },
46
+ "qualityNotes": {
47
+ "type": "string"
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://skill-map.dev/spec/v0/summaries/hook.schema.json",
4
+ "title": "SummaryHook",
5
+ "description": "Report produced by `hook-summarizer` for a single `hook` node. Extends `report-base.schema.json`. Stability: experimental.",
6
+ "allOf": [
7
+ { "$ref": "../report-base.schema.json" }
8
+ ],
9
+ "type": "object",
10
+ "required": ["whatItDoes"],
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "confidence": true,
14
+ "safety": true,
15
+ "whatItDoes": {
16
+ "type": "string",
17
+ "description": "One-sentence summary of what the hook does when triggered. REQUIRED."
18
+ },
19
+ "triggerInferred": {
20
+ "type": "string",
21
+ "description": "Event or condition the summarizer inferred from the body. MAY differ from declared `frontmatter.event`/`condition`; rules can emit drift issues."
22
+ },
23
+ "sideEffects": {
24
+ "type": "array",
25
+ "items": { "type": "string" }
26
+ },
27
+ "blockingInferred": {
28
+ "type": "boolean",
29
+ "description": "Whether execution appears to block host flow. Compare against declared `frontmatter.blocking`."
30
+ },
31
+ "idempotentInferred": {
32
+ "type": "boolean",
33
+ "description": "Whether the hook appears safe to run multiple times. Compare against declared `frontmatter.idempotent`."
34
+ },
35
+ "relatedNodes": {
36
+ "type": "array",
37
+ "items": { "type": "string" }
38
+ },
39
+ "qualityNotes": {
40
+ "type": "string"
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://skill-map.dev/spec/v0/summaries/note.schema.json",
4
+ "title": "SummaryNote",
5
+ "description": "Report produced by `note-summarizer` for a single `note` node. Extends `report-base.schema.json`. Stability: experimental.",
6
+ "allOf": [
7
+ { "$ref": "../report-base.schema.json" }
8
+ ],
9
+ "type": "object",
10
+ "required": ["whatItCovers"],
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "confidence": true,
14
+ "safety": true,
15
+ "whatItCovers": {
16
+ "type": "string",
17
+ "description": "One-sentence summary of the note's subject matter. REQUIRED. Named distinctly from `whatItDoes` since notes describe, not act."
18
+ },
19
+ "topics": {
20
+ "type": "array",
21
+ "description": "Topical tags inferred from the body. Feed into tag-based discovery and `related` link inference.",
22
+ "items": { "type": "string" }
23
+ },
24
+ "keyFacts": {
25
+ "type": "array",
26
+ "description": "Discrete claims or data points the note asserts. Useful for search and diffing over time.",
27
+ "items": { "type": "string" }
28
+ },
29
+ "relatedNodes": {
30
+ "type": "array",
31
+ "items": { "type": "string" }
32
+ },
33
+ "qualityNotes": {
34
+ "type": "string"
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://skill-map.dev/spec/v0/summaries/skill.schema.json",
4
+ "title": "SummarySkill",
5
+ "description": "Report produced by `skill-summarizer` for a single `skill` node. Extends `report-base.schema.json`. Stability: experimental — field set may tighten as real summarizer output stabilizes.",
6
+ "allOf": [
7
+ { "$ref": "../report-base.schema.json" }
8
+ ],
9
+ "type": "object",
10
+ "required": ["whatItDoes"],
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "confidence": true,
14
+ "safety": true,
15
+ "whatItDoes": {
16
+ "type": "string",
17
+ "description": "One-sentence summary of what the skill accomplishes. REQUIRED."
18
+ },
19
+ "recipe": {
20
+ "type": "array",
21
+ "description": "Ordered steps inferred from the skill body. Optional; empty array when the skill is declarative rather than procedural.",
22
+ "items": {
23
+ "type": "object",
24
+ "required": ["step", "description"],
25
+ "additionalProperties": false,
26
+ "properties": {
27
+ "step": { "type": "integer", "minimum": 1 },
28
+ "description": { "type": "string" }
29
+ }
30
+ }
31
+ },
32
+ "preconditions": {
33
+ "type": "array",
34
+ "description": "Conditions that must be true before the skill can run productively.",
35
+ "items": { "type": "string" }
36
+ },
37
+ "outputs": {
38
+ "type": "array",
39
+ "description": "Artifacts or observable effects the skill produces when it completes successfully.",
40
+ "items": { "type": "string" }
41
+ },
42
+ "sideEffects": {
43
+ "type": "array",
44
+ "description": "State changes outside the immediate output: files touched, processes spawned, network calls.",
45
+ "items": { "type": "string" }
46
+ },
47
+ "relatedNodes": {
48
+ "type": "array",
49
+ "description": "`node.path` values the summarizer inferred as related. Feeds `related` links at medium confidence.",
50
+ "items": { "type": "string" }
51
+ },
52
+ "qualityNotes": {
53
+ "type": "string",
54
+ "description": "Free-form notes: ambiguity in the source, potentially misleading wording, outdated references."
55
+ }
56
+ }
57
+ }
package/versioning.md ADDED
@@ -0,0 +1,94 @@
1
+ # Spec versioning
2
+
3
+ The skill-map **spec** and the skill-map **reference CLI** evolve on independent semver tracks. A spec version and a CLI version are related through a `specCompat` range declared by each implementation and each plugin.
4
+
5
+ ## Two tracks
6
+
7
+ | Track | Example tag | Semver meaning |
8
+ |---|---|---|
9
+ | Spec | `spec-v1.2.0` | Schemas + contracts in `spec/`. Consumed by any implementation. |
10
+ | Reference CLI | `cli-v0.8.3` | The `sm` binary and its built-in extensions in `src/`. |
11
+
12
+ A given CLI release declares the spec range it implements (e.g. `"specCompat": "^1.0.0"`). A plugin declares the spec range it targets. At load time the implementation runs `semver.satisfies(specVersion, plugin.specCompat)`; mismatch → plugin disabled with reason `incompatible-spec`.
13
+
14
+ ## Semver for the spec
15
+
16
+ Patch, minor, major have precise meaning for a specification — different from code.
17
+
18
+ | Bump | Allowed changes | Examples |
19
+ |---|---|---|
20
+ | **Patch** (`1.0.0 → 1.0.1`) | Editorial only. No normative change. | Typo fixes, clarified wording, examples added, non-binding notes. |
21
+ | **Minor** (`1.0.0 → 1.1.0`) | Backward-compatible additions. Existing conforming implementations remain conforming. | New optional field, new optional schema, new optional CLI flag, new extension kind capability that is opt-in, new conformance case that tests a new optional feature. |
22
+ | **Major** (`1.0.0 → 2.0.0`) | Any change that can break a conforming implementation. | Remove a field, rename a field, change a field's type, tighten an enum, make an optional field required, change an exit code's meaning, change an event's payload shape, change a verb's default behavior. |
23
+
24
+ Rule of thumb: if a strict v1 implementation could fail a v1.X conformance run, the change is major.
25
+
26
+ ## What counts as normative
27
+
28
+ All of the following are normative and governed by this policy:
29
+
30
+ - Every JSON Schema in `schemas/` (fields, types, required, enums, defaults, `additionalProperties`).
31
+ - Every MUST / SHOULD / MAY statement in prose documents (`architecture.md`, `cli-contract.md`, `job-events.md`, `prompt-preamble.md`, `db-schema.md`, `plugin-kv-api.md`, `dispatch-lifecycle.md`).
32
+ - Exit codes, verb names, required flags, canonical error messages marked "normative".
33
+ - Conformance fixtures and cases — removing or tightening a case is major.
34
+
35
+ The following are **non-normative** and can change at any time without a version bump:
36
+
37
+ - Editorial prose, examples, diagrams.
38
+ - README layout, cross-link structure.
39
+ - Filenames inside `../src/` (reference impl) — never referenced from spec normatively.
40
+ - Internal commentary inside `../ROADMAP.md` and `../CLAUDE.md`.
41
+
42
+ ## Stability tags
43
+
44
+ Fields and features inside the spec carry a stability tag. Tag drives what the version policy allows.
45
+
46
+ | Tag | Meaning | Policy |
47
+ |---|---|---|
48
+ | `experimental` | Under design. May change without warning. | Minor and major bumps can change or remove. Plugins using an experimental field must tolerate breakage. |
49
+ | `stable` | Default. Governed by the semver rules above. | Changes follow the table at the top of this doc. |
50
+ | `deprecated` | Being removed in a future major. | Stays functional until the next major. `deprecated` notice must include the target removal version and a migration hint. |
51
+
52
+ Tags live inline in schema `description` fields and in prose via a leading `**Stability: experimental**` line.
53
+
54
+ ## Deprecation window
55
+
56
+ - `stable` → `deprecated` requires a minor bump.
57
+ - `deprecated` → removed requires a major bump.
58
+ - Between the two, at least three minor releases must ship with the field marked `deprecated`. This gives plugin authors a release window to migrate.
59
+ - Rationale for the deprecation and the replacement field/flag must live in `CHANGELOG.md`.
60
+
61
+ ## Pre-1.0
62
+
63
+ While the spec is `0.Y.Z`:
64
+
65
+ - Minor bumps may contain breaking changes (documented as such in `CHANGELOG.md`).
66
+ - Conformance is advisory — failing a conformance case is a bug report, not a spec violation.
67
+ - `specCompat` in plugins should pin a minor range (`"^0.3.0"` means `>=0.3.0 <0.4.0`), not a major range.
68
+
69
+ The first stable commitment is `spec-v1.0.0`. That tag ships with CUT 3 / `cli-v1.0.0`.
70
+
71
+ ## Independence in practice
72
+
73
+ - **Spec `1.0.0` + CLI `0.1.0`** — spec is stabilized before the CLI ships its v1. Normal case during early life of the project.
74
+ - **Spec `1.2.0` + CLI `0.8.0`** — spec gained an optional feature; CLI hasn't implemented it yet. Fine. Plugins needing that feature must declare `"specCompat": "^1.2.0"`.
75
+ - **Spec `2.0.0` + CLI `1.4.0`** — CLI still targets spec v1. Operator must upgrade CLI before installing v2-targeting plugins.
76
+
77
+ ## Change process
78
+
79
+ 1. PR proposes a spec change. Include rationale and classification (patch/minor/major).
80
+ 2. If major, PR includes a migration note draft for `CHANGELOG.md`.
81
+ 3. If the change affects reference-impl behavior, a companion PR in `src/` lands the implementation behind the bumped `specCompat`.
82
+ 4. Merge order: spec change first, implementation second. An implementation MUST NOT ship a feature that is not yet in the spec (see `CLAUDE.md`: "Every feature: update spec/ first, then src/").
83
+ 5. Tag spec release (`spec-vX.Y.Z`) independent from any CLI tag.
84
+
85
+ ## Canonical URLs
86
+
87
+ Once the domain is live, schemas resolve at stable URLs:
88
+
89
+ ```
90
+ https://skill-map.dev/spec/v1/node.schema.json
91
+ https://skill-map.dev/spec/v1.2/node.schema.json
92
+ ```
93
+
94
+ Major version is always present in the path. Implementations MUST NOT rely on `latest`.