spatial-views 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +63 -2
- package/dist/app/assets/abnfDiagram-S7VZAUFO-BVgtb0Hw.js +1 -0
- package/dist/app/assets/architecture-WOLXFQ4H-DxylGHqT.js +1 -0
- package/dist/app/assets/architectureDiagram-YGSQEFNW-BrBCHqUH.js +36 -0
- package/dist/app/assets/blockDiagram-APKKGZFW-C7fb3MCE.js +140 -0
- package/dist/app/assets/bpmnIcons-APHXDYXF-C0jbCElo.js +1 -0
- package/dist/app/assets/c4Diagram-KJ2TOQU5-Bkb_0fbd.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-DU4vZ03M.js +2 -0
- package/dist/app/assets/chunk-AXFCVDMN-De96BVTB.js +62 -0
- package/dist/app/assets/chunk-BG4553SI-J33jsRLV.js +127 -0
- package/dist/app/assets/chunk-DQASFODM-Bh85SSGO.js +10 -0
- package/dist/app/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
- package/dist/app/assets/chunk-HFQBQIA3-CCklgplR.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-B04qR8ED.js +2 -0
- package/dist/app/assets/chunk-KS47KZWR-BsqDyyAt.js +1 -0
- package/dist/app/assets/chunk-LEVMRMFU-DwxrBz2u.js +1 -0
- package/dist/app/assets/chunk-M57EVK23-D9YIHjps.js +1 -0
- package/dist/app/assets/chunk-NGNAAXSQ-DI_UYJZ4.js +136 -0
- package/dist/app/assets/chunk-OY52VR5R-WB63DeTA.js +88 -0
- package/dist/app/assets/chunk-QB3YPZ4I-cHzzKdtb.js +213 -0
- package/dist/app/assets/chunk-R3KSYZAL-C7rDagaa.js +1 -0
- package/dist/app/assets/chunk-STOXU5M4-CG6pnJtH.js +72 -0
- package/dist/app/assets/chunk-TU62E6Q5-BbcGYfy_.js +1 -0
- package/dist/app/assets/chunk-X3CZISLH-FMl4PpWt.js +1 -0
- package/dist/app/assets/chunk-X4PVCEUW-BUI1Oi3q.js +1 -0
- package/dist/app/assets/chunk-XXDRQBXY-DYhK5YW-.js +1 -0
- package/dist/app/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/dist/app/assets/classDiagram-v2-L25IHNXF-K-k5GTUn.js +217 -0
- package/dist/app/assets/cose-bilkent-JH36ORCC-BJmLLpaN.js +1 -0
- package/dist/app/assets/cynefin-EF2NZ3EQ-DrzwMKdm.js +1 -0
- package/dist/app/assets/cynefinDiagram-L36ESFBY-mkV33_Xx.js +62 -0
- package/dist/app/assets/cytoscape.esm-nTrd5EVq.js +321 -0
- package/dist/app/assets/d3-scale-ygdFCUH8.js +1 -0
- package/dist/app/assets/dagre-SPEB5RXH-BNIymLsu.js +4 -0
- package/dist/app/assets/diagram-3B7GL73J-CGOiolFW.js +200 -0
- package/dist/app/assets/diagram-DNEMPZML-DZFkHNly.js +24 -0
- package/dist/app/assets/diagram-L3MUGCDN-B42GAYLq.js +41 -0
- package/dist/app/assets/diagram-LA4NIPWU-BYuLRYId.js +24 -0
- package/dist/app/assets/diagram-MHCOC4E2-DGzI6TJG.js +3 -0
- package/dist/app/assets/diagram-XPFHEONP-CTBEgDQ8.js +30 -0
- package/dist/app/assets/dist-1Q8ng3tu.js +1 -0
- package/dist/app/assets/ebnfDiagram-UZSYDL2S-GuMdOCvL.js +1 -0
- package/dist/app/assets/elk-XV6XMXQE-BpY3loT5.js +2 -0
- package/dist/app/assets/erDiagram-EYBAPDEH-nDZ2PMGl.js +99 -0
- package/dist/app/assets/eventmodeling-K75KTNOO-BN42Mgwh.js +1 -0
- package/dist/app/assets/flowDiagram-MALGAFMO-BCwwiLzb.js +1 -0
- package/dist/app/assets/ganttDiagram-23REXITY-xMRHaU3y.js +292 -0
- package/dist/app/assets/gitGraph-VSP46ZUC-DyGq5mdd.js +1 -0
- package/dist/app/assets/gitGraphDiagram-STJD7YCW-CDkKLrvO.js +106 -0
- package/dist/app/assets/graphlib-DS17s2tU.js +1 -0
- package/dist/app/assets/index-BY66fc8Q.js +95 -0
- package/dist/app/assets/index-ByetEVbs.css +1 -0
- package/dist/app/assets/info-OHQRW6UA-DOBf-fQH.js +1 -0
- package/dist/app/assets/infoDiagram-KBXO4MBG-B92P8pjY.js +2 -0
- package/dist/app/assets/ishikawaDiagram-M35NCXHK-BRZsbCvK.js +70 -0
- package/dist/app/assets/journeyDiagram-OPLOXDXO-Bppwb1oF.js +139 -0
- package/dist/app/assets/kanban-definition-BZKZHSQY-ByD_x5cm.js +89 -0
- package/dist/app/assets/katex-MEuSR36T.js +257 -0
- package/dist/app/assets/mermaid-parser.core-CKmnV0Md.js +7 -0
- package/dist/app/assets/mermaid.core-BoRvk1Q-.js +44 -0
- package/dist/app/assets/mindmap-definition-I2QAS2VK-fRbUh23C.js +98 -0
- package/dist/app/assets/packet-JDAUHWVQ-CgHq03Zj.js +1 -0
- package/dist/app/assets/pegDiagram-FD4XPPHP-qIABf6H8.js +1 -0
- package/dist/app/assets/pie-XZMESJXO-DtNh3cDE.js +1 -0
- package/dist/app/assets/pieDiagram-J4AKIIQI-Bb4RBdrc.js +39 -0
- package/dist/app/assets/quadrantDiagram-XTYBLID2-B0CpcVWE.js +7 -0
- package/dist/app/assets/radar-ABXABTNO-BS0FcsIX.js +1 -0
- package/dist/app/assets/railroad-I3PHUGI6-lO8vfGdI.js +1 -0
- package/dist/app/assets/railroad-abnf-LNEFI6M7-BUhw7Iuo.js +1 -0
- package/dist/app/assets/railroad-ebnf-DWYD2UWJ-nQNF56LJ.js +1 -0
- package/dist/app/assets/railroad-peg-JR7BVNR7-CwvbVIo6.js +1 -0
- package/dist/app/assets/railroadDiagram-MRQ6NCDL-Dwr-mPZL.js +1 -0
- package/dist/app/assets/requirementDiagram-Y7LWUY3S-Ctv2DKJM.js +84 -0
- package/dist/app/assets/rough.esm-Dy-Kn_BL.js +1 -0
- package/dist/app/assets/sankeyDiagram-WGJFYUXA-BvKX0eIe.js +40 -0
- package/dist/app/assets/sequenceDiagram-5NDRBG5M-Y4YqU2Xt.js +169 -0
- package/dist/app/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
- package/dist/app/assets/stateDiagram-v2-FJ4FJNEA-DmjIjn4u.js +291 -0
- package/dist/app/assets/swimlanes-UMQ2AFYF-B2O5JCjs.js +1 -0
- package/dist/app/assets/swimlanesDiagram-OMPLPG4O-DhCl-Cjg.js +8 -0
- package/dist/app/assets/timeline-definition-SEUHKTQE-DJJdixAI.js +120 -0
- package/dist/app/assets/treeView-D4JQ5SDB-Dd1no4eE.js +1 -0
- package/dist/app/assets/treemap-SAJKECNS-t6wtsaki.js +1 -0
- package/dist/app/assets/usecaseDiagram-AFA6YXN4-Bp8pXgvR.js +328 -0
- package/dist/app/assets/vennDiagram-NNMJR3RB-DYSfZMWT.js +34 -0
- package/dist/app/assets/wardley-7MLQ67FV-Bx60QTuu.js +1 -0
- package/dist/app/assets/wardleyDiagram-S7YFUSEH-CGJ8qg76.js +78 -0
- package/dist/app/assets/xychartDiagram-GGNKY7IX-CRSvraFc.js +7 -0
- package/dist/app/index.html +13 -0
- package/dist/cli/index.js +110 -0
- package/dist/core/api.js +209 -0
- package/dist/core/context.js +194 -0
- package/dist/core/docs.js +134 -0
- package/dist/core/edit.js +105 -0
- package/dist/core/errors.js +3 -0
- package/dist/core/gaps.js +114 -0
- package/dist/core/history.js +19 -0
- package/dist/core/links.js +68 -0
- package/dist/core/mermaid.js +175 -0
- package/dist/core/openspec.js +120 -0
- package/dist/core/paths.js +23 -0
- package/dist/core/resolve.js +35 -0
- package/dist/core/schema.js +101 -0
- package/dist/core/skills.js +103 -0
- package/dist/core/storage.js +183 -0
- package/dist/core/version.js +1 -0
- package/dist/core/watch.js +136 -0
- package/dist/core/xml.js +50 -0
- package/dist/mcp/server.js +357 -0
- package/package.json +53 -4
- package/schema/gap.schema.json +53 -0
- package/schema/pins.schema.json +122 -0
- package/schema/view.schema.json +134 -0
- package/skills/claude/build-gap/SKILL.md +21 -0
- package/skills/claude/draw-system/SKILL.md +23 -0
- package/skills/claude/gap-from-view/SKILL.md +22 -0
- package/skills/cursor/build-gap.mdc +21 -0
- package/skills/cursor/draw-system.mdc +23 -0
- package/skills/cursor/gap-from-view.mdc +22 -0
- package/skills/windsurf/spatial-views.md +66 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/Hotchilli-Cloud/spatial-views/main/schema/view.schema.json",
|
|
4
|
+
"title": "Spatial Views: a View (.spatial/views/<id>.json)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"id": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
10
|
+
},
|
|
11
|
+
"name": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"type": {
|
|
15
|
+
"default": "sub-view",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": [
|
|
18
|
+
"high-level",
|
|
19
|
+
"repo",
|
|
20
|
+
"sub-view",
|
|
21
|
+
"feature"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"modules": {
|
|
25
|
+
"default": [],
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"id": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1
|
|
33
|
+
},
|
|
34
|
+
"name": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"x": {
|
|
38
|
+
"default": 0,
|
|
39
|
+
"type": "number"
|
|
40
|
+
},
|
|
41
|
+
"y": {
|
|
42
|
+
"default": 0,
|
|
43
|
+
"type": "number"
|
|
44
|
+
},
|
|
45
|
+
"description": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
"linked_view_id": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"minLength": 1
|
|
51
|
+
},
|
|
52
|
+
"files": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"items": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"minLength": 1
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"required": [
|
|
61
|
+
"id",
|
|
62
|
+
"name"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"connections": {
|
|
67
|
+
"default": [],
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"id": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"minLength": 1
|
|
75
|
+
},
|
|
76
|
+
"from": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"minLength": 1
|
|
79
|
+
},
|
|
80
|
+
"to": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"minLength": 1
|
|
83
|
+
},
|
|
84
|
+
"label": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"required": [
|
|
89
|
+
"id",
|
|
90
|
+
"from",
|
|
91
|
+
"to"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"features": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"properties": {
|
|
100
|
+
"id": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
103
|
+
},
|
|
104
|
+
"name": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"minLength": 1
|
|
107
|
+
},
|
|
108
|
+
"module_ids": {
|
|
109
|
+
"default": [],
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"minLength": 1
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"required": [
|
|
118
|
+
"id",
|
|
119
|
+
"name"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"draft": {
|
|
124
|
+
"type": "boolean"
|
|
125
|
+
},
|
|
126
|
+
"source": {
|
|
127
|
+
"type": "string"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": [
|
|
131
|
+
"id",
|
|
132
|
+
"name"
|
|
133
|
+
]
|
|
134
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build-gap
|
|
3
|
+
description: Build a Gap from its Spatial Views context - get_context first, build only inside the scope, then archive the OpenSpec change, update the View and close the Gap. Use when asked to build, implement or apply a Gap.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# build-gap
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
1. **Context first**: `get_context` with the Gap id (XML by default). It holds the Big Picture, the path down to the Gap's View, the Gap's modules with their connections and files, and the text of every pinned spec, change and doc. Read all of it before touching code. Note the token count.
|
|
10
|
+
2. **Plan** from the change's `tasks.md` (or the Gap's intent). `update_gap` with `state: "building"`.
|
|
11
|
+
3. **Build** inside the scope: the Gap's modules and their files. A connection marked `Outside="true"` is a contract with a module outside the Gap; keep it. Tick tasks in `tasks.md` as they are done.
|
|
12
|
+
4. **Test** what you built.
|
|
13
|
+
5. **Archive** the change with OpenSpec (its archive command, or `openspec archive <id>` on the CLI), which folds the delta specs into `openspec/specs/`.
|
|
14
|
+
6. **Update the picture**: `add_file_pointer` for new files; `add_module` / `connect` / `update_module` if the architecture changed; `pin` any new spec to its module.
|
|
15
|
+
7. **Close**: `list_gaps` shows the Gap as done once the change is archived (or `update_gap` with `state: "done"` when there is no change). The module's history now shows the change.
|
|
16
|
+
8. Report what changed, the files, and the tests.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
- Never build from memory of the repo: build from `get_context`.
|
|
20
|
+
- Don't widen the scope silently. If the work needs another module, stop and update the Gap.
|
|
21
|
+
- Don't mark a Gap done while its tasks or tests are failing.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: draw-system
|
|
3
|
+
description: Draw (or update) this repo'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 .spatial/ has no Views yet.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# draw-system
|
|
7
|
+
|
|
8
|
+
Build the picture of the system with the `spatial-views` MCP tools. People see it live on the canvas (`npx spatial-views`).
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
1. `list_views`. If Views exist, `get_view` the top one first and update it rather than starting again.
|
|
12
|
+
2. Read the repo: the top-level folders, the entry points, `openspec/project.md` and `openspec/specs/*/spec.md` when OpenSpec is used, and `docs/`.
|
|
13
|
+
3. **High Level**: `create_view` with `type: "high-level"`. 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`).
|
|
14
|
+
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–12 modules.
|
|
15
|
+
5. **File pointers**: `add_file_pointer` for each module's main source folder or file.
|
|
16
|
+
6. **Pin what exists**: for each OpenSpec spec, `pin` it to the module(s) it describes (`openspec/specs/<capability>/spec.md`). Pin PRDs, MDDs and Feature docs to the View, module or Feature they cover. Never edit the docs.
|
|
17
|
+
7. `import_docs` on `docs/` (and `openspec/`) to list everything; pass `draft_views: true` only if asked to turn Mermaid flowcharts into draft Views.
|
|
18
|
+
8. `open_view` the top View, and report: the Views drawn, which specs went on which modules, and anything left unpinned.
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
- Names a person would use, not file names. One module per real boundary.
|
|
22
|
+
- Don't invent parts that aren't in the code or the docs; say what you could not place.
|
|
23
|
+
- OpenSpec stays OpenSpec: read `openspec/`, never rewrite it.
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
A Gap is one outcome, scoped to the modules it touches. The scope is what keeps the build from guessing.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
1. **Think**: restate what is wanted and why in one or two sentences (this becomes the intent).
|
|
12
|
+
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.
|
|
13
|
+
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.
|
|
14
|
+
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.
|
|
15
|
+
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>`).
|
|
16
|
+
6. **Pin** any other doc the work needs to the Gap (`pin` with `gap`).
|
|
17
|
+
7. Report the Gap id, its modules, and the change path.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
- One Gap, one outcome. Split a request that has two.
|
|
21
|
+
- No modules outside the selection. If the change needs more, say so and update the Gap (`update_gap` with `modules`).
|
|
22
|
+
- Without OpenSpec, the Gap file is the plan: put the detail in `intent`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Build a Gap from its Spatial Views context - get_context first, build only inside the scope, then archive the OpenSpec change, update the View and close the Gap. Use when asked to build, implement or apply a Gap."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# build-gap
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
1. **Context first**: `get_context` with the Gap id (XML by default). It holds the Big Picture, the path down to the Gap's View, the Gap's modules with their connections and files, and the text of every pinned spec, change and doc. Read all of it before touching code. Note the token count.
|
|
10
|
+
2. **Plan** from the change's `tasks.md` (or the Gap's intent). `update_gap` with `state: "building"`.
|
|
11
|
+
3. **Build** inside the scope: the Gap's modules and their files. A connection marked `Outside="true"` is a contract with a module outside the Gap; keep it. Tick tasks in `tasks.md` as they are done.
|
|
12
|
+
4. **Test** what you built.
|
|
13
|
+
5. **Archive** the change with OpenSpec (its archive command, or `openspec archive <id>` on the CLI), which folds the delta specs into `openspec/specs/`.
|
|
14
|
+
6. **Update the picture**: `add_file_pointer` for new files; `add_module` / `connect` / `update_module` if the architecture changed; `pin` any new spec to its module.
|
|
15
|
+
7. **Close**: `list_gaps` shows the Gap as done once the change is archived (or `update_gap` with `state: "done"` when there is no change). The module's history now shows the change.
|
|
16
|
+
8. Report what changed, the files, and the tests.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
- Never build from memory of the repo: build from `get_context`.
|
|
20
|
+
- Don't widen the scope silently. If the work needs another module, stop and update the Gap.
|
|
21
|
+
- Don't mark a Gap done while its tasks or tests are failing.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Draw (or update) this repo'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 .spatial/ has no Views yet."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# draw-system
|
|
7
|
+
|
|
8
|
+
Build the picture of the system with the `spatial-views` MCP tools. People see it live on the canvas (`npx spatial-views`).
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
1. `list_views`. If Views exist, `get_view` the top one first and update it rather than starting again.
|
|
12
|
+
2. Read the repo: the top-level folders, the entry points, `openspec/project.md` and `openspec/specs/*/spec.md` when OpenSpec is used, and `docs/`.
|
|
13
|
+
3. **High Level**: `create_view` with `type: "high-level"`. 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`).
|
|
14
|
+
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–12 modules.
|
|
15
|
+
5. **File pointers**: `add_file_pointer` for each module's main source folder or file.
|
|
16
|
+
6. **Pin what exists**: for each OpenSpec spec, `pin` it to the module(s) it describes (`openspec/specs/<capability>/spec.md`). Pin PRDs, MDDs and Feature docs to the View, module or Feature they cover. Never edit the docs.
|
|
17
|
+
7. `import_docs` on `docs/` (and `openspec/`) to list everything; pass `draft_views: true` only if asked to turn Mermaid flowcharts into draft Views.
|
|
18
|
+
8. `open_view` the top View, and report: the Views drawn, which specs went on which modules, and anything left unpinned.
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
- Names a person would use, not file names. One module per real boundary.
|
|
22
|
+
- Don't invent parts that aren't in the code or the docs; say what you could not place.
|
|
23
|
+
- OpenSpec stays OpenSpec: read `openspec/`, never rewrite it.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
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."
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# gap-from-view
|
|
7
|
+
|
|
8
|
+
A Gap is one outcome, scoped to the modules it touches. The scope is what keeps the build from guessing.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
1. **Think**: restate what is wanted and why in one or two sentences (this becomes the intent).
|
|
12
|
+
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.
|
|
13
|
+
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.
|
|
14
|
+
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.
|
|
15
|
+
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>`).
|
|
16
|
+
6. **Pin** any other doc the work needs to the Gap (`pin` with `gap`).
|
|
17
|
+
7. Report the Gap id, its modules, and the change path.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
- One Gap, one outcome. Split a request that has two.
|
|
21
|
+
- No modules outside the selection. If the change needs more, say so and update the Gap (`update_gap` with `modules`).
|
|
22
|
+
- Without OpenSpec, the Gap file is the plan: put the detail in `intent`.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: model_decision
|
|
3
|
+
description: "Spatial Views: draw the system as Views (draw-system), scope a change as a Gap (gap-from-view), and build a Gap from get_context (build-gap). Use for architecture, Gaps, OpenSpec changes and get_context."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Spatial Views skills
|
|
7
|
+
|
|
8
|
+
Use the `spatial-views` MCP tools. Pick the skill that fits:
|
|
9
|
+
|
|
10
|
+
- **draw-system**: Draw (or update) this repo'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 .spatial/ has no Views yet.
|
|
11
|
+
- **gap-from-view**: 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.
|
|
12
|
+
- **build-gap**: Build a Gap from its Spatial Views context - get_context first, build only inside the scope, then archive the OpenSpec change, update the View and close the Gap. Use when asked to build, implement or apply a Gap.
|
|
13
|
+
|
|
14
|
+
## draw-system
|
|
15
|
+
|
|
16
|
+
Build the picture of the system with the `spatial-views` MCP tools. People see it live on the canvas (`npx spatial-views`).
|
|
17
|
+
|
|
18
|
+
### Steps
|
|
19
|
+
1. `list_views`. If Views exist, `get_view` the top one first and update it rather than starting again.
|
|
20
|
+
2. Read the repo: the top-level folders, the entry points, `openspec/project.md` and `openspec/specs/*/spec.md` when OpenSpec is used, and `docs/`.
|
|
21
|
+
3. **High Level**: `create_view` with `type: "high-level"`. 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`).
|
|
22
|
+
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–12 modules.
|
|
23
|
+
5. **File pointers**: `add_file_pointer` for each module's main source folder or file.
|
|
24
|
+
6. **Pin what exists**: for each OpenSpec spec, `pin` it to the module(s) it describes (`openspec/specs/<capability>/spec.md`). Pin PRDs, MDDs and Feature docs to the View, module or Feature they cover. Never edit the docs.
|
|
25
|
+
7. `import_docs` on `docs/` (and `openspec/`) to list everything; pass `draft_views: true` only if asked to turn Mermaid flowcharts into draft Views.
|
|
26
|
+
8. `open_view` the top View, and report: the Views drawn, which specs went on which modules, and anything left unpinned.
|
|
27
|
+
|
|
28
|
+
### Rules
|
|
29
|
+
- Names a person would use, not file names. One module per real boundary.
|
|
30
|
+
- Don't invent parts that aren't in the code or the docs; say what you could not place.
|
|
31
|
+
- OpenSpec stays OpenSpec: read `openspec/`, never rewrite it.
|
|
32
|
+
|
|
33
|
+
## gap-from-view
|
|
34
|
+
|
|
35
|
+
A Gap is one outcome, scoped to the modules it touches. The scope is what keeps the build from guessing.
|
|
36
|
+
|
|
37
|
+
### Steps
|
|
38
|
+
1. **Think**: restate what is wanted and why in one or two sentences (this becomes the intent).
|
|
39
|
+
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.
|
|
40
|
+
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.
|
|
41
|
+
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.
|
|
42
|
+
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>`).
|
|
43
|
+
6. **Pin** any other doc the work needs to the Gap (`pin` with `gap`).
|
|
44
|
+
7. Report the Gap id, its modules, and the change path.
|
|
45
|
+
|
|
46
|
+
### Rules
|
|
47
|
+
- One Gap, one outcome. Split a request that has two.
|
|
48
|
+
- No modules outside the selection. If the change needs more, say so and update the Gap (`update_gap` with `modules`).
|
|
49
|
+
- Without OpenSpec, the Gap file is the plan: put the detail in `intent`.
|
|
50
|
+
|
|
51
|
+
## build-gap
|
|
52
|
+
|
|
53
|
+
### Steps
|
|
54
|
+
1. **Context first**: `get_context` with the Gap id (XML by default). It holds the Big Picture, the path down to the Gap's View, the Gap's modules with their connections and files, and the text of every pinned spec, change and doc. Read all of it before touching code. Note the token count.
|
|
55
|
+
2. **Plan** from the change's `tasks.md` (or the Gap's intent). `update_gap` with `state: "building"`.
|
|
56
|
+
3. **Build** inside the scope: the Gap's modules and their files. A connection marked `Outside="true"` is a contract with a module outside the Gap; keep it. Tick tasks in `tasks.md` as they are done.
|
|
57
|
+
4. **Test** what you built.
|
|
58
|
+
5. **Archive** the change with OpenSpec (its archive command, or `openspec archive <id>` on the CLI), which folds the delta specs into `openspec/specs/`.
|
|
59
|
+
6. **Update the picture**: `add_file_pointer` for new files; `add_module` / `connect` / `update_module` if the architecture changed; `pin` any new spec to its module.
|
|
60
|
+
7. **Close**: `list_gaps` shows the Gap as done once the change is archived (or `update_gap` with `state: "done"` when there is no change). The module's history now shows the change.
|
|
61
|
+
8. Report what changed, the files, and the tests.
|
|
62
|
+
|
|
63
|
+
### Rules
|
|
64
|
+
- Never build from memory of the repo: build from `get_context`.
|
|
65
|
+
- Don't widen the scope silently. If the work needs another module, stop and update the Gap.
|
|
66
|
+
- Don't mark a Gap done while its tasks or tests are failing.
|