@hybridlabor-api/aos 4.0.2 → 4.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/.agents/agents.md +77 -0
  2. package/.agents/graph.md +43 -0
  3. package/.agents/state.schema.json +6 -0
  4. package/.claude/agents/database-reviewer.md +109 -0
  5. package/.claude/agents/go-build-resolver.md +112 -0
  6. package/.claude/agents/opensource-forker.md +216 -0
  7. package/.claude/agents/opensource-sanitizer.md +206 -0
  8. package/.claude/agents/security-reviewer.md +126 -0
  9. package/.claude/agents/silent-failure-hunter.md +68 -0
  10. package/.claude/workflows/startcycle-dispatch.mjs +126 -8
  11. package/CLAUDE.md +62 -0
  12. package/GEMINI.md +9 -1
  13. package/README.md +12 -19
  14. package/THIRD_PARTY_NOTICES.md +133 -0
  15. package/package.json +4 -2
  16. package/skills/basic/bdbmediastorm/SKILL.md +7 -1
  17. package/skills/basic/startcycle/SKILL.md +21 -0
  18. package/skills/basic/startcycle-graph/SKILL.md +27 -7
  19. package/skills/basic/startcycle-graph-user/SKILL.md +65 -11
  20. package/skills/bdbrainstorm/SKILL.md +1 -0
  21. package/skills/global_config/plan-canvas/SKILL.md +233 -0
  22. package/skills/global_config/plan-canvas/scripts/lib/loopback-guard.js +59 -0
  23. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/markdown.js +301 -0
  24. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/sdk.js +239 -0
  25. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/server.js +636 -0
  26. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/sessions.js +271 -0
  27. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/ui.js +630 -0
  28. package/skills/global_config/plan-canvas/scripts/plan-canvas.js +419 -0
  29. package/docs/sessions/AUDIT-HANDOVER-2026-08-28.md +0 -169
  30. package/docs/sessions/BDB_REMOTEOS_MCP_HANDOVER.md +0 -130
  31. package/docs/sessions/SESSION-HANDOVER-v3.13.md +0 -249
package/GEMINI.md CHANGED
@@ -47,4 +47,12 @@ Ask one question first: **do the workers need to see each other?**
47
47
  - **Yes — they must react to each other, or claim work dynamically from a shared list** → an orchestrated agent team (via `send_message`). Currently only `/bdbrainstorm` qualifies, where the spec demands a real debate rather than parallel monologues. True Agent Teams were evaluated and deferred for `/startcycle-graph` (needs an interactive session; the graph runs headless) — see `.agents/graph.md` and F-17's addendum in `docs/sessions/audit-agents.md`.
48
48
  - **Small task** → do it yourself. A two-file edit needs no agents.
49
49
 
50
- "Runs in parallel" is not a reason to reach for a team — subagents already run in parallel. Peer communication and dynamic task claiming are the only things a team adds.
50
+ "Runs in parallel" is not a reason to reach for a team — subagents already run in parallel. Peer communication and dynamic task claiming are the only things a team adds.
51
+
52
+ ## 9. Delegating to an external CLI
53
+ None of this tooling ships with AOS — it depends on CLIs and plugins the user installed separately, so check what is present rather than assuming.
54
+ - **Prefer a plugin's delegation subagent over shelling out to its CLI.** Where installed, it already handles the wrapper flags, cost discipline, and digest contract: `antigravity:antigravity-delegate` (agy), `opencode:opencode-rescue`, `codex:codex-rescue`. These are Claude Code plugins — on another harness, calling the CLI directly is the only path.
55
+ - **Delegate only above the break-even.** A small, self-contained, or judgement-heavy task costs more to hand off and verify than to just do. Keep the digest, not the raw output.
56
+ - **Give it a real timeout.** Measured 2026-09: a trivial headless `agy` prompt took **605s**. `agy-delegate` defaults to `--print-timeout 5m`, so it aborts at 300s and reports an empty body while the answer is still coming — pass `--timeout 15m` for anything non-trivial.
57
+ - **Match the model to the task, not to the default.** The wrapper's tiers map to models that go stale (built-in `flash` still points at Gemini 3.7 while 3.8 ships). Media and fast/mechanical coding → `Gemini 3.8 Flash (Medium)`; trivial → `Gemini 3.8 Flash (Low)`; review, architecture and hard reasoning → `Claude Sonnet 4.6 (Thinking)`. Adversarial review most repays the stronger model: a Flash tier tends to agree with what it is shown, which is exactly what a reviewer must not do. Pass `--model` per call, or remap the tiers once via `CLAUDE_PLUGIN_OPTION_TIER_{FLASH,FLASH_LO,PRO}` — in `~/.zshenv`, not `~/.zshrc`, which non-interactive tool shells never source. Re-check names against `agy models` after an upgrade.
58
+ - **Verify the result, never the status field.** A timed-out delegation returns `{"status": "SUCCESS", "usage": {"total": 0}}` with an empty body — success by every field except the one that matters, and the zero token counts are *not* proof the prompt never arrived (headless usage reporting is simply unpopulated). Treat an empty body as failure regardless of status, and never report a delegated step as done on the strength of its own self-report.
package/README.md CHANGED
@@ -1,30 +1,23 @@
1
1
  ![AOS — BDB Agent OS](assets/header-v4.jpg)
2
2
 
3
3
  🌐 **Language / Sprache / Idioma**: **English** | [ 🇩🇪 Deutsch ](README.de.md) | [ 🇵🇹 Português ](README.pt.md)
4
-
5
- ---
6
-
7
- ```text
8
- █████▄ ████▄ █████▄ ▄████▄ ▄████ ██████ ███ ██ ██████ ▄████▄ ▄█████
9
- ██▄▄██ ██ ██ ██▄▄██ ██▄▄██ ██ ▄▄▄ ██▄▄ ██ ▀▄██ ██ ██ ██ ▀▀▀▄▄▄
10
- ██▄▄█▀ ████▀ ██▄▄█▀ ██ ██ ▀███▀ ██▄▄▄▄ ██ ██ ██ ▀████▀ █████▀
11
-
12
- ──────────────────────────── N O D E F O R G E ─────────────────────────────
13
-
14
- BDB AGENT OS · CORE KERNEL · AOS - v4.0.0
15
- ```
16
-
17
4
  # 🚀 AOS — BDB Agent OS · Optimized Creative & Full-Stack Skills Pack
18
5
 
19
6
  [![CI](https://github.com/hybridlabor-api/aos/actions/workflows/ci.yml/badge.svg)](https://github.com/hybridlabor-api/aos/actions)
20
7
  [![NPM Version](https://img.shields.io/npm/v/@hybridlabor-api/aos.svg)](https://www.npmjs.com/package/@hybridlabor-api/aos)
21
- [![runtime](https://img.shields.io/badge/node-20+-blue.svg)](https://github.com/hybridlabor-api/aos)
8
+ [![NPM Downloads](https://img.shields.io/npm/dw/@hybridlabor-api/aos.svg)](https://www.npmjs.com/package/@hybridlabor-api/aos)
22
9
  [![license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
23
- [![skills](https://img.shields.io/badge/skills-154%20curated-brightgreen.svg)](https://github.com/hybridlabor-api/aos)
10
+ [![GitHub stars](https://img.shields.io/github/stars/hybridlabor-api/aos?style=flat&color=gold)](https://github.com/hybridlabor-api/aos/stargazers)
11
+ [![last commit](https://img.shields.io/github/last-commit/hybridlabor-api/aos.svg)](https://github.com/hybridlabor-api/aos/commits/main)
12
+
13
+ [![skills](https://img.shields.io/badge/skills-169%20curated-brightgreen.svg)](docs/skills_table.md)
14
+ [![MCPs](https://img.shields.io/badge/local%20MCPs-21-brightgreen.svg)](mcps/)
15
+ [![harnesses](https://img.shields.io/badge/harnesses-9%20supported-blueviolet.svg)](#-installation)
16
+ [![runtime](https://img.shields.io/badge/node-20+-blue.svg)](https://github.com/hybridlabor-api/aos)
24
17
 
25
- > **Supercharging AI coding agents with 154 hyper-curated skills, 21 local MCP wrappers, and a runnable multi-agent dispatcher graph.**
18
+ > **Supercharging AI coding agents with 169 hyper-curated skills, 21 local MCP wrappers, and a runnable multi-agent dispatcher graph.**
26
19
 
27
- Welcome to **BDB Agent OS — AOS v4.0.0**: 154 curated skills, 21 local MCP wrappers, and a dispatcher graph that turns them into a real multi-agent build pipeline, not just a prompt library. Point it at a goal and it plans, builds, reviews, and ships through seven coordinated agent nodes — with a mechanically enforced gate before anything actually goes live.
20
+ Welcome to **BDB Agent OS — AOS v4.0.0**: 169 curated skills, 21 local MCP wrappers, and a dispatcher graph that turns them into a real multi-agent build pipeline, not just a prompt library. Point it at a goal and it plans, builds, reviews, and ships through seven coordinated agent nodes — with a mechanically enforced gate before anything actually goes live.
28
21
 
29
22
  It is harness-neutral by design, not "optimized for one tool with others as an afterthought": the dispatcher graph runs on Claude Code's Dynamic Workflows, the same skills and MCP configuration install natively into **Google Antigravity, ChatGPT Codex / Codex CLI, Claude Desktop, Cursor, Aider, Roo Code, Cline, and Windsurf**, and the lightweight `/startcycle-graph-user` variant falls back to Claude Code's own subagents on any machine that has none of the above installed.
30
23
 
@@ -108,9 +101,9 @@ below for how the pipeline itself works.
108
101
 
109
102
  ---
110
103
 
111
- ## 🌟 154 Optimized Skills
104
+ ## 🌟 169 Optimized Skills
112
105
 
113
- We started with a massive pool of over 1,400 raw AI skills. After rigorous testing, filtering, and refinement, we've distilled them down to a hyper-curated set of **154 Optimized Skills** (featuring a native OpenWiki documentation engine, the **memB local semantic memory brain**, and **Universal Agent Harness synchronization**).
106
+ We started with a massive pool of over 1,400 raw AI skills. After rigorous testing, filtering, and refinement, we've distilled them down to a hyper-curated set of **169 Optimized Skills** (featuring a native OpenWiki documentation engine, the **memB local semantic memory brain**, and **Universal Agent Harness synchronization**).
114
107
 
115
108
  These skills are precision-engineered to ensure agents waste no time on redundant tasks and instead operate with maximum agency, strict architectural constraints, and robust context awareness.
116
109
 
@@ -0,0 +1,133 @@
1
+ # Third-Party Notices
2
+
3
+ `@hybridlabor-api/aos` is licensed under Apache-2.0. It additionally bundles
4
+ third-party source code that carries its own license. That code, and the
5
+ license it ships under, is listed here.
6
+
7
+ Each vendored file also carries a one-line pointer back to this document, so
8
+ provenance survives the file being read in isolation.
9
+
10
+ ---
11
+
12
+ ## affaan-m/ECC
13
+
14
+ - **Upstream:** <https://github.com/affaan-m/ECC>
15
+ - **License:** MIT
16
+ - **Copyright:** Copyright (c) 2026 Affaan Mustafa
17
+
18
+ Two independent deliverables were ported from this project.
19
+
20
+ ### 1. Auxiliary agents
21
+
22
+ Ported from ECC `agents/<name>.md` to `.claude/agents/<name>.md`:
23
+
24
+ | File | Upstream source |
25
+ |---|---|
26
+ | `.claude/agents/silent-failure-hunter.md` | `agents/silent-failure-hunter.md` |
27
+ | `.claude/agents/security-reviewer.md` | `agents/security-reviewer.md` |
28
+ | `.claude/agents/go-build-resolver.md` | `agents/go-build-resolver.md` |
29
+ | `.claude/agents/database-reviewer.md` | `agents/database-reviewer.md` |
30
+ | `.claude/agents/opensource-forker.md` | `agents/opensource-forker.md` |
31
+ | `.claude/agents/opensource-sanitizer.md` | `agents/opensource-sanitizer.md` |
32
+
33
+ **Changes made:** frontmatter only. Upstream `name`, `description`, `model`
34
+ and `tools` are preserved verbatim; the AOS-convention `skills:` key and the
35
+ three house body lines (`Primary skills` / `MCP servers used` /
36
+ `Output artifact(s)`) were added, along with a source-pointer YAML comment.
37
+ The agent bodies — including ECC's "Prompt Defense Baseline" block — are
38
+ unmodified.
39
+
40
+ These 6 agents are standalone subagent types. They are deliberately **not**
41
+ registered in `.agents/nodes.json` or `.agents/graph.md`; the AOS pipeline
42
+ graph remains 7 nodes.
43
+
44
+ Note that `opensource-forker` and `opensource-sanitizer` describe themselves in
45
+ their `description:` frontmatter as the first and second stage of an
46
+ `opensource-pipeline` skill. That is an upstream ECC concept with **no AOS
47
+ equivalent** — no such skill exists in this repo's `skills/` tree. The
48
+ descriptions are left verbatim as ported; the two agents work fine invoked
49
+ directly, in that order. Do not go looking for `opensource-pipeline` here.
50
+
51
+ ### 2. Plan Canvas
52
+
53
+ Ported to `skills/global_config/plan-canvas/`:
54
+
55
+ | File | Upstream source |
56
+ |---|---|
57
+ | `skills/global_config/plan-canvas/SKILL.md` | `skills/plan-canvas/SKILL.md` |
58
+ | `skills/global_config/plan-canvas/scripts/plan-canvas.js` | `scripts/plan-canvas.js` |
59
+ | `skills/global_config/plan-canvas/scripts/lib/loopback-guard.js` | `scripts/lib/loopback-guard.js` |
60
+ | `skills/global_config/plan-canvas/scripts/lib/plan-canvas/markdown.js` | `scripts/lib/plan-canvas/markdown.js` |
61
+ | `skills/global_config/plan-canvas/scripts/lib/plan-canvas/sdk.js` | `scripts/lib/plan-canvas/sdk.js` |
62
+ | `skills/global_config/plan-canvas/scripts/lib/plan-canvas/server.js` | `scripts/lib/plan-canvas/server.js` |
63
+ | `skills/global_config/plan-canvas/scripts/lib/plan-canvas/sessions.js` | `scripts/lib/plan-canvas/sessions.js` |
64
+ | `skills/global_config/plan-canvas/scripts/lib/plan-canvas/ui.js` | `scripts/lib/plan-canvas/ui.js` |
65
+
66
+ The directory layout mirrors ECC's `scripts/` shape so every relative
67
+ `require()` resolves unchanged. Changes made:
68
+
69
+ - **`plan-canvas.js`** — `const VERSION = require('../package.json').version`
70
+ replaced with the literal `const VERSION = '1.0.0'`. The skill tree is
71
+ relocated by the installer, so a require walking above the skill directory
72
+ is wrong at any depth. `VERSION` only has to be stable and self-consistent.
73
+ It is kept in sync with `metadata.version` in the skill's `SKILL.md`.
74
+ - **Rebrand**, exact-token only, so a co-installed ECC and AOS do not collide
75
+ over the same port, state directory, or health identity:
76
+ - env prefix `ECC_PLAN_CANVAS_*` → `AOS_PLAN_CANVAS_*`
77
+ (`plan-canvas.js`, `server.js`, `sessions.js`, `ui.js`)
78
+ - health app id `'ecc-plan-canvas'` → `'aos-plan-canvas'`
79
+ (`server.js`, `plan-canvas.js`)
80
+ - CLI name in guidance strings `ecc-plan-canvas` → `aos-plan-canvas`
81
+ (`plan-canvas.js`)
82
+ - `DEFAULT_PORT` `4517` → `4519` (`server.js`)
83
+ - state dir `~/.claude/plan-canvas` → `~/.claude/aos-plan-canvas`
84
+ (`sessions.js`)
85
+ - **`SKILL.md`** — plan-artifact references rewritten from ECC's
86
+ `.claude/plans/*.plan.md` to AOS's `production_artifacts/00_execution_plan.md`,
87
+ port `4517` → `4519`, ECC-install prose replaced with AOS install prose, and
88
+ two upstream claims corrected for this repo: the `stop:plan-canvas-pending`
89
+ hook is not vendored, and the referenced `frontend-design-direction` /
90
+ `artifact-design` skills do not exist in AOS (replaced with `godmode-ui-ux` /
91
+ `ui-component`).
92
+
93
+ Upstream provenance comments inside the vendored sources — including the
94
+ `affaan-m/ECC#2702` reference in `ui.js` — are left intact, as are
95
+ browser-internal identifiers private to the served page
96
+ (`window.__eccPlanCanvasSdk`, `data-ecc-plan-canvas`, and the
97
+ `ecc-plan-canvas:queue:` / `ecc-plan-canvas:theme` localStorage keys).
98
+
99
+ No ECC tests, hooks (`scripts/hooks/plan-canvas-*.js`), or the
100
+ `commands/plan-canvas.md` wrapper were ported.
101
+
102
+ ### License text
103
+
104
+ ```
105
+ MIT License
106
+
107
+ Copyright (c) 2026 Affaan Mustafa
108
+
109
+ Permission is hereby granted, free of charge, to any person obtaining a copy
110
+ of this software and associated documentation files (the "Software"), to deal
111
+ in the Software without restriction, including without limitation the rights
112
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
113
+ copies of the Software, and to permit persons to whom the Software is
114
+ furnished to do so, subject to the following conditions:
115
+
116
+ The above copyright notice and this permission notice shall be included in all
117
+ copies or substantial portions of the Software.
118
+
119
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
120
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
121
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
122
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
123
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
124
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
125
+ SOFTWARE.
126
+ ```
127
+
128
+ ---
129
+
130
+ ## Note on `mcps/`
131
+
132
+ Sub-repositories vendored under `mcps/` carry their own `LICENSE` files in
133
+ their own directories and are not restated here.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybridlabor-api/aos",
3
- "version": "4.0.2",
3
+ "version": "4.2.0-beta.0",
4
4
  "description": "AOS — A Curated AI AGENT OS. Optimized agent skills and add-ons like memB, OpenWiki, Heimdall Token Saver, and Godmode architectures.",
5
5
  "main": "installer.js",
6
6
  "bin": {
@@ -8,7 +8,8 @@
8
8
  "bdb-dev-optimized-agent-skills": "installer.js",
9
9
  "bdb-agent-skills-pro": "installer.js",
10
10
  "bdb-agent-skills": "installer.js",
11
- "setup-saas": "bin/setup-saas.mjs"
11
+ "setup-saas": "bin/setup-saas.mjs",
12
+ "aos-plan-canvas": "skills/global_config/plan-canvas/scripts/plan-canvas.js"
12
13
  },
13
14
  "publishConfig": {
14
15
  "access": "public"
@@ -29,6 +30,7 @@
29
30
  "GEMINI.md",
30
31
  "CODEX.md",
31
32
  "CLAUDE.md",
33
+ "THIRD_PARTY_NOTICES.md",
32
34
  ".agents/",
33
35
  ".claude/",
34
36
  ".codex-plugin/",
@@ -72,7 +72,13 @@ Define hardware and software nodes as strict bounded contexts:
72
72
 
73
73
  ---
74
74
 
75
- ## 5. Execution Rules
75
+ ## 5. Mandatory — Plan Canvas Review
76
+
77
+ Before this session concludes, run `aos-plan-canvas open <file>` against `signal-flow.md` (or the combined show-control spec), then `aos-plan-canvas await <file>` and leave it running. The user reviews the signal flow diagram, hardware topology, and failover matrix in the browser (Mermaid renders live, click-to-annotate, chat rail). Do not consider the show architecture finalized before an `approve` verdict. A `request_changes` verdict means revise the artifact and reopen — it live-reloads. This is a plain CLI tool, identical regardless of which agent harness runs this skill. See the `plan-canvas` skill.
78
+
79
+ ---
80
+
81
+ ## 6. Execution Rules
76
82
 
77
83
  1. **Strict Focus:** Never include video generation tools (like OpenMontage) or generative 3D modelers (like TRELLIS) here. Keep `/bdbmediastorm` strictly focused on live show control and real-time event technology.
78
84
  2. **Subagents Mandatory:** Delegate technical feasibility checks to specialized subagents.
@@ -67,6 +67,8 @@ A straight-line run through the BDB agent roster. Whoever invokes this skill inv
67
67
  - **Action**: reviews the plan for module boundaries, dependency direction, and build order. Approves it, or sends it back to Architect once for a revision. This is a gate, not a deliverable — TechLead does not invoke Architect itself; the invoker re-runs step 1 if TechLead rejects.
68
68
  - **Writes**: no separate file; approval is just the invoker's own record of the gate having passed.
69
69
 
70
+ > **Optional — Plan Canvas.** Before or alongside TechLead's gate, the plan can be reviewed in the browser: `aos-plan-canvas open production_artifacts/00_execution_plan.md`, then `aos-plan-canvas await …`. An `approve` verdict is a human confirmation of the gate. This is optional; the pipeline runs unchanged without it. See the `plan-canvas` skill.
71
+
70
72
  ### 3. Build (parallel, stream-selective)
71
73
  Run only the streams the goal actually needs. A plain backend feature does not need step 3a or 3c; a pure copy change does not need 3b. Each stream's `skills:` frontmatter already lists what it should reach for — the invoker passes that list through rather than restating it here.
72
74
 
@@ -78,6 +80,25 @@ Run only the streams the goal actually needs. A plain backend feature does not n
78
80
 
79
81
  3c is for TouchDesigner, show-control, DMX/grandMA3, 3D, or other media-pipeline goals — most goals are not this. Skip it unless the plan actually calls for it.
80
82
 
83
+ > **Injecting a specific skill.** `/startcycle --skill=<name> <goal>`
84
+ > (repeatable, quote a name with spaces) forces that skill into this run as
85
+ > a hard requirement — for a private skill of your own that isn't part of
86
+ > any build agent's own `skills:` frontmatter. Since this variant has no
87
+ > dispatcher script or `state.json` to carry it automatically, the invoker
88
+ > does the work `startcycle-graph`'s script does for you: extract the
89
+ > `--skill=` flag(s) from the invocation text before anything else runs,
90
+ > confirm each name resolves to a real `SKILL.md` (under
91
+ > `~/.claude/skills/<name>/` or this project's own `skills/` tree) — stop
92
+ > and tell the user if one doesn't, don't silently proceed without it —
93
+ > note the validated list in `00_execution_plan.md`, and include it as a
94
+ > **hard requirement, not a suggestion** in each Build stream's dispatch
95
+ > prompt at step 3. Reviewer (step 4) checks the resulting artifacts for
96
+ > evidence the skill was actually applied, not just available, and treats
97
+ > an ignored mandate as a contract-misread finding. See
98
+ > [`.agents/graph.md`](../../../.agents/graph.md)'s "Mandatory Skill
99
+ > Injection" section for the full rationale — this is the same mechanic,
100
+ > just invoker-driven instead of script-driven.
101
+
81
102
  ### 4. Reviewer
82
103
  - **Agent**: `reviewer`
83
104
  - **Reads**: the artifacts each build stream produced (01/02/03) and the plan's stated contract (`00_execution_plan.md`) — nothing else. Never the goal directly, never a build agent's own claim that it's done; passing that claim through biases the review toward agreement.
@@ -21,12 +21,21 @@ several fields the schema doesn't define at all). Fix it first:
21
21
  mkdir -p .agents
22
22
  [ -f .agents/graph.md ] || cp "$HOME/.agents/graph.md" .agents/graph.md
23
23
  [ -f .agents/state.schema.json ] || cp "$HOME/.agents/state.schema.json" .agents/state.schema.json
24
+ [ -f .agents/nodes.json ] || cp "$HOME/.agents/nodes.json" .agents/nodes.json
24
25
  ```
25
26
 
26
- If `$HOME/.agents/graph.md` or `$HOME/.agents/state.schema.json` doesn't
27
- exist either, stop and tell the user: this machine has no canonical copy of
28
- the graph contract to bootstrap from, and `/startcycle-graph` will produce a
29
- non-conforming `state.json` until one is installed. Don't silently proceed.
27
+ `nodes.json` is not optional and is the one that fails loudest: it is the
28
+ node registry the dispatcher loads as its very first step, and without it
29
+ the run escalates immediately with *"`.agents/nodes.json` failed to load, or
30
+ is missing required node id(s)"* before Architect or any other agent has
31
+ run. (Found exactly that way: a first run in a project that had followed
32
+ this bootstrap step as it was previously written, which copied only the
33
+ other two files.)
34
+
35
+ If any of the three doesn't exist under `$HOME/.agents/` either, stop and
36
+ tell the user: this machine has no canonical copy of the graph contract to
37
+ bootstrap from, and `/startcycle-graph` cannot run correctly until one is
38
+ installed. Don't silently proceed.
30
39
  (`.claude/agents/*.md`, the seven agent persona files, do NOT need this
31
40
  treatment — Claude Code resolves subagents from the user-level
32
41
  `~/.claude/agents/` fine without a project-local copy.)
@@ -37,9 +46,20 @@ yourself (e.g. `echo $HOME` or your own environment info) rather than
37
46
  hardcoding a username, giving
38
47
  `$HOME/.claude/workflows/startcycle-dispatch.mjs` — and `args` set to the
39
48
  goal text that follows `ARGUMENTS:` below this file's content. Pass the goal
40
- through verbatim. If there is no `ARGUMENTS:` text, pass no `args` (or
41
- `args: undefined`) the workflow itself asks for a goal in that case rather
42
- than guessing one.
49
+ through verbatim, including any `--skill=<name>` flag(s) it contains the
50
+ dispatcher script parses those itself (see below), do not strip or
51
+ interpret them yourself. If there is no `ARGUMENTS:` text, pass no `args`
52
+ (or `args: undefined`) — the workflow itself asks for a goal in that case
53
+ rather than guessing one.
54
+
55
+ **Injecting a specific skill.** `/startcycle-graph --skill=<name> <goal>`
56
+ (repeatable, quote a name with spaces) forces that skill into this run as a
57
+ hard requirement for the build nodes, validated to exist before anything
58
+ else runs — this is how you make the pipeline use your own private skill
59
+ that isn't part of `.agents/nodes.json`'s registry. See
60
+ [`.agents/graph.md`](../../../.agents/graph.md)'s "Mandatory Skill
61
+ Injection" section for the full mechanics; nothing about it needs handling
62
+ in this router file, since `args` is passed through as raw text either way.
43
63
 
44
64
  Use `scriptPath`, not `name: "startcycle-dispatch"` — by-name lookup for a
45
65
  custom (non-built-in) workflow script has been observed to fail with
@@ -29,6 +29,24 @@ Do not invent more structure than the task has. A two-file edit doesn't need
29
29
  a Plan node — just do it. This skill is for the cases actually shaped like a
30
30
  small graph, not an excuse to always draw one.
31
31
 
32
+ ## 1b. Injecting a specific skill (optional)
33
+
34
+ `/startcycle-graph-user --skill=<name> <task>` (repeatable, quote a name
35
+ with spaces) forces that skill into this run as a hard requirement — for a
36
+ private skill of the user's own this throwaway graph would otherwise never
37
+ know to reach for. Extract any `--skill=` flag(s) from the invocation text
38
+ before step 1, confirm each name resolves to a real `SKILL.md` (under
39
+ `~/.claude/skills/<name>/` or this project's own `skills/` tree if it has
40
+ one) — stop and tell the user if one doesn't, never silently proceed
41
+ without it — and include it as a **hard requirement, not a suggestion** in
42
+ the Plan node's and every Worker node's prompt. The Review node checks the
43
+ combined output for evidence the skill was actually applied, not just
44
+ mentioned, and calls that out explicitly if it wasn't. Nothing about this
45
+ gets persisted, same as everything else in this skill — it's a per-run
46
+ instruction, not a contract. See
47
+ [`.agents/graph.md`](../../../.agents/graph.md)'s "Mandatory Skill
48
+ Injection" section for the same mechanic in the durable graph variant.
49
+
32
50
  ## 2. Detect what's available — before deciding how workers run
33
51
 
34
52
  ```bash
@@ -39,21 +57,53 @@ command -v codex >/dev/null 2>&1 && echo codex
39
57
 
40
58
  This machine may have none of these — the skill (and whoever installed this
41
59
  package) cannot assume Antigravity, OpenCode, or a Codex plugin connector is
42
- present. Pick the worker path in this priority order, first one found wins:
43
-
44
- 1. **agy present** workers run via `agy-job start --tier flash [--yolo] "<task>"`
45
- (or `pro` for harder reasoning) see the `antigravity` skill for the exact
46
- invocation pattern and cost discipline. Separate compute pool, zero
47
- Anthropic tokens for the work itself.
48
- 2. **opencode present** → route worker tasks through it the same way (its own
49
- subagent/session primitive), if the project already uses it.
50
- 3. **codex present** same idea, via the Codex CLI's own task-delegation
51
- surface if this project has that plugin wired up.
52
- 4. **none present** fall back to Claude Code's own `Agent` tool for each
60
+ present.
61
+
62
+ **Prefer a plugin's own delegation subagent over shelling out to its CLI.**
63
+ If a delegation plugin is installed, it exposes a subagent that already
64
+ handles the wrapper flags, the cost discipline, and the digest contract for
65
+ you reach for that first, and only drop to a raw CLI call when no such
66
+ subagent exists:
67
+
68
+ | CLI | Plugin subagent (preferred) | Raw fallback |
69
+ |---|---|---|
70
+ | agy | `antigravity:antigravity-delegate` | `agy-job start --tier flash [--yolo] "<task>"` |
71
+ | opencode | `opencode:opencode-rescue` | the CLI's own session primitive |
72
+ | codex | `codex:codex-rescue` | the Codex CLI's task-delegation surface |
73
+
74
+ These subagents are **Claude Code plugins**, so they exist only when that
75
+ harness is running *and* the plugin is installed. Check what is actually
76
+ available rather than assuming — on any other harness, or a machine without
77
+ the plugins, the raw CLI column is the only path. Neither column ships with
78
+ AOS: both depend on tooling the user installed separately.
79
+
80
+ Pick the worker path in this priority order, first one found wins:
81
+
82
+ 1. **A delegation plugin subagent is available** → use it (table above).
83
+ Separate compute pool, zero Anthropic tokens for the work itself, and the
84
+ wrapper reports failures in a shape the plugin already knows how to read.
85
+ 2. **The CLI is present but its plugin subagent is not** → call the CLI
86
+ directly per the raw-fallback column, following the `antigravity` skill's
87
+ invocation pattern and cost discipline.
88
+ 3. **None present** → fall back to Claude Code's own `Agent` tool for each
53
89
  worker, with an explicit `model: "haiku"` override. This is the only path
54
90
  that costs Anthropic tokens for the worker step, and the only one
55
91
  guaranteed to exist everywhere — it is the floor, not the default.
56
92
 
93
+ **Give the delegation a real timeout.** Measured 2026-09: a trivial headless
94
+ `agy` prompt took **605s**. `agy-delegate` defaults to `--print-timeout 5m`,
95
+ so it aborts at 300s and reports an empty body while the answer is still on
96
+ its way — pass `--timeout 15m` for anything non-trivial. Budget worker
97
+ wall-clock accordingly; this is the single most likely reason a fan-out
98
+ "fails" on a machine where the CLI is perfectly healthy.
99
+
100
+ **Verify the delegation actually produced content — a status string is not a
101
+ result.** A timed-out delegation returns `{"status": "SUCCESS", "usage":
102
+ {"total": 0}}` with an *empty* body: success by every field except the one
103
+ that matters. The zero token counts are not proof the prompt never arrived —
104
+ headless usage reporting is simply unpopulated. Check the returned text
105
+ itself, and treat an empty body as a failure no matter what the status says.
106
+
57
107
  **This decision happens here, in your own turn, via Bash — never inside a
58
108
  `Workflow` script.** A `Workflow` script's body has no shell or filesystem
59
109
  access (ambient `agent()`/`pipeline()` globals only), so it cannot itself
@@ -104,6 +154,8 @@ graph (`.agents/graph.md`) already does properly.
104
154
  | "The session is already on Opus, so the worker call inherits it fine." | That's exactly the cost this skill exists to avoid — force the tier explicitly every time. |
105
155
  | "This task has one obvious step, but a 3-node graph looks more thorough." | More nodes than the task needs is overhead, not rigor. Size the graph to the work. |
106
156
  | "I'll just call the Workflow tool and let the script figure out which backend to use." | The script can't — it has no shell access. That decision is yours, before the Workflow call, or not via Workflow at all. |
157
+ | "The CLI is on PATH, so I'll shell out to it directly." | If its plugin subagent is installed, that's the supported path — it already handles the wrapper flags and cost discipline. Shell out only when no subagent exists. |
158
+ | "The wrapper returned SUCCESS, so the work is done." | A failing delegation has returned `SUCCESS` with zero tokens and an empty body. Check the actual content, not the status field. |
107
159
 
108
160
  ## 7. Red Flags
109
161
 
@@ -115,5 +167,7 @@ graph (`.agents/graph.md`) already does properly.
115
167
  ## 8. Verification
116
168
 
117
169
  - [ ] Detection step actually ran (`command -v` checks), not assumed.
170
+ - [ ] A plugin delegation subagent was preferred where one was available, rather than shelling out to the CLI anyway.
118
171
  - [ ] Each node's model was explicitly forced, not inherited.
172
+ - [ ] Each worker's returned **content** was checked, not just its status field — an empty body is a failure regardless of a `SUCCESS` status.
119
173
  - [ ] Nothing persistent was left behind after the task completed.
@@ -35,6 +35,7 @@ You are strictly required to enforce the following 6 pillars in your process:
35
35
 
36
36
  ### 6. Shipping Godmode & Pipeline Hand-off
37
37
  - Before the brainstorm concludes, verify that the plan satisfies the `godmode-shipping` rules (Spec-Driven Development, feature flags, rollback strategies).
38
+ - **Mandatory — Plan Canvas review.** Write the aligned plan to a file, then run `aos-plan-canvas open <file>` followed by `aos-plan-canvas await <file>` and leave it running. The user reviews and annotates in the browser (Mermaid diagrams render live, click-to-annotate, chat rail); do not write `state.goal` or hand off to `/startcycle-graph` before an `approve` verdict comes back. A `request_changes` verdict means revise the plan file and reopen the session — it live-reloads. This runs identically regardless of which agent harness is executing this skill; it is a plain CLI, not a Claude-Code-specific mechanism. See the `plan-canvas` skill.
38
39
  - Present the aligned plan and hand off to `/startcycle-graph` for execution — write `state.goal` from this session's output and let `/startcycle-graph`'s dispatcher take it from there (see `.agents/graph.md`). This skill does not invoke `/startcycle-graph`'s agents itself; it produces the goal they read.
39
40
 
40
41
  ## Execution Rules