@digi4care/omo-slim-decision-layer 0.0.0-stage → 0.2.2
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 +96 -2
- package/dist/config.d.ts +6 -0
- package/dist/hooks/interview-inject.d.ts +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4324 -0
- package/dist/model/record.d.ts +320 -0
- package/dist/prompts/decision-discipline.d.ts +1 -0
- package/dist/register/register.d.ts +144 -0
- package/dist/schema/generate.d.ts +1 -0
- package/dist/src/config.d.ts +6 -0
- package/dist/src/hooks/interview-inject.d.ts +2 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/model/record.d.ts +320 -0
- package/dist/src/prompts/decision-discipline.d.ts +1 -0
- package/dist/src/register/register.d.ts +144 -0
- package/dist/src/schema/generate.d.ts +1 -0
- package/dist/src/tools/index.d.ts +4 -0
- package/dist/src/tools/paths.d.ts +16 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/paths.d.ts +16 -0
- package/package.json +72 -4
- package/schema/register.schema.json +381 -0
- package/skills/decision-layer/SKILL.md +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Chris Engelhard
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,97 @@
|
|
|
1
|
-
#
|
|
1
|
+
# omo-slim-decision-layer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An [OpenCode](https://opencode.ai) plugin that adds a **decision layer** to
|
|
4
|
+
AI-assisted development: a typed, git-native decision register that records the
|
|
5
|
+
*why* of a project — requirements, constraints, assumptions and decisions —
|
|
6
|
+
with the same ergonomics that [beads](https://github.com/steveyegge/beads)
|
|
7
|
+
gives work items.
|
|
8
|
+
|
|
9
|
+
Built as a companion plugin for
|
|
10
|
+
[oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim).
|
|
11
|
+
|
|
12
|
+
## What it does
|
|
13
|
+
|
|
14
|
+
- **Typed decision records** — `REQ` (requirement), `CONSTRAINT`
|
|
15
|
+
(non-negotiable), `ASSUMPTION` (unverified, with `needed_to_close`) and `DEC`
|
|
16
|
+
(decision with rejected alternatives and consequences).
|
|
17
|
+
- **Single source of truth** — one YAML register at `.decisions/register.yaml`.
|
|
18
|
+
All writes go through the plugin's tools; the generated markdown view is
|
|
19
|
+
disposable and never authoritative.
|
|
20
|
+
- **Closed vocabularies** — status is `proposed | accepted | rejected |
|
|
21
|
+
superseded`. Supersede instead of edit: history stays append-only.
|
|
22
|
+
- **Owner ratification** — agents draft records; only the owner ratifies.
|
|
23
|
+
This is a convention enforced by discipline, not by a technical gate.
|
|
24
|
+
- **Interview integration** — when oh-my-opencode-slim's `/interview` command
|
|
25
|
+
runs, the plugin injects a discipline prompt so a closed interview ends as
|
|
26
|
+
records in the register instead of loose markdown.
|
|
27
|
+
- **Traceability** — typed links (`refines`, `depends_on`, `constrains`,
|
|
28
|
+
`relates_to`) between records, with queries for orphans and reverse lookup.
|
|
29
|
+
|
|
30
|
+
## Agent tools
|
|
31
|
+
|
|
32
|
+
| Tool | Purpose |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `decision-init` | Create the register (idempotent, never overwrites) |
|
|
35
|
+
| `decision-add` | Create a record (status `proposed`) |
|
|
36
|
+
| `decision-ratify` | `proposed` → `accepted` — owner act, never self-invoked |
|
|
37
|
+
| `decision-reject` | `proposed` → `rejected` |
|
|
38
|
+
| `decision-supersede` | Replace a record, preserving history |
|
|
39
|
+
| `decision-list` | List records, filter by status/type |
|
|
40
|
+
| `decision-query` | Orphans, or "what links to this record" |
|
|
41
|
+
| `decision-validate` | Validate the register against the schema |
|
|
42
|
+
| `decision-view` | Regenerate the markdown view |
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
Add the plugin to your OpenCode config:
|
|
47
|
+
|
|
48
|
+
```jsonc
|
|
49
|
+
{
|
|
50
|
+
"plugin": ["@digi4care/omo-slim-decision-layer@latest"]
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
OpenCode installs the plugin automatically from npm on the next start. To pin
|
|
55
|
+
a version, replace `@latest` with a specific version (e.g. `@0.2.1`).
|
|
56
|
+
|
|
57
|
+
**Local development / offline use.** Every release is also packed as a plain
|
|
58
|
+
`.tgz` in the `release/` folder (semver). A named entry only works for packages
|
|
59
|
+
that exist on npm; for a local or private build, reference the built file
|
|
60
|
+
directly instead:
|
|
61
|
+
|
|
62
|
+
```jsonc
|
|
63
|
+
{
|
|
64
|
+
"plugin": ["file:///absolute/path/to/node_modules/@digi4care/omo-slim-decision-layer/dist/index.js"]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`dist/index.js` is a single bundle; only `@opencode-ai/plugin` and `zod` are
|
|
69
|
+
external, so the host supplies those.
|
|
70
|
+
|
|
71
|
+
**If you use `min-release-age` in your npm config:** OpenCode's own installer
|
|
72
|
+
enforces it too. A freshly published version cannot be installed by OpenCode
|
|
73
|
+
until it is older than that many days. `min-release-age-exclude` helps for
|
|
74
|
+
direct `npm install` calls but **not** for OpenCode's bundled installer
|
|
75
|
+
(observed on OpenCode 1.18.35). Until the window passes, use the `file://`
|
|
76
|
+
form above, or install into the OpenCode package cache yourself
|
|
77
|
+
(`bun add <pkg>` in `~/.cache/opencode/packages/<pkg>@latest`).
|
|
78
|
+
|
|
79
|
+
## Development
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
bun install
|
|
83
|
+
bun test # bun test
|
|
84
|
+
bun run typecheck # tsc --noEmit
|
|
85
|
+
bun run check # biome
|
|
86
|
+
bun run release # build + pack tgz into release/
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Author
|
|
90
|
+
|
|
91
|
+
**Chris Engelhard** — [chrisengelhard.nl](https://chrisengelhard.nl) —
|
|
92
|
+
[chris@chrisengelhard.nl](mailto:chris@chrisengelhard.nl) —
|
|
93
|
+
[@digi4care](https://github.com/digi4care)
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
MIT
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ConfigSchema: z.ZodObject<{
|
|
3
|
+
registerPath: z.ZodDefault<z.ZodString>;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type DecisionLayerConfig = z.infer<typeof ConfigSchema>;
|
|
6
|
+
export declare function loadConfig(worktree: string): DecisionLayerConfig;
|