devague 0.9.1__tar.gz → 0.11.0__tar.gz

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 (136) hide show
  1. devague-0.11.0/.claude/skills/assign-to-workforce/SKILL.md +241 -0
  2. devague-0.11.0/.claude/skills/assign-to-workforce/scripts/assign-to-workforce.sh +209 -0
  3. {devague-0.9.1 → devague-0.11.0}/.claude/skills/spec-to-plan/SKILL.md +85 -6
  4. {devague-0.9.1 → devague-0.11.0}/.claude/skills/spec-to-plan/scripts/spec-to-plan.sh +7 -104
  5. {devague-0.9.1 → devague-0.11.0}/.claude/skills/think/SKILL.md +19 -14
  6. devague-0.11.0/.claude/skills/think/scripts/think.sh +101 -0
  7. {devague-0.9.1 → devague-0.11.0}/.gitignore +3 -0
  8. {devague-0.9.1 → devague-0.11.0}/CHANGELOG.md +26 -0
  9. {devague-0.9.1 → devague-0.11.0}/CLAUDE.md +66 -5
  10. {devague-0.9.1 → devague-0.11.0}/PKG-INFO +1 -1
  11. {devague-0.9.1 → devague-0.11.0}/devague/cli/__init__.py +2 -0
  12. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/learn.py +52 -0
  13. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/plan.py +50 -3
  14. devague-0.11.0/devague/cli/_commands/status.py +53 -0
  15. devague-0.11.0/devague/cli/_status.py +99 -0
  16. {devague-0.9.1 → devague-0.11.0}/devague/plan_convergence.py +56 -1
  17. devague-0.11.0/docs/assign-to-workforce-worked-example.md +226 -0
  18. {devague-0.9.1 → devague-0.11.0}/docs/skill-sources.md +1 -0
  19. {devague-0.9.1 → devague-0.11.0}/pyproject.toml +1 -1
  20. devague-0.11.0/tests/test_cli_learn.py +40 -0
  21. {devague-0.9.1 → devague-0.11.0}/tests/test_cli_plan.py +56 -0
  22. devague-0.11.0/tests/test_cli_status.py +204 -0
  23. devague-0.11.0/tests/test_plan_convergence.py +399 -0
  24. {devague-0.9.1 → devague-0.11.0}/uv.lock +1 -1
  25. devague-0.9.1/.claude/skills/think/scripts/think.sh +0 -205
  26. devague-0.9.1/tests/test_plan_convergence.py +0 -121
  27. {devague-0.9.1 → devague-0.11.0}/.claude/skills/cicd/SKILL.md +0 -0
  28. {devague-0.9.1 → devague-0.11.0}/.claude/skills/cicd/scripts/_resolve-nick.sh +0 -0
  29. {devague-0.9.1 → devague-0.11.0}/.claude/skills/cicd/scripts/portability-lint.sh +0 -0
  30. {devague-0.9.1 → devague-0.11.0}/.claude/skills/cicd/scripts/pr-reply.sh +0 -0
  31. {devague-0.9.1 → devague-0.11.0}/.claude/skills/cicd/scripts/pr-status.sh +0 -0
  32. {devague-0.9.1 → devague-0.11.0}/.claude/skills/cicd/scripts/workflow.sh +0 -0
  33. {devague-0.9.1 → devague-0.11.0}/.claude/skills/communicate/SKILL.md +0 -0
  34. {devague-0.9.1 → devague-0.11.0}/.claude/skills/communicate/scripts/fetch-issues.sh +0 -0
  35. {devague-0.9.1 → devague-0.11.0}/.claude/skills/communicate/scripts/mesh-message.sh +0 -0
  36. {devague-0.9.1 → devague-0.11.0}/.claude/skills/communicate/scripts/post-comment.sh +0 -0
  37. {devague-0.9.1 → devague-0.11.0}/.claude/skills/communicate/scripts/post-issue.sh +0 -0
  38. {devague-0.9.1 → devague-0.11.0}/.claude/skills/communicate/scripts/templates/skill-update-brief.md +0 -0
  39. {devague-0.9.1 → devague-0.11.0}/.claude/skills/doc-test-alignment/SKILL.md +0 -0
  40. {devague-0.9.1 → devague-0.11.0}/.claude/skills/doc-test-alignment/scripts/check.sh +0 -0
  41. {devague-0.9.1 → devague-0.11.0}/.claude/skills/run-tests/SKILL.md +0 -0
  42. {devague-0.9.1 → devague-0.11.0}/.claude/skills/run-tests/scripts/test.sh +0 -0
  43. {devague-0.9.1 → devague-0.11.0}/.claude/skills/sonarclaude/SKILL.md +0 -0
  44. {devague-0.9.1 → devague-0.11.0}/.claude/skills/sonarclaude/scripts/sonar.sh +0 -0
  45. {devague-0.9.1 → devague-0.11.0}/.claude/skills/version-bump/SKILL.md +0 -0
  46. {devague-0.9.1 → devague-0.11.0}/.claude/skills/version-bump/scripts/bump.py +0 -0
  47. {devague-0.9.1 → devague-0.11.0}/.claude/skills.local.yaml.example +0 -0
  48. {devague-0.9.1 → devague-0.11.0}/.devague/current_plan +0 -0
  49. {devague-0.9.1 → devague-0.11.0}/.devague/frames/devague-0-6-0-ships-the-human-review-loop-devague.json +0 -0
  50. {devague-0.9.1 → devague-0.11.0}/.devague/frames/devague-now-ships-a-documented-spec-contract-every.json +0 -0
  51. {devague-0.9.1 → devague-0.11.0}/.devague/frames/devague-turns-a-converged-plan-into-parallel-simpl.json +0 -0
  52. {devague-0.9.1 → devague-0.11.0}/.devague/plans/devague-0-6-0-ships-the-human-review-loop-devague.json +0 -0
  53. {devague-0.9.1 → devague-0.11.0}/.devague/plans/devague-now-ships-a-documented-spec-contract-every.json +0 -0
  54. {devague-0.9.1 → devague-0.11.0}/.devague/plans/devague-turns-a-converged-plan-into-parallel-simpl.json +0 -0
  55. {devague-0.9.1 → devague-0.11.0}/.flake8 +0 -0
  56. {devague-0.9.1 → devague-0.11.0}/.github/workflows/publish.yml +0 -0
  57. {devague-0.9.1 → devague-0.11.0}/.github/workflows/security-checks.yml +0 -0
  58. {devague-0.9.1 → devague-0.11.0}/.github/workflows/tests.yml +0 -0
  59. {devague-0.9.1 → devague-0.11.0}/.markdownlint-cli2.yaml +0 -0
  60. {devague-0.9.1 → devague-0.11.0}/.pre-commit-config.yaml +0 -0
  61. {devague-0.9.1 → devague-0.11.0}/LICENSE +0 -0
  62. {devague-0.9.1 → devague-0.11.0}/README.md +0 -0
  63. {devague-0.9.1 → devague-0.11.0}/culture.yaml +0 -0
  64. {devague-0.9.1 → devague-0.11.0}/devague/__init__.py +0 -0
  65. {devague-0.9.1 → devague-0.11.0}/devague/__main__.py +0 -0
  66. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/__init__.py +0 -0
  67. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/capture.py +0 -0
  68. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/confirm.py +0 -0
  69. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/converge.py +0 -0
  70. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/explain.py +0 -0
  71. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/export.py +0 -0
  72. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/interrogate.py +0 -0
  73. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/list_frames.py +0 -0
  74. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/new.py +0 -0
  75. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/park.py +0 -0
  76. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/question.py +0 -0
  77. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/reject.py +0 -0
  78. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/review.py +0 -0
  79. {devague-0.9.1 → devague-0.11.0}/devague/cli/_commands/show.py +0 -0
  80. {devague-0.9.1 → devague-0.11.0}/devague/cli/_errors.py +0 -0
  81. {devague-0.9.1 → devague-0.11.0}/devague/cli/_frames.py +0 -0
  82. {devague-0.9.1 → devague-0.11.0}/devague/cli/_output.py +0 -0
  83. {devague-0.9.1 → devague-0.11.0}/devague/cli/_paths.py +0 -0
  84. {devague-0.9.1 → devague-0.11.0}/devague/cli/_plans.py +0 -0
  85. {devague-0.9.1 → devague-0.11.0}/devague/convergence.py +0 -0
  86. {devague-0.9.1 → devague-0.11.0}/devague/frame.py +0 -0
  87. {devague-0.9.1 → devague-0.11.0}/devague/plan.py +0 -0
  88. {devague-0.9.1 → devague-0.11.0}/devague/plan_store.py +0 -0
  89. {devague-0.9.1 → devague-0.11.0}/devague/questions_io.py +0 -0
  90. {devague-0.9.1 → devague-0.11.0}/devague/render/__init__.py +0 -0
  91. {devague-0.9.1 → devague-0.11.0}/devague/render/frame_md.py +0 -0
  92. {devague-0.9.1 → devague-0.11.0}/devague/render/plan_md.py +0 -0
  93. {devague-0.9.1 → devague-0.11.0}/devague/render/review_md.py +0 -0
  94. {devague-0.9.1 → devague-0.11.0}/devague/render/spec_md.py +0 -0
  95. {devague-0.9.1 → devague-0.11.0}/devague/store.py +0 -0
  96. {devague-0.9.1 → devague-0.11.0}/docs/examples/contract-example.json +0 -0
  97. {devague-0.9.1 → devague-0.11.0}/docs/llm-guidance.md +0 -0
  98. {devague-0.9.1 → devague-0.11.0}/docs/plans/2026-05-23-devague-0-6-0-ships-the-human-review-loop-devague.md +0 -0
  99. {devague-0.9.1 → devague-0.11.0}/docs/plans/2026-05-23-devague-now-ships-a-documented-spec-contract-every.md +0 -0
  100. {devague-0.9.1 → devague-0.11.0}/docs/plans/2026-05-23-devague-turns-a-converged-plan-into-parallel-simpl.md +0 -0
  101. {devague-0.9.1 → devague-0.11.0}/docs/reviews/spec-contract-frame-review.md +0 -0
  102. {devague-0.9.1 → devague-0.11.0}/docs/spec-contract.md +0 -0
  103. {devague-0.9.1 → devague-0.11.0}/docs/specs/2026-05-23-devague-0-6-0-ships-the-human-review-loop-devague.md +0 -0
  104. {devague-0.9.1 → devague-0.11.0}/docs/specs/2026-05-23-devague-now-ships-a-documented-spec-contract-every.md +0 -0
  105. {devague-0.9.1 → devague-0.11.0}/docs/specs/2026-05-23-devague-turns-a-converged-plan-into-parallel-simpl.md +0 -0
  106. {devague-0.9.1 → devague-0.11.0}/docs/superpowers/plans/2026-05-22-specifix-onboarding.md +0 -0
  107. {devague-0.9.1 → devague-0.11.0}/docs/superpowers/plans/2026-05-23-devague-rename.md +0 -0
  108. {devague-0.9.1 → devague-0.11.0}/docs/superpowers/plans/2026-05-23-devague-working-backwards-engine.md +0 -0
  109. {devague-0.9.1 → devague-0.11.0}/docs/superpowers/specs/2026-05-22-specifix-onboarding-design.md +0 -0
  110. {devague-0.9.1 → devague-0.11.0}/docs/superpowers/specs/2026-05-23-devague-spec-to-plan-design.md +0 -0
  111. {devague-0.9.1 → devague-0.11.0}/docs/superpowers/specs/2026-05-23-devague-working-backwards-design.md +0 -0
  112. {devague-0.9.1 → devague-0.11.0}/sonar-project.properties +0 -0
  113. {devague-0.9.1 → devague-0.11.0}/tests/__init__.py +0 -0
  114. {devague-0.9.1 → devague-0.11.0}/tests/test_cli_affordances.py +0 -0
  115. {devague-0.9.1 → devague-0.11.0}/tests/test_cli_chassis.py +0 -0
  116. {devague-0.9.1 → devague-0.11.0}/tests/test_cli_converge_export.py +0 -0
  117. {devague-0.9.1 → devague-0.11.0}/tests/test_cli_errors.py +0 -0
  118. {devague-0.9.1 → devague-0.11.0}/tests/test_cli_moves.py +0 -0
  119. {devague-0.9.1 → devague-0.11.0}/tests/test_cli_output.py +0 -0
  120. {devague-0.9.1 → devague-0.11.0}/tests/test_cli_paths.py +0 -0
  121. {devague-0.9.1 → devague-0.11.0}/tests/test_cli_question.py +0 -0
  122. {devague-0.9.1 → devague-0.11.0}/tests/test_cli_review.py +0 -0
  123. {devague-0.9.1 → devague-0.11.0}/tests/test_contract.py +0 -0
  124. {devague-0.9.1 → devague-0.11.0}/tests/test_convergence.py +0 -0
  125. {devague-0.9.1 → devague-0.11.0}/tests/test_frame.py +0 -0
  126. {devague-0.9.1 → devague-0.11.0}/tests/test_offline.py +0 -0
  127. {devague-0.9.1 → devague-0.11.0}/tests/test_package.py +0 -0
  128. {devague-0.9.1 → devague-0.11.0}/tests/test_plan.py +0 -0
  129. {devague-0.9.1 → devague-0.11.0}/tests/test_plan_store.py +0 -0
  130. {devague-0.9.1 → devague-0.11.0}/tests/test_render.py +0 -0
  131. {devague-0.9.1 → devague-0.11.0}/tests/test_render_plan.py +0 -0
  132. {devague-0.9.1 → devague-0.11.0}/tests/test_review_loop_integration.py +0 -0
  133. {devague-0.9.1 → devague-0.11.0}/tests/test_review_loop_invariants.py +0 -0
  134. {devague-0.9.1 → devague-0.11.0}/tests/test_spec_to_plan_skill.py +0 -0
  135. {devague-0.9.1 → devague-0.11.0}/tests/test_store.py +0 -0
  136. {devague-0.9.1 → devague-0.11.0}/tests/test_think_skill.py +0 -0
@@ -0,0 +1,241 @@
1
+ ---
2
+ name: assign-to-workforce
3
+ description: >
4
+ Fan out a converged devague plan's dependency waves to parallel agents in
5
+ isolated git worktrees, one agent per task per wave, with TDD-gated merges
6
+ by the main agent. Human gates: the exported spec, the implementation split
7
+ plan (task map + per-task agent/model proposal + go/no-go), and the final PR.
8
+ The devague CLI stays deterministic and non-orchestrating (#20) — it only
9
+ *describes* the graph via `devague plan waves`; the operator (main agent)
10
+ performs the fan-out. Use when the user says "assign to workforce",
11
+ "fan out the plan", "parallel subagents", or after /spec-to-plan exports a
12
+ plan. Authored and maintained in agentculture/devague (origin = devague);
13
+ steward pulls this skill from here and broadcasts it to the AgentCulture
14
+ mesh — it is NOT vendored from steward like the other skills here.
15
+ ---
16
+
17
+ # assign-to-workforce — fan out a converged plan's waves to parallel agents
18
+
19
+ The skill is named **`assign-to-workforce`**; the product/CLI it reads is the
20
+ **`devague plan waves`** command. (The prior leg — turning a spec into a plan —
21
+ is the sibling **`/spec-to-plan`** skill.)
22
+
23
+ `assign-to-workforce` takes a **converged devague plan** and fans out its
24
+ dependency waves to parallel agents (subagents, teammate agents, or generalist
25
+ agents) — one agent per task per wave — each working in an **isolated git
26
+ worktree**. The main agent merges each completed worktree gated by TDD. The
27
+ human owns exactly three gates: the exported spec, the implementation split
28
+ plan, and the final PR.
29
+
30
+ The devague CLI is **never orchestrated by devague itself** — `devague plan
31
+ waves` describes the dependency graph (#20); it does not spawn agents, manage
32
+ worktrees, mark tasks done, or pick a backend. The fan-out is the *operator's*
33
+ job — this skill and the main agent perform it.
34
+
35
+ ## How to run
36
+
37
+ The entry point is `scripts/assign-to-workforce.sh`. Invoke it from the
38
+ repository whose plan you are implementing (plans persist under `.devague/`
39
+ in the current directory):
40
+
41
+ ```bash
42
+ bash .claude/skills/assign-to-workforce/scripts/assign-to-workforce.sh split-plan [--plan <slug>]
43
+ bash .claude/skills/assign-to-workforce/scripts/assign-to-workforce.sh waves [--plan <slug>] [--json]
44
+ bash .claude/skills/assign-to-workforce/scripts/assign-to-workforce.sh help
45
+ ```
46
+
47
+ It resolves the CLI portably — an installed `devague` on `PATH` (the normal
48
+ case), falling back to `uv run devague` when you are inside the devague
49
+ checkout, else an install hint. The `split-plan` subcommand reads
50
+ `devague plan waves --json` and renders the human-facing implementation split
51
+ plan: task map, proposed per-task agent + model assignment, and the go/no-go
52
+ question. The `waves` subcommand forwards to `devague plan waves` verbatim.
53
+
54
+ ### Usage
55
+
56
+ | Subcommand | What it does |
57
+ |------------|--------------|
58
+ | `split-plan [--plan S]` | Read `devague plan waves` and print the implementation split plan — task map with per-task agent + model proposal — ready for human go/no-go review. |
59
+ | `waves [--plan S] [--json]` | Forward to `devague plan waves [--json]`. Read-only; lists wave batches. On a converged plan exits 0 listing the waves. |
60
+ | `help` | Print usage. |
61
+
62
+ ## The full flow
63
+
64
+ The flow has three human gates and one automated TDD merge loop.
65
+
66
+ ### Human gate 1 — the exported spec
67
+
68
+ The plan is seeded from a converged frame (`devague plan new --frame <slug>`).
69
+ The human reviewed and approved the spec when it was exported by the `/think`
70
+ skill. No re-approval needed here — the spec gate is already closed.
71
+
72
+ ### Human gate 2 — the implementation split plan
73
+
74
+ Before any task is assigned, the main agent presents the **implementation split
75
+ plan** for human go/no-go. This is the only gate the human owns at the
76
+ implementation stage (per task, the TDD gate is the main agent's).
77
+
78
+ The split plan contains:
79
+
80
+ 1. **Task map** — every task id, its one-line summary, acceptance criteria, and
81
+ the wave it belongs to (from `devague plan waves`).
82
+ 2. **Per-task agent + model proposal** — for each task: the proposed agent type
83
+ (subagent / teammate / generalist), the proposed model (e.g. a cheaper/faster
84
+ model for a well-scoped task), and the scope justification (why this task is
85
+ safe to delegate).
86
+ 3. **Go/no-go question** — explicit human decision: "Approve this split and
87
+ assign the plan to the workforce, or edit it first?"
88
+
89
+ The human may edit any row (agent type, model, scope) before approving. The
90
+ plan is model-agnostic — devague does not pick a backend (#20).
91
+
92
+ Run `split-plan` to print the proposed table:
93
+
94
+ ```bash
95
+ bash .claude/skills/assign-to-workforce/scripts/assign-to-workforce.sh split-plan
96
+ ```
97
+
98
+ Do not proceed to fan-out until the human approves the split plan.
99
+
100
+ ### Fan-out — one agent per task per wave in isolated worktrees
101
+
102
+ Once the human approves, the main agent fans out each wave in order:
103
+
104
+ 1. **Create an isolated git worktree** for each task in the current wave:
105
+
106
+ ```bash
107
+ git worktree add ../worktrees/agent-<task-id> -b agent/<task-id>
108
+ ```
109
+
110
+ 2. **Spawn a task agent** inside that worktree (using the approved model from
111
+ the split plan), with:
112
+ - The task id, summary, and acceptance criteria as its brief.
113
+ - Instruction to work **test-first** (TDD): write the failing test(s) that
114
+ match the acceptance criteria before implementing.
115
+ - Instruction to commit its work to the worktree branch.
116
+
117
+ 3. **Same-wave tasks run in parallel** (within-wave tasks have no
118
+ inter-task dependency; the dependency graph guarantees this). Same-file
119
+ overlap surfaces as a merge conflict at reconcile time, not a live race —
120
+ isolated worktrees prevent clobbering.
121
+
122
+ 4. **Wait for all tasks in the wave to complete** before starting the next wave.
123
+
124
+ ### TDD-gated merge — main agent, no human per task
125
+
126
+ For each completed task worktree, the main agent:
127
+
128
+ 1. **Runs the task's tests before merge** (on the main branch): baseline must
129
+ pass (or the relevant tests must be absent — the task adds them).
130
+ 2. **Merges the worktree branch** into the main branch:
131
+
132
+ ```bash
133
+ git merge --no-ff agent/<task-id>
134
+ ```
135
+
136
+ 3. **Runs the task's tests after merge**: they must pass. If they do not, the
137
+ merge is reverted and the task agent is given the failure output to fix.
138
+ 4. **Removes the worktree** once the merge is accepted:
139
+
140
+ ```bash
141
+ git worktree remove ../worktrees/agent-<task-id>
142
+ ```
143
+
144
+ The human does **not** review individual task merges. Per-task acceptance is
145
+ the main agent's responsibility — the TDD gate (tests pass before AND after
146
+ merge) plus the task's acceptance criteria. This mirrors the non-authoritative
147
+ working state pattern of the Human Review Loop (#17): per-task merge records
148
+ are uncommitted working state; the authoritative human gate is the final PR.
149
+
150
+ Advance to the next wave only after all tasks in the current wave are merged
151
+ and their tests pass.
152
+
153
+ ### Human gate 3 — the final PR
154
+
155
+ Once all waves are merged and the full test suite passes, the main agent opens
156
+ a PR via the `cicd` skill (`agex pr open`). The human reviews and merges. This
157
+ is the last and only remaining human gate.
158
+
159
+ ## Hard rules (do not violate)
160
+
161
+ These protect the human-gate contract and the TDD guarantee.
162
+
163
+ - **Present the split plan before any fan-out.** Never spawn a task agent
164
+ without prior human approval of the implementation split plan (gate 2). The
165
+ split plan is the human's only implementation-stage decision.
166
+ - **One worktree per task.** Never run two tasks in the same worktree — file
167
+ contention is managed by isolation, not by trust in the dependency graph.
168
+ The dependency graph guarantees *logical* independence within a wave, not
169
+ *file* disjointness. Conflicts surface at merge time.
170
+ - **Tests before AND after merge — no exceptions.** The TDD gate must pass on
171
+ both sides. A merge that makes tests pass only after (not before) means the
172
+ baseline was already broken — fix the baseline first.
173
+ - **Human does not gate per-task merges.** The TDD contract replaces the
174
+ human here. Do not pause for human approval between wave tasks.
175
+ - **devague CLI is not orchestrated.** `devague plan waves` is read-only
176
+ scheduling metadata (#20). Never run `devague plan` commands inside a task
177
+ worktree to "mark a task done" or modify plan state from a subagent.
178
+ - **Three gates only.** The human's gates are: (1) the exported spec, (2) the
179
+ implementation split plan, (3) the final PR. No silent fourth gate.
180
+ - **No LLM calls in the devague CLI.** The CLI is deterministic. This skill
181
+ adds orchestration convention, not CLI behavior.
182
+
183
+ ## Output contract
184
+
185
+ The `split-plan` subcommand prints to **stdout** and exits 0 when a converged
186
+ plan is found. On error (no plan, cyclic graph) it exits non-zero with a
187
+ `hint:` line on stderr. The `waves` subcommand forwards the CLI's own output
188
+ contract (stdout, `--json` for structured output, exit 0 on success).
189
+
190
+ ## Worked example
191
+
192
+ Picking up after `/spec-to-plan` exported a plan for the frame `my-feature`:
193
+
194
+ ```bash
195
+ a() { bash .claude/skills/assign-to-workforce/scripts/assign-to-workforce.sh "$@"; }
196
+
197
+ # 1. Inspect the waves
198
+ a waves
199
+
200
+ # 2. Present the implementation split plan for human review
201
+ a split-plan
202
+
203
+ # --- HUMAN: review the table, edit agent/model assignments if needed,
204
+ # then say "approved" to proceed ---
205
+
206
+ # 3. Fan out wave 1 (t1, t2, t3 are independent — run in parallel)
207
+ git worktree add ../worktrees/agent-t1 -b agent/t1
208
+ git worktree add ../worktrees/agent-t2 -b agent/t2
209
+ git worktree add ../worktrees/agent-t3 -b agent/t3
210
+ # ... spawn task agents in each worktree, await completion ...
211
+
212
+ # 4. TDD-gated merge for each wave-1 task (no human per task)
213
+ git merge --no-ff agent/t1 # tests pass before + after
214
+ git worktree remove ../worktrees/agent-t1
215
+ git merge --no-ff agent/t2
216
+ git worktree remove ../worktrees/agent-t2
217
+ git merge --no-ff agent/t3
218
+ git worktree remove ../worktrees/agent-t3
219
+
220
+ # 5. Advance to wave 2 (t4 depends on t1–t3 being merged)
221
+ git worktree add ../worktrees/agent-t4 -b agent/t4
222
+ # ... spawn, await, merge with TDD gate, remove worktree ...
223
+
224
+ # 6. Open the final PR (human gate 3)
225
+ bash .claude/skills/cicd/scripts/workflow.sh open
226
+ ```
227
+
228
+ The exported plan-md from `devague plan export` is the standing brief for
229
+ each task agent — its task id, summary, acceptance criteria, and the targets
230
+ it covers are already in that file.
231
+
232
+ ## Provenance
233
+
234
+ This is a **first-party** skill — its origin is `agentculture/devague`, where
235
+ the devague agent maintains it alongside the tools it operates (dogfooding),
236
+ next to its siblings `/think` and `/spec-to-plan`. It is the *third* skill in
237
+ that outbound family, covering the implementation leg after a plan converges.
238
+ The flow runs the *opposite* direction of the vendored steward skills: steward
239
+ pulls this **from** devague and broadcasts it to the rest of the AgentCulture
240
+ mesh. The `cite, don't import` policy still holds: downstream repos copy it,
241
+ they don't symlink or depend on it. See `docs/skill-sources.md`.
@@ -0,0 +1,209 @@
1
+ #!/usr/bin/env bash
2
+ # assign-to-workforce.sh — fan out devague plan waves to parallel agents.
3
+ #
4
+ # The skill is named `assign-to-workforce`; it reads `devague plan waves`
5
+ # (scheduling metadata produced by the /spec-to-plan skill) and renders the
6
+ # implementation split plan: task map + per-task agent/model proposal + a
7
+ # go/no-go prompt for the human. The actual fan-out (worktree creation,
8
+ # spawning, TDD-gated merges) is performed by the operator/main agent once
9
+ # the human approves the split plan.
10
+ #
11
+ # The devague CLI is non-orchestrating (#20): `devague plan waves` describes
12
+ # the dependency graph; it does not spawn agents, manage worktrees, or pick
13
+ # a backend. This wrapper is the operator-facing helper.
14
+ #
15
+ # Origin: authored and maintained in agentculture/devague. steward pulls this
16
+ # skill from here and broadcasts it to the rest of the AgentCulture mesh, so
17
+ # it is written to run anywhere — portable bash, no devague-checkout assumptions.
18
+ #
19
+ # Plans persist under .devague/ in the current directory, so run from the repo
20
+ # you are implementing.
21
+
22
+ set -euo pipefail
23
+
24
+ # ── resolve the devague CLI (mesh-first, then local-dev fallback) ───────────
25
+ DEVAGUE=()
26
+ resolve_devague() {
27
+ if command -v devague >/dev/null 2>&1; then
28
+ DEVAGUE=(devague) # installed tool — the normal mesh case
29
+ return 0
30
+ fi
31
+ # Local-dev fallback: inside the devague checkout, run via uv.
32
+ local dir="$PWD"
33
+ while [ -n "$dir" ] && [ "$dir" != "/" ]; do
34
+ if [ -f "$dir/pyproject.toml" ] \
35
+ && grep -q '^name = "devague"' "$dir/pyproject.toml" 2>/dev/null; then
36
+ if command -v uv >/dev/null 2>&1; then
37
+ DEVAGUE=(uv run devague)
38
+ return 0
39
+ fi
40
+ break
41
+ fi
42
+ dir=$(dirname "$dir")
43
+ done
44
+ cat >&2 <<'EOF'
45
+ error: devague CLI not found.
46
+ hint: install it with `uv tool install devague` (or `pipx install devague`),
47
+ or run from inside the devague checkout with `uv` available.
48
+ https://github.com/agentculture/devague
49
+ EOF
50
+ return 1
51
+ }
52
+
53
+ usage() {
54
+ cat <<'EOF'
55
+ assign-to-workforce.sh — fan out devague plan waves to parallel agents.
56
+
57
+ Usage:
58
+ assign-to-workforce.sh split-plan [--plan <slug>] print the implementation split plan
59
+ assign-to-workforce.sh waves [--plan <slug>] [--json] list dependency waves
60
+ assign-to-workforce.sh help this help
61
+
62
+ Commands:
63
+ split-plan Read `devague plan waves --json` and render the human-facing
64
+ implementation split plan: task map + per-task agent/model
65
+ proposal + go/no-go. Present this to the human before any
66
+ fan-out; do not proceed without approval.
67
+ waves Forward `devague plan waves` (and any extra flags) verbatim.
68
+ On a converged plan exits 0 and lists the dependency waves.
69
+
70
+ Plans persist under .devague/ in the current directory — run from the repo
71
+ you are implementing. Results go to stdout, diagnostics to stderr.
72
+
73
+ Human gates (three only):
74
+ 1. The exported spec (already closed by the /think leg).
75
+ 2. This implementation split plan (go/no-go to assign to workforce).
76
+ 3. The final PR (opened by the main agent via `cicd` / `agex pr open`).
77
+
78
+ The devague CLI is non-orchestrating (#20): `devague plan waves` describes
79
+ the graph; the operator performs the fan-out. One worktree per task; TDD
80
+ gates every merge (tests pass before AND after merge); no human per task.
81
+ EOF
82
+ }
83
+
84
+ # ── split-plan: render the implementation split plan for human review ────────
85
+ cmd_split_plan() {
86
+ local extra_args=()
87
+ # Forward any --plan flag so waves targets the right plan.
88
+ while [ $# -gt 0 ]; do
89
+ extra_args+=("$1")
90
+ shift
91
+ done
92
+
93
+ local waves_json tmp_err waves_rc old_exit_trap
94
+ tmp_err="$(mktemp)"
95
+ # Clean up the temp file on any exit path — including a signal between its
96
+ # creation and the explicit removal below — WITHOUT permanently changing the
97
+ # script's process-global EXIT handling: capture any prior EXIT trap, install
98
+ # ours, then restore it once the file is safely gone (#30; PR #31 review).
99
+ old_exit_trap="$(trap -p EXIT)"
100
+ trap 'rm -f "$tmp_err"' EXIT
101
+ set +e
102
+ waves_json="$("${DEVAGUE[@]}" plan waves --json "${extra_args[@]}" 2>"$tmp_err")"
103
+ waves_rc=$?
104
+ set -e
105
+ local waves_err
106
+ waves_err="$(cat "$tmp_err")"
107
+ rm -f "$tmp_err"
108
+ trap - EXIT
109
+ eval "${old_exit_trap}" # empty string is a no-op; re-installs a prior trap if any
110
+
111
+ if [ "$waves_rc" -ne 0 ]; then
112
+ printf '%s\n' "$waves_err" >&2
113
+ return "$waves_rc"
114
+ fi
115
+
116
+ DEVAGUE_WAVES_JSON="$waves_json" python3 - <<'PY'
117
+ import json
118
+ import os
119
+ import sys
120
+
121
+ raw = os.environ.get("DEVAGUE_WAVES_JSON", "").strip()
122
+ if not raw:
123
+ print("error: no waves output from devague plan waves", file=sys.stderr)
124
+ print("hint: ensure a converged plan exists (devague plan converge)", file=sys.stderr)
125
+ sys.exit(1)
126
+
127
+ try:
128
+ data = json.loads(raw)
129
+ except json.JSONDecodeError as exc:
130
+ print(f"error: could not parse waves JSON: {exc}", file=sys.stderr)
131
+ sys.exit(1)
132
+
133
+ plan_slug = data.get("plan", "(unknown)")
134
+ waves = data.get("waves") or []
135
+
136
+ print(f"Implementation split plan — plan: {plan_slug}")
137
+ print()
138
+ print("Dependency waves (from `devague plan waves`):")
139
+ for i, wave in enumerate(waves, 1):
140
+ tasks = ", ".join(wave)
141
+ print(f" Wave {i}: [{tasks}]")
142
+
143
+ print()
144
+ print("Task assignments (proposed — edit before approving):")
145
+ print()
146
+
147
+ headers = ("Task", "Wave", "Summary", "Agent type", "Model", "Scope note")
148
+ rows = []
149
+ for i, wave in enumerate(waves, 1):
150
+ for task_id in wave:
151
+ rows.append((
152
+ task_id,
153
+ str(i),
154
+ "(see plan export for summary + acceptance criteria)",
155
+ "subagent",
156
+ "cheaper/faster",
157
+ "TDD-scoped task; isolated worktree; tests gate merge",
158
+ ))
159
+
160
+ col_widths = [max(len(h), max((len(r[j]) for r in rows), default=0))
161
+ for j, h in enumerate(headers)]
162
+
163
+ def row_str(cells):
164
+ return "| " + " | ".join(c.ljust(w) for c, w in zip(cells, col_widths)) + " |"
165
+
166
+ sep = "| " + " | ".join("-" * w for w in col_widths) + " |"
167
+ print(row_str(headers))
168
+ print(sep)
169
+ for row in rows:
170
+ print(row_str(row))
171
+
172
+ print()
173
+ print("Go/no-go: review the table above, edit agent type / model / scope as needed,")
174
+ print("then confirm: \"Approved — assign to workforce\" or \"Edit first\".")
175
+ print()
176
+ print("Once approved, fan out wave by wave:")
177
+ print(" 1. Create one git worktree per task in the wave.")
178
+ print(" 2. Spawn a task agent per worktree (brief = task summary + acceptance criteria).")
179
+ print(" 3. Await all tasks in the wave; then TDD-gate each merge (tests before + after).")
180
+ print(" 4. Advance to the next wave.")
181
+ print(" 5. Open the final PR (human gate 3) after all waves merge and tests pass.")
182
+ PY
183
+ }
184
+
185
+ main() {
186
+ case "${1:-help}" in
187
+ help | -h | --help)
188
+ usage
189
+ return 0
190
+ ;;
191
+ split-plan)
192
+ shift
193
+ resolve_devague
194
+ cmd_split_plan "$@"
195
+ ;;
196
+ waves)
197
+ shift
198
+ resolve_devague
199
+ exec "${DEVAGUE[@]}" plan waves "$@"
200
+ ;;
201
+ *)
202
+ printf 'error: unknown subcommand: %s\n' "$1" >&2
203
+ printf 'hint: run `assign-to-workforce.sh help` for usage\n' >&2
204
+ return 1
205
+ ;;
206
+ esac
207
+ }
208
+
209
+ main "$@"
@@ -41,8 +41,9 @@ bash .claude/skills/spec-to-plan/scripts/spec-to-plan.sh status
41
41
 
42
42
  It resolves the CLI portably — an installed `devague` on `PATH` (the normal
43
43
  case), falling back to `uv run devague` inside the devague checkout, else an
44
- install hint. Every move except `status` is forwarded verbatim as `devague plan
45
- <move>`, so you can equally call the CLI directly (`devague plan <move> …`).
44
+ install hint. Every move including `status` is forwarded verbatim as
45
+ `devague plan <move>`, so you can equally call the CLI directly
46
+ (`devague plan <move> …`).
46
47
 
47
48
  ### Moves
48
49
 
@@ -58,17 +59,24 @@ install hint. Every move except `status` is forwarded verbatim as `devague plan
58
59
  | `converge` | Evaluate the gate against the **live** source frame; list remaining gaps. |
59
60
  | `export` | Write the buildable plan to `docs/plans/` — only after `converge` passes. |
60
61
  | `waves` | Emit deterministic dependency waves (`{plan, waves}`) — scheduling metadata only, *not* orchestration. Read-only, works on an in-progress plan; refuses a cyclic/dangling graph. Devague describes the graph; an operator decides how to run it (#20). |
62
+ | `status` | Read-only: where the plan stands + the recommended next move, re-checked against the live frame (`--json` too). |
61
63
  | `show` / `list` | Render a plan / list plans (`--json` for raw state). |
62
64
  | `learn` / `explain <move>` | Teach the method / explain one move. |
63
65
 
64
66
  Risk kinds (shared with the frame engine): `unknown_nonblocking`,
65
67
  `unknown_blocking`, `out_of_scope`, `follow_up`.
66
68
 
67
- ### `status` — the next-move helper
69
+ ### `status` — the next-move verb
68
70
 
69
- `status` is a wrapper-only verb. It reads `devague plan converge --json` +
70
- `devague plan list --json` and prints where the current plan stands, the
71
- remaining gaps, and the recommended next move derived from the first gap.
71
+ `status` is a first-class, **read-only** CLI verb (`devague plan status`,
72
+ internalised from this wrapper in 0.11.0 issue
73
+ [#30](https://github.com/agentculture/devague/issues/30)). It composes
74
+ `devague plan list` + `devague plan converge` and prints where the current plan
75
+ stands, the remaining gaps, and the recommended next move derived from the first
76
+ gap. Like `converge`/`export` it re-checks the **live** source frame (so frame
77
+ drift surfaces as an error), but it never mutates state. Pass `--json` for the
78
+ structured payload (`{plan, total, ready_for_plan, blockers, warnings,
79
+ parked_items, required_next_moves}`).
72
80
 
73
81
  ```text
74
82
  plan: my-feature (1 plan total)
@@ -104,6 +112,77 @@ These are the point of the method — convergence must mean something.
104
112
  frame every time. If the frame was deleted or has regressed below convergence,
105
113
  they refuse — re-converge the spec (in `/think`) first.
106
114
 
115
+ ## Coaching toward small, file-disjoint, TDD-gated tasks
116
+
117
+ When authoring a plan that will be built via parallel execution (fanned out to
118
+ multiple agents via the downstream `/assign-to-workforce` skill), prefer the
119
+ following discipline to maximize parallelism and minimize merge friction:
120
+
121
+ ### Small and crisply scoped
122
+
123
+ Each task should be **small enough for a simpler or cheaper model to build
124
+ test-first** without re-deriving the full design. If a task spans multiple files
125
+ or architectural layers, split it — narrow scope forces you to write sharp
126
+ acceptance criteria and keeps waves wide.
127
+
128
+ ### File disjoint
129
+
130
+ **Prefer tasks that touch non-overlapping files.** When two same-wave tasks
131
+ modify the same file, merge collision becomes inevitable. The dependency graph
132
+ alone *does not* guarantee file disjointness — it only sequences task *content*
133
+ dependencies; same-wave tasks with overlapping file-writes must be split across
134
+ waves or given explicit dependencies.
135
+
136
+ Check `devague plan waves` output: if a wave is wide but all tasks touch
137
+ `src/core.py`, the wave is *formally* parallel but *operationally* serialized at
138
+ merge. Reorder task boundaries so wide waves operate on disjoint file sets.
139
+
140
+ ### TDD acceptance criteria on every task
141
+
142
+ Every confirmed task must carry **at least one acceptance criterion**, phrased as
143
+ a testable condition (not a vague outcome). For example:
144
+
145
+ - Bad: "Implement the parser"
146
+ - Better: "Parser accepts a valid spec file and rejects malformed YAML without
147
+ data loss"
148
+
149
+ Acceptance criteria are **the contract** between the main agent (who merges) and
150
+ the subagent (who builds). A test suite derived from these criteria validates
151
+ each task's output *before* merge, independent of model capability. This is not
152
+ optional: `devague plan converge` warns (non-blocking) when a confirmed task
153
+ lacks criteria.
154
+
155
+ ### The key invariant: parallel = serial
156
+
157
+ **A plan built in parallel must yield identical results to building it serially.**
158
+ This is guaranteed only if:
159
+
160
+ 1. Same-wave tasks have no inter-task dependencies (checked by `waves`).
161
+ 2. Same-wave tasks touch disjoint files (you must verify; the CLI does not).
162
+ 3. Each task's acceptance criteria are sharp enough that a subagent's output
163
+ passes them independent of whether it was built in isolation or alongside
164
+ other tasks.
165
+
166
+ The TDD gate — tests pass before *and* after the merge — is the main agent's
167
+ proof that parallelism didn't break correctness.
168
+
169
+ ### How to route tasks to the workforce
170
+
171
+ Once your plan converges, `devague plan waves` emits the dependency-graph as
172
+ **scheduling metadata** (ordered batches of task IDs). This feeds directly into
173
+ the `/assign-to-workforce` skill, which:
174
+
175
+ 1. Displays the plan, waves, and suggested per-task subagent/model pairing.
176
+ 2. Waits for the human to approve the implementation split plan (or edit
177
+ assignments).
178
+ 3. Fans out approved waves to isolated subagent worktrees (one per task per
179
+ wave).
180
+ 4. Returns control to the main agent, which TDD-gates each merge before moving
181
+ to the next wave.
182
+
183
+ Plan for workforce execution early: narrow task scope, write crisp acceptance
184
+ criteria, and strive for wide waves with disjoint files.
185
+
107
186
  ## Output contract
108
187
 
109
188
  Results go to **stdout**, diagnostics and errors to **stderr** — a strict split