dreamteamer 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +16 -0
  3. package/README.md +83 -0
  4. package/agents/dreamteamer.agent.md +7 -0
  5. package/bin/dreamteamer.js +65 -0
  6. package/collection-templates/docs.collection-template.yaml +14 -0
  7. package/collection-templates/entity.collection-template.yaml +16 -0
  8. package/collections/agents.collection.yaml +33 -0
  9. package/collections/collection-templates.collection.yaml +20 -0
  10. package/collections/collections.collection.yaml +78 -0
  11. package/collections/command-bindings.collection.yaml +46 -0
  12. package/collections/commands.collection.yaml +36 -0
  13. package/collections/repos.collection.yaml +42 -0
  14. package/collections/skills.collection.yaml +22 -0
  15. package/collections/ui-views.collection.yaml +48 -0
  16. package/collections/users.collection.yaml +21 -0
  17. package/package.json +58 -0
  18. package/skills/building-dreamteamer/SKILL.md +117 -0
  19. package/skills/building-dreamteamer/references/agents.md +44 -0
  20. package/skills/building-dreamteamer/references/before-you-build.md +42 -0
  21. package/skills/building-dreamteamer/references/collections.md +120 -0
  22. package/skills/building-dreamteamer/references/commands.md +69 -0
  23. package/skills/building-dreamteamer/references/skills.md +73 -0
  24. package/skills/building-dreamteamer/references/ui-components.md +78 -0
  25. package/skills/building-dreamteamer/references/ui-views.md +59 -0
  26. package/skills/using-dreamteamer/SKILL.md +100 -0
  27. package/skills/using-dreamteamer/references/git-events.md +64 -0
  28. package/skills/using-dreamteamer/references/records.md +102 -0
  29. package/src/check.js +193 -0
  30. package/src/cli.js +250 -0
  31. package/src/collections-cli.js +389 -0
  32. package/src/commit.js +117 -0
  33. package/src/compile.js +747 -0
  34. package/src/events.js +124 -0
  35. package/src/field-values.js +69 -0
  36. package/src/filter.js +107 -0
  37. package/src/harnesses.js +233 -0
  38. package/src/history.js +64 -0
  39. package/src/init.js +307 -0
  40. package/src/presentation.js +190 -0
  41. package/src/record-commands.js +84 -0
  42. package/src/records.js +73 -0
  43. package/src/runtime.js +96 -0
  44. package/src/schema-ops.js +263 -0
  45. package/src/semver.js +32 -0
  46. package/src/server.js +291 -0
  47. package/src/store.js +450 -0
  48. package/src/template.js +98 -0
  49. package/src/temporal.js +149 -0
  50. package/src/workspace.js +51 -0
  51. package/src/yaml.js +6 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Gilad Khen
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,16 @@
1
+ dreamteamer
2
+ Copyright 2026 Gilad Khen
3
+
4
+ This product includes software developed by Gilad Khen.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,83 @@
1
+ # dreamteamer
2
+
3
+ A workspace compiler for coding agents. Module sources compile **explicitly** into `.dreamteamer/`,
4
+ the single runtime read surface, and from there into per-harness adapters — Claude Code, Codex, Pi,
5
+ Gemini CLI, Cursor. Data is plain files: records are `<id>.<suffix>.<ext>`, ids are paths,
6
+ references are `<collection>/<id>`. A write lands on disk; `dreamteamer commit` publishes it, one
7
+ commit per repo. Hard validation before disk; nothing hidden.
8
+
9
+ ```bash
10
+ npm i dreamteamer # engine + the `dreamteamer` bin
11
+ npx dreamteamer init # scaffold a workspace
12
+ npx dreamteamer compile # sources → .dreamteamer (+ harness adapters)
13
+ npx dreamteamer check # validate every record
14
+ npx dreamteamer help # the full command surface
15
+ ```
16
+
17
+ There is a VS Code extension — [dreamteamer-vscode](https://github.com/dreamteamer/dreamteamer-vscode) —
18
+ which loads the engine **your workspace pins**, so the editor, the CLI and any agent session are
19
+ provably running the same code.
20
+
21
+ ## Sources, and where they come from
22
+
23
+ A module contributes collections, skills, agents, commands, command-bindings, UI views and
24
+ collection templates. Modules are discovered over three channels, in precedence order: inline
25
+ `modules/*`, then `git_modules/*`, then npm dependencies. Sources live **flat at a module root** —
26
+ `modules/crm/skills/`, beside `package.json` — and an unknown folder at a module root is a compile
27
+ error rather than a silent skip.
28
+
29
+ ## Attached repos (`repos`) vs modules (`git-modules`)
30
+
31
+ Two different lifecycles, deliberately two different homes.
32
+
33
+ **Modules** are declared in the workspace's `package.json` under `dreamteamer.git-modules` and
34
+ restored by `dreamteamer install`. They MUST live in config rather than in records because of a
35
+ genuine bootstrap ordering: a fresh clone has no `.dreamteamer`, therefore no compiled schemas,
36
+ therefore no readable records — so module clones have to be restorable before anything can be read.
37
+
38
+ **Attached repos** are `repos` records under `data/repos/`. They contribute NOTHING to the
39
+ workspace — no schema, no skills, no UI. A repo record says only where a related git repo lives and
40
+ how to get it, and exists so that domain collections can reference `repos/<id>` instead of each
41
+ inventing its own url/ref/identity fields. Because they are not needed at compile time, they get to
42
+ be data — which buys hard validation, the record CLI verbs, and history for free.
43
+
44
+ Working trees are materialized **on demand**:
45
+
46
+ ```bash
47
+ dreamteamer repos ensure <id> # clone if missing, print the path; idempotent
48
+ dreamteamer repos ensure --all # explicit opt-in, e.g. before going offline
49
+ ```
50
+
51
+ `install` deliberately does not do this. The record count only grows while the fraction any given
52
+ session needs only shrinks, so eager restore would make every fresh clone slow, would require every
53
+ identity's credentials to be present at install time, and would let one unreachable remote fail the
54
+ whole install. Lazy materialization fails only the action you asked for, at the moment you asked.
55
+
56
+ Path resolution is `<repos-path>/<identity>/<name>`, where `repos-path` is a `package.json`
57
+ `dreamteamer` key defaulting to `projects`, and `identity` is optional (omit it for
58
+ `<repos-path>/<name>`). A record's `path` field overrides the derivation entirely.
59
+
60
+ **`identity` is an opaque path segment to the engine.** A workspace may use it to select a git
61
+ identity — via `~/.gitconfig` `includeIf` rules keyed on the path, for example — but that resolution
62
+ happens outside the engine, which only joins it into a path.
63
+
64
+ **A missing working tree is not a violation.** `dreamteamer check` does not and must not flag it: a
65
+ reference to `repos/<id>` resolves because the RECORD exists, and whether the clone is on disk is
66
+ irrelevant to referential integrity. Presence is reported by `dreamteamer status`.
67
+
68
+ ## Domain modules are recipes, not packages
69
+
70
+ Anything domain-shaped — people, meetings, products, content — belongs in a module, and a generic
71
+ version belongs in a recipe a workspace **copies and adapts**. They are deliberately not installable
72
+ packages: four workspaces wanted a CRM and all four wanted a different `contacts`, so an import
73
+ would force one answer and make every divergence a fork.
74
+
75
+ ## Contributing
76
+
77
+ Issues are welcome. For anything larger than a typo, please open a discussion before a pull request —
78
+ this is a small, deliberately lean codebase (`npm run metrics` enforces size budgets), and it's
79
+ better to agree on the shape first.
80
+
81
+ ## License
82
+
83
+ Apache-2.0 © 2026 Gilad Khen. See [LICENSE](LICENSE).
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: dreamteamer
3
+ description: master agent — routes a request to the right collection, skill or agent; the default operator for data-facing work
4
+ tools: [Read, Write, Edit, Grep, Glob, Bash]
5
+ skills: [skills/using-dreamteamer]
6
+ ---
7
+ classify the request (data op / schema op / authoring / capability discovery), load the matching skill, and execute or delegate. when a command dispatches you, load the skills that command names, do exactly what it asks, and report a concise summary of what you wrote — record ids, not prose.
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ // self-shadowing (decision 24, applied to the engine itself): when the workspace carries a
3
+ // git_modules/dreamteamer working clone, THAT engine runs — same npm-link semantics module
4
+ // content already gets. the npm-installed copy is bootstrap + fallback; the dev clone wins.
5
+ import fs from 'node:fs';
6
+ import path from 'node:path';
7
+ import { pathToFileURL, fileURLToPath } from 'node:url';
8
+
9
+ // path segments that mean "the thing below me is a module of the thing above me", never a
10
+ // workspace. Declared up here, not beside findDevClone: that call sits at module top level, so a
11
+ // `const` below it is still in its temporal dead zone when the walk needs it.
12
+ const MODULE_SEGMENTS = new Set(['node_modules', 'git_modules', 'modules']);
13
+
14
+ const self = fileURLToPath(import.meta.url);
15
+ const devBin = findDevClone(process.cwd());
16
+ // `realpath`, NOT `path.resolve`: resolve is pure string math and does not follow symlinks, so a
17
+ // workspace whose git_modules/dreamteamer is a SYMLINK to the engine it is already running (the
18
+ // normal shape for a dev clone, and a common shape under a repos folder) compared two spellings
19
+ // of one file, decided they differed, and re-imported itself — a circular import that never
20
+ // settles, so the process exited silently having done nothing at all. Worse than a crash: every
21
+ // command "succeeded" with no output and no effect.
22
+ if (devBin && realpath(devBin) !== realpath(self)) {
23
+ console.error(`… running the git_modules/dreamteamer dev clone (shadows the installed engine)`);
24
+ await import(pathToFileURL(devBin).href);
25
+ } else {
26
+ const { run } = await import('../src/cli.js');
27
+ run(process.argv.slice(2));
28
+ }
29
+
30
+ /** Canonical on-disk identity of a path — symlinks followed, falling back to the literal path. */
31
+ function realpath(p) {
32
+ try {
33
+ return fs.realpathSync(p);
34
+ } catch {
35
+ return path.resolve(p);
36
+ }
37
+ }
38
+
39
+ // same workspace rule as src/workspace.js (nearest package.json with a `dreamteamer` key, climbing
40
+ // out only of module nesting), duplicated here because the dev clone must be found BEFORE choosing
41
+ // which src/ to load. Keep the two in step — they must never disagree about which workspace this is.
42
+ function findDevClone(start) {
43
+ let dir = path.resolve(start);
44
+ const candidates = []; // nearest → topmost
45
+ while (true) {
46
+ const p = path.join(dir, 'package.json');
47
+ if (fs.existsSync(p)) {
48
+ try {
49
+ if ('dreamteamer' in JSON.parse(fs.readFileSync(p, 'utf8'))) candidates.push(dir);
50
+ } catch { /* unparseable — keep walking */ }
51
+ }
52
+ const parent = path.dirname(dir);
53
+ if (parent === dir) break;
54
+ dir = parent;
55
+ }
56
+ if (!candidates.length) return null;
57
+ let workspace = candidates[0];
58
+ for (const higher of candidates.slice(1)) {
59
+ const viaModule = path.relative(higher, workspace).split(path.sep).some((seg) => MODULE_SEGMENTS.has(seg));
60
+ if (!viaModule) break;
61
+ workspace = higher;
62
+ }
63
+ const bin = path.join(workspace, 'git_modules', 'dreamteamer', 'bin', 'dreamteamer.js');
64
+ return fs.existsSync(bin) ? bin : null;
65
+ }
@@ -0,0 +1,14 @@
1
+ name: docs
2
+ template:
3
+ storage: { codec: md, shape: file }
4
+ id:
5
+ generate: "{{ created | date }}--{{ title | slug }}"
6
+ pattern: "^\\d{4}-\\d{2}-\\d{2}--[a-z0-9-]+$"
7
+ schema:
8
+ type: object
9
+ required: [title]
10
+ properties:
11
+ title: { type: string }
12
+ content: { type: string, format: markdown, x-body: true }
13
+ tags: { type: array, items: { type: string } }
14
+ list_fields: [title, tags]
@@ -0,0 +1,16 @@
1
+ # entity: named things (contacts, suppliers, tools…) — id is the bare name slug,
2
+ # no date prefix (docs-style dated ids read wrong for things that ARE, not happen).
3
+ # storage is left to the template mechanism's standard defaults (data/<name>, md, file).
4
+ name: entity
5
+ template:
6
+ id:
7
+ generate: "{{ name | slug }}"
8
+ pattern: "^[a-z0-9][a-z0-9-]*$"
9
+ schema:
10
+ type: object
11
+ required: [name]
12
+ properties:
13
+ name: { type: string }
14
+ notes: { type: string, format: markdown, x-body: true }
15
+ tags: { type: array, items: { type: string } }
16
+ list_fields: [name, tags]
@@ -0,0 +1,33 @@
1
+ name: agents
2
+ storage: { path: agents, codec: md, shape: file, suffix: agent }
3
+ id: { generate: "{{ name | slug }}" }
4
+ schema:
5
+ type: object
6
+ required: [name, description]
7
+ properties:
8
+ name:
9
+ type: string
10
+ description: The agent id — must equal the filename, or dispatch misses.
11
+ description:
12
+ type: string
13
+ description: WHEN to dispatch this agent, in one line. The harness matches a request against this, so it is the agent's entire discoverability.
14
+ tools:
15
+ type: array
16
+ items: { type: string }
17
+ description: The tools this agent may use. Empty means the harness default set.
18
+ model:
19
+ type: string
20
+ description: Which model to run it on. Omit to inherit the session's.
21
+ skills:
22
+ type: array
23
+ items: { type: string, x-reference: skills }
24
+ description: Skills this agent should load. Reference them rather than restating their steps in the body.
25
+ instructions:
26
+ type: string
27
+ format: markdown
28
+ x-body: true
29
+ description: The agent's system prompt — what it is for and how it should work.
30
+ order: 30
31
+ list_fields: [name, last-modified, description]
32
+ icon: smart_toy
33
+ group: system
@@ -0,0 +1,20 @@
1
+ name: collection-templates
2
+ storage: { path: collection-templates, codec: yaml, shape: file, suffix: collection-template }
3
+ id: { generate: "{{ name | slug }}" }
4
+ schema:
5
+ type: object
6
+ required: [name, template]
7
+ properties:
8
+ name:
9
+ type: string
10
+ description: The template id. Scope it to its module (crm-provenance, not provenance) — a template id is an IDENTITY entity, so two modules shipping the same name is a compile-time collision, not a merge.
11
+ description:
12
+ type: string
13
+ description: What field set this template contributes, in one line.
14
+ template:
15
+ type: object
16
+ description: A descriptor stub merged into every collection that names it. Precedence is template < base < overlay, so a descriptor always wins on a key it declares.
17
+ order: 120
18
+ list_fields: [name, last-modified]
19
+ icon: content_copy
20
+ group: system
@@ -0,0 +1,78 @@
1
+ name: collections
2
+ storage: { path: collections, codec: yaml, shape: file, suffix: collection }
3
+ id: { generate: "{{ name | slug }}" }
4
+ schema:
5
+ type: object
6
+ required: [name, schema]
7
+ properties:
8
+ name:
9
+ type: string
10
+ description: The collection id — must equal the filename, and must be unique across every installed module.
11
+ description:
12
+ type: string
13
+ description: What kind of thing this collection holds, in one line.
14
+ title:
15
+ type: string
16
+ description: What to call this collection in the nav and page headers. DERIVED from `name` by title-casing when absent — author it only when that is wrong (`ui-views` → `UI Views`).
17
+ title_template:
18
+ type: string
19
+ description: 'How to label a RECORD of this collection, e.g. `{{ name }}`. DERIVED from the first of title/name/subject the schema declares (else `{{ id }}`). Every reference field pointing at this collection renders its value through this, so it is authored HERE once, not on each referencing field.'
20
+ extends:
21
+ type: string
22
+ description: 'The module collection this one overlays, as `<module>/<collection>`. An overlay adds or narrows fields; it never redefines storage.'
23
+ storage:
24
+ type: object
25
+ description: Where the records live on disk and how they are encoded.
26
+ properties:
27
+ path:
28
+ type: string
29
+ description: Folder holding the records, workspace-relative. `data/` for content, `state/` for operational records, `system/` for sources.
30
+ codec:
31
+ type: string
32
+ enum: [md, yaml, json]
33
+ default: md
34
+ description: File format. Use `md` whenever the record has a body a human will read.
35
+ shape:
36
+ type: string
37
+ enum: [file, folder]
38
+ default: file
39
+ description: One file per record, or one folder per record.
40
+ suffix:
41
+ type: string
42
+ description: 'The middle segment of a record filename: `<id>.<suffix>.<ext>`.'
43
+ entry:
44
+ type: string
45
+ description: Folder shapes only — the file inside the folder that IS the record (e.g. SKILL.md).
46
+ repo:
47
+ type: string
48
+ description: DERIVED by compile, never authored — the workspace-relative root of the git repo holding these records ('.' is the workspace). Set from the owning module's `owns-data`.
49
+ id:
50
+ type: object
51
+ description: How a record's id is derived and what shape it is allowed to take.
52
+ properties:
53
+ generate:
54
+ type: string
55
+ description: 'Template the id is built from, e.g. `{{ created | date }}--{{ name | slug }}`. Derive it from a field the record OWNS, never from write time.'
56
+ pattern:
57
+ type: string
58
+ description: Regex every id must match. `check` enforces it.
59
+ schema:
60
+ type: object
61
+ description: A JSON Schema for the record's fields — validated against the meta-schema, not typed here. A field's own `description:` is what every surface shows as its explanation.
62
+ order:
63
+ type: number
64
+ description: Sort position in the nav. Lower comes first.
65
+ list_fields:
66
+ type: array
67
+ items: { type: string }
68
+ description: The columns a list view shows by default.
69
+ icon:
70
+ type: string
71
+ description: material-symbols-outlined icon name, drawn in the nav and page header. The VS Code tree maps it to the nearest codicon — an unmapped name falls back to a generic cylinder, so pick one that is already mapped or add the row.
72
+ group:
73
+ type: string
74
+ description: Which nav folder this collection sits in. Ungrouped collections list at the top level; `system` is the plumbing group behind the gear.
75
+ order: 10
76
+ list_fields: [name, last-modified]
77
+ icon: schema
78
+ group: system
@@ -0,0 +1,46 @@
1
+ name: command-bindings
2
+ storage:
3
+ path: command-bindings
4
+ codec: yaml
5
+ shape: file
6
+ suffix: command-binding
7
+ id:
8
+ generate: '{{ command | basename }}--{{ collection | basename }}'
9
+ schema:
10
+ type: object
11
+ required:
12
+ - command
13
+ - collection
14
+ properties:
15
+ command:
16
+ type: string
17
+ x-reference: commands
18
+ description: The command this binding applies.
19
+ collection:
20
+ type: string
21
+ x-reference: collections
22
+ description: The collection the command applies TO — which is what makes `dt commands for <ref>` able to answer "what can I do with this record".
23
+ target:
24
+ type: string
25
+ enum:
26
+ - record
27
+ - collection
28
+ default: record
29
+ description: Whether the command runs against one record or the whole collection.
30
+ can-enter:
31
+ type: object
32
+ description: The record state that makes this command AVAILABLE — a filter over the record's own fields. This is what turns a collection into a queue without any run records.
33
+ can-exit:
34
+ type: object
35
+ description: The record state that means the command has already been DONE. Together with can-enter, the record's own fields are the progress marker.
36
+ description:
37
+ type: string
38
+ description: What applying this command to this collection does, in one line.
39
+ order: 45
40
+ list_fields:
41
+ - command
42
+ - collection
43
+ - target
44
+ - last-modified
45
+ icon: bolt
46
+ group: system
@@ -0,0 +1,36 @@
1
+ name: commands
2
+ storage: { path: commands, codec: md, shape: file, suffix: command }
3
+ id: { generate: "{{ name | slug }}" }
4
+ schema:
5
+ type: object
6
+ required: [name]
7
+ properties:
8
+ name:
9
+ type: string
10
+ description: The command id — must equal the filename, and is what the operator types after the slash.
11
+ description:
12
+ type: string
13
+ description: What this command does, in one line. It is the whole entry in the / picker, so write it for someone scanning.
14
+ # native claude-code slash-command frontmatter — compile copies commands verbatim,
15
+ # so these flow straight into .claude/commands/<name>.md and the / picker
16
+ argument-hint:
17
+ type: string
18
+ description: What arguments the command takes, shown inline in the / picker.
19
+ allowed-tools:
20
+ type: string
21
+ description: Tools this command may use, when it should be narrower than the session's.
22
+ model:
23
+ type: string
24
+ description: Which model to run it on. Omit to inherit the session's.
25
+ disable-model-invocation:
26
+ type: boolean
27
+ description: Set when only a person may run this — it stops the model invoking it on its own.
28
+ prompt:
29
+ type: string
30
+ format: markdown
31
+ x-body: true
32
+ description: The command body. Reference the skill that owns the procedure rather than restating its steps — two copies drift.
33
+ order: 40
34
+ list_fields: [name, last-modified, description]
35
+ icon: terminal
36
+ group: system