@really-knows-ai/foundry 3.0.2 → 3.2.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 (42) hide show
  1. package/README.md +12 -15
  2. package/dist/.opencode/plugins/foundry-tools/agent-refresh.js +184 -0
  3. package/dist/.opencode/plugins/foundry-tools/helpers.js +17 -20
  4. package/dist/.opencode/plugins/foundry-tools/refresh-agents-tool.js +27 -0
  5. package/dist/.opencode/plugins/foundry.js +114 -5
  6. package/dist/CHANGELOG.md +161 -0
  7. package/dist/README.md +12 -15
  8. package/dist/agents/foundry.md +37 -0
  9. package/dist/docs/README.md +1 -1
  10. package/dist/docs/architecture.md +8 -5
  11. package/dist/docs/concepts.md +2 -2
  12. package/dist/docs/getting-started.md +55 -135
  13. package/dist/docs/tools.md +21 -1
  14. package/dist/scripts/lib/foundational-guards.js +1 -1
  15. package/dist/scripts/lib/memory/admin/init.js +1 -1
  16. package/dist/scripts/sort.js +1 -1
  17. package/dist/skills/add-appraiser/SKILL.md +19 -34
  18. package/dist/skills/add-artefact-type/SKILL.md +19 -22
  19. package/dist/skills/add-cycle/SKILL.md +28 -37
  20. package/dist/skills/add-extractor/SKILL.md +21 -35
  21. package/dist/skills/add-flow/SKILL.md +43 -88
  22. package/dist/skills/add-law/SKILL.md +19 -24
  23. package/dist/skills/add-memory-edge-type/SKILL.md +12 -20
  24. package/dist/skills/add-memory-entity-type/SKILL.md +10 -19
  25. package/dist/skills/appraise/SKILL.md +1 -1
  26. package/dist/skills/change-embedding-model/SKILL.md +7 -11
  27. package/dist/skills/drop-memory-edge-type/SKILL.md +7 -11
  28. package/dist/skills/drop-memory-entity-type/SKILL.md +7 -11
  29. package/dist/skills/dry-run/SKILL.md +11 -28
  30. package/dist/skills/flow/SKILL.md +2 -2
  31. package/dist/skills/forge/SKILL.md +1 -1
  32. package/dist/skills/human-appraise/SKILL.md +1 -1
  33. package/dist/skills/init-memory/SKILL.md +12 -25
  34. package/dist/skills/list-agents/SKILL.md +1 -1
  35. package/dist/skills/quench/SKILL.md +1 -1
  36. package/dist/skills/refresh-agents/SKILL.md +4 -26
  37. package/dist/skills/rename-memory-edge-type/SKILL.md +7 -11
  38. package/dist/skills/rename-memory-entity-type/SKILL.md +7 -11
  39. package/dist/skills/reset-memory/SKILL.md +10 -18
  40. package/dist/skills/upgrade-foundry/SKILL.md +3 -3
  41. package/package.json +2 -1
  42. package/dist/skills/init-foundry/SKILL.md +0 -91
@@ -12,7 +12,7 @@ You orchestrate subjective appraisal of an artefact by dispatching independent s
12
12
 
13
13
  Before running this skill, verify that the `foundry/` directory exists in the project root. If it does not exist, stop and tell the user:
14
14
 
15
- > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
15
+ > Restart OpenCode to initialise Foundry, then retry this command.
16
16
 
17
17
  ## Stage lifecycle (mandatory)
18
18
 
@@ -16,9 +16,7 @@ Before running this skill, verify all of the following:
16
16
  1. The `foundry/` directory exists in the project root. If it does not
17
17
  exist, stop and tell the user:
18
18
 
19
- > Foundry is not initialized in this project. Run the
20
- > `init-foundry` skill first to create the foundry/ directory
21
- > structure.
19
+ > Restart OpenCode to initialise Foundry, then retry this command.
22
20
 
23
21
  2. The current git branch is a `config/*` branch. Run
24
22
  `git rev-parse --abbrev-ref HEAD` and confirm it matches
@@ -28,15 +26,13 @@ Before running this skill, verify all of the following:
28
26
  create one before continuing:
29
27
 
30
28
  > Foundry configuration changes must be made on a config/* branch.
31
- > From a clean main branch, call:
29
+ > If configuration changes are needed, move to a suitable `config/*`
30
+ > branch internally when the current branch is safe. If the current
31
+ > branch is `work/*` or `dry-run/*/*`, stop and explain the active
32
+ > work must be finished first.
32
33
  >
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/*`.
34
+ > After the prerequisite is handled, continue the user's original
35
+ > request from the current context.
40
36
 
41
37
  4. Memory is initialised and enabled. The new provider is reachable
42
38
  from this machine. Allow enough time and bandwidth to re-embed
@@ -15,9 +15,7 @@ Before running this skill, verify all of the following:
15
15
  1. The `foundry/` directory exists in the project root. If it does not
16
16
  exist, stop and tell the user:
17
17
 
18
- > Foundry is not initialized in this project. Run the
19
- > `init-foundry` skill first to create the foundry/ directory
20
- > structure.
18
+ > Restart OpenCode to initialise Foundry, then retry this command.
21
19
 
22
20
  2. The current git branch is a `config/*` branch. Run
23
21
  `git rev-parse --abbrev-ref HEAD` and confirm it matches
@@ -27,15 +25,13 @@ Before running this skill, verify all of the following:
27
25
  create one before continuing:
28
26
 
29
27
  > Foundry configuration changes must be made on a config/* branch.
30
- > 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.
31
32
  >
32
- > `foundry_git_branch({ kind: "config", description: "<short-name>" })`
33
- >
34
- > Then re-run this skill.
35
-
36
- If the user is on a `dry-run/*/*` branch, they must finish
37
- that dry-run first (`foundry_git_finish({ message, confirm: true })`)
38
- 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.
39
35
 
40
36
  4. Memory is initialised (`foundry/memory/` exists; run `init-memory`
41
37
  if not).
@@ -16,9 +16,7 @@ Before running this skill, verify all of the following:
16
16
  1. The `foundry/` directory exists in the project root. If it does not
17
17
  exist, stop and tell the user:
18
18
 
19
- > Foundry is not initialized in this project. Run the
20
- > `init-foundry` skill first to create the foundry/ directory
21
- > structure.
19
+ > Restart OpenCode to initialise Foundry, then retry this command.
22
20
 
23
21
  2. The current git branch is a `config/*` branch. Run
24
22
  `git rev-parse --abbrev-ref HEAD` and confirm it matches
@@ -28,15 +26,13 @@ Before running this skill, verify all of the following:
28
26
  create one before continuing:
29
27
 
30
28
  > Foundry configuration changes must be made on a config/* branch.
31
- > From a clean main branch, call:
29
+ > If configuration changes are needed, move to a suitable `config/*`
30
+ > branch internally when the current branch is safe. If the current
31
+ > branch is `work/*` or `dry-run/*/*`, stop and explain the active
32
+ > work must be finished first.
32
33
  >
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/*`.
34
+ > After the prerequisite is handled, continue the user's original
35
+ > request from the current context.
40
36
 
41
37
  4. Memory is initialised (`foundry/memory/` exists; run `init-memory`
42
38
  if not).
@@ -22,24 +22,18 @@ files or memory rows behind on `config/<x>`.
22
22
  2. Working tree is clean.
23
23
  3. The flow id and a one-line description of the goal are known.
24
24
 
25
- If on `main`, edit on a `config/<x>` branch first:
26
- `foundry_git_branch({ kind: "config", description: "<short-name>" })`.
25
+ If on `main`, edit on a `config/<x>` branch first. If configuration
26
+ changes are needed, move to a suitable `config/*` branch internally
27
+ when the current branch is safe. If the current branch is `work/*` or
28
+ `dry-run/*/*`, stop and explain the active work must be finished first.
27
29
 
28
30
  ## Protocol
29
31
 
30
32
  ### 1. Branch into dry-run mode
31
33
 
32
- ```text
33
- foundry_git_branch({
34
- kind: "dry-run",
35
- flowId: "<flow-id>",
36
- description: "<dry-run-purpose-slug>"
37
- })
38
- ```
39
-
40
- This creates `dry-run/<x>/<flow>-<purpose>` and truncates the trace
41
- file. From here every `foundry_*` tool call is logged to
42
- `.foundry/trace/<branch-slug>.jsonl`.
34
+ The assistant creates a `dry-run/<x>/<flow>-<purpose>` branch and
35
+ truncates the trace file. From here every internal tool call is logged
36
+ to `.foundry/trace/<branch-slug>.jsonl`.
43
37
 
44
38
  ### 2. Run the flow
45
39
 
@@ -57,12 +51,8 @@ they appear in the trace.
57
51
 
58
52
  ### 4. Finish: snapshot + discard
59
53
 
60
- ```text
61
- foundry_git_finish({
62
- message: "<one-paragraph findings>",
63
- confirm: true
64
- })
65
- ```
54
+ Finish the dry-run with a one-paragraph findings message and explicit
55
+ confirmation.
66
56
 
67
57
  The tool:
68
58
 
@@ -92,15 +82,8 @@ dry-run mode for another run. Snapshots accumulate; prune them with
92
82
 
93
83
  ### 6. Finish the config
94
84
 
95
- When ready, finish `config/<x>` to `main`:
96
-
97
- ```text
98
- foundry_git_finish({
99
- message: "<config description>",
100
- baseBranch: "main",
101
- confirm: true
102
- })
103
- ```
85
+ When ready, finish `config/<x>` to `main` with a config description and
86
+ explicit confirmation.
104
87
 
105
88
  Snapshots are gitignored and stay in the local working tree; they do
106
89
  not merge with the config.
@@ -15,12 +15,12 @@ A foundry flow reads a flow definition, creates a work branch, and executes cycl
15
15
 
16
16
  Before running this skill, verify that the `foundry/` directory exists in the project root. If it does not exist, stop and tell the user:
17
17
 
18
- > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
18
+ > Restart OpenCode to initialise Foundry, then retry this command.
19
19
 
20
20
  ## Starting a flow
21
21
 
22
22
  1. Call `foundry_config_flow` with the flow ID — get the flow definition
23
- 2. Call `foundry_git_branch` with `kind: "work"`, the flow ID, and a short description — create the work branch (e.g. `foundry_git_branch({ kind: "work", flowId, description })`)
23
+ 2. Create a work branch for the flow using the flow ID and a short description
24
24
  3. Determine the starting cycle:
25
25
  - Any cycle listed in the flow can be the starting cycle. The flow's `starting-cycles` list is a hint for when the user's request is ambiguous.
26
26
  - Map the user's goal to a cycle by matching the requested output (e.g. "write a short story from the tennis haiku" → `create-short-story`; "write a haiku" → `create-haiku`).
@@ -12,7 +12,7 @@ You produce or revise artefacts. You read the work file to understand the goal,
12
12
 
13
13
  Before running this skill, verify that the `foundry/` directory exists in the project root. If it does not exist, stop and tell the user:
14
14
 
15
- > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
15
+ > Restart OpenCode to initialise Foundry, then retry this command.
16
16
 
17
17
  ## Stage lifecycle (mandatory)
18
18
 
@@ -12,7 +12,7 @@ You are a human quality gate. Sort has routed to you either because the LLM appr
12
12
 
13
13
  Before running this skill, verify that the `foundry/` directory exists in the project root. If it does not exist, stop and tell the user:
14
14
 
15
- > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
15
+ > Restart OpenCode to initialise Foundry, then retry this command.
16
16
 
17
17
  ## Stage lifecycle (mandatory)
18
18
 
@@ -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
@@ -19,27 +19,18 @@ Before running this skill, verify all of the following:
19
19
  1. The `foundry/` directory exists in the project root. If it does not
20
20
  exist, stop and tell the user:
21
21
 
22
- > Foundry is not initialized in this project. Run the
23
- > `init-foundry` skill first to create the foundry/ directory
24
- > structure.
22
+ > Restart OpenCode to initialise Foundry, then retry this command.
25
23
 
26
24
  2. The current git branch is a `config/*` branch. Run
27
25
  `git rev-parse --abbrev-ref HEAD` and confirm it matches
28
26
  `config/<description>`.
29
27
 
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/*`.
28
+ 3. If the branch does not start with `config/`, move to a suitable
29
+ `config/*` branch internally when the current branch is safe. If
30
+ the current branch is `work/*` or `dry-run/*/*`, stop and explain
31
+ the active work must be finished first. When unrelated uncommitted
32
+ changes could be affected by branching or writing files, ask before
33
+ proceeding.
43
34
 
44
35
  Neither `foundry/memory/` nor `foundry-memory/` may already exist.
45
36
 
@@ -82,11 +73,7 @@ Neither `foundry/memory/` nor `foundry-memory/` may already exist.
82
73
  git commit -m "feat: initialise flow memory"
83
74
  ```
84
75
 
85
- 5. **Tell the user what is next**:
76
+ 5. **Continue the user's original request**:
86
77
 
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`).
78
+ > Flow memory is scaffolded. The Foundry agent will continue to define
79
+ > 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.
@@ -12,7 +12,7 @@ You run deterministic checks on an artefact by executing the CLI commands define
12
12
 
13
13
  Before running this skill, verify that the `foundry/` directory exists in the project root. If it does not exist, stop and tell the user:
14
14
 
15
- > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
15
+ > Restart OpenCode to initialise Foundry, then retry this command.
16
16
 
17
17
  ## Stage lifecycle (mandatory)
18
18
 
@@ -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.
@@ -13,9 +13,7 @@ Before running this skill, verify all of the following:
13
13
  1. The `foundry/` directory exists in the project root. If it does not
14
14
  exist, stop and tell the user:
15
15
 
16
- > Foundry is not initialized in this project. Run the
17
- > `init-foundry` skill first to create the foundry/ directory
18
- > structure.
16
+ > Restart OpenCode to initialise Foundry, then retry this command.
19
17
 
20
18
  2. The current git branch is a `config/*` branch. Run
21
19
  `git rev-parse --abbrev-ref HEAD` and confirm it matches
@@ -25,15 +23,13 @@ Before running this skill, verify all of the following:
25
23
  create one before continuing:
26
24
 
27
25
  > Foundry configuration changes must be made on a config/* branch.
28
- > From a clean main branch, call:
26
+ > If configuration changes are needed, move to a suitable `config/*`
27
+ > branch internally when the current branch is safe. If the current
28
+ > branch is `work/*` or `dry-run/*/*`, stop and explain the active
29
+ > work must be finished first.
29
30
  >
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/*`.
31
+ > After the prerequisite is handled, continue the user's original
32
+ > request from the current context.
37
33
 
38
34
  4. Memory is initialised. The `from` edge type must exist; the `to`
39
35
  name must be free.
@@ -13,9 +13,7 @@ Before running this skill, verify all of the following:
13
13
  1. The `foundry/` directory exists in the project root. If it does not
14
14
  exist, stop and tell the user:
15
15
 
16
- > Foundry is not initialized in this project. Run the
17
- > `init-foundry` skill first to create the foundry/ directory
18
- > structure.
16
+ > Restart OpenCode to initialise Foundry, then retry this command.
19
17
 
20
18
  2. The current git branch is a `config/*` branch. Run
21
19
  `git rev-parse --abbrev-ref HEAD` and confirm it matches
@@ -25,15 +23,13 @@ Before running this skill, verify all of the following:
25
23
  create one before continuing:
26
24
 
27
25
  > Foundry configuration changes must be made on a config/* branch.
28
- > From a clean main branch, call:
26
+ > If configuration changes are needed, move to a suitable `config/*`
27
+ > branch internally when the current branch is safe. If the current
28
+ > branch is `work/*` or `dry-run/*/*`, stop and explain the active
29
+ > work must be finished first.
29
30
  >
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/*`.
31
+ > After the prerequisite is handled, continue the user's original
32
+ > request from the current context.
37
33
 
38
34
  4. Memory is initialised. The `from` entity type must exist; the `to`
39
35
  name must be free (no existing entity or edge).
@@ -16,30 +16,22 @@ Before running this skill, verify all of the following:
16
16
  1. The `foundry/` directory exists in the project root. If it does not
17
17
  exist, stop and tell the user:
18
18
 
19
- > Foundry is not initialized in this project. Run the
20
- > `init-foundry` skill first to create the foundry/ directory
21
- > structure.
19
+ > Restart OpenCode to initialise Foundry, then retry this command.
22
20
 
23
21
  2. The current git branch is a `config/*` branch. Run
24
22
  `git rev-parse --abbrev-ref HEAD` and confirm it matches
25
23
  `config/<description>`.
26
24
 
27
- 3. If the branch does not start with `config/`, instruct the user to
28
- create one before continuing:
25
+ 3. If the branch does not start with `config/`, move to a suitable
26
+ `config/*` branch internally when the current branch is safe. If
27
+ the current branch is `work/*` or `dry-run/*/*`, stop and explain
28
+ the active work must be finished first. When unrelated uncommitted
29
+ changes could be affected by branching or writing files, ask before
30
+ proceeding.
29
31
 
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).
32
+ 4. Memory is initialised (`foundry/memory/` exists; initialise it
33
+ internally if not). After the reset completes, continue the user's
34
+ original request from context.
43
35
 
44
36
  ## Steps
45
37
 
@@ -14,13 +14,13 @@ This is a rebuild-style upgrade. Treat the old `foundry/` directory as source ma
14
14
 
15
15
  Before running this skill, verify that the project root contains `foundry/`. If it does not, stop and tell the user:
16
16
 
17
- > Foundry is not initialised in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
17
+ > Restart OpenCode to initialise Foundry, then retry this command.
18
18
 
19
19
  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:
@@ -53,7 +53,7 @@ Do not modify the preserved source directory after moving it. Read from it as so
53
53
 
54
54
  ### 3. Initialise current-version configuration
55
55
 
56
- Run the current `init-foundry` flow to create a fresh `foundry/` directory for the installed Foundry version.
56
+ On next restart, the plugin's config hook will auto-initialise a fresh `foundry/` directory.
57
57
 
58
58
  After initialisation, confirm the new config directory exists and contains the expected current top-level structure.
59
59
 
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.2.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/",
@@ -1,91 +0,0 @@
1
- ---
2
- name: init-foundry
3
- type: atomic
4
- description: Initialize a Foundry project by creating the foundry/ directory structure
5
- ---
6
-
7
- # Initialize Foundry
8
-
9
- Set up the `foundry/` directory structure in the current project.
10
-
11
- ## Prerequisites
12
-
13
- - The project must not already have a `foundry/` directory.
14
-
15
- ## Steps
16
-
17
- 1. **Check for existing foundry/ directory**
18
- - If `foundry/` already exists, inform the user and stop.
19
-
20
- 2. **Create the directory structure**
21
- Create the following directories, each with a `.gitkeep` file:
22
-
23
- ```
24
- foundry/
25
- artefacts/.gitkeep
26
- flows/.gitkeep
27
- cycles/.gitkeep
28
- laws/.gitkeep
29
- appraisers/.gitkeep
30
- ```
31
-
32
- 3. **Update `.gitignore`**
33
-
34
- Append the following lines to the project's `.gitignore` (creating
35
- the file if absent), skipping any that are already present:
36
-
37
- ```
38
- .snapshots/
39
- node_modules/
40
- .DS_Store
41
- ```
42
-
43
- - `.snapshots/` keeps dry-run snapshots out of git.
44
- - `node_modules/` keeps any npm dependencies (e.g. validator
45
- packages) out of git. Without it, foundry's `config/*` tools
46
- reject calls with `unexpected_files` as soon as the user runs
47
- `npm install`.
48
- - `.DS_Store` keeps macOS metadata out of git.
49
-
50
- The plugin will idempotently append `.foundry/` itself on first
51
- boot, so you do not need to add that line.
52
-
53
- 4. **Generate foundry agent files**
54
-
55
- Run the `refresh-agents` skill to generate `.opencode/agents/foundry-*.md` files for multi-model routing.
56
-
57
- 5. **Commit the structure**
58
-
59
- ```bash
60
- git add foundry/ .gitignore .opencode/agents/foundry-*.md
61
- git commit -m "feat: initialize Foundry project structure"
62
- ```
63
-
64
- 6. **Guide next steps**
65
-
66
- Tell the user:
67
-
68
- > Foundry is initialized. **Restart OpenCode** for the new foundry agents to take effect.
69
- >
70
- > The first time the plugin boots in this project, it will create the
71
- > `.foundry/` runtime directory (which holds the per-worktree HMAC key) and
72
- > idempotently append `.foundry/` to your `.gitignore` so the secret never
73
- > gets committed. The `.snapshots/` line was added by this skill to keep
74
- > dry-run snapshots out of git.
75
- >
76
- > Here's how to set up your first pipeline:
77
- >
78
- > 1. **Define an artefact type** — use the `add-artefact-type` skill
79
- > 2. **Add laws** — use the `add-law` skill to define quality criteria
80
- > 3. **Create appraiser personalities** — use the `add-appraiser` skill
81
- > 4. **Define a cycle** — use the `add-cycle` skill
82
- > 5. **Create a flow** — use the `add-flow` skill
83
- >
84
- > Then run your flow with the `flow` skill.
85
- >
86
- > **Optional: Flow Memory**
87
- >
88
- > If your flows need persistent knowledge (entities, relationships, semantic
89
- > search), use the `init-memory` skill to scaffold flow memory. Memory is
90
- > useful for projects that need to track code structure, dependencies, or
91
- > domain knowledge across flow runs.