ruleloom 0.0.0-stage → 0.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.
- package/CHANGELOG.md +17 -0
- package/LICENSE +21 -0
- package/README.md +151 -2
- package/dist/adapters/claude.d.ts +3 -0
- package/dist/adapters/claude.d.ts.map +1 -0
- package/dist/adapters/claude.js +59 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/codex.d.ts +3 -0
- package/dist/adapters/codex.d.ts.map +1 -0
- package/dist/adapters/codex.js +84 -0
- package/dist/adapters/codex.js.map +1 -0
- package/dist/adapters/copilot.d.ts +3 -0
- package/dist/adapters/copilot.d.ts.map +1 -0
- package/dist/adapters/copilot.js +53 -0
- package/dist/adapters/copilot.js.map +1 -0
- package/dist/adapters/format.d.ts +27 -0
- package/dist/adapters/format.d.ts.map +1 -0
- package/dist/adapters/format.js +55 -0
- package/dist/adapters/format.js.map +1 -0
- package/dist/adapters/index.d.ts +10 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +11 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/types.d.ts +19 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +2 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/assemble.d.ts +61 -0
- package/dist/assemble.d.ts.map +1 -0
- package/dist/assemble.js +133 -0
- package/dist/assemble.js.map +1 -0
- package/dist/blocks.d.ts +32 -0
- package/dist/blocks.d.ts.map +1 -0
- package/dist/blocks.js +59 -0
- package/dist/blocks.js.map +1 -0
- package/dist/bundle.d.ts +121 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +157 -0
- package/dist/bundle.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +141 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +73 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +205 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +16 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/issues.d.ts +6 -0
- package/dist/issues.d.ts.map +1 -0
- package/dist/issues.js +31 -0
- package/dist/issues.js.map +1 -0
- package/dist/project.d.ts +73 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +103 -0
- package/dist/project.js.map +1 -0
- package/dist/prompt.d.ts +62 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +91 -0
- package/dist/prompt.js.map +1 -0
- package/dist/resources.d.ts +39 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +118 -0
- package/dist/resources.js.map +1 -0
- package/dist/select.d.ts +14 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +25 -0
- package/dist/select.js.map +1 -0
- package/dist/slots.d.ts +35 -0
- package/dist/slots.d.ts.map +1 -0
- package/dist/slots.js +86 -0
- package/dist/slots.js.map +1 -0
- package/docs/agent-definition.md +86 -0
- package/docs/api.md +65 -0
- package/docs/architecture.md +47 -0
- package/docs/cli.md +28 -0
- package/docs/errors.md +76 -0
- package/docs/targets.md +49 -0
- package/package.json +51 -4
package/dist/slots.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { RuleLoomError } from './errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* Two sigils, two owners.
|
|
4
|
+
*
|
|
5
|
+
* `${{NAME}}` belongs to the agent: a `random` or `data` slot from its own
|
|
6
|
+
* `agent.json`, bound in place — in the preamble, a rule, a skill — so it is
|
|
7
|
+
* part of the agent's text for that compilation.
|
|
8
|
+
*
|
|
9
|
+
* `{{NAME}}` belongs to the run: a block appended after the static text from
|
|
10
|
+
* the project's block templates (`<shared>/blocks/`). It is left exactly as it
|
|
11
|
+
* is.
|
|
12
|
+
*
|
|
13
|
+
* Anything else, either sigil, is a compilation error naming where. Without
|
|
14
|
+
* it a typo such as `{{THEM}}` reaches the model as a literal and nobody
|
|
15
|
+
* notices.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* A value an operator may pass for a `data` slot at compile time: a name, not
|
|
19
|
+
* a document. No `{` or `}`, so it cannot smuggle a slot into the text it is
|
|
20
|
+
* written into; short, because a model asked to copy a long free-form value
|
|
21
|
+
* rewrites it.
|
|
22
|
+
*/
|
|
23
|
+
const DATA_OVERRIDE = /^[\p{L}\p{N}](?:[\p{L}\p{N} _.-]{0,62}[\p{L}\p{N}])?$/u;
|
|
24
|
+
/** One `NAME=value` override, trimmed and validated. */
|
|
25
|
+
export function resolveDataOverride(name, value) {
|
|
26
|
+
const trimmed = value.trim();
|
|
27
|
+
if (!DATA_OVERRIDE.test(trimmed)) {
|
|
28
|
+
throw new RuleLoomError('DATA_OVERRIDE_INVALID', `${name} = "${value}" — 1 to 64 characters: letters, digits, dash, dot, underscore or inner space; never a brace`);
|
|
29
|
+
}
|
|
30
|
+
return trimmed;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The value each `${{NAME}}` an agent declares takes for one compilation.
|
|
34
|
+
*
|
|
35
|
+
* `data` is copied as written, then overridden by `given.data`. `random` takes
|
|
36
|
+
* the drawn value from `given.random`, or its first value when nothing was
|
|
37
|
+
* drawn — deterministic on purpose, so two compilations compare byte for byte.
|
|
38
|
+
* Both `given` maps are pools: a run carries every value it drew for every
|
|
39
|
+
* agent, so a name this agent does not declare is ignored. A drawn *value*
|
|
40
|
+
* outside the declared list is refused: a typo or a stale pin.
|
|
41
|
+
*/
|
|
42
|
+
export function resolveAgentSlots(config, given = {}) {
|
|
43
|
+
const slots = { ...config.data };
|
|
44
|
+
for (const [name, value] of Object.entries(given.data ?? {})) {
|
|
45
|
+
if (Object.hasOwn(slots, name))
|
|
46
|
+
slots[name] = resolveDataOverride(name, value);
|
|
47
|
+
}
|
|
48
|
+
for (const [name, values] of Object.entries(config.random)) {
|
|
49
|
+
const wanted = given.random?.[name];
|
|
50
|
+
if (wanted !== undefined && !values.includes(wanted)) {
|
|
51
|
+
throw new RuleLoomError('RANDOM_VALUE_UNKNOWN', `${name}=${wanted} — ${config.name} declares ${values.join(', ')}`);
|
|
52
|
+
}
|
|
53
|
+
slots[name] = wanted ?? values[0];
|
|
54
|
+
}
|
|
55
|
+
return slots;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Binds the agent's slots in a text and refuses any slot nobody knows.
|
|
59
|
+
*
|
|
60
|
+
* One pass with a function replacer: a value is inserted once, never re-read
|
|
61
|
+
* as a template, and `$` sequences in it stay text.
|
|
62
|
+
*/
|
|
63
|
+
export function bindSlots(text, slots, options = {}) {
|
|
64
|
+
const where = options.where ?? 'text';
|
|
65
|
+
const blocks = new Set(options.blocks ?? []);
|
|
66
|
+
return text.replace(/(\$?)\{\{([A-Z][A-Z0-9_]*)\}\}/g, (whole, sigil, name) => {
|
|
67
|
+
if (sigil === '$') {
|
|
68
|
+
if (Object.hasOwn(slots, name)) {
|
|
69
|
+
options.used?.add(name);
|
|
70
|
+
return slots[name];
|
|
71
|
+
}
|
|
72
|
+
const declared = Object.keys(slots);
|
|
73
|
+
throw new RuleLoomError('AGENT_SLOT_UNKNOWN', `${where} cites \${{${name}}}, which the agent declares neither in random nor in data `
|
|
74
|
+
+ `(${declared.length > 0 ? declared.join(', ') : 'no slot declared'})`);
|
|
75
|
+
}
|
|
76
|
+
if (blocks.has(name))
|
|
77
|
+
return whole;
|
|
78
|
+
const hint = Object.hasOwn(slots, name) ? ` — the agent declares this name: write \${{${name}}}` : '';
|
|
79
|
+
throw new RuleLoomError('PROMPT_SLOT_UNKNOWN', `${where} cites {{${name}}}, which is not a run block (${[...blocks].join(', ') || 'none declared'})${hint}`);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/** The slots a text actually cited, with their values, sorted by name. */
|
|
83
|
+
export function usedSlots(slots, used) {
|
|
84
|
+
return Object.fromEntries([...used].sort().map((name) => [name, slots[name]]));
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=slots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.js","sourceRoot":"","sources":["../src/slots.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Agent definition
|
|
2
|
+
|
|
3
|
+
## `ruleloom.json` — the project
|
|
4
|
+
|
|
5
|
+
Optional; at the project root. Every path is relative to the file, except `sharedDir` (relative to `agentsDir`) and `constraints` / `blocksDir` (relative to `sharedDir`).
|
|
6
|
+
|
|
7
|
+
| Field | Default | Meaning |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `agentsDir` | `"."` | One sub-directory per agent, each with an `agent.json`. |
|
|
10
|
+
| `sharedDir` | `"shared"` | Shared rules (`rules/`), run blocks, constraints. Never an agent. |
|
|
11
|
+
| `exclude` | `[]` | Sub-directories of `agentsDir` that are never agents. |
|
|
12
|
+
| `namePrefix` | `""` | Prefix of every generated agent name: `acme-` makes `writer` into `acme-writer`. Lowercase, digits, `-`. |
|
|
13
|
+
| `constraints` | — | A paragraph appended to every agent file. Say out loud that rules are loaded for the agent, so it does not conclude they are optional. |
|
|
14
|
+
| `blocksDir` | `"blocks"` | Run block templates. |
|
|
15
|
+
| `blockNumberFloor` | `100` | Lowest number a run block may carry; hand-written modules stay below. |
|
|
16
|
+
| `targets` | `["claude"]` | Targets compiled when none is named. |
|
|
17
|
+
| `resources` | `{}` | Shared referentials by alias (see below). |
|
|
18
|
+
| `cacheDir` | `".ruleloom/cache"` | Where Git resources are fetched. |
|
|
19
|
+
|
|
20
|
+
### Resources
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"resources": {
|
|
25
|
+
"common": { "path": "../company-rules" },
|
|
26
|
+
"security": { "git": "https://github.com/acme/agent-rules.git", "ref": "v2.3.0", "commit": "9f1c2ab", "path": "rules" }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
A module cites them as `@common/rules/00_TONE.md`. `ref` is a tag or a commit — a branch moves, and a moving source is not reproducible. `commit`, when given, makes compilation fail if the ref resolves elsewhere (`RESOURCE_COMMIT_MISMATCH`). The commit read is recorded in `build-manifest.json` either way.
|
|
32
|
+
|
|
33
|
+
## `agent.json` — one agent
|
|
34
|
+
|
|
35
|
+
| Field | Required | Meaning |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `name` | yes | The agent's own name. |
|
|
38
|
+
| `version` | yes | Recorded in prompts and manifests. |
|
|
39
|
+
| `summary` | yes | One line: what it turns into what. Becomes the platform's `description`. |
|
|
40
|
+
| `inputs`, `outputs` | — | Artefact names, for the orchestrator. RuleLoom does not read them. |
|
|
41
|
+
| `preamble` | — | Lines opening every prompt and agent file. Slots allowed. |
|
|
42
|
+
| `sharedRules` | — | File names in `<shared>/rules/`, inherited first. |
|
|
43
|
+
| `data` | — | Constant slots: `{ "TONE": "plain" }`, cited as `${{TONE}}`. Free text, no braces, ≤ 2000 characters. |
|
|
44
|
+
| `random` | — | Drawn slots: `{ "SHAPE": ["list", "table"] }`, at least two bare names. The first is taken when nothing is drawn. |
|
|
45
|
+
| `modes` | — | Variants of the agent; the first is the default. |
|
|
46
|
+
| `runtime.skills` | — | Skill slugs to preload (Claude Code). A slug the agent does not have is refused. |
|
|
47
|
+
| `mcp` | — | MCP servers by name: `{ "command", "args", "env" }` (stdio) or `{ "url" }` (HTTP). `env` lists variable names only. |
|
|
48
|
+
| `targets` | — | Per-target settings written into the agent's frontmatter or config: `claude`, `codex`, `copilot`. See [targets](targets.md). |
|
|
49
|
+
| `modules` | yes | The files, in reading order. |
|
|
50
|
+
|
|
51
|
+
### Modules
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{ "path": "source/rules/10_SHAPE.md", "tags": ["SHAPE_WRONG"], "always": false, "trailing": false, "modes": [] }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
| Field | Meaning |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `path` | Relative to the agent; `shared/…` for the shared directory; `@alias/…` for a resource. |
|
|
60
|
+
| `kind` | `rule`, `skill` or `mission`. Inferred when absent: a path under `skills/` is a skill, anything else a rule. At most one mission. |
|
|
61
|
+
| `tags` | Verification codes the module helps fix. A retry (`failedCodes`) keeps only matching modules and the `always` ones. |
|
|
62
|
+
| `always` | Kept on every retry — the output contract, above all. |
|
|
63
|
+
| `trailing` | In a prompt, placed after the run blocks: the last thing the model reads. Ignored by bundles. |
|
|
64
|
+
| `modes` | Compiled only for these modes. Empty: every mode. |
|
|
65
|
+
|
|
66
|
+
A module's slug is its file name, lowercase, `_` → `-`: `20_CHANGELOG_STYLE.md` → `20-changelog-style`. A skill's description is its first heading without the `[nn]` prefix.
|
|
67
|
+
|
|
68
|
+
## Slots and run blocks
|
|
69
|
+
|
|
70
|
+
Two sigils, two owners:
|
|
71
|
+
|
|
72
|
+
- `${{NAME}}` — the agent's: bound at compile time from `data` or `random`.
|
|
73
|
+
- `{{NAME}}` — the run's: a block template `<shared>/blocks/<number>_<NAME>.md` whose first line is `# [<number>] …` and which cites `{{NAME}}` once. `compilePrompt` appends the blocks the caller supplies, in number order, after the static text. Bundles leave `{{NAME}}` as written.
|
|
74
|
+
|
|
75
|
+
Any other `{{…}}` or `${{…}}` is a compile error naming the file.
|
|
76
|
+
|
|
77
|
+
```md
|
|
78
|
+
<!-- shared/blocks/100_BRIEF.md -->
|
|
79
|
+
# [100] BRIEF
|
|
80
|
+
|
|
81
|
+
{{BRIEF}}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Determinism
|
|
85
|
+
|
|
86
|
+
Compilation reads `agent.json` order, never a directory listing, writes no timestamp, and takes the first value of every `random` slot unless the caller passes a drawn one. Two compilations of the same inputs produce the same bytes; `build-manifest.json` carries one checksum over every emitted file. Randomness belongs to whoever runs the agent: draw once, pass the values, record them.
|
package/docs/api.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# API
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import {
|
|
5
|
+
loadProject, defineProject,
|
|
6
|
+
compilePrompt, compileBundle, compileAllBundles, writeBundles, materialiseAgent,
|
|
7
|
+
readAgentConfig, selectModules, resolveAgentSlots, bindSlots, loadBlockTemplates,
|
|
8
|
+
RuleLoomError,
|
|
9
|
+
} from 'ruleloom';
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Projects
|
|
13
|
+
|
|
14
|
+
- `loadProject(root)` — reads `root/ruleloom.json`, or the defaults when there is none.
|
|
15
|
+
- `defineProject(root, options)` — the same from an object, for a caller that keeps its conventions in code.
|
|
16
|
+
|
|
17
|
+
## Prompts
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const prompt = compilePrompt({
|
|
21
|
+
project, agent: 'writer',
|
|
22
|
+
values: { BRIEF: '…', FEEDBACK: '…' }, // run blocks
|
|
23
|
+
random: { SHAPE: 'table' }, // drawn slots; first value otherwise
|
|
24
|
+
data: { TONE: 'dry' }, // data overrides
|
|
25
|
+
failedCodes: ['SHAPE_WRONG'], // retry: tagged + always modules only
|
|
26
|
+
mode: 'digest',
|
|
27
|
+
expectedBlocks: ['BRIEF', 'FEEDBACK'], // refuse a missing or extra block template
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Returns `static`, `dynamic` (run blocks then trailing modules), `runBlocks`, `trailing`, `text`, `staticSha256`, `modules` (path, sha256, bytes), `unresolvedBlocks`, `cited`, `slots`, `selection` (`full` | `retry`).
|
|
32
|
+
|
|
33
|
+
## Bundles
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
const bundle = compileBundle({ project, agent: 'writer', target: 'codex', scope: 'isolated' });
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Returns `{ agent, agentName, target, files, manifest }`. `files` is a `Map<path, content>` including `build-manifest.json`:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"agent": "writer", "version": "1.0.0", "target": "codex", "scope": "isolated",
|
|
44
|
+
"sources": [{ "path": "source/rules/10_SHAPE.md", "sha256": "…", "bytes": 61 }],
|
|
45
|
+
"resources": [{ "alias": "common", "url": "…", "ref": "v1", "commit": "…" }],
|
|
46
|
+
"files": [{ "path": "AGENTS.md", "sha256": "…", "bytes": 812 }],
|
|
47
|
+
"checksum": "…",
|
|
48
|
+
"cited": { "SHAPE": "list" },
|
|
49
|
+
"slots": { "SHAPE": "list", "TONE": "plain" },
|
|
50
|
+
"notes": ["…"]
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- `compileAllBundles(project, { target })` — every agent.
|
|
55
|
+
- `writeBundles({ project, target, outRoot, agent?, check? })` — writes `outRoot/<agent>/` and returns `{ written, drifted, orphaned, bundles }`.
|
|
56
|
+
- `materialiseAgent({ project, agent, target, runtimeRoot })` — a dedicated workspace; `RUNTIME_ROOT_NOT_ISOLATED` when configuration above it would leak in.
|
|
57
|
+
- `inheritedConfig(dir, target)` — what an agent launched in `dir` would inherit from its parents.
|
|
58
|
+
|
|
59
|
+
## Lower level
|
|
60
|
+
|
|
61
|
+
`assembleAgent` (the platform-neutral agent every adapter receives), `ADAPTERS` / `claudeAdapter` / `codexAdapter` / `copilotAdapter`, `selectModules`, `resolveAgentSlots`, `bindSlots`, `loadBlockTemplates`, `renderBlock`, `moduleSlug`, `moduleTitle`, `yamlScalar`.
|
|
62
|
+
|
|
63
|
+
## Errors
|
|
64
|
+
|
|
65
|
+
Every failure is a `RuleLoomError` with a stable `code` and a message starting with it. Match on `error.code`, never on the sentence. See [errors](errors.md).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
RuleLoom is the second of four stages. It does not run agents; it produces what a platform needs to run one, and records exactly what it produced.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
1 Referentials 2 Compiler 3 Dedicated workspaces 4 Orchestration
|
|
7
|
+
─────────────── ───────────── ────────────────────── ───────────────
|
|
8
|
+
shared rules, skills, resolve references Claude Code .claude/ CI/CD: build, test,
|
|
9
|
+
MCP servers assemble modules, Codex AGENTS.md review, docs
|
|
10
|
+
local dirs, Git repos slots, MCP Copilot .github/ LangGraph: chaining,
|
|
11
|
+
agent.json per agent adapt native format parallelism,
|
|
12
|
+
validate limits, names one agent, its own validation, retry
|
|
13
|
+
permissions; secrets
|
|
14
|
+
injected at runtime
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 1. Referentials
|
|
18
|
+
|
|
19
|
+
Everything an agent is made of is a file under version control:
|
|
20
|
+
|
|
21
|
+
- `agents/<name>/agent.json` — the agent: its modules in order, slots, modes, MCP servers, per-target settings.
|
|
22
|
+
- `agents/shared/` — rules several agents inherit (`sharedRules`), run block templates, the constraints paragraph.
|
|
23
|
+
- Resources declared in `ruleloom.json` — a local directory or a Git repository at a pinned ref, cited as `@alias/…`. The commit actually read is recorded in each build manifest, so a ref that moves cannot change a build unnoticed (`commit` pins it hard).
|
|
24
|
+
|
|
25
|
+
## 2. Compiler
|
|
26
|
+
|
|
27
|
+
| Step | What happens | Fails with |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| Resolve | `agent.json` and `ruleloom.json` validated; module paths located in the agent, `shared/` or a resource; Git resources fetched at their ref | `AGENT_CONFIG_INVALID`, `RESOURCE_*`, `MODULE_PATH_OUTSIDE` |
|
|
30
|
+
| Assemble | modules selected for the mode (and, for a prompt, the failed codes); `${{slots}}` bound; rules, skills and the mission named | `AGENT_SLOT_UNKNOWN`, `PROMPT_SLOT_UNKNOWN`, `AGENT_MODE_UNKNOWN`, `AGENT_PRELOAD_SKILL_UNKNOWN` |
|
|
31
|
+
| Adapt | one adapter per target writes the platform's files | `TARGET_OVERRIDE_*`, `COPILOT_AGENT_TOO_LARGE` |
|
|
32
|
+
| Validate | names and sizes every target accepts; a checksum over every emitted file | `SKILL_NAME_INVALID`, `SKILL_DESCRIPTION_TOO_LONG` |
|
|
33
|
+
|
|
34
|
+
Two outputs:
|
|
35
|
+
|
|
36
|
+
- **A bundle** (`compileBundle`): a directory the platform loads by itself. Rules stay one file each where the platform supports it, because a separate file is what lets a human see which rule an agent followed.
|
|
37
|
+
- **A prompt** (`compilePrompt`): one string for a completion API, split into a static half (cacheable) and a dynamic half (the run blocks, then the trailing modules).
|
|
38
|
+
|
|
39
|
+
## 3. Dedicated workspaces
|
|
40
|
+
|
|
41
|
+
`materialiseAgent` lays a bundle out as the whole configuration of a directory, with a `workspace/` for inputs and deliverables. It refuses a root that has platform configuration above it: Claude Code and Codex both walk up the tree and load what they find, so an agent launched under a repository would also read that repository's instructions.
|
|
42
|
+
|
|
43
|
+
Secrets are not part of a workspace. MCP servers reference variables (`${TOKEN}` for Claude Code and Copilot, `env_vars` for Codex); the launcher provides them.
|
|
44
|
+
|
|
45
|
+
## 4. Orchestration
|
|
46
|
+
|
|
47
|
+
Outside RuleLoom. An orchestrator (a CI job, a LangGraph graph) compiles or materialises an agent, launches it, checks its output, and on failure recompiles the prompt with `failedCodes` — only the modules tagged with what failed, so a retry costs a fraction of the first attempt. Build manifests make every run attributable to exact sources.
|
package/docs/cli.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# CLI
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
ruleloom validate [--project dir] [--target t]...
|
|
5
|
+
ruleloom compile [--project dir] [--target t]... [--agent name] [--out dir] [--check]
|
|
6
|
+
[--mode m] [--data NAME=value]... [--random NAME=value]...
|
|
7
|
+
ruleloom prompt --agent name [--project dir] [--mode m] [--failed CODE,CODE]
|
|
8
|
+
[--value NAME=file]... [--data NAME=value]... [--random NAME=value]...
|
|
9
|
+
ruleloom materialise --agent name --root dir [--project dir] [--target t] [--mode m]
|
|
10
|
+
ruleloom list [--project dir]
|
|
11
|
+
ruleloom --version
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`--project` is the directory holding `ruleloom.json` (default: the current directory). `--target` may be repeated; without it, the project's `targets` are used.
|
|
15
|
+
|
|
16
|
+
| Command | What it does | Exit code |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `validate` | Compiles every agent for every target in memory; prints checksums and notes. | 1 on the first error |
|
|
19
|
+
| `compile` | Writes `<out>/<target>/<agent>/` (default `.ruleloom/build`), removing files no bundle produces any more. With `--check`, writes nothing and reports drift. | 1 on drift under `--check` |
|
|
20
|
+
| `prompt` | Prints one agent's compiled prompt. `--value BRIEF=brief.md` fills a run block from a file; `--failed` compiles a retry. | 0; unresolved blocks are listed on stderr |
|
|
21
|
+
| `materialise` | Lays one bundle out as a dedicated workspace under `--root`; refuses a root with platform configuration above it. Prints `cwd`, `workspace`, `agentName`, `checksum`. | 1 if the root is not isolated |
|
|
22
|
+
| `list` | Prints the project's agents. | 0 |
|
|
23
|
+
|
|
24
|
+
In CI:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx ruleloom compile --check --out generated
|
|
28
|
+
```
|
package/docs/errors.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Error codes
|
|
2
|
+
|
|
3
|
+
Every failure is a `RuleLoomError` whose `code` is one of these and whose message starts with it. Schema codes (marked *schema*) appear inside `AGENT_CONFIG_INVALID` or `PROJECT_CONFIG_INVALID`, after the field path.
|
|
4
|
+
|
|
5
|
+
## Definitions
|
|
6
|
+
|
|
7
|
+
| Code | Cause |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `AGENT_CONFIG_UNREADABLE` / `AGENT_CONFIG_INVALID` | `agent.json` is not JSON, or fails the schema; the message lists every issue. |
|
|
10
|
+
| `PROJECT_CONFIG_UNREADABLE` / `PROJECT_CONFIG_INVALID` | Same, for `ruleloom.json`. |
|
|
11
|
+
| `RANDOM_NAME_INVALID`, `DATA_NAME_INVALID` *schema* | A slot name that is not `UPPER_SNAKE`. |
|
|
12
|
+
| `RANDOM_VALUE_INVALID`, `DATA_VALUE_INVALID` *schema* | A value that could carry a brace into the text, or too long. |
|
|
13
|
+
| `AGENT_SLOT_DUPLICATED` *schema* | One name in both `random` and `data`. |
|
|
14
|
+
| `MODE_INVALID`, `AGENT_MODE_DUPLICATED`, `AGENT_MODE_UNKNOWN` *schema* | A malformed mode, a repeated one, or a module bound to a mode the agent does not declare. |
|
|
15
|
+
| `MCP_NAME_INVALID`, `MCP_TRANSPORT_INVALID`, `MCP_ENV_NAME_INVALID` *schema* | An MCP server with a bad name, both or neither of `command` / `url`, or an `env` entry that is not a variable name (a value would be a secret in every generated file). |
|
|
16
|
+
| `TARGET_KEY_INVALID`, `TARGET_VALUE_MULTILINE` *schema* | A per-target setting that cannot be written as one frontmatter line. |
|
|
17
|
+
| `SUMMARY_MULTILINE` *schema* | The summary becomes a one-line description. |
|
|
18
|
+
| `NAME_PREFIX_INVALID`, `RESOURCE_ALIAS_INVALID` *schema* | Project naming. |
|
|
19
|
+
|
|
20
|
+
## Resolution
|
|
21
|
+
|
|
22
|
+
| Code | Cause |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `AGENTS_ROOT_MISSING`, `AGENT_NOT_FOUND` | No such directory, or no `agent.json` in it. |
|
|
25
|
+
| `AGENT_MODULE_MISSING` | A module path names no file. |
|
|
26
|
+
| `MODULE_PATH_OUTSIDE` | A module path leaves its root (`../`). |
|
|
27
|
+
| `SHARED_RULE_MISSING` | A `sharedRules` entry not in `<shared>/rules/`; the message lists the known ones. |
|
|
28
|
+
| `CONSTRAINTS_MISSING` | The project's `constraints` file does not exist. |
|
|
29
|
+
| `RESOURCE_UNKNOWN`, `RESOURCE_MISSING`, `RESOURCE_PATH_OUTSIDE` | An `@alias` the project does not declare, a local resource that does not exist, a resource `path` that leaves its repository. |
|
|
30
|
+
| `RESOURCE_GIT_FETCH_FAILED` | The repository or the ref could not be fetched. |
|
|
31
|
+
| `RESOURCE_COMMIT_MISMATCH` | The ref resolves to another commit than the one pinned. |
|
|
32
|
+
|
|
33
|
+
## Assembly and slots
|
|
34
|
+
|
|
35
|
+
| Code | Cause |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `AGENT_SLOT_UNKNOWN` | `${{NAME}}` the agent declares in neither `data` nor `random`. |
|
|
38
|
+
| `PROMPT_SLOT_UNKNOWN` | `{{NAME}}` that is not a run block; the hint names `${{NAME}}` when the agent declares it. |
|
|
39
|
+
| `RANDOM_VALUE_UNKNOWN` | A drawn value outside the declared list. |
|
|
40
|
+
| `DATA_OVERRIDE_INVALID` | An override that is not a short name. |
|
|
41
|
+
| `AGENT_PRELOAD_SKILL_UNKNOWN` | `runtime.skills` names a skill the agent does not have. |
|
|
42
|
+
| `AGENT_MULTIPLE_MISSIONS` | More than one `mission` module. |
|
|
43
|
+
| `RULE_SLUG_COLLISION`, `SKILL_SLUG_COLLISION` | Two modules with the same file name. |
|
|
44
|
+
| `PROMPT_NO_MODULES` | Nothing selected — usually a retry whose codes match no tag and no `always` module. |
|
|
45
|
+
| `PROMPT_VALUE_UNKNOWN` | A value for a block that has no template. |
|
|
46
|
+
|
|
47
|
+
## Run blocks
|
|
48
|
+
|
|
49
|
+
| Code | Cause |
|
|
50
|
+
|---|---|
|
|
51
|
+
| `PROMPT_BLOCKS_MISSING` | Blocks are expected and the directory does not exist. |
|
|
52
|
+
| `PROMPT_BLOCK_NAME` | A file not named `<number>_<NAME>.md`. |
|
|
53
|
+
| `PROMPT_BLOCK_UNKNOWN`, `PROMPT_BLOCK_MISSING` | Against `expectedBlocks`: an extra block, or a missing one. |
|
|
54
|
+
| `PROMPT_BLOCK_DUPLICATE` | Two files for one block. |
|
|
55
|
+
| `PROMPT_BLOCK_NUMBER_RANGE` | A number below the floor. |
|
|
56
|
+
| `PROMPT_BLOCK_NUMBER_MISMATCH` | The heading's `[n]` differs from the file number. |
|
|
57
|
+
| `PROMPT_BLOCK_SLOT`, `PROMPT_BLOCK_FOREIGN_SLOT` | The template cites its own slot not exactly once, or cites another. |
|
|
58
|
+
|
|
59
|
+
## Targets
|
|
60
|
+
|
|
61
|
+
| Code | Cause |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `SKILL_NAME_INVALID`, `SKILL_DESCRIPTION_TOO_LONG` | A skill every target would not accept. |
|
|
64
|
+
| `AGENT_NAME_INVALID` | An agent name Copilot cannot use as a file name. |
|
|
65
|
+
| `TARGET_OVERRIDE_RESERVED` | A per-target key RuleLoom writes itself (`name`, `description`…). |
|
|
66
|
+
| `TARGET_OVERRIDE_UNKNOWN` | A Codex key outside the documented ones. |
|
|
67
|
+
| `TARGET_OVERRIDE_FORBIDDEN` | `permissionMode: bypassPermissions` (Claude Code), `sandbox_mode: danger-full-access` (Codex). |
|
|
68
|
+
| `COPILOT_AGENT_TOO_LARGE` | Agent body over 30,000 characters. |
|
|
69
|
+
| `ADAPTER_RESERVED_PATH` | An adapter tried to write `build-manifest.json`. |
|
|
70
|
+
| `RUNTIME_ROOT_NOT_ISOLATED` | `materialiseAgent` under a root with platform configuration above it. |
|
|
71
|
+
|
|
72
|
+
## CLI
|
|
73
|
+
|
|
74
|
+
| Code | Cause |
|
|
75
|
+
|---|---|
|
|
76
|
+
| `CLI_USAGE`, `CLI_PAIR_INVALID`, `TARGET_UNKNOWN` | A missing flag, a `NAME=value` without `=`, an unknown target. |
|
package/docs/targets.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Targets
|
|
2
|
+
|
|
3
|
+
Each adapter writes what its platform documents, and nothing it does not. Sources checked 2026-11-30.
|
|
4
|
+
|
|
5
|
+
## Claude Code — `claude`
|
|
6
|
+
|
|
7
|
+
| File | Content |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `.claude/agents/<name>.md` | Frontmatter `name`, `description` (the summary), `skills` (the preload, comma-separated), then `targets.claude` keys. Body: preamble, mission, constraints. |
|
|
10
|
+
| `.claude/rules/<slug>.md` | One per rule, shared rules first. No `paths` frontmatter: loaded at launch. |
|
|
11
|
+
| `.claude/skills/<slug>/SKILL.md` | Frontmatter `name` (= directory), `description` (first heading). |
|
|
12
|
+
| `.mcp.json` | `mcpServers`: stdio `{type, command, args, env}` with `env` values written as `${NAME}`; HTTP `{type: "http", url}`. |
|
|
13
|
+
|
|
14
|
+
`targets.claude` accepts any subagent frontmatter key (`tools`, `model`, `permissionMode`, `maxTurns`…), written as given. `name`, `description` and `skills` are RuleLoom's. `permissionMode: bypassPermissions` is refused.
|
|
15
|
+
|
|
16
|
+
Notes: Claude Code asks the user to approve project MCP servers. `.claude/` and `CLAUDE.md` are inherited from parent directories — see `materialiseAgent`.
|
|
17
|
+
|
|
18
|
+
Sources: <https://code.claude.com/docs/en/memory>, <https://code.claude.com/docs/en/skills>, <https://code.claude.com/docs/en/sub-agents>, <https://code.claude.com/docs/en/mcp>.
|
|
19
|
+
|
|
20
|
+
## OpenAI Codex — `codex`
|
|
21
|
+
|
|
22
|
+
| File | Content |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `AGENTS.md` | `# <name>`, the summary, preamble, mission, constraints, then every rule, separated by `---`. Codex has no modular rules directory. |
|
|
25
|
+
| `.agents/skills/<slug>/SKILL.md` | Frontmatter `name`, `description`. |
|
|
26
|
+
| `.codex/config.toml` | `targets.codex` keys; `project_doc_max_bytes` when `AGENTS.md` exceeds 32 KiB; `[mcp_servers.<name>]` with `command`, `args`, `env_vars` (names forwarded from Codex's environment) or `url`. |
|
|
27
|
+
|
|
28
|
+
`targets.codex` accepts `model`, `model_reasoning_effort`, `sandbox_mode`, `approval_policy` (strings). `sandbox_mode: danger-full-access` is refused.
|
|
29
|
+
|
|
30
|
+
Notes: Codex stops reading instructions at `project_doc_max_bytes` (32 KiB by default); RuleLoom raises it rather than letting the file be cut. A project `.codex/config.toml` is loaded only for a project the user trusts — the build manifest says so. Codex has no skill preload and no project-level prompt files.
|
|
31
|
+
|
|
32
|
+
Sources: <https://learn.chatgpt.com/docs/agent-configuration/agents-md>, <https://learn.chatgpt.com/docs/build-skills>, <https://learn.chatgpt.com/docs/extend/mcp>, <https://learn.chatgpt.com/docs/config-file/config-reference>.
|
|
33
|
+
|
|
34
|
+
## GitHub Copilot — `copilot`
|
|
35
|
+
|
|
36
|
+
| File | Content |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `.github/agents/<name>.agent.md` | Frontmatter `name`, `description`, then `targets.copilot` keys (`tools` as a list). Body: preamble, mission, constraints — at most 30,000 characters. |
|
|
39
|
+
| `.github/instructions/<slug>.instructions.md` | One per rule, `applyTo: "**"`. |
|
|
40
|
+
| `.github/skills/<slug>/SKILL.md` | Frontmatter `name` (= directory, lowercase, ≤ 64), `description` (≤ 1024). |
|
|
41
|
+
| `.mcp.json` | Same shape as Claude Code's: the Copilot harness in VS Code reads it. |
|
|
42
|
+
|
|
43
|
+
Notes: the cloud coding agent reads MCP servers from the repository settings, not from a file — the manifest says so. A body over 30,000 characters is refused (`COPILOT_AGENT_TOO_LARGE`): move text from the mission into rules.
|
|
44
|
+
|
|
45
|
+
Sources: <https://docs.github.com/en/copilot/reference/custom-agents-configuration>, <https://code.visualstudio.com/docs/agents/reference/custom-instructions-reference>, <https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-skills>, <https://code.visualstudio.com/docs/agents/reference/mcp-configuration>.
|
|
46
|
+
|
|
47
|
+
## Limits every target shares
|
|
48
|
+
|
|
49
|
+
Skill names are validated against the strictest platform (Copilot): lowercase letters, digits and hyphens, at most 64 characters (`SKILL_NAME_INVALID`). Descriptions at most 1024 characters. Frontmatter values are quoted whenever plain YAML would misread them — a platform that cannot parse a file skips it without a word.
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ruleloom",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Define an AI agent once — rules, skills, MCP servers, variables — and compile it into the native configuration of Claude Code, OpenAI Codex and GitHub Copilot.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai-agents",
|
|
7
|
+
"claude-code",
|
|
8
|
+
"codex",
|
|
9
|
+
"github-copilot",
|
|
10
|
+
"agents-md",
|
|
11
|
+
"prompt-engineering",
|
|
12
|
+
"mcp",
|
|
13
|
+
"compiler"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=20"
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"bin": {
|
|
30
|
+
"ruleloom": "dist/cli.js"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"README.md",
|
|
35
|
+
"CHANGELOG.md",
|
|
36
|
+
"LICENSE",
|
|
37
|
+
"docs"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && chmod +x dist/cli.js",
|
|
41
|
+
"typecheck": "tsc --noEmit",
|
|
42
|
+
"test": "vitest run",
|
|
43
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"zod": "^4.6.6"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^22.10.0",
|
|
50
|
+
"typescript": "^5.7.3",
|
|
51
|
+
"vitest": "^3.0.5"
|
|
52
|
+
}
|
|
53
|
+
}
|