@crafts69guy/orchestra 0.0.0-stage → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: dispatch
3
+ description: "orch workflow: run independent substantial tasks from .scratch/<feature>/plan.md in parallel, one implementer per git worktree (worktrunk), then merge them into the feature branch one at a time."
4
+ ---
5
+
6
+ # Dispatch
7
+
8
+ Run the plan in waves. Harness-specific spawn syntax:
9
+ [Claude Code](references/claude.md) · [Codex](references/codex.md).
10
+
11
+ `orch` is the CLI shipped with this plugin; the session context names its
12
+ absolute path. Use that path where the plugin's `bin/` is not on `PATH` (Codex).
13
+ `orch wt` wraps worktrunk (`wt`) and prints JSON.
14
+
15
+ ## Preconditions
16
+
17
+ - You are on the feature branch `F` named in the plan, with a clean tree.
18
+ - `wt` is installed. If the repo has worktrunk project hooks
19
+ (`.config/wt.toml`) and the user has not said the repo is trusted, ask once
20
+ before passing `--yes`: it runs the repo's hook commands.
21
+
22
+ ## Each wave
23
+
24
+ 1. **Pick** the ready `substantial` tasks: all `depends_on` merged, `files`
25
+ disjoint. At most 4 per wave; queue the rest. `small` tasks are never
26
+ dispatched: run them as one batched implementer task on `F`, before any wave
27
+ that depends on them.
28
+ 2. **Create** worktrees: `orch wt new <F> <T1> <T2> …` → JSON list of
29
+ `{task, branch, path}`.
30
+ 3. **Spawn** one implementer per task, all in the **same message** so they run
31
+ in parallel. Brief each with: plan path + task id, its worktree `path`
32
+ (work only there), the plan's Decisions, `validate`, and "do not commit".
33
+ 4. **Wait** for all reports. `partial`/`blocked` → answer and resume that agent
34
+ (max 2 rounds), or re-plan.
35
+ 5. **Review** each diff (`git -C <path> diff`). Send defects back to the same
36
+ agent.
37
+ 6. **Merge one task at a time:**
38
+ `orch wt merge <F> <T> --message "<conventional commit message>"`.
39
+ The message is the full commit message: include any trailers your
40
+ instructions require (e.g. `Co-Authored-By`). Never rewrite merged commits
41
+ afterwards.
42
+ - `status: merged` → next task.
43
+ - `status: conflict` → the rebase was aborted and the worktree kept. Resolve
44
+ it yourself in the worktree, or resume the task's implementer with the
45
+ conflicting files, then merge again.
46
+ 7. **Verify** the full test suite on `F` before the next wave.
47
+
48
+ ## After the last wave
49
+
50
+ Report per task: merged commit, validation evidence, anything skipped. Shipping
51
+ (push, PR) is still the shipper's job and needs the user's go-ahead.
52
+
53
+ ## Don't
54
+
55
+ - Run two implementers in the same checkout.
56
+ - Merge in parallel, or merge a task whose validation you have not seen.
57
+ - Let implementers commit, push, or touch files outside their `files`.
@@ -0,0 +1,9 @@
1
+ # Dispatch on Claude Code
2
+
3
+ - Agent names carry the plugin prefix: `orch:implementer`, `orch:scoper`,
4
+ `orch:reviewer`, `orch:shipper`. The bare name is not found.
5
+ - Parallel spawn: several Agent tool calls in one assistant message.
6
+ - Do not set `isolation: "worktree"`; the worktree comes from `orch wt new`.
7
+ - Resume an agent with SendMessage to its id or name; it keeps its context.
8
+ - Plugin hooks see `agent_type` as `orch:<role>` and enforce: implementers
9
+ cannot commit or push; only the shipper pushes or opens PRs.
@@ -0,0 +1,12 @@
1
+ # Dispatch on Codex
2
+
3
+ - Agent names are bare: `implementer`, `scoper`, `reviewer`, `shipper`. They
4
+ are loaded from the plugin's `codex/agents/*.toml` by the `orch codex`
5
+ launcher (`-c agents.<name>.config_file=…`). An unknown name silently falls
6
+ back to the default agent, so confirm the role in its first reply.
7
+ - Spawn each task with `spawn_agent` (`agent_type`, no forked turns), all
8
+ before waiting, then `wait_agent` on every id.
9
+ - The sandbox must allow writing `<repo>/.git` (`--add-dir <repo>/.git`) or
10
+ `orch wt new` and commits fail. `orch codex` adds it.
11
+ - Hooks only run when the user trusted them, so restate "do not commit or
12
+ push" in every brief.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: plan
3
+ description: "orch workflow: write .scratch/<feature>/plan.md, a task list with file ownership and dependencies that the dispatch skill can run in parallel waves. Use when work has 2+ separable parts."
4
+ ---
5
+
6
+ # Plan
7
+
8
+ Write `.scratch/<feature>/plan.md` in the repo root. Keep `.scratch/` out of git
9
+ (`.git/info/exclude`) unless the repo already tracks it.
10
+
11
+ ## Before writing
12
+
13
+ 1. Read the scoper brief if there is one; do not rescope.
14
+ 2. Decide every cross-cutting choice now (interfaces, names, libraries, error
15
+ handling). Workers run in parallel and cannot ask each other.
16
+
17
+ ## Format
18
+
19
+ ````markdown
20
+ # <feature>
21
+
22
+ Base branch: <F> # the branch the tasks merge into
23
+
24
+ ## Decisions
25
+
26
+ - <decision that every task must follow>
27
+
28
+ ## Tasks
29
+
30
+ ```yaml
31
+ - id: T1
32
+ goal: <one sentence, observable outcome>
33
+ files: [<paths this task owns>]
34
+ depends_on: []
35
+ size: small # or substantial (rule below)
36
+ validate: <command that proves this task works>
37
+ decisions: [<task-specific choices>]
38
+ ```
39
+ ````
40
+
41
+ ## Rules
42
+
43
+ - `files` is ownership. Two tasks with no dependency path between them must not
44
+ share a file. If they must, add a `depends_on` edge or merge the tasks.
45
+ - Shared files that everyone touches (lockfiles, barrel exports, registries) go
46
+ to one task that the others depend on.
47
+ - Each task is 1 implementer-sized unit (one module or feature), not a project.
48
+ - `size` is `substantial` when the task is its own module or feature needing
49
+ several edit-and-test cycles, roughly 100+ changed lines; otherwise `small`.
50
+ - `validate` runs inside the task's own worktree and must not need other
51
+ unmerged tasks.
52
+ - Don't split one feature into many tiny tasks. Separate features stay separate
53
+ tasks (each can land as its own commit), but small ones are batched, not
54
+ dispatched (below).
55
+
56
+ ## After writing
57
+
58
+ Show the user the task table (id, goal, size, depends_on) in a few lines. If 2+
59
+ independent tasks are `substantial`, continue with the `dispatch` skill for
60
+ them. Batch the `small` tasks into one implementer task (all of them, in order,
61
+ on the feature branch); run the rest (a lone or dependent substantial task) with
62
+ its own implementer, one at a time. Parallel worktrees only pay off when each
63
+ task is substantial.