ace-assign 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/.ace-defaults/assign/catalog/composition-rules.yml +211 -0
  3. data/.ace-defaults/assign/catalog/recipes/batch-tasks.recipe.yml +44 -0
  4. data/.ace-defaults/assign/catalog/recipes/documentation.recipe.yml +35 -0
  5. data/.ace-defaults/assign/catalog/recipes/fix-and-review.recipe.yml +32 -0
  6. data/.ace-defaults/assign/catalog/recipes/implement-simple.recipe.yml +29 -0
  7. data/.ace-defaults/assign/catalog/recipes/implement-with-pr.recipe.yml +48 -0
  8. data/.ace-defaults/assign/catalog/recipes/release-only.recipe.yml +34 -0
  9. data/.ace-defaults/assign/catalog/steps/apply-feedback.step.yml +22 -0
  10. data/.ace-defaults/assign/catalog/steps/commit.step.yml +22 -0
  11. data/.ace-defaults/assign/catalog/steps/create-pr.step.yml +28 -0
  12. data/.ace-defaults/assign/catalog/steps/create-retro.step.yml +22 -0
  13. data/.ace-defaults/assign/catalog/steps/fix-tests.step.yml +22 -0
  14. data/.ace-defaults/assign/catalog/steps/lint.step.yml +22 -0
  15. data/.ace-defaults/assign/catalog/steps/mark-task-done.step.yml +57 -0
  16. data/.ace-defaults/assign/catalog/steps/onboard-base.step.yml +19 -0
  17. data/.ace-defaults/assign/catalog/steps/onboard.step.yml +19 -0
  18. data/.ace-defaults/assign/catalog/steps/plan-task.step.yml +17 -0
  19. data/.ace-defaults/assign/catalog/steps/pre-commit-review.step.yml +34 -0
  20. data/.ace-defaults/assign/catalog/steps/push-to-remote.step.yml +28 -0
  21. data/.ace-defaults/assign/catalog/steps/rebase-with-main.step.yml +28 -0
  22. data/.ace-defaults/assign/catalog/steps/reflect-and-refactor.step.yml +57 -0
  23. data/.ace-defaults/assign/catalog/steps/release-minor.step.yml +23 -0
  24. data/.ace-defaults/assign/catalog/steps/release.step.yml +23 -0
  25. data/.ace-defaults/assign/catalog/steps/reorganize-commits.step.yml +28 -0
  26. data/.ace-defaults/assign/catalog/steps/research.step.yml +19 -0
  27. data/.ace-defaults/assign/catalog/steps/review-pr.step.yml +22 -0
  28. data/.ace-defaults/assign/catalog/steps/security-audit.step.yml +22 -0
  29. data/.ace-defaults/assign/catalog/steps/split-subtree-root.step.yml +25 -0
  30. data/.ace-defaults/assign/catalog/steps/squash-changelog.step.yml +28 -0
  31. data/.ace-defaults/assign/catalog/steps/task-load.step.yml +29 -0
  32. data/.ace-defaults/assign/catalog/steps/update-docs.step.yml +38 -0
  33. data/.ace-defaults/assign/catalog/steps/update-pr-desc.step.yml +28 -0
  34. data/.ace-defaults/assign/catalog/steps/verify-e2e.step.yml +42 -0
  35. data/.ace-defaults/assign/catalog/steps/verify-test-suite.step.yml +48 -0
  36. data/.ace-defaults/assign/catalog/steps/verify-test.step.yml +36 -0
  37. data/.ace-defaults/assign/catalog/steps/work-on-task.step.yml +23 -0
  38. data/.ace-defaults/assign/config.yml +48 -0
  39. data/.ace-defaults/assign/presets/fix-bug.yml +65 -0
  40. data/.ace-defaults/assign/presets/quick-implement.yml +41 -0
  41. data/.ace-defaults/assign/presets/release-only.yml +35 -0
  42. data/.ace-defaults/assign/presets/work-on-docs.yml +41 -0
  43. data/.ace-defaults/assign/presets/work-on-task.yml +179 -0
  44. data/.ace-defaults/nav/protocols/skill-sources/ace-assign.yml +19 -0
  45. data/.ace-defaults/nav/protocols/wfi-sources/ace-assign.yml +19 -0
  46. data/CHANGELOG.md +1415 -0
  47. data/README.md +87 -0
  48. data/Rakefile +16 -0
  49. data/docs/exit-codes.md +61 -0
  50. data/docs/getting-started.md +121 -0
  51. data/docs/handbook.md +40 -0
  52. data/docs/usage.md +224 -0
  53. data/exe/ace-assign +16 -0
  54. data/handbook/guides/fork-context.g.md +231 -0
  55. data/handbook/skills/as-assign-compose/SKILL.md +24 -0
  56. data/handbook/skills/as-assign-create/SKILL.md +23 -0
  57. data/handbook/skills/as-assign-drive/SKILL.md +24 -0
  58. data/handbook/skills/as-assign-prepare/SKILL.md +23 -0
  59. data/handbook/skills/as-assign-recover-fork/SKILL.md +22 -0
  60. data/handbook/skills/as-assign-run-in-batches/SKILL.md +23 -0
  61. data/handbook/skills/as-assign-start/SKILL.md +25 -0
  62. data/handbook/workflow-instructions/assign/compose.wf.md +256 -0
  63. data/handbook/workflow-instructions/assign/create.wf.md +215 -0
  64. data/handbook/workflow-instructions/assign/drive.wf.md +666 -0
  65. data/handbook/workflow-instructions/assign/prepare.wf.md +469 -0
  66. data/handbook/workflow-instructions/assign/recover-fork.wf.md +233 -0
  67. data/handbook/workflow-instructions/assign/run-in-batches.wf.md +212 -0
  68. data/handbook/workflow-instructions/assign/start.wf.md +46 -0
  69. data/lib/ace/assign/atoms/assign_frontmatter_parser.rb +173 -0
  70. data/lib/ace/assign/atoms/catalog_loader.rb +101 -0
  71. data/lib/ace/assign/atoms/composition_rules.rb +219 -0
  72. data/lib/ace/assign/atoms/number_generator.rb +110 -0
  73. data/lib/ace/assign/atoms/preset_expander.rb +277 -0
  74. data/lib/ace/assign/atoms/step_file_parser.rb +207 -0
  75. data/lib/ace/assign/atoms/step_numbering.rb +227 -0
  76. data/lib/ace/assign/atoms/step_sorter.rb +66 -0
  77. data/lib/ace/assign/atoms/tree_formatter.rb +106 -0
  78. data/lib/ace/assign/cli/commands/add.rb +102 -0
  79. data/lib/ace/assign/cli/commands/assignment_target.rb +55 -0
  80. data/lib/ace/assign/cli/commands/create.rb +63 -0
  81. data/lib/ace/assign/cli/commands/fail.rb +43 -0
  82. data/lib/ace/assign/cli/commands/finish.rb +88 -0
  83. data/lib/ace/assign/cli/commands/fork_run.rb +229 -0
  84. data/lib/ace/assign/cli/commands/list.rb +166 -0
  85. data/lib/ace/assign/cli/commands/retry_cmd.rb +42 -0
  86. data/lib/ace/assign/cli/commands/select.rb +45 -0
  87. data/lib/ace/assign/cli/commands/start.rb +40 -0
  88. data/lib/ace/assign/cli/commands/status.rb +407 -0
  89. data/lib/ace/assign/cli.rb +144 -0
  90. data/lib/ace/assign/models/assignment.rb +107 -0
  91. data/lib/ace/assign/models/assignment_info.rb +66 -0
  92. data/lib/ace/assign/models/queue_state.rb +326 -0
  93. data/lib/ace/assign/models/step.rb +197 -0
  94. data/lib/ace/assign/molecules/assignment_discoverer.rb +57 -0
  95. data/lib/ace/assign/molecules/assignment_manager.rb +276 -0
  96. data/lib/ace/assign/molecules/fork_session_launcher.rb +102 -0
  97. data/lib/ace/assign/molecules/queue_scanner.rb +130 -0
  98. data/lib/ace/assign/molecules/skill_assign_source_resolver.rb +376 -0
  99. data/lib/ace/assign/molecules/step_renumberer.rb +227 -0
  100. data/lib/ace/assign/molecules/step_writer.rb +246 -0
  101. data/lib/ace/assign/organisms/assignment_executor.rb +1299 -0
  102. data/lib/ace/assign/version.rb +7 -0
  103. data/lib/ace/assign.rb +141 -0
  104. metadata +289 -0
@@ -0,0 +1,231 @@
1
+ ---
2
+ doc-type: guide
3
+ title: Fork Context Guide
4
+ purpose: Explain fork context execution model, boundaries, and recovery patterns for ace-assign subtree delegation.
5
+ ace-docs:
6
+ last-updated: 2026-03-18
7
+ last-checked: 2026-03-21
8
+ ---
9
+
10
+ # Fork Context Guide
11
+
12
+ ## Overview
13
+
14
+ Fork context enables step files to run in isolated agent contexts using the Task tool. When a step has `context: fork` in its frontmatter, ace-assign outputs instructions for the orchestrating agent to execute the step via a subagent.
15
+
16
+ For hierarchical split workflows, use **parent-only** fork markers:
17
+ - Split parent step: `context: fork`
18
+ - Child steps (`onboard-base`, `task-load`, `plan-task`, `work-on-task`, `verify-test`, `release-minor`): no `context: fork`
19
+ - Runtime execution scope is controlled explicitly with `--assignment <id>@<root>`
20
+
21
+ ## When to Use Fork Context
22
+
23
+ Use fork context when:
24
+
25
+ - **Isolation is needed** - The step requires a clean agent context without previous conversation state
26
+ - **Complex multi-step work** - The step involves substantial implementation that benefits from focused agent attention
27
+ - **Independent execution** - The work can proceed without real-time interaction with the orchestrator
28
+
29
+ Do **not** use fork context for:
30
+
31
+ - Simple instructions that the orchestrator can execute directly
32
+ - Steps that require continuous orchestrator oversight
33
+ - Verification steps (see Anti-patterns below)
34
+
35
+ ## Step File Structure
36
+
37
+ Fork context steps can use a rich structure with distinct sections:
38
+
39
+ ```markdown
40
+ ---
41
+ status: pending
42
+ context: fork
43
+ ---
44
+
45
+ ## Onboard
46
+
47
+ Load context before starting work:
48
+ - `ace-bundle project`
49
+ - `ace-task show {{taskref}}`
50
+
51
+ ## Work
52
+
53
+ [Main instructions for the forked agent]
54
+
55
+ Implement the feature following project conventions.
56
+ Run tests after each significant change.
57
+
58
+ ## Report
59
+
60
+ Return structured summary:
61
+ - **Task**: task ID and title
62
+ - **Status**: completed | partial | blocked
63
+ - **Changes**: files modified and what changed
64
+ - **Commits**: commit hashes and messages created
65
+ - **Issues**: problems encountered or deferred decisions
66
+ ```
67
+
68
+ ### Section Purposes
69
+
70
+ | Section | Purpose |
71
+ |---------|---------|
72
+ | **Onboard** | Context loading commands to run before work |
73
+ | **Work** | Main implementation instructions |
74
+ | **Report** | Expected output format from the forked agent |
75
+
76
+ ## Execution Flow
77
+
78
+ When `ace:assign-drive` (or manual orchestration) encounters a fork-enabled subtree:
79
+
80
+ 1. Runs `ace-assign status`
81
+ 2. Detects `Fork subtree detected (root: ...)` in output (outside fork scope)
82
+ 3. Delegates with `ace-assign fork-run --assignment <id>@<root>`
83
+ 4. Fork launcher executes `/as-assign-drive <id>@<root>` in a scoped process
84
+ 5. Scoped process advances only inside subtree
85
+ 6. Parent process resumes after subtree completion
86
+
87
+ ```
88
+ ace:assign-drive loop
89
+ |
90
+ +-- ace-assign status
91
+ +-- Detects "Fork subtree detected (root: ...)"
92
+ +-- ace-assign fork-run --assignment <id>@<root>
93
+ +-- Forked /as-assign-drive <id>@<root>
94
+ +-- Subtree completes
95
+ +-- Parent loop continues
96
+ ```
97
+
98
+ ## Context Isolation Model
99
+
100
+ Fork context provides:
101
+
102
+ - **Clean slate** - No prior conversation affecting the subagent
103
+ - **Focused task** - Single step with clear boundaries
104
+ - **Structured output** - Report format ensures consistent results
105
+
106
+ The orchestrating agent:
107
+
108
+ - Maintains workflow state
109
+ - Coordinates between steps
110
+ - Processes subagent reports
111
+ - Handles failures and retries
112
+
113
+ ## Recovery From Failed Fork Subtrees
114
+
115
+ When a forked subtree fails, use **adaptive minimal-safe replay**:
116
+
117
+ - Do not automatically replay the whole subtree.
118
+ - Replay only the minimum set of steps needed to restore context confidence.
119
+ - Always review prior subtree reports before choosing replay depth.
120
+
121
+ Typical recovery shape:
122
+
123
+ ```
124
+ failed step
125
+ -> recovery onboarding/report review
126
+ -> verify-test
127
+ -> retry failed or nearest affected step
128
+ -> resume remaining subtree steps
129
+ ```
130
+
131
+ Recovery steps are inserted between the failed step and the next pending step (or appended if the failure happened at subtree end). This keeps history intact while avoiding unnecessary rework.
132
+
133
+ ## Anti-Patterns
134
+
135
+ ### Do Not Combine Work and Verify
136
+
137
+ **Wrong:** Worker verifies its own work
138
+
139
+ ```yaml
140
+ steps:
141
+ - name: implement-and-verify
142
+ context: fork
143
+ instructions: |
144
+ Implement the feature.
145
+ Then verify it works correctly. # BAD: self-verification
146
+ ```
147
+
148
+ **Right:** Separate steps for work and verification
149
+
150
+ ```yaml
151
+ steps:
152
+ - name: implement
153
+ context: fork
154
+ instructions: |
155
+ Implement the feature.
156
+
157
+ - name: verify
158
+ # No context: fork - orchestrator runs this
159
+ instructions: |
160
+ Run ace-test to verify implementation.
161
+ ```
162
+
163
+ ### Do Not Use Fork for Simple Commands
164
+
165
+ **Wrong:** Forking for trivial work
166
+
167
+ ```yaml
168
+ steps:
169
+ - name: run-tests
170
+ context: fork
171
+ instructions: Run ace-test
172
+ ```
173
+
174
+ **Right:** Orchestrator handles simple commands directly
175
+
176
+ ```yaml
177
+ steps:
178
+ - name: run-tests
179
+ instructions: Run ace-test and report results
180
+ ```
181
+
182
+ ## Example Preset
183
+
184
+ A typical work-on-task preset with fork context:
185
+
186
+ ```yaml
187
+ name: work-on-task
188
+ description: Work on a task with forked implementation
189
+
190
+ steps:
191
+ - name: prepare
192
+ instructions:
193
+ - Load task context
194
+ - Review requirements
195
+
196
+ - name: implement
197
+ context: fork
198
+ instructions: |
199
+ ## Onboard
200
+ - ace-bundle project
201
+ - ace-task show {{taskref}}
202
+
203
+ ## Work
204
+ Implement the task following the specification.
205
+
206
+ ## Report
207
+ Return: status, changes, commits, issues
208
+
209
+ - name: verify
210
+ instructions:
211
+ - Run ace-test
212
+ - Verify all acceptance criteria
213
+ ```
214
+
215
+ ## Debugging
216
+
217
+ To see how fork steps are processed:
218
+
219
+ ```bash
220
+ # Check current step and context
221
+ ace-assign status
222
+
223
+ # Enable debug output
224
+ ACE_DEBUG=1 ace-assign status
225
+ ```
226
+
227
+ ## Related
228
+
229
+ - [ace-assign README](../../README.md) - Main documentation
230
+ - [Work Queue Model](../workflow-instructions/drive-assignment.wf.md) - Assignment management
231
+ - `ace-assign fork-run --root <step> --assignment <id>` - Prepare subtree-scoped fork session
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: as-assign-compose
3
+ description: Compose a tailored assignment from ace-assign catalog steps and composition rules (catalog-only)
4
+ # bundle: wfi://assign/compose
5
+ # agent: general-purpose
6
+ user-invocable: true
7
+ allowed-tools:
8
+ - Bash(ace-assign:*)
9
+ - Bash(ace-bundle:*)
10
+ - Glob
11
+ - Read
12
+ - Write
13
+ - AskUserQuestion
14
+ argument-hint: '"description of what you need" [--taskref value] [--taskrefs values]'
15
+ last_modified: 2026-02-13
16
+ source: ace-assign
17
+ skill:
18
+ kind: workflow
19
+ execution:
20
+ workflow: wfi://assign/compose
21
+
22
+ ---
23
+
24
+ Load and run `ace-bundle wfi://assign/compose` in the current project, then follow the loaded workflow as the source of truth and execute it end-to-end instead of only summarizing it.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: as-assign-create
3
+ description: Public assignment creation workflow (create, optionally handoff to drive with --run)
4
+ # bundle: wfi://assign/create
5
+ # agent: general-purpose
6
+ user-invocable: true
7
+ allowed-tools:
8
+ - Bash(ace-assign:*)
9
+ - Bash(ace-bundle:*)
10
+ - Read
11
+ - Write
12
+ - AskUserQuestion
13
+ argument-hint: "[instructions|preset [params] [--run]]"
14
+ last_modified: 2026-02-11
15
+ source: ace-assign
16
+ skill:
17
+ kind: workflow
18
+ execution:
19
+ workflow: wfi://assign/create
20
+
21
+ ---
22
+
23
+ Load and run `ace-bundle wfi://assign/create` in the current project, then follow the loaded workflow as the source of truth and execute it end-to-end instead of only summarizing it.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: as-assign-drive
3
+ description: Drive agent execution through an active assignment
4
+ # bundle: wfi://assign/drive
5
+ # agent: general-purpose
6
+ user-invocable: true
7
+ allowed-tools:
8
+ - Bash(ace-assign:*)
9
+ - Bash(ace-bundle:*)
10
+ - Read
11
+ - Write
12
+ - AskUserQuestion
13
+ - Skill
14
+ argument-hint: "[assignment[@scope]]"
15
+ last_modified: 2026-02-11
16
+ source: ace-assign
17
+ skill:
18
+ kind: workflow
19
+ execution:
20
+ workflow: wfi://assign/drive
21
+
22
+ ---
23
+
24
+ Load and run `ace-bundle wfi://assign/drive` in the current project, then follow the loaded workflow as the source of truth and execute it end-to-end instead of only summarizing it.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: as-assign-prepare
3
+ description: Legacy/internal helper to prepare job.yaml from preset or informal instructions
4
+ # bundle: wfi://assign/prepare
5
+ # agent: general-purpose
6
+ user-invocable: false
7
+ allowed-tools:
8
+ - Bash(ace-bundle:*)
9
+ - Glob
10
+ - Read
11
+ - Write
12
+ - AskUserQuestion
13
+ argument-hint: "[preset-name] [--taskref value | --taskrefs values] [--output path]"
14
+ last_modified: 2026-02-11
15
+ source: ace-assign
16
+ skill:
17
+ kind: workflow
18
+ execution:
19
+ workflow: wfi://assign/prepare
20
+
21
+ ---
22
+
23
+ Load and run `ace-bundle wfi://assign/prepare` in the current project, then follow the loaded workflow as the source of truth and execute it end-to-end instead of only summarizing it.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: as-assign-recover-fork
3
+ description: Recover from fork-run failures in assignment execution
4
+ user-invocable: true
5
+ allowed-tools:
6
+ - Bash(ace-assign:*)
7
+ - Bash(ace-bundle:*)
8
+ - Bash(ace-git-commit:*)
9
+ - Bash(git:*)
10
+ - Read
11
+ - Write
12
+ - AskUserQuestion
13
+ argument-hint: "<assignment-id>@<fork-root>"
14
+ source: ace-assign
15
+ skill:
16
+ kind: workflow
17
+ execution:
18
+ workflow: wfi://assign/recover-fork
19
+
20
+ ---
21
+
22
+ Load and run `ace-bundle wfi://assign/recover-fork` in the current project, then follow the loaded workflow as the source of truth and execute it end-to-end instead of only summarizing it.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: as-assign-run-in-batches
3
+ description: Create a generic repeated-item fan-out assignment from template + explicit items
4
+ # bundle: wfi://assign/run-in-batches
5
+ # agent: general-purpose
6
+ user-invocable: true
7
+ allowed-tools:
8
+ - Bash(ace-assign:*)
9
+ - Bash(ace-bundle:*)
10
+ - Read
11
+ - Write
12
+ - AskUserQuestion
13
+ argument-hint: "\"instruction template\" --items item1,item2 [--sequential] [--max-parallel N] [--run]"
14
+ last_modified: 2026-03-08
15
+ source: ace-assign
16
+ skill:
17
+ kind: workflow
18
+ execution:
19
+ workflow: wfi://assign/run-in-batches
20
+
21
+ ---
22
+
23
+ Load and run `ace-bundle wfi://assign/run-in-batches` in the current project, then follow the loaded workflow as the source of truth and execute it end-to-end instead of only summarizing it.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: as-assign-start
3
+ description: Legacy compatibility orchestration that routes assignment startup through create then drive
4
+ # bundle: wfi://assign/start
5
+ # context: no-fork
6
+ # agent: general-purpose
7
+ user-invocable: false
8
+ allowed-tools:
9
+ - Bash(ace-assign:*)
10
+ - Bash(ace-bundle:*)
11
+ - Read
12
+ - Write
13
+ - AskUserQuestion
14
+ argument-hint: "[instructions|preset [params] [--run]]"
15
+ last_modified: 2026-03-09
16
+ source: ace-assign
17
+ skill:
18
+ kind: orchestration
19
+ execution:
20
+ workflow: wfi://assign/start
21
+ assign:
22
+ source: wfi://assign/start
23
+ ---
24
+
25
+ Load and run `ace-bundle wfi://assign/start` in the current project, then follow the loaded workflow as the source of truth and execute it end-to-end instead of only summarizing it.
@@ -0,0 +1,256 @@
1
+ ---
2
+ doc-type: workflow
3
+ title: Compose Assignment Workflow
4
+ purpose: LLM-driven composition of assignments using canonical assign-capable skill metadata, phrase hints, and hard ordering rules
5
+ ace-docs:
6
+ last-updated: 2026-03-18
7
+ last-checked: 2026-03-21
8
+ ---
9
+
10
+ # Compose Assignment Workflow
11
+
12
+ ## Purpose
13
+
14
+ Compose a tailored assignment by selecting steps from assign-capable canonical skills, applying composition rules, and using recipes as optional starting points.
15
+
16
+ Boundary:
17
+ - Compose resolves intent from user input + assign-capable canonical step data.
18
+ - Compose is allowed to use step-level intent metadata (phrase hints) from canonicalized step entries.
19
+ - Compose keeps skill-backed steps high-level. Runtime `ace-assign create` performs `assign.source` sub-step expansion.
20
+
21
+ ## Input Formats
22
+
23
+ ### 1. Natural Description
24
+
25
+ ```bash
26
+ /as-assign-compose "implement task 148 with PR and 2 reviews"
27
+ ```
28
+
29
+ ### 2. Explicit Step List
30
+
31
+ ```bash
32
+ /as-assign-compose "run tests, reorganize commits, push to remote"
33
+ ```
34
+
35
+ ### 3. Recipe Reference
36
+
37
+ ```bash
38
+ /as-assign-compose implement-with-pr --taskref 148
39
+ ```
40
+
41
+ ## Process
42
+
43
+ ### 1. Load Canonical Assign-Capable Catalog
44
+
45
+ Load public skill-backed step entries from canonical skills:
46
+
47
+ ```
48
+ Canonical source: skill://* (workflow/orchestration skills with explicit assign metadata)
49
+ Read: ace-assign/.ace-defaults/assign/catalog/composition-rules.yml
50
+ Glob: ace-assign/.ace-defaults/assign/catalog/recipes/*.recipe.yml
51
+ ```
52
+
53
+ Internal helper step templates under `ace-assign/.ace-defaults/assign/catalog/steps/*.step.yml`
54
+ remain runtime support data for non-skill steps such as subtree orchestration helpers. They are not the
55
+ authoritative source for public skill-backed step composition.
56
+
57
+ For each step, read:
58
+ - `name`, `skill`, `description`
59
+ - `prerequisites`
60
+ - `context`
61
+ - `tags`
62
+ - `intent.phrases` (if present)
63
+
64
+ ### 2. Understand Intent
65
+
66
+ Extract from user input:
67
+ - Goal and requested actions
68
+ - Explicit requested order
69
+ - Task refs (`--taskref`, `--taskrefs`, or inline text)
70
+ - Constraints (include/exclude specific steps)
71
+
72
+ Classify request shape:
73
+ - **Explicit-step mode**: user lists concrete steps (comma-separated or sequenced)
74
+ - **Goal mode**: user states high-level outcome
75
+
76
+ ### 3. Resolve Explicit Phrases to Steps
77
+
78
+ Apply deterministic matching per explicit phrase in order:
79
+
80
+ 1. Exact step-name match (`push-to-remote`)
81
+ 2. Exact/contains match against `intent.phrases`
82
+ 3. Token overlap against step `name` + `description` + `intent.phrases`
83
+
84
+ Normalization rules:
85
+ - Lowercase and trim punctuation before matching
86
+ - Normalize duplicates to one step unless repetition is explicitly requested
87
+ - Keep first match as canonical step selection
88
+
89
+ Unmatched phrase handling:
90
+ - Stop composition
91
+ - Return unmatched phrase and closest candidates (step name + matching hint)
92
+
93
+ ### 4. Optional Recipe Match
94
+
95
+ Recipe matching is optional and advisory:
96
+
97
+ - If user provides an exact recipe name, use it as starting scaffold.
98
+ - If request is explicit-step mode, explicit steps are primary and recipe steps are secondary defaults.
99
+ - If both conflict, explicit user steps win unless hard ordering/prerequisite rules require correction.
100
+
101
+ ### 5. Compose Step Sequence
102
+
103
+ Precedence policy:
104
+
105
+ 1. **Explicit user steps** (primary)
106
+ 2. **Required prerequisites** from selected steps
107
+ 3. **Hard ordering rules** from `composition-rules.yml`
108
+ 4. **Recommended conditionals/defaults** as suggestions (advisory)
109
+
110
+ Hard-rule corrections must be explainable by rule name.
111
+
112
+ Skill-backed steps (for example `work-on-task`) remain high-level in composed YAML.
113
+ Do not manually inline sub-steps from external skill/workflow files in compose.
114
+
115
+ ### 6. Validate
116
+
117
+ Validate composed sequence:
118
+
119
+ - Hard ordering satisfied (`before/after` rules)
120
+ - Required prerequisites present
121
+ - Pair constraints honored where applicable
122
+ - No unresolved placeholders in rendered instructions
123
+
124
+ If reordering occurred, record:
125
+ - original explicit order
126
+ - final order
127
+ - rule name(s) causing adjustment
128
+
129
+ ### 7. Present Plan
130
+
131
+ Show user the composed assignment:
132
+
133
+ ```
134
+ Proposed: <assignment-name>
135
+
136
+ Steps:
137
+ 010: verify-test-suite
138
+ 020: reorganize-commits
139
+ 030: push-to-remote
140
+
141
+ Ordering adjustments:
142
+ - none
143
+
144
+ Suggestions (advisory):
145
+ [optional] add update-pr-desc
146
+ ```
147
+
148
+ Include:
149
+ - Step number + name + brief description
150
+ - Fork context markers where applicable
151
+ - Hard-rule reorder explanations
152
+ - Advisory suggestions (clearly labeled optional)
153
+
154
+ ### 8. Refine (Optional)
155
+
156
+ Use AskUserQuestion when needed:
157
+ - Accept as-is
158
+ - Add/remove step
159
+ - Adjust review cycles
160
+ - Provide custom changes
161
+
162
+ Re-validate after edits.
163
+
164
+ ### 9. Generate job.yaml
165
+
166
+ Generate job configuration compatible with `ace-assign create`:
167
+
168
+ ```yaml
169
+ session:
170
+ name: <assignment-name>
171
+ description: <composed description>
172
+
173
+ steps:
174
+ - name: verify-test-suite
175
+ workflow: wfi://test/verify-suite
176
+ instructions:
177
+ - Run package test verification.
178
+ ```
179
+
180
+ Step mapping source of truth:
181
+ - `name` from canonicalized step catalog entry
182
+ - `workflow` from canonicalized step catalog entry
183
+ - `context` from canonicalized step catalog entry (if set)
184
+ - `instructions` as assignment overlay from catalog description + request-specific context
185
+
186
+ ### 10. Output Result
187
+
188
+ Write job.yaml to task jobs directory (or custom `--output`) and report:
189
+
190
+ ```
191
+ Assignment composed: <assignment-name>
192
+ Job configuration: <path-to-job.yaml>
193
+
194
+ Steps: N total
195
+ 010: ...
196
+
197
+ Composition validated: no ordering violations
198
+ ```
199
+
200
+ ## Error Handling
201
+
202
+ | Scenario | Action |
203
+ |----------|--------|
204
+ | No matching recipe | Compose directly from steps |
205
+ | Unmatched explicit phrase | Fail with unmatched phrase + closest candidates |
206
+ | Missing required prerequisite | Insert required prerequisite and report why |
207
+ | Ordering violation | Reorder by hard rule and report rule name |
208
+ | Missing required parameter | Prompt user |
209
+ | Empty step selection | Suggest minimum viable assignment |
210
+
211
+ ## Examples
212
+
213
+ ### Example 1: Explicit Steps
214
+
215
+ ```bash
216
+ /as-assign-compose "run tests, reorganize commits, push to remote"
217
+ ```
218
+
219
+ Expected core steps:
220
+ - `verify-test-suite`, `reorganize-commits`, `push-to-remote`
221
+
222
+ ### Example 2: Explicit + Mainline Maintenance
223
+
224
+ ```bash
225
+ /as-assign-compose "squash changelog, rebase with origin main, update pr description"
226
+ ```
227
+
228
+ Expected core steps:
229
+ - `squash-changelog`, `rebase-with-main`, `update-pr-desc`
230
+
231
+ ### Example 3: High-level Task Intent
232
+
233
+ ```bash
234
+ /as-assign-compose "work on task 123 and create a PR"
235
+ ```
236
+
237
+ Expected composed steps include high-level `work-on-task` and `create-pr`; runtime create expands task sub-steps via `assign.source`.
238
+
239
+ ## Success Criteria
240
+
241
+ - [ ] Canonical assign-capable phrase hints are used for explicit-step matching
242
+ - [ ] Common explicit requests resolve to stable steps
243
+ - [ ] Explicit ordering is preserved unless hard rules require changes
244
+ - [ ] Any reorder is explainable by named rule
245
+ - [ ] Skill-backed step expansion remains runtime responsibility
246
+ - [ ] Output job.yaml stays compatible with `ace-assign create`
247
+
248
+ ## Next Steps
249
+
250
+ After job.yaml is created:
251
+
252
+ ```bash
253
+ /as-assign-create <job.yaml>
254
+ # or
255
+ /as-assign-create "...intent..." --run
256
+ ```