@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.
- package/README.md +165 -0
- package/bin/skills.js +408 -0
- package/catalog/skills.json +32 -0
- package/package.json +26 -0
- package/skills/dirtyloops/SKILL.md +67 -0
- package/skills/dirtyloops/examples/README.md +8 -0
- package/skills/dirtyloops/examples/orchestrator-callback/README.md +18 -0
- package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/00-roadmap.md +26 -0
- package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/01-foundation.md +51 -0
- package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/02-integration.md +45 -0
- package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/IMPLEMENT.md +68 -0
- package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/loop-state.md +36 -0
- package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/implementation-thread.md +30 -0
- package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/review-thread.md +35 -0
- package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/run-loop.md +33 -0
- package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/turn-docs/01-foundation.md +79 -0
- package/skills/dirtyloops/examples/single-thread-subagent/README.md +14 -0
- package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/00-roadmap.md +16 -0
- package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/01-foundation.md +36 -0
- package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/02-integration.md +23 -0
- package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/IMPLEMENT.md +50 -0
- package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/loop-state.md +28 -0
- package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/prompts/run-loop.md +22 -0
- package/skills/dirtyloops/examples/single-thread-subagent/docs/implementation/example-stream/turn-docs/01-foundation.md +32 -0
- package/skills/dirtyloops/plan.html +587 -0
- package/skills/dirtyloops/references/beads.md +114 -0
- package/skills/dirtyloops/references/common.md +66 -0
- package/skills/dirtyloops/references/create-loop.md +85 -0
- package/skills/dirtyloops/references/help.md +170 -0
- package/skills/dirtyloops/references/inspect-loop.md +11 -0
- package/skills/dirtyloops/references/review-ci.md +37 -0
- package/skills/dirtyloops/references/run-loop.md +41 -0
- package/skills/dirtyloops/references/storyboard.md +64 -0
- package/skills/dirtyloops/references/swarms.md +59 -0
- package/skills/dirtyloops/references/turn-docs.md +29 -0
- package/skills/dirtyloops/references/workflows/orchestrator-callback.md +120 -0
- package/skills/dirtyloops/references/workflows/single-thread-subagent.md +45 -0
- package/skills/dirtyloops/schemas/implementation-callback.schema.json +38 -0
- package/skills/dirtyloops/schemas/review-callback.schema.json +35 -0
- package/skills/dirtyloops/schemas/swarm-report.schema.json +43 -0
- package/skills/dirtyloops/templates/common/00-roadmap.md.template +33 -0
- package/skills/dirtyloops/templates/common/IMPLEMENT.md.template +79 -0
- package/skills/dirtyloops/templates/common/loop-state.md.template +39 -0
- package/skills/dirtyloops/templates/common/phase.md.template +56 -0
- package/skills/dirtyloops/templates/common/run-loop.md.template +46 -0
- package/skills/dirtyloops/templates/common/storyboard-post-run.html.template +77 -0
- package/skills/dirtyloops/templates/common/turn-doc.md.template +61 -0
- package/skills/dirtyloops/templates/workflows/orchestrator-callback/implementation-thread-prompt.md.template +40 -0
- package/skills/dirtyloops/templates/workflows/orchestrator-callback/review-thread-prompt.md.template +38 -0
- package/skills/dirtyloops/templates/workflows/orchestrator-callback/run-loop-addendum.md.template +17 -0
- package/skills/dirtyloops/templates/workflows/single-thread-subagent/run-loop-addendum.md.template +12 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Beads
|
|
2
|
+
|
|
3
|
+
Beads is the canonical tracker for dirtyloops.
|
|
4
|
+
|
|
5
|
+
## Before Mutating Beads
|
|
6
|
+
|
|
7
|
+
Inspect the local Beads command surface:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
bd --help
|
|
11
|
+
bd create --help
|
|
12
|
+
bd update --help
|
|
13
|
+
bd show --help
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Inspect dependency commands if present:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
bd dep --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Use only commands supported by the installed version.
|
|
23
|
+
|
|
24
|
+
## Create Loop State
|
|
25
|
+
|
|
26
|
+
For a new loop:
|
|
27
|
+
|
|
28
|
+
- create or identify one epic
|
|
29
|
+
- create one child issue per phase
|
|
30
|
+
- link each child issue to its phase doc
|
|
31
|
+
- add dependencies matching the plan
|
|
32
|
+
- record loop metadata on the epic
|
|
33
|
+
- record phase execution metadata on each child issue
|
|
34
|
+
- record quality gates and PR policy in issue text or supported metadata
|
|
35
|
+
|
|
36
|
+
If `bd create` does not support parent assignment in the same command, create the issue first and update parent/dependencies in separate supported commands.
|
|
37
|
+
|
|
38
|
+
## Loop Metadata
|
|
39
|
+
|
|
40
|
+
Use supported Beads metadata/design/body fields to store typed dirtyloop metadata. Prefer metadata when the installed Beads version supports it; otherwise store a clearly labelled JSON block in the epic design or description.
|
|
41
|
+
|
|
42
|
+
Epic metadata must include:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"dirtyloop_version": 1,
|
|
47
|
+
"workflow": "single-thread-subagent|orchestrator-callback",
|
|
48
|
+
"stream_slug": "...",
|
|
49
|
+
"doc_root": "docs/implementation/<stream>",
|
|
50
|
+
"run_policy": "until-complete",
|
|
51
|
+
"once_mode": false,
|
|
52
|
+
"branch_pr_policy": "...",
|
|
53
|
+
"quality_gates": ["..."],
|
|
54
|
+
"thread_defaults": {
|
|
55
|
+
"implementation": { "speed": "standard" },
|
|
56
|
+
"review": { "speed": "standard" }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For `orchestrator-callback`, add:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"callback_policy": {
|
|
66
|
+
"requires_concrete_orchestrator_thread_id": true,
|
|
67
|
+
"requires_source_thread_id": true,
|
|
68
|
+
"heartbeat_after_minutes": 30,
|
|
69
|
+
"polling": "fallback-only"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For `single-thread-subagent`, add:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"swarm_policy": {
|
|
79
|
+
"mode": "mass-subagent",
|
|
80
|
+
"min_parallel_agents": 8,
|
|
81
|
+
"target_scout_agents": "8-20",
|
|
82
|
+
"target_slice_agents": "8-16",
|
|
83
|
+
"target_implementation_helper_agents": "8-16",
|
|
84
|
+
"target_review_agents": "8-20",
|
|
85
|
+
"target_ci_agents": "4-12",
|
|
86
|
+
"requires_slice_plan_before_implementation": true,
|
|
87
|
+
"coordinator_direct_implementation": "integration-only"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Phase metadata must include phase number, phase doc, turn doc, completion criteria, quality gates, branch/PR instructions, and either callback target data or swarm slice policy for the selected workflow.
|
|
93
|
+
|
|
94
|
+
## Selection
|
|
95
|
+
|
|
96
|
+
Pick the next phase from Beads, not from the doc list. Prefer a command such as:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
bd ready
|
|
100
|
+
bd show <epic-id> --deps
|
|
101
|
+
bd show <phase-id>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
If Beads is unavailable but `.beads/issues.jsonl` is checked in, use that only as a read-only routing fallback and report the degraded state.
|
|
105
|
+
|
|
106
|
+
## Export
|
|
107
|
+
|
|
108
|
+
When this repo tracks `.beads/issues.jsonl`, refresh it after Beads mutations using the local supported export command. In the user's current Beads installations this is commonly:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
bd export -o .beads/issues.jsonl
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Do not assume `bd sync` exists.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Common Contract
|
|
2
|
+
|
|
3
|
+
These rules apply to every dirtyloop workflow.
|
|
4
|
+
|
|
5
|
+
## Authority
|
|
6
|
+
|
|
7
|
+
Beads is canonical for:
|
|
8
|
+
|
|
9
|
+
- phase status
|
|
10
|
+
- issue ownership
|
|
11
|
+
- ordering
|
|
12
|
+
- dependencies
|
|
13
|
+
- blockers
|
|
14
|
+
- completion
|
|
15
|
+
|
|
16
|
+
Implementation docs are context. If Beads and docs disagree, report the mismatch and trust Beads.
|
|
17
|
+
|
|
18
|
+
## Repo Layout
|
|
19
|
+
|
|
20
|
+
Create or use:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
docs/implementation/<stream>/
|
|
24
|
+
IMPLEMENT.md
|
|
25
|
+
00-roadmap.md
|
|
26
|
+
<phase-docs>.md
|
|
27
|
+
loop-state.md
|
|
28
|
+
turn-docs/
|
|
29
|
+
prompts/
|
|
30
|
+
schemas/
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`loop-state.md` is a compact resume aid, not the source of truth.
|
|
34
|
+
|
|
35
|
+
All generated paths inside loop docs, prompts, examples, and callback payloads must be repo-relative. Do not include user-specific home directories or usernames in generated loop artifacts.
|
|
36
|
+
|
|
37
|
+
## Workflow Invariants
|
|
38
|
+
|
|
39
|
+
- Keep one active implementation PR at a time unless Beads and the phase doc explicitly allow parallel work.
|
|
40
|
+
- Select exactly one next ready phase.
|
|
41
|
+
- Read the linked phase doc before editing.
|
|
42
|
+
- File follow-ups instead of widening a phase.
|
|
43
|
+
- Update Beads first, then mirror compact state into `loop-state.md`.
|
|
44
|
+
- Do not mark a phase complete while review or CI is unresolved.
|
|
45
|
+
|
|
46
|
+
## Review Skill And Storyboard Policy
|
|
47
|
+
|
|
48
|
+
Reviewer agents use:
|
|
49
|
+
|
|
50
|
+
`thermo-nuclear-code-quality-review`
|
|
51
|
+
|
|
52
|
+
Post-run storyboard generation should use:
|
|
53
|
+
|
|
54
|
+
`impeccable`
|
|
55
|
+
|
|
56
|
+
If the `impeccable` skill is not found, continue the storyboard step without it. Add a brief note to the closeout and storyboard saying `impeccable` was not found and was skipped for the storyboard step.
|
|
57
|
+
|
|
58
|
+
## Storyboard Diff Rule
|
|
59
|
+
|
|
60
|
+
Closeout must install `@pierre/diffs` in the target repo when missing, using the repo's package manager and normal dependency style.
|
|
61
|
+
|
|
62
|
+
All storyboard diffs must use:
|
|
63
|
+
|
|
64
|
+
`@pierre/diffs/ssr`
|
|
65
|
+
|
|
66
|
+
SSR is required for every diff block.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Create Loop
|
|
2
|
+
|
|
3
|
+
Use this branch when turning a finalized plan into a Beads-canonical implementation loop.
|
|
4
|
+
|
|
5
|
+
## Inputs
|
|
6
|
+
|
|
7
|
+
Use the immediately preceding finalized plan in the conversation unless the user provides a plan path.
|
|
8
|
+
|
|
9
|
+
Required:
|
|
10
|
+
|
|
11
|
+
- repo root
|
|
12
|
+
- stream slug
|
|
13
|
+
- epic title
|
|
14
|
+
- workflow
|
|
15
|
+
- run policy
|
|
16
|
+
- thread defaults
|
|
17
|
+
- callback policy for `orchestrator-callback`
|
|
18
|
+
- swarm policy for `single-thread-subagent`
|
|
19
|
+
- quality gates
|
|
20
|
+
- branch/PR policy
|
|
21
|
+
|
|
22
|
+
If required inputs are missing and cannot be inferred safely, ask one concise question before writing files.
|
|
23
|
+
|
|
24
|
+
Ask only for missing decisions. Prefer these defaults when the user has not specified otherwise:
|
|
25
|
+
|
|
26
|
+
- run policy: continue until epic complete, blocked, interrupted, or review/CI unresolved
|
|
27
|
+
- one-shot mode: off unless the user says `run once` or `--once`
|
|
28
|
+
- worker/reviewer speed: standard
|
|
29
|
+
- orchestrator-callback heartbeat: 30 minutes, fallback-only polling
|
|
30
|
+
- single-thread-subagent swarm mode: mass-subagent, minimum 8 parallel agents for broad scout/slice/review work
|
|
31
|
+
|
|
32
|
+
## Steps
|
|
33
|
+
|
|
34
|
+
1. Inspect the repo.
|
|
35
|
+
- Confirm the repo root.
|
|
36
|
+
- Check existing `docs/implementation/`.
|
|
37
|
+
- Check Beads availability and command surface.
|
|
38
|
+
- Completion criterion: you know whether this is a new stream or an update to an existing stream.
|
|
39
|
+
|
|
40
|
+
2. Normalize the plan into phases.
|
|
41
|
+
- Each phase gets outcome, scope, out-of-scope, inputs, quality gates, dependencies, and completion criteria.
|
|
42
|
+
- Prefer focused phases and file follow-ups for adjacent work.
|
|
43
|
+
- Completion criterion: every plan requirement maps to one phase or an explicit follow-up.
|
|
44
|
+
|
|
45
|
+
3. Normalize loop metadata.
|
|
46
|
+
- Record workflow, run policy, branch/PR policy, quality gates, and thread defaults.
|
|
47
|
+
- For `orchestrator-callback`, record callback policy: concrete orchestrator thread id required in prompts and callback payloads, source thread id required in callback payloads, heartbeat interval, and fallback-only polling.
|
|
48
|
+
- For `single-thread-subagent`, record swarm policy: mass-subagent mode, minimum parallel agents, scout/slice/implementation-helper/review/CI swarm sizes, mandatory slice plan before implementation, and coordinator-direct-implementation limits.
|
|
49
|
+
- Completion criterion: the loop can be validated from Beads metadata before any worker, reviewer, or broad implementation work starts.
|
|
50
|
+
|
|
51
|
+
4. Create Beads state.
|
|
52
|
+
- Create or update the epic.
|
|
53
|
+
- Create child phase issues.
|
|
54
|
+
- Add dependencies.
|
|
55
|
+
- Link child issues to phase docs.
|
|
56
|
+
- Store loop metadata on the epic and phase execution metadata on child issues using supported Beads metadata/design/body fields.
|
|
57
|
+
- Refresh checked-in Beads export when applicable.
|
|
58
|
+
- Completion criterion: Beads can route the next ready phase without consulting chat.
|
|
59
|
+
|
|
60
|
+
5. Create repo docs.
|
|
61
|
+
- Use templates under `templates/common/` plus the selected workflow template.
|
|
62
|
+
- Create `IMPLEMENT.md`, `00-roadmap.md`, phase docs, `loop-state.md`, `turn-docs/`, `prompts/`, and `schemas/`.
|
|
63
|
+
- Treat docs as generated execution views of Beads state. If Beads and docs disagree, Beads wins.
|
|
64
|
+
- Use repo-relative paths inside generated docs and prompts.
|
|
65
|
+
- Do not include user-specific home directories or usernames in generated artifacts.
|
|
66
|
+
- Completion criterion: the generated docs are enough to run the loop without the original chat.
|
|
67
|
+
|
|
68
|
+
6. Generate the run prompt.
|
|
69
|
+
- Save it as `docs/implementation/<stream>/prompts/run-loop.md`.
|
|
70
|
+
- Include the selected workflow name.
|
|
71
|
+
- Include Beads epic id, run policy, phase-doc location, turn-doc rules, review skill, CI ownership, thread defaults, callback/slice preflight rules, and storyboard requirements.
|
|
72
|
+
- Completion criterion: the user can paste the generated prompt into Codex to start the loop.
|
|
73
|
+
|
|
74
|
+
## Output Contract
|
|
75
|
+
|
|
76
|
+
End with:
|
|
77
|
+
|
|
78
|
+
- files created
|
|
79
|
+
- Beads epic id
|
|
80
|
+
- Beads phase issue ids
|
|
81
|
+
- generated run prompt path
|
|
82
|
+
- exact customized run prompt
|
|
83
|
+
- any blockers or degraded Beads operations
|
|
84
|
+
|
|
85
|
+
Do not start the implementation loop unless the user explicitly asks.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Help
|
|
2
|
+
|
|
3
|
+
Use this branch when the user asks how to use `$dirtyloops`, what workflows exist, or what command to run next.
|
|
4
|
+
|
|
5
|
+
Do not mutate files, Beads, branches, PRs, or threads while answering help.
|
|
6
|
+
|
|
7
|
+
## What dirtyloops Does
|
|
8
|
+
|
|
9
|
+
`$dirtyloops` turns a finalized plan into a Beads-canonical implementation loop and can then run, inspect, or close that loop.
|
|
10
|
+
|
|
11
|
+
Every dirtyloop uses:
|
|
12
|
+
|
|
13
|
+
- Beads as canonical tracker
|
|
14
|
+
- typed loop metadata on Beads for workflow, run policy, callback policy, thread defaults, swarm policy, quality gates, and branch/PR policy
|
|
15
|
+
- phase docs linked from Beads child issues
|
|
16
|
+
- repo-relative paths in generated docs and prompts
|
|
17
|
+
- one Markdown turn doc per phase
|
|
18
|
+
- bounded subagent swarms
|
|
19
|
+
- reviewer-owned CI
|
|
20
|
+
- `thermo-nuclear-code-quality-review` for reviewers
|
|
21
|
+
- `storyboard-post-run-mm-dd-yyyy.html` for final closeout
|
|
22
|
+
- `impeccable` for the storyboard when available
|
|
23
|
+
- automatic target-repo installation of `@pierre/diffs` when missing
|
|
24
|
+
- `@pierre/diffs/ssr` for every storyboard diff
|
|
25
|
+
|
|
26
|
+
## Commands
|
|
27
|
+
|
|
28
|
+
### `$dirtyloops help`
|
|
29
|
+
|
|
30
|
+
Explain usage. This command is read-only.
|
|
31
|
+
|
|
32
|
+
### `$dirtyloops create <workflow>`
|
|
33
|
+
|
|
34
|
+
Turn the finalized plan into a loop.
|
|
35
|
+
|
|
36
|
+
Required inputs:
|
|
37
|
+
|
|
38
|
+
- repo path
|
|
39
|
+
- stream slug
|
|
40
|
+
- epic title
|
|
41
|
+
- workflow
|
|
42
|
+
- run policy
|
|
43
|
+
- thread defaults
|
|
44
|
+
- quality gates
|
|
45
|
+
- branch/PR policy
|
|
46
|
+
|
|
47
|
+
Example:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
$dirtyloops create orchestrator-callback from the finalized plan above
|
|
51
|
+
|
|
52
|
+
Repo: .
|
|
53
|
+
Stream slug: smart-flow-alerts
|
|
54
|
+
Epic title: Smart-flow alerts migration
|
|
55
|
+
Quality gates: bun test, bun run typecheck, targeted browser QA
|
|
56
|
+
Branch/PR policy: one active implementation PR at a time
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Output:
|
|
60
|
+
|
|
61
|
+
- Beads epic and child phase issues
|
|
62
|
+
- `docs/implementation/<stream>/IMPLEMENT.md`
|
|
63
|
+
- `00-roadmap.md`
|
|
64
|
+
- phase docs
|
|
65
|
+
- `loop-state.md`
|
|
66
|
+
- `turn-docs/`
|
|
67
|
+
- workflow prompts
|
|
68
|
+
- schemas
|
|
69
|
+
- `docs/implementation/<stream>/prompts/run-loop.md`
|
|
70
|
+
|
|
71
|
+
### `$dirtyloops run <workflow>`
|
|
72
|
+
|
|
73
|
+
Run an existing loop until the epic is complete, blocked, interrupted, or review/CI is unresolved.
|
|
74
|
+
|
|
75
|
+
Use `run once` or `--once` to run only the next ready phase and stop after closeout.
|
|
76
|
+
|
|
77
|
+
Example:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
$dirtyloops run single-thread-subagent
|
|
81
|
+
|
|
82
|
+
Repo: .
|
|
83
|
+
Stream: docs/implementation/smart-flow-alerts/
|
|
84
|
+
Beads epic: islandflow-ghce
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `$dirtyloops inspect`
|
|
88
|
+
|
|
89
|
+
Read Beads and loop docs without mutation. Use this when resuming a loop or checking whether it is blocked.
|
|
90
|
+
|
|
91
|
+
### `$dirtyloops closeout`
|
|
92
|
+
|
|
93
|
+
Verify the epic is complete, then generate the post-run storyboard.
|
|
94
|
+
|
|
95
|
+
If `impeccable` is missing, closeout still completes and records that the skill was skipped. If `@pierre/diffs` is missing from the target repo, closeout installs it before rendering diffs.
|
|
96
|
+
|
|
97
|
+
## Workflows
|
|
98
|
+
|
|
99
|
+
### `single-thread-subagent`
|
|
100
|
+
|
|
101
|
+
Use this when you want one visible Codex coordinator thread with mass subagent swarms.
|
|
102
|
+
|
|
103
|
+
Shape:
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
main coordinator thread
|
|
107
|
+
-> selector/scout/slice/implementation-helper/reviewer/CI subagents
|
|
108
|
+
-> coordinator synthesizes and integrates
|
|
109
|
+
-> coordinator closeout
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Use it for CLI-friendly or context-controlled loops where separate callback threads are not desired. Single-thread means one visible coordinator, not solo implementation; broad phases should use 8+ subagents and a slice plan before implementation.
|
|
113
|
+
|
|
114
|
+
### `orchestrator-callback`
|
|
115
|
+
|
|
116
|
+
Use this for the original multi-thread loop.
|
|
117
|
+
|
|
118
|
+
Shape:
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
orchestrator thread
|
|
122
|
+
-> selector subagent
|
|
123
|
+
-> implementation thread
|
|
124
|
+
-> implementation callback when PR-ready
|
|
125
|
+
-> review thread
|
|
126
|
+
-> review callback when review + CI are resolved
|
|
127
|
+
-> orchestrator closeout
|
|
128
|
+
-> next selector
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Only the orchestrator creates implementation and review threads. Worker threads do not create review threads. Worker and reviewer prompts must contain the concrete orchestrator thread id as callback target.
|
|
132
|
+
|
|
133
|
+
## Which Workflow Should I Pick?
|
|
134
|
+
|
|
135
|
+
Pick `orchestrator-callback` when:
|
|
136
|
+
|
|
137
|
+
- you want separate visible worker/reviewer threads
|
|
138
|
+
- the work is long-running
|
|
139
|
+
- implementation and review should happen in distinct contexts
|
|
140
|
+
- you want callback-driven orchestration
|
|
141
|
+
|
|
142
|
+
Pick `single-thread-subagent` when:
|
|
143
|
+
|
|
144
|
+
- you want one visible thread
|
|
145
|
+
- you are running in a CLI-friendly style
|
|
146
|
+
- you want less thread management
|
|
147
|
+
- you want mass internal subagent swarms without separate visible worker/reviewer threads
|
|
148
|
+
|
|
149
|
+
## Examples And Plan
|
|
150
|
+
|
|
151
|
+
Human-readable overview:
|
|
152
|
+
|
|
153
|
+
`plan.html`
|
|
154
|
+
|
|
155
|
+
Generated output examples:
|
|
156
|
+
|
|
157
|
+
- `examples/single-thread-subagent/`
|
|
158
|
+
- `examples/orchestrator-callback/`
|
|
159
|
+
|
|
160
|
+
## Good Help Answer Shape
|
|
161
|
+
|
|
162
|
+
When answering `$dirtyloops help`, lead with:
|
|
163
|
+
|
|
164
|
+
1. one sentence explaining dirtyloops
|
|
165
|
+
2. the two workflows
|
|
166
|
+
3. the create/run commands
|
|
167
|
+
4. the decision rule for workflow choice
|
|
168
|
+
5. links to `plan.html` and examples
|
|
169
|
+
|
|
170
|
+
Keep it practical. Do not dump every internal rule unless the user asks.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Inspect Loop
|
|
2
|
+
|
|
3
|
+
Use this branch to report dirtyloop state without changing files, Beads, branches, PRs, or threads.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
|
|
7
|
+
1. Read `IMPLEMENT.md`, `loop-state.md`, and Beads state.
|
|
8
|
+
2. Compare docs against Beads.
|
|
9
|
+
3. Report current phase, ready phase candidates, active PR/thread state if recorded, blockers, and next recommended action.
|
|
10
|
+
|
|
11
|
+
Completion criterion: the user can see whether the loop is ready to run, blocked, or complete.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Review And CI
|
|
2
|
+
|
|
3
|
+
Review and CI are owned by reviewer and CI verification agents, not by a passive coordinator.
|
|
4
|
+
|
|
5
|
+
## Review Skill
|
|
6
|
+
|
|
7
|
+
Every reviewer agent must use:
|
|
8
|
+
|
|
9
|
+
`thermo-nuclear-code-quality-review`
|
|
10
|
+
|
|
11
|
+
The review bar is structural: simplification, abstraction quality, spaghetti growth, wrong-layer logic, file-size blowups, unnecessary wrappers, type looseness, and canonical-helper duplication are real blockers when they affect maintainability.
|
|
12
|
+
|
|
13
|
+
## CI Ownership
|
|
14
|
+
|
|
15
|
+
Reviewer and CI verification agents own:
|
|
16
|
+
|
|
17
|
+
- CI inspection
|
|
18
|
+
- CI failure diagnosis
|
|
19
|
+
- safe repairs when assigned
|
|
20
|
+
- reruns
|
|
21
|
+
- final CI evidence
|
|
22
|
+
- turn-doc updates for review and CI
|
|
23
|
+
|
|
24
|
+
The coordinator must not close a phase while CI is unknown, failing, or still running.
|
|
25
|
+
|
|
26
|
+
Allowed CI closeout states:
|
|
27
|
+
|
|
28
|
+
- `ci-green`
|
|
29
|
+
- `ci-repaired-and-green`
|
|
30
|
+
- `ci-unavailable-with-evidence`
|
|
31
|
+
- `ci-blocked-with-cause`
|
|
32
|
+
|
|
33
|
+
Unknown CI is not approval.
|
|
34
|
+
|
|
35
|
+
## Existing Turn Doc
|
|
36
|
+
|
|
37
|
+
Reviewers and CI agents update the existing phase turn doc. They do not create a separate review or CI doc.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Run Loop
|
|
2
|
+
|
|
3
|
+
Use this branch to execute an existing dirtyloop. Continue phase-by-phase by default until the epic is complete, blocked, interrupted, or review/CI is unresolved. If the user requested `run once` or `--once`, run only the next ready phase and stop after closeout.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
|
|
7
|
+
1. Read Beads.
|
|
8
|
+
- Inspect the epic and ready child issues.
|
|
9
|
+
- Read dirtyloop metadata from the epic and phase execution metadata from the selected child issue.
|
|
10
|
+
- Completion criterion: the next ready Beads issue, run policy, workflow, thread defaults, and callback/slice policy are known; or a concrete blocker is known.
|
|
11
|
+
|
|
12
|
+
2. Read the execution context.
|
|
13
|
+
- Read `IMPLEMENT.md`.
|
|
14
|
+
- Read `loop-state.md`.
|
|
15
|
+
- Read the linked phase doc.
|
|
16
|
+
- Completion criterion: selected scope, dependencies, gates, and workflow are known.
|
|
17
|
+
|
|
18
|
+
3. Validate launch preflight.
|
|
19
|
+
- For `orchestrator-callback`, require a concrete orchestrator thread id before launching workers/reviewers. The actual worker/reviewer prompt text must name that exact id as the callback target and must not rely on phrases like `current orchestrator thread`, `this thread`, or `source thread wrapper`.
|
|
20
|
+
- For `orchestrator-callback`, require worker/reviewer thread defaults to be explicit, defaulting to standard speed/reasoning when metadata does not override it.
|
|
21
|
+
- For `single-thread-subagent`, require a mass-subagent slice/scout plan before broad implementation. The coordinator may perform integration and final repairs, but it must not do most broad discovery or implementation itself.
|
|
22
|
+
- Completion criterion: the workflow can start without relying on inherited thread settings, vague callback targets, or solo coordinator implementation.
|
|
23
|
+
|
|
24
|
+
4. Run the selected workflow.
|
|
25
|
+
- Follow the selected workflow reference.
|
|
26
|
+
- Use required swarms for the workflow.
|
|
27
|
+
- Keep implementation to exactly one phase.
|
|
28
|
+
- Completion criterion: the workflow reaches PR-ready, approved, repaired, blocked, or stream-complete state.
|
|
29
|
+
|
|
30
|
+
5. Close out the phase.
|
|
31
|
+
- Update the existing turn doc.
|
|
32
|
+
- Update Beads first.
|
|
33
|
+
- Record lifecycle events or notes for worker launch, callbacks, review launch, CI state, phase closeout, and next phase selection when supported by Beads.
|
|
34
|
+
- Refresh Beads export when applicable.
|
|
35
|
+
- Update `loop-state.md`.
|
|
36
|
+
- Completion criterion: Beads and docs agree on the phase state.
|
|
37
|
+
|
|
38
|
+
6. Continue or stop.
|
|
39
|
+
- Default: select the next ready Beads child issue and continue the loop.
|
|
40
|
+
- Stop when the epic is complete, blocked, interrupted, review/CI is unresolved, or the user requested `run once` / `--once`.
|
|
41
|
+
- Completion criterion: final response includes the current phase, PR/CI state, Beads updates, whether the loop continued or stopped, and the exact stop reason when stopped.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Storyboard Closeout
|
|
2
|
+
|
|
3
|
+
Use this branch when the Beads epic is complete or ready to close.
|
|
4
|
+
|
|
5
|
+
## Artifact
|
|
6
|
+
|
|
7
|
+
Generate:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
docs/implementation/<stream>/storyboard-post-run-mm-dd-yyyy.html
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Use the actual current date for the filename.
|
|
14
|
+
|
|
15
|
+
## Storyboard Skill
|
|
16
|
+
|
|
17
|
+
Use when available:
|
|
18
|
+
|
|
19
|
+
`impeccable`
|
|
20
|
+
|
|
21
|
+
If the `impeccable` skill exists, follow that skill's setup before designing or generating the storyboard.
|
|
22
|
+
|
|
23
|
+
If the `impeccable` skill is not found, continue without it. Add a brief note to the closeout and inside the storyboard saying `impeccable` was not found and was skipped for the storyboard step.
|
|
24
|
+
|
|
25
|
+
## Required Diff Renderer
|
|
26
|
+
|
|
27
|
+
Every diff block must use:
|
|
28
|
+
|
|
29
|
+
`@pierre/diffs/ssr`
|
|
30
|
+
|
|
31
|
+
SSR is required. Do not hand-roll diff rendering. Do not use a client-only diff renderer.
|
|
32
|
+
|
|
33
|
+
If `@pierre/diffs` is missing, install it in the target repo before generating the storyboard. Inspect the repo package manager and add it in the repo's normal style. Do not substitute another diff renderer.
|
|
34
|
+
|
|
35
|
+
## Inputs
|
|
36
|
+
|
|
37
|
+
- Beads epic and child issues
|
|
38
|
+
- every Markdown turn doc
|
|
39
|
+
- phase docs
|
|
40
|
+
- PRs and commits
|
|
41
|
+
- review findings and repairs
|
|
42
|
+
- CI evidence
|
|
43
|
+
- follow-ups
|
|
44
|
+
|
|
45
|
+
## Narrative
|
|
46
|
+
|
|
47
|
+
Tell the story of the implementation. Avoid a rigid status template.
|
|
48
|
+
|
|
49
|
+
Include:
|
|
50
|
+
|
|
51
|
+
- setup
|
|
52
|
+
- each phase's arc
|
|
53
|
+
- important snippets
|
|
54
|
+
- discoveries
|
|
55
|
+
- failed attempts
|
|
56
|
+
- repairs
|
|
57
|
+
- review moments
|
|
58
|
+
- CI evidence
|
|
59
|
+
- final state
|
|
60
|
+
- follow-ups
|
|
61
|
+
|
|
62
|
+
## Completion Criterion
|
|
63
|
+
|
|
64
|
+
The storyboard exists, has been visually/technically verified, includes all phases, installs `@pierre/diffs` if it was missing, and uses `@pierre/diffs/ssr` for every diff.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Swarms
|
|
2
|
+
|
|
3
|
+
dirtyloops use bounded swarms. Fan out aggressively when the phase has broad surface area, shared architecture, CI risk, or user-facing behavior. In `single-thread-subagent`, mass subagent work is mandatory for broad phases: the visible coordinator orchestrates, synthesizes, integrates, and closes out; subagents do much of the discovery, slicing, implementation analysis, review, and CI verification.
|
|
4
|
+
|
|
5
|
+
## Default Sizes
|
|
6
|
+
|
|
7
|
+
- selector swarm: 4-8 agents
|
|
8
|
+
- scout swarm: 8-20 agents
|
|
9
|
+
- slice planning swarm: 8-16 agents
|
|
10
|
+
- implementation helper swarm: 8-16 agents
|
|
11
|
+
- reviewer swarm: 8-20 agents
|
|
12
|
+
- CI verification swarm: 4-12 agents
|
|
13
|
+
- storyboard synthesis swarm: 3-8 agents
|
|
14
|
+
|
|
15
|
+
For `single-thread-subagent`, use at least 8 parallel agents before broad implementation unless the phase is explicitly tiny. If fewer than 8 agents are used, record the reason in the turn doc.
|
|
16
|
+
|
|
17
|
+
## Bounds
|
|
18
|
+
|
|
19
|
+
Each subagent gets:
|
|
20
|
+
|
|
21
|
+
- one mission
|
|
22
|
+
- explicit files, commands, or questions
|
|
23
|
+
- no loop-state ownership
|
|
24
|
+
- no Beads mutation unless explicitly assigned
|
|
25
|
+
- no implementation unless explicitly assigned to an implementation slice
|
|
26
|
+
- compact structured output
|
|
27
|
+
- max 5 context facts to retain
|
|
28
|
+
|
|
29
|
+
## Slice Planning
|
|
30
|
+
|
|
31
|
+
For non-trivial `single-thread-subagent` phases, run a slice planning swarm before implementation. Slices should be bounded by module, file group, workflow, test surface, or risk area.
|
|
32
|
+
|
|
33
|
+
The coordinator must synthesize the slice reports before broad edits. Direct coordinator implementation is limited to integration, glue, conflict resolution, final repairs, and Beads/PR state.
|
|
34
|
+
|
|
35
|
+
## Report Shape
|
|
36
|
+
|
|
37
|
+
Use compact reports:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mission": "scout|slice-plan|implementation-helper|review|ci|storyboard",
|
|
42
|
+
"slice_id": "string-or-null",
|
|
43
|
+
"status": "ready|blocked|risk-found|done",
|
|
44
|
+
"scope_checked": ["..."],
|
|
45
|
+
"findings": [
|
|
46
|
+
{
|
|
47
|
+
"severity": "high|medium|low|info",
|
|
48
|
+
"evidence": "path:line or command summary",
|
|
49
|
+
"summary": "...",
|
|
50
|
+
"recommendation": "..."
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"recommendations": ["..."],
|
|
54
|
+
"artifacts": ["repo-relative path, command summary, or patch summary"],
|
|
55
|
+
"context_to_keep": ["max 5 bullets"]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The coordinator or lead thread synthesizes reports into the turn doc.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Turn Docs
|
|
2
|
+
|
|
3
|
+
Turn docs are Markdown. They are the durable narrative log for the loop.
|
|
4
|
+
|
|
5
|
+
Each phase has exactly one turn doc:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
docs/implementation/<stream>/turn-docs/<phase-id>.md
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Implementation, review, CI, repairs, PR state, Beads updates, follow-ups, and closeout all go into that same file.
|
|
12
|
+
|
|
13
|
+
## Required Sections
|
|
14
|
+
|
|
15
|
+
Each turn doc should include:
|
|
16
|
+
|
|
17
|
+
- phase selection
|
|
18
|
+
- scope
|
|
19
|
+
- implementation log
|
|
20
|
+
- subagent swarm summary
|
|
21
|
+
- review
|
|
22
|
+
- CI and gates
|
|
23
|
+
- PR and commits
|
|
24
|
+
- Beads updates
|
|
25
|
+
- follow-ups filed
|
|
26
|
+
- context to keep
|
|
27
|
+
- closeout
|
|
28
|
+
|
|
29
|
+
The doc can be narrative. It does not need to be rigidly filled out if the information is present and easy to scan.
|