ace-task 0.31.9 → 0.36.7

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.
@@ -1,19 +1,18 @@
1
1
  ---
2
2
  name: task-draft
3
3
  allowed-tools: Bash, Read
4
- description: Create behavior-first draft tasks and subtasks with vertical slicing
5
- and verification plans
4
+ description: Create high-level behavioral specifications that define WHAT the system should do (UX/DX/AX) rather than HOW to implement it. This workflow transforms ideas or requirements into behavior-first draft tasks with clear interface contracts, leaving implementation details for the replan step. This workflow also includes automated idea file management, moving original idea files to organized locations with task number prefixes for clear traceability.
6
5
  doc-type: workflow
7
6
  purpose: task draft workflow instruction
8
7
  ace-docs:
9
- last-updated: '2026-03-21'
8
+ last-updated: '2026-04-25'
10
9
  ---
11
10
 
12
11
  # Draft Task - Behavior-First Specification
13
12
 
14
13
  ## Goal
15
14
 
16
- Create high-level behavioral specifications that define WHAT the system should do (UX/DX/AX) rather than HOW to implement it. This workflow transforms ideas or requirements into behavior-first draft tasks with clear interface contracts, leaving implementation details for the replan step. The workflow also includes automated idea file management, moving original idea files to organized locations with task number prefixes for clear traceability.
15
+ Create high-level behavioral specifications that define WHAT the system should do (UX/DX/AX) rather than HOW to implement it. This workflow transforms ideas or requirements into behavior-first draft tasks with clear interface contracts, leaving implementation details for the replan step. This workflow also includes automated idea file management, moving original idea files to organized locations with task number prefixes for clear traceability.
17
16
 
18
17
  ## Prerequisites
19
18
 
@@ -36,6 +35,11 @@ Create high-level behavioral specifications that define WHAT the system should d
36
35
  * User stories or experience descriptions
37
36
  * Interface specifications or contracts
38
37
  * If files are referenced, read their contents
38
+ * If the input is a GitHub issue URL, extract the issue number and treat it
39
+ as task lifecycle metadata. Use that number with `ace-task create
40
+ --github-issue <number>` when creating the parent task or single flat task.
41
+ The issue URL may still appear in the task body as source context, but the
42
+ lifecycle link belongs in task frontmatter as `github_issue`.
39
43
  * **Intent mapping from enhanced ideas**: When the source idea contains the
40
44
  3-Question Delegation Brief sections (`What I Hope to Accomplish`,
41
45
  `What "Complete" Looks Like`, `Success Criteria`), use them as the
@@ -79,6 +83,7 @@ Create high-level behavioral specifications that define WHAT the system should d
79
83
  - What users experience: [UX description]
80
84
  - Interface contract: [CLI/API/UI examples]
81
85
  - Success criteria: [Measurable outcomes]
86
+ - Linked GitHub issue: #[issue-number] (when drafting from a GitHub issue)
82
87
  - Status: draft (needs implementation planning)
83
88
 
84
89
  2. [Next Task Title] - [User experience summary]
@@ -111,6 +116,8 @@ Create high-level behavioral specifications that define WHAT the system should d
111
116
  * Integration/E2E scenarios when behavior crosses boundaries
112
117
  * At least one invalid/failure-path scenario
113
118
  * Capture required context files per slice for fresh sessions in `bundle.files`
119
+ * Draft real child subtasks immediately when a parent has multiple original intentions
120
+ * Do not preserve major goals only in parent prose; if an intention matters, it must exist as a real child task/subtask
114
121
 
115
122
  7. **Determine Storage Location and Create Draft Tasks**
116
123
 
@@ -127,12 +134,14 @@ Create high-level behavioral specifications that define WHAT the system should d
127
134
  **Pattern A -- Single flat task (default):**
128
135
  ```bash
129
136
  ace-task create "Task Title" --status draft --estimate "TBD"
137
+ ace-task create "Task Title" --status draft --estimate "TBD" --github-issue 276
130
138
  ```
131
139
 
132
140
  **Pattern B -- Orchestrator with subtasks:**
133
141
  ```bash
134
142
  # 1. Create the parent task first
135
143
  ace-task create "Parent Title" --status draft --estimate "TBD"
144
+ ace-task create "Parent Title" --status draft --estimate "TBD" --github-issue 276
136
145
  # Returns: v.X.Y+task.NNN
137
146
 
138
147
  # 2. Add each subtask with --child-of (auto-converts parent to orchestrator)
@@ -157,20 +166,22 @@ Create high-level behavioral specifications that define WHAT the system should d
157
166
  * For subtasks, list required shared context files explicitly in EACH subtask's bundle (no implicit inheritance)
158
167
  * Include behavioral specification template
159
168
  * Focus on behavioral content, leave implementation for replan step
169
+ * When drafting from a GitHub issue:
170
+ * Put `--github-issue <number>` only on the parent/orchestrator or single
171
+ flat task create command unless separate subtasks each own distinct
172
+ GitHub issues.
173
+ * Run `ace-task github-sync <parent-or-task-ref>` after creation so the
174
+ GitHub issue receives the ACE task tracking update.
160
175
 
161
- ### Spike-First Rule for Engine/Pipeline Redesigns
176
+ ### Review-First Rule for Uncertain Drafts
162
177
 
163
- When an orchestrator task redesigns a core execution path (test runner, build pipeline,
164
- deployment flow), the FIRST subtask should be a time-boxed spike that:
165
- 1. Validates the target architecture end-to-end with a single scenario
166
- 2. Identifies which existing concepts survive and which get removed
167
- 3. Produces a "concept inventory" showing what the final system looks like
178
+ When requirements are uncertain, do not create a special spike task. Draft the real goal subtasks immediately, then let later `as-task-review` do the deep analysis.
168
179
 
169
- Only AFTER the spike validates the end-state should remaining subtasks be drafted.
170
- This prevents decomposing into subtasks that add concepts the spike later proves unnecessary.
171
-
172
- **Anti-pattern**: 8 subtasks drafted upfront, each adding features, then a late subtask undoes half.
173
- **Correct pattern**: 1 spike subtask validates the end-state, then remaining subtasks build toward it.
180
+ 1. The parent owns the umbrella outcome and decomposition map only.
181
+ 2. Each original intention or goal must exist as a real child subtask from the start.
182
+ 3. If ordering matters, make the first child the smallest real vertical slice that validates the riskiest path.
183
+ 4. Review may later rewrite, split, reorder, skip, or add dependencies between draft subtasks.
184
+ 5. Do not preserve uncertainty by inventing a dedicated research-only subtask when normal review can answer it.
174
185
 
175
186
  8. **Complete Behavioral Specifications**
176
187
  * For each created draft task, populate with:
@@ -232,16 +243,20 @@ This prevents decomposing into subtasks that add concepts the spike later proves
232
243
  * **Validation Checklist:**
233
244
  * [ ] All behavioral requirements captured as drafts
234
245
  * [ ] Task files have status: draft
246
+ * [ ] GitHub issue inputs are linked through `github_issue` frontmatter on the parent/single task
247
+ * [ ] Linked GitHub issue inputs have been synced with `ace-task github-sync <ref>`
235
248
  * [ ] Behavioral specifications are complete
236
249
  * [ ] Interface contracts are defined
237
250
  * [ ] Success criteria are measurable
238
251
  * [ ] Vertical slices are defined using task/subtask model (no horizontal-only decomposition)
252
+ * [ ] Every original intention is represented as a real task/subtask, not only parent prose
239
253
  * [ ] Verification Plan includes unit/equivalent validation, integration/E2E when needed, and failure path checks
240
254
  * [ ] `bundle` frontmatter exists with canonical key order (`presets`, `files`, `commands`)
241
255
  * [ ] Required context artifacts are explicitly listed in `bundle.files` for each task/subtask
242
256
  * [ ] Draft is decision-complete: no unresolved behavior choices left for implementer
243
257
  * [ ] Defaults are explicit where behavior could otherwise be ambiguous
244
258
  * [ ] Usage documentation created in `ux/usage.md` (when task changes any API surface)
259
+ * [ ] For uncertain families, the first slice is still a real subtask rather than a dedicated spike
245
260
 
246
261
  12. **Run Quality Pass (Better, Not More)**
247
262
  * Perform one concise quality pass before finalizing:
@@ -335,6 +350,10 @@ All code implementation happens during `ace-bundle wfi://task/work` (status: in-
335
350
  * All tasks have status: draft
336
351
  * No implementation details mixed with behavioral requirements
337
352
  * Clear handoff to review-task for readiness validation and promotion to pending
353
+ * **REQUIRED when drafting from a GitHub issue URL:**
354
+ * The parent/orchestrator or single flat task is created with `--github-issue <number>`
355
+ * The task frontmatter contains `github_issue: <number>`
356
+ * `ace-task github-sync <ref>` has updated the linked issue
338
357
  * **REQUIRED when drafting from ideas:**
339
358
  * All source idea files marked as done via `ace-idea move <id> --to archive`
340
359
  * Task references updated to new idea file locations
@@ -358,6 +377,15 @@ All code implementation happens during `ace-bundle wfi://task/work` (status: in-
358
377
  **Example 3: Interface-focused requirements**
359
378
  > "Draft task for CLI tool: auth-manager with login, logout, and status commands"
360
379
 
380
+ **Example 4: GitHub issue integration**
381
+ > "Draft a task from https://github.com/cs3b/ace/issues/276"
382
+
383
+ Create the parent or single task with the linked issue number:
384
+
385
+ ```bash
386
+ ace-task create "Task Title" --status draft --estimate "TBD" --github-issue 276
387
+ ```
388
+
361
389
  ---
362
390
 
363
391
  This workflow creates behavior-first specifications that serve as clear contracts for implementation, ensuring user value is defined before technical details are considered.
@@ -549,4 +577,4 @@ the decomposition was premature. Consider consolidating remaining subtasks.
549
577
  ## Notes for Implementer
550
578
  - Full usage documentation to be completed during work-on-task step using `wfi://docs/update-usage`
551
579
  </template>
552
- </documents>
580
+ </documents>
@@ -137,6 +137,16 @@ The plan will be consumed by a separate execution agent that has no access to th
137
137
  - List consumer packages that will need coordinated updates
138
138
  - Document the full downstream scope before implementation begins
139
139
 
140
+ **Layer Ownership Triage:**
141
+ - For tasks involving shared resources, external protocols, command routing, configuration namespaces, or cross-package helpers, identify the owner layer before choosing files to edit.
142
+ - Classify relevant packages/components as:
143
+ - **Owner/creator**: creates, names, persists, routes, or navigates the primitive
144
+ - **Adapter/orchestrator**: coordinates owner APIs for a workflow
145
+ - **Consumer/symptom**: exposes the issue but does not own the primitive
146
+ - Default to implementing shared policy in the owner layer, then update adapters/consumers to call it.
147
+ - Do not plan a consumer-only fix when an owner layer exists and has not been inspected.
148
+ - Example: for tmux window-name failures surfaced by `ace-assign`, inspect `ace-tmux` first because it owns tmux window creation, naming, and navigation.
149
+
140
150
  **Document Research Findings:**
141
151
  - Summarize key technical insights
142
152
  - Note recommended approaches with pros/cons
@@ -164,6 +174,7 @@ The plan will be consumed by a separate execution agent that has no access to th
164
174
  - Identify existing files requiring changes
165
175
  - Document specific modifications and their impact
166
176
  - Plan integration points and interfaces
177
+ - Mark cross-package files as owner, adapter/orchestrator, or consumer/symptom when layer ownership triage applies
167
178
 
168
179
  **Delete Files:**
169
180
  - Identify obsolete files to be removed
@@ -486,4 +497,4 @@ If needed, add **`## Behavioral Gaps`** only after `## Freshness Summary`.
486
497
  - `ace-test path/to/test_file.rb`
487
498
  </template>
488
499
 
489
- </documents>
500
+ </documents>
@@ -1,19 +1,18 @@
1
1
  ---
2
2
  name: task-review
3
3
  allowed-tools: Bash, Read
4
- description: Review draft tasks for readiness, vertical slice quality, verification
5
- plans, and promotion to pending
4
+ description: Review draft tasks for readiness, vertical slice quality, verification plans, and promotion to pending
6
5
  doc-type: workflow
7
6
  purpose: Review draft tasks for readiness and quality before promotion
8
7
  ace-docs:
9
- last-updated: '2026-03-21'
8
+ last-updated: '2026-04-25'
10
9
  ---
11
10
 
12
11
  # Review Task Workflow Instruction
13
12
 
14
13
  ## Goal
15
14
 
16
- Validate draft behavioral specifications and promote to pending when ready. This workflow acts as the readiness gate between drafting and implementation. It reviews draft tasks for completeness, conducts autonomous research to resolve open questions, generates critical questions for unresolved items, and either promotes validated drafts to `status: pending` or blocks with `needs_review: true` when questions remain.
15
+ Validate draft behavioral specifications and promote to pending when ready. This workflow acts as the readiness gate between drafting and implementation. It reviews draft tasks for completeness, conducts autonomous research to resolve open questions, rewrites draft families when codebase reality differs from the original draft, generates critical questions for unresolved items, and either promotes validated drafts to `status: pending` or blocks with `needs_review: true` when questions remain.
17
16
 
18
17
  ## Prerequisites
19
18
 
@@ -40,6 +39,7 @@ Validate draft behavioral specifications and promote to pending when ready. This
40
39
  - Enumerate child subtasks and their current statuses before any promotion
41
40
  - Treat every child subtask still in `draft` as an additional review target
42
41
  - Review draft subtasks first and defer any parent promotion decision until child review outcomes are known
42
+ - Confirm the parent is acting as umbrella outcome plus decomposition map rather than hiding major work only in parent prose
43
43
  - Parse the behavioral specification sections:
44
44
  - User Experience (input, process, output)
45
45
  - Expected Behavior
@@ -51,13 +51,19 @@ Validate draft behavioral specifications and promote to pending when ready. This
51
51
  - Frontmatter `bundle` block (`presets`, `files`, `commands`)
52
52
  - Identify gaps, ambiguities, or assumptions that need clarification
53
53
 
54
- 2. **Autonomous Research Phase:**
54
+ 2. **Autonomous Research and Draft Repair Phase:**
55
55
  - **Attempt Self-Resolution First:**
56
56
  - Search project documentation for answers
57
57
  - Analyze similar implementations in codebase
58
58
  - Review related tasks and their solutions
59
59
  - Check architectural decisions and patterns
60
60
  - Consult technical documentation and best practices
61
+ - **Repair draft structure when research changes the shape:**
62
+ - Rewrite draft subtasks when codebase reality or shipped behavior differs from the original draft
63
+ - Split draft subtasks when one child is hiding multiple real goals
64
+ - Add or change normal task dependencies when ordering matters
65
+ - Mark obsolete draft subtasks `skipped` when the goal is already satisfied or no longer valid
66
+ - Update the parent decomposition summary to match the repaired child set
61
67
  - **Web Search When Appropriate:**
62
68
  - If WebSearch tool is available and needed:
63
69
  - Search for industry standards or best practices
@@ -102,9 +108,10 @@ Validate draft behavioral specifications and promote to pending when ready. This
102
108
  - [ ] **Scope Boundaries Clear**: In-scope and out-of-scope explicitly stated
103
109
  - [ ] **Validation Questions Addressed**: All validation questions either answered or documented as blocking
104
110
  - [ ] **Vertical Slice Quality (Task/Subtask)**: Scope is decomposed into end-to-end capability slices (standalone task or orchestrator+subtasks), not horizontal layer-only work
111
+ - [ ] **Original Intention Coverage**: Each major original intention exists as a real child task/subtask instead of being preserved only in parent prose
105
112
  - [ ] **Subtask Slice Clarity**: Each subtask has a distinct observable outcome and does not duplicate sibling scope
106
113
  - [ ] **Child Readiness Complete** (orchestrators only): Every draft child subtask has been reviewed and either promoted to `pending` or blocked with documented questions
107
- - [ ] **Tracer-First for Uncertain Architecture**: For uncertain/novel execution paths, first subtask is a tracer slice validating viability
114
+ - [ ] **First Slice Is Real Work**: When ordering matters, the first slice is the smallest real capability, not a synthetic research-only task
108
115
  - [ ] **Slice Size Signal Present**: Each slice includes advisory size (`small|medium|large`) for planning visibility
109
116
  - [ ] **Decision-Complete Spec**: Implementer can execute without inventing missing behavioral decisions
110
117
  - [ ] **Defaults Declared**: Ambiguous/unspecified behavior has explicit defaults
@@ -119,10 +126,7 @@ Validate draft behavioral specifications and promote to pending when ready. This
119
126
  - [ ] **Operating Modes Covered**: Spec addresses relevant operating modes (dry-run, force, verbose, quiet) or explicitly marks them out-of-scope
120
127
  - [ ] **Degenerate Inputs Covered**: Spec considers identity operations (X=Y), empty inputs, and self-referential calls where the same entity appears in both argument positions
121
128
  - [ ] **Per-Path Variations Covered**: If spec says "same behavior for X and Y", it enumerates edge cases unique to each path (guard logic, error handling, parameter differences)
122
- - [ ] **End-State Coherence** (orchestrator subtasks only): Concepts introduced by this subtask
123
- (new fields, modes, formats) are expected to exist in the final deliverable --
124
- not be removed by a later subtask. If this subtask adds a concept that a later
125
- subtask will consolidate away, flag as SCOPE RISK and consider merging subtasks.
129
+ - [ ] **End-State Coherence** (orchestrator subtasks only): Concepts introduced by this subtask are expected to exist in the final deliverable and not be removed by a later sibling rewrite without reasoned review-driven reshaping
126
130
  - [ ] **Title Length**: Title is max 80 characters
127
131
  - [ ] **Folder Slug**: 3-5 word context slug for folder
128
132
  - [ ] **File Slug**: 4-7 word action slug for spec file
@@ -248,6 +252,7 @@ For non-draft tasks, skip the Readiness Checklist and Promote/Block steps. Focus
248
252
  - Refining draft specifications before implementation
249
253
  - Researching answers to open questions on draft tasks
250
254
  - Checking if a draft is implementation-ready
255
+ - Reshaping uncertain draft families without inventing a dedicated spike subtask
251
256
 
252
257
  **Don't use review-task when:**
253
258
  - Creating new tasks (use draft-task)
@@ -266,6 +271,7 @@ For non-draft tasks, skip the Readiness Checklist and Promote/Block steps. Focus
266
271
  - Bundle frontmatter (`presets`, `files`, `commands`) validated for completeness
267
272
  - Task promoted to pending if ready, or blocked with `needs_review: true`
268
273
  - Orchestrator parents are promoted only after draft child subtasks have also passed review
274
+ - Review can rewrite, split, reorder, skip, or dependency-shape draft children when research proves the initial draft wrong
269
275
  - Structure and formatting preserved
270
276
  - No loss of existing information
271
277
  - Clear improvement in task clarity or completeness
@@ -335,10 +341,11 @@ cd .ace-tasks && ace-search "needs_review: true" --content
335
341
  The review-task workflow serves as the quality gate between specification and implementation:
336
342
 
337
343
  1. **Research-First Approach**: AI agents attempt to find answers through documentation, codebase analysis, and pattern recognition before escalating
338
- 2. **Readiness Checklist**: Systematic validation ensures behavioral specs are complete before promotion
339
- 3. **Smart Question Filtering**: Only truly unresolvable questions requiring business/design decisions are escalated
340
- 4. **Persistent Question Tracking**: Questions are saved in task files with `needs_review: true` metadata for easy filtering
341
- 5. **Clear Lifecycle Decision**: Every review results in either promotion to pending or documented blocking questions
344
+ 2. **Draft Repair Authority**: Review rewrites, splits, reorders, and dependency-shapes uncertain draft families instead of requiring a special spike task type
345
+ 3. **Readiness Checklist**: Systematic validation ensures behavioral specs are complete before promotion
346
+ 4. **Smart Question Filtering**: Only truly unresolvable questions requiring business/design decisions are escalated
347
+ 5. **Persistent Question Tracking**: Questions are saved in task files with `needs_review: true` metadata for easy filtering
348
+ 6. **Clear Lifecycle Decision**: Every review results in either promotion to pending or documented blocking questions
342
349
 
343
350
  This approach enables:
344
351
  - **Clear Lifecycle Gate**: Draft tasks must pass validation before entering the implementation pipeline
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: task-work
3
- description: Execute task implementation against behavioral spec using pre-loaded
4
- plan
3
+ description: Execute task implementation against behavioral spec using pre-loaded plan
4
+ allowed-tools: Bash, Read, Write
5
5
  assign:
6
6
  sub-steps:
7
7
  - onboard-base
@@ -16,7 +16,7 @@ assign:
16
16
  doc-type: workflow
17
17
  purpose: Execute task implementation from plan with quality gates
18
18
  ace-docs:
19
- last-updated: '2026-03-21'
19
+ last-updated: '2026-04-25'
20
20
  ---
21
21
 
22
22
  # Work on Task
@@ -41,6 +41,7 @@ To avoid known `--content` stalls in some environments:
41
41
  - `ace-task plan <ref>` (path mode, reuse cached plan when available)
42
42
  - The most recent plan artifact plus current task spec, documented in the step report
43
43
  4. If stalls repeat, add a follow-up fix task and capture evidence in the retrospective.
44
+ 5. If implementation reveals the spec is materially wrong, stale, or missing an adoption path, stop and either update the spec or add a follow-up task before continuing.
44
45
 
45
46
  ## Primary Directive
46
47
 
@@ -58,11 +59,13 @@ Work through the plan checklist, step by step:
58
59
  - If the spec says X, implement X — don't gold-plate, don't simplify away requirements
59
60
  - If spec and plan conflict, spec wins — the plan is a HOW, not a WHAT
60
61
  - If the spec is ambiguous or incomplete: stop and ask, don't assume
62
+ - If runtime work materially changes a promised public contract (flags, naming, fallback behavior, proof surface, ownership boundary), do not silently drift. Update the task/spec or create a follow-up task before release or demo cleanup.
63
+ - If implementation reveals the plan targets only a symptom/consumer package for a shared primitive, stop and re-plan at the owner layer before editing. The owner layer is the package that creates, names, persists, routes, or navigates the primitive; adapters and consumers should reuse owner APIs instead of duplicating policy.
61
64
 
62
65
  **Prior implementation awareness:**
63
- - Before creating new modules, search for existing implementations of the same concern — especially spike or prototype code from prior subtasks
64
- - If a sibling task (same parent, earlier sequence) produced spike code: refactor and promote it rather than creating parallel "production" versions
65
- - Check dependency task reports and the task folder for prior work artifacts (concept inventories, spike reports)
66
+ - Before creating new modules, search for existing implementations of the same concern
67
+ - If a sibling task produced prototype or exploratory code, refactor and promote it rather than creating parallel "production" versions
68
+ - Check dependency task reports and the task folder for prior work artifacts
66
69
  - When plan file paths point to locations where code already exists, integrate rather than duplicate
67
70
 
68
71
  **Execution discipline:**
@@ -72,19 +75,20 @@ Work through the plan checklist, step by step:
72
75
  - If a test failure is undiagnosable after one attempt: stop and report
73
76
 
74
77
  **Task lifecycle:**
75
- - `draft` status: warn the user that the spec hasn't been reviewed, then continue only with explicit confirmation. In unattended/fork contexts where interactive confirmation is not possible, proceed after marking in-progress the assignment creation layer is responsible for blocking draft tasks before they reach this point.
78
+ - `draft` status: warn the user that the spec hasn't been reviewed, then continue only with explicit confirmation. In unattended/fork contexts where interactive confirmation is not possible, proceed after marking in-progress -- the assignment creation layer is responsible for blocking draft tasks before they reach this point.
76
79
  - Mark in-progress before first change, done after last verification
77
- - Never modify task frontmatter directly use `ace-task update <ref> --set key=value`
80
+ - Never modify task frontmatter directly -- use `ace-task update <ref> --set key=value`
81
+ - If implementation reveals the reviewed draft structure is materially wrong, update the affected task specs or add follow-up tasks before continuing with misleading assumptions.
78
82
 
79
83
  ## Code Conventions
80
84
 
81
- - Follow established project patterns don't introduce new abstractions or styles
85
+ - Follow established project patterns -- don't introduce new abstractions or styles
82
86
  - 2-space indentation (Ruby); keep lines under 120 characters
83
87
  - Write tests for all new logic; run `ace-test` before committing
84
88
 
85
89
  ## Task Folder
86
90
 
87
- **Documents:** Task-specific docs (reports, findings, usage docs) go in the task folder never in the project root.
91
+ **Documents:** Task-specific docs (reports, findings, usage docs) go in the task folder -- never in the project root.
88
92
 
89
93
  **Codemods** (scripts that transform files): create in `{task-folder}/codemods/`, never in `bin/`
90
94
 
@@ -94,7 +98,7 @@ Work through the plan checklist, step by step:
94
98
 
95
99
  All plan steps checked, all success criteria pass:
96
100
 
97
- 1. **Verify working tree is clean** no uncommitted changes:
101
+ 1. **Verify working tree is clean** -- no uncommitted changes:
98
102
  ```bash
99
103
  git status --short
100
104
  ```
@@ -18,7 +18,17 @@ module Ace
18
18
  # @param created_at [Time, nil] Creation time
19
19
  # @param parent [String, nil] Parent task ID for subtasks
20
20
  # @return [Hash] Frontmatter hash
21
- def self.build(id:, status: "pending", priority: nil, tags: [], dependencies: [], created_at: nil, parent: nil, estimate: nil)
21
+ def self.build(
22
+ id:,
23
+ status: "pending",
24
+ priority: nil,
25
+ tags: [],
26
+ dependencies: [],
27
+ created_at: nil,
28
+ parent: nil,
29
+ estimate: nil,
30
+ github_issue: nil
31
+ )
22
32
  fm = {
23
33
  "id" => id,
24
34
  "status" => status || "pending",
@@ -29,6 +39,7 @@ module Ace
29
39
  fm["dependencies"] = dependencies || []
30
40
  fm["tags"] = tags || []
31
41
  fm["parent"] = parent if parent
42
+ fm["github_issue"] = github_issue if github_issue
32
43
  fm
33
44
  end
34
45
 
@@ -19,7 +19,7 @@ module Ace
19
19
  end
20
20
 
21
21
  def self.valid_id?(id)
22
- id.to_s.match?(/^[0-9a-z]{3}\.[a-z]\.[0-9a-z]{3}$/)
22
+ id.to_s.match?(/\A[0-9a-z]{3}\.[a-z]\.[0-9a-z]{3}(?:\.[0-9a-z])?\z/)
23
23
  end
24
24
 
25
25
  def self.scope_consistent?(status, special_folder)
@@ -20,6 +20,7 @@ module Ace
20
20
  '"Fix login bug" # Create task with title',
21
21
  '"Fix auth" --priority high --tags auth,security # With priority and tags',
22
22
  '"Setup DB" --child-of q7w # Create as subtask',
23
+ '"Track issue" --github-issue 276 # Link GitHub issue',
23
24
  '"Quick task" --in maybe # Create in _maybe/ folder',
24
25
  '"Draft spec" --status draft --estimate TBD # Create as draft with estimate',
25
26
  '"Preview only" --dry-run # Show what would be created'
@@ -31,6 +32,7 @@ module Ace
31
32
  option :tags, type: :string, aliases: %w[-T], desc: "Tags (comma-separated)"
32
33
  option :status, type: :string, aliases: %w[-s], desc: "Initial status (draft, pending, blocked, ...)"
33
34
  option :estimate, type: :string, aliases: %w[-e], desc: "Effort estimate (e.g. TBD, 2h, 1d)"
35
+ option :"github-issue", type: :array, desc: "Linked GitHub issue number"
34
36
  option :"child-of", type: :string, desc: "Parent task reference (creates subtask)"
35
37
  option :in, type: :string, aliases: %w[-i], desc: "Target folder (e.g. next, maybe)"
36
38
  option :"dry-run", type: :boolean, aliases: %w[-n], desc: "Preview without writing"
@@ -48,6 +50,7 @@ module Ace
48
50
  tags = tags_str ? tags_str.split(",").map(&:strip).reject(&:empty?) : []
49
51
  status = options[:status]
50
52
  estimate = options[:estimate]
53
+ github_issue = parse_github_issue(options[:"github-issue"])
51
54
  child_of = options[:"child-of"]
52
55
  in_folder = options[:in]
53
56
 
@@ -64,6 +67,7 @@ module Ace
64
67
  puts " Status: #{status}" if status
65
68
  puts " Priority: #{priority}" if priority
66
69
  puts " Estimate: #{estimate}" if estimate
70
+ puts " GitHub: #{github_issue}" if github_issue
67
71
  puts " Tags: #{tags.join(", ")}" if tags.any?
68
72
  puts " Parent: #{child_of}" if child_of
69
73
  puts " Folder: #{in_folder}" if in_folder
@@ -72,10 +76,29 @@ module Ace
72
76
 
73
77
  manager = Ace::Task::Organisms::TaskManager.new
74
78
 
75
- task = if child_of
76
- manager.create_subtask(child_of, title, status: status, priority: priority, tags: tags, estimate: estimate)
77
- else
78
- manager.create(title, status: status, priority: priority, tags: tags, estimate: estimate)
79
+ task = begin
80
+ if child_of
81
+ manager.create_subtask(
82
+ child_of,
83
+ title,
84
+ status: status,
85
+ priority: priority,
86
+ tags: tags,
87
+ estimate: estimate,
88
+ github_issue: github_issue
89
+ )
90
+ else
91
+ manager.create(
92
+ title,
93
+ status: status,
94
+ priority: priority,
95
+ tags: tags,
96
+ estimate: estimate,
97
+ github_issue: github_issue
98
+ )
99
+ end
100
+ rescue Ace::Task::Organisms::TaskManager::CreateRetriesExhaustedError => e
101
+ raise Ace::Support::Cli::Error, e.message
79
102
  end
80
103
 
81
104
  unless task
@@ -90,6 +113,9 @@ module Ace
90
113
 
91
114
  puts "Created task #{task.id}"
92
115
  puts " Path: #{task.file_path}"
116
+ if manager.last_update_note && !manager.last_update_note.strip.empty?
117
+ puts "Info: #{manager.last_update_note}"
118
+ end
93
119
 
94
120
  if options[:git_commit]
95
121
  Ace::Support::Items::Molecules::GitCommitter.commit(
@@ -98,6 +124,22 @@ module Ace
98
124
  )
99
125
  end
100
126
  end
127
+
128
+ private
129
+
130
+ def parse_github_issue(raw_values)
131
+ values = Array(raw_values).flatten.compact
132
+ return nil if values.empty?
133
+ raise Ace::Support::Cli::Error.new("Only one --github-issue may be provided") if values.length > 1
134
+
135
+ candidate = values.first.to_s.strip
136
+ raise Ace::Support::Cli::Error.new("Invalid GitHub issue '#{values.first}': expected numeric ID") unless candidate.match?(/\A\d+\z/)
137
+
138
+ id = candidate.to_i
139
+ raise Ace::Support::Cli::Error.new("Invalid GitHub issue '#{values.first}': expected positive numeric ID") if id <= 0
140
+
141
+ id
142
+ end
101
143
  end
102
144
  end
103
145
  end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ace/support/cli"
4
+
5
+ module Ace
6
+ module Task
7
+ module CLI
8
+ module Commands
9
+ # ace-support-cli Command class for ace-task github-sync
10
+ class GithubSync < Ace::Support::Cli::Command
11
+ include Ace::Support::Cli::Base
12
+
13
+ desc <<~DESC.strip
14
+ Synchronize linked GitHub issues for a task or all linked tasks
15
+ DESC
16
+
17
+ example [
18
+ "q7w # Sync one task",
19
+ "--all # Sync all linked tasks"
20
+ ]
21
+
22
+ argument :ref, required: false, desc: "Task reference (full ID, short ref, or suffix)"
23
+ option :all, type: :boolean, aliases: %w[-a], desc: "Sync all linked tasks"
24
+
25
+ option :quiet, type: :boolean, aliases: %w[-q], desc: "Suppress non-essential output"
26
+ option :verbose, type: :boolean, aliases: %w[-v], desc: "Show verbose output"
27
+ option :debug, type: :boolean, aliases: %w[-d], desc: "Show debug output"
28
+
29
+ def call(ref: nil, **options)
30
+ all = options[:all]
31
+
32
+ if !all && (ref.nil? || ref.strip.empty?)
33
+ raise Ace::Support::Cli::Error.new("Provide a task reference or use --all")
34
+ end
35
+
36
+ manager = Ace::Task::Organisms::TaskManager.new
37
+ result = manager.github_sync(ref: ref, all: all)
38
+ raise Ace::Support::Cli::Error.new("Task '#{ref}' not found") if result.nil?
39
+ print_failures(result[:failures])
40
+
41
+ if result[:failed].to_i.positive?
42
+ raise Ace::Support::Cli::Error.new(
43
+ "GitHub sync incomplete: synced #{result[:synced]}, failed #{result[:failed]}, skipped #{result[:skipped]}"
44
+ )
45
+ elsif all
46
+ puts "GitHub sync complete: synced #{result[:synced]} linked task(s), skipped #{result[:skipped]} task(s)"
47
+ elsif result[:synced].positive?
48
+ puts "GitHub sync complete: #{result[:task_id]}"
49
+ else
50
+ puts "No linked GitHub issues for task #{result[:task_id]}"
51
+ end
52
+ end
53
+
54
+ private
55
+
56
+ def print_failures(failures)
57
+ Array(failures).each do |failure|
58
+ warn "GitHub sync failed for #{failure[:task_id]}: #{failure[:error]}"
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -24,6 +24,7 @@ module Ace
24
24
  "q7w # Reuse fresh plan or generate new",
25
25
  "q7w --refresh # Force regeneration",
26
26
  "q7w --content # Print full plan content",
27
+ "q7w --timeout 30 # Fail fast if plan generation stalls",
27
28
  "q7w --model gemini:flash-latest # Override planning model"
28
29
  ]
29
30
 
@@ -32,6 +33,7 @@ module Ace
32
33
  option :refresh, type: :boolean, desc: "Force plan regeneration"
33
34
  option :content, type: :boolean, desc: "Print full plan content instead of path"
34
35
  option :model, type: :string, desc: "Provider:model override for plan generation"
36
+ option :timeout, type: :integer, desc: "LLM request timeout in seconds for plan generation"
35
37
 
36
38
  option :quiet, type: :boolean, aliases: %w[-q], desc: "Suppress non-essential output"
37
39
  option :verbose, type: :boolean, aliases: %w[-v], desc: "Show verbose output"
@@ -58,7 +60,7 @@ module Ace
58
60
 
59
61
  context_files = capture_context_files(task)
60
62
  model = options[:model] || default_model(config)
61
- generator = plan_generator(model)
63
+ generator = plan_generator(model, timeout: options[:timeout])
62
64
  content = generator.generate(
63
65
  task: task,
64
66
  context_files: context_files,
@@ -104,13 +106,15 @@ module Ace
104
106
  end
105
107
  end
106
108
 
107
- def plan_generator(model, cli_args: nil)
109
+ def plan_generator(model, cli_args: nil, timeout: nil)
108
110
  klass = self.class.generator_class || Molecules::TaskPlanGenerator
109
- klass.new(model: model, cli_args: cli_args)
111
+ kwargs = {model: model, cli_args: cli_args}
112
+ kwargs[:timeout] = timeout if timeout
113
+ klass.new(**kwargs)
110
114
  end
111
115
 
112
116
  def default_model(config)
113
- config.dig("task", "plan", "model") || "gemini:flash-latest"
117
+ config.dig("task", "plan", "model") || "role:planner"
114
118
  end
115
119
  end
116
120
  end