specplane 0.1.0a1__py3-none-any.whl

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 (106) hide show
  1. _specplane_kit/.agents/skills/specplane-author/SKILL.md +34 -0
  2. _specplane_kit/.agents/skills/specplane-bootstrap/SKILL.md +24 -0
  3. _specplane_kit/.agents/skills/specplane-explain/SKILL.md +33 -0
  4. _specplane_kit/.agents/skills/specplane-flows/SKILL.md +56 -0
  5. _specplane_kit/.agents/skills/specplane-implement/SKILL.md +99 -0
  6. _specplane_kit/.agents/skills/specplane-infer/SKILL.md +120 -0
  7. _specplane_kit/.agents/skills/specplane-validate/SKILL.md +36 -0
  8. _specplane_kit/.cursor/rules/specplane-core.mdc +22 -0
  9. _specplane_kit/.cursor/rules/specplane-yaml.mdc +17 -0
  10. _specplane_kit/.cursor/skills/specplane-author/SKILL.md +34 -0
  11. _specplane_kit/.cursor/skills/specplane-bootstrap/SKILL.md +24 -0
  12. _specplane_kit/.cursor/skills/specplane-explain/SKILL.md +33 -0
  13. _specplane_kit/.cursor/skills/specplane-flows/SKILL.md +56 -0
  14. _specplane_kit/.cursor/skills/specplane-implement/SKILL.md +99 -0
  15. _specplane_kit/.cursor/skills/specplane-infer/SKILL.md +120 -0
  16. _specplane_kit/.cursor/skills/specplane-validate/SKILL.md +36 -0
  17. _specplane_kit/__init__.py +1 -0
  18. _specplane_kit/specplane/README.md +55 -0
  19. _specplane_kit/specplane/core_prompt/README_START_HERE.md +13 -0
  20. _specplane_kit/specplane/core_prompt/README_v6.1.0.md +90 -0
  21. _specplane_kit/specplane/core_prompt/README_v9.1.0.md +133 -0
  22. _specplane_kit/specplane/core_prompt/applicable/01-philosophy-and-5c.md +89 -0
  23. _specplane_kit/specplane/core_prompt/applicable/02-file-layout.md +164 -0
  24. _specplane_kit/specplane/core_prompt/applicable/03-shared-meta.md +72 -0
  25. _specplane_kit/specplane/core_prompt/applicable/04-capability.md +159 -0
  26. _specplane_kit/specplane/core_prompt/applicable/05-foundation.md +46 -0
  27. _specplane_kit/specplane/core_prompt/applicable/06-system-container-component.md +285 -0
  28. _specplane_kit/specplane/core_prompt/applicable/07-ai-native.md +165 -0
  29. _specplane_kit/specplane/core_prompt/applicable/08-validation-rules.md +321 -0
  30. _specplane_kit/specplane/core_prompt/applicable/09-diagrams-and-refs.md +60 -0
  31. _specplane_kit/specplane/core_prompt/applicable/10-worked-examples.md +283 -0
  32. _specplane_kit/specplane/core_prompt/applicable/11-guidance-and-checklists.md +194 -0
  33. _specplane_kit/specplane/core_prompt/applicable/README.md +57 -0
  34. _specplane_kit/specplane/core_prompt/archived/README.md +19 -0
  35. _specplane_kit/specplane/core_prompt/archived/specplane_schema_prompt_v5.5.1_balanced.md +1137 -0
  36. _specplane_kit/specplane/core_prompt/archived/specplane_schema_prompt_v5.5.5_balanced.md +1347 -0
  37. _specplane_kit/specplane/core_prompt/archived/specplane_schema_prompt_v6.0.0_progressive_disclosure.md +1047 -0
  38. _specplane_kit/specplane/core_prompt/archived/specplane_schema_prompt_v7_detailed.md +1609 -0
  39. _specplane_kit/specplane/core_prompt/archived/specplane_schema_prompt_v8.0.0_progressive_disclosure.md +1301 -0
  40. _specplane_kit/specplane/core_prompt/archived/specplane_schema_prompt_v9.0.0_progressive_disclosure.md +1584 -0
  41. _specplane_kit/specplane/core_prompt/specplane_schema_prompt_v6.1.0_progressive_disclosure.md +1106 -0
  42. _specplane_kit/specplane/core_prompt/specplane_schema_prompt_v9.1.0.md +1715 -0
  43. _specplane_kit/specplane/foundations/foundation.accessibility.yaml +51 -0
  44. _specplane_kit/specplane/foundations/foundation.ai_guidelines.yaml +50 -0
  45. _specplane_kit/specplane/foundations/foundation.analytics_conventions.yaml +151 -0
  46. _specplane_kit/specplane/foundations/foundation.api_conventions.yaml +62 -0
  47. _specplane_kit/specplane/foundations/foundation.component_library.yaml +55 -0
  48. _specplane_kit/specplane/foundations/foundation.data_model_conventions.yaml +51 -0
  49. _specplane_kit/specplane/foundations/foundation.design_system.yaml +58 -0
  50. _specplane_kit/specplane/foundations/foundation.error_handling.yaml +56 -0
  51. _specplane_kit/specplane/foundations/foundation.eval_standards.yaml +57 -0
  52. _specplane_kit/specplane/foundations/foundation.event_schema.yaml +48 -0
  53. _specplane_kit/specplane/foundations/foundation.iconography.yaml +44 -0
  54. _specplane_kit/specplane/foundations/foundation.internationalization.yaml +52 -0
  55. _specplane_kit/specplane/foundations/foundation.logging_conventions.yaml +60 -0
  56. _specplane_kit/specplane/foundations/foundation.model_governance.yaml +62 -0
  57. _specplane_kit/specplane/foundations/foundation.motion.yaml +48 -0
  58. _specplane_kit/specplane/foundations/foundation.observability_standards.yaml +62 -0
  59. _specplane_kit/specplane/foundations/foundation.performance_budget.yaml +47 -0
  60. _specplane_kit/specplane/foundations/foundation.privacy_consent.yaml +57 -0
  61. _specplane_kit/specplane/foundations/foundation.security_baseline.yaml +55 -0
  62. _specplane_kit/specplane/supporting_prompts/spec_validation_prompt_examples.md +7 -0
  63. _specplane_kit/specplane/supporting_prompts/when_making_changes.md +4 -0
  64. _specplane_kit/specplane/supporting_prompts/widget_spec_examples.md +33 -0
  65. _specplane_kit/tools/specplane/README.md +100 -0
  66. _specplane_kit/tools/specplane/ci_gate.py +127 -0
  67. _specplane_kit/tools/specplane/cli.py +576 -0
  68. _specplane_kit/tools/specplane/drift.py +96 -0
  69. _specplane_kit/tools/specplane/impact.py +1138 -0
  70. _specplane_kit/tools/specplane/initkit.py +421 -0
  71. _specplane_kit/tools/specplane/kernel.py +1867 -0
  72. _specplane_kit/tools/specplane/mcp_stdio.py +258 -0
  73. _specplane_kit/tools/specplane/requirements.txt +1 -0
  74. _specplane_kit/tools/specplane/specplane.config.json.example +6 -0
  75. _specplane_kit/tools/specplane/telemetry.py +447 -0
  76. _specplane_kit/tools/specplane/validate.py +755 -0
  77. _specplane_kit/tools/specplane/view.py +633 -0
  78. _specplane_kit/tools/specplane/viewer/app.css +870 -0
  79. _specplane_kit/tools/specplane/viewer/app.js +2400 -0
  80. _specplane_kit/tools/specplane/viewer/fonts/OFL-jetbrains-mono.txt +93 -0
  81. _specplane_kit/tools/specplane/viewer/fonts/OFL-schibsted-grotesk.txt +93 -0
  82. _specplane_kit/tools/specplane/viewer/fonts/jetbrains-mono-400.woff2 +0 -0
  83. _specplane_kit/tools/specplane/viewer/fonts/jetbrains-mono-500.woff2 +0 -0
  84. _specplane_kit/tools/specplane/viewer/fonts/jetbrains-mono-600.woff2 +0 -0
  85. _specplane_kit/tools/specplane/viewer/fonts/schibsted-grotesk-400.woff2 +0 -0
  86. _specplane_kit/tools/specplane/viewer/fonts/schibsted-grotesk-500.woff2 +0 -0
  87. _specplane_kit/tools/specplane/viewer/fonts/schibsted-grotesk-600.woff2 +0 -0
  88. _specplane_kit/tools/specplane/viewer/index.html +15 -0
  89. _specplane_kit/tools/specplane/viewer/logo.png +0 -0
  90. _specplane_kit/tools/specplane/viewer/vendor/MERMAID_VERSION +1 -0
  91. _specplane_kit/tools/specplane/viewer/vendor/mermaid.min.js +2029 -0
  92. cli.py +576 -0
  93. drift.py +96 -0
  94. impact.py +1138 -0
  95. initkit.py +421 -0
  96. kernel.py +1867 -0
  97. mcp_stdio.py +258 -0
  98. specplane-0.1.0a1.dist-info/METADATA +31 -0
  99. specplane-0.1.0a1.dist-info/RECORD +106 -0
  100. specplane-0.1.0a1.dist-info/WHEEL +5 -0
  101. specplane-0.1.0a1.dist-info/entry_points.txt +2 -0
  102. specplane-0.1.0a1.dist-info/licenses/LICENSE +201 -0
  103. specplane-0.1.0a1.dist-info/top_level.txt +10 -0
  104. telemetry.py +447 -0
  105. validate.py +755 -0
  106. view.py +633 -0
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: specplane-author
3
+ description: Create or expand SpecPlane YAML specs (capability, foundation, system, container, component, AI-native types). Use when the user explicitly asks to write, add, or update a specification file. If they described a product change in natural language, use specplane-implement instead.
4
+ ---
5
+
6
+ # SpecPlane Author
7
+
8
+ ## Load
9
+
10
+ 1. Read `specplane/core_prompt/applicable/README.md`.
11
+ 2. Read `03-shared-meta.md`.
12
+ 3. Read **only** the type section:
13
+ - capability → `04-capability.md`
14
+ - foundation → `05-foundation.md` and copy shape from `specplane/foundations/` if starting from boilerplate
15
+ - system / container / component → `06-system-container-component.md`
16
+ - agent / tool / workflow / evaluator / tool_registry / state_store → `06` then `07-ai-native.md`
17
+ 4. Skim the matching example in `10-worked-examples.md` if the type is capability or component.
18
+ 5. If the user wants journey / lifecycle / information-flow richness or “what’s missing on this flow,” also load `specplane-flows`. String `flows` remain valid; mappings are optional.
19
+
20
+ Do not load `specplane_schema_prompt_v9.1.0.md` unless a field is missing from those sections.
21
+
22
+ ## Procedure
23
+
24
+ 1. If this is a **behavior change to something that already exists**, stop and follow `specplane-implement` (retrieve, classify, change folder). Do not silently patch live YAML.
25
+ 2. If `tools/specplane/cli.py` exists and you have an id, `retrieve` it first. Do not slurp `specs/`.
26
+ 3. Identify level and (for components) `meta.type` / `meta.domain`.
27
+ 4. **Where to write:**
28
+ - Brand-new capability with no live id: Phase 1 live file is OK (`responsibilities`, `flows`, `business_value`, `constraints`).
29
+ - In-flight work or an open change: put ADDED/MODIFIED YAML in `specs/changes/<id>/`, not as a changelog novel on the live file.
30
+ 5. Set `meta.id` to the filename without extension. Use snake_case ids.
31
+ 6. If adding `implements`, `uses`, or internal dependencies, update the other side of the link in the same change.
32
+ 7. Add a `changelog` row and bump `meta.version` only on **live** 5C files. Change-folder YAML (`proposal` / `delta` / `success`) is not 5C meta.
33
+ 8. If `tools/specplane/cli.py` exists, run `validate` in this session. Do not add git hooks or CI.
34
+ 9. Summarize what was authored and what is still Phase-incomplete. If validate prints a line that starts with `SpecPlane ·`, quote that line in the reply the user sees, unchanged. Do not invent a SpecPlane receipt.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: specplane-bootstrap
3
+ description: Initialize a SpecPlane specs/ tree (capabilities, foundations, system, containers, components, changes). Use when the user asks to set up SpecPlane, scaffold specs, or start a new spec workspace.
4
+ ---
5
+
6
+ # SpecPlane Bootstrap
7
+
8
+ ## Load
9
+
10
+ Read `specplane/core_prompt/applicable/02-file-layout.md` and `03-shared-meta.md`. Do not load the full master prompt.
11
+
12
+ ## Procedure
13
+
14
+ 1. Create if missing (`cli.py init` may already have empty dirs):
15
+ - `specs/capabilities/`
16
+ - `specs/foundations/`
17
+ - `specs/containers/`
18
+ - `specs/components/`
19
+ - `specs/changes/` (in-flight write path; keep empty until a real change)
20
+ 2. Add one `specs/system.<name>.yaml` if none exists.
21
+ 3. If the user named capabilities or foundations, create those files; otherwise create one example capability and copy needed files from `specplane/foundations/`.
22
+ 4. Every **5C** file: `meta.id` equals filename without extension, semver `version`, `introduced_in`, at least one `changelog` entry. Do not invent fake 5C meta for files under `specs/changes/`.
23
+ 5. If `tools/specplane/cli.py` exists, run `validate` in this session; else `validate.py`. Do not add git hooks or CI.
24
+ 6. Report the tree. If validate prints a line that starts with `SpecPlane ·`, quote that line in the reply the user sees, unchanged. Do not invent a SpecPlane receipt. Next step is usually a Phase 1 capability. Daily product requests after that use `specplane-implement` (see [`docs/golden-journey.md`](../../../docs/golden-journey.md)), not more scaffolding.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: specplane-explain
3
+ description: Explain how something works from the specification, the open change, the implementation, and the evidence, kept apart. Use when the user asks how something works, why the code does this, or what the spec says versus the change. Do not use to author a spec or to implement a product change.
4
+ ---
5
+
6
+ # SpecPlane Explain
7
+
8
+ Answer how something works. Keep four sources apart. Do not merge them into one story.
9
+
10
+ 1. Run `context` on the spec id or the file the user named.
11
+
12
+ ```bash
13
+ SPECPLANE_CALLER=cursor_skill python3 tools/specplane/cli.py context <target> --spec-root specs
14
+ ```
15
+
16
+ Add `--change <slug>` when one open change is the task. Prefer `specplane` if it is on PATH.
17
+
18
+ 2. If the command says the file is unmapped, stop. Do not invent a component. Do not parse the file into a spec. Quote the `SpecPlane ·` line.
19
+
20
+ 3. Read implementation files only when `context` names a `realization.paths` entry for that component. Do not scan the repository for a match the command did not name.
21
+
22
+ 4. Answer with four headings, in this order:
23
+
24
+ - **Specification** — the live text `context` printed (purpose, responsibilities, constraints).
25
+ - **Change** — the open change summaries. That is the implementation context. Canonical synchronization is pending until accept. If there is no open change, say so.
26
+ - **Implementation** — what the named files do. If none are declared, say none are declared.
27
+ - **Evidence** — each sensor's evidence and status. `UNVERIFIED` means no bound check passed. `VERIFIED` means a bound command passed. It does not mean the implementation satisfies the spec. `FAILED` means a bound command failed.
28
+
29
+ If the four disagree, say that in three sentences, one per disagreement. Do not pick a winner.
30
+
31
+ If a command prints a line that starts with `SpecPlane ·`, quote it unchanged. Do not invent a receipt. Do not add `--by` flags. Do not assign owners. Do not write `realized_by`. Components the graph does not name stay unmarked.
32
+
33
+ A readiness warning means implementation is underway and no implementation relationships are declared. Phase 1 stays valid. Do not add `realized_by` to clear the warning.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: specplane-flows
3
+ description: >-
4
+ Enhance SpecPlane capability flows with optional journey, object-lifecycle,
5
+ and information-flow richness. Use when the user asks to review, complete,
6
+ or improve user journeys, UX/info flows, object lifecycles, malloc-use-free
7
+ completeness, or what is missing on a flow. Do not invent unanswered behavior.
8
+ ---
9
+
10
+ # SpecPlane Flows
11
+
12
+ Review and enrich `capability.flows`. Do not add a sixth C. Do not require every file to have journey + lifecycle + information.
13
+
14
+ ## Load
15
+
16
+ 1. `specplane/core_prompt/applicable/README.md`
17
+ 2. `specplane/core_prompt/applicable/04-capability.md` (flow mapping + `open_questions`)
18
+ 3. If a component realization is in scope: `06-system-container-component.md` (`planning.user_flows` stays a sliver)
19
+
20
+ Do not load the full master prompt.
21
+
22
+ ## PRE
23
+
24
+ If `tools/specplane/cli.py` exists and you have a capability id:
25
+
26
+ ```bash
27
+ SPECPLANE_CALLER=cursor_skill python3 tools/specplane/cli.py retrieve <id> --spec-root specs
28
+ ```
29
+
30
+ Do not slurp `specs/`. Open only files the CLI named.
31
+
32
+ If a command prints a line that starts with `SpecPlane ·`, quote that line in the reply the user sees, unchanged. If it does not, do not invent a SpecPlane receipt. Do not say SpecPlane caught a bug or revised the code unless that printed line says so.
33
+
34
+ ## What to do
35
+
36
+ 1. **Keep the string index.** Existing `flows: ["Sign-up", "Login"]` stays valid. Promote a string to a mapping only when this file needs the richness.
37
+ 2. **Ask which kinds this file needs** (not all three by default):
38
+ - **journey** — where the person starts, paths, how it ends
39
+ - **lifecycle** — `malloc → use → free` for objects this flow creates
40
+ - **information** — collected, moved, retained, destroyed
41
+ 3. **Walk the implied envelope.** For each object: create → use → modify → share → archive? → restore? → delete? → what remains? For each journey: entry, stages, success, abandonment, exceptions, recovery.
42
+ 4. **Do not invent answers.** If terminate/recover/ownership/retention is unspecified, write an `open_questions` item (`question`, optional `id` / `raised_from` / `status: open`). Capability-level `open_questions` or component `validation.open_questions` — same slot family; do not add a second key.
43
+ 5. **Stories are a lens.** One or two `stories:` rows as evidence is fine. Do not generate a Jira-sized `user_stories` list.
44
+ 6. **Cross-capability journeys are composed.** Do not copy a Discover→Cancel saga into every capability. Record the piece this file owns; note other capability ids in `open_questions` or `raised_from` if a hop is missing.
45
+ 7. **External guidance is optional.** Web/UX research may be labeled `External guidance` and become questions or suggested spec edits. It is not law. Do not stuff best-practice essays into YAML.
46
+ 8. **Components realize pieces.** You may set `planning.user_flows.flow_ref`. Do not copy lifecycle tables onto the component.
47
+
48
+ ## Write rules
49
+
50
+ - In-flight work goes in `specs/changes/<slug>/` when this is an evolve of a live capability. New Phase 1 capabilities may take mappings on the live file.
51
+ - Prefer inference → questions → (after a human answers) spec mutation. Resolved questions graduate into the mapping (`lifecycle`, `recovery`, …) and get `status: resolved`.
52
+ - After edits: `python3 tools/specplane/cli.py validate --spec-root specs` when the CLI exists.
53
+
54
+ ## Done when
55
+
56
+ The file is more digestible (named pieces + only the kinds it needs), gaps are **questions** not invented requirements, and a string-only neighbor file was left string-only.
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: specplane-implement
3
+ description: Run the SpecPlane change ritual when the user describes a product change, bug, experiment, feature, install/docs that state a promise, or asks to implement. PRE: retrieve when a promise might move (if unsure, retrieve). POST: check_sync --change, then run --change. Typos/renames skip retrieve. Do not use for bootstrap or YAML-only authoring.
4
+ ---
5
+
6
+ # SpecPlane Implement
7
+
8
+ The user talks about the product. You run SpecPlane. They should not type `retrieve` or `blast`. Intended chat shape: [`docs/golden-journey.md`](../../../docs/golden-journey.md).
9
+
10
+ Do not slurp `specs/`. Call the kernel CLI. No SpecPlane API key. Do not add git hooks or CI.
11
+
12
+ ## Hard gates (not optional)
13
+
14
+ Developers paste a prompt and expect codegen. You still run SpecPlane **when a product promise might move**. Do not skip because it looks like docs, packaging, README, “just implement,” or “no new capabilities.”
15
+
16
+ **PRE — if the request could reasonably move a promise** (behavior, contracts, events, security, rollout, how the product is obtained: init/install/README CLI claims):
17
+
18
+ 1. Guess the capability (or component) id. Call `retrieve`. If none exists, say so.
19
+ 2. Classify **only after** that retrieve.
20
+ 3. If not trivial: open `specs/changes/<id>/`, `blast`, ask at most one unresolved consequential question, **wait**, then implement.
21
+
22
+ **PRE — skip retrieve** only when it cannot reasonably move a promise: typo, 4px, rename helper, same-behavior refactor. Say “no spec impact.” If unsure, retrieve — do not guess trivial.
23
+
24
+ **POST — after a non-trivial implement, before claiming done:**
25
+
26
+ 1. `validate`.
27
+ 2. `check_sync --change <slug> --changed-ids` with every id you retrieved, blasted, or whose realization files you edited. `<slug>` is this request’s `specs/changes/<slug>/` folder. The default changed-set is spec YAML in git, plus component ids whose declared `implementation.realization.paths` match a changed file. `--changed-ids` is an explicit override. An empty default is not a pass if you touched app code or `tools/specplane/`. If a map exists, run `reconcile` or report missing and unmapped paths. Maps are optional: do not require one to implement, and do not copy inferred cites into `realization.paths`. A coverage pass is declared coverage, not behavioral agreement.
28
+ 3. `run --change <slug>`. This invokes binds already on that change (`run.argv` or `run.unittest` / `test:`). It does not create tests, exec English `must:` lines, or certify that the implementation satisfies the spec. No bind → `not_run` (exit 0 when nothing failed or errored).
29
+ 4. Do not silently pick spec vs code. Do not edit live 5C YAML until the user accepts (promote).
30
+
31
+ The kernel does not watch the chat. If you do not call retrieve/check_sync, SpecPlane is silent. Clarifying questions are the coding agent following this skill, not a SpecPlane daemon.
32
+
33
+ If `tools/specplane/cli.py` is missing, say so and stop implementing product behavior.
34
+
35
+ ## Load
36
+
37
+ Read `specplane/core_prompt/applicable/README.md`. When writing code, load `06-system-container-component.md` for contracts. Load `08-validation-rules.md` only if live links/versions will change **at promote**.
38
+
39
+ Do not load the full master prompt.
40
+
41
+ ## Kernel
42
+
43
+ Prefer `specplane` if it is on PATH, else `python3 tools/specplane/cli.py`.
44
+
45
+ ```bash
46
+ python3 tools/specplane/cli.py retrieve <id> --spec-root specs
47
+ python3 tools/specplane/cli.py blast <id> --spec-root specs
48
+ python3 tools/specplane/cli.py impact <id> --spec-root specs
49
+ python3 tools/specplane/cli.py validate --spec-root specs
50
+ python3 tools/specplane/cli.py check_sync --spec-root specs --change <slug> --changed-ids id1,id2
51
+ python3 tools/specplane/cli.py reconcile --spec-root specs
52
+ python3 tools/specplane/cli.py run --spec-root specs --change <slug>
53
+ ```
54
+
55
+ When you run the CLI, set `SPECPLANE_CALLER=cursor_skill`. That is the only signal that a skill invoked it. A local event is recorded unless the human has run `usage disable`. Nothing is uploaded. Do not put a path, a spec id, or a secret in `SPECPLANE_CALLER`, `SPECPLANE_RUN_ID`, or `SPECPLANE_SESSION_ID`.
56
+
57
+ If a command prints a line that starts with `SpecPlane ·`, quote that line in the reply the user sees, unchanged. If it does not, do not invent a SpecPlane receipt. Do not say SpecPlane caught a bug or revised the code unless that printed line says so.
58
+
59
+ During an open change, the implementation context is that change. Live text and the change stay labeled. Canonical synchronization stays pending until the user accepts. For the file you are editing, run `context <path>`. If it says the file is unmapped, leave it unmapped. Do not invent a component.
60
+
61
+ Do not invent a graph by reading the whole tree. You may open files the CLI already named.
62
+
63
+ ## Procedure
64
+
65
+ 1. **PRE.** If this could move a promise, guess the capability id and `retrieve` it (or say none exists). Paraphrase as a short human projection. If it cannot (typo / 4px / rename / same-behavior refactor), say “no spec impact” and do it — no retrieve. If unsure, retrieve.
66
+
67
+ 2. **Propose a class** (do not quiz the user on taxonomy):
68
+ - **trivial** — cannot reasonably move a promise (typo, 4px, rename helper, behavior-free refactor). Just do it. State “no spec impact.” Stop here.
69
+ - **fix** — live spec already promises this; it is broken or incomplete.
70
+ - **evolve** — the promise itself changes (including how the product is obtained: install, init, “what the README says the CLI does”).
71
+ - **learn** — experiment; may not become live law.
72
+
73
+ Ceremony follows **semantic consequence**, not diff size. One-line `danger` token change can be evolve. A large internal refactor can be trivial.
74
+
75
+ If the class is obvious, state it and continue. Ask “proceed?” only when it could reasonably be another class. **Wait** for that answer before writing code.
76
+
77
+ 3. **Open a change** unless trivial. Create `specs/changes/<slug>/`:
78
+ - `proposal.yaml` — `kind`, `promise_ids`, `why`
79
+ - `delta.yaml` — ADDED / MODIFIED / REMOVED
80
+ - `success.yaml` — named sensors (`must:` lines are enough)
81
+ - `decision.md` — only if a human must choose
82
+
83
+ Do **not** edit live `capability.*.yaml` / `foundation.*.yaml` until promote. New capabilities with no live id: Phase 1 live file **or** ADDED in this folder; prefer a change folder if this request is an evolve of something that exists.
84
+
85
+ 4. **Blast** the promise id and components you will touch. Tell the user “likely affected,” not hop-rule homework. Foundations are terminal.
86
+
87
+ 5. **Interrupt sparingly.** Ask only unresolved consequential questions (prefer one). Record the answer in `decision.md`. **Wait** before implementing. Isolated UI nits are not interruptions; a global foundation/token used by many ids is.
88
+
89
+ 6. **Implement** from the projection: live promise + delta + blast + decisions. Match capabilities, errors, events, and `success.yaml`. Keep bidirectional links if you touch `implements` / `uses` (on files in the change, or at promote).
90
+
91
+ 7. **POST reconcile.** Run `validate`, `check_sync --change <slug> --changed-ids` for ids you touched (including realization files), then `run --change <slug>`. When a component already declares `realization.paths`, also run `reconcile` or report missing / unmapped_changed. Maps are optional. Do not invent one by copying inferred cites. Coverage pass is declared coverage, not behavioral agreement. A `run` pass means bound checks exited 0, not that the implementation satisfies the spec. Optionally `python3 tools/specplane/drift.py --scope changed` as a coarse reminder; `reconcile` is the declared-path check. Do not pick spec vs code when they disagree — report it.
92
+
93
+ 8. **Promote only after the user accepts.** Then: apply the delta to live YAML, bump `meta.version` + changelog on those live files, move the folder to `specs/changes/_archive/<slug>/`. Retrieve should then show one live graph.
94
+
95
+ If this repo has no `specs/`, say so and point at bootstrap. Do not copy SpecPlane’s own `specs/` into another app.
96
+
97
+ ## Impact perspectives
98
+
99
+ `impact <id>` is one affected subgraph plus projections (system, product, quality, governance, ownership). `blast` stays the bucket tree that `check_sync` uses. Do not invent stakeholder views (`qa_view`, `security_view`, and the like) or ask a model to re-decide blast. Agents may propose missing spec relationships as inferred; they are not the impact engine. Absence of a governed concern or owner is "not represented", never "no security impact" or "no QA required". See [`docs/impact-perspectives.md`](../../../docs/impact-perspectives.md).
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: specplane-infer
3
+ description: Map an existing repository into a handful of Phase 1 inferred capability specs. Use when the user says map this, brownfield, what's already here, or infer specs from this repo. Not for an empty tree (use specplane-bootstrap). Never write live specs and never scan source from a CLI.
4
+ ---
5
+
6
+ # SpecPlane Infer
7
+
8
+ Brownfield on-ramp. One named root. One shot. A handful of capabilities. Then stop.
9
+
10
+ The coding agent walks the tree. SpecPlane does not. There is no `infer` CLI and no MCP infer. `inferred` is not live.
11
+
12
+ ## When
13
+
14
+ - The user has an existing repo and asks to map it, brownfield it, or say what is already here.
15
+ - They may name a path, a service, or "the API". That name is the root. Use the workspace root only when they did not name a smaller one.
16
+
17
+ ## When not
18
+
19
+ - Empty `specs/` and they want to start a product: `specplane-bootstrap`. Greenfield init does not infer.
20
+ - They described a product change: `specplane-implement`.
21
+ - They asked to author one spec they already understand: `specplane-author`.
22
+ - Drift, `realization.paths`, or "does this code match the spec": that is not this skill.
23
+
24
+ ## Load
25
+
26
+ 1. `specplane/core_prompt/applicable/README.md`
27
+ 2. `03-shared-meta.md`
28
+ 3. `04-capability.md`
29
+
30
+ Do not load the full v9.1.0 reference. Do not invent containers, components, systems, or evaluators.
31
+
32
+ ## Walk
33
+
34
+ You already have the tree, the languages, and the configs. Read the README, manifests, and the directories under the named root. Different languages are your problem. Do not ask the kernel to parse `.py`, `.go`, or `.ts`.
35
+
36
+ Write at most **7** capabilities. If the root is larger, say what you left out and stop. Do not boil a monorepo.
37
+
38
+ ## Write
39
+
40
+ Phase 1 capability files only, under `specs/capabilities/`. Filename equals `meta.id`.
41
+
42
+ Five questions, in the usual fields:
43
+
44
+ | Question | Field |
45
+ |---|---|
46
+ | Purpose | `meta.purpose` |
47
+ | Contract | `responsibilities` |
48
+ | Failure | `constraints` (what must not happen). A flow name if the failure is a path. Do not invent a `failure:` key. |
49
+ | Constraint | `constraints` |
50
+ | Success | `business_value.user_outcome` |
51
+
52
+ Also required so the file validates: `flows` as string names when you know them, `business_value.objective`, `revenue_dependency`, `strategic_priority`, `constraints.data_classification`, `meta` (`id`, `level: capability`, `version`, `introduced_in`, `status`, `review_state`, `last_updated`), and a `changelog` row.
53
+
54
+ Every file:
55
+
56
+ - `tags` includes `inferred`.
57
+ - `refs` cite repo-relative paths that show why the guess exists. Cites are evidence of the guess. They are not `realization.paths`.
58
+
59
+ ```yaml
60
+ meta:
61
+ id: "capability.billing_checkout"
62
+ purpose: "Customer completes paid checkout"
63
+ level: "capability"
64
+ owner: ""
65
+ tags: ["inferred"]
66
+ last_updated: "YYYY-MM-DD"
67
+ status: "planned"
68
+ version: "1.0.0"
69
+ review_state: "unreviewed"
70
+ introduced_in: "1.0.0"
71
+ changelog:
72
+ - date: "YYYY-MM-DD"
73
+ author: "infer"
74
+ summary: "Inferred Phase 1 from the named root"
75
+ breaking: false
76
+ responsibilities:
77
+ - "Accept payment and record the order"
78
+ flows:
79
+ - "Checkout"
80
+ business_value:
81
+ user_outcome: "Customer completes paid checkout"
82
+ objective: "Take payment"
83
+ revenue_dependency: "high"
84
+ strategic_priority: "core"
85
+ constraints:
86
+ security: []
87
+ legal: []
88
+ ux:
89
+ - "Do not confirm the order when payment fails"
90
+ data_classification: "confidential"
91
+ refs:
92
+ - id: "cite_checkout"
93
+ type: "other"
94
+ path: "src/billing/checkout.py"
95
+ title: "Why this guess"
96
+ ```
97
+
98
+ Do not set `realized_by`. Do not omit `inferred`. Do not overwrite a file that is already live (no `inferred` tag).
99
+
100
+ ## Stop
101
+
102
+ After the handful, stop. Tell the human the ids and the cites. Ask which ids to promote. Wait.
103
+
104
+ ## Promote
105
+
106
+ Only after the human names ids:
107
+
108
+ ```bash
109
+ SPECPLANE_CALLER=cursor_skill python3 tools/specplane/cli.py promote --ids id1,id2 --spec-root specs
110
+ ```
111
+
112
+ That command drops `inferred` on those files and adds a changelog row. It does not promote unnamed ids. Do not drop the tag yourself.
113
+
114
+ `retrieve` prints `inferred (not live)` until then. `list_gaps` lists `inferred_unpromoted` and stays advisory.
115
+
116
+ If a command prints a line that starts with `SpecPlane ·`, quote that line in the reply the user sees, unchanged. If it does not, do not invent a SpecPlane receipt. Do not say SpecPlane caught a bug or revised the code unless that printed line says so.
117
+
118
+ ## Again later
119
+
120
+ A later map is a new change folder under `specplane-implement` when a live promise would move. Do not re-infer on a schedule. Do not stamp live to match code.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: specplane-validate
3
+ description: Validate SpecPlane YAML and kernel sync (naming, links, changelog, retrieve leftovers, check_sync). Use when the user asks to review, audit, or check specs — not for implementing a product change.
4
+ ---
5
+
6
+ # SpecPlane Validate
7
+
8
+ ## Load
9
+
10
+ Read `specplane/core_prompt/applicable/08-validation-rules.md` and `11-guidance-and-checklists.md`. Do not load the full master prompt.
11
+
12
+ ## Procedure
13
+
14
+ 1. Prefer the kernel CLI when present (`--spec-root specs`). Do not add git hooks or CI jobs.
15
+
16
+ ```bash
17
+ python3 tools/specplane/cli.py validate --spec-root specs
18
+ python3 tools/specplane/cli.py check_sync --spec-root specs
19
+ ```
20
+
21
+ `python3 tools/specplane/validate.py` is validate-only. Use `cli.py retrieve <id>` / `blast <id>` when the review is about one promise or impact, not the whole tree.
22
+
23
+ Set `SPECPLANE_CALLER=cursor_skill` on those commands. A local event is recorded unless `usage disable` was run. Nothing is uploaded.
24
+
25
+ If a command prints a line that starts with `SpecPlane ·`, quote that line in the reply the user sees, unchanged. If it does not, do not invent a SpecPlane receipt. Do not say SpecPlane caught a bug or revised the code unless that printed line says so.
26
+
27
+ 2. Optionally run `python3 tools/specplane/drift.py --scope changed` as a reminder, not as a required gate.
28
+
29
+ 3. Read sections 08 and 11 for findings the CLI cannot see (wording, completeness).
30
+
31
+ 4. Report by severity:
32
+ - blocker: CLI errors (id/filename, links, semver, changelog, `check_sync` uncovered ids)
33
+ - warn: CLI warnings plus incomplete Phase 2/3; leftover graphs `retrieve` marked replaced
34
+ - info: naming or wording
35
+
36
+ 5. Suggest the smallest fix per finding. Do not rewrite unrelated sections. Do not silently pick spec vs code.
@@ -0,0 +1,22 @@
1
+ ---
2
+ description: SpecPlane loading contract — never dump the full master prompt
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # SpecPlane
7
+
8
+ Default schema is v9.1.0. Follow `AGENTS.md`.
9
+
10
+ This repo has **two trees**: `specplane/` is the kit (language). `specs/` is the kernel product (what the CLI must do). Do not copy `specs/` into other apps. `design-docs/` is gitignored strategy, not specs.
11
+
12
+ For spec authoring, read `specplane/core_prompt/applicable/README.md` and load only the section for the current task. Do not attach `specplane_schema_prompt_v9.1.0.md` unless the user is changing the schema or explicitly asks for the complete reference.
13
+
14
+ Specs describe what and how well, not how. Keep bidirectional links in sync. Add a changelog entry when bumping `meta.version` on live 5C files.
15
+
16
+ Product requests in natural language use the change ritual in `specplane-implement` ([`docs/golden-journey.md`](docs/golden-journey.md)).
17
+
18
+ **PRE:** If the request could move a promise, `retrieve` before writing, then change folder + blast; ask and **wait** if a decision is unresolved. Typos/renames: no retrieve. If unsure, retrieve.
19
+
20
+ **POST:** After non-trivial work, `validate`, `check_sync --change <slug> --changed-ids`, then `run --change <slug>`. Default check_sync (spec YAML in git only) is not a pass if you touched `tools/specplane/` or app code. Coverage pass is not behavioral agreement. `run` invokes bound checks only; it does not create tests or certify behavior. The kernel does not watch the chat.
21
+
22
+ Do not slurp `specs/`. Do not edit live YAML for in-flight work.
@@ -0,0 +1,17 @@
1
+ ---
2
+ description: SpecPlane YAML authoring — load the applicable schema section for the spec type
3
+ globs: "**/*.yaml"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # SpecPlane YAML
8
+
9
+ When editing SpecPlane YAML (`capability.*`, `foundation.*`, `system.*`, `container.*`, `component.*`):
10
+
11
+ 1. Confirm `meta.id` matches the filename without extension.
12
+ 2. Load only the applicable section for this spec type from `specplane/core_prompt/applicable/README.md` (03 plus 04–07).
13
+ 3. If you add `implements`, `uses`, or `dependencies.internal`, update the reciprocal field in the same change.
14
+ 4. Bump `meta.version` and add a `changelog` entry on **live** 5C files. Files under `specs/changes/` are the in-flight write path — not 5C meta, not changelog novels on the live capability.
15
+ 5. If this edit is a behavior change, it should already live in an open change folder (`specplane-implement`). Do not silently patch live YAML.
16
+
17
+ Do not load the full v9.1.0 master prompt for a single-file edit.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: specplane-author
3
+ description: Create or expand SpecPlane YAML specs (capability, foundation, system, container, component, AI-native types). Use when the user explicitly asks to write, add, or update a specification file. If they described a product change in natural language, use specplane-implement instead.
4
+ ---
5
+
6
+ # SpecPlane Author
7
+
8
+ ## Load
9
+
10
+ 1. Read `specplane/core_prompt/applicable/README.md`.
11
+ 2. Read `03-shared-meta.md`.
12
+ 3. Read **only** the type section:
13
+ - capability → `04-capability.md`
14
+ - foundation → `05-foundation.md` and copy shape from `specplane/foundations/` if starting from boilerplate
15
+ - system / container / component → `06-system-container-component.md`
16
+ - agent / tool / workflow / evaluator / tool_registry / state_store → `06` then `07-ai-native.md`
17
+ 4. Skim the matching example in `10-worked-examples.md` if the type is capability or component.
18
+ 5. If the user wants journey / lifecycle / information-flow richness or “what’s missing on this flow,” also load `specplane-flows`. String `flows` remain valid; mappings are optional.
19
+
20
+ Do not load `specplane_schema_prompt_v9.1.0.md` unless a field is missing from those sections.
21
+
22
+ ## Procedure
23
+
24
+ 1. If this is a **behavior change to something that already exists**, stop and follow `specplane-implement` (retrieve, classify, change folder). Do not silently patch live YAML.
25
+ 2. If `tools/specplane/cli.py` exists and you have an id, `retrieve` it first. Do not slurp `specs/`.
26
+ 3. Identify level and (for components) `meta.type` / `meta.domain`.
27
+ 4. **Where to write:**
28
+ - Brand-new capability with no live id: Phase 1 live file is OK (`responsibilities`, `flows`, `business_value`, `constraints`).
29
+ - In-flight work or an open change: put ADDED/MODIFIED YAML in `specs/changes/<id>/`, not as a changelog novel on the live file.
30
+ 5. Set `meta.id` to the filename without extension. Use snake_case ids.
31
+ 6. If adding `implements`, `uses`, or internal dependencies, update the other side of the link in the same change.
32
+ 7. Add a `changelog` row and bump `meta.version` only on **live** 5C files. Change-folder YAML (`proposal` / `delta` / `success`) is not 5C meta.
33
+ 8. If `tools/specplane/cli.py` exists, run `validate` in this session. Do not add git hooks or CI.
34
+ 9. Summarize what was authored and what is still Phase-incomplete. If validate prints a line that starts with `SpecPlane ·`, quote that line in the reply the user sees, unchanged. Do not invent a SpecPlane receipt.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: specplane-bootstrap
3
+ description: Initialize a SpecPlane specs/ tree (capabilities, foundations, system, containers, components, changes). Use when the user asks to set up SpecPlane, scaffold specs, or start a new spec workspace.
4
+ ---
5
+
6
+ # SpecPlane Bootstrap
7
+
8
+ ## Load
9
+
10
+ Read `specplane/core_prompt/applicable/02-file-layout.md` and `03-shared-meta.md`. Do not load the full master prompt.
11
+
12
+ ## Procedure
13
+
14
+ 1. Create if missing (`cli.py init` may already have empty dirs):
15
+ - `specs/capabilities/`
16
+ - `specs/foundations/`
17
+ - `specs/containers/`
18
+ - `specs/components/`
19
+ - `specs/changes/` (in-flight write path; keep empty until a real change)
20
+ 2. Add one `specs/system.<name>.yaml` if none exists.
21
+ 3. If the user named capabilities or foundations, create those files; otherwise create one example capability and copy needed files from `specplane/foundations/`.
22
+ 4. Every **5C** file: `meta.id` equals filename without extension, semver `version`, `introduced_in`, at least one `changelog` entry. Do not invent fake 5C meta for files under `specs/changes/`.
23
+ 5. If `tools/specplane/cli.py` exists, run `validate` in this session; else `validate.py`. Do not add git hooks or CI.
24
+ 6. Report the tree. If validate prints a line that starts with `SpecPlane ·`, quote that line in the reply the user sees, unchanged. Do not invent a SpecPlane receipt. Next step is usually a Phase 1 capability. Daily product requests after that use `specplane-implement` (see [`docs/golden-journey.md`](../../../docs/golden-journey.md)), not more scaffolding.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: specplane-explain
3
+ description: Explain how something works from the specification, the open change, the implementation, and the evidence, kept apart. Use when the user asks how something works, why the code does this, or what the spec says versus the change. Do not use to author a spec or to implement a product change.
4
+ ---
5
+
6
+ # SpecPlane Explain
7
+
8
+ Answer how something works. Keep four sources apart. Do not merge them into one story.
9
+
10
+ 1. Run `context` on the spec id or the file the user named.
11
+
12
+ ```bash
13
+ SPECPLANE_CALLER=cursor_skill python3 tools/specplane/cli.py context <target> --spec-root specs
14
+ ```
15
+
16
+ Add `--change <slug>` when one open change is the task. Prefer `specplane` if it is on PATH.
17
+
18
+ 2. If the command says the file is unmapped, stop. Do not invent a component. Do not parse the file into a spec. Quote the `SpecPlane ·` line.
19
+
20
+ 3. Read implementation files only when `context` names a `realization.paths` entry for that component. Do not scan the repository for a match the command did not name.
21
+
22
+ 4. Answer with four headings, in this order:
23
+
24
+ - **Specification** — the live text `context` printed (purpose, responsibilities, constraints).
25
+ - **Change** — the open change summaries. That is the implementation context. Canonical synchronization is pending until accept. If there is no open change, say so.
26
+ - **Implementation** — what the named files do. If none are declared, say none are declared.
27
+ - **Evidence** — each sensor's evidence and status. `UNVERIFIED` means no bound check passed. `VERIFIED` means a bound command passed. It does not mean the implementation satisfies the spec. `FAILED` means a bound command failed.
28
+
29
+ If the four disagree, say that in three sentences, one per disagreement. Do not pick a winner.
30
+
31
+ If a command prints a line that starts with `SpecPlane ·`, quote it unchanged. Do not invent a receipt. Do not add `--by` flags. Do not assign owners. Do not write `realized_by`. Components the graph does not name stay unmarked.
32
+
33
+ A readiness warning means implementation is underway and no implementation relationships are declared. Phase 1 stays valid. Do not add `realized_by` to clear the warning.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: specplane-flows
3
+ description: >-
4
+ Enhance SpecPlane capability flows with optional journey, object-lifecycle,
5
+ and information-flow richness. Use when the user asks to review, complete,
6
+ or improve user journeys, UX/info flows, object lifecycles, malloc-use-free
7
+ completeness, or what is missing on a flow. Do not invent unanswered behavior.
8
+ ---
9
+
10
+ # SpecPlane Flows
11
+
12
+ Review and enrich `capability.flows`. Do not add a sixth C. Do not require every file to have journey + lifecycle + information.
13
+
14
+ ## Load
15
+
16
+ 1. `specplane/core_prompt/applicable/README.md`
17
+ 2. `specplane/core_prompt/applicable/04-capability.md` (flow mapping + `open_questions`)
18
+ 3. If a component realization is in scope: `06-system-container-component.md` (`planning.user_flows` stays a sliver)
19
+
20
+ Do not load the full master prompt.
21
+
22
+ ## PRE
23
+
24
+ If `tools/specplane/cli.py` exists and you have a capability id:
25
+
26
+ ```bash
27
+ SPECPLANE_CALLER=cursor_skill python3 tools/specplane/cli.py retrieve <id> --spec-root specs
28
+ ```
29
+
30
+ Do not slurp `specs/`. Open only files the CLI named.
31
+
32
+ If a command prints a line that starts with `SpecPlane ·`, quote that line in the reply the user sees, unchanged. If it does not, do not invent a SpecPlane receipt. Do not say SpecPlane caught a bug or revised the code unless that printed line says so.
33
+
34
+ ## What to do
35
+
36
+ 1. **Keep the string index.** Existing `flows: ["Sign-up", "Login"]` stays valid. Promote a string to a mapping only when this file needs the richness.
37
+ 2. **Ask which kinds this file needs** (not all three by default):
38
+ - **journey** — where the person starts, paths, how it ends
39
+ - **lifecycle** — `malloc → use → free` for objects this flow creates
40
+ - **information** — collected, moved, retained, destroyed
41
+ 3. **Walk the implied envelope.** For each object: create → use → modify → share → archive? → restore? → delete? → what remains? For each journey: entry, stages, success, abandonment, exceptions, recovery.
42
+ 4. **Do not invent answers.** If terminate/recover/ownership/retention is unspecified, write an `open_questions` item (`question`, optional `id` / `raised_from` / `status: open`). Capability-level `open_questions` or component `validation.open_questions` — same slot family; do not add a second key.
43
+ 5. **Stories are a lens.** One or two `stories:` rows as evidence is fine. Do not generate a Jira-sized `user_stories` list.
44
+ 6. **Cross-capability journeys are composed.** Do not copy a Discover→Cancel saga into every capability. Record the piece this file owns; note other capability ids in `open_questions` or `raised_from` if a hop is missing.
45
+ 7. **External guidance is optional.** Web/UX research may be labeled `External guidance` and become questions or suggested spec edits. It is not law. Do not stuff best-practice essays into YAML.
46
+ 8. **Components realize pieces.** You may set `planning.user_flows.flow_ref`. Do not copy lifecycle tables onto the component.
47
+
48
+ ## Write rules
49
+
50
+ - In-flight work goes in `specs/changes/<slug>/` when this is an evolve of a live capability. New Phase 1 capabilities may take mappings on the live file.
51
+ - Prefer inference → questions → (after a human answers) spec mutation. Resolved questions graduate into the mapping (`lifecycle`, `recovery`, …) and get `status: resolved`.
52
+ - After edits: `python3 tools/specplane/cli.py validate --spec-root specs` when the CLI exists.
53
+
54
+ ## Done when
55
+
56
+ The file is more digestible (named pieces + only the kinds it needs), gaps are **questions** not invented requirements, and a string-only neighbor file was left string-only.