@really-knows-ai/foundry 3.2.7 → 3.3.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/dist/.opencode/plugins/foundry-tools/config-create-tools.js +91 -19
- package/dist/.opencode/plugins/foundry-tools/config-law-tools.js +111 -108
- package/dist/CHANGELOG.md +30 -0
- package/dist/scripts/lib/config-creators/appraiser.js +29 -2
- package/dist/scripts/lib/config-creators/artefact-type.js +49 -2
- package/dist/scripts/lib/config-creators/cycle.js +112 -2
- package/dist/scripts/lib/config-creators/flow.js +27 -2
- package/dist/scripts/lib/config-creators/law.js +269 -0
- package/dist/skills/add-appraiser/SKILL.md +7 -14
- package/dist/skills/add-artefact-type/SKILL.md +14 -28
- package/dist/skills/add-cycle/SKILL.md +17 -26
- package/dist/skills/add-flow/SKILL.md +9 -0
- package/dist/skills/add-law/SKILL.md +17 -22
- package/package.json +1 -1
|
@@ -48,28 +48,20 @@ If the user names a type-specific law for an artefact type that does not exist,
|
|
|
48
48
|
|
|
49
49
|
### 2. Draft the law
|
|
50
50
|
|
|
51
|
-
Write the law
|
|
51
|
+
Write the law using these structured fields:
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
- `id` (string) — lowercase, hyphenated law identifier, unique across all laws
|
|
54
|
+
- `name` (string) — human-readable name
|
|
55
|
+
- `description` (string) — one or two sentences describing what this law checks
|
|
56
|
+
- `passing` (string) — description of what passing looks like
|
|
57
|
+
- `failing` (string) — description of what failing looks like
|
|
58
|
+
- `validators` (array, optional) — validator entries. Include only when a deterministic check can decide pass/fail. See **Validator contract** below for the exact shape a validator command must satisfy.
|
|
55
59
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
validators:
|
|
59
|
-
- id: validator-id
|
|
60
|
-
command: ./script.sh
|
|
61
|
-
failure-means: (optional description)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
The `law-id` (heading) should be:
|
|
60
|
+
The `id` value should be:
|
|
65
61
|
- Lowercase, hyphenated
|
|
66
62
|
- Short but descriptive
|
|
67
63
|
- Unique across all laws (global and type-specific)
|
|
68
64
|
|
|
69
|
-
The `validators:` block is optional. Include it only when a
|
|
70
|
-
deterministic check can decide pass/fail. See **Validator contract**
|
|
71
|
-
below for the exact shape a validator command must satisfy.
|
|
72
|
-
|
|
73
65
|
### 3. Check for conflicts
|
|
74
66
|
|
|
75
67
|
Read all existing laws that would apply to the same artefact types:
|
|
@@ -111,7 +103,7 @@ Iterate until the user is happy.
|
|
|
111
103
|
|
|
112
104
|
### 5. Validate the draft
|
|
113
105
|
|
|
114
|
-
Call `foundry_config_validate_law({ name: "<
|
|
106
|
+
Call `foundry_config_validate_law({ name: "<id>", body: "<assembled markdown>" })`. Assemble the body from the fields using the `## <id>` heading format the tool produces internally.
|
|
115
107
|
|
|
116
108
|
If the result is `{ ok: false, errors: [...] }`, address each error (adjust the body) and re-run until you get `{ ok: true }`. Common issues: missing required frontmatter keys, references to artefact types that don't exist yet.
|
|
117
109
|
|
|
@@ -126,8 +118,11 @@ Then call:
|
|
|
126
118
|
|
|
127
119
|
```
|
|
128
120
|
foundry_config_add_law({
|
|
129
|
-
|
|
130
|
-
|
|
121
|
+
id: "<id>",
|
|
122
|
+
name: "<name>",
|
|
123
|
+
description: "<description>",
|
|
124
|
+
passing: "<passing>",
|
|
125
|
+
failing: "<failing>",
|
|
131
126
|
target: { kind: "global", file: "<file-name>.md" } // OR
|
|
132
127
|
{ kind: "type-specific", typeId: "<artefact-type>" }
|
|
133
128
|
})
|
|
@@ -140,9 +135,9 @@ The tool:
|
|
|
140
135
|
- produces one git commit on the current `config/*` branch.
|
|
141
136
|
|
|
142
137
|
The tool appends to an existing `laws.md` automatically when the
|
|
143
|
-
new
|
|
138
|
+
new law id is not already present. It only errors when
|
|
144
139
|
a law with the same id is already in the file — in that case use
|
|
145
|
-
`foundry_config_edit_law({ id: "<law-id>",
|
|
140
|
+
`foundry_config_edit_law({ id: "<law-id>", description: "<updated>", passing: "<updated>", failing: "<updated>" })`
|
|
146
141
|
to modify the existing law in place.
|
|
147
142
|
|
|
148
143
|
Show the user the resulting commit hash from the response.
|
|
@@ -286,7 +281,7 @@ Then proceed with the update.
|
|
|
286
281
|
|
|
287
282
|
#### 8e. Apply the update
|
|
288
283
|
|
|
289
|
-
Call `foundry_config_edit_law({ id: "<law-id>",
|
|
284
|
+
Call `foundry_config_edit_law({ id: "<law-id>", description: "<updated>", passing: "<updated>", failing: "<updated>", validators: [...] })` with the full updated fields.
|
|
290
285
|
|
|
291
286
|
Validate the result. If the tool returns `{ ok: true }`, show the user the commit hash. If it returns `{ ok: false, errors }`, address each error and retry.
|
|
292
287
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@really-knows-ai/foundry",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "A skill-driven framework for governed artefact generation with AI coding tools. Define your own artefact types, laws, and flows — Foundry handles the forge → quench → appraise pipeline with deterministic routing, quality gates, and iterative refinement.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/.opencode/plugins/foundry.js",
|