@chllming/wave-orchestration 0.5.3 → 0.5.4

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 (79) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +56 -509
  3. package/docs/README.md +39 -0
  4. package/docs/concepts/context7-vs-skills.md +94 -0
  5. package/docs/concepts/operating-modes.md +91 -0
  6. package/docs/concepts/runtime-agnostic-orchestration.md +95 -0
  7. package/docs/concepts/what-is-a-wave.md +133 -0
  8. package/docs/guides/planner.md +113 -0
  9. package/docs/guides/terminal-surfaces.md +80 -0
  10. package/docs/image.png +0 -0
  11. package/docs/plans/context7-wave-orchestrator.md +2 -0
  12. package/docs/plans/current-state.md +10 -0
  13. package/docs/plans/master-plan.md +3 -3
  14. package/docs/plans/migration.md +4 -3
  15. package/docs/plans/wave-orchestrator.md +27 -3
  16. package/docs/reference/runtime-config/README.md +19 -0
  17. package/docs/reference/skills.md +156 -0
  18. package/docs/roadmap.md +160 -564
  19. package/package.json +2 -1
  20. package/releases/manifest.json +17 -0
  21. package/scripts/wave-orchestrator/config.mjs +17 -0
  22. package/scripts/wave-orchestrator/context7.mjs +9 -0
  23. package/scripts/wave-orchestrator/coordination.mjs +16 -0
  24. package/scripts/wave-orchestrator/executors.mjs +24 -11
  25. package/scripts/wave-orchestrator/install.mjs +41 -2
  26. package/scripts/wave-orchestrator/launcher.mjs +113 -20
  27. package/scripts/wave-orchestrator/planner.mjs +1328 -0
  28. package/scripts/wave-orchestrator/project-profile.mjs +190 -0
  29. package/scripts/wave-orchestrator/shared.mjs +2 -0
  30. package/scripts/wave-orchestrator/skills.mjs +448 -0
  31. package/scripts/wave-orchestrator/terminals.mjs +16 -0
  32. package/scripts/wave-orchestrator/traces.mjs +23 -0
  33. package/scripts/wave-orchestrator/wave-files.mjs +299 -84
  34. package/scripts/wave.mjs +11 -0
  35. package/skills/provider-aws/SKILL.md +6 -0
  36. package/skills/provider-aws/skill.json +5 -0
  37. package/skills/provider-custom-deploy/SKILL.md +5 -0
  38. package/skills/provider-custom-deploy/skill.json +5 -0
  39. package/skills/provider-docker-compose/SKILL.md +6 -0
  40. package/skills/provider-docker-compose/skill.json +5 -0
  41. package/skills/provider-github-release/SKILL.md +6 -0
  42. package/skills/provider-github-release/skill.json +5 -0
  43. package/skills/provider-kubernetes/SKILL.md +6 -0
  44. package/skills/provider-kubernetes/skill.json +5 -0
  45. package/skills/provider-railway/SKILL.md +6 -0
  46. package/skills/provider-railway/adapters/claude.md +1 -0
  47. package/skills/provider-railway/adapters/codex.md +1 -0
  48. package/skills/provider-railway/adapters/local.md +1 -0
  49. package/skills/provider-railway/adapters/opencode.md +1 -0
  50. package/skills/provider-railway/skill.json +5 -0
  51. package/skills/provider-ssh-manual/SKILL.md +6 -0
  52. package/skills/provider-ssh-manual/skill.json +5 -0
  53. package/skills/repo-coding-rules/SKILL.md +7 -0
  54. package/skills/repo-coding-rules/skill.json +5 -0
  55. package/skills/role-deploy/SKILL.md +6 -0
  56. package/skills/role-deploy/skill.json +5 -0
  57. package/skills/role-documentation/SKILL.md +6 -0
  58. package/skills/role-documentation/skill.json +5 -0
  59. package/skills/role-evaluator/SKILL.md +6 -0
  60. package/skills/role-evaluator/skill.json +5 -0
  61. package/skills/role-implementation/SKILL.md +6 -0
  62. package/skills/role-implementation/skill.json +5 -0
  63. package/skills/role-infra/SKILL.md +6 -0
  64. package/skills/role-infra/skill.json +5 -0
  65. package/skills/role-integration/SKILL.md +6 -0
  66. package/skills/role-integration/skill.json +5 -0
  67. package/skills/role-research/SKILL.md +6 -0
  68. package/skills/role-research/skill.json +5 -0
  69. package/skills/runtime-claude/SKILL.md +6 -0
  70. package/skills/runtime-claude/skill.json +5 -0
  71. package/skills/runtime-codex/SKILL.md +6 -0
  72. package/skills/runtime-codex/skill.json +5 -0
  73. package/skills/runtime-local/SKILL.md +5 -0
  74. package/skills/runtime-local/skill.json +5 -0
  75. package/skills/runtime-opencode/SKILL.md +6 -0
  76. package/skills/runtime-opencode/skill.json +5 -0
  77. package/skills/wave-core/SKILL.md +7 -0
  78. package/skills/wave-core/skill.json +5 -0
  79. package/wave.config.json +27 -0
@@ -9,8 +9,8 @@
9
9
 
10
10
  ## Near-Term Work
11
11
 
12
- - Keep the starter wave, role prompts, and component cutover matrix aligned with the shipped launcher behavior.
12
+ - Keep the starter wave, role prompts, starter skills, and component cutover matrix aligned with the shipped launcher and planner behavior.
13
13
  - Expand `wave doctor` and migration guidance around cross-repo adoption, executor availability, and future breaking config changes.
14
- - Add richer starter templates for additional repository shapes after the generic single-repo path is stable.
14
+ - Build on the shipped planner foundation with richer starter templates and eventually ad-hoc or forward-replan flows.
15
15
  - Extend replay and trace tooling from internal helpers and file-backed artifacts into easier operator workflows, larger historical fixtures, and a public replay surface if it proves stable.
16
- - Add the remaining roadmap items that are not yet shipped, especially richer capability routing and better operator workflows around cross-lane dependency tickets.
16
+ - Add the remaining roadmap items that are not yet shipped, especially stronger operating-mode enforcement and better operator workflows around cross-lane dependency tickets.
@@ -5,8 +5,8 @@
5
5
  1. Install the package from npmjs with `pnpm add -D @chllming/wave-orchestration`.
6
6
  2. For a fresh repo, run `pnpm exec wave init`.
7
7
  3. For a repo that already has Wave config, docs, or waves you want to preserve, run `pnpm exec wave init --adopt-existing`.
8
- 4. Edit `wave.config.json` for the repo's docs, roles, validation rules, executor defaults, and component-cutover matrix paths.
9
- 5. Replace the starter plan docs, sample waves, and component cutover matrix with repository-specific ones.
8
+ 4. Edit `wave.config.json` for the repo's docs, roles, validation rules, executor defaults, skill attachment policy, and component-cutover matrix paths.
9
+ 5. Replace the starter plan docs, sample waves, starter `skills/` bundles, and component cutover matrix with repository-specific ones.
10
10
  6. Configure Context7 bundles for the external libraries that repo actually uses.
11
11
  7. Run `pnpm exec wave doctor` and `pnpm exec wave launch --lane main --dry-run --no-dashboard` until validation passes.
12
12
  8. Inspect seeded coordination and inbox artifacts with `pnpm exec wave coord show --lane main --wave 0 --dry-run --json` and `pnpm exec wave coord inbox --lane main --wave 0 --agent A1 --dry-run`.
@@ -18,5 +18,6 @@ GitHub Packages remains available as an authenticated fallback path, and maintai
18
18
 
19
19
  - Package upgrades change the runtime behavior in `node_modules`; they do not copy a new starter scaffold into the repo.
20
20
  - `wave upgrade` writes `.wave/install-state.json` and `.wave/upgrade-history/*` only.
21
- - Existing `wave.config.json`, role prompts, plan docs, Context7 bundles, and wave files are never overwritten by the upgrade flow.
21
+ - Existing `wave.config.json`, role prompts, plan docs, `skills/` bundles, Context7 bundles, and wave files are never overwritten by the upgrade flow.
22
+ - Fresh `wave init` seeds the starter `skills/` library. `wave init --adopt-existing` records existing repo-owned skill bundles when they are already present, but does not replace or rewrite them.
22
23
  - The current runtime expects the post-roadmap model: typed coordination, compiled inboxes, `A8` integration, staged closure, orchestrator-first clarification, and operational runtime policy.
@@ -2,6 +2,8 @@
2
2
 
3
3
  The Wave Orchestrator coordinates repository work as bounded execution waves.
4
4
 
5
+ For the broader docs map, concept pages, and workflow guides, start at [docs/README.md](../README.md).
6
+
5
7
  ## What It Does
6
8
 
7
9
  - parses wave plans from `docs/plans/waves/`
@@ -19,6 +21,9 @@ The Wave Orchestrator coordinates repository work as bounded execution waves.
19
21
 
20
22
  ## Main Commands
21
23
 
24
+ - `pnpm exec wave project setup`
25
+ - `pnpm exec wave project show --json`
26
+ - `pnpm exec wave draft --wave 1 --template implementation`
22
27
  - `pnpm exec wave init`
23
28
  - `pnpm exec wave init --adopt-existing`
24
29
  - `pnpm exec wave doctor`
@@ -37,10 +42,25 @@ The Wave Orchestrator coordinates repository work as bounded execution waves.
37
42
 
38
43
  ## Configuration
39
44
 
40
- - `wave.config.json` controls docs roots, shared plan docs, role prompts, validation thresholds, executor defaults, executor profiles, per-lane runtime policy, component-cutover matrix paths, capability-routing preferences, and Context7 bundle-index location.
45
+ - `wave.config.json` controls docs roots, shared plan docs, role prompts, validation thresholds, executor defaults, executor profiles, per-lane runtime policy, skill attachment policy, component-cutover matrix paths, capability-routing preferences, and Context7 bundle-index location.
41
46
  - `docs/context7/bundles.json` controls allowed external library bundles and lane defaults.
42
47
  - `docs/plans/component-cutover-matrix.json` is the canonical machine-readable source for component maturity and per-wave promotion targets.
43
48
  - `.wave/install-state.json` records how the workspace was initialized and which package version is installed.
49
+ - `.wave/project-profile.json` records planner defaults such as oversight mode, terminal surface, and deploy-environment memory.
50
+
51
+ ## Skill Packs
52
+
53
+ - Wave skill bundles live under `skills/<skill-id>/`.
54
+ - Each bundle requires `skill.json` and `SKILL.md`.
55
+ - Bundles can also include runtime adapters at `adapters/<runtime>.md` for `codex`, `claude`, `opencode`, or `local`.
56
+ - The starter config resolves skills in this order: global base, lane base, global role map, lane role map, global runtime map, lane runtime map, global deploy-kind map, lane deploy-kind map, then explicit per-agent `### Skills`.
57
+ - The effective skill set is recomputed after final executor resolution, including retry-time runtime fallback, so a fallback from one runtime to another also swaps runtime-specific skill overlays.
58
+ - Starter bundles in this repo cover:
59
+ - core Wave coordination and repo coding rules
60
+ - runtime packs for Codex, Claude, OpenCode, and local execution
61
+ - role packs for implementation, integration, documentation, evaluator, infra, deploy, and research work
62
+ - deploy and environment packs for Railway, Docker Compose, Kubernetes, SSH/manual rollout, and generic custom deploys
63
+ - explicit provider packs for GitHub release flow and AWS norms when a wave or lane wants to attach them
44
64
 
45
65
  ## Setup
46
66
 
@@ -48,7 +68,7 @@ The Wave Orchestrator coordinates repository work as bounded execution waves.
48
68
  2. Confirm `tmux` and at least one real executor (`codex`, `claude`, or `opencode`) are available if you want real wave execution.
49
69
  3. Run `pnpm exec wave init` for a fresh repo, or `pnpm exec wave init --adopt-existing` for a repo with existing Wave files you want preserved.
50
70
  4. Review [wave.config.json](../../wave.config.json).
51
- 5. Review the role prompts and docs you want the repo to own.
71
+ 5. Review the role prompts, starter `skills/` bundles, and docs you want the repo to own.
52
72
 
53
73
  ## Recommended Launch Flow
54
74
 
@@ -143,6 +163,7 @@ pnpm exec wave changelog --since-installed
143
163
  - dashboards: `.tmp/<lane>-wave-launcher/dashboards/`
144
164
  - Context7 cache: `.tmp/<lane>-wave-launcher/context7-cache/`
145
165
  - executor overlays: `.tmp/<lane>-wave-launcher/executors/`
166
+ Each agent overlay can include `skills.resolved.md`, `skills.metadata.json`, and `<runtime>-skills.txt` in addition to the runtime-specific executor files.
146
167
  - cross-lane dependencies: `.tmp/wave-orchestrator/dependencies/`
147
168
  Required inbound tickets in this directory block both autonomous wave launch and lane finalization until they resolve.
148
169
  - cross-wave orchestration board: `.tmp/wave-orchestrator/messageboards/orchestrator.md`
@@ -164,7 +185,7 @@ pnpm exec wave changelog --since-installed
164
185
  - `structured-signals.json`
165
186
  - `quality.json`
166
187
  - `run-metadata.json`
167
- - `run-metadata.json` is the canonical trace index. It records attempt settings, artifact presence, executor history, prompt hashes, Context7 snippet hashes, the gate snapshot, `replayContext`, and the cumulative `historySnapshot` for that attempt.
188
+ - `run-metadata.json` is the canonical trace index. It records attempt settings, artifact presence, executor history, prompt hashes, Context7 snippet hashes, resolved skill ids and bundle metadata, the gate snapshot, `replayContext`, and the cumulative `historySnapshot` for that attempt.
168
189
  - `outcome.json` is the stored replay baseline. Replay compares recomputed gates and quality against it instead of trusting only inline metadata.
169
190
  - For `traceVersion: 2`, launched agents must have copied prompt/log/status/inbox/summary artifacts, and promoted-component waves must include the copied component matrix JSON.
170
191
  - `quality.json` is cumulative through the current attempt. It is intended for regression comparison, not only for one-shot pass/fail reporting.
@@ -180,7 +201,9 @@ pnpm exec wave changelog --since-installed
180
201
  - From the configured thresholds onward, every non-A0/A8/A9 agent must declare `### Components` and emit `[wave-component]` markers for those components.
181
202
  - `### Capabilities` is optional and lets the scheduler route targeted follow-up work by capability.
182
203
  - `### Deliverables` is optional and lets a wave declare exact repo-relative file outputs that must exist, and that stay within the agent's declared file ownership, before an implementation agent can satisfy its exit contract.
204
+ - `### Skills` is optional and adds explicit skill ids from `skills/` on top of the lane, role, runtime, and deploy-kind defaults.
183
205
  - `### Executor` can declare `profile`, `fallbacks`, `tags`, and runtime budgets in addition to vendor-specific overrides.
206
+ - `## Deploy environments` lets the wave declare named deployment targets. The default deploy environment kind is also used for deploy-kind skill attachment.
184
207
  - Lane runtime policy can assign a default executor by role even when the wave omits `### Executor`.
185
208
  - Use `### Role prompts` for standing-role imports from `docs/agents/*.md`.
186
209
  - Optional standing roles available in this repo include `docs/agents/wave-infra-role.md` for infra proof and `docs/agents/wave-deploy-verifier-role.md` for rollout verification.
@@ -202,6 +225,7 @@ pnpm exec wave changelog --since-installed
202
225
  - `--executor local` exists only for smoke-testing prompt and closure behavior.
203
226
  - `--codex-sandbox danger-full-access` is the default because it avoids host bubblewrap assumptions.
204
227
  - Resolution order is: per-agent explicit executor id, executor profile id, lane role default, CLI `--executor`, then `executors.default`.
228
+ - Skills resolve only after that executor choice is known. Runtime-specific skill overlays are regenerated whenever retry-time fallback changes the selected executor.
205
229
  - Runtime mix targets are enforced before launch and again before any retry-time fallback reassignment.
206
230
  - Fallbacks are declared in profiles or lane policy, can be applied automatically on retry when the next executor is available and still satisfies mix targets, and are recorded in the ledger, integration summary, and traces when used.
207
231
  - Generic `budget.minutes` caps per-agent attempt timeouts. Generic `budget.turns` seeds `claude.maxTurns` and `opencode.steps` when executor-specific values are not set.
@@ -38,6 +38,20 @@ Merge behavior:
38
38
  - lane executor overrides replace the corresponding global runtime fields before profile and agent resolution
39
39
  - a lane profile with the same name as a global profile replaces that profile definition for the lane
40
40
 
41
+ Skill settings resolve after executor selection, because runtime and deploy-kind skill attachment depend on the resolved executor id and the wave's default deploy environment kind. The starter layering order is:
42
+
43
+ 1. `skills.base`
44
+ 2. `lanes.<lane>.skills.base`
45
+ 3. `skills.byRole[resolvedRole]`
46
+ 4. `lanes.<lane>.skills.byRole[resolvedRole]`
47
+ 5. `skills.byRuntime[resolvedExecutorId]`
48
+ 6. `lanes.<lane>.skills.byRuntime[resolvedExecutorId]`
49
+ 7. `skills.byDeployKind[defaultDeployEnvironmentKind]`
50
+ 8. `lanes.<lane>.skills.byDeployKind[defaultDeployEnvironmentKind]`
51
+ 9. agent `### Skills`
52
+
53
+ When retry-time fallback changes the runtime, Wave recomputes the effective skill set and rewrites the executor overlay before relaunch.
54
+
41
55
  ## Common Fields
42
56
 
43
57
  These fields are shared across runtimes:
@@ -68,11 +82,16 @@ Wave writes runtime artifacts here:
68
82
  Common files:
69
83
 
70
84
  - `launch-preview.json`: resolved invocation lines, env vars, and retry mode
85
+ - `skills.resolved.md`: canonical merged skill payload for the selected agent and runtime
86
+ - `skills.metadata.json`: resolved skill ids, bundle metadata, hashes, and generated artifact paths
87
+ - `<runtime>-skills.txt`: runtime-projected skill text used by the selected executor
71
88
  - `claude-system-prompt.txt`: generated Claude harness prompt overlay
72
89
  - `claude-settings.json`: generated Claude settings overlay when inline settings data is present
73
90
  - `opencode-agent-prompt.txt`: generated OpenCode harness prompt overlay
74
91
  - `opencode.json`: generated OpenCode runtime config overlay
75
92
 
93
+ `launch-preview.json` also records the resolved skill metadata so dry-run can verify the exact runtime plus skill combination before any live launch.
94
+
76
95
  ## Recommended Validation Path
77
96
 
78
97
  Use dry-run before relying on a new runtime configuration:
@@ -0,0 +1,156 @@
1
+ # Skills Reference
2
+
3
+ Skills are repo-owned reusable instruction bundles that can be attached by lane, role, runtime, deploy kind, or explicit per-agent declaration.
4
+
5
+ ## Canonical Bundle Layout
6
+
7
+ Each bundle lives under `skills/<skill-id>/` and requires:
8
+
9
+ - `skill.json`
10
+ - `SKILL.md`
11
+
12
+ Optional runtime adapters live under:
13
+
14
+ - `adapters/codex.md`
15
+ - `adapters/claude.md`
16
+ - `adapters/opencode.md`
17
+ - `adapters/local.md`
18
+
19
+ Minimal example:
20
+
21
+ ```text
22
+ skills/provider-railway/
23
+ skill.json
24
+ SKILL.md
25
+ adapters/
26
+ codex.md
27
+ claude.md
28
+ opencode.md
29
+ local.md
30
+ ```
31
+
32
+ ## `skill.json`
33
+
34
+ Required fields in practice:
35
+
36
+ - `id`
37
+ - `title`
38
+ - `description`
39
+
40
+ The bundle directory name and manifest `id` must match the normalized skill id.
41
+
42
+ ## `SKILL.md`
43
+
44
+ This is the canonical human-authored instruction body for the skill.
45
+
46
+ Keep it focused on reusable guidance that should survive across:
47
+
48
+ - many waves
49
+ - multiple roles
50
+ - multiple runtimes
51
+
52
+ Do not duplicate volatile assignment-specific details that belong in the wave prompt instead.
53
+
54
+ ## `wave.config.json` Surface
55
+
56
+ Top-level and lane-local skill attachment use the same shape:
57
+
58
+ ```json
59
+ {
60
+ "skills": {
61
+ "dir": "skills",
62
+ "base": ["wave-core"],
63
+ "byRole": {
64
+ "implementation": ["role-implementation"]
65
+ },
66
+ "byRuntime": {
67
+ "codex": ["runtime-codex"]
68
+ },
69
+ "byDeployKind": {
70
+ "railway-mcp": ["provider-railway"]
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ Lane-local `lanes.<lane>.skills` extends the global config instead of replacing it.
77
+
78
+ ## Resolution Order
79
+
80
+ Resolved skills attach in this order:
81
+
82
+ 1. global `skills.base`
83
+ 2. lane `skills.base`
84
+ 3. global `skills.byRole[resolvedRole]`
85
+ 4. lane `skills.byRole[resolvedRole]`
86
+ 5. global `skills.byRuntime[resolvedExecutorId]`
87
+ 6. lane `skills.byRuntime[resolvedExecutorId]`
88
+ 7. global `skills.byDeployKind[defaultDeployEnvironmentKind]`
89
+ 8. lane `skills.byDeployKind[defaultDeployEnvironmentKind]`
90
+ 9. agent `### Skills`
91
+
92
+ Duplicates are removed while preserving first-seen order.
93
+
94
+ ## Per-Agent Attachment
95
+
96
+ Wave markdown can add explicit skills:
97
+
98
+ ````md
99
+ ### Skills
100
+
101
+ - provider-github-release
102
+ - provider-aws
103
+ ````
104
+
105
+ These are additive. They do not replace the base, role, runtime, or deploy-kind skill layers.
106
+
107
+ ## Deploy-Kind Attachment
108
+
109
+ Deploy-kind mapping uses the wave's default deploy environment from `## Deploy environments`.
110
+
111
+ If the wave declares:
112
+
113
+ ````md
114
+ ## Deploy environments
115
+
116
+ - `prod`: `railway-mcp` default
117
+ ````
118
+
119
+ then `byDeployKind.railway-mcp` skills become eligible for agents in that wave.
120
+
121
+ ## Runtime Projection
122
+
123
+ The canonical bundle is shared, but projection is runtime specific:
124
+
125
+ - Codex
126
+ Skill bundle directories become `--add-dir` inputs, and the merged skill text is included in the compiled prompt.
127
+ - Claude
128
+ The merged skill payload is appended to the generated system-prompt overlay.
129
+ - OpenCode
130
+ Skill instructions flow into `opencode.json`, and relevant files are attached through `--file`.
131
+ - Local
132
+ Skill text stays prompt-only.
133
+
134
+ ## Generated Artifacts
135
+
136
+ Executor overlay directories can contain:
137
+
138
+ - `skills.resolved.md`
139
+ - `skills.metadata.json`
140
+ - `<runtime>-skills.txt`
141
+
142
+ Dry-run `launch-preview.json` and live trace metadata also record the resolved skill ids and bundle metadata.
143
+
144
+ ## Validation
145
+
146
+ `wave doctor` validates that all configured skill bundles referenced by lane skill config exist and can be loaded.
147
+
148
+ Missing or malformed bundles are treated as configuration errors, not silent no-ops.
149
+
150
+ ## Best Practices
151
+
152
+ - Put repo-specific norms into skills, not repeated wave prompts.
153
+ - Keep skills short and reusable.
154
+ - Use runtime adapters only for runtime-specific instructions.
155
+ - Prefer deploy-kind mapping for environment conventions and explicit `### Skills` only for special cases.
156
+ - Keep bundle ids stable so traces and prompt fingerprints stay intelligible across runs.