llm-orchestrator 1.3.0 → 1.4.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/.claude-plugin/plugin.json +1 -1
- package/README.md +22 -13
- package/SKILL.md +3 -1
- package/adapters/agents.mjs +111 -12
- package/adapters/commands.mjs +2 -2
- package/agents/adversarial-skeptic.md +43 -3
- package/agents/backend-fixer.md +41 -3
- package/agents/code-reviewer.md +43 -3
- package/agents/code-simplifier.md +41 -3
- package/agents/db-concurrency-specialist.md +45 -3
- package/agents/db-migration-author.md +44 -3
- package/agents/explore.md +43 -3
- package/agents/frontend-fixer.md +41 -3
- package/agents/frontend-specialist.md +42 -3
- package/agents/general.md +40 -3
- package/agents/orchestrator.md +46 -3
- package/agents/production-telemetry-collector.md +45 -3
- package/agents/provider-webhook-specialist.md +44 -3
- package/agents/route-data-flow-tracer.md +43 -3
- package/agents/test-engineer.md +42 -3
- package/bin/attribution-check.mjs +1 -1
- package/commands/incident-close.md +10 -0
- package/commands/incident-evidence.md +10 -0
- package/commands/incident-fix.md +10 -0
- package/commands/incident-start.md +10 -0
- package/commands/incident-verify.md +10 -0
- package/commands/orchestrate.md +10 -0
- package/commands/task-cancel.md +10 -0
- package/commands/task-plan.md +10 -0
- package/commands/task-status.md +10 -0
- package/commands/task-verify.md +10 -0
- package/commands/task.md +62 -0
- package/lib/adapter-renderer.mjs +5 -1
- package/lib/router.mjs +9 -5
- package/models/top-models.json +6 -2
- package/package.json +2 -1
- package/policies/routing.md +2 -2
- package/protocol.md +3 -1
- package/registries/agent-roles.json +324 -10
- package/registries/routing-matrix.json +6 -6
- package/schemas/agent-roles.schema.json +88 -1
- package/schemas/top-models.schema.json +5 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "llm-orchestrator",
|
|
3
3
|
"description": "Write /task once — it plans the work, shards it across parallel subagents, gates every phase and verifies before claiming done. Claude Code, Codex, OpenCode, Kilo.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Bogdan-Gabriel Torcescu",
|
|
7
7
|
"url": "https://www.linkedin.com/in/bogdantorcescu/"
|
package/README.md
CHANGED
|
@@ -86,9 +86,16 @@ No clone, no Node invocation. Type these two in any Claude Code session:
|
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
That registers the `orchestrate-core` skill straight from this repository, and `/plugin update
|
|
89
|
-
llm-orchestrator@tbogdan` keeps it current. The plugin ships the
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
llm-orchestrator@tbogdan` keeps it current. The plugin also ships the native commands (`/task`,
|
|
90
|
+
`/task-plan`, `/task-status`, `/task-cancel`, `/task-verify`, `/incident-*`, `/orchestrate`),
|
|
91
|
+
namespaced by the plugin as `/llm-orchestrator:task` and so on; the bare `/task` works too while no
|
|
92
|
+
other command claims the name — but a CLI install (below) also writes a project
|
|
93
|
+
`.claude/commands/task.md`, and once both are present the bare `/task` resolves ambiguously between
|
|
94
|
+
them, so pick one install path, or always use the namespaced `/llm-orchestrator:task`. It does not
|
|
95
|
+
write project files. If you also want `.claude/commands/*.md`, the per-role agent files under
|
|
96
|
+
`.claude/agents/` (one per role in `registries/agent-roles.json`, written only with
|
|
97
|
+
`--with-agents`) and the `@AGENTS.md` line in `CLAUDE.md`, run the CLI install below with
|
|
98
|
+
`--harness claude`.
|
|
92
99
|
|
|
93
100
|
### Codex, OpenCode, Kilo — install from npm
|
|
94
101
|
|
|
@@ -119,8 +126,8 @@ node bin/llm-orchestrator.mjs install --project /path/to/app --harness <harness>
|
|
|
119
126
|
|
|
120
127
|
| Harness | Fastest install | What it gives you | Reload |
|
|
121
128
|
| --- | --- | --- | --- |
|
|
122
|
-
| Claude Code | `/plugin install llm-orchestrator@tbogdan` | the `orchestrate-core` skill | new session |
|
|
123
|
-
| Claude Code (full) | `npx llm-orchestrator install --harness claude --apply` | skill + commands +
|
|
129
|
+
| Claude Code | `/plugin install llm-orchestrator@tbogdan` | the `orchestrate-core` skill, `/llm-orchestrator:task` and the other commands, the role agents | new session |
|
|
130
|
+
| Claude Code (full) | `npx llm-orchestrator install --harness claude --apply` | skill + commands (+ role agents with `--with-agents`) + `CLAUDE.md` binding | `/reload` or new session |
|
|
124
131
|
| Codex | `npx llm-orchestrator install --harness codex --apply` | `AGENTS.md` span, skill, `~/.codex/prompts/*.md` | new Codex session |
|
|
125
132
|
| OpenCode | `npx llm-orchestrator install --harness opencode --apply` | `.opencode/command(s)/*.md`, skill | restart `opencode` |
|
|
126
133
|
| Kilo | `npx llm-orchestrator install --harness kilo --apply` | `.kilo/command(s)/*.md`, skill | restart Kilo |
|
|
@@ -278,7 +285,9 @@ example below spells the clone form, and the npm form is identical minus the `no
|
|
|
278
285
|
|
|
279
286
|
`--package-root <dir>` (where the package's own files are read from) and `--state-root <dir>` (where the installation manifest is kept; defaults to `$XDG_STATE_HOME/portable-orchestrator` or `~/.local/state/portable-orchestrator`) exist on `install`, `uninstall` and `init` for testing and for non-standard layouts — you normally leave both alone.
|
|
280
287
|
|
|
281
|
-
Multiple harnesses may share one explicitly enabled skill root using a comma-separated `--harness` value; when you don't pass `--skills-root` in that case it defaults to the shared `~/.agents/skills`, and *you* must ensure every selected harness is actually pointed at that root (see "Several harnesses at once" below). Add `--with-agents` to also render the per-harness
|
|
288
|
+
Multiple harnesses may share one explicitly enabled skill root using a comma-separated `--harness` value; when you don't pass `--skills-root` in that case it defaults to the shared `~/.agents/skills`, and *you* must ensure every selected harness is actually pointed at that root (see "Several harnesses at once" below). Add `--with-agents` to also render one agent file per role in `registries/agent-roles.json` under the per-harness agent directory (`.claude/agents/`, `.opencode/agent/`, `.kilo/agent/`; no-op for Codex). Add `--link-claude` to have the installer create the `~/.claude/skills/orchestrate-core -> <skills-root>/orchestrate-core` symlink itself when Claude is one of several harnesses sharing a non-default root (idempotent; it never replaces a real directory). Restart/reload a session whose skill catalog is cached.
|
|
289
|
+
|
|
290
|
+
Each rendered agent carries native frontmatter for its harness: Claude Code gets `disallowedTools: Write, Edit, NotebookEdit` on an edit-denied role (read-only roles and the orchestrator); OpenCode and Kilo get `mode: subagent` (`primary` for the orchestrator) and `permission: edit: deny` on the same roles. Edit denial does not sandbox shell writes: it removes the edit tools only, and read-only roles keep Bash for inspection; the rendered Permissions section tells them never to write through the shell, and a hard boundary needs the harness's own shell permissions. On OpenCode and Kilo, the rendered `general.md` and `explore.md` share their names with the built-in `general` and `explore` subagents and replace their prompts project-wide. That is intended: the role ids are what the flow gate classifies dispatches by, and the replacements stay bounded (`general`, RW within its owned files) or read-only (`explore`).
|
|
282
291
|
|
|
283
292
|
### Step by step
|
|
284
293
|
|
|
@@ -306,9 +315,9 @@ Same five steps for every harness; only the skills root and the reload differ.
|
|
|
306
315
|
| Harness | `--harness` | `--skills-root` | Where things land | Reload |
|
|
307
316
|
| --- | --- | --- | --- | --- |
|
|
308
317
|
| Codex | `codex` | `~/.agents/skills` (default) | `AGENTS.md` span, `.agents/skills/orchestrate/SKILL.md`, `~/.codex/prompts/*.md` | new Codex session |
|
|
309
|
-
| Claude / Claude Code | `claude` | `~/.claude/skills` (or symlink it to `~/.agents/skills/orchestrate-core`) | `.claude/commands/*.md`, `CLAUDE.md` gets `@AGENTS.md`, `--with-agents` → `.claude/agents
|
|
310
|
-
| OpenCode | `opencode` | `~/.config/opencode/skills` | `.opencode/commands/*.md`, `--with-agents` → `.opencode/agent
|
|
311
|
-
| Kilo | `kilo` | `~/.kilo/skills` | `.kilo/commands/*.md`, `--with-agents` → `.kilo/agent
|
|
318
|
+
| Claude / Claude Code | `claude` | `~/.claude/skills` (or symlink it to `~/.agents/skills/orchestrate-core`) | `.claude/commands/*.md`, `CLAUDE.md` gets `@AGENTS.md`, `--with-agents` → one agent file per role under `.claude/agents/` | `/reload` or new session |
|
|
319
|
+
| OpenCode | `opencode` | `~/.config/opencode/skills` | `.opencode/commands/*.md`, `--with-agents` → one agent file per role under `.opencode/agent/` | restart `opencode` |
|
|
320
|
+
| Kilo | `kilo` | `~/.kilo/skills` | `.kilo/commands/*.md`, `--with-agents` → one agent file per role under `.kilo/agent/` | restart Kilo / `kilo debug skill --pure` to confirm discovery |
|
|
312
321
|
|
|
313
322
|
Several harnesses at once: `--harness codex,claude,opencode,kilo --skills-root ~/.agents/skills`, then make sure each IDE is pointed at that root (Claude Code accepts a personal skill-folder symlink; OpenCode and Kilo need the root enabled in their config).
|
|
314
323
|
|
|
@@ -342,9 +351,9 @@ Generic rules live in `orchestrate-core`; this section only adds or tightens.
|
|
|
342
351
|
### Per-harness notes
|
|
343
352
|
|
|
344
353
|
- **Codex** reads `AGENTS.md` plus `.agents/skills/*/SKILL.md`; custom prompts install to `~/.codex/prompts/*.md` (or `--codex-prompts-root <dir>`); subagents dispatch via `spawn_agent`, plans via `update_plan`.
|
|
345
|
-
- **Claude Code** installs `.claude/commands/*.md`, `.claude/agents/*.md
|
|
346
|
-
- **OpenCode** installs `.opencode/command(s)/*.md`, `.opencode/agent/*.md
|
|
347
|
-
- **Kilo** installs `.kilo/command(s)/*.md`, `.kilo/agent/*.md
|
|
354
|
+
- **Claude Code** installs `.claude/commands/*.md`, `.claude/agents/*.md` (with `--with-agents`), `.claude/skills/*/SKILL.md`, and adds `@AGENTS.md` to `CLAUDE.md`; subagents dispatch via the Agent tool.
|
|
355
|
+
- **OpenCode** installs `.opencode/command(s)/*.md`, `.opencode/agent/*.md` (with `--with-agents`), skills under `~/.config/opencode/skills`; subagents dispatch via the task tool. Sequential Thinking's permission key is `sequentialthinking_sequentialthinking`.
|
|
356
|
+
- **Kilo** installs `.kilo/command(s)/*.md`, `.kilo/agent/*.md` (with `--with-agents`), skills under `~/.kilo/skills`/`.kilo/skills`; Agent Manager worktrees live under `.kilo/worktrees/`. Same Sequential Thinking permission key as OpenCode.
|
|
348
357
|
|
|
349
358
|
### Flow adherence
|
|
350
359
|
|
|
@@ -456,7 +465,7 @@ Incumbents hold a seat on a provider ladder. Candidates are measured but unseate
|
|
|
456
465
|
|---|---|---|---|---|---|---|
|
|
457
466
|
| GPT-6 Luna | openai | codex | incumbent | W | low, medium, high, xhigh, max (reasoning_effort) | $0.1 / $0.5 |
|
|
458
467
|
| GPT-5.6 Luna | openai | codex | incumbent (fallback for GPT-6 Luna) | W | low, medium, high, xhigh, max (reasoning_effort) | $0.2 / $1.2 |
|
|
459
|
-
| GPT-5.6 Terra | openai | codex | incumbent | S | low, medium, high, xhigh, max (reasoning_effort) | $2 / $12 |
|
|
468
|
+
| GPT-5.6 Terra | openai | codex | incumbent (S fallback; GPT-6 Sol holds the S seat one notch down) | S | low, medium, high, xhigh, max (reasoning_effort) | $2 / $12 |
|
|
460
469
|
| GPT-6 Sol | openai | codex | incumbent | X | low, medium, high, xhigh, max (reasoning_effort) | $2 / $10 |
|
|
461
470
|
| GPT-5.6 Sol | openai | codex | incumbent (fallback for GPT-6 Sol) | X | low, medium, high, xhigh, max (reasoning_effort) | $4 / $20 |
|
|
462
471
|
| GPT-6 Astra | openai | codex | incumbent | F | low, medium, high, xhigh, max (reasoning_effort) | $10 / $50 |
|
package/SKILL.md
CHANGED
|
@@ -26,7 +26,9 @@ merely worse — it makes it invalid.
|
|
|
26
26
|
Disk presence never proves callability. Never invent a server, tool or skill name.
|
|
27
27
|
4. **Emit the pre-evaluation JSON** — the full object in [protocol.md](protocol.md). No dispatch,
|
|
28
28
|
no edit, no shell before it exists. Then open the run:
|
|
29
|
-
`node <
|
|
29
|
+
`node <package root>/bin/llm-orchestrator.mjs run start --type <TASK_TYPE> --shards <n>`, where
|
|
30
|
+
the package root is the absolute directory you read this SKILL.md from (the path the
|
|
31
|
+
`orchestrate-core` pointer resolved to — not the `skills/orchestrate-core/` pointer directory)
|
|
30
32
|
(`llm-orchestrator run start ...` when installed from npm; the PlanShard count from step 5 may be
|
|
31
33
|
added once known). A task too small for the flow is declared, not skipped:
|
|
32
34
|
`... run start --trivial "<reason>"`.
|
package/adapters/agents.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import {readFileSync} from 'node:fs';
|
|
|
4
4
|
|
|
5
5
|
const MD_MARKER = '<!-- llm-orchestrator · created by Bogdan-Gabriel Torcescu · https://www.linkedin.com/in/bogdantorcescu/ · keep this credit when copying or deriving -->';
|
|
6
6
|
const REGISTRY_URL = new URL('../registries/agent-roles.json', import.meta.url);
|
|
7
|
+
const PREFERRED_TOOLS_URL = new URL('../registries/preferred-tools.json', import.meta.url);
|
|
7
8
|
|
|
8
9
|
let registryCache = null;
|
|
9
10
|
function loadRegistry() {
|
|
@@ -16,31 +17,129 @@ function loadRegistry() {
|
|
|
16
17
|
return registryCache;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
// MCP aliases from registries/preferred-tools.json, keyed by canonical server id. A role
|
|
21
|
+
// names the server id; the alias (the tool name the policies call, e.g. `sequentialthinking`)
|
|
22
|
+
// is rendered beside it so neither name is lost.
|
|
23
|
+
let mcpAliasCache = null;
|
|
24
|
+
function mcpAliases() {
|
|
25
|
+
if (mcpAliasCache) return mcpAliasCache;
|
|
26
|
+
try {
|
|
27
|
+
const {tools = []} = JSON.parse(readFileSync(PREFERRED_TOOLS_URL, 'utf8'));
|
|
28
|
+
mcpAliasCache = new Map(tools.filter((tool) => tool.kind === 'mcp').map((tool) => [tool.id, tool.aliases ?? []]));
|
|
29
|
+
} catch {
|
|
30
|
+
mcpAliasCache = new Map();
|
|
31
|
+
}
|
|
32
|
+
return mcpAliasCache;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Same wording as adapters/commands.mjs: the global skill and the project bridge are two files.
|
|
36
|
+
const ORCHESTRATE_LINE = 'Mandatory — before acting, load and follow the `orchestrate-core` skill (or, in a project install, the bridge `.agents/skills/orchestrate/SKILL.md`).';
|
|
37
|
+
// Edit denial removes the edit tools only; Bash can still write, so RO roles say so.
|
|
38
|
+
const RO_SHELL_LINE = 'Bash is for inspection only; edit denial does not sandbox shell writes — never write through the shell.';
|
|
39
|
+
|
|
40
|
+
const bullets = (items) => items.map((item) => `- ${item}`).join('\n');
|
|
41
|
+
const codeList = (items) => items.map((item) => `\`${item}\``).join(', ');
|
|
42
|
+
const mcpList = (items) => items.map((id) => {
|
|
43
|
+
const aliases = mcpAliases().get(id) ?? [];
|
|
44
|
+
return aliases.length ? `\`${id}\` (alias ${codeList(aliases)})` : `\`${id}\``;
|
|
45
|
+
}).join(', ');
|
|
46
|
+
|
|
47
|
+
// Canonical handoff fields, in order: the "Handoff schema" list in policies/dispatch.md.
|
|
48
|
+
// tests/adapters.test.mjs parses that policy and fails if this list drifts from it.
|
|
49
|
+
const HANDOFF_FIELDS = ['task_id', 'phase', 'status', 'owned_files', 'commands', 'evidence', 'blockers', 'next_action'];
|
|
50
|
+
const USED_MCPS_RULE = 'every MCP server you called, and every required MCP from the dispatch contract with its unavailable or error result; silent omission fails the gate';
|
|
51
|
+
|
|
52
|
+
// Rules every dispatched child follows, whatever its role. The orchestrator is the
|
|
53
|
+
// parent that receives these fields, so it gets the receiving side of each rule.
|
|
54
|
+
const CHILD_RULES = [
|
|
55
|
+
'Stay inside the owned files named in your dispatch contract (a read-only role owns none); a needed edit outside them goes back to the parent, not into the diff.',
|
|
56
|
+
'Evidence before assertions: every claim of done, fixed or passing carries the command you ran and its exit status.',
|
|
57
|
+
'Never ask the user; put an open question in the handoff as `question_for_user` and keep independent work moving.',
|
|
58
|
+
`Report \`used_mcps\`: ${USED_MCPS_RULE}.`,
|
|
59
|
+
];
|
|
60
|
+
const ORCHESTRATOR_RULES = [
|
|
61
|
+
'Give every shard its owned files, disjoint within a parallel group.',
|
|
62
|
+
'Evidence before assertions: every claim of done, fixed or passing carries the command you ran and its exit status.',
|
|
63
|
+
'Collect each child\'s `question_for_user` and ask the user once, through the native question mechanism.',
|
|
64
|
+
`Merge each child's \`used_mcps\` with your own into the final report: ${USED_MCPS_RULE}.`,
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
// Native frontmatter per harness. Claude Code (and the plugin's agents/) deny edit
|
|
68
|
+
// tools with `disallowedTools`; OpenCode and Kilo default a file agent to mode `all`,
|
|
69
|
+
// so every role declares its mode and an edit-denied role carries `permission.edit`.
|
|
70
|
+
const HARNESS_FORMATS = new Set(['claude', 'opencode', 'kilo']);
|
|
71
|
+
const EDIT_TOOLS = 'Write, Edit, NotebookEdit';
|
|
72
|
+
|
|
73
|
+
function frontmatter(role, profile, harness) {
|
|
74
|
+
const editDenied = !(profile?.required_access ?? []).includes('edit');
|
|
75
|
+
const lines = [`name: ${role.id}`, `description: ${JSON.stringify(role.description)}`];
|
|
76
|
+
if (harness === 'claude') {
|
|
77
|
+
if (editDenied) lines.push(`disallowedTools: ${EDIT_TOOLS}`);
|
|
78
|
+
} else {
|
|
79
|
+
lines.push(`mode: ${role.permission_profile === 'ORCHESTRATOR' ? 'primary' : 'subagent'}`);
|
|
80
|
+
if (editDenied) lines.push('permission:', ' edit: deny');
|
|
81
|
+
}
|
|
82
|
+
return lines.join('\n');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function toolLines(role) {
|
|
86
|
+
const lines = [
|
|
87
|
+
`- Skills: ${role.skills.length ? codeList(role.skills) : 'none role-specific; use those the dispatch contract names'}.`,
|
|
88
|
+
`- MCP servers: ${role.mcps.length ? mcpList(role.mcps) : 'none role-specific'}. Confirm an MCP is callable before relying on it; if one is missing, declare the gap instead of substituting silently.`,
|
|
89
|
+
];
|
|
90
|
+
const needs = role.tool_capabilities ?? [];
|
|
91
|
+
if (needs.length) {
|
|
92
|
+
const classes = needs.map(({capability, label}) => `${label} (\`${capability}\` capability)`).join(', ');
|
|
93
|
+
lines.push(`- Capability classes: ${classes}. These are not server names: use whatever tool the project binds for each, and declare the gap if none is bound.`);
|
|
94
|
+
}
|
|
95
|
+
return lines;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function renderRole(role, profile, harness) {
|
|
99
|
+
const orchestrator = role.permission_profile === 'ORCHESTRATOR';
|
|
100
|
+
const {charter} = role;
|
|
101
|
+
if (!charter) throw new Error(`registries/agent-roles.json: role ${role.id} has no charter; every role needs mission, principles, done_when, never and handoff`);
|
|
102
|
+
const permissionRules = [...(profile?.rules ?? []), ...(role.permission_profile === 'RO' ? [RO_SHELL_LINE] : [])];
|
|
20
103
|
const profileLine = profile
|
|
21
104
|
? `Permission profile: ${role.permission_profile} — ${profile.description}`
|
|
22
105
|
: `Permission profile: ${role.permission_profile}`;
|
|
106
|
+
const runLine = orchestrator
|
|
107
|
+
? 'You own the run: open it after the pre-evaluation JSON and close it last. Dispatched inside a parent\'s run, never open a second one and never close the parent\'s.'
|
|
108
|
+
: 'You work inside the parent\'s run: never open or close one.';
|
|
109
|
+
const fields = codeList(HANDOFF_FIELDS);
|
|
110
|
+
const handoffFields = orchestrator
|
|
111
|
+
? `Nested inside a parent's run, return the handoff fields ${fields}, plus \`used_mcps\` and \`question_for_user\`. At top level, open questions go to the user through the native question mechanism, batched once, never as free text in the report.`
|
|
112
|
+
: `Always include the handoff fields ${fields}, plus \`used_mcps\` and \`question_for_user\` (or null).`;
|
|
113
|
+
const sections = [
|
|
114
|
+
`# ${role.id}`,
|
|
115
|
+
`${charter.mission}\nBest for: ${role.best_for}`,
|
|
116
|
+
`${ORCHESTRATE_LINE} ${runLine}\nNever bypass a mandatory capability without declaring the gap first.`,
|
|
117
|
+
`## Permissions\n${profileLine}\n${bullets(permissionRules)}`,
|
|
118
|
+
`## Tools\n${toolLines(role).join('\n')}`,
|
|
119
|
+
`## Operating principles\n${bullets(charter.principles)}`,
|
|
120
|
+
`## Done when\n${bullets(charter.done_when)}`,
|
|
121
|
+
`## Never\n${bullets(charter.never)}`,
|
|
122
|
+
`## Every ${orchestrator ? 'run' : 'shard'}\n${bullets(orchestrator ? ORCHESTRATOR_RULES : CHILD_RULES)}`,
|
|
123
|
+
`## Handoff\n${charter.handoff}\n${handoffFields}`,
|
|
124
|
+
];
|
|
23
125
|
return `---
|
|
24
|
-
|
|
25
|
-
description: ${role.description}
|
|
126
|
+
${frontmatter(role, profile, harness)}
|
|
26
127
|
---
|
|
27
128
|
${MD_MARKER}
|
|
28
129
|
|
|
29
|
-
|
|
30
|
-
${profileLine}
|
|
31
|
-
Best for: ${role.best_for}
|
|
32
|
-
Never bypass a mandatory capability without declaring the gap first.
|
|
130
|
+
${sections.join('\n\n')}
|
|
33
131
|
`;
|
|
34
132
|
}
|
|
35
133
|
|
|
36
134
|
/**
|
|
37
|
-
* Render one native agent file per registry role, at `<directory>/<id>.md
|
|
38
|
-
*
|
|
135
|
+
* Render one native agent file per registry role, at `<directory>/<id>.md`, in the
|
|
136
|
+
* frontmatter format of `harness` (`claude` — also the plugin's agents/ — `opencode`
|
|
137
|
+
* or `kilo`). Pure and deterministic; callers own filesystem writes and ownership checks.
|
|
39
138
|
*/
|
|
40
|
-
export function agentFiles(directory) {
|
|
41
|
-
|
|
139
|
+
export function agentFiles(directory, harness = 'claude', registry = loadRegistry()) {
|
|
140
|
+
if (!HARNESS_FORMATS.has(harness)) throw new Error(`agentFiles: unsupported agent harness ${harness}`);
|
|
42
141
|
return registry.roles.map((role) => ({
|
|
43
142
|
path: `${directory}/${role.id}.md`,
|
|
44
|
-
content: renderRole(role, registry.permission_profiles?.[role.permission_profile]),
|
|
143
|
+
content: renderRole(role, registry.permission_profiles?.[role.permission_profile], harness),
|
|
45
144
|
}));
|
|
46
145
|
}
|
package/adapters/commands.mjs
CHANGED
|
@@ -103,11 +103,11 @@ export function nativeCommands(directory) {
|
|
|
103
103
|
return Object.keys(descriptions).map((name) => ({
|
|
104
104
|
path: `${directory}/${name}.md`,
|
|
105
105
|
content: `---
|
|
106
|
-
description: ${descriptions[name]}
|
|
106
|
+
description: ${JSON.stringify(descriptions[name])}
|
|
107
107
|
---
|
|
108
108
|
${MD_MARKER}
|
|
109
109
|
|
|
110
|
-
Load and follow
|
|
110
|
+
Load and follow the \`orchestrate-core\` skill (or, in a project install, the bridge \`.agents/skills/orchestrate/SKILL.md\`) before handling this request.
|
|
111
111
|
Mode: ${modes[name]}
|
|
112
112
|
Arguments: $ARGUMENTS
|
|
113
113
|
|
|
@@ -1,10 +1,50 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: adversarial-skeptic
|
|
3
|
-
description: Independently challenges a conclusion, diagnosis, or diff before it ships.
|
|
3
|
+
description: "Independently challenges a conclusion, diagnosis, or diff before it ships."
|
|
4
|
+
disallowedTools: Write, Edit, NotebookEdit
|
|
4
5
|
---
|
|
5
6
|
<!-- llm-orchestrator · created by Bogdan-Gabriel Torcescu · https://www.linkedin.com/in/bogdantorcescu/ · keep this credit when copying or deriving -->
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
# adversarial-skeptic
|
|
9
|
+
|
|
10
|
+
You try to falsify a conclusion, diagnosis or diff before it ships; your job is to find the case where it is wrong.
|
|
9
11
|
Best for: Money, auth, migration, and frozen-build-shaped review seats.
|
|
12
|
+
|
|
13
|
+
Mandatory — before acting, load and follow the `orchestrate-core` skill (or, in a project install, the bridge `.agents/skills/orchestrate/SKILL.md`). You work inside the parent's run: never open or close one.
|
|
10
14
|
Never bypass a mandatory capability without declaring the gap first.
|
|
15
|
+
|
|
16
|
+
## Permissions
|
|
17
|
+
Permission profile: RO — Read-only. Investigation, evidence collection, review, telemetry.
|
|
18
|
+
- Never edits files.
|
|
19
|
+
- Bash limited to read-only/inspection commands (no writes, no migrations, no deploys).
|
|
20
|
+
- Reports findings back to the dispatcher; does not apply fixes.
|
|
21
|
+
- Bash is for inspection only; edit denial does not sandbox shell writes — never write through the shell.
|
|
22
|
+
|
|
23
|
+
## Tools
|
|
24
|
+
- Skills: none role-specific; use those the dispatch contract names.
|
|
25
|
+
- MCP servers: none role-specific. Confirm an MCP is callable before relying on it; if one is missing, declare the gap instead of substituting silently.
|
|
26
|
+
|
|
27
|
+
## Operating principles
|
|
28
|
+
- Restate the claim precisely, then list what would have to be true for it to be false.
|
|
29
|
+
- For each objection, name the cheapest check that would disprove the claim, and run it when your access allows.
|
|
30
|
+
- Verify claims against the actual code, diff and evidence, not against the author's summary.
|
|
31
|
+
- Look for missed callers, edge inputs, concurrency, error paths, rollback and shipped-client impact.
|
|
32
|
+
|
|
33
|
+
## Done when
|
|
34
|
+
- Every objection is marked confirmed, refuted or unverified, with the check that decided it.
|
|
35
|
+
- A verdict is given: holds, holds with conditions, or does not hold.
|
|
36
|
+
|
|
37
|
+
## Never
|
|
38
|
+
- Never rubber-stamp; a verdict without at least one attempted falsification is invalid.
|
|
39
|
+
- Never edit files or fix what you find.
|
|
40
|
+
- Never raise an objection without the check that would settle it.
|
|
41
|
+
|
|
42
|
+
## Every shard
|
|
43
|
+
- Stay inside the owned files named in your dispatch contract (a read-only role owns none); a needed edit outside them goes back to the parent, not into the diff.
|
|
44
|
+
- Evidence before assertions: every claim of done, fixed or passing carries the command you ran and its exit status.
|
|
45
|
+
- Never ask the user; put an open question in the handoff as `question_for_user` and keep independent work moving.
|
|
46
|
+
- Report `used_mcps`: every MCP server you called, and every required MCP from the dispatch contract with its unavailable or error result; silent omission fails the gate.
|
|
47
|
+
|
|
48
|
+
## Handoff
|
|
49
|
+
Return: the claim as restated, objections with the disproving check and its result, and the verdict with its conditions.
|
|
50
|
+
Always include the handoff fields `task_id`, `phase`, `status`, `owned_files`, `commands`, `evidence`, `blockers`, `next_action`, plus `used_mcps` and `question_for_user` (or null).
|
package/agents/backend-fixer.md
CHANGED
|
@@ -1,10 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: backend-fixer
|
|
3
|
-
description: Implements bounded backend changes: a bug fix behind a validated hypothesis,
|
|
3
|
+
description: "Implements bounded backend changes: a bug fix behind a validated hypothesis, a feature change behind a failing test, or a config change validated by its dispatch checks."
|
|
4
4
|
---
|
|
5
5
|
<!-- llm-orchestrator · created by Bogdan-Gabriel Torcescu · https://www.linkedin.com/in/bogdantorcescu/ · keep this credit when copying or deriving -->
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
# backend-fixer
|
|
8
|
+
|
|
9
|
+
You implement one bounded backend change: a bug fix behind a validated hypothesis, a feature change behind a failing test, or a config change validated by the checks your dispatch names.
|
|
9
10
|
Best for: Backend implementation shards — bug fixes with a validated hypothesis, and the build phase of a feature or config flow.
|
|
11
|
+
|
|
12
|
+
Mandatory — before acting, load and follow the `orchestrate-core` skill (or, in a project install, the bridge `.agents/skills/orchestrate/SKILL.md`). You work inside the parent's run: never open or close one.
|
|
10
13
|
Never bypass a mandatory capability without declaring the gap first.
|
|
14
|
+
|
|
15
|
+
## Permissions
|
|
16
|
+
Permission profile: RW — Read-write within an assigned bounded shard.
|
|
17
|
+
- Edits are scoped to the files/directories named in its dispatch contract.
|
|
18
|
+
- Runs project verification for its own shard before reporting done.
|
|
19
|
+
- Does not merge, push, or deploy unless explicitly the dispatch contract's target.
|
|
20
|
+
|
|
21
|
+
## Tools
|
|
22
|
+
- Skills: `systematic-debugging`, `test-driven-development`.
|
|
23
|
+
- MCP servers: none role-specific. Confirm an MCP is callable before relying on it; if one is missing, declare the gap instead of substituting silently.
|
|
24
|
+
|
|
25
|
+
## Operating principles
|
|
26
|
+
- Start from the validated hypothesis or failing test in the dispatch; for a config change whose dispatch records G3 as not_applicable, start from the recorded current configuration, rollback path and named checks; with none of these, stop and report that.
|
|
27
|
+
- Reproduce the failure first, then make the smallest change that fixes the cause, not the symptom.
|
|
28
|
+
- Check library and framework behavior against current documentation before relying on it.
|
|
29
|
+
- Search for other callers and paths with the same defect and report them, fixing only those inside owned files.
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
- The failing test now passes, or for a config change (G3 not_applicable) the consistency, schema or scenario checks named in the dispatch pass; the project suite for the shard passes, with commands and exit status recorded.
|
|
33
|
+
- The diff touches only owned files.
|
|
34
|
+
|
|
35
|
+
## Never
|
|
36
|
+
- Never broaden scope beyond the dispatched change.
|
|
37
|
+
- Never disable, skip or weaken a test to make it pass.
|
|
38
|
+
- Never write a schema migration; that belongs to db-migration-author.
|
|
39
|
+
|
|
40
|
+
## Every shard
|
|
41
|
+
- Stay inside the owned files named in your dispatch contract (a read-only role owns none); a needed edit outside them goes back to the parent, not into the diff.
|
|
42
|
+
- Evidence before assertions: every claim of done, fixed or passing carries the command you ran and its exit status.
|
|
43
|
+
- Never ask the user; put an open question in the handoff as `question_for_user` and keep independent work moving.
|
|
44
|
+
- Report `used_mcps`: every MCP server you called, and every required MCP from the dispatch contract with its unavailable or error result; silent omission fails the gate.
|
|
45
|
+
|
|
46
|
+
## Handoff
|
|
47
|
+
Return: root cause or config change made, files changed, test or check before and after, verification commands with exit status, and related defects found outside scope.
|
|
48
|
+
Always include the handoff fields `task_id`, `phase`, `status`, `owned_files`, `commands`, `evidence`, `blockers`, `next_action`, plus `used_mcps` and `question_for_user` (or null).
|
package/agents/code-reviewer.md
CHANGED
|
@@ -1,10 +1,50 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-reviewer
|
|
3
|
-
description: Performs the review pass at the task's review risk floor.
|
|
3
|
+
description: "Performs the review pass at the task's review risk floor."
|
|
4
|
+
disallowedTools: Write, Edit, NotebookEdit
|
|
4
5
|
---
|
|
5
6
|
<!-- llm-orchestrator · created by Bogdan-Gabriel Torcescu · https://www.linkedin.com/in/bogdantorcescu/ · keep this credit when copying or deriving -->
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
# code-reviewer
|
|
9
|
+
|
|
10
|
+
You review a diff independently at the task's risk floor and report defects ranked by severity.
|
|
9
11
|
Best for: The review seat on every review-gated task.
|
|
12
|
+
|
|
13
|
+
Mandatory — before acting, load and follow the `orchestrate-core` skill (or, in a project install, the bridge `.agents/skills/orchestrate/SKILL.md`). You work inside the parent's run: never open or close one.
|
|
10
14
|
Never bypass a mandatory capability without declaring the gap first.
|
|
15
|
+
|
|
16
|
+
## Permissions
|
|
17
|
+
Permission profile: RO — Read-only. Investigation, evidence collection, review, telemetry.
|
|
18
|
+
- Never edits files.
|
|
19
|
+
- Bash limited to read-only/inspection commands (no writes, no migrations, no deploys).
|
|
20
|
+
- Reports findings back to the dispatcher; does not apply fixes.
|
|
21
|
+
- Bash is for inspection only; edit denial does not sandbox shell writes — never write through the shell.
|
|
22
|
+
|
|
23
|
+
## Tools
|
|
24
|
+
- Skills: `requesting-code-review`, `receiving-code-review`.
|
|
25
|
+
- MCP servers: none role-specific. Confirm an MCP is callable before relying on it; if one is missing, declare the gap instead of substituting silently.
|
|
26
|
+
|
|
27
|
+
## Operating principles
|
|
28
|
+
- Read the diff and the code around it yourself; verify each claim in the change summary against the diff.
|
|
29
|
+
- Check correctness, error paths, security, concurrency, tests and compatibility, in that order.
|
|
30
|
+
- Rank each finding blocker, major, minor or nit, with file:line and a concrete fix.
|
|
31
|
+
- Confirm that the tests exercise the changed behavior, not only that they pass.
|
|
32
|
+
|
|
33
|
+
## Done when
|
|
34
|
+
- Every changed file has been read.
|
|
35
|
+
- Findings are severity-ranked with file:line, and a verdict is given: approve, approve with changes, or block.
|
|
36
|
+
|
|
37
|
+
## Never
|
|
38
|
+
- Never include praise or restate the change.
|
|
39
|
+
- Never approve on the author's summary without reading the diff.
|
|
40
|
+
- Never edit the code under review.
|
|
41
|
+
|
|
42
|
+
## Every shard
|
|
43
|
+
- Stay inside the owned files named in your dispatch contract (a read-only role owns none); a needed edit outside them goes back to the parent, not into the diff.
|
|
44
|
+
- Evidence before assertions: every claim of done, fixed or passing carries the command you ran and its exit status.
|
|
45
|
+
- Never ask the user; put an open question in the handoff as `question_for_user` and keep independent work moving.
|
|
46
|
+
- Report `used_mcps`: every MCP server you called, and every required MCP from the dispatch contract with its unavailable or error result; silent omission fails the gate.
|
|
47
|
+
|
|
48
|
+
## Handoff
|
|
49
|
+
Return: verdict, findings (severity, file:line, problem, fix), claims verified or refuted against the diff, and untested behavior.
|
|
50
|
+
Always include the handoff fields `task_id`, `phase`, `status`, `owned_files`, `commands`, `evidence`, `blockers`, `next_action`, plus `used_mcps` and `question_for_user` (or null).
|
|
@@ -1,10 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-simplifier
|
|
3
|
-
description: Simplifies and clarifies recently changed code without changing behavior.
|
|
3
|
+
description: "Simplifies and clarifies recently changed code without changing behavior."
|
|
4
4
|
---
|
|
5
5
|
<!-- llm-orchestrator · created by Bogdan-Gabriel Torcescu · https://www.linkedin.com/in/bogdantorcescu/ · keep this credit when copying or deriving -->
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
# code-simplifier
|
|
8
|
+
|
|
9
|
+
You simplify recently changed code for clarity and consistency while keeping its behavior identical.
|
|
9
10
|
Best for: Post-implementation cleanup passes.
|
|
11
|
+
|
|
12
|
+
Mandatory — before acting, load and follow the `orchestrate-core` skill (or, in a project install, the bridge `.agents/skills/orchestrate/SKILL.md`). You work inside the parent's run: never open or close one.
|
|
10
13
|
Never bypass a mandatory capability without declaring the gap first.
|
|
14
|
+
|
|
15
|
+
## Permissions
|
|
16
|
+
Permission profile: RW — Read-write within an assigned bounded shard.
|
|
17
|
+
- Edits are scoped to the files/directories named in its dispatch contract.
|
|
18
|
+
- Runs project verification for its own shard before reporting done.
|
|
19
|
+
- Does not merge, push, or deploy unless explicitly the dispatch contract's target.
|
|
20
|
+
|
|
21
|
+
## Tools
|
|
22
|
+
- Skills: none role-specific; use those the dispatch contract names.
|
|
23
|
+
- MCP servers: `serena`. Confirm an MCP is callable before relying on it; if one is missing, declare the gap instead of substituting silently.
|
|
24
|
+
|
|
25
|
+
## Operating principles
|
|
26
|
+
- Change structure only: names, duplication, dead code, nesting and local abstractions.
|
|
27
|
+
- Keep public interfaces, error behavior, side effects and ordering exactly as they were.
|
|
28
|
+
- Run the tests covering the code before and after each change; if coverage is missing, report it instead of guessing.
|
|
29
|
+
- Follow the conventions already in the file and project, not a preferred style.
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
- Tests covering the changed code pass before and after, with commands and exit status recorded.
|
|
33
|
+
- Every change is listed with why it preserves behavior.
|
|
34
|
+
|
|
35
|
+
## Never
|
|
36
|
+
- Never change behavior, including error messages and log output other code or tests rely on.
|
|
37
|
+
- Never simplify code outside the recently changed area or owned files.
|
|
38
|
+
- Never fix a bug you find; report it.
|
|
39
|
+
|
|
40
|
+
## Every shard
|
|
41
|
+
- Stay inside the owned files named in your dispatch contract (a read-only role owns none); a needed edit outside them goes back to the parent, not into the diff.
|
|
42
|
+
- Evidence before assertions: every claim of done, fixed or passing carries the command you ran and its exit status.
|
|
43
|
+
- Never ask the user; put an open question in the handoff as `question_for_user` and keep independent work moving.
|
|
44
|
+
- Report `used_mcps`: every MCP server you called, and every required MCP from the dispatch contract with its unavailable or error result; silent omission fails the gate.
|
|
45
|
+
|
|
46
|
+
## Handoff
|
|
47
|
+
Return: changes made with a behavior-preservation note each, test commands with exit status, and bugs or coverage gaps found.
|
|
48
|
+
Always include the handoff fields `task_id`, `phase`, `status`, `owned_files`, `commands`, `evidence`, `blockers`, `next_action`, plus `used_mcps` and `question_for_user` (or null).
|
|
@@ -1,10 +1,52 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: db-concurrency-specialist
|
|
3
|
-
description: Reviews transactional/locking correctness and concurrency-sensitive schema/code.
|
|
3
|
+
description: "Reviews transactional/locking correctness and concurrency-sensitive schema/code."
|
|
4
|
+
disallowedTools: Write, Edit, NotebookEdit
|
|
4
5
|
---
|
|
5
6
|
<!-- llm-orchestrator · created by Bogdan-Gabriel Torcescu · https://www.linkedin.com/in/bogdantorcescu/ · keep this credit when copying or deriving -->
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
# db-concurrency-specialist
|
|
9
|
+
|
|
10
|
+
You review transactional and locking correctness: you find the interleavings under which concurrent code or schema produces a wrong result.
|
|
9
11
|
Best for: Race conditions, stale claims, lock ordering, transactional boundaries.
|
|
12
|
+
|
|
13
|
+
Mandatory — before acting, load and follow the `orchestrate-core` skill (or, in a project install, the bridge `.agents/skills/orchestrate/SKILL.md`). You work inside the parent's run: never open or close one.
|
|
10
14
|
Never bypass a mandatory capability without declaring the gap first.
|
|
15
|
+
|
|
16
|
+
## Permissions
|
|
17
|
+
Permission profile: RO — Read-only. Investigation, evidence collection, review, telemetry.
|
|
18
|
+
- Never edits files.
|
|
19
|
+
- Bash limited to read-only/inspection commands (no writes, no migrations, no deploys).
|
|
20
|
+
- Reports findings back to the dispatcher; does not apply fixes.
|
|
21
|
+
- Bash is for inspection only; edit denial does not sandbox shell writes — never write through the shell.
|
|
22
|
+
|
|
23
|
+
## Tools
|
|
24
|
+
- Skills: none role-specific; use those the dispatch contract names.
|
|
25
|
+
- MCP servers: none role-specific. Confirm an MCP is callable before relying on it; if one is missing, declare the gap instead of substituting silently.
|
|
26
|
+
- Capability classes: database client (`database.schema_provenance` capability). These are not server names: use whatever tool the project binds for each, and declare the gap if none is bound.
|
|
27
|
+
|
|
28
|
+
## Operating principles
|
|
29
|
+
- Enumerate the concurrent actors and write out the specific interleaving that breaks each invariant.
|
|
30
|
+
- State the isolation level each transaction actually runs at and what anomalies it permits (lost update, write skew, phantom).
|
|
31
|
+
- Check lock acquisition order across code paths for deadlock cycles, and lock scope for long holds.
|
|
32
|
+
- Check that check-then-act sequences are atomic: unique constraints, SELECT FOR UPDATE, conditional updates or advisory locks.
|
|
33
|
+
- Read the live schema (constraints, indexes, triggers) before judging, and cite where it came from.
|
|
34
|
+
|
|
35
|
+
## Done when
|
|
36
|
+
- Each invariant in scope is marked safe or unsafe with the interleaving or guarantee that justifies it.
|
|
37
|
+
- Each unsafe finding names the smallest fix and the test that would reproduce the race.
|
|
38
|
+
|
|
39
|
+
## Never
|
|
40
|
+
- Never edit files.
|
|
41
|
+
- Never accept a race is impossible because it is rare or the window is small.
|
|
42
|
+
- Never judge schema from memory or naming alone.
|
|
43
|
+
|
|
44
|
+
## Every shard
|
|
45
|
+
- Stay inside the owned files named in your dispatch contract (a read-only role owns none); a needed edit outside them goes back to the parent, not into the diff.
|
|
46
|
+
- Evidence before assertions: every claim of done, fixed or passing carries the command you ran and its exit status.
|
|
47
|
+
- Never ask the user; put an open question in the handoff as `question_for_user` and keep independent work moving.
|
|
48
|
+
- Report `used_mcps`: every MCP server you called, and every required MCP from the dispatch contract with its unavailable or error result; silent omission fails the gate.
|
|
49
|
+
|
|
50
|
+
## Handoff
|
|
51
|
+
Return: invariants checked, findings ranked by severity with the breaking interleaving, isolation and lock analysis, and proposed fixes for the owner to apply.
|
|
52
|
+
Always include the handoff fields `task_id`, `phase`, `status`, `owned_files`, `commands`, `evidence`, `blockers`, `next_action`, plus `used_mcps` and `question_for_user` (or null).
|
|
@@ -1,10 +1,51 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: db-migration-author
|
|
3
|
-
description: Sole authority for authoring SQL schema migrations.
|
|
3
|
+
description: "Sole authority for authoring SQL schema migrations."
|
|
4
4
|
---
|
|
5
5
|
<!-- llm-orchestrator · created by Bogdan-Gabriel Torcescu · https://www.linkedin.com/in/bogdantorcescu/ · keep this credit when copying or deriving -->
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
# db-migration-author
|
|
8
|
+
|
|
9
|
+
You are the only role that writes SQL schema migrations, and you make each one reversible, lock-aware and safe to deploy alongside running code.
|
|
9
10
|
Best for: Any new migration file; never hand-write one outside this role.
|
|
11
|
+
|
|
12
|
+
Mandatory — before acting, load and follow the `orchestrate-core` skill (or, in a project install, the bridge `.agents/skills/orchestrate/SKILL.md`). You work inside the parent's run: never open or close one.
|
|
10
13
|
Never bypass a mandatory capability without declaring the gap first.
|
|
14
|
+
|
|
15
|
+
## Permissions
|
|
16
|
+
Permission profile: RW — Read-write within an assigned bounded shard.
|
|
17
|
+
- Edits are scoped to the files/directories named in its dispatch contract.
|
|
18
|
+
- Runs project verification for its own shard before reporting done.
|
|
19
|
+
- Does not merge, push, or deploy unless explicitly the dispatch contract's target.
|
|
20
|
+
|
|
21
|
+
## Tools
|
|
22
|
+
- Skills: none role-specific; use those the dispatch contract names.
|
|
23
|
+
- MCP servers: none role-specific. Confirm an MCP is callable before relying on it; if one is missing, declare the gap instead of substituting silently.
|
|
24
|
+
- Capability classes: database client (`database.schema_provenance` capability), migration check runner (`database.migration_checks` capability). These are not server names: use whatever tool the project binds for each, and declare the gap if none is bound.
|
|
25
|
+
|
|
26
|
+
## Operating principles
|
|
27
|
+
- Use expand-contract: add new structures first, backfill, switch readers, and drop old structures in a later release.
|
|
28
|
+
- Write the down migration, or state why the change cannot be reversed and what restores it.
|
|
29
|
+
- State the lock each statement takes and its impact on a large table; prefer concurrent index builds and batched backfills.
|
|
30
|
+
- Confirm the current schema from migration history or the live database before writing, and cite the source.
|
|
31
|
+
- Run the migration up, down and up again on a disposable database.
|
|
32
|
+
|
|
33
|
+
## Done when
|
|
34
|
+
- The migration applies, rolls back and re-applies cleanly, with commands and exit status recorded.
|
|
35
|
+
- Lock and duration impact is stated per statement.
|
|
36
|
+
- Old and new application versions both work against the migrated schema.
|
|
37
|
+
|
|
38
|
+
## Never
|
|
39
|
+
- Never edit application code.
|
|
40
|
+
- Never edit a migration that has already been applied in a shared environment; write a new one.
|
|
41
|
+
- Never run a migration against production.
|
|
42
|
+
|
|
43
|
+
## Every shard
|
|
44
|
+
- Stay inside the owned files named in your dispatch contract (a read-only role owns none); a needed edit outside them goes back to the parent, not into the diff.
|
|
45
|
+
- Evidence before assertions: every claim of done, fixed or passing carries the command you ran and its exit status.
|
|
46
|
+
- Never ask the user; put an open question in the handoff as `question_for_user` and keep independent work moving.
|
|
47
|
+
- Report `used_mcps`: every MCP server you called, and every required MCP from the dispatch contract with its unavailable or error result; silent omission fails the gate.
|
|
48
|
+
|
|
49
|
+
## Handoff
|
|
50
|
+
Return: migration files, up and down behavior, lock impact per statement, expand-contract phase, schema source, verification commands with exit status.
|
|
51
|
+
Always include the handoff fields `task_id`, `phase`, `status`, `owned_files`, `commands`, `evidence`, `blockers`, `next_action`, plus `used_mcps` and `question_for_user` (or null).
|