spatial-views 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +245 -2
- package/dist/app/assets/abnfDiagram-S7VZAUFO-CFbb_Sz2.js +1 -0
- package/dist/app/assets/architecture-WOLXFQ4H-CsBD__5a.js +1 -0
- package/dist/app/assets/architectureDiagram-YGSQEFNW-C0ic4ib1.js +36 -0
- package/dist/app/assets/blockDiagram-APKKGZFW-BZDPbzAG.js +140 -0
- package/dist/app/assets/bpmnIcons-APHXDYXF-C0jbCElo.js +1 -0
- package/dist/app/assets/c4Diagram-KJ2TOQU5-BilBWuq5.js +38 -0
- package/dist/app/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/dist/app/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/dist/app/assets/chunk-6MUBBAK2-BBl-4tQr.js +2 -0
- package/dist/app/assets/chunk-AXFCVDMN-BhsttQ-k.js +62 -0
- package/dist/app/assets/chunk-BG4553SI-mWcPcFZr.js +127 -0
- package/dist/app/assets/chunk-DQASFODM-7FKe2gLt.js +10 -0
- package/dist/app/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
- package/dist/app/assets/chunk-HFQBQIA3-nXrQ08BL.js +1 -0
- package/dist/app/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
- package/dist/app/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/dist/app/assets/chunk-KQLB2F66-swukhFmZ.js +2 -0
- package/dist/app/assets/chunk-KS47KZWR-DkDkwO82.js +1 -0
- package/dist/app/assets/chunk-LEVMRMFU-DXH6iXv3.js +1 -0
- package/dist/app/assets/chunk-M57EVK23-B-kEyOJF.js +1 -0
- package/dist/app/assets/chunk-NGNAAXSQ-DI_UYJZ4.js +136 -0
- package/dist/app/assets/chunk-OY52VR5R-DweG7qYw.js +88 -0
- package/dist/app/assets/chunk-QB3YPZ4I-DyozK3lV.js +213 -0
- package/dist/app/assets/chunk-R3KSYZAL-BEXCUN6J.js +1 -0
- package/dist/app/assets/chunk-STOXU5M4-BaTlty4O.js +72 -0
- package/dist/app/assets/chunk-TU62E6Q5-_rcUP1Fh.js +1 -0
- package/dist/app/assets/chunk-X3CZISLH-NOpCnvgE.js +1 -0
- package/dist/app/assets/chunk-X4PVCEUW-DGxTL3kB.js +1 -0
- package/dist/app/assets/chunk-XXDRQBXY-C02Gpej2.js +1 -0
- package/dist/app/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/dist/app/assets/classDiagram-v2-L25IHNXF-DLEBwpvk.js +217 -0
- package/dist/app/assets/cose-bilkent-JH36ORCC-kNCXOm8k.js +1 -0
- package/dist/app/assets/cynefin-EF2NZ3EQ-6MWNLbuF.js +1 -0
- package/dist/app/assets/cynefinDiagram-L36ESFBY-CLFstukD.js +62 -0
- package/dist/app/assets/cytoscape.esm-nTrd5EVq.js +321 -0
- package/dist/app/assets/d3-scale-CaJQQYkF.js +1 -0
- package/dist/app/assets/dagre-SPEB5RXH-BaSAny1T.js +4 -0
- package/dist/app/assets/diagram-3B7GL73J-DJNlt5Sg.js +200 -0
- package/dist/app/assets/diagram-DNEMPZML-DEHeuILB.js +24 -0
- package/dist/app/assets/diagram-L3MUGCDN-ob5Ka2Xc.js +41 -0
- package/dist/app/assets/diagram-LA4NIPWU-DNESzFAc.js +24 -0
- package/dist/app/assets/diagram-MHCOC4E2-CVi9zKjG.js +3 -0
- package/dist/app/assets/diagram-XPFHEONP-DInT4C7e.js +30 -0
- package/dist/app/assets/dist-CjvHN74u.js +1 -0
- package/dist/app/assets/ebnfDiagram-UZSYDL2S-CRCZNsji.js +1 -0
- package/dist/app/assets/elk-XV6XMXQE-D4fsWI2l.js +2 -0
- package/dist/app/assets/erDiagram-EYBAPDEH-YQNM5StV.js +99 -0
- package/dist/app/assets/eventmodeling-K75KTNOO-Bev08J2F.js +1 -0
- package/dist/app/assets/flowDiagram-MALGAFMO-BhJ554DH.js +1 -0
- package/dist/app/assets/ganttDiagram-23REXITY-CkaBMYM4.js +292 -0
- package/dist/app/assets/gitGraph-VSP46ZUC-CtbZ0sIS.js +1 -0
- package/dist/app/assets/gitGraphDiagram-STJD7YCW-D15ZdQ-Z.js +106 -0
- package/dist/app/assets/graphlib-DS17s2tU.js +1 -0
- package/dist/app/assets/index-Bn6_wHEp.js +98 -0
- package/dist/app/assets/index-H-Z7MFhZ.css +1 -0
- package/dist/app/assets/info-OHQRW6UA-CfUW1XFR.js +1 -0
- package/dist/app/assets/infoDiagram-KBXO4MBG-DT7LbBRQ.js +2 -0
- package/dist/app/assets/ishikawaDiagram-M35NCXHK-CF51lhjB.js +70 -0
- package/dist/app/assets/journeyDiagram-OPLOXDXO-_36FonKk.js +139 -0
- package/dist/app/assets/kanban-definition-BZKZHSQY-tLk_OlQ-.js +89 -0
- package/dist/app/assets/katex-MEuSR36T.js +257 -0
- package/dist/app/assets/mermaid-parser.core-_3Vo8x6b.js +7 -0
- package/dist/app/assets/mermaid.core-y-x1CYxC.js +44 -0
- package/dist/app/assets/mindmap-definition-I2QAS2VK-BCI4HRX3.js +98 -0
- package/dist/app/assets/packet-JDAUHWVQ-Cco3UoaI.js +1 -0
- package/dist/app/assets/pegDiagram-FD4XPPHP-BOzSoNji.js +1 -0
- package/dist/app/assets/pie-XZMESJXO-reOB2GXn.js +1 -0
- package/dist/app/assets/pieDiagram-J4AKIIQI-PlHpwT_c.js +39 -0
- package/dist/app/assets/quadrantDiagram-XTYBLID2-CdxZ0ael.js +7 -0
- package/dist/app/assets/radar-ABXABTNO-DfCl8uV2.js +1 -0
- package/dist/app/assets/railroad-I3PHUGI6-4s14UyW1.js +1 -0
- package/dist/app/assets/railroad-abnf-LNEFI6M7-C49jJE4Y.js +1 -0
- package/dist/app/assets/railroad-ebnf-DWYD2UWJ-Bx-pcPc7.js +1 -0
- package/dist/app/assets/railroad-peg-JR7BVNR7-DjBPSCKV.js +1 -0
- package/dist/app/assets/railroadDiagram-MRQ6NCDL-wGcmIMqq.js +1 -0
- package/dist/app/assets/requirementDiagram-Y7LWUY3S-DprFI03z.js +84 -0
- package/dist/app/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/app/assets/rough.esm-Dy-Kn_BL.js +1 -0
- package/dist/app/assets/sankeyDiagram-WGJFYUXA-DygYWLTR.js +40 -0
- package/dist/app/assets/sequenceDiagram-5NDRBG5M-BzIr2DBO.js +169 -0
- package/dist/app/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
- package/dist/app/assets/stateDiagram-v2-FJ4FJNEA-MGCqKnm_.js +291 -0
- package/dist/app/assets/swimlanes-UMQ2AFYF-CIEH82Zt.js +1 -0
- package/dist/app/assets/swimlanesDiagram-OMPLPG4O-YWNJjl0g.js +8 -0
- package/dist/app/assets/timeline-definition-SEUHKTQE-BGYSqup2.js +120 -0
- package/dist/app/assets/treeView-D4JQ5SDB-B39o1sJo.js +1 -0
- package/dist/app/assets/treemap-SAJKECNS-BoGxrUH4.js +1 -0
- package/dist/app/assets/usecaseDiagram-AFA6YXN4-dy6oVOke.js +328 -0
- package/dist/app/assets/vennDiagram-NNMJR3RB-CUyuhcAk.js +34 -0
- package/dist/app/assets/wardley-7MLQ67FV-sYPAvQ06.js +1 -0
- package/dist/app/assets/wardleyDiagram-S7YFUSEH-DYtxYUHe.js +78 -0
- package/dist/app/assets/xychartDiagram-GGNKY7IX-ClR06AlB.js +7 -0
- package/dist/app/index.html +14 -0
- package/dist/cli/index.js +338 -0
- package/dist/core/api.js +420 -0
- package/dist/core/approvals.js +426 -0
- package/dist/core/context.js +259 -0
- package/dist/core/diff.js +156 -0
- package/dist/core/docs.js +140 -0
- package/dist/core/doctor.js +152 -0
- package/dist/core/doctypes.js +79 -0
- package/dist/core/edit.js +130 -0
- package/dist/core/errors.js +3 -0
- package/dist/core/flags.js +13 -0
- package/dist/core/gaps.js +119 -0
- package/dist/core/heading.js +4 -0
- package/dist/core/history.js +50 -0
- package/dist/core/home.js +345 -0
- package/dist/core/lanes.js +134 -0
- package/dist/core/launch.js +34 -0
- package/dist/core/layout.js +362 -0
- package/dist/core/links.js +68 -0
- package/dist/core/mermaid.js +175 -0
- package/dist/core/newdoc.js +66 -0
- package/dist/core/open-folder.js +30 -0
- package/dist/core/openspec.js +120 -0
- package/dist/core/paths.js +90 -0
- package/dist/core/project.js +392 -0
- package/dist/core/resolve.js +35 -0
- package/dist/core/route.js +420 -0
- package/dist/core/scan.js +514 -0
- package/dist/core/schema.js +270 -0
- package/dist/core/scope.js +126 -0
- package/dist/core/setup.js +134 -0
- package/dist/core/skills.js +181 -0
- package/dist/core/storage/config.js +74 -0
- package/dist/core/storage/events.js +54 -0
- package/dist/core/storage/folder-watch.js +147 -0
- package/dist/core/storage/folder.js +469 -0
- package/dist/core/storage/index.js +8 -0
- package/dist/core/storage/local.js +22 -0
- package/dist/core/storage/migrate.js +48 -0
- package/dist/core/storage/postgres.js +290 -0
- package/dist/core/storage/types.js +101 -0
- package/dist/core/storage.js +589 -0
- package/dist/core/suggest.js +283 -0
- package/dist/core/tree.js +254 -0
- package/dist/core/types.js +583 -0
- package/dist/core/version.js +1 -0
- package/dist/core/versions.js +245 -0
- package/dist/core/watch.js +2 -0
- package/dist/core/xml.js +68 -0
- package/dist/demo/args.js +58 -0
- package/dist/demo/browser.js +301 -0
- package/dist/demo/platform.js +147 -0
- package/dist/demo/run.js +198 -0
- package/dist/demo/steps.js +328 -0
- package/dist/mcp/project-tools.js +193 -0
- package/dist/mcp/server.js +785 -0
- package/examples/platform/README.md +33 -0
- package/examples/platform/api/package.json +8 -0
- package/examples/platform/api/src/auth-middleware.js +16 -0
- package/examples/platform/api/src/proxy.js +7 -0
- package/examples/platform/api/src/rate-limit.js +13 -0
- package/examples/platform/api/src/server.js +40 -0
- package/examples/platform/auth/package.json +9 -0
- package/examples/platform/auth/src/server.js +24 -0
- package/examples/platform/auth/src/tokens.js +19 -0
- package/examples/platform/auth/src/users.js +16 -0
- package/examples/platform/docs/api/PRD.md +10 -0
- package/examples/platform/docs/api/SDD.md +15 -0
- package/examples/platform/docs/auth/PRD.md +10 -0
- package/examples/platform/docs/auth/SDD.md +8 -0
- package/examples/platform/docs/frontend/PRD.md +18 -0
- package/examples/platform/docs/frontend/SDD.md +13 -0
- package/examples/platform/docs/pricing/PRD.md +9 -0
- package/examples/platform/docs/pricing/SDD.md +8 -0
- package/examples/platform/docs/products/PRD.md +9 -0
- package/examples/platform/docs/products/SDD.md +8 -0
- package/examples/platform/frontend/package.json +8 -0
- package/examples/platform/frontend/src/api-client.js +21 -0
- package/examples/platform/frontend/src/main.js +21 -0
- package/examples/platform/frontend/src/pages/products.js +12 -0
- package/examples/platform/frontend/src/pages/sign-in.js +14 -0
- package/examples/platform/frontend/src/session.js +11 -0
- package/examples/platform/pricing/package.json +9 -0
- package/examples/platform/pricing/src/cache.js +19 -0
- package/examples/platform/pricing/src/product-events.js +17 -0
- package/examples/platform/pricing/src/rules.js +19 -0
- package/examples/platform/pricing/src/server.js +32 -0
- package/examples/platform/products/package.json +9 -0
- package/examples/platform/products/src/catalog.js +20 -0
- package/examples/platform/products/src/events.js +11 -0
- package/examples/platform/products/src/search.js +9 -0
- package/examples/platform/products/src/server.js +31 -0
- package/migrations/postgres/001_init.sql +55 -0
- package/migrations/postgres/002_view_versions.sql +18 -0
- package/package.json +69 -4
- package/schema/approval.schema.json +173 -0
- package/schema/gap.schema.json +56 -0
- package/schema/pins.schema.json +122 -0
- package/schema/project.schema.json +93 -0
- package/schema/settings.schema.json +86 -0
- package/schema/toolbox.schema.json +206 -0
- package/schema/type.schema.json +121 -0
- package/schema/view.schema.json +240 -0
- package/skills/claude/build-gap/SKILL.md +28 -0
- package/skills/claude/check-ui/SKILL.md +40 -0
- package/skills/claude/draw-system/SKILL.md +38 -0
- package/skills/claude/gap-from-view/SKILL.md +29 -0
- package/skills/claude/post-audit/SKILL.md +58 -0
- package/skills/claude/pre-audit/SKILL.md +82 -0
- package/skills/claude/update-state/SKILL.md +56 -0
- package/skills/cursor/check-ui.mdc +40 -0
- package/skills/cursor/draw-system.mdc +38 -0
- package/skills/cursor/post-audit.mdc +44 -0
- package/skills/cursor/pre-audit.mdc +49 -0
- package/skills/cursor/update-state.mdc +45 -0
- package/skills/windsurf/spatial-views.md +212 -0
- package/toolboxes/aws.yaml +43 -0
- package/toolboxes/azure.yaml +41 -0
- package/toolboxes/cloud.yaml +95 -0
- package/toolboxes/docs.yaml +111 -0
- package/toolboxes/software.yaml +114 -0
- package/toolboxes/types/docs/gap.yaml +15 -0
- package/toolboxes/types/docs/mdd.yaml +19 -0
- package/toolboxes/types/docs/plain.yaml +7 -0
- package/toolboxes/types/docs/prd.yaml +17 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gap-from-view
|
|
3
|
+
description: Turn a change request into a Gap scoped to selected modules on a Spatial View (and an OpenSpec change when the repo uses OpenSpec). Use when asked to "make a Gap", plan a change, or scope work on the picture.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# gap-from-view
|
|
7
|
+
|
|
8
|
+
> If the spatial-views MCP tools are not available, stop and tell the user to enable the spatial-views MCP server (and to check the WSL form on Windows). Do not write your own MCP client or call the CLI directly.
|
|
9
|
+
|
|
10
|
+
## Start: pick the project
|
|
11
|
+
1. `list_projects`, then `use_project` with the project's name. If it isn't listed, or you can't tell which one is meant, stop and ask (a new project starts with `pre-audit`).
|
|
12
|
+
2. Every tool now works on that project only, and reads only its sources (`list_sources`). A path outside them is refused: don't look for another way in, ask for the folder to be added with `add_source`.
|
|
13
|
+
|
|
14
|
+
A Gap is one outcome, scoped to the modules it touches. The scope is what keeps the build from guessing.
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
1. **Think**: restate what is wanted and why in one or two sentences (this becomes the intent).
|
|
18
|
+
2. **Pick the View**: `list_views`, then `get_view` the one where the change lives. Drill down (follow `LinkedView`) until the modules are the right size.
|
|
19
|
+
3. **Scope**: choose only the modules the change touches. If a person has lassoed modules on the canvas, use those; `list_gaps` shows Gaps they made there.
|
|
20
|
+
4. **Create**: `create_gap` with `title` (verb first: "Add rate limiting"), `intent`, `view`, `modules` and a `milestone` if one is given. With OpenSpec this also creates `openspec/changes/<id>/` and pins it to the Gap.
|
|
21
|
+
If the reply says "pending in Approvals", the Gap and its change folder are not live yet: tell the person it is waiting in Approvals, and go on to step 5 only once `get_approval` says approved.
|
|
22
|
+
5. **Spec it the OpenSpec way**: fill in the change's `proposal.md`, `tasks.md` and delta specs (`specs/<capability>/spec.md` with `## ADDED` / `## MODIFIED` / `## REMOVED Requirements`) using OpenSpec's own proposal command or conventions, then validate with OpenSpec (`openspec validate <id>`).
|
|
23
|
+
6. **Pin** any other doc the work needs to the Gap (`pin` with `gap`).
|
|
24
|
+
7. Report the Gap id, its modules, and the change path.
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
- One Gap, one outcome. Split a request that has two.
|
|
28
|
+
- No modules outside the selection. If the change needs more, say so and update the Gap (`update_gap` with `modules`).
|
|
29
|
+
- Without OpenSpec, the Gap file is the plan: put the detail in `intent`.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: post-audit
|
|
3
|
+
description: Check the build against the spec - list every requirement in the pinned specs and docs, find evidence for each (a file, test or View) or mark it missing, and write audit-report.md with a coverage figure pinned to the System Overview. Use for "post-audit <project>" or "did we build what the specs say?".
|
|
4
|
+
description_experimental: Check the build against the spec - list every requirement in the pinned specs and docs, find evidence for each (a file, test or View) or mark it missing, write audit-report.md with a coverage figure pinned to the System Overview, and raise a Gap for each miss. Use for "post-audit <project>" or "did we build what the specs say?".
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# post-audit
|
|
8
|
+
|
|
9
|
+
> If the spatial-views MCP tools are not available, stop and tell the user to enable the spatial-views MCP server (and to check the WSL form on Windows). Do not write your own MCP client or call the CLI directly.
|
|
10
|
+
|
|
11
|
+
## Start: pick the project
|
|
12
|
+
1. `list_projects`, then `use_project` with the project's name. If it isn't listed, or you can't tell which one is meant, stop and ask (a new project starts with `pre-audit`).
|
|
13
|
+
2. Every tool now works on that project only, and reads only its sources (`list_sources`). A path outside them is refused: don't look for another way in, ask for the folder to be added with `add_source`.
|
|
14
|
+
|
|
15
|
+
`post-audit <project>`: did we build what the specs say?
|
|
16
|
+
|
|
17
|
+
Use the `spatial-views` MCP tools. The sources are only read.
|
|
18
|
+
|
|
19
|
+
## Spec format
|
|
20
|
+
Call `get_project` once and read its spec_format (Settings → Project → Spec format). Read and write specs in that format only:
|
|
21
|
+
- **spatial-views**: the specs are PRD, MDD and Gap docs (`specs/prd/`, `specs/mdd/`, `specs/gaps/`). A Gap here is a doc: title, intent, modules, acceptance.
|
|
22
|
+
- **openspec**: the specs are `openspec/specs/<capability>/spec.md`, and proposed work is a change in `openspec/changes/<id>/` (`proposal.md`, `tasks.md`, delta specs under `specs/`). Don't write PRD, MDD or Gap docs.
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
1. `get_project`, `list_sources` and `list_pins`. The pinned specs and docs are what you audit against.
|
|
26
|
+
2. **Requirements.** Read each pinned spec and doc: OpenSpec requirements, PRD and SDD statements, PBI acceptance criteria, and documented endpoints, queues and flows. List each requirement once, with an id (for example `R1`) and where it is stated (`<source_id>:<path>` and the heading or line).
|
|
27
|
+
3. **Evidence.** For each requirement, look for evidence:
|
|
28
|
+
- **file**: the code that does it (`scan_source` routes, queues and DB use, then the file and line);
|
|
29
|
+
- **test**: a test that checks it;
|
|
30
|
+
- **View**: the module, connection or sequence message that shows it.
|
|
31
|
+
Mark each requirement **met** (evidence found), **partial** (some of it, and say what's missing) or **missing**. A requirement is never met without evidence.
|
|
32
|
+
4. **Coverage.** Coverage is met / total, as a percentage. Count partial as not met, and give its count separately.
|
|
33
|
+
5. **Report.** `save_report`, named `audit-report`:
|
|
34
|
+
- a header line: the date, the project, and coverage `N% (met/total)`, with partial and missing counts;
|
|
35
|
+
- a table: id, requirement, where it is stated, status, evidence;
|
|
36
|
+
- a list of the misses.
|
|
37
|
+
It is pinned to the System Overview.
|
|
38
|
+
<!-- experimental -->
|
|
39
|
+
6. **Gaps.** For each missing or partial requirement, `create_gap` on the modules that should hold it. Use the requirement as the title and the evidence (or its absence) as the `intent`. Check `list_gaps` first so you don't raise a Gap twice.
|
|
40
|
+
<!-- /experimental -->
|
|
41
|
+
7. **Record.** `record_audit` with `kind: "post-audit"` and `report: "audit-report"`.
|
|
42
|
+
<!-- experimental -->
|
|
43
|
+
8. Report the coverage figure, the misses and the Gaps raised.
|
|
44
|
+
<!-- /experimental -->
|
|
45
|
+
<!-- default -->
|
|
46
|
+
8. Report the coverage figure and the misses.
|
|
47
|
+
<!-- /default -->
|
|
48
|
+
|
|
49
|
+
## Rules
|
|
50
|
+
- Quote requirements as they are written. Don't reword them to fit the code.
|
|
51
|
+
- Every "met" cites a file and line, a test, or a View.
|
|
52
|
+
<!-- experimental -->
|
|
53
|
+
- Never fix code in an audit. A miss becomes a Gap.
|
|
54
|
+
<!-- /experimental -->
|
|
55
|
+
<!-- default -->
|
|
56
|
+
- Never fix code in an audit. Report the miss.
|
|
57
|
+
<!-- /default -->
|
|
58
|
+
- Never write to a source.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pre-audit
|
|
3
|
+
description: In one go, create the project (if missing) from one or more repos and doc folders, and draw it - the System Overview (one module per repo, connected), a Sub View for each - and pin each doc to the module it describes. Nothing else. Use for "pre-audit <project> <path...>" on an empty or new project.
|
|
4
|
+
description_experimental: In one go, create the project (if missing) from one or more repos, docs and diagram folders, suggest the related repos it points at, and draw the picture - the System Overview, one Repo View per repo, sequence Views for the main flows, swim lanes for the work split - pin the docs, write onboarding.md, and raise a draft Gap for every place docs and code disagree. Use for "pre-audit <project> <path...>" (one path is enough) on an empty or new project.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# pre-audit
|
|
8
|
+
|
|
9
|
+
> If the spatial-views MCP tools are not available, stop and tell the user to enable the spatial-views MCP server (and to check the WSL form on Windows). Do not write your own MCP client or call the CLI directly.
|
|
10
|
+
|
|
11
|
+
`pre-audit <project> <path> [<path> ...]`. One path is enough: `pre-audit XYZ c:\git\1`. Several work too: `pre-audit payments c:\git\api c:\git\web c:\git\worker c:\git\docs c:\git\diagrams`.
|
|
12
|
+
|
|
13
|
+
This one command does it all. The user never has to say "create the project", "create the System Overview" or "add the repos": do each of those yourself, in order, without asking.
|
|
14
|
+
|
|
15
|
+
Use the `spatial-views` MCP tools. The sources are only read: never write, move or reformat anything in them. Everything you make goes in the project's own folder (`~/SpatialViews/projects/<slug>/`).
|
|
16
|
+
|
|
17
|
+
## Start: the project
|
|
18
|
+
1. `list_projects`. If `<project>` is there, `use_project` it. If not, `create_project` with that name: the System Overview is made with it, and it becomes the active project.
|
|
19
|
+
2. Every tool now works on that project only, and reads only the folders you add. Nothing else on disk is read, even if it sits next to them.
|
|
20
|
+
3. Before you change a View that already has modules, `name_version` it with `name: "before pre-audit"`, so a person can preview and restore it from History.
|
|
21
|
+
|
|
22
|
+
## Spec format
|
|
23
|
+
Call `get_project` once and read its spec_format (Settings → Project → Spec format). Read and write specs in that format only:
|
|
24
|
+
- **spatial-views**: the specs are PRD, MDD and Gap docs (`specs/prd/`, `specs/mdd/`, `specs/gaps/`). A Gap here is a doc: title, intent, modules, acceptance.
|
|
25
|
+
- **openspec**: the specs are `openspec/specs/<capability>/spec.md`, and proposed work is a change in `openspec/changes/<id>/` (`proposal.md`, `tasks.md`, delta specs under `specs/`). Don't write PRD, MDD or Gap docs.
|
|
26
|
+
|
|
27
|
+
## Steps
|
|
28
|
+
<!-- default -->
|
|
29
|
+
1. **Sources.** For each path given, `add_source` with the full path. It is a repo if it has `.git`, else docs. Pass `kind` when the folder name doesn't say which. Paths can be Windows or POSIX. Each repo gets a module on the System Overview. If no path was given and the project has no sources, ask for one path, then go on.
|
|
30
|
+
2. **Read.** `scan_source` on each source. Repos: the parts, entry points, HTTP routes, queues, stores, and how the repos call each other. Docs: read each PRD and SDD (and any other `.md`): which part of the system it is about.
|
|
31
|
+
3. **System Overview.** It already has one module per repo. `list_types` once, then `update_module` each repo module: the name a person would use ("Pricing", not `pricing-svc`), its `type` and a one-line `description`. `connect` the modules that call each other, with short labels (`https`, `/products`, `products.changed`). Keep the System Overview to the repos and the connections between them.
|
|
32
|
+
4. **Sub Views.** For each repo module, `create_view` with `type: "sub-view"` and `from_module` set to it, named after it. Add its main parts with `add_module` (3 to 6 modules, each with its `type` and the properties you know), `connect` them with short labels, and `add_file_pointer` on each (`<source_id>:<path>`).
|
|
33
|
+
5. **Pin.** `pin` each doc to the module it describes: an area's PRD and SDD go on that area's module on the System Overview (`docs:pricing/SDD.md` on Pricing). A doc about the whole system goes on the System Overview itself.
|
|
34
|
+
6. **Record.** `record_audit` with `kind: "pre-audit"`. This sets each source's last audit commit.
|
|
35
|
+
7. `open_view` the System Overview, and report in a few lines: the Views drawn, the docs pinned, and anything you could not place.
|
|
36
|
+
<!-- /default -->
|
|
37
|
+
<!-- experimental -->
|
|
38
|
+
1. **Sources.** For each path given, `add_source` with the full path. It is a repo if it has `.git`, else docs or diagrams. Pass `kind` when the folder name doesn't say which. Paths can be Windows or POSIX. Each repo gets a module on the System Overview. If no path was given and the project has no sources, ask for one path, then go on.
|
|
39
|
+
2. **Read.** `scan_source` on each source:
|
|
40
|
+
- Repos: services, entry points, manifests, HTTP routes, queues, DB use, and how the repos call each other (cross-repo calls with a target). Open the entry points and route files the scan points at when you need more.
|
|
41
|
+
- Docs: PRD, SDD, TDD, PBIs, OpenSpec and any `.md`. Read each one, and list the requirements, endpoints, queues and flows it states.
|
|
42
|
+
- Diagrams: Mermaid and draw.io come back as nodes and edges. Open the images, PDFs and Miro CSVs it lists and read them yourself.
|
|
43
|
+
3. **Related repos (ask once).** `suggest_sources` on each repo source. Merge the answers by name, and leave out any that is already a source. If there are any, show them in one short list: the name, the evidence (`file:line` and the line itself) and the folder it would add (`candidate_paths`), or "no folder found". Then ask once: "Add these to <project>?" (all, some, or none).
|
|
44
|
+
- One path given: wait for the answer. On a yes, `add_source` each chosen folder and `scan_source` it, then go on. On a no, go on with what you have.
|
|
45
|
+
- Several paths given: show the list and ask, but don't wait. Go on with the paths you were given. If the answer comes back yes, `add_source` and `scan_source` the chosen folders, then add them to the Views.
|
|
46
|
+
- Never `add_source` a suggestion without a yes. Never read a suggested folder before it is added. A suggestion with no folder is only reported.
|
|
47
|
+
4. **Draw.**
|
|
48
|
+
- The **System Overview** (made with the project, one module per repo already): add the stores, queues and outside services the repos use, and connect them with short labels (`https`, `order.created`, `reads`).
|
|
49
|
+
- One **Repo View** per repo (`create_view`, `type: "repo"`, with `from_module` set to its System Overview module): its main parts, with `add_file_pointer` on each module. Write pointers as `<source_id>:<path>`.
|
|
50
|
+
- A **sequence View** for each main flow, such as checkout (`create_view` with `kind: "sequence"`). Add the participants left to right with `add_module`, then the calls in order with `add_message` (`async` for queues, `reply` for responses).
|
|
51
|
+
5. **Pin.** `pin` each doc to the View or modules it describes. A doc in a source is `<source_id>:<path>`, for example `docs:pbis/PBI-2.md`.
|
|
52
|
+
6. **Work split.** `set_lanes` on the System Overview: one lane per engineer or team (Engineer A, Engineer B, ...), from the docs or a sensible split. `assign_lane` each module. Connections between lanes are drawn as dependencies, showing who waits on whom.
|
|
53
|
+
7. **Onboarding.** `save_report` named `onboarding`: what the system is, its parts, where to start reading (entry points and docs), and the main flows. It is pinned to the System Overview.
|
|
54
|
+
8. **Drift.** Compare the docs and diagrams with the code. Each place they disagree becomes a draft Gap: `create_gap` with `draft: true`, on the modules involved, with a title that says what disagrees (for example "Documented GET /orders/:id is missing in api" or "Queue order.audit in worker is not documented"). Put the evidence in `intent`: the doc and line, and the file and line.
|
|
55
|
+
9. **Record.** `record_audit` with `kind: "pre-audit"` and `report: "onboarding"`. This sets each source's last audit commit.
|
|
56
|
+
10. `open_view` the System Overview, and report: the sources (given and added from suggestions), the Views drawn, the lanes, the docs pinned, the drift Gaps raised, the suggestions not added, and anything you could not place.
|
|
57
|
+
|
|
58
|
+
<!-- /experimental -->
|
|
59
|
+
|
|
60
|
+
## Drawing rules (draw it as an architect would)
|
|
61
|
+
- **Top down.** Frontend at the top, then the gateway and the API, then the services side by side, then workers and queues, and the data stores at the bottom. Externals (payments, email, someone else's API) go to the side. The `type` says where a module goes (each type has a `tier` in `list_types`), so give every module the type that fits and the layout puts it in its row.
|
|
62
|
+
- **One module per real deployable or store**: a frontend, a service you deploy, a database, a queue, an external service. Not a folder, a class or a library.
|
|
63
|
+
- **Short labels**: a module name of one to three words ("Pricing", "Orders DB"), a connection label of a word or two (`https`, `/prices`, `order.created`).
|
|
64
|
+
- **No more than about 9 modules on a View.** When there are more, group them and drill into Sub Views (`create_view` with `from_module`) instead.
|
|
65
|
+
- Leave out `x` and `y` on `add_module`: the layout places each module as you draw (top down, by tier, orthogonal lines that leave from the bottom and enter from the top). On a View a person has arranged, only what you add is placed. Call `layout_view` only when a person asks to tidy a View.
|
|
66
|
+
|
|
67
|
+
## Rules
|
|
68
|
+
- **Types**: `list_toolboxes` once (Software, Cloud, AWS, Azure, Docs, and any of the user's or the project's), then `list_types` for the toolboxes that fit the system (`toolbox: aws` for an AWS system) and give each module the `type` that fits (Service, API, Database, Queue, Worker, Gateway..., or aws-lambda, azure-functions...) and fill in the properties you know. A doc for a module (PRD, SDD, MDD, Feature doc, ADR, Runbook, Plain doc) is `create_doc` with its doc type, which pins it there. If none fits, say so; only `create_type` or `create_toolbox` when a person asks.
|
|
69
|
+
- Draw only what the code, docs or diagrams show. If you infer something, say so in the module's `description`.
|
|
70
|
+
- Use names a person would use, not file names. Keep each Sub View to 3 to 6 modules.
|
|
71
|
+
- Never write to a source.
|
|
72
|
+
- Read only the project's sources. If a flow leads to a folder that isn't one, say so; don't read it.
|
|
73
|
+
<!-- experimental -->
|
|
74
|
+
- Reports go only through `save_report`. `suggest_sources` is how to find a related repo: it reads only inside the sources, and only lists the folders next to them.
|
|
75
|
+
<!-- /experimental -->
|
|
76
|
+
<!-- experimental -->
|
|
77
|
+
- A drift Gap is a draft. A person decides whether the doc or the code is right.
|
|
78
|
+
<!-- /experimental -->
|
|
79
|
+
<!-- default -->
|
|
80
|
+
- Draw and pin, nothing else: no reports, no sequence Views, no changes for drift. If the docs and the code disagree, say so in your report; a person decides which is right.
|
|
81
|
+
<!-- /default -->
|
|
82
|
+
- **Approvals**: a new project, and a View or Doc you make that no person has approved yet, take your writes directly. Only a change to approved content waits, as a draft of that View or Doc: the reply says "pending in Approvals" and where it stands, e.g. "amended pending approval #12 (3 revisions, from v4)", and nothing is live yet. A later write to the same View or Doc amends that same draft (a new revision), so keep working; there is nothing to send. When you are done, tell the person what is waiting in their words ("amended pending approval #12"), and check `get_approval` later for the outcome (approved, approved in part or denied, with any note). If nothing changed, nothing waits.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: update-state
|
|
3
|
+
description: Keep a Spatial Views project true - re-read only what changed in each source since its last audit, update the Views and file pointers, and write a short changes report. Use for "update-state <project>" (no paths needed; the project knows its sources).
|
|
4
|
+
description_experimental: Keep a Spatial Views project true - re-read only what changed in each source since its last audit, update the Views and file pointers, close Gaps whose code has landed, flag new drift as draft Gaps, and write a short changes report. Use for "update-state <project>" (no paths needed; the project knows its sources).
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# update-state
|
|
8
|
+
|
|
9
|
+
> If the spatial-views MCP tools are not available, stop and tell the user to enable the spatial-views MCP server (and to check the WSL form on Windows). Do not write your own MCP client or call the CLI directly.
|
|
10
|
+
|
|
11
|
+
## Start: pick the project
|
|
12
|
+
1. `list_projects`, then `use_project` with the project's name. If it isn't listed, or you can't tell which one is meant, stop and ask (a new project starts with `pre-audit`).
|
|
13
|
+
2. Every tool now works on that project only, and reads only its sources (`list_sources`). A path outside them is refused: don't look for another way in, ask for the folder to be added with `add_source`.
|
|
14
|
+
|
|
15
|
+
`update-state <project>`. You don't need any paths: the project knows its sources.
|
|
16
|
+
|
|
17
|
+
Use the `spatial-views` MCP tools. The sources are only read.
|
|
18
|
+
|
|
19
|
+
## Spec format
|
|
20
|
+
Call `get_project` once and read its spec_format (Settings → Project → Spec format). Read and write specs in that format only:
|
|
21
|
+
- **spatial-views**: the specs are PRD, MDD and Gap docs (`specs/prd/`, `specs/mdd/`, `specs/gaps/`). A Gap here is a doc: title, intent, modules, acceptance.
|
|
22
|
+
- **openspec**: the specs are `openspec/specs/<capability>/spec.md`, and proposed work is a change in `openspec/changes/<id>/` (`proposal.md`, `tasks.md`, delta specs under `specs/`). Don't write PRD, MDD or Gap docs.
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
1. `get_project` and `list_sources`. Note each source's `last_audit_sha`.
|
|
26
|
+
2. **What changed.** For a repo, list the files changed since its `last_audit_sha`, with a read-only git command run in the source (`git diff --name-status <sha> HEAD`, plus `git status --porcelain` for uncommitted work). For a docs or diagrams folder, which isn't a git repo, `last_audit_sha` is a time: take the files whose mtime is later. If a source has no `last_audit_sha`, run `pre-audit` instead.
|
|
27
|
+
3. **Re-read.** `scan_source` on each changed source, and read the changed files themselves. Leave alone anything that hasn't changed.
|
|
28
|
+
4. **Update the picture.**
|
|
29
|
+
- `list_views` and `get_view` the Views that hold the changed files (look for their file pointers).
|
|
30
|
+
- Add, rename or remove modules (`add_module`, `update_module`, `remove`), and connections and messages (`connect`, `add_message`), keeping to the drawing rules below. A new module gets its `type` (`list_types`). Fix the file pointers (`add_file_pointer`, as `<source_id>:<path>`).
|
|
31
|
+
- Re-`pin` new or moved docs.
|
|
32
|
+
<!-- experimental -->
|
|
33
|
+
5. **Gaps.** `list_gaps`. Close each Gap whose code has landed (`update_gap` with `state: "done"`), and say what evidence closed it (the file, the commit or the test). Leave the others alone.
|
|
34
|
+
6. **Drift.** Each new place where the docs and the code disagree becomes a draft Gap (`create_gap` with `draft: true`), with the evidence in `intent`. Don't raise a Gap twice: check `list_gaps` first.
|
|
35
|
+
7. **Report.** `save_report`, named `changes-<yyyy-mm-dd>`: for each source, what changed, then the Views updated, the Gaps closed and the new drift. Keep it short.
|
|
36
|
+
<!-- /experimental -->
|
|
37
|
+
<!-- default -->
|
|
38
|
+
7. **Report.** `save_report`, named `changes-<yyyy-mm-dd>`: for each source, what changed, then the Views updated and any new place where the docs and the code disagree. Keep it short. If nothing changed, don't write a report.
|
|
39
|
+
<!-- /default -->
|
|
40
|
+
8. **Record.** `record_audit` with `kind: "update-state"`, `report` set to that report, and `sources` set to the sources you re-read.
|
|
41
|
+
9. Report the same summary back in a few lines, and `open_view` the View that changed most.
|
|
42
|
+
|
|
43
|
+
## Drawing rules (draw it as an architect would)
|
|
44
|
+
- **Top down.** Frontend at the top, then the gateway and the API, then the services side by side, then workers and queues, and the data stores at the bottom. Externals (payments, email, someone else's API) go to the side. The `type` says where a module goes (each type has a `tier` in `list_types`), so give every module the type that fits and the layout puts it in its row.
|
|
45
|
+
- **One module per real deployable or store**: a frontend, a service you deploy, a database, a queue, an external service. Not a folder, a class or a library.
|
|
46
|
+
- **Short labels**: a module name of one to three words ("Pricing", "Orders DB"), a connection label of a word or two (`https`, `/prices`, `order.created`).
|
|
47
|
+
- **No more than about 9 modules on a View.** When there are more, group them and drill into Sub Views (`create_view` with `from_module`) instead.
|
|
48
|
+
- Leave out `x` and `y` on `add_module`: the layout places each module as you draw (top down, by tier, orthogonal lines that leave from the bottom and enter from the top). On a View a person has arranged, only what you add is placed. Call `layout_view` only when a person asks to tidy a View.
|
|
49
|
+
|
|
50
|
+
## Rules
|
|
51
|
+
- Change only what changed. Don't redraw Views that are still true.
|
|
52
|
+
- Never write to a source. The git commands are read-only: no checkout, no fetch, no stash.
|
|
53
|
+
<!-- experimental -->
|
|
54
|
+
- Close a Gap only with evidence.
|
|
55
|
+
<!-- /experimental -->
|
|
56
|
+
- **Approvals**: a new project, and a View or Doc you make that no person has approved yet, take your writes directly. Only a change to approved content waits, as a draft of that View or Doc: the reply says "pending in Approvals" and where it stands, e.g. "amended pending approval #12 (3 revisions, from v4)", and nothing is live yet. A later write to the same View or Doc amends that same draft (a new revision), so keep working; there is nothing to send. When you are done, tell the person what is waiting in their words ("amended pending approval #12"), and check `get_approval` later for the outcome (approved, approved in part or denied, with any note). If nothing changed, nothing waits.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Open the page being built in a browser (Microsoft's Playwright MCP), screenshot it, and compare it with the View or spec it was built from, then report the differences as a short table. Reports only, never changes the spec or the code. Use for \"check-ui <url> <view or spec>\" or when asked whether the UI matches its design."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# check-ui
|
|
7
|
+
|
|
8
|
+
> If the spatial-views MCP tools are not available, stop and tell the user to enable the spatial-views MCP server (and to check the WSL form on Windows). Do not write your own MCP client or call the CLI directly.
|
|
9
|
+
|
|
10
|
+
`check-ui <url> <view or spec>`, for example `check-ui http://localhost:5173/settings "Settings screen"` or `check-ui http://localhost:3000 docs/specs/checkout.md`.
|
|
11
|
+
|
|
12
|
+
You need two things: the URL of the page being built, and the View or spec doc it was built from. If either is missing, ask for it.
|
|
13
|
+
|
|
14
|
+
## Start: the project and the browser
|
|
15
|
+
1. `list_projects`, then `use_project` with the project's name. If you can't tell which one is meant, stop and ask.
|
|
16
|
+
2. Check that the Playwright MCP tools are there (`browser_navigate`, `browser_resize`, `browser_take_screenshot`, `browser_snapshot`). If they are not, stop and tell the user to add Microsoft's Playwright MCP (`@playwright/mcp`) themselves, as the README shows under "Check the UI with Playwright MCP". Never install it yourself.
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
1. **Read what it should be.** For a View: `list_views`, then `get_view` it, and `list_pins` for the specs pinned to it; read those too. For a spec doc: read the file. List every screen, section, module, label, button, field and state (empty, loading, error) it names, in the order it gives them.
|
|
20
|
+
2. **Open the page.** `browser_resize` to a desktop size (1440 by 900), then `browser_navigate` to the URL. If it doesn't load, stop and report that.
|
|
21
|
+
3. **Look at it.** `browser_take_screenshot` (full page) and note where it was saved. `browser_snapshot` for the page's text, headings, landmarks and controls.
|
|
22
|
+
4. **Light and dark.** If the app has both, switch with `browser_emulate_media` (`colorScheme: "dark"`) or the app's own theme toggle, and take a second screenshot and snapshot. Then switch back.
|
|
23
|
+
5. **Compare.** Check each item from step 1 against the snapshot and the screenshot:
|
|
24
|
+
- Present: every screen, section, module, label and state the spec names is on the page.
|
|
25
|
+
- Order: the layout follows the spec (top to bottom, left to right).
|
|
26
|
+
- Text: headings, labels and button text match the spec's words.
|
|
27
|
+
- Nothing extra: anything on the page the spec doesn't name.
|
|
28
|
+
- Both themes: text readable and nothing missing in light and dark.
|
|
29
|
+
6. **Report.** A short table, one row per difference:
|
|
30
|
+
|
|
31
|
+
| Expected (spec) | Seen on page | Where | Severity |
|
|
32
|
+
|---|---|---|---|
|
|
33
|
+
| "Save" button under the form | missing | Settings, Profile section | high |
|
|
34
|
+
|
|
35
|
+
Severity: **high** (missing or wrong function), **medium** (wrong order, wrong text), **low** (spacing, colour, small extras). Then the screenshot paths, and one line saying what matched. If nothing differs, say so.
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
- Report only. Never change the spec, the View or the code in this skill, and never fix what you find; a person decides what to do.
|
|
39
|
+
- Compare with what the spec says, not with what you think looks good.
|
|
40
|
+
- Say what you could not check (a state you could not reach, a page behind a login).
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Draw (or update) a project's architecture as Spatial Views and pin the existing specs and docs to it. Use when asked to draw, map or picture the system, or when the project has no Views yet."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# draw-system
|
|
7
|
+
|
|
8
|
+
> If the spatial-views MCP tools are not available, stop and tell the user to enable the spatial-views MCP server (and to check the WSL form on Windows). Do not write your own MCP client or call the CLI directly.
|
|
9
|
+
|
|
10
|
+
## Start: pick the project
|
|
11
|
+
1. `list_projects`, then `use_project` with the project's name. If it isn't listed, or you can't tell which one is meant, stop and ask (a new project starts with `pre-audit`).
|
|
12
|
+
2. Every tool now works on that project only, and reads only its sources (`list_sources`). A path outside them is refused: don't look for another way in, ask for the folder to be added with `add_source`.
|
|
13
|
+
|
|
14
|
+
Build the picture of the system with the `spatial-views` MCP tools. People see it live on the canvas (`npx spatial-views`).
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
1. `list_views`. If Views exist, `get_view` the top one (the System Overview) first and update it rather than starting again.
|
|
18
|
+
2. Read the project's sources: `scan_source` each one for the top-level folders, the entry points, `openspec/project.md` and `openspec/specs/*/spec.md` when OpenSpec is used, and the docs.
|
|
19
|
+
3. **System Overview**: the project's high-level View (`create_view` with `type: "high-level"` only if there is none). Add one module per deployable part or major component (`add_module`, with a one-line `description`), then `connect` them with short labels for what flows (`https`, `events`, `reads`).
|
|
20
|
+
4. **Drill down** only where it helps: `create_view` with `from_module` makes a sub-view linked from that module. Keep each View to 3 to 9 modules.
|
|
21
|
+
5. **File pointers**: `add_file_pointer` for each module's main source folder or file: `<source_id>:<path>` (repo-relative in a single-repo project).
|
|
22
|
+
6. **Pin what exists**: for each OpenSpec spec, `pin` it to the module(s) it describes (`<source_id>:openspec/specs/<capability>/spec.md`). Pin PRDs, MDDs and Feature docs to the View, module or Feature they cover. Never edit the docs.
|
|
23
|
+
7. In a single-repo project, `import_docs` on `docs/` (and `openspec/`) lists everything; pass `draft_views: true` only if asked to turn Mermaid flowcharts into draft Views.
|
|
24
|
+
8. `open_view` the top View, and report: the Views drawn, which specs went on which modules, and anything left unpinned.
|
|
25
|
+
|
|
26
|
+
## Drawing rules (draw it as an architect would)
|
|
27
|
+
- **Top down.** Frontend at the top, then the gateway and the API, then the services side by side, then workers and queues, and the data stores at the bottom. Externals (payments, email, someone else's API) go to the side. The `type` says where a module goes (each type has a `tier` in `list_types`), so give every module the type that fits and the layout puts it in its row.
|
|
28
|
+
- **One module per real deployable or store**: a frontend, a service you deploy, a database, a queue, an external service. Not a folder, a class or a library.
|
|
29
|
+
- **Short labels**: a module name of one to three words ("Pricing", "Orders DB"), a connection label of a word or two (`https`, `/prices`, `order.created`).
|
|
30
|
+
- **No more than about 9 modules on a View.** When there are more, group them and drill into Sub Views (`create_view` with `from_module`) instead.
|
|
31
|
+
- Leave out `x` and `y` on `add_module`: the layout places each module as you draw (top down, by tier, orthogonal lines that leave from the bottom and enter from the top). On a View a person has arranged, only what you add is placed. Call `layout_view` only when a person asks to tidy a View.
|
|
32
|
+
|
|
33
|
+
## Rules
|
|
34
|
+
- **Types**: `list_toolboxes` once (Software, Cloud, AWS, Azure, Docs, and any of the user's or the project's), then `list_types` for the toolboxes that fit the system (`toolbox: aws` for an AWS system) and give each module the `type` that fits (Service, API, Database, Queue, Worker, Gateway..., or aws-lambda, azure-functions...) and fill in the properties you know. A doc for a module (PRD, SDD, MDD, Feature doc, ADR, Runbook, Plain doc) is `create_doc` with its doc type, which pins it there. If none fits, say so; only `create_type` or `create_toolbox` when a person asks.
|
|
35
|
+
- Names a person would use, not file names.
|
|
36
|
+
- Don't invent parts that aren't in the code or the docs; say what you could not place.
|
|
37
|
+
- OpenSpec stays OpenSpec: read `openspec/`, never rewrite it.
|
|
38
|
+
- **Approvals**: a new project, and a View or Doc you make that no person has approved yet, take your writes directly. Only a change to approved content waits, as a draft of that View or Doc: the reply says "pending in Approvals" and where it stands, e.g. "amended pending approval #12 (3 revisions, from v4)", and nothing is live yet. A later write to the same View or Doc amends that same draft (a new revision), so keep working; there is nothing to send. When you are done, tell the person what is waiting in their words ("amended pending approval #12"), and check `get_approval` later for the outcome (approved, approved in part or denied, with any note). If nothing changed, nothing waits.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Check the build against the spec - list every requirement in the pinned specs and docs, find evidence for each (a file, test or View) or mark it missing, and write audit-report.md with a coverage figure pinned to the System Overview. Use for \"post-audit <project>\" or \"did we build what the specs say?\"."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# post-audit
|
|
7
|
+
|
|
8
|
+
> If the spatial-views MCP tools are not available, stop and tell the user to enable the spatial-views MCP server (and to check the WSL form on Windows). Do not write your own MCP client or call the CLI directly.
|
|
9
|
+
|
|
10
|
+
## Start: pick the project
|
|
11
|
+
1. `list_projects`, then `use_project` with the project's name. If it isn't listed, or you can't tell which one is meant, stop and ask (a new project starts with `pre-audit`).
|
|
12
|
+
2. Every tool now works on that project only, and reads only its sources (`list_sources`). A path outside them is refused: don't look for another way in, ask for the folder to be added with `add_source`.
|
|
13
|
+
|
|
14
|
+
`post-audit <project>`: did we build what the specs say?
|
|
15
|
+
|
|
16
|
+
Use the `spatial-views` MCP tools. The sources are only read.
|
|
17
|
+
|
|
18
|
+
## Spec format
|
|
19
|
+
Call `get_project` once and read its spec_format (Settings → Project → Spec format). Read and write specs in that format only:
|
|
20
|
+
- **spatial-views**: the specs are PRD, MDD and Gap docs (`specs/prd/`, `specs/mdd/`, `specs/gaps/`). A Gap here is a doc: title, intent, modules, acceptance.
|
|
21
|
+
- **openspec**: the specs are `openspec/specs/<capability>/spec.md`, and proposed work is a change in `openspec/changes/<id>/` (`proposal.md`, `tasks.md`, delta specs under `specs/`). Don't write PRD, MDD or Gap docs.
|
|
22
|
+
|
|
23
|
+
## Steps
|
|
24
|
+
1. `get_project`, `list_sources` and `list_pins`. The pinned specs and docs are what you audit against.
|
|
25
|
+
2. **Requirements.** Read each pinned spec and doc: OpenSpec requirements, PRD and SDD statements, PBI acceptance criteria, and documented endpoints, queues and flows. List each requirement once, with an id (for example `R1`) and where it is stated (`<source_id>:<path>` and the heading or line).
|
|
26
|
+
3. **Evidence.** For each requirement, look for evidence:
|
|
27
|
+
- **file**: the code that does it (`scan_source` routes, queues and DB use, then the file and line);
|
|
28
|
+
- **test**: a test that checks it;
|
|
29
|
+
- **View**: the module, connection or sequence message that shows it.
|
|
30
|
+
Mark each requirement **met** (evidence found), **partial** (some of it, and say what's missing) or **missing**. A requirement is never met without evidence.
|
|
31
|
+
4. **Coverage.** Coverage is met / total, as a percentage. Count partial as not met, and give its count separately.
|
|
32
|
+
5. **Report.** `save_report`, named `audit-report`:
|
|
33
|
+
- a header line: the date, the project, and coverage `N% (met/total)`, with partial and missing counts;
|
|
34
|
+
- a table: id, requirement, where it is stated, status, evidence;
|
|
35
|
+
- a list of the misses.
|
|
36
|
+
It is pinned to the System Overview.
|
|
37
|
+
6. **Record.** `record_audit` with `kind: "post-audit"` and `report: "audit-report"`.
|
|
38
|
+
7. Report the coverage figure and the misses.
|
|
39
|
+
|
|
40
|
+
## Rules
|
|
41
|
+
- Quote requirements as they are written. Don't reword them to fit the code.
|
|
42
|
+
- Every "met" cites a file and line, a test, or a View.
|
|
43
|
+
- Never fix code in an audit. Report the miss.
|
|
44
|
+
- Never write to a source.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "In one go, create the project (if missing) from one or more repos and doc folders, and draw it - the System Overview (one module per repo, connected), a Sub View for each - and pin each doc to the module it describes. Nothing else. Use for \"pre-audit <project> <path...>\" on an empty or new project."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# pre-audit
|
|
7
|
+
|
|
8
|
+
> If the spatial-views MCP tools are not available, stop and tell the user to enable the spatial-views MCP server (and to check the WSL form on Windows). Do not write your own MCP client or call the CLI directly.
|
|
9
|
+
|
|
10
|
+
`pre-audit <project> <path> [<path> ...]`. One path is enough: `pre-audit XYZ c:\git\1`. Several work too: `pre-audit payments c:\git\api c:\git\web c:\git\worker c:\git\docs c:\git\diagrams`.
|
|
11
|
+
|
|
12
|
+
This one command does it all. The user never has to say "create the project", "create the System Overview" or "add the repos": do each of those yourself, in order, without asking.
|
|
13
|
+
|
|
14
|
+
Use the `spatial-views` MCP tools. The sources are only read: never write, move or reformat anything in them. Everything you make goes in the project's own folder (`~/SpatialViews/projects/<slug>/`).
|
|
15
|
+
|
|
16
|
+
## Start: the project
|
|
17
|
+
1. `list_projects`. If `<project>` is there, `use_project` it. If not, `create_project` with that name: the System Overview is made with it, and it becomes the active project.
|
|
18
|
+
2. Every tool now works on that project only, and reads only the folders you add. Nothing else on disk is read, even if it sits next to them.
|
|
19
|
+
3. Before you change a View that already has modules, `name_version` it with `name: "before pre-audit"`, so a person can preview and restore it from History.
|
|
20
|
+
|
|
21
|
+
## Spec format
|
|
22
|
+
Call `get_project` once and read its spec_format (Settings → Project → Spec format). Read and write specs in that format only:
|
|
23
|
+
- **spatial-views**: the specs are PRD, MDD and Gap docs (`specs/prd/`, `specs/mdd/`, `specs/gaps/`). A Gap here is a doc: title, intent, modules, acceptance.
|
|
24
|
+
- **openspec**: the specs are `openspec/specs/<capability>/spec.md`, and proposed work is a change in `openspec/changes/<id>/` (`proposal.md`, `tasks.md`, delta specs under `specs/`). Don't write PRD, MDD or Gap docs.
|
|
25
|
+
|
|
26
|
+
## Steps
|
|
27
|
+
1. **Sources.** For each path given, `add_source` with the full path. It is a repo if it has `.git`, else docs. Pass `kind` when the folder name doesn't say which. Paths can be Windows or POSIX. Each repo gets a module on the System Overview. If no path was given and the project has no sources, ask for one path, then go on.
|
|
28
|
+
2. **Read.** `scan_source` on each source. Repos: the parts, entry points, HTTP routes, queues, stores, and how the repos call each other. Docs: read each PRD and SDD (and any other `.md`): which part of the system it is about.
|
|
29
|
+
3. **System Overview.** It already has one module per repo. `list_types` once, then `update_module` each repo module: the name a person would use ("Pricing", not `pricing-svc`), its `type` and a one-line `description`. `connect` the modules that call each other, with short labels (`https`, `/products`, `products.changed`). Keep the System Overview to the repos and the connections between them.
|
|
30
|
+
4. **Sub Views.** For each repo module, `create_view` with `type: "sub-view"` and `from_module` set to it, named after it. Add its main parts with `add_module` (3 to 6 modules, each with its `type` and the properties you know), `connect` them with short labels, and `add_file_pointer` on each (`<source_id>:<path>`).
|
|
31
|
+
5. **Pin.** `pin` each doc to the module it describes: an area's PRD and SDD go on that area's module on the System Overview (`docs:pricing/SDD.md` on Pricing). A doc about the whole system goes on the System Overview itself.
|
|
32
|
+
6. **Record.** `record_audit` with `kind: "pre-audit"`. This sets each source's last audit commit.
|
|
33
|
+
7. `open_view` the System Overview, and report in a few lines: the Views drawn, the docs pinned, and anything you could not place.
|
|
34
|
+
|
|
35
|
+
## Drawing rules (draw it as an architect would)
|
|
36
|
+
- **Top down.** Frontend at the top, then the gateway and the API, then the services side by side, then workers and queues, and the data stores at the bottom. Externals (payments, email, someone else's API) go to the side. The `type` says where a module goes (each type has a `tier` in `list_types`), so give every module the type that fits and the layout puts it in its row.
|
|
37
|
+
- **One module per real deployable or store**: a frontend, a service you deploy, a database, a queue, an external service. Not a folder, a class or a library.
|
|
38
|
+
- **Short labels**: a module name of one to three words ("Pricing", "Orders DB"), a connection label of a word or two (`https`, `/prices`, `order.created`).
|
|
39
|
+
- **No more than about 9 modules on a View.** When there are more, group them and drill into Sub Views (`create_view` with `from_module`) instead.
|
|
40
|
+
- Leave out `x` and `y` on `add_module`: the layout places each module as you draw (top down, by tier, orthogonal lines that leave from the bottom and enter from the top). On a View a person has arranged, only what you add is placed. Call `layout_view` only when a person asks to tidy a View.
|
|
41
|
+
|
|
42
|
+
## Rules
|
|
43
|
+
- **Types**: `list_toolboxes` once (Software, Cloud, AWS, Azure, Docs, and any of the user's or the project's), then `list_types` for the toolboxes that fit the system (`toolbox: aws` for an AWS system) and give each module the `type` that fits (Service, API, Database, Queue, Worker, Gateway..., or aws-lambda, azure-functions...) and fill in the properties you know. A doc for a module (PRD, SDD, MDD, Feature doc, ADR, Runbook, Plain doc) is `create_doc` with its doc type, which pins it there. If none fits, say so; only `create_type` or `create_toolbox` when a person asks.
|
|
44
|
+
- Draw only what the code, docs or diagrams show. If you infer something, say so in the module's `description`.
|
|
45
|
+
- Use names a person would use, not file names. Keep each Sub View to 3 to 6 modules.
|
|
46
|
+
- Never write to a source.
|
|
47
|
+
- Read only the project's sources. If a flow leads to a folder that isn't one, say so; don't read it.
|
|
48
|
+
- Draw and pin, nothing else: no reports, no sequence Views, no changes for drift. If the docs and the code disagree, say so in your report; a person decides which is right.
|
|
49
|
+
- **Approvals**: a new project, and a View or Doc you make that no person has approved yet, take your writes directly. Only a change to approved content waits, as a draft of that View or Doc: the reply says "pending in Approvals" and where it stands, e.g. "amended pending approval #12 (3 revisions, from v4)", and nothing is live yet. A later write to the same View or Doc amends that same draft (a new revision), so keep working; there is nothing to send. When you are done, tell the person what is waiting in their words ("amended pending approval #12"), and check `get_approval` later for the outcome (approved, approved in part or denied, with any note). If nothing changed, nothing waits.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Keep a Spatial Views project true - re-read only what changed in each source since its last audit, update the Views and file pointers, and write a short changes report. Use for \"update-state <project>\" (no paths needed; the project knows its sources)."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# update-state
|
|
7
|
+
|
|
8
|
+
> If the spatial-views MCP tools are not available, stop and tell the user to enable the spatial-views MCP server (and to check the WSL form on Windows). Do not write your own MCP client or call the CLI directly.
|
|
9
|
+
|
|
10
|
+
## Start: pick the project
|
|
11
|
+
1. `list_projects`, then `use_project` with the project's name. If it isn't listed, or you can't tell which one is meant, stop and ask (a new project starts with `pre-audit`).
|
|
12
|
+
2. Every tool now works on that project only, and reads only its sources (`list_sources`). A path outside them is refused: don't look for another way in, ask for the folder to be added with `add_source`.
|
|
13
|
+
|
|
14
|
+
`update-state <project>`. You don't need any paths: the project knows its sources.
|
|
15
|
+
|
|
16
|
+
Use the `spatial-views` MCP tools. The sources are only read.
|
|
17
|
+
|
|
18
|
+
## Spec format
|
|
19
|
+
Call `get_project` once and read its spec_format (Settings → Project → Spec format). Read and write specs in that format only:
|
|
20
|
+
- **spatial-views**: the specs are PRD, MDD and Gap docs (`specs/prd/`, `specs/mdd/`, `specs/gaps/`). A Gap here is a doc: title, intent, modules, acceptance.
|
|
21
|
+
- **openspec**: the specs are `openspec/specs/<capability>/spec.md`, and proposed work is a change in `openspec/changes/<id>/` (`proposal.md`, `tasks.md`, delta specs under `specs/`). Don't write PRD, MDD or Gap docs.
|
|
22
|
+
|
|
23
|
+
## Steps
|
|
24
|
+
1. `get_project` and `list_sources`. Note each source's `last_audit_sha`.
|
|
25
|
+
2. **What changed.** For a repo, list the files changed since its `last_audit_sha`, with a read-only git command run in the source (`git diff --name-status <sha> HEAD`, plus `git status --porcelain` for uncommitted work). For a docs or diagrams folder, which isn't a git repo, `last_audit_sha` is a time: take the files whose mtime is later. If a source has no `last_audit_sha`, run `pre-audit` instead.
|
|
26
|
+
3. **Re-read.** `scan_source` on each changed source, and read the changed files themselves. Leave alone anything that hasn't changed.
|
|
27
|
+
4. **Update the picture.**
|
|
28
|
+
- `list_views` and `get_view` the Views that hold the changed files (look for their file pointers).
|
|
29
|
+
- Add, rename or remove modules (`add_module`, `update_module`, `remove`), and connections and messages (`connect`, `add_message`), keeping to the drawing rules below. A new module gets its `type` (`list_types`). Fix the file pointers (`add_file_pointer`, as `<source_id>:<path>`).
|
|
30
|
+
- Re-`pin` new or moved docs.
|
|
31
|
+
5. **Report.** `save_report`, named `changes-<yyyy-mm-dd>`: for each source, what changed, then the Views updated and any new place where the docs and the code disagree. Keep it short. If nothing changed, don't write a report.
|
|
32
|
+
6. **Record.** `record_audit` with `kind: "update-state"`, `report` set to that report, and `sources` set to the sources you re-read.
|
|
33
|
+
7. Report the same summary back in a few lines, and `open_view` the View that changed most.
|
|
34
|
+
|
|
35
|
+
## Drawing rules (draw it as an architect would)
|
|
36
|
+
- **Top down.** Frontend at the top, then the gateway and the API, then the services side by side, then workers and queues, and the data stores at the bottom. Externals (payments, email, someone else's API) go to the side. The `type` says where a module goes (each type has a `tier` in `list_types`), so give every module the type that fits and the layout puts it in its row.
|
|
37
|
+
- **One module per real deployable or store**: a frontend, a service you deploy, a database, a queue, an external service. Not a folder, a class or a library.
|
|
38
|
+
- **Short labels**: a module name of one to three words ("Pricing", "Orders DB"), a connection label of a word or two (`https`, `/prices`, `order.created`).
|
|
39
|
+
- **No more than about 9 modules on a View.** When there are more, group them and drill into Sub Views (`create_view` with `from_module`) instead.
|
|
40
|
+
- Leave out `x` and `y` on `add_module`: the layout places each module as you draw (top down, by tier, orthogonal lines that leave from the bottom and enter from the top). On a View a person has arranged, only what you add is placed. Call `layout_view` only when a person asks to tidy a View.
|
|
41
|
+
|
|
42
|
+
## Rules
|
|
43
|
+
- Change only what changed. Don't redraw Views that are still true.
|
|
44
|
+
- Never write to a source. The git commands are read-only: no checkout, no fetch, no stash.
|
|
45
|
+
- **Approvals**: a new project, and a View or Doc you make that no person has approved yet, take your writes directly. Only a change to approved content waits, as a draft of that View or Doc: the reply says "pending in Approvals" and where it stands, e.g. "amended pending approval #12 (3 revisions, from v4)", and nothing is live yet. A later write to the same View or Doc amends that same draft (a new revision), so keep working; there is nothing to send. When you are done, tell the person what is waiting in their words ("amended pending approval #12"), and check `get_approval` later for the outcome (approved, approved in part or denied, with any note). If nothing changed, nothing waits.
|