The wl next --groups/-g grouping feature determines parallel-work safety by
extracting file paths from work item descriptions. To make this work reliably,
all intake_complete work items should include a **Key Files:** or ## Key Files section
listing the files the work item will touch.
Add a **Key Files:** or ## Key Files section near the end of the work item description
with bullet-pointed file paths:
**Key Files:**
- `path/to/file.ext`
- `another/file.ts`
- `docs/guide.md`A Markdown heading (without a trailing colon) is also accepted:
## Key Files
- `path/to/file.ext`
- `another/file.ts`
- `docs/guide.md`-
Section header: Use
**Key Files:**(bold with colon) or## Key Files(Markdown heading without colon). The header is case-insensitive (key files:,Key Files:,KEY FILES:) — any casing works. Bold markers are optional but recommended. A trailing colon afterkey filesis also optional — the parser accepts bothKey Files:andKey Files. -
Bullet items: List paths as Markdown bullet items using
-or*. Each line starting with-or*after the header is processed as a path candidate. -
Backticks: Paths may be wrapped in backticks or plain text:
- `src/commands/next.ts`(recommended, visually distinct)- src/commands/next.ts(also valid)
-
Trailing description: Paths with backticks may have descriptive text after the closing backtick. The parser extracts only the text between backticks as the path:
- `src/commands/next.ts` — New file for next command- `src/commands/helpers.ts`: Shared helpers- `src/foo.ts` (some context)
-
Valid path criteria: Each extracted path must:
- Contain at least one
/(indicating a file in a directory) - End with a file extension (e.g.,
.ts,.md,.json) - Not be a URL (
http://...,https://...)
- Contain at least one
-
Single section: Only the first
**Key Files:**section in the description is processed. Any subsequent sections are ignored. -
Section termination: The parser stops at the next Markdown heading (
#,##,###) or the next bold section header (e.g.,**Risks:**).
## Summary
Implement the new grouping feature.
**Key Files:**
- `src/commands/grouping.ts`
- `src/commands/helpers.ts`
- `tests/grouping-utility.test.ts`
## Risks
None identified.Key Files:
- src/commands/next.ts
- docs/CLI.mdMissing section entirely:
## Summary
Do the thing. No file paths listed.Section exists but no valid paths:
**Key Files:**
- https://example.com
- Some random text| Stage | Required? |
|---|---|
idea |
No (optional) |
intake_complete |
Should include |
plan_complete |
Should include (groups items) |
in_progress |
Optional |
in_review |
No |
The extractFilePaths() function in src/commands/helpers.ts implements
the extraction logic. It is shared between:
- The
wl next --groups/-ggrouping algorithm - The
wl doctor file-pathssubcommand - The automatic advisory check on transition to
intake_complete
- CLI.md —
wl nextandwl doctorcommand documentation wl doctor file-paths— On-demand validation- Work Item Descriptions — Description format guidance