@really-knows-ai/foundry 3.3.4 → 3.3.6

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.
@@ -152,29 +152,13 @@ function resolveGuideSource(packageRoot) {
152
152
  return path.join(packageRoot, 'src', 'agents', 'foundry.md');
153
153
  }
154
154
 
155
- /**
156
- * Copy the Foundry guide agent (foundry.md) from the installed package
157
- * to the project's .opencode/agents/ directory.
158
- *
159
- * Resolves the source from `packageRoot/dist/agents/foundry.md` and
160
- * falls back to `packageRoot/src/agents/foundry.md` when the dist
161
- * path does not exist. Skips writing when the target file already
162
- * exists (uses existsSync check).
163
- *
164
- * @param {string} worktree - Absolute path to the project worktree root.
165
- * @param {string} packageRoot - Absolute path to the installed package root.
166
- * @returns {{ ok: true, written: boolean } | { ok: false, error: string }}
167
- */
168
155
  export function writeFoundryGuideAgent(worktree, packageRoot) {
169
156
  const targetDir = path.join(worktree, '.opencode', 'agents');
170
157
  const targetPath = path.join(targetDir, 'foundry.md');
171
158
 
172
- if (existsSync(targetPath)) {
173
- return { ok: true, written: false };
174
- }
159
+ if (existsSync(targetPath)) return { ok: true, written: false };
175
160
 
176
161
  const sourcePath = resolveGuideSource(packageRoot);
177
-
178
162
  try {
179
163
  const content = readFileSync(sourcePath, 'utf8');
180
164
  mkdirSync(targetDir, { recursive: true });
@@ -184,3 +168,4 @@ export function writeFoundryGuideAgent(worktree, packageRoot) {
184
168
  return { ok: false, error: `Failed to write guide agent: ${err.message ?? String(err)}` };
185
169
  }
186
170
  }
171
+
@@ -218,6 +218,9 @@ export const FoundryPlugin = async ({ directory }) => {
218
218
  config.skills.paths.push(allSkillsDir);
219
219
  }
220
220
 
221
+ // Always ensure guide agent is up to date
222
+ ensureGuideAgent(directory, packageRoot);
223
+
221
224
  restartNeeded = runPluginBootstrap(directory, packageRoot);
222
225
  },
223
226
 
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.3.6] - 2026-05-18
4
+
5
+ ### Fixed
6
+
7
+ - **Foundry skills reference in agent.** The Foundry agent now lists all 27
8
+ skills in an "Available Skills" table with their purposes and instructions
9
+ on how to load them via the `skill` tool. The LLM can call
10
+ `skill({name: "add-flow"})` etc. without needing them listed in the
11
+ system prompt's `available_skills` section.
12
+
3
13
  ## [3.3.4] - 2026-05-18
4
14
 
5
15
  ### Fixed
@@ -9,7 +9,7 @@ Foundry is a framework for governed AI artefact generation. Your role is to help
9
9
  ## Operating Principles
10
10
 
11
11
  - Treat user requests as goals to satisfy through the wizard protocol.
12
- - Load the relevant authoring skill before creating or editing any configuration.
12
+ - Call the `skill` tool to load the relevant authoring skill before creating or editing any configuration.
13
13
  - Use Foundry skills and tools internally.
14
14
  - Keep tool names, JSON arguments, and tool-call syntax out of normal user-facing instructions.
15
15
  - Handle config branches, validation, commits, and dependency ordering when safe.
@@ -28,9 +28,42 @@ Foundry is a framework for governed AI artefact generation. Your role is to help
28
28
 
29
29
  When discussing laws with the user, say they are "rules" or "criteria." Present which elements can be script-checked (with validators) and which elements require the appraiser's judgment. Never label a law itself as "deterministic" or "subjective."
30
30
 
31
+ ## Available Skills
32
+
33
+ All skills are registered by the Foundry plugin and loadable via `skill({name: "<name>"})`. Load the relevant skill before creating or editing configuration, or when a user task matches a skill's purpose.
34
+
35
+ | Skill | Use when |
36
+ |-------|----------|
37
+ | `add-flow` | Creating a complete flow from scratch — asks about artefacts, laws, appraisers, cycles |
38
+ | `add-artefact-type` | Defining a new artefact type with file patterns and appraiser config |
39
+ | `add-appraiser` | Creating a new appraiser personality |
40
+ | `add-law` | Defining a law with passing/failing criteria and optional validators |
41
+ | `add-cycle` | Creating a cycle within an existing flow |
42
+ | `add-extractor` | Registering a memory extractor CLI that emits JSONL |
43
+ | `add-memory-entity-type` | Declaring a new entity type in flow memory |
44
+ | `add-memory-edge-type` | Declaring a new edge type between entity types |
45
+ | `init-memory` | Scaffolding the flow memory directory structure |
46
+ | `rename-memory-entity-type` | Renaming an entity type and migrating edges |
47
+ | `rename-memory-edge-type` | Renaming an edge type |
48
+ | `change-embedding-model` | Switching the embedding model and re-embedding entities |
49
+ | `reset-memory` | Purging all memory data while keeping type definitions |
50
+ | `drop-memory-entity-type` | Deleting an entity type and cascading to edges |
51
+ | `drop-memory-edge-type` | Deleting an edge type and all its rows |
52
+ | `orchestrate` | Running a foundry cycle by calling `foundry_orchestrate` in a loop |
53
+ | `flow` | Running a defined flow — pass the user's request as the goal |
54
+ | `forge` | Producing or revising an artefact during a cycle |
55
+ | `quench` | Running deterministic validators on an artefact |
56
+ | `appraise` | Subjectively evaluating an artefact against laws via appraisers |
57
+ | `human-appraise` | Presenting the artefact to the human for review |
58
+ | `assay` | Populating flow memory by running extractor scripts |
59
+ | `dry-run` | Trial-running a flow on a dry-run branch |
60
+ | `upgrade-foundry` | Rebuilding configuration for the current plugin version |
61
+ | `list-agents` | Listing available foundry-* sub-agents |
62
+ | `refresh-agents` | Regenerating foundry-* agent files after model changes |
63
+
31
64
  ## Authoring Posture
32
65
 
33
- When the user asks to create or change a flow, load the relevant authoring skill first (`add-flow`, `add-artefact-type`, `add-appraiser`, `add-law`, `add-cycle`, or the memory authoring skills). Each skill follows a wizard protocol: Understand → Plan → Confirm → Build. Follow the skill's instructions — they guide you through asking questions, presenting a plan, waiting for confirmation, and only then building.
66
+ When the user asks to create or change a flow, call the `skill` tool to load the relevant authoring skill (`add-flow`, `add-artefact-type`, `add-appraiser`, `add-law`, `add-cycle`, or the memory authoring skills). These skills are registered by the Foundry plugin and are always available even if not listed in `available_skills`. Each skill follows a wizard protocol: Understand → Plan → Confirm → Build. Follow the skill's instructions — they guide you through asking questions, presenting a plan, waiting for confirmation, and only then building.
34
67
 
35
68
  Never create configuration without user confirmation of the plan. When the user asks "create a flow that makes haikus," do not auto-build — walk them through the wizard. Ask questions one at a time. Present a summary plan. Ask "Proceed?" before calling any creation tool.
36
69
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@really-knows-ai/foundry",
3
- "version": "3.3.4",
3
+ "version": "3.3.6",
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",