Skip to content

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.

LocationRole today
apps/sdlc/skills/task-define/SKILL.mdInteractive 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.mdDocuments required sections (Goal, Today, Approach, Files to touch, ACs) but does not require the Files-to-touch list to be derived from the ACs.

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.

  1. Add a heuristic to /sdlc:task-define that scans the ACs for grep-command shapes (grep -rnE '<regex>', command grep, git grep, etc.) and extracts the regex + path.
  2. Run the extracted command from the worktree root. Collect unique file paths from stdout.
  3. AskUserQuestion: “AC-N implies the following touchpoints — append to Files-to-touch?” with a multi-select of the discovered paths.
  4. For each accepted path, append a modify row with a placeholder Change note the user can fill in.
LocationKindChange
apps/sdlc/skills/task-define/SKILL.mdmodifyDocument the auto-populate flow as an opt-in step, including the AskUserQuestion prompt.
apps/sdlc/skills/task-define/scan_validate_ac.tsmodifyImplement the grep-AC heuristic: extract regex + path from grep-shaped ACs, run the grep, emit unique file matches for the skill’s prompt.
  • AC-1: Given a task with AC text grep -rnE 'foo' src/ and one match src/bar.py, running /sdlc:task-define offers to add src/bar.py as a modify row.
  • 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.
  • 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-ready already walks Files-to-touch row existence; this task only seeds the table.
  • none

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.


← Back to Tasks