ww-agentic-workflows 1.0.0.dev3__py3-none-any.whl

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 (167) hide show
  1. ww/__init__.py +18 -0
  2. ww/_bundled_extensions/ww/git/extension.py +1728 -0
  3. ww/action_execution.py +887 -0
  4. ww/actions/__init__.py +94 -0
  5. ww/actions/command.py +444 -0
  6. ww/actions/contracts.py +699 -0
  7. ww/actions/extension.py +197 -0
  8. ww/actions/mcp.py +84 -0
  9. ww/actions/prompt.py +74 -0
  10. ww/actions/skill.py +62 -0
  11. ww/actions/slash_command.py +63 -0
  12. ww/agents.py +151 -0
  13. ww/amendments.py +54 -0
  14. ww/artifacts.py +93 -0
  15. ww/assessments.py +181 -0
  16. ww/assets/__init__.py +2 -0
  17. ww/assets/agent_instructions.md +49 -0
  18. ww/assets/docs/examples.md +879 -0
  19. ww/assets/docs/features.md +4639 -0
  20. ww/assets/docs/specification.md +1876 -0
  21. ww/assets/noww_skill.md +11 -0
  22. ww/assets/workflows/catchall.yaml +26 -0
  23. ww/assets/workflows/onboarding.yaml +586 -0
  24. ww/assets/workflows/scriptize.yaml +130 -0
  25. ww/assets/ww-automate_skill.md +23 -0
  26. ww/assets/ww-deduce-feedback_skill.md +38 -0
  27. ww/assets/ww-feedback-rules_skill.md +48 -0
  28. ww/assets/ww-learn-project_skill.md +22 -0
  29. ww/assets/ww-refresh_skill.md +26 -0
  30. ww/assets/ww-rule_skill.md +83 -0
  31. ww/assets/ww-rules-from-artifacts_skill.md +22 -0
  32. ww/assets/ww-scriptize_skill.md +33 -0
  33. ww/assets/ww-setup_skill.md +94 -0
  34. ww/assets/ww-solve_skill.md +23 -0
  35. ww/assets/ww-suggest_skill.md +32 -0
  36. ww/assets/ww-wizard_skill.md +105 -0
  37. ww/assets/ww_skill.md +59 -0
  38. ww/assignments.py +283 -0
  39. ww/bootstrap.py +405 -0
  40. ww/builtin_workflows.py +215 -0
  41. ww/changes.py +225 -0
  42. ww/child_coordination.py +482 -0
  43. ww/children.py +106 -0
  44. ww/claude_permissions.py +115 -0
  45. ww/cli/__init__.py +7 -0
  46. ww/cli/__main__.py +6 -0
  47. ww/cli/audit.py +129 -0
  48. ww/cli/catalogs.py +131 -0
  49. ww/cli/discover.py +607 -0
  50. ww/cli/initialization.py +898 -0
  51. ww/cli/lookup.py +287 -0
  52. ww/cli/main.py +1768 -0
  53. ww/cli/parser.py +1200 -0
  54. ww/cli/prompts.py +217 -0
  55. ww/cli/updates.py +117 -0
  56. ww/completion_artifacts.py +156 -0
  57. ww/completion_inputs.py +39 -0
  58. ww/config/__init__.py +582 -0
  59. ww/config/actions.py +591 -0
  60. ww/config/composition.py +571 -0
  61. ww/config/rules.py +511 -0
  62. ww/config/steps.py +1220 -0
  63. ww/config/values.py +223 -0
  64. ww/config_files.py +191 -0
  65. ww/config_writes.py +264 -0
  66. ww/contracts.py +155 -0
  67. ww/control.py +41 -0
  68. ww/defaults.py +130 -0
  69. ww/design_docs.py +32 -0
  70. ww/discovery.py +104 -0
  71. ww/documents.py +217 -0
  72. ww/errors.py +18 -0
  73. ww/executable.py +43 -0
  74. ww/execution_models/__init__.py +64 -0
  75. ww/execution_models/construction.py +148 -0
  76. ww/execution_models/decoding.py +38 -0
  77. ww/execution_models/plan_codec.py +565 -0
  78. ww/execution_models/records.py +1206 -0
  79. ww/execution_models/runs.py +266 -0
  80. ww/extensions/__init__.py +40 -0
  81. ww/extensions/api.py +559 -0
  82. ww/extensions/registry.py +864 -0
  83. ww/extensions/store.py +78 -0
  84. ww/feedback.py +342 -0
  85. ww/handler_repairs.py +57 -0
  86. ww/hooks/__init__.py +40 -0
  87. ww/hooks/agents.py +380 -0
  88. ww/hooks/install.py +168 -0
  89. ww/hooks/notices.py +206 -0
  90. ww/hooks/records.py +209 -0
  91. ww/hooks/runtime.py +266 -0
  92. ww/hooks/transcripts.py +183 -0
  93. ww/inspect.py +896 -0
  94. ww/instructions/__init__.py +17 -0
  95. ww/instructions/builder.py +1682 -0
  96. ww/instructions/commands.py +335 -0
  97. ww/instructions/handoff.py +149 -0
  98. ww/instructions/models.py +686 -0
  99. ww/instructions/policy.py +219 -0
  100. ww/instructions/text.py +168 -0
  101. ww/interactions.py +187 -0
  102. ww/interpolation.py +37 -0
  103. ww/item_passes.py +167 -0
  104. ww/items.py +99 -0
  105. ww/locking.py +207 -0
  106. ww/metadata_publication.py +230 -0
  107. ww/onboarding.py +229 -0
  108. ww/open_work.py +236 -0
  109. ww/operations.py +193 -0
  110. ww/operator_ui/__init__.py +16 -0
  111. ww/operator_ui/page.html +351 -0
  112. ww/operator_ui/server.py +215 -0
  113. ww/operator_ui/session.py +389 -0
  114. ww/operator_ui/sheet.py +104 -0
  115. ww/operator_ui/view.py +109 -0
  116. ww/output.py +339 -0
  117. ww/output_adapters/__init__.py +12 -0
  118. ww/output_adapters/base.py +25 -0
  119. ww/output_adapters/json_adapter.py +37 -0
  120. ww/output_adapters/markdown.py +2293 -0
  121. ww/output_adapters/rule_pages.py +337 -0
  122. ww/output_adapters/terminal.py +21 -0
  123. ww/package_updates.py +167 -0
  124. ww/plan/__init__.py +38 -0
  125. ww/plan/actions.py +207 -0
  126. ww/plan/compiler.py +1492 -0
  127. ww/plan/constructs.py +456 -0
  128. ww/plan/models.py +665 -0
  129. ww/project_config.py +752 -0
  130. ww/recovery.py +401 -0
  131. ww/replanning.py +367 -0
  132. ww/results.py +77 -0
  133. ww/rule_checks.py +230 -0
  134. ww/rule_conversion.py +331 -0
  135. ww/rule_disputes.py +148 -0
  136. ww/rule_store.py +456 -0
  137. ww/rule_verification.py +714 -0
  138. ww/rule_views.py +447 -0
  139. ww/rule_writes.py +920 -0
  140. ww/run_coordination.py +158 -0
  141. ww/runtimes.py +105 -0
  142. ww/service.py +4405 -0
  143. ww/setup_apply.py +428 -0
  144. ww/step_values.py +20 -0
  145. ww/storage.py +447 -0
  146. ww/storage_adapters/__init__.py +36 -0
  147. ww/storage_adapters/base.py +540 -0
  148. ww/storage_adapters/filesystem.py +370 -0
  149. ww/storage_adapters/memory.py +195 -0
  150. ww/storage_adapters/project_metadata.py +69 -0
  151. ww/storage_adapters/task_document.py +484 -0
  152. ww/task_ids.py +114 -0
  153. ww/task_references.py +124 -0
  154. ww/transitions.py +1619 -0
  155. ww/updates.py +399 -0
  156. ww/upgrade.py +95 -0
  157. ww/validation.py +168 -0
  158. ww/variables.py +275 -0
  159. ww/workflow_config.py +854 -0
  160. ww/workflow_update.py +239 -0
  161. ww/workflow_validation.py +1260 -0
  162. ww/workspace.py +50 -0
  163. ww_agentic_workflows-1.0.0.dev3.dist-info/METADATA +690 -0
  164. ww_agentic_workflows-1.0.0.dev3.dist-info/RECORD +167 -0
  165. ww_agentic_workflows-1.0.0.dev3.dist-info/WHEEL +4 -0
  166. ww_agentic_workflows-1.0.0.dev3.dist-info/entry_points.txt +2 -0
  167. ww_agentic_workflows-1.0.0.dev3.dist-info/licenses/LICENSE +674 -0
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: noww
3
+ description: Work without ww. Use only when the user invokes /noww or asks not to use ww.
4
+ ---
5
+
6
+ # Work without ww
7
+
8
+ Do not use ww for the rest of this conversation, unless the user asks for it
9
+ again: do not run `./ww discover`, and do not start, continue, or complete a ww
10
+ task, `catchall` included. Carry out requests directly, as in a project without
11
+ ww. A ww task already in progress stays as it is; do not reset or fail it.
@@ -0,0 +1,26 @@
1
+ # SPDX-License-Identifier: GPL-3.0-or-later
2
+ #
3
+ # catchall records a change no configured workflow covers. It exists so that
4
+ # every change goes through ww, including the small ones an agent would
5
+ # otherwise just make, without adding any process to them: the agent works
6
+ # exactly as it would on a plain prompt and ww keeps the record.
7
+ workflows:
8
+ - name: catchall
9
+ description: >-
10
+ Records a change to files that no other workflow covers, adding no
11
+ process of its own.
12
+ # A plain prompt leaves the agent free to delegate; so does this.
13
+ runtime: auto
14
+ # A new request on the same task replaces an unfinished one.
15
+ restartable: true
16
+ steps:
17
+ - name: work
18
+ description: >-
19
+ This workflow only records the request; it adds no process of its
20
+ own. Carry out the request exactly as you would if the user had
21
+ asked you directly, without ww: the same judgement, tools,
22
+ subagents, skills, and project conventions. Complete the step when
23
+ the work is done, with what you changed as the artifact.
24
+ # The session that received the prompt does the work, as it would
25
+ # without ww; any subagents it uses along the way are its choice.
26
+ role: manager
@@ -0,0 +1,586 @@
1
+ # SPDX-License-Identifier: GPL-3.0-or-later
2
+ #
3
+ # ww's learning and setup workflows. They learn how the project works, into
4
+ # the one file ww keeps for its own use, and design a setup with the operator
5
+ # from it, which ww places with `setup apply`. They never interview the
6
+ # operator about who they are, their role, their team or their company: what
7
+ # the setup needs of the operator is asked as process questions, in
8
+ # conversation, and ends up in the proposal, not in a dossier. The `ww-*`
9
+ # skills start them; `ww-setup` guides through them on a first use, express
10
+ # (`ww-suggest` told to derive defaults) or not.
11
+ #
12
+ # The learning step always updates an existing file in place, so running the
13
+ # workflow again refreshes it. None of them commits: the shared file is left
14
+ # for the operator to review and commit.
15
+
16
+ documents:
17
+ - project: >-
18
+ How this project's work is organised: tooling, trackers, infrastructure,
19
+ stack, conventions and recurring pitfalls. Shared with the team.
20
+ scope: project
21
+ path: .ww/project.md
22
+ - setup_proposal: >-
23
+ The configuration fragment a ww setup workflow proposes, which ww places
24
+ with `setup apply`.
25
+ path: .ww/tasks/{{ww.task.id}}/setup-proposal.yaml
26
+
27
+ modes:
28
+ - ww-narrate: >-
29
+ The operator asked to see what ww does while it learns. Before each step,
30
+ tell them in one or two plain sentences what the step does and why; after
31
+ it, say what it found or changed and where.
32
+
33
+ workflows:
34
+ - name: ww-learn-project
35
+ description: >-
36
+ Learns the repository (purpose, stack, verify commands, CI, review and
37
+ release process, conventions, pitfalls) into project.md.
38
+ runtime: single
39
+ restartable: true
40
+ role: manager
41
+ recommended_next_workflow: ww-suggest
42
+ steps:
43
+ - name: scan
44
+ description: >-
45
+ Learn the repository in {{ww.task.workspace_dir}}: what it is for,
46
+ in a sentence or two, and above all how its work is organised. Read
47
+ only; change no file. If {{ww.documents.project}} exists, read it
48
+ first: what it records is the project learning to refresh, so look
49
+ again only at what may have changed and keep the rest. First run
50
+ `{{ww.executable}} inspect` there and take its facts as the base, each with the evidence it names or "not found": the default
51
+ and integration branch, the branch patterns, merge or rebase and the
52
+ pull request signals; activity and team shape; the fix share and the
53
+ paths fixes touch; the manifests and their verify commands, each an
54
+ exact argument list such as `npm run lint`; the tracker key prefixes
55
+ with the candidate `task_format`; and the commit convention with the
56
+ candidate `commit_format`. Spend your own reading only on what
57
+ inspect cannot see, naming the file or command for each fact you
58
+ add: how and where commands run, on the host or through a wrapper
59
+ (a container exec such as `docker compose exec app`, a virtual
60
+ environment, a task runner), with the wrapper as an exact argument
61
+ list, and whether each worktree gets its own environment, from the
62
+ Makefile or task runner, the compose and devcontainer files, the CI
63
+ jobs and the agent instructions; what agents are allowed or
64
+ forbidden to do, from the content of
65
+ AGENTS.md, CLAUDE.md and cursor rules; what the pull request template
66
+ and CODEOWNERS demand; the process sections of the README and
67
+ CONTRIBUTING, such as reviews, releases and versioning; the gates the
68
+ CI files enforce; the workflows and conventions already in use,
69
+ including an existing ww setup (`ww.yaml`, `ww-setup.yaml`); and a verify command a document names that no
70
+ manifest does. Then, briefly, the agent tooling (MCP servers and
71
+ agent settings in .mcp.json, .claude/, .codex/, .cursor/, .gemini/,
72
+ skills and commands) and the stack (languages, frameworks, package
73
+ managers, containers, deployment). If {{ww.documents.project}}
74
+ exists, note what it says that no longer matches. The artifact is
75
+ the inspect profile, then the setup facts with what you added, then
76
+ the other findings.
77
+ - name: history
78
+ description: >-
79
+ Find the mistakes that come back. Read only. Start from the Fixes
80
+ section of the inspect profile: the fix share, the paths fixes touch
81
+ and the recent fix subjects. Read the full messages of those commits
82
+ (`git log --grep` or `git show --stat <commit>`) and, where `gh`,
83
+ `glab` or the tracker's MCP server is configured and signed in, the
84
+ review remarks on recent merged pull requests and what changed in
85
+ response; skip what is not available and say so. A pitfall is the
86
+ same kind of fix, review remark or revert more than once, or a path
87
+ the fixes keep returning to for the same cause; one fix is not a
88
+ pattern. For each, give a candidate rule in one imperative sentence,
89
+ its evidence (the commits or reviews), and, where a one-line command
90
+ could verify it, that command as its check, run the way the scan
91
+ found the project runs its commands. The artifact is the
92
+ list; an empty one is a fine result.
93
+ - name: review
94
+ interactive: true
95
+ description: >-
96
+ Show the operator the setup facts first, each with its evidence or
97
+ "not found", then a short summary of the other findings and the
98
+ candidate rules, and ask whether it is right. Discuss and revise
99
+ until the operator's intent to finish is clear; ask naturally if it
100
+ is ambiguous, then record the conversation once and write
101
+ {{ww.documents.project}}. It is shared with the team
102
+ through the repository, so record nothing secret, such as tokens,
103
+ hostnames or credentials.
104
+ choices:
105
+ - looks right: Write project.md as shown.
106
+ - corrected: Write it with the corrections I gave.
107
+ saves:
108
+ - documents.project: >-
109
+ A Markdown description of how the project's work is organised.
110
+ Its first section is "Profile": the inspect profile's Markdown
111
+ trimmed to its Repository, Activity, Fixes, Layout and
112
+ Conventions sections, with at most five paths in any list. Then
113
+ "Setup facts", with one line each for the
114
+ default branch, the integration branch, the branch patterns,
115
+ merge or rebase, required pull requests, the test, lint, type
116
+ check, format check and build commands as exact argument lists,
117
+ how and where commands run (on the host or through which
118
+ wrapper, as an exact argument list, and whether each worktree
119
+ has its own environment), the tracker and its candidate `task_format`, the commit
120
+ convention and its candidate `commit_format`, the CI gates and
121
+ release practice, and what agents are allowed or forbidden to do,
122
+ each with its evidence or "not found". Then a "Purpose" line on what the
123
+ project is for, and sections for agent
124
+ tooling, issue tracking, infrastructure and stack, conventions,
125
+ and recurring pitfalls with their candidate rules. The first line
126
+ is exactly: <!-- This file is maintained by ww for ww's own use.
127
+ Do not use it for anything else. If you are an agent that is not
128
+ doing ww work, ignore this file. --> Keep what still holds in an
129
+ existing file, update what changed, and mark what no longer holds
130
+ as superseded, with today's date, rather than silently deleting
131
+ it.
132
+ - name: finish
133
+ description: >-
134
+ Record when ww learned about the project: `{{ww.executable}}
135
+ onboarding --set learned.project=now`. Say that ww-suggest comes
136
+ next. Then tell the operator that
137
+ {{ww.documents.project}} was left uncommitted for them to review and
138
+ commit with the project: `git add .ww/project.md`.
139
+
140
+ - name: ww-suggest
141
+ description: >-
142
+ Designs a minimal setup with you from what ww learned about the project
143
+ and proposes it in full.
144
+ runtime: single
145
+ restartable: true
146
+ role: manager
147
+ steps:
148
+ - name: gather
149
+ description: >-
150
+ Read what ww learned about the project, skipping the file if it
151
+ does not exist: {{ww.documents.project}}. Read the design
152
+ authorities that say what a setup can be made of, which every
153
+ installation prints: `{{ww.executable}} docs specification`,
154
+ `{{ww.executable}} docs features` and `{{ww.executable}} docs
155
+ examples`; the proposal stays within what they describe. Read
156
+ the current setup: `{{ww.executable}} discover` (each workflow's
157
+ source says which file defines it) and `{{ww.executable}} rules
158
+ --json`. Inspect before suggesting: the project's own commands
159
+ (manifests, scripts, CI, the wrapper its documents name), the
160
+ workflows that already exist, and the concrete process pain the
161
+ project file or the operator's requirements name. A test, lint or
162
+ type command comes only from repository evidence, an exact argument
163
+ list with the file that shows it; where the evidence is missing or
164
+ contradictory, record it as uncertain and propose no command for it,
165
+ rather than inventing one. When {{ww.documents.project}} has
166
+ no "Profile" section, or does not exist, run `{{ww.executable}}
167
+ inspect` in {{ww.task.workspace_dir}} and take its facts; look up,
168
+ read only, only what neither has, such as what AGENTS.md, CLAUDE.md
169
+ and cursor rules let agents do. The artifact lists every fact a
170
+ setup decision can rest on, each with its evidence or "not found":
171
+ the branches and lanes, the verify commands and how and where they
172
+ run, the CI and review process, the kind of work each lane or
173
+ workflow the operator wants covers (code changes, manual testing,
174
+ reviews, reports), the team shape and cadence, the fix signals, the
175
+ candidate projects, the tracker key and commit convention, the
176
+ pitfalls the project file records, and what is already configured.
177
+ If {{ww.documents.project}} does not exist, tell the operator that
178
+ the proposal will be weaker without it and that the next step offers
179
+ to learn first; they may prefer to go on; say that the suggestions
180
+ then rest on the checkout alone. State whether the
181
+ requirements ask for an express setup.
182
+ - name: process
183
+ interactive: true
184
+ description: >-
185
+ Ask the operator about their process, a few questions that shape the
186
+ setup, in one message, numbered, each one plain sentence. Never ask
187
+ about who they are, their role, their team or their company; ask
188
+ only about the work. Skip what the gathered facts already answer,
189
+ saying so in a clause ("the project file records that reviews happen
190
+ in pull requests"), and ask only what is missing: (1) what is
191
+ painful in how work goes with agents or in this project today,
192
+ taking recurring pitfalls the facts list as the starting point; (2)
193
+ what outcome would help most; (3) where they want to be involved,
194
+ such as reviewing, approving a plan or testing by hand, and where an
195
+ agent may go on alone; (4) what may run automatically without them.
196
+ If the requirements ask for an express setup, ask none of these:
197
+ state the defaults the facts support for each, and ask only a
198
+ consequential choice that the facts leave open and that changes the
199
+ setup, such as who reviews when the project shows no review process.
200
+ Ask only what the gathered facts leave unanswered and what changes
201
+ the design. End your turn and wait for the answers; "skip" is a
202
+ valid answer.
203
+ Then converse: follow up where an answer deserves it and say what it
204
+ implies for the setup. Treat clear contextual completion as
205
+ permission to finish; ask naturally if it is ambiguous, then record
206
+ the conversation once. Keep the answers for the proposal: they
207
+ decide modes, operator stops, review and automation there, and are
208
+ not written to a file of their own. They never block ordinary work.
209
+ - name: design
210
+ interactive: true
211
+ description: >-
212
+ Settle with the operator what the setup turns on, in one message:
213
+ numbered items, each one plain sentence with its default and, in a
214
+ clause, the evidence for it, so that the operator only corrects;
215
+ list the options under an item that has a few. What the profile
216
+ already answers, and what the process answers, is stated as decided,
217
+ not asked. End your turn and
218
+ wait for the answers; "skip" keeps a default. Then discuss: follow
219
+ up where an answer deserves it and revise the decisions. Treat clear
220
+ contextual completion as permission to finish; ask naturally if it
221
+ is ambiguous, then record the conversation once. Cover:
222
+ (1) the integration branch and the lanes, from the branch patterns
223
+ actually present: feature work, plus a hotfix, bugfix or release
224
+ lane only where such branches exist or the operator asks for one,
225
+ and a merge back where there is an integration branch; (2) the
226
+ verify commands and their order, from the manifests, and how they
227
+ run: on the host or through the project's wrapper, in the task's
228
+ worktree when there is one; (3) whether
229
+ agents commit, following the commit convention (yes by default), and
230
+ push (never); (4) a worktree per task: on by default when several
231
+ contributors are active and the operator works on parallel tasks,
232
+ otherwise off; (5) the task ID format, from the tracker key prefixes,
233
+ or ww's generated IDs when there are none; (6) the review, from the review process the facts show and where the
234
+ operator wants to be involved: for a solo team shape, no interactive
235
+ review by default but an agent self-review step, and for a small
236
+ team or a team, the operator keeping the review in an interactive
237
+ step by default, an agent review loop being the alternative; (7) for each workflow whose work is not
238
+ a plain code change, such as manual testing, which step features it
239
+ needs and why, as the features guide's "Designing a workflow"
240
+ section says; (8) what the process answers turn into modes, such as brief
241
+ updates or asking first, and operator stops; (9) only when the layout lists candidate
242
+ projects, `projects`: ask for the paths of the sibling
243
+ repositories, which ww never scans; (10) a rule for a hot path or a
244
+ fix-prone path, only when the Fixes section shows a repeated cause
245
+ there, naming it; (11) last, for whom the setup is: the operator
246
+ alone, in local files kept out of version control, or the team, in
247
+ files committed with the project. If ww-setup.local.yaml exists
248
+ beside ww.yaml, an earlier run set ww up for the operator alone: say
249
+ so, and that this run can share that setup or refine it. If the
250
+ gather step found {{ww.documents.project}} missing, add to the last
251
+ item the option to learn first. The artifact lists every decision
252
+ with the fact or answer it rests on. The answer to the last item is
253
+ the choice. On "learn first" this run ends; tell the operator to run
254
+ ww-learn-project, which recommends ww-suggest when it completes.
255
+ choices:
256
+ - for me: Set it up for me alone; I can share it later.
257
+ - for the team: Set it up for the team, in the shared files.
258
+ - learn first: Let ww learn the project first; nothing changes.
259
+ - not now: Stop here; nothing changes. I can come back later.
260
+ - assess: >-
261
+ Did the operator choose "for me" or "for the team" in the design
262
+ step?
263
+ - name: setup
264
+ steps:
265
+ - name: propose
266
+ interactive: true
267
+ artifact_from: design
268
+ description: >-
269
+ Draft the complete setup from the facts and the design
270
+ decisions, in the shape of the examples (`{{ww.executable}} docs
271
+ examples`, the Node project one), sized to the project:
272
+ one test script gets one lane, a handler or two and the git
273
+ settings. Write it to {{ww.documents.setup_proposal}} as a
274
+ fragment with the root keys `workflows`, `modes`, `documents`,
275
+ `handlers`, `hooks` and `rules` in ww's YAML notation, plus
276
+ `settings` for ww.json: `task_format` from the tracker's key (its
277
+ prefix with `digit`), or `explicit` when every task carries the
278
+ tracker's ID; `projects` with the paths the operator gave; under
279
+ `extensions` and `ww/git`, `base_branches` (`default` the
280
+ integration branch, `hotfix` the release branch),
281
+ `branch_name_formats` per lane, `commit_format` after the commit
282
+ convention, `separate_branch: true`, and `worktrees` with
283
+ `worktree_dir` only when chosen; under `rules`, a
284
+ `check_guidance` only when {{ww.documents.project}} records a
285
+ wrapper that commands go through, such as a container: one or two
286
+ sentences telling `ww-scriptize-rules`, which scripts rules
287
+ into checks, where each check must run (through the wrapper, on the task's worktree) and
288
+ when the host may run one. `ww-scriptize-rules` automatically
289
+ branches from `extensions.ww/git.base_branches.default` (required)
290
+ and follows the ww/git worktree settings; it needs no workflow
291
+ lane setting. Add
292
+ `limits` only on request.
293
+
294
+
295
+ Design the workflows by the features guide (`{{ww.executable}} docs
296
+ features`, "Designing a workflow") and write exact syntax by the
297
+ specification (`{{ww.executable}} docs specification`): they say
298
+ where a command belongs (an ordinary step, a reusable handler or
299
+ a hook), when items, assessments, loops and modes are warranted,
300
+ and how ww/git lifecycle handlers attach to lanes; nothing
301
+ pushes. Give each lane a workflow: investigate, implement or
302
+ fix, and the review chosen in design; `inherit` for a lane that
303
+ differs only in its base branch, a `merge-to-<integration
304
+ branch>` lane where there is one, and `recommended_next_workflow`
305
+ where lanes chain.
306
+
307
+
308
+ Every command the fragment carries, a handler's step, a hook's
309
+ `argv` or `shell`, a rule's check and a script, runs the way
310
+ the project runs its commands: ww runs it from the step's
311
+ directory, the task's worktree when worktrees are on, so write
312
+ it for that directory, through the project's wrapper where it
313
+ has one, following the `check_guidance` that `{{ww.executable}}
314
+ rules --json` shows when it is set, and never name the main
315
+ checkout's absolute path or `cd` out of it.
316
+
317
+
318
+ Keep each workflow as simple as its work allows and add a feature only
319
+ for the concrete reason the guide gives. Never redefine a
320
+ workflow ww ships (`catchall`, `ww-*`), duplicate what is
321
+ configured, or edit ww's configuration files yourself. A
322
+ workflow the project already defines is changed with
323
+ `{{ww.executable}} setup update`, not by a second definition.
324
+
325
+
326
+ For each proposed workflow, in this order: (1) state its
327
+ trigger, the result it should give and where the operator is
328
+ involved, in a few lines; (2) choose the smallest structure that
329
+ expresses them; (3) show concise YAML and a short walkthrough of
330
+ a representative task, with a failure and retry path wherever an
331
+ external effect or an automatic command is involved; (4) validate
332
+ and inspect, below, and fix the draft before asking; (5) ask to
333
+ apply it. Commands come from the repository evidence of the
334
+ gather step; show a command it could not settle as an open
335
+ question, never as a guess. Preserve every requirement the
336
+ operator stated, rather than shortening the YAML.
337
+
338
+
339
+ Validate the composed configuration and inspect what it
340
+ compiles to: `{{ww.executable}} setup apply
341
+ {{ww.documents.setup_proposal}} --for <me or team, as chosen in
342
+ design> --dry-run --inspect <the main lane> --agent <your
343
+ agent>` and fix the fragment until it passes. In the compiled
344
+ plan check that automation is ww-owned (a command runs as a
345
+ handler or hook, and no step asks the agent to run it), that
346
+ item scopes are valid, and that the operator meets only the
347
+ conversations intended. Present it section by section
348
+ (settings, handlers, workflows, hooks, modes, rules), each piece
349
+ with its evidence in one clause, such as "`hotfix` lane: 14
350
+ `hotfix/*` branches merged this year" or "`run-tests` runs `npm
351
+ test`: `package.json` scripts", then the dry run's changes. Then
352
+ walk through the main lane: its steps in order with what an agent
353
+ does at each and where ww runs checks automatically without an
354
+ agent prompt, from the fragment, in ten lines or fewer. Ask
355
+ whether to apply it; discuss and take changes, validating and
356
+ showing it again until the operator's intent to finish is clear;
357
+ ask naturally if it is ambiguous, then record the conversation
358
+ once with their pick, apply or cancel. The pick is the approval
359
+ of this exact edit: do not ask again before applying it.
360
+ choices:
361
+ - apply: Apply it as shown.
362
+ - cancel: Do not apply anything.
363
+ saves:
364
+ - documents.setup_proposal: >-
365
+ The setup fragment as the operator last saw it.
366
+ - assess: Did the operator choose "apply" in the propose step?
367
+ - name: apply
368
+ description: >-
369
+ Place the setup the operator agreed to: `{{ww.executable}} setup
370
+ apply {{ww.documents.setup_proposal}} --for <me or team, as
371
+ chosen in design> --yes`. Then run `{{ww.executable}} lint` and
372
+ show its result, and run `{{ww.executable}} plan --workflow <the
373
+ main lane> --agent <your agent>` and show the operator its first
374
+ step's page as "what an agent gets on the first task". Tell the
375
+ operator which files changed, naming
376
+ each as the output lists it. For the team, they are
377
+ ww-setup.yaml, ww.yaml and ww.json, left uncommitted: remind the
378
+ operator to review and commit them, for example `git add
379
+ ww-setup.yaml ww.yaml ww.json`. For the operator alone, they are
380
+ local files and nothing is committed; running ww-suggest again
381
+ and choosing the team offers the same setup to the team. If
382
+ `setup apply` refuses, show its message and stop; never place the
383
+ configuration another way.
384
+
385
+ - name: ww-solve
386
+ description: >-
387
+ Turns a problem you describe into proposed workflows, modes, rules or
388
+ hooks.
389
+ runtime: single
390
+ restartable: true
391
+ role: manager
392
+ steps:
393
+ - name: listen
394
+ interactive: true
395
+ description: >-
396
+ Ask the operator to describe the problem: what goes wrong, how often,
397
+ and what it costs them. Ask a few clarifying questions, one at a
398
+ time, then restate the problem in two or three sentences and ask
399
+ whether that is it.
400
+ - name: propose
401
+ interactive: true
402
+ description: >-
403
+ Read what ww learned about the project, skipping the file if it
404
+ does not exist: {{ww.documents.project}}; and the current
405
+ setup: `{{ww.executable}} discover` and `{{ww.executable}} rules
406
+ --json`. Propose the smallest change that addresses the problem: a
407
+ workflow or a step, a mode, a rule, a hook, or a setting. Let
408
+ the problem decide what it asks of the operator: what it must always
409
+ hold gets rules and checks, what can be handed over gets handoffs,
410
+ and decisions the operator keeps become operator stops or
411
+ interactive steps. Where the problem is about a kind of work, choose
412
+ the structure by the features guide (`{{ww.executable}} docs
413
+ features`, "Designing a workflow"), and write exact syntax by the
414
+ specification (`{{ww.executable}} docs specification`). Write every command it carries, a hook's `argv` or `shell`, a
415
+ rule's check or a script, for the step's directory, the task's
416
+ worktree when worktrees are on, through the project's wrapper as
417
+ {{ww.documents.project}} records it and as the `check_guidance` of
418
+ `{{ww.executable}} rules --json` says when it is set, never with
419
+ the main checkout's absolute path. Write it as a setup fragment to
420
+ {{ww.documents.setup_proposal}} (the root keys `workflows`, `modes`,
421
+ `documents`, `handlers`, `hooks`, `rules` and `settings`; rules as
422
+ literal sentences in the `rules` lists of the steps they govern). A
423
+ fragment adds definitions; to change a workflow the configuration
424
+ already defines, write the complete changed workflow alone in the
425
+ fragment (its `workflows` list holding that one entry) and apply it
426
+ with `{{ww.executable}} setup update <name> <fragment>`, which
427
+ edits the definition in force where it is written. Never
428
+ edit ww's configuration files yourself. Check the fragment with
429
+ `{{ww.executable}} setup apply {{ww.documents.setup_proposal}} --for
430
+ me --dry-run` (or `setup update <name> <fragment> --dry-run`) until
431
+ it passes. Show the operator what each piece does
432
+ and why, with the dry run's list of changes, and ask where to apply
433
+ it.
434
+ choices:
435
+ - for me: Apply it to my local setup.
436
+ - for the team: Apply it to the shared setup.
437
+ - update: Change the existing workflow where it is defined.
438
+ - cancel: Do not apply anything.
439
+ saves:
440
+ - documents.setup_proposal: >-
441
+ The setup fragment as the operator last saw it.
442
+ - assess: >-
443
+ Did the operator choose "for me", "for the team" or "update" in the
444
+ propose step?
445
+ - name: apply
446
+ description: >-
447
+ Place the change: `{{ww.executable}} setup apply
448
+ {{ww.documents.setup_proposal}} --for <me or team, as chosen> --yes`
449
+ or, for "update", `{{ww.executable}} setup update <name>
450
+ {{ww.documents.setup_proposal}} --yes`, then run `{{ww.executable}} lint` and show its result. Tell the
451
+ operator which files changed; shared ones are left uncommitted for
452
+ them to review and commit. If `setup apply` refuses, show its message
453
+ and stop; never place the configuration another way.
454
+
455
+ - name: ww-rules-from-artifacts
456
+ description: >-
457
+ Proposes rules from the lessons that recur in chosen steps' past results.
458
+ runtime: single
459
+ restartable: true
460
+ role: manager
461
+ steps:
462
+ - name: choose
463
+ interactive: true
464
+ description: >-
465
+ Run `{{ww.executable}} discover` and list the workflows and their
466
+ steps. Ask the operator which steps' results to learn from (review
467
+ and fix steps are good sources) and how many recent tasks to read;
468
+ ten is a sensible default. Offer the step names through your question
469
+ tool.
470
+ - name: read
471
+ description: >-
472
+ Find the recent tasks that ran the chosen steps: the task directories
473
+ under `.ww/tasks/` at the project root, newest first, and for each
474
+ `{{ww.executable}} artifacts <task-id>` (add `--run <run-id>` for an
475
+ earlier run). Read only the artifacts of the chosen steps. Collect
476
+ the lessons that recur in more than one task, such as the same review
477
+ finding or the same fix, and skip one-off defects. Read
478
+ `{{ww.executable}} rules --json` and drop lessons an existing rule
479
+ already covers. Read {{ww.documents.project}} where it exists, and keep each
480
+ lesson within what it says: the project's conventions decide what a
481
+ rule may demand. The artifact lists each lesson with
482
+ the tasks that show it.
483
+ - name: propose
484
+ interactive: true
485
+ description: >-
486
+ Turn each lesson into a candidate rule: one imperative sentence, with
487
+ a `paths` glob only when it is about a kind of file, and a check only
488
+ when it is an obvious one-line command, written for the step's
489
+ directory (the task's worktree when there is one) and run through
490
+ the project's wrapper as {{ww.documents.project}} records it,
491
+ following the `check_guidance` of `{{ww.executable}} rules --json`
492
+ when it is set. Choose the rule group it
493
+ belongs to from `{{ww.executable}} rules --json`, or a new group with
494
+ the workflows and steps it concerns. Show the operator all candidates
495
+ in one block, each with its group, the steps it will reach, and the
496
+ evidence, and ask which to add. Keep them few and gentle.
497
+ choices:
498
+ - add all: Add every rule shown.
499
+ - add some: Add the ones I named.
500
+ - none: Add nothing.
501
+ - assess: Did the operator choose to add any rule in the propose step?
502
+ - name: add
503
+ description: >-
504
+ Add the rules the operator accepted, only through ww's rule commands,
505
+ each checked with `--dry-run` first: a new group with
506
+ `{{ww.executable}} rules add --group <name> --dir <path> [--workflows
507
+ <name>...] [--steps <name>...]`, then each rule with
508
+ `{{ww.executable}} rules add <group> --text "<sentence>" [--paths
509
+ <glob>...]`. Never edit a rule file or ww's configuration files
510
+ yourself; report a refusal instead of working around it. Run
511
+ `{{ww.executable}} lint`, show where each rule now applies, and tell
512
+ the operator that the new rule files and ww-rules.yaml are left
513
+ uncommitted for them to review and commit.
514
+
515
+ - name: ww-automate
516
+ description: >-
517
+ Proposes a script for a step's mechanical work, and the handler that runs
518
+ it.
519
+ runtime: single
520
+ restartable: true
521
+ role: manager
522
+ steps:
523
+ - name: choose
524
+ interactive: true
525
+ description: >-
526
+ Run `{{ww.executable}} discover` and list the workflows and their
527
+ steps. Ask the operator which step to look at, offering the step
528
+ names through your blocking question tool or as a numbered list in
529
+ the chat.
530
+ - name: analyse
531
+ description: >-
532
+ Read the chosen step's instruction (`{{ww.executable}} plan
533
+ --workflow <workflow> --agent <your agent>`) and what it produced in
534
+ recent tasks (`{{ww.executable}} artifacts <task-id>` for the task
535
+ directories under `.ww/tasks/` at the project root). Decide which
536
+ parts of its work are mechanical, the same every time and needing no
537
+ judgement: running commands, collecting or reformatting data, filling
538
+ a template, checking a condition. The artifact says what could be a
539
+ script, what must stay with an agent, and whether the script would
540
+ replace the step or run beside it, by the features guide's
541
+ "Designing a workflow" section (`{{ww.executable}} docs features`). Read
542
+ {{ww.documents.project}} where it exists, and keep the proposal
543
+ within what it says: the project's conventions decide what a script
544
+ may automate.
545
+ If nothing is mechanical, say so; that is a fine result.
546
+ - name: propose
547
+ interactive: true
548
+ description: >-
549
+ If the analysis found nothing to automate, tell the operator and
550
+ offer only "cancel". Otherwise draft the script (shell or the
551
+ project's own language, small, with a clear exit status) and the
552
+ handler change as a setup fragment in
553
+ {{ww.documents.setup_proposal}}: a hook that runs it, filtered to the
554
+ workflow and step with `workflows` and `steps`, or, for a workflow
555
+ the configuration defines, that workflow with the step turned into an
556
+ `argv` or `shell` step. To change a workflow the configuration
557
+ already defines, write the complete changed workflow alone in the
558
+ fragment and place it with `setup update`, which edits the
559
+ definition in force. Never edit ww's configuration files
560
+ yourself. ww runs the script from the step's directory, the task's
561
+ worktree when worktrees are on: write it for that directory, run
562
+ the project's tools through its wrapper as
563
+ {{ww.documents.project}} records it, and never name the main
564
+ checkout's absolute path. Check the fragment with
565
+ `{{ww.executable}} setup apply {{ww.documents.setup_proposal}} --for
566
+ me --dry-run`. Show the operator the script, where it would live, and the dry run's list of
567
+ changes, and ask where to apply it.
568
+ choices:
569
+ - for me: Apply it to my local setup.
570
+ - for the team: Apply it to the shared setup.
571
+ - cancel: Do not apply anything.
572
+ saves:
573
+ - documents.setup_proposal: >-
574
+ The setup fragment as the operator last saw it.
575
+ - assess: >-
576
+ Did the operator choose "for me" or "for the team" in the propose
577
+ step?
578
+ - name: apply
579
+ description: >-
580
+ Write the script where the operator agreed, make it executable, and
581
+ run it once on a harmless input if it has one. Then place the handler
582
+ change: `{{ww.executable}} setup apply
583
+ {{ww.documents.setup_proposal}} --for <me or team, as chosen> --yes`,
584
+ and run `{{ww.executable}} lint`. Tell the operator which files
585
+ changed and that they are left uncommitted for them to review and
586
+ commit. If `setup apply` refuses, show its message and stop.