@really-knows-ai/foundry 1.0.0 → 1.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.
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Foundry plugin for OpenCode.ai
3
3
  *
4
- * Conditional bootstrap:
5
- * - If foundry/ exists in project: full skill registration + pipeline context
6
- * - If foundry/ does not exist: only init-foundry skill + minimal prompt
4
+ * All skills are always registered. Individual skills check for foundry/ dir.
5
+ * - If foundry/ exists: pipeline context + multi-model agent registration
6
+ * - If foundry/ does not exist: minimal prompt guiding user to init-foundry
7
7
  */
8
8
 
9
9
  import path from 'path';
@@ -56,11 +56,12 @@ export const FoundryPlugin = async ({ client, directory }) => {
56
56
  config.skills = config.skills || {};
57
57
  config.skills.paths = config.skills.paths || [];
58
58
 
59
- if (foundryExists) {
60
- if (!config.skills.paths.includes(allSkillsDir)) {
61
- config.skills.paths.push(allSkillsDir);
62
- }
59
+ // Always register all skills — individual skills check for foundry/ dir
60
+ if (!config.skills.paths.includes(allSkillsDir)) {
61
+ config.skills.paths.push(allSkillsDir);
62
+ }
63
63
 
64
+ if (foundryExists) {
64
65
  // Register per-model subagents for multi-model stage routing
65
66
  try {
66
67
  const providers = await client.provider.list();
@@ -83,10 +84,6 @@ export const FoundryPlugin = async ({ client, directory }) => {
83
84
  } catch (err) {
84
85
  console.warn('[foundry] Failed to discover models for agent registration:', err.message);
85
86
  }
86
- } else {
87
- if (!config.skills.paths.includes(initSkillDir)) {
88
- config.skills.paths.push(initSkillDir);
89
- }
90
87
  }
91
88
  },
92
89
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@really-knows-ai/foundry",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A structured framework for AI-driven artefact creation with deterministic routing, quality gates, and iterative refinement cycles.",
5
5
  "type": "module",
6
6
  "main": ".opencode/plugins/foundry.js",
@@ -8,6 +8,12 @@ description: Creates a new appraiser personality, checking for semantic overlap
8
8
 
9
9
  You help the user create a new appraiser personality. You ensure it's genuinely distinct from existing appraisers and scaffold the definition file.
10
10
 
11
+ ## Prerequisites
12
+
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
+
15
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
16
+
11
17
  ## Protocol
12
18
 
13
19
  ### 1. Gather basics
@@ -8,6 +8,12 @@ description: Creates a new artefact type, checking for conflicts with existing t
8
8
 
9
9
  You help the user create a new artefact type. You ensure it doesn't conflict with existing types, scaffold the directory structure, and walk the user through defining laws and validation.
10
10
 
11
+ ## Prerequisites
12
+
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
+
15
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
16
+
11
17
  ## Protocol
12
18
 
13
19
  ### 1. Gather basics
@@ -8,6 +8,12 @@ description: Creates a new foundry cycle within a foundry flow, specifying the o
8
8
 
9
9
  You help the user create a new foundry cycle and add it to an existing foundry flow. A foundry cycle produces one artefact type (read-write) and optionally reads from artefact types produced by earlier foundry cycles (read-only).
10
10
 
11
+ ## Prerequisites
12
+
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
+
15
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
16
+
11
17
  ## Protocol
12
18
 
13
19
  ### 1. Identify the foundry flow
@@ -8,6 +8,12 @@ description: Creates a new foundry flow definition.
8
8
 
9
9
  You help the user create a new foundry flow. A foundry flow is an ordered list of foundry cycles that transforms a request into finished artefacts.
10
10
 
11
+ ## Prerequisites
12
+
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
+
15
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
16
+
11
17
  ## Protocol
12
18
 
13
19
  ### 1. Gather basics
@@ -8,6 +8,12 @@ description: Creates a new law, checking for conflicts with existing laws.
8
8
 
9
9
  You help the user create a new law. You ensure it's well-scoped, doesn't conflict with existing laws, and ends up in the right file.
10
10
 
11
+ ## Prerequisites
12
+
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
+
15
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
16
+
11
17
  ## Protocol
12
18
 
13
19
  ### 1. Determine scope
@@ -8,6 +8,12 @@ description: Subjective evaluation of an artefact against laws via multiple inde
8
8
 
9
9
  You orchestrate subjective appraisal of an artefact by dispatching independent sub-agent appraisers, then consolidating their feedback into WORK.md.
10
10
 
11
+ ## Prerequisites
12
+
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
+
15
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
16
+
11
17
  ## Appraiser configuration
12
18
 
13
19
  Appraiser personalities are defined in `foundry/appraisers/` (the appraiser directory). Each markdown file defines:
@@ -9,6 +9,12 @@ composes: [sort, forge, quench, appraise, hitl]
9
9
 
10
10
  A foundry cycle reads its definition from `foundry/cycles/<cycle-id>.md`, sets up WORK.md for routing, then hands control to the sort skill which drives the forge → quench → appraise loop.
11
11
 
12
+ ## Prerequisites
13
+
14
+ Before running this skill, verify that the `foundry/` directory exists in the project root. If it does not exist, stop and tell the user:
15
+
16
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
17
+
12
18
  ## Cycle definition
13
19
 
14
20
  The cycle definition (`foundry/cycles/<cycle-id>.md`) specifies:
@@ -9,6 +9,12 @@ composes: [cycle]
9
9
 
10
10
  A foundry flow reads a flow definition from `foundry/flows/`, creates a work branch, initialises WORK.md, and executes each foundry cycle in sequence.
11
11
 
12
+ ## Prerequisites
13
+
14
+ Before running this skill, verify that the `foundry/` directory exists in the project root. If it does not exist, stop and tell the user:
15
+
16
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
17
+
12
18
  ## Starting a foundry flow
13
19
 
14
20
  1. Read the flow definition from `foundry/flows/<flow-id>.md`
@@ -8,6 +8,12 @@ description: Produces or revises an artefact, guided by WORK.md and the foundry
8
8
 
9
9
  You produce or revise artefacts. You read WORK.md to understand the goal and feedback, and the foundry cycle definition to understand what you're producing and what inputs you can read.
10
10
 
11
+ ## Prerequisites
12
+
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
+
15
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
16
+
11
17
  ## Protocol
12
18
 
13
19
  ### First generation (no artefact registered in WORK.md yet)
@@ -8,6 +8,12 @@ description: Human-in-the-loop checkpoint. Pauses the cycle for human input befo
8
8
 
9
9
  You are a human-in-the-loop checkpoint. Sort has routed to you because the cycle definition includes a pause point here. Your job is to present context, ask the human whatever needs asking, record their response, and return control to sort.
10
10
 
11
+ ## Prerequisites
12
+
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
+
15
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
16
+
11
17
  ## Protocol
12
18
 
13
19
  1. Read `WORK.md` — understand the current state: goal, artefacts, feedback
@@ -8,6 +8,12 @@ description: Deterministic validation of an artefact by running CLI commands. Wr
8
8
 
9
9
  You run deterministic checks on an artefact by executing the CLI commands defined in the artefact type's validation file. No judgment — commands pass or fail.
10
10
 
11
+ ## Prerequisites
12
+
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
+
15
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
16
+
11
17
  ## When this skill applies
12
18
 
13
19
  This skill only runs if `foundry/artefacts/<type>/validation.md` exists. If there is no validation file for the artefact type, this skill is skipped.
@@ -8,6 +8,12 @@ description: Deterministic routing for a foundry cycle. Runs scripts/sort.js and
8
8
 
9
9
  You are the central dispatcher for a foundry cycle. You run the sort script to determine what stage to execute next, then invoke that stage's skill.
10
10
 
11
+ ## Prerequisites
12
+
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
+
15
+ > Foundry is not initialized in this project. Run the `init-foundry` skill first to create the foundry/ directory structure.
16
+
11
17
  ## Protocol
12
18
 
13
19
  1. Run the sort script: