@dirtydishes/skills 0.1.1

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 (51) hide show
  1. package/README.md +165 -0
  2. package/bin/skills.js +408 -0
  3. package/catalog/skills.json +32 -0
  4. package/package.json +26 -0
  5. package/skills/dirtyloops/SKILL.md +67 -0
  6. package/skills/dirtyloops/examples/README.md +8 -0
  7. package/skills/dirtyloops/examples/orchestrator-callback/README.md +18 -0
  8. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/00-roadmap.md +26 -0
  9. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/01-foundation.md +51 -0
  10. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/02-integration.md +45 -0
  11. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/IMPLEMENT.md +68 -0
  12. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/loop-state.md +36 -0
  13. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/implementation-thread.md +30 -0
  14. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/review-thread.md +35 -0
  15. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/run-loop.md +33 -0
  16. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/turn-docs/01-foundation.md +79 -0
  17. package/skills/dirtyloops/examples/single-thread-subagent/README.md +14 -0
  18. package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/00-roadmap.md +16 -0
  19. package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/01-foundation.md +36 -0
  20. package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/02-integration.md +23 -0
  21. package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/IMPLEMENT.md +50 -0
  22. package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/loop-state.md +28 -0
  23. package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/prompts/run-loop.md +22 -0
  24. package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/turn-docs/01-foundation.md +32 -0
  25. package/skills/dirtyloops/plan.html +587 -0
  26. package/skills/dirtyloops/references/beads.md +114 -0
  27. package/skills/dirtyloops/references/common.md +66 -0
  28. package/skills/dirtyloops/references/create-loop.md +85 -0
  29. package/skills/dirtyloops/references/help.md +170 -0
  30. package/skills/dirtyloops/references/inspect-loop.md +11 -0
  31. package/skills/dirtyloops/references/review-ci.md +37 -0
  32. package/skills/dirtyloops/references/run-loop.md +41 -0
  33. package/skills/dirtyloops/references/storyboard.md +64 -0
  34. package/skills/dirtyloops/references/swarms.md +59 -0
  35. package/skills/dirtyloops/references/turn-docs.md +29 -0
  36. package/skills/dirtyloops/references/workflows/orchestrator-callback.md +120 -0
  37. package/skills/dirtyloops/references/workflows/single-thread-subagent.md +45 -0
  38. package/skills/dirtyloops/schemas/implementation-callback.schema.json +38 -0
  39. package/skills/dirtyloops/schemas/review-callback.schema.json +35 -0
  40. package/skills/dirtyloops/schemas/swarm-report.schema.json +43 -0
  41. package/skills/dirtyloops/templates/common/00-roadmap.md.template +33 -0
  42. package/skills/dirtyloops/templates/common/IMPLEMENT.md.template +79 -0
  43. package/skills/dirtyloops/templates/common/loop-state.md.template +39 -0
  44. package/skills/dirtyloops/templates/common/phase.md.template +56 -0
  45. package/skills/dirtyloops/templates/common/run-loop.md.template +46 -0
  46. package/skills/dirtyloops/templates/common/storyboard-post-run.html.template +77 -0
  47. package/skills/dirtyloops/templates/common/turn-doc.md.template +61 -0
  48. package/skills/dirtyloops/templates/workflows/orchestrator-callback/implementation-thread-prompt.md.template +40 -0
  49. package/skills/dirtyloops/templates/workflows/orchestrator-callback/review-thread-prompt.md.template +38 -0
  50. package/skills/dirtyloops/templates/workflows/orchestrator-callback/run-loop-addendum.md.template +17 -0
  51. package/skills/dirtyloops/templates/workflows/single-thread-subagent/run-loop-addendum.md.template +12 -0
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: dirtyloops
3
+ description: Create, run, inspect, close, and explain Beads-canonical Codex implementation loops.
4
+ argument-hint: "help|create|run|inspect|closeout, optional workflow"
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # dirtyloops
9
+
10
+ A dirtyloop is a Beads-canonical Codex implementation loop: phase docs, one Markdown turn doc per phase, bounded subagent swarms, strict review, subagent-owned CI, and a final storyboard.
11
+
12
+ ## Steps
13
+
14
+ 1. Parse the branch from the user's request.
15
+ - `create`: turn a finalized plan into Beads issues, typed loop metadata, implementation docs, templates, and a run prompt.
16
+ - `run`: execute the loop until the epic is complete, blocked, interrupted, or `run once` is requested.
17
+ - `inspect`: summarize the current loop state without changing it.
18
+ - `closeout`: verify completion and generate the post-run storyboard.
19
+ - `help`: explain dirtyloops commands, workflows, examples, and usage.
20
+ - If the branch is missing, infer it only when obvious from the request. Otherwise ask one concise question.
21
+ - Completion criterion: one branch is selected and no other branch instructions are followed yet.
22
+
23
+ 2. Select the workflow.
24
+ - Skip this step for `help`.
25
+ - `single-thread-subagent`: one coordinator thread uses mass subagent swarms for selection, scouting, slice planning, implementation assistance, review, and CI; no separate Codex worker/reviewer threads.
26
+ - `orchestrator-callback`: an orchestrator thread creates implementation threads, then review threads; workers and reviewers call back to a concrete orchestrator thread id.
27
+ - Choose `orchestrator-callback` when the user mentions original loop flow, new threads, callbacks, worker threads, implementation threads, or review threads.
28
+ - Choose `single-thread-subagent` when the user mentions single thread, CLI-friendly, or keeping all orchestration in one thread.
29
+ - If the workflow is ambiguous for `create` or `run`, ask one concise question.
30
+ - Completion criterion: exactly one workflow is selected.
31
+
32
+ 3. Load the required references before acting.
33
+ - For `help`, read only `references/help.md`, then answer without mutating files, Beads, branches, PRs, or threads.
34
+ - For all non-help branches, read `references/common.md`, `references/beads.md`, `references/swarms.md`, `references/review-ci.md`, and `references/turn-docs.md`.
35
+ - For `create`, read `references/create-loop.md`.
36
+ - For `run`, read `references/run-loop.md`.
37
+ - For `inspect`, read `references/inspect-loop.md`.
38
+ - For `closeout`, read `references/storyboard.md`.
39
+ - For non-help branches, read the selected workflow file under `references/workflows/`.
40
+ - For `create`, read the selected workflow example under `examples/`.
41
+ - Read only the templates needed for the selected branch and workflow.
42
+ - Completion criterion: every referenced file for the selected branch/workflow has been read before file edits, Beads mutation, thread creation, or loop execution.
43
+
44
+ 4. Execute the selected branch.
45
+ - Follow the branch reference's completion criterion.
46
+ - Preserve Beads as canonical.
47
+ - Do not widen phase scope; file Beads follow-ups instead.
48
+ - Completion criterion: the branch reference's output contract has been satisfied, or a concrete blocker has been reported.
49
+
50
+ ## Hard Requirements
51
+
52
+ - Beads is canonical for status, ordering, blockers, dependencies, and completion.
53
+ - Beads records typed dirtyloop metadata: workflow, run policy, branch/PR policy, quality gates, callback policy, thread defaults, and swarm policy.
54
+ - Phase docs are execution context linked from Beads.
55
+ - Generated docs, prompts, examples, and callback payloads use repo-relative paths. Do not include user-specific home directories or usernames in generated loop artifacts.
56
+ - Use one Markdown turn doc per phase.
57
+ - Reviewers update the existing phase turn doc; they do not create a separate review doc.
58
+ - Reviewer agents must use `thermo-nuclear-code-quality-review`.
59
+ - Reviewer and CI verification agents own CI.
60
+ - `dirtyloops run` continues phase-by-phase by default. Stop only when the epic is complete, blocked, interrupted, review/CI is unresolved, or the user explicitly asked for `run once` / `--once`.
61
+ - Orchestrator-callback prompts and callback payloads must carry the concrete orchestrator thread id. Do not launch a worker or reviewer if the actual instruction text says only `current orchestrator thread`, `this thread`, or another generic target.
62
+ - Worker and reviewer threads default to standard speed/reasoning unless the Beads loop metadata explicitly says otherwise.
63
+ - For `single-thread-subagent`, the coordinator orchestrates, synthesizes, integrates, owns branch/PR/Beads state, and closes out. It must launch mass subagent swarms before broad implementation; direct coordinator implementation is for integration, glue, and final repair work.
64
+ - Use large bounded subagent swarms: 8+ by default for broad scout, slice, implementation-helper, and review work, and up to 20 when the phase warrants it.
65
+ - Closeout generates `storyboard-post-run-mm-dd-yyyy.html`.
66
+ - The storyboard should use `impeccable` when present. If it is missing, continue without it and add a brief note that the skill was not found and was skipped during closeout.
67
+ - Closeout must install `@pierre/diffs` in the target repo if missing, then use `@pierre/diffs/ssr` for every storyboard diff. SSR is required for every diff block.
@@ -0,0 +1,8 @@
1
+ # dirtyloops examples
2
+
3
+ These examples show the shape `$dirtyloops create` should produce.
4
+
5
+ - `single-thread-subagent/` shows one visible coordinator thread with mass subagent swarms, slice planning, implementation helpers, review, and CI verification.
6
+ - `orchestrator-callback/` shows the original thread-callback loop: orchestrator thread, implementation threads, review threads, concrete callback targets, and callback payloads.
7
+
8
+ Treat these as shape examples, not content to copy verbatim. New loops should fill in repo-specific Beads ids, phase docs, gates, branch policy, callback target ids, thread defaults, swarm policy, and prompt wording.
@@ -0,0 +1,18 @@
1
+ # Example: Orchestrator Callback Workflow
2
+
3
+ This example shows the generated files for the original dirtyloops flow.
4
+
5
+ Topology:
6
+
7
+ ```text
8
+ orchestrator thread
9
+ -> selector subagent
10
+ -> implementation thread with exact callback target
11
+ -> implementation callback when PR-ready
12
+ -> review thread with exact callback target
13
+ -> review callback when review + CI resolved
14
+ -> orchestrator closeout
15
+ -> next selector
16
+ ```
17
+
18
+ Beads is canonical. The docs are execution context. Implementation and review callbacks echo the concrete orchestrator thread id and source thread id. Review and CI update the existing phase turn doc.
@@ -0,0 +1,26 @@
1
+ # Example Stream Roadmap
2
+
3
+ Canonical tracker: Beads epic `example-epic`
4
+
5
+ ## Outcome
6
+
7
+ Replace the old reporting path with a simpler implementation that has durable review and CI evidence.
8
+
9
+ ## Phase Sequence
10
+
11
+ 1. `example-epic.1` - Foundation
12
+ 2. `example-epic.2` - Integration
13
+
14
+ ## Dependencies
15
+
16
+ Integration depends on Foundation.
17
+
18
+ ## Risks
19
+
20
+ - The old reporting path may contain hidden behavior.
21
+ - Shared helpers may tempt ad-hoc branching.
22
+ - CI failures must be owned by reviewer/verification agents.
23
+
24
+ ## Closeout
25
+
26
+ The final closeout artifact is `storyboard-post-run-mm-dd-yyyy.html`.
@@ -0,0 +1,51 @@
1
+ # Phase 01: Foundation
2
+
3
+ Canonical Beads issue: `example-epic.1`
4
+
5
+ Epic: `example-epic`
6
+
7
+ Status is tracked in Beads. This doc is implementation context.
8
+
9
+ ## Outcome
10
+
11
+ Introduce the new reporting model behind a narrow internal API.
12
+
13
+ ## Scope
14
+
15
+ Allowed:
16
+
17
+ - add the model module
18
+ - add focused tests for the model boundary
19
+ - document migration assumptions in the turn doc
20
+
21
+ Out of scope:
22
+
23
+ - replacing public UI
24
+ - deleting the old path
25
+ - widening shared helper behavior
26
+
27
+ ## Inputs
28
+
29
+ - existing report payloads
30
+ - target internal API shape
31
+ - quality gates from `IMPLEMENT.md`
32
+
33
+ ## Beads
34
+
35
+ - Epic: `example-epic`
36
+ - Issue: `example-epic.1`
37
+ - Depends on: none
38
+ - Parallel-safe: no
39
+
40
+ ## Suggested Swarms
41
+
42
+ - 8 scouts to inspect old reporting assumptions
43
+ - 8 reviewers for structural simplification and boundary quality
44
+ - 4 CI verification agents if CI fails
45
+
46
+ ## Completion Criteria
47
+
48
+ - model API exists
49
+ - tests cover core behavior
50
+ - PR is open
51
+ - reviewer thread has approved or repaired with concrete CI state
@@ -0,0 +1,45 @@
1
+ # Phase 02: Integration
2
+
3
+ Canonical Beads issue: `example-epic.2`
4
+
5
+ Epic: `example-epic`
6
+
7
+ Status is tracked in Beads. This doc is implementation context.
8
+
9
+ ## Outcome
10
+
11
+ Route the reporting surface through the new model while preserving behavior.
12
+
13
+ ## Scope
14
+
15
+ Allowed:
16
+
17
+ - swap the reporting adapter to the new model
18
+ - add regression tests
19
+ - update docs and close follow-ups
20
+
21
+ Out of scope:
22
+
23
+ - unrelated UI polish
24
+ - broad report redesign
25
+ - deleting fallback code not touched by this phase
26
+
27
+ ## Beads
28
+
29
+ - Epic: `example-epic`
30
+ - Issue: `example-epic.2`
31
+ - Depends on: `example-epic.1`
32
+ - Parallel-safe: no
33
+
34
+ ## Suggested Swarms
35
+
36
+ - 10 scouts across adapter, tests, and call sites
37
+ - 12 reviewers for structural and behavioral review
38
+ - 6 CI verification agents if failures appear
39
+
40
+ ## Completion Criteria
41
+
42
+ - adapter uses the new model
43
+ - behavior remains covered
44
+ - review and CI are resolved
45
+ - Beads issue is closed
@@ -0,0 +1,68 @@
1
+ # Example Stream Implementation Loop
2
+
3
+ Workflow: `orchestrator-callback`
4
+
5
+ Canonical tracker: Beads epic `example-epic`
6
+
7
+ This example shows the shape of a generated orchestrator-callback loop. Beads is canonical; these docs are execution context and resume aids.
8
+
9
+ ## Goal
10
+
11
+ Replace an old reporting path with a simpler evidence-backed implementation while preserving behavior.
12
+
13
+ ## Sources Of Truth
14
+
15
+ - Beads epic: `example-epic`
16
+ - Beads loop metadata: workflow, run policy, callback policy, thread defaults, quality gates, and branch/PR policy
17
+ - Roadmap: `docs/implementation/example-stream/00-roadmap.md`
18
+ - Loop state mirror: `docs/implementation/example-stream/loop-state.md`
19
+ - Phase docs linked from Beads child issues
20
+ - Turn docs: `docs/implementation/example-stream/turn-docs/`
21
+
22
+ ## Thread Topology
23
+
24
+ Only the orchestrator creates implementation and review threads.
25
+
26
+ Implementation threads:
27
+
28
+ - receive the full phase doc, Beads issue id, branch policy, quality gates, and orchestrator thread id
29
+ - default to standard speed/reasoning unless Beads metadata explicitly overrides it
30
+ - have prompt text that names the exact orchestrator thread id as callback target
31
+ - may use bounded subagents
32
+ - update the existing phase turn doc
33
+ - open the PR
34
+ - call back exactly once when PR-ready or blocked, echoing `orchestrator_thread_id` and including `source_thread_id`
35
+ - do not create review threads
36
+
37
+ Review threads:
38
+
39
+ - use `thermo-nuclear-code-quality-review`
40
+ - default to standard speed/reasoning unless Beads metadata explicitly overrides it
41
+ - have prompt text that names the exact orchestrator thread id as callback target
42
+ - may use reviewer and CI verification subagents
43
+ - own CI, repairs, reruns, and evidence
44
+ - update the existing phase turn doc
45
+ - call back exactly once when review and CI are resolved, echoing `orchestrator_thread_id` and including `source_thread_id`
46
+
47
+ The orchestrator owns Beads closeout and next selector launch. The loop continues phase-by-phase until the epic is complete, blocked, interrupted, or review/CI is unresolved.
48
+
49
+ ## Phase Ledger
50
+
51
+ | Beads Issue | Phase | Phase Doc | Depends On | Status |
52
+ |---|---|---|---|---|
53
+ | `example-epic.1` | Foundation | `01-foundation.md` | none | pending |
54
+ | `example-epic.2` | Integration | `02-integration.md` | `example-epic.1` | pending |
55
+
56
+ ## Quality Gates
57
+
58
+ - `bun test`
59
+ - `bun run typecheck`
60
+ - targeted browser QA when UI changes
61
+
62
+ ## Branch And PR Policy
63
+
64
+ One active implementation PR at a time. Use branch prefix `example-stream/`.
65
+
66
+ ## Storyboard
67
+
68
+ When the epic is complete, generate `storyboard-post-run-mm-dd-yyyy.html` using `impeccable` when present. If missing, continue and note that it was skipped. Install `@pierre/diffs` if missing, and use `@pierre/diffs/ssr` for every diff.
@@ -0,0 +1,36 @@
1
+ # Loop State
2
+
3
+ Canonical tracker: Beads epic `example-epic`
4
+
5
+ This file is a compact resume aid only. If this file disagrees with Beads, Beads wins.
6
+
7
+ Status: active
8
+
9
+ Stream: `example-stream`
10
+
11
+ Workflow: `orchestrator-callback`
12
+
13
+ Current phase: none
14
+
15
+ Current Beads issue: none
16
+
17
+ Current implementation thread: none
18
+
19
+ Current review thread: none
20
+
21
+ Current PR: none
22
+
23
+ Last completed phase: none
24
+
25
+ Blocked: no
26
+
27
+ ## Phase Ledger
28
+
29
+ | Phase | Beads Issue | Status | PR | Turn Doc |
30
+ |---|---|---|---|---|
31
+ | Foundation | `example-epic.1` | pending | | `turn-docs/01-foundation.md` |
32
+ | Integration | `example-epic.2` | pending | | `turn-docs/02-integration.md` |
33
+
34
+ ## Last Orchestrator Update
35
+
36
+ Not started.
@@ -0,0 +1,30 @@
1
+ # Implementation Thread Prompt
2
+
3
+ You are the implementation thread for Beads issue `example-epic.1`.
4
+
5
+ Callback target:
6
+
7
+ `THREAD_ORCHESTRATOR_ID`
8
+
9
+ Send your final callback to exact orchestrator thread id `THREAD_ORCHESTRATOR_ID`. Do not rely on `current orchestrator thread`, `this thread`, or implicit wrapper metadata.
10
+
11
+ ## Inputs
12
+
13
+ - Beads issue: `example-epic.1`
14
+ - Phase doc: `docs/implementation/example-stream/01-foundation.md`
15
+ - Implementation index: `docs/implementation/example-stream/IMPLEMENT.md`
16
+ - Turn doc: `docs/implementation/example-stream/turn-docs/01-foundation.md`
17
+ - Branch policy: create or use `example-stream/01-foundation`
18
+ - Thread default: standard speed/reasoning
19
+
20
+ ## Rules
21
+
22
+ - Implement exactly this phase.
23
+ - Do not widen scope.
24
+ - Use bounded implementation/scout subagents when useful.
25
+ - Update the existing Markdown turn doc.
26
+ - Run local gates before PR when feasible.
27
+ - Open or update the PR.
28
+ - Do not create the review thread.
29
+ - Call back exactly once to the orchestrator when PR-ready or blocked.
30
+ - The callback payload must include `orchestrator_thread_id: "THREAD_ORCHESTRATOR_ID"` and your `source_thread_id`.
@@ -0,0 +1,35 @@
1
+ # Review Thread Prompt
2
+
3
+ You are the review thread for Beads issue `example-epic.1`.
4
+
5
+ Callback target:
6
+
7
+ `THREAD_ORCHESTRATOR_ID`
8
+
9
+ Send your final callback to exact orchestrator thread id `THREAD_ORCHESTRATOR_ID`. Do not rely on `current orchestrator thread`, `this thread`, or implicit wrapper metadata.
10
+
11
+ ## Mandatory Skill
12
+
13
+ Use:
14
+
15
+ `thermo-nuclear-code-quality-review`
16
+
17
+ ## Inputs
18
+
19
+ - Beads issue: `example-epic.1`
20
+ - Phase doc: `docs/implementation/example-stream/01-foundation.md`
21
+ - Turn doc: `docs/implementation/example-stream/turn-docs/01-foundation.md`
22
+ - PR: `#123`
23
+ - Required gates: `bun test`, `bun run typecheck`
24
+ - Thread default: standard speed/reasoning
25
+
26
+ ## Rules
27
+
28
+ - Be ambitious about structural simplification.
29
+ - Use reviewer and CI verification subagents when useful.
30
+ - Own CI through green, repaired-and-green, unavailable-with-evidence, or blocked-with-cause.
31
+ - Apply safe in-scope repairs when assigned.
32
+ - Update the existing Markdown turn doc.
33
+ - Do not create follow-up implementation threads.
34
+ - Call back exactly once when review and CI are resolved.
35
+ - The callback payload must include `orchestrator_thread_id: "THREAD_ORCHESTRATOR_ID"` and your `source_thread_id`.
@@ -0,0 +1,33 @@
1
+ # Run Loop: Example Stream
2
+
3
+ Workflow: `orchestrator-callback`
4
+
5
+ Canonical tracker: Beads epic `example-epic`
6
+
7
+ Start from:
8
+
9
+ - Beads epic: `example-epic`
10
+ - Implementation index: `docs/implementation/example-stream/IMPLEMENT.md`
11
+ - Resume aid: `docs/implementation/example-stream/loop-state.md`
12
+
13
+ ## Rules
14
+
15
+ - Beads is canonical.
16
+ - Orchestrator selects exactly one next ready Beads child issue.
17
+ - Continue phase-by-phase until the epic is complete, blocked, interrupted, or review/CI is unresolved.
18
+ - Only the orchestrator creates implementation and review threads.
19
+ - Worker and reviewer threads default to standard speed/reasoning unless Beads metadata says otherwise.
20
+ - Worker and reviewer prompt text must include the exact orchestrator thread id `THREAD_ORCHESTRATOR_ID` as callback target.
21
+ - Implementation threads call back exactly once when PR-ready or blocked.
22
+ - Implementation callbacks echo `orchestrator_thread_id` and include `source_thread_id`.
23
+ - Implementation threads do not create review threads.
24
+ - Review threads use `thermo-nuclear-code-quality-review`.
25
+ - Review threads own CI, repairs, reruns, and evidence.
26
+ - Review threads call back exactly once when review and CI are resolved.
27
+ - Review callbacks echo `orchestrator_thread_id` and include `source_thread_id`.
28
+ - All actors update the existing Markdown phase turn doc.
29
+ - Update Beads first, then update `loop-state.md`.
30
+
31
+ ## Start Prompt
32
+
33
+ Run the Example Stream dirtyloop with workflow `orchestrator-callback`. Use Beads epic `example-epic` as canonical. Read `docs/implementation/example-stream/IMPLEMENT.md` and `docs/implementation/example-stream/loop-state.md`, select one next ready Beads child issue with a selector subagent, create an implementation thread at standard speed with the full linked phase doc and exact callback target `THREAD_ORCHESTRATOR_ID` in the prompt text, wait for an implementation callback that echoes `orchestrator_thread_id` and includes `source_thread_id`, then create a review thread at standard speed that uses `thermo-nuclear-code-quality-review` and owns CI. Close out only after the review callback reports concrete CI state and echoes the same callback target. Do not let worker threads create review threads. Continue to the next ready phase unless the epic is complete, blocked, interrupted, or review/CI is unresolved.
@@ -0,0 +1,79 @@
1
+ # Phase 01 Turn Doc: Foundation
2
+
3
+ Beads issue: `example-epic.1`
4
+
5
+ Phase doc: `docs/implementation/example-stream/01-foundation.md`
6
+
7
+ This is the single Markdown turn doc for the phase.
8
+
9
+ ## Phase Selection
10
+
11
+ Selected by the orchestrator after `bd ready` showed `example-epic.1` unblocked.
12
+
13
+ ## Implementation Log
14
+
15
+ - Implementation thread `THREAD_IMPLEMENTATION_ID` created with orchestrator callback target `THREAD_ORCHESTRATOR_ID`.
16
+ - Worker created branch `example-stream/01-foundation`.
17
+ - Worker opened PR `#123`.
18
+
19
+ ## Implementation Callback
20
+
21
+ ```json
22
+ {
23
+ "type": "implementation-callback",
24
+ "orchestrator_thread_id": "THREAD_ORCHESTRATOR_ID",
25
+ "source_thread_id": "THREAD_IMPLEMENTATION_ID",
26
+ "phase_issue_id": "example-epic.1",
27
+ "status": "pr-ready",
28
+ "branch": "example-stream/01-foundation",
29
+ "pr": "#123",
30
+ "commits": ["abc1234"],
31
+ "turn_doc": "docs/implementation/example-stream/turn-docs/01-foundation.md",
32
+ "local_gates": ["bun test: passed"],
33
+ "changed_files": ["src/reporting/model.ts", "src/reporting/model.test.ts"],
34
+ "blockers": [],
35
+ "context_to_keep": ["The new model boundary is report-in/report-out and does not know UI concerns."]
36
+ }
37
+ ```
38
+
39
+ ## Review
40
+
41
+ Reviewer skill:
42
+
43
+ `thermo-nuclear-code-quality-review`
44
+
45
+ - Review thread `THREAD_REVIEW_ID` created by orchestrator after PR-ready callback.
46
+ - Reviewer swarm found one simplification opportunity and repaired it on the branch.
47
+
48
+ ## CI And Gates
49
+
50
+ CI owner: reviewer/verification agents
51
+
52
+ Current CI state: `ci-repaired-and-green`
53
+
54
+ Evidence:
55
+
56
+ - Validate check passed on commit `def5678`.
57
+
58
+ ## Review Callback
59
+
60
+ ```json
61
+ {
62
+ "type": "review-callback",
63
+ "orchestrator_thread_id": "THREAD_ORCHESTRATOR_ID",
64
+ "source_thread_id": "THREAD_REVIEW_ID",
65
+ "phase_issue_id": "example-epic.1",
66
+ "status": "repaired",
67
+ "pr": "#123",
68
+ "ci_state": "ci-repaired-and-green",
69
+ "review_skill": "thermo-nuclear-code-quality-review",
70
+ "repairs": ["Collapsed adapter branching into the model boundary."],
71
+ "findings_remaining": [],
72
+ "turn_doc": "docs/implementation/example-stream/turn-docs/01-foundation.md",
73
+ "context_to_keep": ["Adapter branching should stay behind the model boundary."]
74
+ }
75
+ ```
76
+
77
+ ## Closeout
78
+
79
+ Orchestrator merged PR `#123`, closed `example-epic.1`, refreshed Beads export, and launched the next selector.
@@ -0,0 +1,14 @@
1
+ # Example: Single-Thread Subagent Workflow
2
+
3
+ This example shows the generated files for the single-thread dirtyloops flow.
4
+
5
+ Topology:
6
+
7
+ ```text
8
+ main coordinator thread
9
+ -> selector/scout/slice/implementation-helper/reviewer/CI subagents
10
+ -> coordinator synthesizes and integrates
11
+ -> coordinator closeout
12
+ ```
13
+
14
+ Beads is canonical. Subagents are bounded and disposable. The main thread owns loop state, branch/PR state, integration, and closeout. Broad implementation starts only after a mass subagent slice plan.
@@ -0,0 +1,16 @@
1
+ # Example Stream Roadmap
2
+
3
+ Canonical tracker: Beads epic `example-epic`
4
+
5
+ ## Outcome
6
+
7
+ Replace the old reporting path inside one visible coordinator thread with mass subagent swarms.
8
+
9
+ ## Phase Sequence
10
+
11
+ 1. `example-epic.1` - Foundation
12
+ 2. `example-epic.2` - Integration
13
+
14
+ ## Closeout
15
+
16
+ The final closeout artifact is `storyboard-post-run-mm-dd-yyyy.html`.
@@ -0,0 +1,36 @@
1
+ # Phase 01: Foundation
2
+
3
+ Canonical Beads issue: `example-epic.1`
4
+
5
+ Epic: `example-epic`
6
+
7
+ ## Outcome
8
+
9
+ Introduce the new reporting model behind a narrow internal API.
10
+
11
+ ## Scope
12
+
13
+ Allowed:
14
+
15
+ - add the model module
16
+ - add focused tests
17
+ - update the turn doc
18
+
19
+ Out of scope:
20
+
21
+ - separate worker/reviewer threads
22
+ - replacing public UI
23
+ - deleting the old path
24
+
25
+ ## Beads
26
+
27
+ - Epic: `example-epic`
28
+ - Issue: `example-epic.1`
29
+ - Depends on: none
30
+ - Parallel-safe: no
31
+
32
+ ## Suggested Swarms
33
+
34
+ - 8 scouts for old behavior assumptions
35
+ - 12 reviewers for structural simplification
36
+ - 4 CI verification agents if gates fail
@@ -0,0 +1,23 @@
1
+ # Phase 02: Integration
2
+
3
+ Canonical Beads issue: `example-epic.2`
4
+
5
+ Epic: `example-epic`
6
+
7
+ ## Outcome
8
+
9
+ Route the reporting surface through the new model while preserving behavior.
10
+
11
+ ## Beads
12
+
13
+ - Epic: `example-epic`
14
+ - Issue: `example-epic.2`
15
+ - Depends on: `example-epic.1`
16
+ - Parallel-safe: no
17
+
18
+ ## Completion Criteria
19
+
20
+ - adapter uses the model
21
+ - review subagents approve or repair
22
+ - CI verification subagents report concrete state
23
+ - Beads issue is closed
@@ -0,0 +1,50 @@
1
+ # Example Stream Implementation Loop
2
+
3
+ Workflow: `single-thread-subagent`
4
+
5
+ Canonical tracker: Beads epic `example-epic`
6
+
7
+ This example shows the shape of a generated single-thread subagent loop. Single-thread means one visible coordinator, not solo implementation.
8
+
9
+ ## Goal
10
+
11
+ Replace an old reporting path with a simpler evidence-backed implementation while preserving behavior.
12
+
13
+ ## Sources Of Truth
14
+
15
+ - Beads epic: `example-epic`
16
+ - Roadmap: `docs/implementation/example-stream/00-roadmap.md`
17
+ - Beads loop metadata: workflow, run policy, swarm policy, quality gates, and branch/PR policy
18
+ - Loop state mirror: `docs/implementation/example-stream/loop-state.md`
19
+ - Phase docs linked from Beads child issues
20
+ - Turn docs: `docs/implementation/example-stream/turn-docs/`
21
+
22
+ ## Topology
23
+
24
+ The main coordinator thread owns integration, branch state, PR state, Beads updates, and closeout.
25
+
26
+ Subagents are bounded swarms:
27
+
28
+ - selector swarm: 4-8 agents
29
+ - scout swarm: 8-20 agents
30
+ - slice planning swarm: 8-16 agents
31
+ - implementation helper swarm: 8-16 agents
32
+ - reviewer swarm: 8-20 agents
33
+ - CI verification swarm: 4-12 agents
34
+
35
+ Subagents split the phase into slices, inspect, prepare implementation guidance or patches, review, verify, and report. They do not own loop state.
36
+
37
+ The coordinator runs a slice planning swarm before broad implementation. Direct coordinator implementation is limited to synthesis, integration, glue, conflicts, final repairs, and Beads/PR closeout.
38
+
39
+ ## Phase Ledger
40
+
41
+ | Beads Issue | Phase | Phase Doc | Depends On | Status |
42
+ |---|---|---|---|---|
43
+ | `example-epic.1` | Foundation | `01-foundation.md` | none | pending |
44
+ | `example-epic.2` | Integration | `02-integration.md` | `example-epic.1` | pending |
45
+
46
+ ## Review And CI
47
+
48
+ Reviewer subagents must use `thermo-nuclear-code-quality-review`.
49
+
50
+ Reviewer and CI verification subagents own CI evidence.