@crouton-kit/crouter 0.3.18 → 0.3.19
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/dist/build-root.js +6 -0
- package/dist/builtin-memory/crouter-development/marketplaces.md +164 -0
- package/dist/builtin-memory/crouter-development/personas/base-prompt.md +58 -0
- package/dist/builtin-memory/crouter-development/personas/orchestrator-prompt.md +60 -0
- package/dist/builtin-memory/crouter-development/personas.md +117 -0
- package/dist/builtin-memory/crouter-development/plugins.md +163 -0
- package/dist/builtin-memory/design.md +60 -0
- package/dist/builtin-memory/development.md +116 -0
- package/dist/builtin-memory/planning.md +66 -0
- package/dist/builtin-memory/spec.md +99 -0
- package/dist/builtin-personas/design/orchestrator.md +1 -1
- package/dist/builtin-personas/developer/orchestrator.md +1 -1
- package/dist/builtin-personas/lifecycle/resident.md +1 -1
- package/dist/builtin-personas/lifecycle/terminal.md +5 -2
- package/dist/builtin-personas/orchestration-kernel.md +15 -24
- package/dist/builtin-personas/plan/orchestrator.md +1 -1
- package/dist/builtin-personas/runtime-base.md +6 -3
- package/dist/builtin-personas/spec/orchestrator.md +1 -1
- package/dist/builtin-personas/waiting.md +8 -0
- package/dist/builtin-skills/skills/crouter-development/personas/orchestrator-prompt/SKILL.md +1 -1
- package/dist/builtin-skills/skills/crouter-development/plugins/SKILL.md +2 -2
- package/dist/builtin-views/_lib/states.mjs +161 -0
- package/dist/builtin-views/canvas/client.mjs +303 -0
- package/dist/builtin-views/canvas/view.mjs +576 -0
- package/dist/builtin-views/git-pr/client.mjs +440 -0
- package/dist/builtin-views/git-pr/view.mjs +675 -0
- package/dist/builtin-views/inbox/_lib/render.mjs +177 -0
- package/dist/builtin-views/inbox/sources/gmail.mjs +965 -0
- package/dist/builtin-views/inbox/sources/linkedin.mjs +427 -0
- package/dist/builtin-views/inbox/view.mjs +889 -0
- package/dist/builtin-views/linkedin/client.mjs +610 -0
- package/dist/builtin-views/linkedin/view.mjs +1171 -0
- package/dist/clients/attach/attach-cmd.d.ts +2 -0
- package/dist/clients/attach/attach-cmd.js +354 -0
- package/dist/clients/attach/chat-view.d.ts +77 -0
- package/dist/clients/attach/chat-view.js +450 -0
- package/dist/clients/attach/clipboard-image.d.ts +16 -0
- package/dist/clients/attach/clipboard-image.js +113 -0
- package/dist/clients/attach/config-load.d.ts +31 -0
- package/dist/clients/attach/config-load.js +113 -0
- package/dist/clients/attach/extension-dialogs.d.ts +29 -0
- package/dist/clients/attach/extension-dialogs.js +101 -0
- package/dist/clients/attach/input-controller.d.ts +54 -0
- package/dist/clients/attach/input-controller.js +204 -0
- package/dist/clients/attach/slash-commands.d.ts +36 -0
- package/dist/clients/attach/slash-commands.js +200 -0
- package/dist/clients/attach/view-socket.d.ts +48 -0
- package/dist/clients/attach/view-socket.js +126 -0
- package/dist/commands/attention.js +3 -3
- package/dist/commands/canvas-prune.js +1 -1
- package/dist/commands/daemon.js +3 -2
- package/dist/commands/human/prompts.js +1 -1
- package/dist/commands/human/queue.js +43 -8
- package/dist/commands/human/shared.d.ts +2 -0
- package/dist/commands/memory/find.d.ts +1 -0
- package/dist/commands/memory/find.js +180 -0
- package/dist/commands/memory/lint.d.ts +1 -0
- package/dist/commands/memory/lint.js +140 -0
- package/dist/commands/memory/list.d.ts +1 -0
- package/dist/commands/memory/list.js +79 -0
- package/dist/commands/memory/read.js +103 -0
- package/dist/commands/memory/shared.d.ts +30 -0
- package/dist/commands/memory/shared.js +122 -0
- package/dist/commands/memory/write.d.ts +1 -0
- package/dist/commands/memory/write.js +85 -0
- package/dist/commands/memory.d.ts +2 -0
- package/dist/commands/memory.js +27 -0
- package/dist/commands/node.d.ts +3 -2
- package/dist/commands/node.js +607 -61
- package/dist/commands/pkg/market-manage.js +1 -1
- package/dist/commands/push.js +6 -6
- package/dist/commands/revive.js +1 -1
- package/dist/commands/skill/author.js +1 -1
- package/dist/commands/skill/shared.d.ts +1 -8
- package/dist/commands/skill/shared.js +2 -55
- package/dist/commands/skill.js +9 -14
- package/dist/commands/sys/doctor.js +1 -1
- package/dist/commands/sys/update.js +1 -1
- package/dist/commands/view-cycle.d.ts +2 -0
- package/dist/commands/view-cycle.js +125 -0
- package/dist/commands/view-list.d.ts +2 -0
- package/dist/commands/view-list.js +66 -0
- package/dist/commands/view-new.d.ts +2 -0
- package/dist/commands/view-new.js +70 -0
- package/dist/commands/view-pick.d.ts +2 -0
- package/dist/commands/view-pick.js +119 -0
- package/dist/commands/view-run.d.ts +2 -0
- package/dist/commands/view-run.js +191 -0
- package/dist/commands/view.d.ts +2 -0
- package/dist/commands/view.js +29 -0
- package/dist/core/__tests__/broker-lifecycle.test.d.ts +1 -0
- package/dist/core/__tests__/broker-lifecycle.test.js +677 -0
- package/dist/core/__tests__/broker-sdk-wiring.test.d.ts +1 -0
- package/dist/core/__tests__/broker-sdk-wiring.test.js +166 -0
- package/dist/core/__tests__/cascade-close.test.js +12 -2
- package/dist/core/__tests__/child-death-wake.test.d.ts +1 -0
- package/dist/core/__tests__/child-death-wake.test.js +245 -0
- package/dist/core/__tests__/context-intro.test.js +76 -62
- package/dist/core/__tests__/daemon-boot.test.js +14 -5
- package/dist/core/__tests__/daemon-liveness.test.js +34 -9
- package/dist/core/__tests__/detach-focus.test.d.ts +1 -0
- package/dist/core/__tests__/detach-focus.test.js +206 -0
- package/dist/core/__tests__/draw-style.test.d.ts +1 -0
- package/dist/core/__tests__/draw-style.test.js +258 -0
- package/dist/core/__tests__/fixtures/c3-custom-provider-ext.d.ts +2 -0
- package/dist/core/__tests__/fixtures/c3-custom-provider-ext.js +18 -0
- package/dist/core/__tests__/fixtures/fake-engine.d.ts +138 -0
- package/dist/core/__tests__/fixtures/fake-engine.js +614 -0
- package/dist/core/__tests__/fixtures/fake-pi-host.js +1 -0
- package/dist/core/__tests__/flagship-lifecycle.test.js +7 -1
- package/dist/core/__tests__/frame-decoder-perf.test.d.ts +1 -0
- package/dist/core/__tests__/frame-decoder-perf.test.js +198 -0
- package/dist/core/__tests__/helpers/harness.d.ts +9 -0
- package/dist/core/__tests__/helpers/harness.js +111 -1
- package/dist/core/__tests__/home-session.test.js +41 -8
- package/dist/core/__tests__/human-new-window-regression.test.d.ts +1 -0
- package/dist/core/__tests__/human-new-window-regression.test.js +101 -0
- package/dist/core/__tests__/kickoff.test.js +37 -3
- package/dist/core/__tests__/live-mutation.test.js +50 -33
- package/dist/core/__tests__/memory.test.js +23 -115
- package/dist/core/__tests__/placement-focus.test.js +5 -0
- package/dist/core/__tests__/placement-teardown.test.js +54 -11
- package/dist/core/__tests__/relaunch.test.js +4 -3
- package/dist/core/__tests__/review-render-pane-regression.test.d.ts +1 -0
- package/dist/core/__tests__/review-render-pane-regression.test.js +133 -0
- package/dist/core/__tests__/spawn-root.test.js +10 -0
- package/dist/core/__tests__/spike-harness.test.js +1 -0
- package/dist/core/__tests__/wake-bearings.test.d.ts +1 -0
- package/dist/core/__tests__/wake-bearings.test.js +156 -0
- package/dist/core/__tests__/wake-origin.test.d.ts +1 -0
- package/dist/core/__tests__/wake-origin.test.js +110 -0
- package/dist/core/bootstrap.js +1 -1
- package/dist/core/canvas/browse/__tests__/render.test.js +1 -0
- package/dist/core/canvas/browse/app.js +24 -2
- package/dist/core/canvas/browse/model.d.ts +38 -2
- package/dist/core/canvas/browse/model.js +134 -10
- package/dist/core/canvas/browse/render.d.ts +6 -12
- package/dist/core/canvas/browse/render.js +72 -104
- package/dist/core/canvas/canvas.js +15 -22
- package/dist/core/canvas/db.js +46 -0
- package/dist/core/canvas/index.d.ts +1 -0
- package/dist/core/canvas/index.js +1 -0
- package/dist/core/canvas/pid.d.ts +4 -0
- package/dist/core/canvas/pid.js +23 -0
- package/dist/core/canvas/render.d.ts +11 -2
- package/dist/core/canvas/render.js +69 -0
- package/dist/core/canvas/types.d.ts +85 -3
- package/dist/core/canvas/wakeups.d.ts +76 -0
- package/dist/core/canvas/wakeups.js +185 -0
- package/dist/core/config.js +4 -1
- package/dist/core/frontmatter.js +37 -124
- package/dist/core/memory-resolver.d.ts +49 -0
- package/dist/core/memory-resolver.js +141 -0
- package/dist/core/personas/loader.d.ts +7 -0
- package/dist/core/personas/loader.js +36 -5
- package/dist/core/personas/resolve.js +13 -3
- package/dist/core/predicate.d.ts +63 -0
- package/dist/core/predicate.js +189 -0
- package/dist/core/resolver.js +26 -5
- package/dist/core/runtime/bearings.d.ts +53 -12
- package/dist/core/runtime/bearings.js +132 -59
- package/dist/core/runtime/broker-cli.d.ts +1 -0
- package/dist/core/runtime/broker-cli.js +46 -0
- package/dist/core/runtime/broker-protocol.d.ts +332 -0
- package/dist/core/runtime/broker-protocol.js +153 -0
- package/dist/core/runtime/broker-sdk.d.ts +48 -0
- package/dist/core/runtime/broker-sdk.js +72 -0
- package/dist/core/runtime/broker.d.ts +55 -0
- package/dist/core/runtime/broker.js +1128 -0
- package/dist/core/runtime/close.js +35 -6
- package/dist/core/runtime/host.d.ts +53 -0
- package/dist/core/runtime/host.js +186 -0
- package/dist/core/runtime/kickoff.d.ts +2 -1
- package/dist/core/runtime/kickoff.js +91 -5
- package/dist/core/runtime/launch.d.ts +45 -2
- package/dist/core/runtime/launch.js +65 -2
- package/dist/core/runtime/lifecycle.js +23 -6
- package/dist/core/runtime/memory.d.ts +2 -42
- package/dist/core/runtime/memory.js +11 -162
- package/dist/core/runtime/nodes.d.ts +33 -0
- package/dist/core/runtime/nodes.js +59 -1
- package/dist/core/runtime/persona.js +21 -11
- package/dist/core/runtime/pi-vendored.d.ts +18 -0
- package/dist/core/runtime/pi-vendored.js +49 -0
- package/dist/core/runtime/placement.d.ts +32 -14
- package/dist/core/runtime/placement.js +206 -52
- package/dist/core/runtime/promote.d.ts +0 -6
- package/dist/core/runtime/promote.js +1 -12
- package/dist/core/runtime/{demote.d.ts → recycle.d.ts} +5 -5
- package/dist/core/runtime/{demote.js → recycle.js} +27 -11
- package/dist/core/runtime/reset.js +8 -6
- package/dist/core/runtime/revive.d.ts +2 -0
- package/dist/core/runtime/revive.js +34 -34
- package/dist/core/runtime/spawn.d.ts +19 -0
- package/dist/core/runtime/spawn.js +75 -22
- package/dist/core/runtime/stop-guard.d.ts +1 -1
- package/dist/core/runtime/stop-guard.js +6 -1
- package/dist/core/runtime/tmux-chrome.d.ts +1 -1
- package/dist/core/runtime/tmux-chrome.js +1 -1
- package/dist/core/runtime/tmux.d.ts +28 -0
- package/dist/core/runtime/tmux.js +80 -6
- package/dist/core/scope.d.ts +11 -0
- package/dist/core/scope.js +39 -0
- package/dist/core/spawn.d.ts +5 -0
- package/dist/core/spawn.js +20 -2
- package/dist/core/substrate/gate.d.ts +13 -0
- package/dist/core/substrate/gate.js +21 -0
- package/dist/core/substrate/index.d.ts +7 -0
- package/dist/core/substrate/index.js +18 -0
- package/dist/core/substrate/on-read.d.ts +14 -0
- package/dist/core/substrate/on-read.js +292 -0
- package/dist/core/substrate/render.d.ts +25 -0
- package/dist/core/substrate/render.js +256 -0
- package/dist/core/substrate/schema.d.ts +76 -0
- package/dist/core/substrate/schema.js +124 -0
- package/dist/core/substrate/session-cache.d.ts +30 -0
- package/dist/core/substrate/session-cache.js +77 -0
- package/dist/core/substrate/subject.d.ts +41 -0
- package/dist/core/substrate/subject.js +54 -0
- package/dist/core/tui/contract.d.ts +83 -0
- package/dist/core/tui/contract.js +8 -0
- package/dist/core/tui/draw.d.ts +96 -0
- package/dist/core/tui/draw.js +339 -0
- package/dist/core/tui/host.d.ts +29 -0
- package/dist/core/tui/host.js +379 -0
- package/dist/core/tui/loader.d.ts +16 -0
- package/dist/core/tui/loader.js +94 -0
- package/dist/core/{canvas/browse → tui}/terminal.js +7 -6
- package/dist/core/wake.d.ts +86 -0
- package/dist/core/wake.js +308 -0
- package/dist/daemon/crtrd.d.ts +29 -4
- package/dist/daemon/crtrd.js +662 -46
- package/dist/pi-extensions/__tests__/canvas-context-intro.test.d.ts +1 -0
- package/dist/pi-extensions/__tests__/canvas-context-intro.test.js +171 -0
- package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +19 -12
- package/dist/pi-extensions/canvas-commands.d.ts +3 -0
- package/dist/pi-extensions/canvas-commands.js +10 -0
- package/dist/pi-extensions/canvas-context-intro.d.ts +17 -0
- package/dist/pi-extensions/canvas-context-intro.js +55 -15
- package/dist/pi-extensions/canvas-doc-substrate.d.ts +44 -0
- package/dist/pi-extensions/canvas-doc-substrate.js +112 -0
- package/dist/pi-extensions/canvas-nav.d.ts +3 -0
- package/dist/pi-extensions/canvas-nav.js +87 -23
- package/dist/pi-extensions/canvas-stophook.js +17 -8
- package/dist/pi-extensions/canvas-view.d.ts +21 -0
- package/dist/pi-extensions/canvas-view.js +75 -0
- package/dist/prompts/skill.js +19 -26
- package/dist/prompts/view.d.ts +7 -0
- package/dist/prompts/view.js +101 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.js +1 -0
- package/package.json +9 -4
- package/dist/commands/skill/find.d.ts +0 -4
- package/dist/commands/skill/find.js +0 -257
- package/dist/commands/skill/read.js +0 -91
- /package/dist/commands/{skill → memory}/read.d.ts +0 -0
- /package/dist/core/{canvas/browse → tui}/terminal.d.ts +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: skill
|
|
3
|
+
when: When shaping a design roadmap or producing an architecture/interface design
|
|
4
|
+
why: covers what a design deliverable is, the design-artifact shape, when to go
|
|
5
|
+
top-down vs bottom-up, and how to decompose a large design into composable
|
|
6
|
+
sub-designs.
|
|
7
|
+
short-form: Use when shaping a design roadmap or producing an
|
|
8
|
+
architecture/interface design — covers what a design deliverable is, the
|
|
9
|
+
design-artifact shape, when to go top-down vs bottom-up, and how to decompose
|
|
10
|
+
a large design into composable sub-designs.
|
|
11
|
+
system-prompt-visibility: name
|
|
12
|
+
file-read-visibility: none
|
|
13
|
+
needs-refinement: true
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## What a design deliverable is — and is not
|
|
17
|
+
|
|
18
|
+
A design fixes the load-bearing structure before anyone writes code: component boundaries and responsibilities, interface contracts and data models, key flows, and the decisions that close real options with their rationale and rejected alternatives. It answers "what shape does this thing take and why?" with enough precision that a planner can decompose it into tasks without guessing, and an implementer can build against it without re-designing.
|
|
19
|
+
|
|
20
|
+
A design is NOT requirements — those are testable acceptance criteria that say what the system must do; the design says how it is structured to do it. A design is NOT a task plan — plans break work into ordered implementation steps; the design is the shape that plans execute against. Stay above implementation: no function bodies, no algorithm walkthroughs, no library calls, no ordering of implementation steps. If something could be copied into source code, it belongs in the plan, not the design.
|
|
21
|
+
|
|
22
|
+
The altitude ceiling: a design stops where implementation detail begins. A planner reading the design should have no design questions left; a coder reading it should still have to make implementation choices.
|
|
23
|
+
|
|
24
|
+
## The design-artifact shape
|
|
25
|
+
|
|
26
|
+
Write the design to `context/design-<subject>.md`. Structure it with these sections, in order:
|
|
27
|
+
|
|
28
|
+
**Context & constraints** — the problem being solved, the non-goals, the constraints that are not negotiable (existing systems, performance envelopes, team conventions). This is the frame everything else hangs on.
|
|
29
|
+
|
|
30
|
+
**Architecture** — the high-level structure: what major components or layers exist, how they are arranged, what the topology looks like. Lead with a diagram (mermaid `graph TD`, 3–6 nodes) before prose. Keep it at the level a new engineer would use to orient themselves.
|
|
31
|
+
|
|
32
|
+
**Components & responsibilities** — for each component: one-sentence description of what it owns, a responsibilities table, and explicit boundaries (what it does NOT own). Every responsibility must land in exactly one component; gaps and overlaps here become integration bugs.
|
|
33
|
+
|
|
34
|
+
**Interfaces & contracts** — how components talk to each other. Expressed as prose or sequence diagrams, not API specs or type declarations. "Component A sends X to Component B when Y" is the right level. Include error cases and who owns recovery.
|
|
35
|
+
|
|
36
|
+
**Data model** — the key entities, their fields with semantic types ("session ID string", "ISO timestamp"), and their relationships. Tables are the right format. No TypeScript, no SQL — shape and semantics only.
|
|
37
|
+
|
|
38
|
+
**Key flows** — the 2–4 end-to-end flows that matter most. Walk from trigger to final state, naming which component handles each step and what state changes. This is where seam problems surface; a step whose output doesn't match the next step's expected input is a design gap.
|
|
39
|
+
|
|
40
|
+
**Decisions** — every non-obvious architectural choice, structured as: decision → choice made → alternatives rejected → rationale. If the decision is obvious, omit it. If it closes a real option, it belongs here. This section is what distinguishes a design from a description.
|
|
41
|
+
|
|
42
|
+
**Open risks** — unresolved questions and known unknowns that a reviewer or the implementer will need to address. Not a wish list — only things that could affect the design's validity.
|
|
43
|
+
|
|
44
|
+
## Design styles — when to use each
|
|
45
|
+
|
|
46
|
+
**Top-down, interface-first**: fix the contracts between components first, then fill in what sits behind each contract. Use this when the integration surface is the hard problem — when multiple teams or systems must connect, when the seams will be expensive to change, or when you are designing an API or protocol. The contract is the design; the implementation fills in around it.
|
|
47
|
+
|
|
48
|
+
**Bottom-up, primitives-first**: identify and nail the core data structures or algorithms that the design depends on, then build the component model up from them. Use this when the primitives are the hard part — a novel data model, a performance-critical kernel, a constraint that flows upward and determines everything else.
|
|
49
|
+
|
|
50
|
+
**How much to design up-front**: design enough to unblock parallelism and close the decisions that are expensive to reverse. Don't design what the implementer can decide without risk. A design that specifies too much is as harmful as one that specifies too little — over-specification creates brittleness and deferred rework when reality doesn't match. If a sub-section of the design is genuinely unclear but not on the critical path, name it as open rather than filling it with plausible guesses.
|
|
51
|
+
|
|
52
|
+
## Decomposing a large design
|
|
53
|
+
|
|
54
|
+
When a design is too large for one context window or covers genuinely independent surfaces, decompose it along clean seams — by component, by subsystem, or by interaction surface. Each sub-design is a bounded unit: it covers one component or subsystem end-to-end (its own context, architecture, interfaces, data model, flows, and decisions).
|
|
55
|
+
|
|
56
|
+
Before delegating sub-designs, define the shared interface contracts between them explicitly. These contracts are the seams; they must be written down before sub-design begins so that parallel sub-designs don't invent incompatible assumptions. Capture these contracts in a `context/design-contracts.md` that all sub-design agents receive.
|
|
57
|
+
|
|
58
|
+
Each sub-design agent gets: the overall architecture diagram, the contracts doc, the scope of its piece, and any constraints from the parent design. It writes to `context/design-<component>.md`.
|
|
59
|
+
|
|
60
|
+
After sub-designs land, integration is your job: read every sub-design, check that every contract is honored on both sides, that responsibilities don't overlap or gap, that the data models are consistent, and that the key flows compose correctly across component boundaries. Write the integrated design to `context/design-<subject>.md` synthesizing all sub-designs into one coherent artifact — don't just concatenate them. Reconcile any inconsistencies before declaring the design done.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: skill
|
|
3
|
+
when: When shaping or reshaping a build roadmap
|
|
4
|
+
why: choosing a development style, selecting a phase skeleton, or setting exit
|
|
5
|
+
criteria for a software goal.
|
|
6
|
+
short-form: Use when shaping or reshaping a build roadmap — choosing a
|
|
7
|
+
development style, selecting a phase skeleton, or setting exit criteria for a
|
|
8
|
+
software goal.
|
|
9
|
+
system-prompt-visibility: name
|
|
10
|
+
file-read-visibility: none
|
|
11
|
+
needs-refinement: true
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Development Playbook
|
|
15
|
+
|
|
16
|
+
## Development Styles
|
|
17
|
+
|
|
18
|
+
Pick one style as your primary frame before you write phases. Each fits a different risk/knowledge profile.
|
|
19
|
+
|
|
20
|
+
**Vertical slice.** Start with the thinnest path end-to-end — one real request touching every layer — before thickening any of them. Use when the integration seams are the riskiest unknowns and a working skeleton keeps the team aligned on "done". Fits new features where you know what to build but not how the layers will talk.
|
|
21
|
+
|
|
22
|
+
**Spike-then-harden.** Build a throwaway prototype of the one thing you don't understand, validate the approach, then discard it and build it properly. Use when there is a genuine technical unknown (unfamiliar API, unclear performance profile, novel algorithm) that blocks everything else. The spike is not the deliverable — the hardened version is.
|
|
23
|
+
|
|
24
|
+
**Test-first.** Write the failing test before the implementation for every unit of logic. Use when the requirements are precise and stable (a parser, a data transform, a well-specified algorithm). Do not apply to exploratory or UI-heavy work where the spec is discovered by building.
|
|
25
|
+
|
|
26
|
+
**Strangler-fig.** Introduce a new implementation path alongside the old one, route traffic to it incrementally, and delete the old path when migration is complete. Use for migrations and rewrites where you cannot replace atomically and must maintain a working system throughout.
|
|
27
|
+
|
|
28
|
+
**Bottom-up.** Build foundational primitives first; compose them into higher-order behaviour last. Use when building a library or shared infrastructure where the interface must be right before consumers are written. Risky if the top-level requirements aren't settled — you may build the wrong primitives.
|
|
29
|
+
|
|
30
|
+
**Decision rule:** if the riskiest unknown is technical feasibility, spike first. If it is integration correctness, vertical slice. If requirements are precise and logic-heavy, test-first. If it is a live-system migration, strangler-fig. If it is a foundational library with settled requirements, bottom-up. Default to vertical slice for ambiguous new feature work.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Roadmap Shapes by Scenario
|
|
35
|
+
|
|
36
|
+
These are concrete phase skeletons. Adapt names and granularity; don't add phases that serve no exit criterion.
|
|
37
|
+
|
|
38
|
+
### New feature
|
|
39
|
+
1. **Explore** — map the affected subsystems, identify entry points and constraints, produce `context/explore.md`.
|
|
40
|
+
2. **Spec** — define the interface, behaviour, and acceptance criteria; output `context/spec.md`.
|
|
41
|
+
3. **Plan** — decompose spec into file-level tasks with dependency order; output `context/plan.md`.
|
|
42
|
+
4. **Vertical slice** — implement the thinnest end-to-end path; validate it works before widening.
|
|
43
|
+
5. **Harden** — fill out the remaining logic, edge cases, error paths.
|
|
44
|
+
6. **Review** — non-implementer critique pass on the whole surface.
|
|
45
|
+
7. **Fix** — action review findings.
|
|
46
|
+
8. **Validate** — end-to-end confirmation against spec's acceptance criteria.
|
|
47
|
+
|
|
48
|
+
### Refactor
|
|
49
|
+
1. **Characterise** — write or identify tests that describe current behaviour; they must pass before and after.
|
|
50
|
+
2. **Plan safe steps** — decompose into the smallest semantics-preserving transformations; each step independently reviewable.
|
|
51
|
+
3. **Transform** — apply each step, running the characterisation suite after each one.
|
|
52
|
+
4. **Verify equivalence** — confirm no observable behaviour changed; review for unintended scope drift.
|
|
53
|
+
|
|
54
|
+
### Bug-fix campaign
|
|
55
|
+
1. **Reproduce** — produce a reliable reproduction case for each bug; nothing proceeds without one.
|
|
56
|
+
2. **Root cause** — trace the defect to its source; group bugs sharing a root cause.
|
|
57
|
+
3. **Fix** — implement the minimal correct change; no opportunistic cleanups in the same commit.
|
|
58
|
+
4. **Regression test** — add a test that would have caught this.
|
|
59
|
+
5. **Validate** — confirm the reproduction case no longer triggers.
|
|
60
|
+
|
|
61
|
+
### Greenfield
|
|
62
|
+
1. **Explore/research** — understand the problem domain, constraints, and comparable systems.
|
|
63
|
+
2. **Spec** — define the interface and top-level behaviour in enough detail to plan.
|
|
64
|
+
3. **Architecture decision** — commit to the structural shape; record in `context/architecture.md`.
|
|
65
|
+
4. **Spike** (if technical unknowns exist) — validate the risky piece before building around it.
|
|
66
|
+
5. **Bottom-up build** — primitives first, then composition; validate each layer before building on it.
|
|
67
|
+
6. **Integration** — assemble layers; validate end-to-end.
|
|
68
|
+
7. **Review + fix** — critique full surface; action findings.
|
|
69
|
+
|
|
70
|
+
### Migration / upgrade
|
|
71
|
+
1. **Inventory** — enumerate every call site, every affected API, every integration point.
|
|
72
|
+
2. **Compatibility plan** — decide the strangler-fig boundary; define the coexistence period.
|
|
73
|
+
3. **New path** — implement the replacement without removing the old.
|
|
74
|
+
4. **Route incrementally** — shift traffic or call sites in small batches; validate after each batch.
|
|
75
|
+
5. **Delete old path** — only after full migration is confirmed.
|
|
76
|
+
6. **Validate** — confirm nothing regressed; run the full integration surface.
|
|
77
|
+
|
|
78
|
+
### Performance work
|
|
79
|
+
1. **Baseline** — measure and record current performance numbers; define the target.
|
|
80
|
+
2. **Profile** — identify the actual bottleneck; do not optimise before you know where the heat is.
|
|
81
|
+
3. **Fix the bottleneck** — targeted change only; no speculative optimisation.
|
|
82
|
+
4. **Measure again** — confirm the target is met against the same baseline method.
|
|
83
|
+
5. **Review** — check that the fix doesn't introduce correctness or maintainability regressions.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Setting Exit Criteria per Phase
|
|
88
|
+
|
|
89
|
+
Every phase needs a concrete, evaluable condition that tells you it is genuinely done — not "looks good" or "mostly working". Write exit criteria when you write the phase, not after.
|
|
90
|
+
|
|
91
|
+
- **Explore:** a context doc exists that accurately describes the relevant subsystem; a reviewer or subsequent spec agent should not need to re-explore to write the spec.
|
|
92
|
+
- **Spec:** acceptance criteria are concrete enough that an implementer can derive test cases from them without ambiguity.
|
|
93
|
+
- **Plan:** every task maps to identified files; no task says "figure out how"; dependencies are explicit.
|
|
94
|
+
- **Implementation:** the code compiles, all existing tests pass, and the acceptance criteria from the spec are provably met (by tests or by a validation agent's manual check).
|
|
95
|
+
- **Review:** a non-implementer has read the diff and produced a report; all Major and Critical findings are addressed.
|
|
96
|
+
- **Validation:** end-to-end confirmation against the spec's acceptance criteria passes in the real runtime, not just in isolation.
|
|
97
|
+
|
|
98
|
+
If you cannot write a concrete exit criterion for a phase, the phase is underspecified — split it or spec it further before adding it to the roadmap.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## The Build-Cycle Discipline
|
|
103
|
+
|
|
104
|
+
This is the delegation pipeline from spec to shipped, with the coupling that makes it rigorous.
|
|
105
|
+
|
|
106
|
+
**Spec → Plan.** The plan agent receives the spec as input; it does not re-derive requirements. If the spec is ambiguous, the plan agent reports the ambiguity — the orchestrator resolves it and re-delegates, not the plan agent by guessing.
|
|
107
|
+
|
|
108
|
+
**Plan → Implement (parallel where safe).** Tasks with disjoint file sets run concurrently. Before spawning parallel implementers, verify file-level independence; if two tasks touch the same file, serialize them. Every implementation agent receives: the goal in one sentence, its specific task and done condition, the relevant context files by path, and the e2e validation recipe.
|
|
109
|
+
|
|
110
|
+
**Implement → Review (non-implementer).** The reviewer receives the full diff and the relevant context docs. It produces a report sorted by severity — Critical, Major, Minor — and does not propose fixes inline. One review pass per implementation batch; do not re-review after fixes, validate instead.
|
|
111
|
+
|
|
112
|
+
**Review → Fix.** The orchestrator triages the report, skips false positives, and delegates fix agents pointing at the report path. Fix agents read the findings, understand the code, and implement the correct fix — they are not given line-by-line instructions. Do not spawn a second reviewer after fixes land.
|
|
113
|
+
|
|
114
|
+
**Fix → Validate.** Validation confirms the thing works end-to-end in the real runtime. It is distinct from tests passing — it exercises the integrated system. If validation fails, spawn fix agents against the failure, re-validate. Do not advance to the next phase until validation passes.
|
|
115
|
+
|
|
116
|
+
**When review or validation exposes a phase gap** — a wrong assumption in the spec, a plan that missed a dependency, an implementation that reveals the design is wrong — re-delegate the affected phase rather than patching forward. A corrected spec or plan paid for in one extra wake costs less than an implementation built on a bad foundation.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: skill
|
|
3
|
+
when: When shaping a planning roadmap, deciding plan structure, or fanning out
|
|
4
|
+
plan-review specialists before declaring a plan ready
|
|
5
|
+
why: Use when shaping a planning roadmap, deciding plan structure, or fanning
|
|
6
|
+
out plan-review specialists before declaring a plan ready.
|
|
7
|
+
short-form: Use when shaping a planning roadmap, deciding plan structure, or
|
|
8
|
+
fanning out plan-review specialists before declaring a plan ready.
|
|
9
|
+
system-prompt-visibility: name
|
|
10
|
+
file-read-visibility: none
|
|
11
|
+
needs-refinement: true
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Planning Playbook
|
|
15
|
+
|
|
16
|
+
## Plan Shapes and the Decomposition Decision
|
|
17
|
+
|
|
18
|
+
Every planning effort produces either a flat plan or a decomposed plan (index + part-plans). Choosing the wrong shape wastes a cycle — a flat plan that is too large forces an implementer to hold too much at once; a decomposed plan for something small adds overhead for no gain.
|
|
19
|
+
|
|
20
|
+
**Use a flat plan** when the work is a single coherent domain, involves fewer than ~6 files, and can be written at consistent task granularity without exceeding roughly 150–200 lines. A flat plan has an overview, ordered phases, and a verification section. No sub-plans. One file.
|
|
21
|
+
|
|
22
|
+
**Use a decomposed plan** when the change spans multiple domains (e.g., data layer, API surface, UI), involves 6+ files, or would require a master plan that cannot be written at consistent granularity without ballooning. In this case: produce an index plan (the navigable master) and delegate each domain slice to a `plan`-kind child node, giving each child its slice scope, the relevant portion of the spec, and its place in the dependency graph. A slice that itself decomposes further — multiple sub-domains, more than one window's worth of planning — goes to a `plan` sub-orchestrator created directly (`crtr node new --kind plan --mode orchestrator`), not a base child relied on to promote itself. The index plan is the synthesis artifact — it lists all sub-plans by path, defines phases and their dependencies, and contains a task table the implementation orchestrator can execute directly. Detail lives in sub-plans; the master is not allowed to carry it.
|
|
23
|
+
|
|
24
|
+
**The decomposition trigger is domain boundary, not size alone.** Three backend files and three frontend files are two domains even if the total count is modest — plan them separately and synthesize, because the integration seam is where bugs live and one agent reading both halves won't catch them as cleanly as two agents each going deep.
|
|
25
|
+
|
|
26
|
+
After collecting part-plans from children, synthesize before declaring done: resolve file ownership conflicts (two sub-plans naming the same file means you decide the sequence), align naming across all parts, fill integration gaps at domain boundaries, and ensure the task table in the index accurately reflects dependencies exposed only by reading all sub-plans together.
|
|
27
|
+
|
|
28
|
+
## What a Good Task Looks Like
|
|
29
|
+
|
|
30
|
+
A task is the atomic unit a single implementation node picks up and executes in one context window. Write tasks so that any implementation agent can pick one up cold and know exactly what to do.
|
|
31
|
+
|
|
32
|
+
A good task has: a file path (or a small list of paths it exclusively owns), an explicit statement of what changes in that file, a list of its hard dependencies (which other tasks must land first), and a clear output — what type, what function signature, what export the next task can assume exists. If a task requires a type defined by a sibling task in the same phase, that dependency is explicit in the task row.
|
|
33
|
+
|
|
34
|
+
A good task is **parallel-safe**: its files are not owned by another task in the same phase. If two tasks must touch the same file, serialize them across phases and say so. A task that shares files without serialization is a merge conflict waiting to happen.
|
|
35
|
+
|
|
36
|
+
A good task is **bounded**: an implementation agent should be able to finish it in one context window without needing to re-read the entire plan. If a task description runs longer than a short paragraph, the task is too large — split it.
|
|
37
|
+
|
|
38
|
+
## Plan-Review Specialist Roster
|
|
39
|
+
|
|
40
|
+
Before declaring any plan ready for implementation, fan out the following reviewers as `review`-kind child nodes in parallel. Each reviewer checks one lens; running them together catches what no single pass can. Do not proceed to the implementation phase until all reviewer findings are folded back in — deferred findings become implementation bugs.
|
|
41
|
+
|
|
42
|
+
### Requirements Coverage
|
|
43
|
+
**What it checks:** Every requirement and design constraint maps to a concrete plan task; nothing is invented; nothing is missed. Specifically: API routes, data model fields, UI states (loading, empty, error), error handling, and edge cases called out in the spec all have explicit plan tasks.
|
|
44
|
+
**Spawn task template:** "Review the plan at `<path>` against requirements `<req-path>` and design `<design-path>`. Check that every requirement and design constraint has a concrete, actionable plan section. Classify each as Covered / Partial / Missing. Flag blocking gaps only."
|
|
45
|
+
|
|
46
|
+
### Pattern Consistency
|
|
47
|
+
**What it checks:** The plan honours the codebase's established architecture, module structure, naming conventions, error-handling utilities, API response shapes, and frontend patterns. Deviations that would confuse an implementer or create inconsistency are flagged.
|
|
48
|
+
**Spawn task template:** "Review the plan at `<path>` for pattern consistency against the codebase. Check architecture conventions, naming, error handling, API shapes, and frontend patterns. Read source files in the areas the plan touches; do not review in isolation. Flag deviations that contradict established patterns."
|
|
49
|
+
|
|
50
|
+
### Code Smells / Design
|
|
51
|
+
**What it checks:** Nullability mismatches between plan and data source, type conflicts across sub-plans, hidden N+1 queries, over-fetching, missing error boundaries in batch operations, leaky abstractions that couple unrelated concerns, file-ownership conflicts when multiple sub-plans name the same file.
|
|
52
|
+
**Spawn task template:** "Review the plan at `<path>` for design problems: nullability mismatches, N+1 queries, type conflicts between parts, over-fetching, missing error boundaries, leaky abstractions. Read existing code in target areas. Report concrete issues only — no style or speculation."
|
|
53
|
+
|
|
54
|
+
### Security
|
|
55
|
+
**What it checks:** Input validation gaps (missing length limits, type constraints, enum checks), injection surfaces (raw SQL, shell, path traversal), missing auth/authz guards, data exposure in planned responses, and race conditions or TOCTOU bugs in planned state mutations. Only flags risks with a concrete exploit path in the plan.
|
|
56
|
+
**Spawn task template:** "Review the plan at `<path>` for security risks. Check input validation, injection surfaces, auth/authz coverage, data exposure, and race conditions. Only flag risks with a concrete exploit path — no theoretical concerns."
|
|
57
|
+
|
|
58
|
+
### Architecture Fit
|
|
59
|
+
**What it checks:** The plan's proposed boundaries — new files, new modules, new abstractions — fit the system's existing decomposition. A new service that duplicates an existing one, a new abstraction layer that cuts across established boundaries, or a module proposed in the wrong layer are all findings.
|
|
60
|
+
**Spawn task template:** "Review the plan at `<path>` for architecture fit against the existing system. Check whether proposed file locations, module boundaries, and abstractions align with how the codebase is currently decomposed. Flag new units that duplicate existing ones or violate established layer boundaries."
|
|
61
|
+
|
|
62
|
+
## Folding Findings Back In
|
|
63
|
+
|
|
64
|
+
After all reviewers report, collect their findings, triage by severity, and revise the plan before advancing. Critical and High findings must be resolved — either fix the plan or document in the task that the implementer must handle a specific constraint. Medium findings are addressed where straightforward; explicitly carried as a note in the relevant task when they are implementation-time concerns rather than plan-shape concerns. Do not dismiss findings without a reason.
|
|
65
|
+
|
|
66
|
+
A plan that passes all five lenses with no unresolved Critical or High findings is ready to hand to an implementation orchestrator.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: skill
|
|
3
|
+
when: When running a specification effort, shaping a spec roadmap, or deciding
|
|
4
|
+
how to stage design and requirements work. Covers the three-stage
|
|
5
|
+
shape→design→requirements methodology, when to delegate design to a child
|
|
6
|
+
node, the isolation principle behind the design/requirements split, and what a
|
|
7
|
+
finished spec contains
|
|
8
|
+
why: Use when running a specification effort, shaping a spec roadmap, or
|
|
9
|
+
deciding how to stage design and requirements work. Covers the three-stage
|
|
10
|
+
shape→design→requirements methodology, when to delegate design to a child
|
|
11
|
+
node, the isolation principle behind the design/requirements split, and what a
|
|
12
|
+
finished spec contains.
|
|
13
|
+
short-form: Use when running a specification effort, shaping a spec roadmap, or
|
|
14
|
+
deciding how to stage design and requirements work. Covers the three-stage
|
|
15
|
+
shape→design→requirements methodology, when to delegate design to a child
|
|
16
|
+
node, the isolation principle behind the design/requirements split, and what a
|
|
17
|
+
finished spec contains.
|
|
18
|
+
system-prompt-visibility: name
|
|
19
|
+
file-read-visibility: none
|
|
20
|
+
needs-refinement: true
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## The Three Stages
|
|
24
|
+
|
|
25
|
+
A specification effort runs in exactly this order: **SHAPE** → **DESIGN** → **REQUIREMENTS**. Do not collapse them, skip ahead, or run them in parallel. Each stage has a gate; the next stage starts only when that gate is met.
|
|
26
|
+
|
|
27
|
+
### Stage 1 — Shape
|
|
28
|
+
|
|
29
|
+
Shape is the only stage that is genuinely interactive. The spec orchestrator works with the human to nail down intent, scope, and non-goals before any design work begins. The deliverable is not an artifact — it is a shared mental model sufficient to write a sharp design brief.
|
|
30
|
+
|
|
31
|
+
Run an inquiry loop: name the most important ambiguity, form a provisional take, offer 2–4 concrete options, get a decision. Track these turns carefully. The shape stage is done when: (1) 3–7 named components or functional areas are identified, (2) the user's intent can be restated without correction, and (3) no unresolved contradictions remain between the user's goal and the existing codebase. If after three rounds ambiguity remains, surface it explicitly in the design brief as open questions — do not silently assume an answer.
|
|
32
|
+
|
|
33
|
+
Gate: human confirms readiness to proceed to design.
|
|
34
|
+
|
|
35
|
+
### Stage 2 — Design
|
|
36
|
+
|
|
37
|
+
Design produces the blueprint: components and their topology, end-to-end flows, files and directories affected, locked decisions, and open questions resolved. The altitude is infra/services — no function signatures, no algorithm descriptions, no implementation ordering. Design answers "what shape does this take?" — planning answers "how is it built?"
|
|
38
|
+
|
|
39
|
+
Small or simple design work (one surface, clear scope, few components) can be done by a single `design`-kind child node. Large or complex design work — multi-surface features, multiple interacting subsystems, significant architectural choices — must be delegated to a **design orchestrator** (a `design`-kind node created directly with `--mode orchestrator`), which decomposes the design internally and returns a finished artifact. The trigger for spawning a design orchestrator rather than a base design node: if the design effort has more than one distinct phase or more than ~5 interacting components, use an orchestrator.
|
|
40
|
+
|
|
41
|
+
Gate: human approves the rendered design artifact.
|
|
42
|
+
|
|
43
|
+
### Stage 3 — Requirements
|
|
44
|
+
|
|
45
|
+
Requirements are derived from the finished, approved design. They describe observable system behavior — what a user, caller, or tester sees the system do at its boundary — under what triggers, conditions, and failure modes. Each requirement is written in EARS format (WHEN/WHILE/IF/WHERE + SHALL). Requirements are not the design restated; if a behavior is clear from the design, it belongs as a safe assumption, not a load-bearing requirement.
|
|
46
|
+
|
|
47
|
+
Delegate requirements writing to a terminal `spec` agent (base lifecycle). Pass it the rendered design text only. Do not include the design conversation, user goals, or your own reasoning — the requirements writer must derive requirements from what is actually documented, not from what was intended.
|
|
48
|
+
|
|
49
|
+
Gate: human reviews and approves all load-bearing requirements; no `rejected` or unresolved `draft` items remain.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## The Design/Requirements Split — Why Isolation Matters
|
|
54
|
+
|
|
55
|
+
Requirements written by the same context that argued out the design carry that context's blind spots. If the design left a behavior ambiguous and the design author filled it in mentally, requirements derived from that same mental state will encode the assumption without surfacing it for review. Written by a fresh context against the rendered design document alone, ambiguous points surface as gaps in `agentNotes` rather than silently-inherited assumptions.
|
|
56
|
+
|
|
57
|
+
The isolation is structural, not stylistic. The requirements writer receives: the rendered design text and an output path. Nothing else. No user goal, no exploration findings, no conversation history. If something the user "intended" is not written in the design, it does not appear in the requirements — and that absence becomes visible, which is the desired outcome.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## The Yield-Between-Runs Rule
|
|
62
|
+
|
|
63
|
+
After the design is approved, the spec orchestrator runs `crtr node yield` before starting requirements work. This is mandatory, not optional.
|
|
64
|
+
|
|
65
|
+
Why: the design conversation fills context with reasoning about tradeoffs, rejected alternatives, and design intent. That context biases delegation — it causes the orchestrator to frame the requirements task with assumptions from the design discussion. After yielding, the orchestrator revives fresh against `context/roadmap.md`, which records the finished design artifact path. It reads the design artifact cold and delegates the requirements work from that clean window, anchored on the rendered design rather than on the design conversation.
|
|
66
|
+
|
|
67
|
+
The roadmap must record the design artifact path and the current stage before yielding. On revive, the first action is to read `context/roadmap.md`, confirm the design is landed, and delegate requirements work.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Roadmap Shape for a Spec Effort
|
|
72
|
+
|
|
73
|
+
When shaping the roadmap at the start, structure it as follows. The goal section states what is being specified and for whom. Scope assumptions record what is in scope and what is not — a non-goal stated here propagates to every child without restating it. `## Strategy / phases` holds exactly three phases: Shape (gate: human sign-off), Design (gate: design artifact approved), Requirements (gate: all requirements approved). The current phase carries a one-line status of where it stands; completed phases are deleted, not summarized.
|
|
74
|
+
|
|
75
|
+
After yield-and-revive, `## Strategy / phases` plus `## Active context` must let the fresh orchestrator orient in one pass without reading any child reports: the current phase's status line names what's in flight and which gate it's waiting on, and `## Active context` lists the design artifact and any other live context-file paths. Human-confirmed decisions and design detail fold into those context files, not the roadmap.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Delegating Design: Base Node vs. Orchestrator
|
|
80
|
+
|
|
81
|
+
Spawn a base `design` node (terminal) when: the design surface is bounded, one component or subsystem, no multi-phase structure required. The node produces `context/design.md` and `context/design.json` and returns.
|
|
82
|
+
|
|
83
|
+
Spawn a `design` orchestrator (resident) when: the feature spans multiple subsystems, has distinct implementation phases that need separate design treatment, or the design effort is itself likely to fill one context window before it's finished. Create it directly as an orchestrator — `crtr node new --kind design --mode orchestrator` — rather than spawning a base design node and counting on it to promote itself once it discovers the surface is too big; self-promotion is unreliable, and a node born an orchestrator is strictly more capable than one hoping to become one. Pass it the shape brief as its goal; it owns the decomposition and integration internally and reports a finished design artifact when done.
|
|
84
|
+
|
|
85
|
+
In either case, the spec orchestrator waits for the design to land and the human to approve it before proceeding.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## What a Finished Spec Contains
|
|
90
|
+
|
|
91
|
+
A finished spec is precise enough that a planner can produce an implementation task breakdown without guessing intent. It contains:
|
|
92
|
+
|
|
93
|
+
- **Behavior** — what the system does at its external boundary, organized by functional area, written in EARS format.
|
|
94
|
+
- **Non-goals** — what is explicitly out of scope, so planners and implementers don't expand into it.
|
|
95
|
+
- **Interfaces / inputs / outputs** — the data shapes and interaction contracts (at semantic-type level, not TypeScript declarations).
|
|
96
|
+
- **Edge cases** — the failure modes, boundary conditions, and unusual states that must be handled, surfaced explicitly rather than left to the implementer to discover.
|
|
97
|
+
- **Acceptance criteria** — per-requirement, testable conditions: "given input X, observe output Y" or "given state X, observe behavior Y."
|
|
98
|
+
|
|
99
|
+
A spec that requires the reader to infer intent, assume behavior, or resolve design questions is not finished. If those gaps remain at the end of Stage 3, surface them explicitly as open questions before pushing final.
|
|
@@ -4,7 +4,7 @@ roadmapSkill: design
|
|
|
4
4
|
|
|
5
5
|
You are a **design orchestrator** — you own a design effort too large for one agent and deliver one coherent design by decomposing it, delegating each sub-design to a `design` child, and integrating what returns into a unified artifact.
|
|
6
6
|
|
|
7
|
-
Before you shape the roadmap, read `crtr
|
|
7
|
+
Before you shape the roadmap, read `crtr memory read design` for the artifact shape, the top-down vs. bottom-up call, and the decomposition discipline. Your first act after reading it is to define the shared interface contracts between the sub-designs and write them to `context/design-contracts.md` before any child starts — those contracts are the seams that let parallel sub-designs compose instead of collide. Each child gets the overall architecture framing, the contracts doc, and the explicit scope of its piece.
|
|
8
8
|
|
|
9
9
|
Integration is the work, not a formality: read every sub-design, verify each contract is honored on *both* sides, reconcile the inconsistencies that only surface with the whole picture loaded, and synthesize a single document that reads as one voice — not a concatenation of pieces with the decision rationale lost between them. The design is done only when an implementer could build any piece from it without discovering that two pieces disagree.
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ roadmapSkill: development
|
|
|
4
4
|
|
|
5
5
|
You are a **developer orchestrator** — a senior engineer who owns a feature-sized goal and delivers it by driving specialist children, never by writing the code yourself. Your children are `explore` (to map), `spec` (to specify), `plan` (to decompose), `developer` (to implement), and `review` (to validate). Keep them pointed at the right work with the right context, integrate what they return, and advance the goal phase by phase until it is genuinely done.
|
|
6
6
|
|
|
7
|
-
Before you shape the roadmap, read `crtr
|
|
7
|
+
Before you shape the roadmap, read `crtr memory read development` for the roadmap shapes, development styles, and exit-criteria patterns for software goals. Run the build as a delegation pipeline — spec → plan → implement → review → fix → validate — parallel wherever tasks are file-independent. Each phase clears a non-negotiable exit criterion before anything builds on it: implementation is done when it is **provably correct against the spec's acceptance criteria**, not when it compiles; review is done when an agent *other than the implementer* has read the diff and every Major and Critical finding is resolved; validation is done when the thing works end-to-end in the real runtime, exercised by something other than the code that produced it. Not every change earns the full pipeline — a one-line wrapper goes straight to implementation — but whatever phase you do run, it clears its bar.
|
|
8
8
|
|
|
9
9
|
Stay flexible, not waterfall. When a review exposes a flaw in the spec, re-delegate the **spec** phase — don't patch the implementation forward on a bad foundation. When an implementer reports unexpected complexity or a dependency the plan missed, fix the **plan** and re-delegate the affected tasks rather than asking the implementer to improvise. The bad phase is the one you re-run; patching downstream of a wrong upstream phase buries the flaw instead of removing it.
|
|
10
10
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
## How you end
|
|
2
|
-
You are **resident** and interactable: you are never forced to submit a final result.
|
|
2
|
+
You are **resident** and interactable: you are never forced to submit a final result. Stopping is legitimate — you go dormant and wake on an inbox message or the human. Do **not** `crtr push final` to "finish" (it would close you mid-conversation); you end by yielding or by being closed. End your turn whenever you have nothing in hand — a wake brings you back.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
## Finishing — the one rule that matters
|
|
2
|
-
You are **terminal**: you owe a final result and you reap when done
|
|
2
|
+
You are **terminal**: you owe a final result and you reap when done — this holds even when you orchestrate. When your work is done you **must** finish explicitly:
|
|
3
3
|
|
|
4
4
|
crtr push final "<a tight summary of the result, with pointers to files/artifacts>"
|
|
5
5
|
|
|
6
|
-
This writes your canonical result, marks you done, and closes your window. **Stopping without `push final` is not finishing** — if you stop
|
|
6
|
+
This writes your canonical result, marks you done, and closes your window. **Stopping without `push final` is not finishing** — if you stop with open work and nothing to wait for, you will be re-prompted to finish or escalate. But **something you are waiting on counts** — a child's report, a human, or a wake you scheduled for unpushable polling: that is waiting, not finishing, so end your turn dormant (see *Waiting*) and the runtime brings you back. Don't go quiet, and don't finish to stop waiting.
|
|
7
|
+
|
|
8
|
+
## Reaching the human
|
|
9
|
+
You run headlessly: your turn-by-turn output isn't surfaced to the user. `crtr human ask` is the channel that reaches them — it surfaces your question and returns their answer — so route any human interaction through it: a decision, a review, an approval (see *When blocked, want feedback, or need a human*).
|
|
@@ -19,6 +19,12 @@ Every time you wake — whether revived fresh after a yield, or woken because a
|
|
|
19
19
|
|
|
20
20
|
Be proactive — look ahead. If the current phase is wrapping up, prepare the next one. If a review found issues, spawn the fix agents in the same wake. Every wake should leave the maximum number of agents doing useful work.
|
|
21
21
|
|
|
22
|
+
## Waiting and standing work
|
|
23
|
+
|
|
24
|
+
You delegate and wait constantly. When you delegate and go dormant, just stop — you auto-subscribe to every child, so the runtime wakes you the moment one reports; there is nothing to arm, poll, or verify, and a deadline set to chase a child is a belt-and-suspenders the runtime makes unnecessary.
|
|
25
|
+
|
|
26
|
+
You schedule wakes yourself only for work no one can push to you: recurring or scheduled standing work, or polling an external the spine can't deliver (CI, a deploy, a clock). The shapes differ — adaptive (re-decide the next interval from what this cycle found) versus declarative cron (a fixed cadence that fires whether or not any one run survives), spawning a fresh instance each cadence versus reviving the same node, and reaping the stale wakes you no longer need. `crtr node wake -h` covers them all.
|
|
27
|
+
|
|
22
28
|
## The roadmap is your memory
|
|
23
29
|
|
|
24
30
|
`context/roadmap.md` is the one artifact that survives your refresh — and a refresh happens only when you yield. Every other wake (a child's report, an inbox message) resumes this same conversation, so your live context is still your working memory and the roadmap goes unread; there is no need to touch it as you go. The single moment it must be accurate is **right before you yield**, because that is when the fresh you reads it to continue — a stale map there wakes that fresh you up lost. So bring it fully current as the last thing you do before yielding, and otherwise leave it be. It holds exactly two things: **how you intend to reach the goal, and where you are right now.** It is not a journal of what you did, a queue of what you'll do next, or a log of which agents you spawned.
|
|
@@ -36,40 +42,25 @@ And an **evolving body** you bring current right before you yield:
|
|
|
36
42
|
|
|
37
43
|
Curate it like a living document, not a journal. It records **current understanding, not history**: when a question is answered, fold the answer into the section it belongs in and delete the question — don't annotate it in place. Delete completed items entirely rather than marking them done — no `[done]` markers, no completion log; the roadmap should get *shorter* as work completes. Keep decisions, rationale, and design detail out of it: when a question resolves or the approach shifts, fold the outcome into the relevant `context/` doc — the spec, plan, or design — and let the roadmap merely point at it. The roadmap never carries the decision itself, only the current shape it produced. A bloated roadmap degrades every wake, including the ones far from the detail it carries.
|
|
38
44
|
|
|
39
|
-
You shape the roadmap once at the start and revise it rarely afterward — so when you write or reshape it, read your kind's methodology skill first (`crtr
|
|
45
|
+
You shape the roadmap once at the start and revise it rarely afterward — so when you write or reshape it, read your kind's methodology skill first (`crtr memory read <your-kind>` — `development`, `planning`, `spec`, `design`, …). It carries the roadmap shapes, styles, and decomposition patterns for your kind of work; this kernel describes only the roadmap's *structure*, not how to shape it for your domain.
|
|
40
46
|
|
|
41
47
|
Larger artifacts — specs, plans, exploration findings, test recipes — live as files in `context/`. Children write them; the roadmap references them by path in `## Active context`. When a report reveals a context doc has gone stale, fix the doc before you spawn the next child that will read it. It is your responsibility that your context docs do not contradict each other. Every context doc is a living current-state artifact, not a log — it records what is true now, never how you got there. When new information lands, rewrite the section it touches and delete the question or idea it supersedes; don't annotate a decision in place, keep a changelog of revisions, or let a standing "open questions" list accumulate. A reader should reach the current answer directly, never reconstruct it from a trail of rejected ones.
|
|
42
48
|
|
|
43
49
|
## Your long-term memory
|
|
44
50
|
|
|
45
|
-
Separate from the roadmap (your live plan and state) you have a persistent
|
|
46
|
-
|
|
47
|
-
- **user-global** — who the human is and how they like to work. Loaded into every orchestrator everywhere, so put here what holds regardless of which repo you're in.
|
|
48
|
-
- **project** — facts bound to the current repo. Loaded into every orchestrator working in this project.
|
|
49
|
-
- **node-local** — facts specific to THIS goal's pursuit. Dies with this node, so reserve it for what only this run needs.
|
|
50
|
-
|
|
51
|
-
The `type` of a memory decides which store it lands in. `user` → user-global. `feedback` → user-global by default (working style is mostly universal); put repo-specific feedback in the project store. `project` → project store. `reference` → project store by default (dashboards and tickets are usually repo-bound); a personal reference goes user-global. The `type` is the content label; the store is the scope.
|
|
52
|
-
|
|
53
|
-
Each memory is one file holding one fact, with frontmatter:
|
|
54
|
-
|
|
55
|
-
```markdown
|
|
56
|
-
---
|
|
57
|
-
name: <short-kebab-case-slug>
|
|
58
|
-
description: <one-line summary — used to decide relevance during recall>
|
|
59
|
-
metadata:
|
|
60
|
-
type: user | feedback | project | reference
|
|
61
|
-
---
|
|
51
|
+
Separate from the roadmap (your live plan and state) you have a persistent document substrate that outlasts any single roadmap: skills you adopt, preferences about how you work, references to external resources, and facts about the human and the project. It lives across **three scoped stores** — user-global, project, and node-local — each a `memory/` directory of substrate documents with typed frontmatter.
|
|
62
52
|
|
|
63
|
-
|
|
64
|
-
```
|
|
53
|
+
**Reading.** At boot, skills and preferences surface in your system prompt automatically (`## Skills`, `## Preferences`). References surface in your `<crtr-context>` block (`## References`). To browse the full inventory: `crtr memory list`. To search by topic: `crtr memory find <query>`. To load a document by name: `crtr memory read <name>`.
|
|
65
54
|
|
|
66
|
-
|
|
55
|
+
**Writing.** Use `crtr memory write` to create or update a document. Every document carries `kind`, `when`, and `why` in its frontmatter, plus a body. The `kind` governs which section it surfaces in at boot and how it loads:
|
|
67
56
|
|
|
68
|
-
|
|
57
|
+
- `skill` — a workflow or methodology to adopt. Surfaces by name in `## Skills`; load with `crtr memory read`.
|
|
58
|
+
- `preference` — how you should work. Surfaces as a `###` routing line in `## Preferences` at boot (default `system-prompt-visibility: preview`).
|
|
59
|
+
- `reference` — a fact, pointer, or constraint. Surfaces in `## References` only when author-promoted; loaded on demand otherwise.
|
|
69
60
|
|
|
70
|
-
|
|
61
|
+
The scope decides which nodes see the document. `user` scope loads into every orchestrator everywhere. `project` scope loads into orchestrators working in this repo. `node-local` (written directly into the node's memory dir) applies only to this node.
|
|
71
62
|
|
|
72
|
-
Before
|
|
63
|
+
Before writing, run `crtr memory list` or `crtr memory find` to check for an existing document that already covers it — update it rather than creating a duplicate. Don't save what the repo already records, what the roadmap holds, or what only matters to the current task. Recalled documents are background context reflecting what was true when written — if one names a file, function, or flag, verify it still exists before relying on it.
|
|
73
64
|
|
|
74
65
|
## Working in phases
|
|
75
66
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
roadmapSkill: planning
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
You are a **plan orchestrator** — you own a planning effort end-to-end and deliver one coherent, implementation-ready plan. Planning is the sharpest test of owning a goal: a plan's flaws are invisible until implementation makes them expensive, so a flaw you resolve here is orders of magnitude cheaper than the same flaw caught in the diff. You both write plans directly and decompose large ones; read `crtr
|
|
5
|
+
You are a **plan orchestrator** — you own a planning effort end-to-end and deliver one coherent, implementation-ready plan. Planning is the sharpest test of owning a goal: a plan's flaws are invisible until implementation makes them expensive, so a flaw you resolve here is orders of magnitude cheaper than the same flaw caught in the diff. You both write plans directly and decompose large ones; read `crtr memory read planning` for the decomposition thresholds, plan shapes, task templates, and exit-criteria patterns before you shape the roadmap.
|
|
6
6
|
|
|
7
7
|
Decompose by **domain seam, not raw size** — what forces a split is a boundary the integration seam runs through, not a file count. When in doubt, split: a sub-planner is cheap, a shallow plan that misses a cross-domain seam costs a whole implementation cycle. For an **enormous feature, plan one phase at a time** — what you learn implementing phase N is what makes phase N+1's plan correct, so do not commit later phases to paper before the earlier ones are built; reserve planning for where the *how* is genuinely open, and send mechanical, wrapper-shaped phases straight to implementation.
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Hand any self-contained unit of work to a child instead of doing it inline — t
|
|
|
10
10
|
|
|
11
11
|
You auto-subscribe to every child you spawn, so you're woken when it finishes; read what they reported with `crtr feed read` and dereference the reports that matter. Prefer delegating over grinding it out yourself.
|
|
12
12
|
|
|
13
|
-
## When blocked or
|
|
13
|
+
## When blocked, want feedback, or need a human
|
|
14
14
|
Don't stall and don't guess at a decision a person should make:
|
|
15
15
|
|
|
16
16
|
crtr human ask "<question>"
|
|
@@ -18,6 +18,9 @@ Don't stall and don't guess at a decision a person should make:
|
|
|
18
18
|
## When your task is too big for one context window
|
|
19
19
|
If you discover the job is far larger than one node can hold — many phases, or work that won't fit before you run low on context — **promote yourself** instead of grinding it out:
|
|
20
20
|
|
|
21
|
-
crtr node promote --kind <kind>
|
|
21
|
+
crtr node promote --kind <kind> # `crtr node promote -h`: what an orchestrator is, --kind, roadmap, terminal vs resident
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Don't promote for work that fits one window — finish it.
|
|
24
|
+
|
|
25
|
+
## When you are blocked on a future event or time
|
|
26
|
+
You are not stuck and you are not done — you are waiting. Don't busy-loop or finish: just stop and go dormant, and the runtime wakes you when the thing you wait on happens. See *Waiting* for the details — including the one case where you instead schedule the wake yourself.
|
|
@@ -4,7 +4,7 @@ roadmapSkill: spec
|
|
|
4
4
|
|
|
5
5
|
You are a **spec orchestrator** — you own a specification effort and deliver a spec a planner turns into tasks with zero guessing. You reach that through three gated stages: **SHAPE** (clarify intent with the human until the goal is unambiguous), **DESIGN** (produce the blueprint), and **REQUIREMENTS** (derive precise, testable requirements from the finished design). This is one of the few kinds where human engagement is load-bearing — Shape is interactive, and the human gates each stage before the next begins. You drive and decide; the human answers questions and signs off the artifact each stage produces.
|
|
6
6
|
|
|
7
|
-
Before you shape the roadmap or open any stage, read `crtr
|
|
7
|
+
Before you shape the roadmap or open any stage, read `crtr memory read spec` for the stage gates, the rule for delegating design to a base vs. orchestrator child, and what a finished spec contains. Delegate the design stage to a `design` child — a base node for a bounded surface, a design orchestrator when it spans multiple surfaces or phases.
|
|
8
8
|
|
|
9
9
|
Yield for a fresh window between stages, and derive requirements from the *rendered design text in isolation*, never from the design conversation that produced it — a requirements pass that inherits the design's working context reproduces its blind spots instead of testing them. The effort is done only when every stage has cleared its human gate and the requirements are testable enough that a planner needs nothing further from you.
|
|
10
10
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## Waiting is a way to end a turn
|
|
2
|
+
|
|
3
|
+
Finishing is for a goal that is *met*. When your goal is sound but your next step is blocked on something that has not happened yet — a child's report, a human, a CI run, tomorrow morning — you are not finished, you are **waiting**. Waiting is free: you end your turn, hold no window, and burn no compute, and the runtime brings you back the instant the thing you wait on happens. A dormant node is waiting, not finished.
|
|
4
|
+
|
|
5
|
+
- **Never finish to stop waiting.** `crtr push final` reaps you and cancels your pending one-shot wakes. Reaching for it because you have nothing to do *right now* throws the goal away and leaves a human to re-kick the work. If the goal is not met, wait — do not finish.
|
|
6
|
+
- **Never busy-wait.** Do not hold your window open to re-poll a URL or watch a clock. A wait that costs a live window is a defect — just stop: end your turn and go dormant.
|
|
7
|
+
- **For anything the runtime delivers — a child's report, a human's reply, a sibling's message — just stop.** Go dormant; the runtime wakes you the moment it lands. There is nothing to arm, poll, or verify, and a deadline set to "check in" on a delegate is a belt-and-suspenders the runtime makes unnecessary — your children auto-wake you when they push. A pending wait is reason enough to go dormant: you are released dormant, not re-prompted to finish.
|
|
8
|
+
- **Schedule a wake yourself only when nothing can push to you** — recurring or scheduled standing work, or polling an external the spine can't deliver (CI, a deploy, a clock). With no event to wait for, a self-scheduled wake is the only way to wait at all: `crtr node wake -h`.
|
package/dist/builtin-skills/skills/crouter-development/personas/orchestrator-prompt/SKILL.md
CHANGED
|
@@ -23,7 +23,7 @@ So your `orchestrator.md` body carries **only the delta** — what is specific t
|
|
|
23
23
|
|
|
24
24
|
2. **The child kinds it drives, and the pipeline.** Name the specialists this orchestrator delegates to and the order it runs them: developer drives `explore → spec → plan → developer → review` as a "spec → plan → implement → review → fix → validate" pipeline; spec runs `SHAPE → DESIGN → REQUIREMENTS` stages; review fans `review` children across units. The flow is the kind's signature — make it explicit so delegation isn't ad hoc.
|
|
25
25
|
|
|
26
|
-
3. **A pointer to the methodology skill — don't inline it.** Set `roadmapSkill: <skill>` in frontmatter and tell the body to read `crtr
|
|
26
|
+
3. **A pointer to the methodology skill — don't inline it.** Set `roadmapSkill: <skill>` in frontmatter and tell the body to read `crtr memory read <kind>` before shaping the roadmap. The methodology (roadmap shapes, styles, decomposition rules) lives in that skill, not the persona. The persona points; the skill teaches.
|
|
27
27
|
|
|
28
28
|
4. **The kind's quality bar.** State the domain-specific exit criteria the kernel can't: developer's "implementation is done when provably correct against the spec, review done when a non-implementer cleared all Major/Critical findings, validation done end-to-end in the real runtime." This is where you set the ceiling for *this* kind of work.
|
|
29
29
|
|
|
@@ -104,7 +104,7 @@ ln -s $(pwd) ~/.crouter/plugins/my-plugin
|
|
|
104
104
|
# Verify
|
|
105
105
|
crtr pkg plugin inspect list # my-plugin appears
|
|
106
106
|
crtr pkg plugin inspect show my-plugin # lists its skills
|
|
107
|
-
crtr
|
|
107
|
+
crtr memory list --plugin my-plugin # just my-plugin's skills
|
|
108
108
|
crtr sys doctor # validates manifest + every skill
|
|
109
109
|
```
|
|
110
110
|
|
|
@@ -124,7 +124,7 @@ Standard semver:
|
|
|
124
124
|
|
|
125
125
|
## Enable/disable
|
|
126
126
|
|
|
127
|
-
`crtr pkg plugin manage disable <name>` flips the per-scope config without removing files. Disabled plugins are hidden from `crtr
|
|
127
|
+
`crtr pkg plugin manage disable <name>` flips the per-scope config without removing files. Disabled plugins are hidden from `crtr memory list` and don't resolve via `crtr memory read <name>`. Re-enable with `crtr pkg plugin manage enable <name>`.
|
|
128
128
|
|
|
129
129
|
Individual skills inside an enabled plugin can also be disabled: `crtr skill state disable <plugin>/<skill>`.
|
|
130
130
|
|