Extract Work Items from Meta Documents
!accelerator config context --skill extract-work-items --fail-safe
!accelerator config agents --fail-safe
If no "Agent Names" section appears above, use these defaults:
accelerator:reviewer, accelerator:codebase-locator,
accelerator:codebase-analyser, accelerator:codebase-pattern-finder,
accelerator:documents-locator, accelerator:documents-analyser,
accelerator:web-search-researcher.
Work items directory: !accelerator config path work --fail-safe
Research directory: !accelerator config path research_codebase --fail-safe
Plans directory: !accelerator config path plans --fail-safe
Work Item Template
The template below defines the sections and frontmatter fields that every
work item must contain. Read it now — the valid work item kinds live in the kind
field (not a hardcoded list elsewhere in this skill), and every written file
must populate every frontmatter field.
!accelerator config template work-item --fail-safe
You are tasked with identifying requirements, work items, and actionable
tasks within existing meta documents and helping the user capture them as
formal work items. Source documents typically tell you what work items should
exist but rarely give the full business context, testable acceptance
criteria, dependencies, and assumptions a good work item needs. The model,
the user, and web research fill those gaps.
Extraction therefore proceeds in two layers:
- Source-derived content stays faithful. Anything you draw from the
source documents must reflect what they actually say — do not silently
invent requirements that are not there.
- Business-context gaps are surfaced. The
Assumptions, Open Questions
and Drafting Notes sections serve different purposes when present, and all
matter:
- Assumptions are interpretations you made that affect the work item's
meaning. Flag one only when using the wrong interpretation would lead
someone to build something different. Example: "Interpreted 'users' as
end users rather than internal staff — if wrong, scope changes."
- Open Questions are genuine unknowns the source raises but leaves
unanswered that a reader or implementer needs resolved before work can
proceed. Example: "What does 'better results' mean — improved relevance,
faster delivery, or both?"
- Drafting Notes capture interpretations you made while filling out
the work item — business-context calls, scope decisions, or technical
choices that someone should review if they turn out to be wrong.
Actively populate this section. If you inferred who the stakeholders
are, what a vague term means, what the scope boundary is, or which
technical approach the source implies, write it down.
Examples: "Treated this as a spike because no acceptance criteria are
defined — if implementation is already expected, kind and scope both
change." Routine field selections (kind, priority, tags) don't need an
entry unless the choice reflects a substantive scope or meaning
interpretation that a reviewer should be aware of.
For each selected candidate, you offer the user the choice between
enriching the work item interactively (with model knowledge, web research,
and a few focused questions, similar to /create-work-item) or accepting
the source-derived skeleton as-is and refining later. The enrichment
loop is per candidate, not pre-generated, so the work the model invests
matches the depth the user wants for each work item.
Initial Setup
When this command is invoked:
- Check if parameters were provided:
- If one or more file paths were provided, note them as the target documents
- If no parameters provided, ask conversationally and helpfully which
documents to work with. Give the user enough context to respond easily:
briefly explain what kinds of sources work (specific files, planning docs,
meeting notes, research, specs), mention that you can also scan all
documents in the configured directories, and invite them to direct.
Helpful examples matter more here than brevity — aim for something
welcoming and informative rather than a single terse question.
Wait for user input.
Process Steps
Step 1: Identify Source Documents
- If specific files were provided, read them FULLY. Before reading,
verify each path exists. If any path does not exist, report which
paths are missing and ask the user to correct or remove them — do not
silently skip them or proceed with an empty set.
- If scanning all meta documents:
- Spawn a {documents locator agent} agent to find all documents in the
configured research and plans directories (shown above)
- Present the discovered documents and let the user select which to scan:
I found the following documents:
**Research:**
- `{research directory}/2026-04-08-topic.md` — Topic research
- ...
**Plans:**
- `{plans directory}/2026-04-19-feature.md` — Feature plan
- ...
Which documents should I scan for work items? (enter numbers, "all", or
specific paths)
- Wait for user selection.
Step 2: Analyse Documents for Work Items
Spawn {documents analyser agent} agents (one per document, in parallel)
with instructions to identify requirements and actionable work items.
Look for:
- Explicit requirements ("The system must...", "Users need to...",
"We need to implement...")
- User stories ("As a..., I want..., so that...")
- Feature descriptions and acceptance criteria
- Bug reports with symptoms and expected behaviour
- Open-ended investigations or unknowns requiring research
- Multi-deliverable themes that span several stories
- One-off tasks (migrations, infrastructure work, documentation)
Wait for all agents to complete.
Deduplicate: Where the same work item appears across multiple
documents, merge the entries and record all source documents it came from.
Present discovered candidates as a numbered list:
I found the following actionable items across the scanned documents:
1. **[Short title]** — [one-line description]
Source: `{research directory}/2026-04-08-topic.md`
2. **[Short title]** — [one-line description]
Source: `{plans directory}/2026-04-19-feature.md`, `{research directory}/2026-04-08-topic.md`
3. ...
Which items would you like to create work items for? (enter numbers, "all",
or "none")
If no actionable items are found across all documents, inform the user:
"No actionable items found in the provided documents." and exit cleanly.
Wait for user selection. If the user selects "none", exit cleanly without
writing any files.
Step 3: Enrich and Approve (Per Candidate)
For each selected candidate, in original presented order, build a
source-derived skeleton, present it, and let the user choose how much
enrichment to invest. Do NOT pre-generate drafts for the entire batch
in advance — enrichment can change a draft significantly, so generation
happens per candidate inside this loop.
3.1 Build the source-derived skeleton
For the current candidate:
- Infer the work item kind from its content using kinds read from the
work item template's
kind field:
- clear bug reports with symptoms and expected/actual behaviour →
bug
- open-ended investigations with specific questions →
spike
- broad multi-deliverable themes →
epic
- specific single deliverables →
story
- one-off technical or operational tasks →
task
- Default to
story for items where the kind is genuinely ambiguous.
- Draft a complete work item from the source content alone, using
XXXX
as the placeholder work item number.
- Kind-specific content placement:
- bug: reproduction steps, expected/actual behaviour →
Requirements section
- spike: research questions, time-box, exit criteria →
Requirements section
- epic: initial story decomposition →
Requirements section as a list
- Do not rename or add sections beyond those in the work item template.
- Surface business-context gaps using the right section: put your
interpretation in
Assumptions (when you made a call and the wrong call
changes what gets built). Put unanswered questions in Open Questions when
you genuinely cannot tell from the source. Populate Open Questions with
anything that would materially change scope, approach, or acceptance
criteria if resolved differently. Add a Drafting Notes entry for every
meaningful interpretation you made (scope boundaries, who
stakeholders are, what vague terms mean, which technical approach is implied).
- Include all source documents for this item in the
References section.
3.2 Present the skeleton with options
Candidate #N of M: [title]
Kind (proposed): [kind]
Source: [paths]
[work item content with XXXX placeholder, including Drafting Notes section]
Use the AskUserQuestion tool with four options:
- Enrich — interactive Q&A, web research where useful, then approve
- Accept as-is — write this skeleton as a thin draft for later refinement
- Skip — exclude from this batch
- Accept all remaining — fast-path every remaining candidate as a thin draft
Wait for the user's choice. If the user enters free-form text via the "Other"
input, treat it as Enrich seeded with those instructions: enter the
enrichment loop in 3.3 using the supplied text as the first round of revision
guidance, skipping the question phase if the instructions are already
substantive.
3.3 enrich — interactive enrichment
Treat this as a focused, per-candidate version of the /create-work-item
flow, seeded with the skeleton above:
Ask 1–3 focused business-context questions tailored to this
candidate. Fewer than /create-work-item's 3–5 because the source
already provides some context. Cover whichever of the following are
not already clear from the source:
- What pain point or problem does this address, and who experiences it?
- What is the desired outcome — what changes for people once this is done?
- Are there constraints, deadlines, or dependencies worth knowing?
- For bugs: what is the impact, and is it a blocker?
- Anything you are uncertain about, or that should be researched?
Spawn {web-search-researcher agent} when there is uncertainty
about any aspect of this candidate the model lacks confidence on —
business rules, domain concepts, competitive landscape, industry
standards, external technology. Skip only when the candidate is
self-contained and well-understood from the source plus user answers.
When in doubt, prefer to spawn research — over-asking is cheaper
than producing a vague enriched draft.
Update the draft combining source content, user answers, model
knowledge, and research findings. Re-present it as a structured
proposal that:
- Confirms or revises the kind
- Lists requirements drawn from source + enrichment
- Proposes specific, testable acceptance criteria — prefer
Given/When/Then for story/task; draw on domain knowledge and
research to make them thorough
- Lists dependencies (blocking and blocked) where known
- Keeps a
Drafting Notes section for any interpretations still
unresolved so the user can challenge them
- Lists remaining open questions in the
Open Questions section
Then use the AskUserQuestion tool with four options:
- Approve — accept this draft and move on to the next candidate
- Revise — update the draft with additional instructions (prompted after
via plain-text — do NOT use
AskUserQuestion for the instructions)
- Skip — discard this candidate entirely
- Accept as-is — discard enrichment and use the original source-only skeleton
Iterate on the same candidate. Challenge weak or untestable
acceptance criteria — when a criterion is not measurable, ask what a
passing test would look like and reformulate together. Do not accept
vague criteria into the draft. The candidate position (e.g. "Candidate
#N of M") does NOT advance during iteration: re-present the updated
draft for the same candidate and accept further free-form revision
instructions, looping as many times as needed. Only approve (or one
of the interrupts below) advances to candidate N+1. Once the user
explicitly approves, mark the candidate approved (enriched) and
advance to the next candidate.
The user may switch out of enrichment at any point by saying:
skip — exclude this candidate entirely. Discard any partial
enrichment work — questions answered, drafts re-proposed — and never
approve it later, even if accept remaining as-is is invoked on a
subsequent candidate.
accept as-is — replace the in-flight enriched draft with the
original 3.1 source-derived skeleton (NOT the partially enriched
state) and apply the 3.4 thin-draft assumptions note. The user is
saying "stop enriching this one; take the source-only version".
Honour these interrupts immediately on the turn they are received.
3.4 accept as-is — thin draft
Take the source-derived skeleton from 3.1 as the final draft for this
candidate. Append (or extend) the Drafting Notes section with the
following note verbatim (so future tooling like /refine-work-item
and human reviewers can detect thin drafts deterministically):
Extracted from source documents without interactive enrichment.
Acceptance criteria, dependencies, and kind may need refinement before
promoting from draft to ready.
If the candidate already has source-derived drafting notes, keep them
and add the verbatim note as a separate paragraph beneath.
Keep any Open Questions from the 3.1 skeleton — these are genuine
business unknowns that need resolution regardless of whether enrichment
happened. Mark the candidate approved (thin) and advance to the next.
3.5 skip
Exclude this candidate from the batch and advance to the next. Skipped
candidates never become approved later, even if a subsequent
accept remaining as-is is used.
3.6 accept remaining as-is — fast-path
Mark every remaining unreviewed candidate as approved (thin),
applying the same skeleton + assumptions note as 3.4. Do not ask
further questions. Already-skipped candidates stay skipped. Jump to
Step 4.
3.7 No accelerator work next-number calls in Step 3
accelerator work next-number is not called at any point during Step 3,
regardless of which option the user picks. Writing happens exclusively
in Step 4 after all approvals — enriched and thin — are collected.
Step 4: Write Work Items
Count approved (non-skipped) items: N.
If N is 0: print "No work items approved — nothing written." and exit
cleanly. Do NOT call accelerator work next-number.
Otherwise:
a. Compute target slugs — for each approved draft, derive a meaningful
kebab-case slug from its title.
b. Read configuration. Invoke each script by its bare path and use the
command's stdout as the named value — do not wrap the call in a VAR=$(…)
assignment, as the assignment (not the path) would become the command and escape
the rule:
- Run
accelerator config work id_pattern and use its
stdout as PATTERN.
- Run
accelerator config work default_project_code and
use its stdout as DEFAULT_PROJECT.
Run the bare path directly as an executable;
never prefix it with bash/sh/env (a wrapper prefix escapes the skill's
allowed-tools permission and forces an unnecessary prompt).
c. Suggest projected IDs: if PATTERN contains {project}, the
default project for each row is DEFAULT_PROJECT (warn and require
user amendment if DEFAULT_PROJECT is empty). If PATTERN lacks
{project}, no project column is shown.
Compute display-only projected IDs by calling, per distinct
project code:
accelerator work next-number --project <code> --count <count-for-that-project>
These calls do not commit numbers; the same call is re-issued after
every amendment to keep the table accurate.
d. Present an amendment table:
| # | Slug | Project | Projected ID |
| 1 | add-foo | PROJ | PROJ-0001 |
| 2 | fix-bar | PROJ | PROJ-0002 |
| 3 | update-baz | PROJ | PROJ-0003 |
Amend any rows? (`<rows> <PROJECT>` to set, `<rows> -` to revert to
default, `?` for help, `q` to cancel, blank to confirm.)
When PATTERN lacks {project}, omit the Project column and
render only | # | Slug | Projected ID |. The amendment prompt is
not shown in that case — proceed directly to confirmation.
Amendment grammar (canonical — same wording in every state):
<rows>: one row number (2) or comma-separated list (2,3,7).
Whitespace around commas is permitted (2, 3, 7) and trimmed.
<PROJECT>: a project code matching [A-Za-z][A-Za-z0-9]*.
<rows> -: revert the named rows to the default project code
(or to "no project" when no default is set).
?: re-display the amendment grammar reference plus the
unchanged table; no state change.
q: cancel the entire flow with no files written and no numbers
allocated.
- Blank input: confirms the current table state.
Validation: out-of-range row numbers re-prompt with
error: row N — out of range (valid: 1-M) without applying any
other amendments in the same input. Invalid project codes
re-prompt with error: row N — project value "<value>" must match [A-Za-z][A-Za-z0-9]* and discard the entire input
(no partial application). Unrecognised commands re-prompt with
error: unrecognised input. Type ? for help. On any rejection
the table reverts to its last valid state.
After every accepted amendment, recompute projected IDs by
re-issuing the per-project allocator calls (display only).
e. Project-aware slug-collision check before any allocation. For
each row, glob:
- When the pattern has
{project}:
{work_dir}/<project>-*-<slug>.md for the row's project — a
same-slug file under the same project is a real collision.
- Always (legacy fallback):
{work_dir}/[0-9][0-9][0-9][0-9]-<slug>.md — a same-slug legacy
file shadows the new file regardless of project.
Within the same batch, two amendments to the same project with
the same slug are also a collision. Same slug under different
projects (PROJ-0001-add-foo.md and OTHER-0001-add-foo.md) is
legitimate and not a collision.
If any collision is detected, report which slugs collide and
which existing files they match, abort without calling the
allocator, and ask the user to resolve the collision before
re-running.
f. Allocate per distinct project code, in original presentation
order:
accelerator work next-number --project <code> --count <count>
One call per distinct project code; --project is omitted when
the pattern lacks {project}. If any allocator call exits
non-zero, abort immediately and surface the error verbatim — do
not write any files. The whole batch fails atomically.
g. Substitute the allocated full IDs into approved drafts in
their original presented order. Within a single project, the
first row in presentation order takes the first allocated
number; multiple projects each preserve their own ordering. The
id frontmatter is always quoted ("PROJ-0001").
h. Populate frontmatter for every approved draft. Before writing
each file, capture metadata and substitute the unified base
fields into the template's frontmatter block:
Invoke
accelerator corpus metadata derive
once for the batch to obtain Current Date/Time (UTC):,
Current Revision:, and Repository Name:.
For each approved draft, substitute every field below
with the indicated value:
type: ← work-item
id: ← the allocated full ID, always quoted as a YAML
string (e.g. id: "PROJ-0001")
title: ← the draft's H1 title
date: ← the Current Date/Time (UTC): value
author: ← the author value resolved per the rules in
create-work-item/SKILL.md > author (config → VCS user →
prompt)
producer: ← extract-work-items
status: ← draft
last_updated: ← the same Current Date/Time (UTC): value
last_updated_by: ← the same value resolved for author
schema_version: ← 1 (bare integer, not quoted)
Optional linkage/foreign-ref keys are omit-by-default:
the template shows each as ""/[], but write a
key into the artifact only when it has a value, and omit it
entirely otherwise (do not carry the empty placeholder
through). By default a freshly extracted draft names none of
them.
parent: ← the parent work item's ID as a typed-linkage ref
("work-item:NNNN"). Fill when the source names a parent;
otherwise omit the key entirely.
blocks: ← list of typed-linkage refs to work items this
item blocks (["work-item:NNNN", ...]). Fill when blocking
edges are explicit in the source; otherwise omit the key.
blocked_by: ← list of typed-linkage refs to work items that
block this one. Prefer writing the canonical blocks: on the
other side; emit blocked_by: only when the canonical side
cannot be written, and omit it otherwise.
derived_from: ← list of typed-linkage refs to artifacts this
item is derived from (["plan:NNNN", ...]). Fill when
derivation is explicit; otherwise omit the key.
relates_to: ← list of typed-linkage refs to related
artifacts. Fill when relationships are explicit; otherwise
omit the key.
source: ← typed-linkage ref to the originating source
artifact ("issue-research:NNNN"). Fill when the source is a
meta artifact with an id; otherwise omit the key.
external_id: ← cross-system pointer (e.g. a Jira/Linear
key). Fill when the item is linked to an external tracker;
otherwise omit the key.
i. Write all N work item files. Each work item's References
section must include all source document paths the item was
extracted from. For deduplicated items that appeared in multiple
documents, list every contributing source under References,
one per line.
j. If a write error occurs mid-batch: report which numbers were
allocated, which files were written successfully, and which were
not — so the user can manually write the missing files with
their pre-assigned IDs. Do not retry writes silently and do not
call the allocator again to re-allocate; the original allocation
stands. The user needs to know the exact state.
Print a summary table:
Created the following work items:
| ID | Title | File |
|------------|---------|--------------------------------------|
| PROJ-0001 | [title] | `{work_dir}/PROJ-0001-slug.md` |
| OTHER-0001 | [title] | `{work_dir}/OTHER-0001-slug.md` |
...
Under the default {number:04d} pattern the ID column shows
0001, 0002, etc., and no project amendment table appears.
Validate the frontmatter: after writing, run the validator on each work
item written this batch
accelerator corpus frontmatter validate --file <each written work item path>
If any invocation exits non-zero, the document violates the canonical
frontmatter standard; report the emitted violation and fix the frontmatter
before completing.
Quality Guidelines
- Never call
accelerator work next-number before all approvals are collected.
The number space is shared and finite; consuming numbers for drafts the
user might still skip creates gaps that are impossible to clean up later.
- Never call
accelerator work next-number when N=0. An all-skipped session must
exit cleanly with no side effects.
- If
accelerator work next-number exits non-zero, abort immediately and surface
the script's error output verbatim — even if it emitted some numbers on
stdout before failing, treat the entire batch as failed.
- Verify all target slugs are free BEFORE calling
accelerator work next-number —
collision checks happen before number allocation, by slug pattern, since
numbers are not yet known. Under a {project} pattern the collision
check is project-aware: the same slug under two different project
codes (PROJ-0001-add-foo.md and OTHER-0001-add-foo.md) is
legitimate. Same-slug legacy NNNN-{slug}.md files always count as a
collision.
- Under a
{project} pattern, the amendment table prompts the user
to assign or override project codes per row before allocation. The
display-only projected IDs are recomputed after every amendment.
No numbers are committed until the user confirms with blank input.
- Numbers are assigned to approved drafts in their original presented
order, not in approval timestamp order. This makes outputs deterministic
and matches the order the user reviewed.
- Every written work item MUST include all source document paths in its
References section. For deduplicated items that appeared in multiple
documents, list every contributing source.
- Do not extract structural or navigational content (table of contents
entries, section headings with no requirements content, agenda items
with no actionable outcome) as candidate work items. If a heading just
organises content rather than describing work, skip it.
- Work item kind inference must use kinds read from the work item template
frontmatter (loaded at the top of this skill), not a hardcoded list.
Default to
story for items where the kind is genuinely ambiguous.
- All frontmatter fields defined in the work item template must be populated
in every written work item —
type (work-item), id matching the
assigned full ID, title matching the work item's title, date,
author, producer (extract-work-items), status (draft),
kind, priority (medium unless the source implies otherwise),
parent (empty string unless the source establishes a parent),
external_id (empty unless set), tags (a YAML array, possibly
empty), last_updated, last_updated_by, and schema_version: 1.
No field may contain unfilled placeholder text like [author] or
NNNN. The body H1 format is # <full-id>: <title> — kept in sync
with the frontmatter title: field.
date must use the work item template's YYYY-MM-DDTHH:MM:SS+00:00
format in UTC (e.g. obtained via date -u +%Y-%m-%dT%H:%M:%S+00:00).
author is sourced in this order: configuration if present, then the
source document's author/owner field if named, then the current git/jj
user identity, then — only if all of those fail — ask the user once
before writing the batch. Never write [author] or any placeholder.
- "Accept remaining as-is" only marks unreviewed candidates as approved
(thin) — it does not resurrect skipped candidates, and writing still
happens exclusively in Step 4 after the single
accelerator work next-number
call.
- Source-derived content stays faithful to what the source documents say.
Do not silently invent requirements. When you make an interpretation while
filling out the work item — about scope, stakeholders, terminology, or implied
approach — capture it in
Drafting Notes. Use Open Questions for genuine
unknowns the source leaves unanswered. A Drafting Note is worth writing
whenever the wrong interpretation would send someone in a meaningfully
different direction.
- The enrichment loop (3.3) is per candidate. Do not pre-generate enriched
drafts for the whole batch — enrichment depends on the user's answers
and the model's research, both of which differ per candidate. Build the
source-derived skeleton (3.1), present it (3.2), then enrich one
candidate at a time.
- Web research (
{web-search-researcher agent}) is a first-class step
inside enrichment. Spawn it whenever there is uncertainty about
domain, business, competitive, or technical aspects of the candidate.
Skip only when the candidate is self-contained and well-understood.
- Thin drafts (accepted as-is) and enriched drafts coexist in the same
work items directory. Thin drafts must carry the verbatim
Drafting Notes
entry recording non-enrichment so a future /refine-work-item invocation (or
manual review) can identify them as needing follow-up before promotion
from draft to ready.
- Acceptance criteria in enriched drafts must be specific and testable;
prefer Given/When/Then for story/task. Challenge any criterion that
is not measurable before accepting it into the draft.
!accelerator config instructions extract-work-items --fail-safe
1---2name: extract-work-items3description: Extract work items in batch from existing documents (specs, PRDs, research, plans, meeting notes, design docs). Use whenever the user wants to capture, pull out, or convert requirements, work items, user stories, bug reports, or actionable tasks from existing files into structured work items in meta/work/ — even if they don't say "extract" explicitly.4---56# Extract Work Items from Meta Documents78!`accelerator config context --skill extract-work-items --fail-safe`9!`accelerator config agents --fail-safe`1011If no "Agent Names" section appears above, use these defaults:12accelerator:reviewer, accelerator:codebase-locator,13accelerator:codebase-analyser, accelerator:codebase-pattern-finder,14accelerator:documents-locator, accelerator:documents-analyser,15accelerator:web-search-researcher.1617**Work items directory**: !`accelerator config path work --fail-safe`18**Research directory**: !`accelerator config path research_codebase --fail-safe`19**Plans directory**: !`accelerator config path plans --fail-safe`2021## Work Item Template2223The template below defines the sections and frontmatter fields that every24work item must contain. Read it now — the valid work item kinds live in the `kind`25field (not a hardcoded list elsewhere in this skill), and every written file26must populate every frontmatter field.2728!`accelerator config template work-item --fail-safe`2930You are tasked with identifying requirements, work items, and actionable31tasks within existing meta documents and helping the user capture them as32formal work items. Source documents typically tell you *what* work items should33exist but rarely give the full business context, testable acceptance34criteria, dependencies, and assumptions a good work item needs. The model,35the user, and web research fill those gaps.3637Extraction therefore proceeds in two layers:3839- **Source-derived content stays faithful.** Anything you draw from the40 source documents must reflect what they actually say — do not silently41 invent requirements that are not there.42- **Business-context gaps are surfaced.** The `Assumptions`, `Open Questions`43 and `Drafting Notes` sections serve different purposes when present, and all 44 matter:45 - **Assumptions** are interpretations you made that affect the work item's46 meaning. Flag one only when using the wrong interpretation would lead47 someone to build something different. Example: *"Interpreted 'users' as48 end users rather than internal staff — if wrong, scope changes."*49 - **Open Questions** are genuine unknowns the source raises but leaves50 unanswered that a reader or implementer needs resolved before work can51 proceed. Example: *"What does 'better results' mean — improved relevance, 52 faster delivery, or both?"*53 - **Drafting Notes** capture interpretations you made while filling out54 the work item — business-context calls, scope decisions, or technical55 choices that someone should review if they turn out to be wrong.56 Actively populate this section. If you inferred who the stakeholders57 are, what a vague term means, what the scope boundary is, or which58 technical approach the source implies, write it down.59 Examples: *"Treated this as a spike because no acceptance criteria are 60 defined — if implementation is already expected, kind and scope both 61 change."* Routine field selections (kind, priority, tags) don't need an 62 entry unless the choice reflects a substantive scope or meaning 63 interpretation that a reviewer should be aware of.6465For each selected candidate, you offer the user the choice between66*enriching* the work item interactively (with model knowledge, web research,67and a few focused questions, similar to `/create-work-item`) or *accepting68the source-derived skeleton as-is* and refining later. The enrichment69loop is per candidate, not pre-generated, so the work the model invests70matches the depth the user wants for each work item.7172## Initial Setup7374When this command is invoked:75761. **Check if parameters were provided**:7778- If one or more file paths were provided, note them as the target documents79- If no parameters provided, ask conversationally and helpfully which80 documents to work with. Give the user enough context to respond easily:81 briefly explain what kinds of sources work (specific files, planning docs,82 meeting notes, research, specs), mention that you can also scan all83 documents in the configured directories, and invite them to direct.84 Helpful examples matter more here than brevity — aim for something85 welcoming and informative rather than a single terse question.8687Wait for user input.8889## Process Steps9091### Step 1: Identify Source Documents92931. If specific files were provided, read them FULLY. Before reading,94 verify each path exists. If any path does not exist, report which95 paths are missing and ask the user to correct or remove them — do not96 silently skip them or proceed with an empty set.972. If scanning all meta documents:98 - Spawn a **{documents locator agent}** agent to find all documents in the99 configured research and plans directories (shown above)100 - Present the discovered documents and let the user select which to scan:101 ```102 I found the following documents:103104 **Research:**105 - `{research directory}/2026-04-08-topic.md` — Topic research106 - ...107108 **Plans:**109 - `{plans directory}/2026-04-19-feature.md` — Feature plan110 - ...111112 Which documents should I scan for work items? (enter numbers, "all", or113 specific paths)114 ```115 - Wait for user selection.116117### Step 2: Analyse Documents for Work Items1181191. **Spawn {documents analyser agent} agents** (one per document, in parallel)120 with instructions to identify requirements and actionable work items.121 Look for:122 - Explicit requirements ("The system must...", "Users need to...",123 "We need to implement...")124 - User stories ("As a..., I want..., so that...")125 - Feature descriptions and acceptance criteria126 - Bug reports with symptoms and expected behaviour127 - Open-ended investigations or unknowns requiring research128 - Multi-deliverable themes that span several stories129 - One-off tasks (migrations, infrastructure work, documentation)1301312. **Wait for all agents to complete.**1321333. **Deduplicate**: Where the same work item appears across multiple134 documents, merge the entries and record all source documents it came from.1351364. **Present discovered candidates** as a numbered list:137138```139I found the following actionable items across the scanned documents:1401411. **[Short title]** — [one-line description]142 Source: `{research directory}/2026-04-08-topic.md`1431442. **[Short title]** — [one-line description]145 Source: `{plans directory}/2026-04-19-feature.md`, `{research directory}/2026-04-08-topic.md`1461473. ...148149Which items would you like to create work items for? (enter numbers, "all",150or "none")151```152153If no actionable items are found across all documents, inform the user:154"No actionable items found in the provided documents." and exit cleanly.155156Wait for user selection. If the user selects "none", exit cleanly without157writing any files.158159### Step 3: Enrich and Approve (Per Candidate)160161For each selected candidate, in original presented order, build a162source-derived skeleton, present it, and let the user choose how much163enrichment to invest. Do NOT pre-generate drafts for the entire batch164in advance — enrichment can change a draft significantly, so generation165happens per candidate inside this loop.166167#### 3.1 Build the source-derived skeleton168169For the current candidate:170171- Infer the work item kind from its content using kinds read from the172 work item template's `kind` field:173 - clear bug reports with symptoms and expected/actual behaviour → `bug`174 - open-ended investigations with specific questions → `spike`175 - broad multi-deliverable themes → `epic`176 - specific single deliverables → `story`177 - one-off technical or operational tasks → `task`178 - Default to `story` for items where the kind is genuinely ambiguous.179- Draft a complete work item from the source content alone, using `XXXX`180 as the placeholder work item number.181- Kind-specific content placement:182 - bug: reproduction steps, expected/actual behaviour → `Requirements` section183 - spike: research questions, time-box, exit criteria → `Requirements` section184 - epic: initial story decomposition → `Requirements` section as a list185 - Do not rename or add sections beyond those in the work item template.186- Surface business-context gaps using the right section: put your187 interpretation in `Assumptions` (when you made a call and the wrong call188 changes what gets built). Put unanswered questions in `Open Questions` when 189 you genuinely cannot tell from the source. Populate `Open Questions` with 190 anything that would materially change scope, approach, or acceptance 191 criteria if resolved differently. Add a `Drafting Notes` entry for every 192 meaningful interpretation you made (scope boundaries, who193 stakeholders are, what vague terms mean, which technical approach is implied).194- Include all source documents for this item in the `References` section.195196#### 3.2 Present the skeleton with options197198```199Candidate #N of M: [title]200Kind (proposed): [kind]201Source: [paths]202203[work item content with XXXX placeholder, including Drafting Notes section]204205```206207Use the `AskUserQuestion` tool with four options:2082091. **Enrich** — interactive Q&A, web research where useful, then approve2102. **Accept as-is** — write this skeleton as a thin draft for later refinement2113. **Skip** — exclude from this batch2124. **Accept all remaining** — fast-path every remaining candidate as a thin draft213214Wait for the user's choice. If the user enters free-form text via the "Other"215input, treat it as **Enrich** seeded with those instructions: enter the216enrichment loop in 3.3 using the supplied text as the first round of revision217guidance, skipping the question phase if the instructions are already218substantive.219220#### 3.3 enrich — interactive enrichment221222Treat this as a focused, per-candidate version of the `/create-work-item`223flow, seeded with the skeleton above:2242251. **Ask 1–3 focused business-context questions** tailored to this226 candidate. Fewer than `/create-work-item`'s 3–5 because the source227 already provides some context. Cover whichever of the following are228 not already clear from the source:229 - What pain point or problem does this address, and who experiences it?230 - What is the desired outcome — what changes for people once this is done?231 - Are there constraints, deadlines, or dependencies worth knowing?232 - For bugs: what is the impact, and is it a blocker?233 - Anything you are uncertain about, or that should be researched?2342352. **Spawn `{web-search-researcher agent}`** when there is uncertainty236 about any aspect of this candidate the model lacks confidence on —237 business rules, domain concepts, competitive landscape, industry238 standards, external technology. Skip only when the candidate is239 self-contained and well-understood from the source plus user answers.240 When in doubt, prefer to spawn research — over-asking is cheaper241 than producing a vague enriched draft.2422433. **Update the draft** combining source content, user answers, model244 knowledge, and research findings. Re-present it as a structured245 proposal that:246 - Confirms or revises the kind247 - Lists requirements drawn from source + enrichment248 - Proposes specific, testable acceptance criteria — prefer249 Given/When/Then for story/task; draw on domain knowledge and250 research to make them thorough251 - Lists dependencies (blocking and blocked) where known252 - Keeps a `Drafting Notes` section for any interpretations still253 unresolved so the user can challenge them254 - Lists remaining open questions in the `Open Questions` section255256 Then use the `AskUserQuestion` tool with four options:257258 1. **Approve** — accept this draft and move on to the next candidate259 2. **Revise** — update the draft with additional instructions (prompted after260 via plain-text — do NOT use `AskUserQuestion` for the instructions)261 3. **Skip** — discard this candidate entirely262 4. **Accept as-is** — discard enrichment and use the original source-only skeleton2632644. **Iterate on the same candidate.** Challenge weak or untestable265 acceptance criteria — when a criterion is not measurable, ask what a266 passing test would look like and reformulate together. Do not accept267 vague criteria into the draft. The candidate position (e.g. "Candidate268 #N of M") does NOT advance during iteration: re-present the updated269 draft for the same candidate and accept further free-form revision270 instructions, looping as many times as needed. Only `approve` (or one271 of the interrupts below) advances to candidate N+1. Once the user272 explicitly approves, mark the candidate **approved (enriched)** and273 advance to the next candidate.274275The user may switch out of enrichment at any point by saying:276277- `skip` — exclude this candidate entirely. Discard any partial278 enrichment work — questions answered, drafts re-proposed — and never279 approve it later, even if `accept remaining as-is` is invoked on a280 subsequent candidate.281- `accept as-is` — replace the in-flight enriched draft with the282 original 3.1 source-derived skeleton (NOT the partially enriched283 state) and apply the 3.4 thin-draft assumptions note. The user is284 saying "stop enriching this one; take the source-only version".285286Honour these interrupts immediately on the turn they are received.287288#### 3.4 accept as-is — thin draft289290Take the source-derived skeleton from 3.1 as the final draft for this291candidate. Append (or extend) the `Drafting Notes` section with the292following note **verbatim** (so future tooling like `/refine-work-item`293and human reviewers can detect thin drafts deterministically):294295> Extracted from source documents without interactive enrichment.296> Acceptance criteria, dependencies, and kind may need refinement before297> promoting from `draft` to `ready`.298299If the candidate already has source-derived drafting notes, keep them300and add the verbatim note as a separate paragraph beneath.301Keep any `Open Questions` from the 3.1 skeleton — these are genuine302business unknowns that need resolution regardless of whether enrichment303happened. Mark the candidate **approved (thin)** and advance to the next.304305#### 3.5 skip306307Exclude this candidate from the batch and advance to the next. Skipped308candidates never become approved later, even if a subsequent309`accept remaining as-is` is used.310311#### 3.6 accept remaining as-is — fast-path312313Mark every remaining *unreviewed* candidate as **approved (thin)**,314applying the same skeleton + assumptions note as 3.4. Do not ask315further questions. Already-skipped candidates stay skipped. Jump to316Step 4.317318#### 3.7 No `accelerator work next-number` calls in Step 3319320`accelerator work next-number` is not called at any point during Step 3,321regardless of which option the user picks. Writing happens exclusively322in Step 4 after all approvals — enriched and thin — are collected.323324### Step 4: Write Work Items3253261. **Count approved (non-skipped) items: N.**3273282. **If N is 0**: print "No work items approved — nothing written." and exit329 cleanly. Do NOT call `accelerator work next-number`.3303313. **Otherwise**:332333 a. **Compute target slugs** — for each approved draft, derive a meaningful334 kebab-case slug from its title.335336 b. **Read configuration.** Invoke each script by its bare path and use the337 command's stdout as the named value — do **not** wrap the call in a `VAR=$(…)`338 assignment, as the assignment (not the path) would become the command and escape339 the rule:340341 - Run `accelerator config work id_pattern` and use its342 stdout as `PATTERN`.343 - Run `accelerator config work default_project_code` and344 use its stdout as `DEFAULT_PROJECT`.345346 Run the bare path **directly** as an executable;347 never prefix it with `bash`/`sh`/`env` (a wrapper prefix escapes the skill's348 `allowed-tools` permission and forces an unnecessary prompt).349350 c. **Suggest projected IDs**: if `PATTERN` contains `{project}`, the351 default project for each row is `DEFAULT_PROJECT` (warn and require352 user amendment if `DEFAULT_PROJECT` is empty). If `PATTERN` lacks353 `{project}`, no project column is shown.354355 Compute *display-only* projected IDs by calling, per distinct356 project code:357 ```358 accelerator work next-number --project <code> --count <count-for-that-project>359 ```360 These calls do not commit numbers; the same call is re-issued after361 every amendment to keep the table accurate.362363 d. **Present an amendment table**:364365 ```366 | # | Slug | Project | Projected ID |367 | 1 | add-foo | PROJ | PROJ-0001 |368 | 2 | fix-bar | PROJ | PROJ-0002 |369 | 3 | update-baz | PROJ | PROJ-0003 |370371 Amend any rows? (`<rows> <PROJECT>` to set, `<rows> -` to revert to372 default, `?` for help, `q` to cancel, blank to confirm.)373 ```374375 When `PATTERN` lacks `{project}`, omit the `Project` column and376 render only `| # | Slug | Projected ID |`. The amendment prompt is377 not shown in that case — proceed directly to confirmation.378379 **Amendment grammar** (canonical — same wording in every state):380381 - `<rows>`: one row number (`2`) or comma-separated list (`2,3,7`).382 Whitespace around commas is permitted (`2, 3, 7`) and trimmed.383 - `<PROJECT>`: a project code matching `[A-Za-z][A-Za-z0-9]*`.384 - `<rows> -`: revert the named rows to the default project code385 (or to "no project" when no default is set).386 - `?`: re-display the amendment grammar reference plus the387 unchanged table; no state change.388 - `q`: cancel the entire flow with no files written and no numbers389 allocated.390 - Blank input: confirms the current table state.391392 **Validation**: out-of-range row numbers re-prompt with393 `error: row N — out of range (valid: 1-M)` without applying any394 other amendments in the same input. Invalid project codes395 re-prompt with `error: row N — project value "<value>" must396 match [A-Za-z][A-Za-z0-9]*` and discard the entire input397 (no partial application). Unrecognised commands re-prompt with398 `error: unrecognised input. Type ? for help.` On any rejection399 the table reverts to its last valid state.400401 After every accepted amendment, recompute projected IDs by402 re-issuing the per-project allocator calls (display only).403404 e. **Project-aware slug-collision check** before any allocation. For405 each row, glob:406 - When the pattern has `{project}`:407 `{work_dir}/<project>-*-<slug>.md` for the row's project — a408 same-slug file under the *same* project is a real collision.409 - Always (legacy fallback):410 `{work_dir}/[0-9][0-9][0-9][0-9]-<slug>.md` — a same-slug legacy411 file shadows the new file regardless of project.412413 Within the same batch, two amendments to the same project with414 the same slug are also a collision. Same slug under different415 projects (`PROJ-0001-add-foo.md` and `OTHER-0001-add-foo.md`) is416 legitimate and not a collision.417418 If any collision is detected, report which slugs collide and419 which existing files they match, abort without calling the420 allocator, and ask the user to resolve the collision before421 re-running.422423 f. **Allocate per distinct project code**, in original presentation424 order:425 ```426 accelerator work next-number --project <code> --count <count>427 ```428 One call per distinct project code; `--project` is omitted when429 the pattern lacks `{project}`. If any allocator call exits430 non-zero, abort immediately and surface the error verbatim — do431 not write any files. The whole batch fails atomically.432433 g. **Substitute the allocated full IDs** into approved drafts in434 their original presented order. Within a single project, the435 first row in presentation order takes the first allocated436 number; multiple projects each preserve their own ordering. The437 `id` frontmatter is **always quoted** (`"PROJ-0001"`).438439 h. **Populate frontmatter** for every approved draft. Before writing440 each file, capture metadata and substitute the unified base441 fields into the template's frontmatter block:442443 1. Invoke444 `accelerator corpus metadata derive`445 once for the batch to obtain `Current Date/Time (UTC):`,446 `Current Revision:`, and `Repository Name:`.447 2. For each approved draft, **substitute** every field below448 with the indicated value:449 - `type:` ← `work-item`450 - `id:` ← the allocated full ID, always quoted as a YAML451 string (e.g. `id: "PROJ-0001"`)452 - `title:` ← the draft's H1 title453 - `date:` ← the `Current Date/Time (UTC):` value454 - `author:` ← the author value resolved per the rules in455 `create-work-item/SKILL.md > author` (config → VCS user →456 prompt)457 - `producer:` ← `extract-work-items`458 - `status:` ← `draft`459 - `last_updated:` ← the same `Current Date/Time (UTC):` value460 - `last_updated_by:` ← the same value resolved for `author`461 - `schema_version:` ← `1` (bare integer, not quoted)462463 Optional linkage/foreign-ref keys are omit-by-default:464 the template shows each as `""`/`[]`, but write a465 key into the artifact **only** when it has a value, and omit it466 entirely otherwise (do not carry the empty placeholder467 through). By default a freshly extracted draft names none of468 them.469470 - `parent:` ← the parent work item's ID as a typed-linkage ref471 (`"work-item:NNNN"`). Fill when the source names a parent;472 otherwise omit the key entirely.473 - `blocks:` ← list of typed-linkage refs to work items this474 item blocks (`["work-item:NNNN", ...]`). Fill when blocking475 edges are explicit in the source; otherwise omit the key.476 - `blocked_by:` ← list of typed-linkage refs to work items that477 block this one. Prefer writing the canonical `blocks:` on the478 other side; emit `blocked_by:` only when the canonical side479 cannot be written, and omit it otherwise.480 - `derived_from:` ← list of typed-linkage refs to artifacts this481 item is derived from (`["plan:NNNN", ...]`). Fill when482 derivation is explicit; otherwise omit the key.483 - `relates_to:` ← list of typed-linkage refs to related484 artifacts. Fill when relationships are explicit; otherwise485 omit the key.486 - `source:` ← typed-linkage ref to the originating source487 artifact (`"issue-research:NNNN"`). Fill when the source is a488 meta artifact with an id; otherwise omit the key.489 - `external_id:` ← cross-system pointer (e.g. a Jira/Linear490 key). Fill when the item is linked to an external tracker;491 otherwise omit the key.492493 i. **Write all N work item files**. Each work item's `References`494 section must include all source document paths the item was495 extracted from. For deduplicated items that appeared in multiple496 documents, list every contributing source under `References`,497 one per line.498499 j. If a write error occurs mid-batch: report which numbers were500 allocated, which files were written successfully, and which were501 not — so the user can manually write the missing files with502 their pre-assigned IDs. Do not retry writes silently and do not503 call the allocator again to re-allocate; the original allocation504 stands. The user needs to know the exact state.5055064. **Print a summary table**:507508```509Created the following work items:510| ID | Title | File |511|------------|---------|--------------------------------------|512| PROJ-0001 | [title] | `{work_dir}/PROJ-0001-slug.md` |513| OTHER-0001 | [title] | `{work_dir}/OTHER-0001-slug.md` |514...515```516517Under the default `{number:04d}` pattern the ID column shows518`0001`, `0002`, etc., and no project amendment table appears.519520**Validate the frontmatter**: after writing, run the validator on each work521item written this batch522523```bash524accelerator corpus frontmatter validate --file <each written work item path>525```526527If any invocation exits non-zero, the document violates the canonical528frontmatter standard; report the emitted violation and fix the frontmatter529before completing.530531## Quality Guidelines532533- Never call `accelerator work next-number` before all approvals are collected.534 The number space is shared and finite; consuming numbers for drafts the535 user might still skip creates gaps that are impossible to clean up later.536- Never call `accelerator work next-number` when N=0. An all-skipped session must537 exit cleanly with no side effects.538- If `accelerator work next-number` exits non-zero, abort immediately and surface539 the script's error output verbatim — even if it emitted some numbers on540 stdout before failing, treat the entire batch as failed.541- Verify all target slugs are free BEFORE calling `accelerator work next-number` —542 collision checks happen before number allocation, by slug pattern, since543 numbers are not yet known. Under a `{project}` pattern the collision544 check is **project-aware**: the same slug under two different project545 codes (`PROJ-0001-add-foo.md` and `OTHER-0001-add-foo.md`) is546 legitimate. Same-slug legacy `NNNN-{slug}.md` files always count as a547 collision.548- Under a `{project}` pattern, the amendment table prompts the user549 to assign or override project codes per row before allocation. The550 display-only projected IDs are recomputed after every amendment.551 No numbers are committed until the user confirms with blank input.552- Numbers are assigned to approved drafts in their original presented553 order, not in approval timestamp order. This makes outputs deterministic554 and matches the order the user reviewed.555- Every written work item MUST include all source document paths in its556 `References` section. For deduplicated items that appeared in multiple557 documents, list every contributing source.558- Do not extract structural or navigational content (table of contents559 entries, section headings with no requirements content, agenda items560 with no actionable outcome) as candidate work items. If a heading just561 organises content rather than describing work, skip it.562- Work item kind inference must use kinds read from the work item template563 frontmatter (loaded at the top of this skill), not a hardcoded list.564 Default to `story` for items where the kind is genuinely ambiguous.565- All frontmatter fields defined in the work item template must be populated566 in every written work item — `type` (`work-item`), `id` matching the567 assigned full ID, `title` matching the work item's title, `date`,568 `author`, `producer` (`extract-work-items`), `status` (`draft`),569 `kind`, `priority` (medium unless the source implies otherwise),570 `parent` (empty string unless the source establishes a parent),571 `external_id` (empty unless set), `tags` (a YAML array, possibly572 empty), `last_updated`, `last_updated_by`, and `schema_version: 1`.573 No field may contain unfilled placeholder text like `[author]` or574 `NNNN`. The body H1 format is `# <full-id>: <title>` — kept in sync575 with the frontmatter `title:` field.576- `date` must use the work item template's `YYYY-MM-DDTHH:MM:SS+00:00`577 format in UTC (e.g. obtained via `date -u +%Y-%m-%dT%H:%M:%S+00:00`).578- `author` is sourced in this order: configuration if present, then the579 source document's author/owner field if named, then the current git/jj580 user identity, then — only if all of those fail — ask the user once581 before writing the batch. Never write `[author]` or any placeholder.582- "Accept remaining as-is" only marks unreviewed candidates as approved583 (thin) — it does not resurrect skipped candidates, and writing still584 happens exclusively in Step 4 after the single `accelerator work next-number`585 call.586- Source-derived content stays faithful to what the source documents say.587 Do not silently invent requirements. When you make an interpretation while588 filling out the work item — about scope, stakeholders, terminology, or implied589 approach — capture it in `Drafting Notes`. Use `Open Questions` for genuine590 unknowns the source leaves unanswered. A Drafting Note is worth writing591 whenever the wrong interpretation would send someone in a meaningfully592 different direction.593- The enrichment loop (3.3) is per candidate. Do not pre-generate enriched594 drafts for the whole batch — enrichment depends on the user's answers595 and the model's research, both of which differ per candidate. Build the596 source-derived skeleton (3.1), present it (3.2), then enrich one597 candidate at a time.598- Web research (`{web-search-researcher agent}`) is a first-class step599 inside enrichment. Spawn it whenever there is uncertainty about600 domain, business, competitive, or technical aspects of the candidate.601 Skip only when the candidate is self-contained and well-understood.602- Thin drafts (accepted as-is) and enriched drafts coexist in the same603 work items directory. Thin drafts must carry the verbatim `Drafting Notes`604 entry recording non-enrichment so a future `/refine-work-item` invocation (or605 manual review) can identify them as needing follow-up before promotion606 from `draft` to `ready`.607- Acceptance criteria in enriched drafts must be specific and testable;608 prefer Given/When/Then for story/task. Challenge any criterion that609 is not measurable before accepting it into the draft.610611!`accelerator config instructions extract-work-items --fail-safe`