T-MNGR-task-define-auto-populates-files-to-touch-from-ac-grep
Status: closed/superseded · Impact: low · Complexity: small
Grep-AC-driven mechanical-sweep tasks (where the AC reads “grep X returns zero matches”) routinely
under-specify the Files-to-touch table — the author lists what they know about, the AC implies
everything that matches. Today the implementer has to bridge the gap by re-running the grep at
implementation time and extending the touch list. A /sdlc:task-define extension that runs the AC’s
grep command at authoring time and seeds the Files-to-touch table from its output closes the gap.
| Location | Role today |
|---|---|
apps/sdlc/skills/task-define/SKILL.md | Interactive task-definition skill that walks the user through each required body section but never inspects what the AC implies about scope. |
apps/sdlc/lib/model/entities/task/implementation-ready.md | Documents required sections (Goal, Today, Approach, Files to touch, ACs) but does not require the Files-to-touch list to be derived from the ACs. |
Proposed
Section titled “Proposed”When /sdlc:task-define detects an AC of the shape grep -rnE '<regex>' <path> (or similar
literal-grep ACs), the skill auto-runs the grep against the worktree and offers to append unique
file matches to the Files-to-touch table with kind modify. The user can edit the resulting rows
before commit. Empty ACs without a grep-shaped predicate are left alone.
Approach
Section titled “Approach”- Add a heuristic to
/sdlc:task-definethat scans the ACs for grep-command shapes (grep -rnE '<regex>',command grep,git grep, etc.) and extracts the regex + path. - Run the extracted command from the worktree root. Collect unique file paths from stdout.
- AskUserQuestion: “AC-N implies the following touchpoints — append to Files-to-touch?” with a multi-select of the discovered paths.
- For each accepted path, append a
modifyrow with a placeholderChangenote the user can fill in.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
apps/sdlc/skills/task-define/SKILL.md | modify | Document the auto-populate flow as an opt-in step, including the AskUserQuestion prompt. |
apps/sdlc/skills/task-define/scan_validate_ac.ts | modify | Implement the grep-AC heuristic: extract regex + path from grep-shaped ACs, run the grep, emit unique file matches for the skill’s prompt. |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: Given a task with AC text
grep -rnE 'foo' src/and one matchsrc/bar.py, running/sdlc:task-defineoffers to addsrc/bar.pyas amodifyrow. - AC-2: Given a task with ACs that contain no grep-shaped command, the auto-populate step is a no-op (silent skip, no user-facing prompt).
- AC-3: A new unit test exercises the AC-text → grep-command extraction against representative AC bodies.
Out of scope
Section titled “Out of scope”- Other AC shapes (test-name matches, lint rules, etc.). Grep-AC is the wedge; broader inference is a separate task.
- Re-running the grep at implementation time as a guard. The verifier in
/sdlc:task-ensure-readyalready walks Files-to-touch row existence; this task only seeds the table.
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”Surfaced in the post-mortem of [T-I2ML-squash-legacy-feat-branch-references](/planning/tasks/squash-legacy-feat-branch-references/), where the explicit
Files-to-touch table listed 13 files but the AC-1 sweep (grep -rnE '\bfeat/' plugin/ returns zero
matches) actually required edits to ~25 files. The implementer had to re-derive the touchpoint list
from the AC at implementation time; this task automates that step at authoring time.