@really-knows-ai/foundry 3.0.2 → 3.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.
Files changed (34) hide show
  1. package/README.md +8 -7
  2. package/dist/.opencode/plugins/foundry-tools/helpers.js +10 -19
  3. package/dist/.opencode/plugins/foundry-tools/refresh-agents-tool.js +88 -0
  4. package/dist/.opencode/plugins/foundry.js +2 -0
  5. package/dist/CHANGELOG.md +113 -0
  6. package/dist/README.md +8 -7
  7. package/dist/agents/foundry.md +37 -0
  8. package/dist/docs/architecture.md +6 -3
  9. package/dist/docs/concepts.md +1 -1
  10. package/dist/docs/getting-started.md +57 -135
  11. package/dist/docs/tools.md +21 -1
  12. package/dist/scripts/sort.js +1 -1
  13. package/dist/skills/add-appraiser/SKILL.md +19 -34
  14. package/dist/skills/add-artefact-type/SKILL.md +19 -22
  15. package/dist/skills/add-cycle/SKILL.md +28 -37
  16. package/dist/skills/add-extractor/SKILL.md +21 -33
  17. package/dist/skills/add-flow/SKILL.md +43 -88
  18. package/dist/skills/add-law/SKILL.md +19 -24
  19. package/dist/skills/add-memory-edge-type/SKILL.md +11 -17
  20. package/dist/skills/add-memory-entity-type/SKILL.md +9 -16
  21. package/dist/skills/change-embedding-model/SKILL.md +6 -8
  22. package/dist/skills/drop-memory-edge-type/SKILL.md +6 -8
  23. package/dist/skills/drop-memory-entity-type/SKILL.md +6 -8
  24. package/dist/skills/dry-run/SKILL.md +11 -28
  25. package/dist/skills/flow/SKILL.md +1 -1
  26. package/dist/skills/init-foundry/SKILL.md +30 -25
  27. package/dist/skills/init-memory/SKILL.md +11 -22
  28. package/dist/skills/list-agents/SKILL.md +1 -1
  29. package/dist/skills/refresh-agents/SKILL.md +4 -26
  30. package/dist/skills/rename-memory-edge-type/SKILL.md +6 -8
  31. package/dist/skills/rename-memory-entity-type/SKILL.md +6 -8
  32. package/dist/skills/reset-memory/SKILL.md +10 -16
  33. package/dist/skills/upgrade-foundry/SKILL.md +1 -1
  34. package/package.json +2 -1
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: init-memory
3
3
  type: atomic
4
- description: Initialize flow memory by creating the foundry/memory/ and foundry-memory/ directory structures
4
+ description: Initialise flow memory by creating the foundry/memory/ and foundry-memory/ directory structures
5
5
  ---
6
6
 
7
- # Initialize Flow Memory
7
+ # Initialise Flow Memory
8
8
 
9
9
  Scaffold `foundry/memory/` (config) and `foundry-memory/relations/` (row data)
10
10
  in the current project. `foundry/memory/` holds entity-type and edge-type
@@ -27,19 +27,12 @@ Before running this skill, verify all of the following:
27
27
  `git rev-parse --abbrev-ref HEAD` and confirm it matches
28
28
  `config/<description>`.
29
29
 
30
- 3. If the branch does not start with `config/`, instruct the user to
31
- create one before continuing:
32
-
33
- > Foundry configuration changes must be made on a config/* branch.
34
- > From a clean main branch, call:
35
- >
36
- > `foundry_git_branch({ kind: "config", description: "<short-name>" })`
37
- >
38
- > Then re-run this skill.
39
-
40
- If the user is on a `dry-run/*/*` branch, they must finish
41
- that dry-run first (`foundry_git_finish({ message, confirm: true })`)
42
- before re-running this skill on the parent `config/*`.
30
+ 3. If the branch does not start with `config/`, move to a suitable
31
+ `config/*` branch internally when the current branch is safe. If
32
+ the current branch is `work/*` or `dry-run/*/*`, stop and explain
33
+ the active work must be finished first. When unrelated uncommitted
34
+ changes could be affected by branching or writing files, ask before
35
+ proceeding.
43
36
 
44
37
  Neither `foundry/memory/` nor `foundry-memory/` may already exist.
45
38
 
@@ -82,11 +75,7 @@ Neither `foundry/memory/` nor `foundry-memory/` may already exist.
82
75
  git commit -m "feat: initialise flow memory"
83
76
  ```
84
77
 
85
- 5. **Tell the user what is next**:
78
+ 5. **Continue the user's original request**:
86
79
 
87
- > Flow memory is scaffolded. Next steps:
88
- >
89
- > - Use `add-memory-entity-type` to declare entity types (e.g. `class`,
90
- > `method`, `table`).
91
- > - Use `add-memory-edge-type` to declare edge types (e.g. `calls`,
92
- > `writes`, `references`).
80
+ > Flow memory is scaffolded. The Foundry agent will continue to define
81
+ > memory entity and edge types as needed to support your goal.
@@ -21,4 +21,4 @@ foundry-<provider>-<model> → <provider>/<model>
21
21
 
22
22
  If no `foundry-*.md` files are found, output:
23
23
 
24
- > No foundry agent files found. Run the `refresh-agents` skill to generate them.
24
+ > No foundry agent files found. Call `foundry_refresh_agents()` to generate them.
@@ -9,35 +9,13 @@ Regenerate `.opencode/agents/foundry-*.md` files from the currently available mo
9
9
 
10
10
  ## Protocol
11
11
 
12
- 1. Run `opencode models` to get all available `provider/model` IDs
13
- 2. Create `.opencode/agents/` directory if it does not exist
14
- 3. Delete all existing `.opencode/agents/foundry-*.md` files (stale agents from removed providers)
15
- 4. For each model line in the output, generate a markdown agent file
12
+ Call the `foundry_refresh_agents` tool. It runs `opencode models`, deletes stale agent files, and generates fresh ones.
16
13
 
17
- ### Agent file format
14
+ ## Output
18
15
 
19
- Filename: `.opencode/agents/foundry-<slug>.md`
16
+ The tool returns `{ ok: true, count: <n> }` on success.
20
17
 
21
- Where `<slug>` is the model ID with **both** `/` and `.` replaced by `-`. This keeps filenames shell-safe and unambiguous.
22
-
23
- Examples:
24
- - `opencode/claude-sonnet-4` → `.opencode/agents/foundry-opencode-claude-sonnet-4.md`
25
- - `github-copilot/claude-sonnet-4.6` → `.opencode/agents/foundry-github-copilot-claude-sonnet-4-6.md`
26
- - `github-copilot/gpt-5.4` → `.opencode/agents/foundry-github-copilot-gpt-5-4.md`
27
-
28
- Content:
29
-
30
- ```markdown
31
- ---
32
- description: "Foundry stage agent using <provider>/<model-key>"
33
- mode: subagent
34
- model: "<provider>/<model-key>"
35
- hidden: true
36
- ---
37
- You are a Foundry stage agent. Follow the skill instructions provided in your task prompt exactly.
38
- ```
39
-
40
- 5. After writing all files, output:
18
+ After the tool completes, tell the user:
41
19
 
42
20
  > Generated `<count>` foundry agent files in `.opencode/agents/`.
43
21
  > **Restart OpenCode** for the new agents to take effect.
@@ -25,15 +25,13 @@ Before running this skill, verify all of the following:
25
25
  create one before continuing:
26
26
 
27
27
  > Foundry configuration changes must be made on a config/* branch.
28
- > From a clean main branch, call:
28
+ > If configuration changes are needed, move to a suitable `config/*`
29
+ > branch internally when the current branch is safe. If the current
30
+ > branch is `work/*` or `dry-run/*/*`, stop and explain the active
31
+ > work must be finished first.
29
32
  >
30
- > `foundry_git_branch({ kind: "config", description: "<short-name>" })`
31
- >
32
- > Then re-run this skill.
33
-
34
- If the user is on a `dry-run/*/*` branch, they must finish
35
- that dry-run first (`foundry_git_finish({ message, confirm: true })`)
36
- before re-running this skill on the parent `config/*`.
33
+ > After the prerequisite is handled, continue the user's original
34
+ > request from the current context.
37
35
 
38
36
  4. Memory is initialised. The `from` edge type must exist; the `to`
39
37
  name must be free.
@@ -25,15 +25,13 @@ Before running this skill, verify all of the following:
25
25
  create one before continuing:
26
26
 
27
27
  > Foundry configuration changes must be made on a config/* branch.
28
- > From a clean main branch, call:
28
+ > If configuration changes are needed, move to a suitable `config/*`
29
+ > branch internally when the current branch is safe. If the current
30
+ > branch is `work/*` or `dry-run/*/*`, stop and explain the active
31
+ > work must be finished first.
29
32
  >
30
- > `foundry_git_branch({ kind: "config", description: "<short-name>" })`
31
- >
32
- > Then re-run this skill.
33
-
34
- If the user is on a `dry-run/*/*` branch, they must finish
35
- that dry-run first (`foundry_git_finish({ message, confirm: true })`)
36
- before re-running this skill on the parent `config/*`.
33
+ > After the prerequisite is handled, continue the user's original
34
+ > request from the current context.
37
35
 
38
36
  4. Memory is initialised. The `from` entity type must exist; the `to`
39
37
  name must be free (no existing entity or edge).
@@ -24,22 +24,16 @@ Before running this skill, verify all of the following:
24
24
  `git rev-parse --abbrev-ref HEAD` and confirm it matches
25
25
  `config/<description>`.
26
26
 
27
- 3. If the branch does not start with `config/`, instruct the user to
28
- create one before continuing:
29
-
30
- > Foundry configuration changes must be made on a config/* branch.
31
- > From a clean main branch, call:
32
- >
33
- > `foundry_git_branch({ kind: "config", description: "<short-name>" })`
34
- >
35
- > Then re-run this skill.
36
-
37
- If the user is on a `dry-run/*/*` branch, they must finish
38
- that dry-run first (`foundry_git_finish({ message, confirm: true })`)
39
- before re-running this skill on the parent `config/*`.
40
-
41
- 4. Memory is initialised (`foundry/memory/` exists; run `init-memory`
42
- if not).
27
+ 3. If the branch does not start with `config/`, move to a suitable
28
+ `config/*` branch internally when the current branch is safe. If
29
+ the current branch is `work/*` or `dry-run/*/*`, stop and explain
30
+ the active work must be finished first. When unrelated uncommitted
31
+ changes could be affected by branching or writing files, ask before
32
+ proceeding.
33
+
34
+ 4. Memory is initialised (`foundry/memory/` exists; initialise it
35
+ internally if not). After the reset completes, continue the user's
36
+ original request from context.
43
37
 
44
38
  ## Steps
45
39
 
@@ -20,7 +20,7 @@ Verify a safe base state before making changes:
20
20
 
21
21
  - The worktree is clean, or the user explicitly chooses how to handle dirty files.
22
22
  - `WORK.md` is absent from the repository root.
23
- - The upgrade runs from a config branch such as `config/upgrade-foundry`, or you create one with `foundry_git_branch({ kind: 'config', description: 'upgrade-foundry' })` before making config changes.
23
+ - The upgrade runs from a config branch such as `config/upgrade-foundry`. If configuration changes are needed, move to a suitable `config/*` branch internally when the current branch is safe. If the current branch is `work/*` or `dry-run/*/*`, stop and explain the active work must be finished first.
24
24
  - Use an isolated worktree where practical, matching the normal config-edit workflow.
25
25
 
26
26
  If `WORK.md` exists, stop and tell the user:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@really-knows-ai/foundry",
3
- "version": "3.0.2",
3
+ "version": "3.1.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",
@@ -34,6 +34,7 @@
34
34
  },
35
35
  "files": [
36
36
  "dist/.opencode/",
37
+ "dist/agents/",
37
38
  "dist/skills/",
38
39
  "dist/scripts/",
39
40
  "dist/docs/",