Create Work Item
!accelerator config context --skill create-work-item --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
Active integration: !accelerator config work integration --fail-safe
The Active integration line gates the post-draft push offer (Step 5). The
accelerator config work integration command above prints an empty line
when no integration is configured, so branch on the string: a non-empty value means
integration configured (offer the push); an empty value means not configured
(no push offer — behave exactly as today). This is the single resolution of the
active tracker for this invocation; the push dispatcher is told which tracker to
use from this value, so the gate and the route cannot diverge.
Work Item Template
The template below defines the sections and frontmatter fields that every
work item must contain. Read it now — use it to guide what information you gather
in Step 1 and what structure you produce in Steps 3–4.
!accelerator config template work-item --fail-safe
You are tasked with guiding the user through creating a well-formed work item —
a structured document capturing a feature, bug, task, spike, or epic for
tracking and implementation. This is a collaborative, challenging conversation:
the model contributes its own knowledge and research alongside the user's input
rather than simply transcribing what the user says. The goal is a work item that
is well-reasoned and well-specified — one that would stand on its own without
needing the author present to explain it.
The work item template has three sections that look similar but capture
different things — populate each deliberately:
- Assumptions are interpretations you made that affect what gets built.
Flag one only when using the wrong interpretation would lead someone to
build something different. Example: "Treating 'users' as end users
rather than internal staff — if wrong, scope changes."
- Open Questions are genuine unknowns 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, where the scope boundary sits, or which technical
approach is implied, write it down. Routine field selections (kind,
priority, tags) don't need an entry unless the choice reflects a
substantive scope or meaning interpretation a reviewer should be aware
of.
Step 0: Parameter Check
When this command is invoked:
If an argument was provided:
First, try to resolve the argument as a reference to an existing
work item by invoking the resolver:
accelerator work resolve <argument>
The resolver respects work.id_pattern and accepts paths, full IDs
(PROJ-0042), legacy bare numbers (0042), and short numbers (42,
resolved against work.default_project_code when set).
- Exit 0 (single match): the resolver echoes the absolute path on
stdout. Continue to frontmatter validation below.
- Exit 1 (input invalid — neither path, full ID, nor bare number):
proceed to topic-string handling below; treat the argument as a
topic.
- Exit 2 (ambiguous match): the resolver lists every candidate
with a source-category tag (
legacy, project-prepended,
pattern-shape, or a project code). Present the list to the user
and ask them to disambiguate by re-running with a full ID (e.g.
PROJ-0042) or a path.
- Exit 3 (no match): print
"No work item matching <argument> — interpreting as topic string. If that's wrong, abort and re-run with a different argument (or /list-work-items to find a valid reference)." and proceed to
topic-string handling below.
- Exit 6 (path outside the work directory): the argument names a
real file that lies outside the managed work directory, so it is not
a topic string. Stop, print the resolver's error, and offer to run
/list-work-items.
Frontmatter validation (only reached after a file was successfully
resolved). Run:
accelerator work show <path> --field id
The own-identity field is id on unified-shape files and
work_item_id on legacy files; work show resolves both
transparently, so either key name passed here would return the
same value.
If it exits non-zero (frontmatter missing or unclosed), print:
Could not parse frontmatter in <path> — the file may be corrupted.
Re-open it and check that the YAML frontmatter is bracketed by two
`---` lines and contains all nine required fields.
and exit without spawning agents or writing any file. (The file clearly
resolved, so the user intended a path — no fallback applies.)
If validation passes, read the file fully (frontmatter and body) and
cache the identity fields in conversation state:
id (or work_item_id on legacy files), date, author, status,
title, kind, priority, parent, tags. For any missing
optional field, use the template default — do not abort. Set the conversation into
enrich-existing mode with existing_work_item_path cached, and
skip directly to Step 1 in that mode — do not run the vagueness check.
Topic-string handling: if no resolution succeeded (discriminators
did not trigger, or they triggered with a fallback warning), check
whether the argument is too vague (no clear deliverable or subject).
- Vague examples: "improve things", "fix the API", "add more features"
- Clear examples: "add full-text search to the docs index page",
"fix login timeout after password reset"
- If vague, ask at least one clarifying question and wait for a more
specific description before proceeding to Step 1.
- If clear, proceed directly to Step 1.
If no argument was provided, respond with:
I'll help you create a well-specified work item through a collaborative conversation.
To get started, describe what you want to achieve — what's the problem or goal?
For example: "add full-text search to the docs index page", or "users can't log in after resetting their password"
I'll ask a few questions to understand the problem space, do some research, then
work with you to shape a thoroughly reasoned work item.
Then wait for the user's input. Apply the same vagueness check to their
response — if still vague, ask a clarifying question before proceeding to
Step 1.
Step 1: Gather Business Context
Once the topic is clear, ask 3–5 open questions to understand the business
context before investigating. Consult the work item template sections above to
understand what the work item will need — use them to guide which questions are
worth asking. Tailor the questions to the topic, but cover:
- 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?
- Does the user have a solution or approach in mind? If so, surface it and
ask whether it's a constraint or a preference to be explored further.
- Are there any constraints, deadlines, or dependencies worth knowing?
- For bug topics: what is the impact, and is it a blocker?
- Is there anything you are uncertain about, or that I should research?
Ask all relevant questions at once rather than one at a time. Wait for the
user's answers before proceeding to Step 2.
In enrich-existing mode
Do not ask the broad discovery questions above. Instead:
Identify which body sections of the existing file are substantive (real
content beyond [bracketed placeholder] text) and which are gaps (empty,
placeholder-only, or missing entirely). Tag each gap with exactly one of
the literal tokens:
empty — section is absent or contains no content
placeholder-only — section contains only template [...] blocks
instructional-prose — section contains the template's instructional
prose carried over verbatim (e.g. "Describe the business value of this
work item here…")
partial — section contains one or more substantive sentences alongside
residual placeholders
Use the literal token; do not paraphrase. The eval grader pattern-matches
on these exact strings.
Present the gap analysis briefly:
I've read the existing work item (<resolved path>). Here's what looks
complete and what still needs work:
Complete: [section list, or "none"]
Gaps:
- <Section> (<tag>)
- ...
I'll ask targeted questions about the gaps.
Ask only questions that address the identified gaps. Do not re-ask
questions whose answers are already substantively present in the file.
If the existing content is rich enough that no obvious gaps remain,
briefly confirm this and ask what the user wants to add or improve, then
proceed to Step 2.
Step 2: Investigate
Using the topic and business context from Step 1, run investigation agents
in parallel:
Spawn {documents locator agent} to search {work_dir} only —
look for existing work items with similar titles, descriptions, or scope.
Do not search research documents, plans, or other directories — work items
capture business requirements, not implementation details.
Spawn {web-search-researcher agent} when there is uncertainty or a need
for richer context about any aspect of the topic — business rules, domain
concepts, competitive landscape, industry standards, external technology, or
anything the model lacks confidence on. Skip this agent only when the topic
is entirely self-contained and well-understood from the user's description.
When in doubt, prefer to spawn research — over-asking is cheaper than
producing a vague or poorly-grounded proposal.
Run both agents in parallel where both are warranted.
Once agents complete, synthesise findings — what the model knows from training,
what research turned up, what prior work items exist — as the foundation for Step 3.
If a similar existing work item is found: Check its status.
If the status is done, abandoned, or superseded — mention the work item
briefly and note it is already closed, then continue creating the new one.
Otherwise — surface the work item and offer the user numbered options, for
example:
- Proceed with a new work item (if the scope genuinely differs)
- Exit and update the existing work item instead (use
/update-work-item once
available; for now, update it manually)
- Continue creating a new work item linked to the existing one as a parent
Adapt the options to what makes sense given the work item's kind and status.
Do not silently continue or modify the existing work item inline. Wait for
the user's choice before proceeding.
In enrich-existing mode: exclude the resolved input file from the
similarity scan. The {documents locator agent} search of {work_dir} will
find the file being enriched; do not surface it as a "potential duplicate" of
itself. Other near-duplicates discovered are handled per the unchanged rules
above.
Step 3: Propose and Refine
Using the business context and investigation synthesis, the model leads with
a structured proposal. Do not ask the user to generate requirements or
acceptance criteria from scratch — propose them and invite challenge.
- Recommend a work item kind with a brief rationale. Valid kinds come from
the work item template's
kind field (loaded at the top of this skill) — do
not hardcode the list. Default to story when the kind is genuinely
ambiguous.
- Draft requirements drawn from the business context and research.
- Draft acceptance criteria — specific and testable; prefer Given/When/Then
format for story/task. Draw on domain knowledge and research to make these
thorough, not just what the user explicitly mentioned.
- Surface interpretations and gaps using the right section:
- Put scope-changing interpretations you made in
Assumptions and invite
the user to confirm or correct them.
- Put genuine unknowns that block progress in
Open Questions.
- Put every meaningful drafting-time interpretation (who stakeholders are,
what vague terms mean, scope boundaries, implied technical approach) in
Drafting Notes so a reviewer can challenge them.
Present as a structured proposal:
Based on what you've told me and my research, here's what I think this work item needs:
**Suggested kind**: [kind]
**Rationale**: [one sentence]
**Requirements I'd suggest**:
- [requirement]
**Out of scope** (explicitly not captured here):
- [item]
**Acceptance criteria I'd suggest**:
- Given/When/Then...
**Assumptions I've made** (scope-changing calls — confirm or correct):
- [assumption]
**Drafting Notes** (interpretations a reviewer should see):
- [interpretation — e.g. who stakeholders are, what a vague term means,
scope boundary, implied technical approach]
**Open questions** (unknowns to resolve before work begins):
- [anything the user should clarify before drafting]
Wait for the user to validate, push back, or refine. Challenge vague or
untestable responses — if an acceptance criterion is not measurable (e.g.,
"it works correctly"), first ask a clarifying question to understand the
intent ("what would a passing test actually look like here?"). Only after
understanding the intent should you help reformulate it into something
testable. Do not accept vague criteria into the draft. Iterate until the
proposal is well-specified and agreed.
In enrich-existing mode
Do not lead with a from-scratch proposal. Instead present a section-by-section
review and augmentation:
Here's how the existing work item reads against my research, with proposed
additions for the gaps:
**[Section name]** — [complete | needs improvement: <reason> | missing]
[existing content excerpt or note that it is missing]
[proposed addition or replacement, when applicable]
[repeat per section]
**Title**: [keep / propose new title with rationale]
**Kind**: [keep existing <kind> / propose change to <kind> with rationale]
**Priority**: [keep / propose change with rationale]
**Parent**: [keep / propose change]
**Tags**: [keep / propose additions]
**Status**: [keep <cached> — say so if you'd like to transition it]
Apply the canonical Identity Field Rules (see Quality Guidelines): propose
only the fields marked Proposable; never propose changes to immutable fields;
surface a status transition only if the user makes a direct explicit request
for one (the listing offers the affordance but never proposes a change
unsolicited).
The refinement loop in this step (challenging untestable criteria, vague
requirements, etc.) applies equally to existing and proposed content.
Step 4: Draft Work Item
Draft a complete work item from the agreed proposal using the template
structure loaded at the top of this skill. Use NNNN as the placeholder
work item number throughout. Do NOT call accelerator work next-number at this step.
Kind-specific content placement:
- story/epic: open the
Summary section with a user story statement —
"As a [role], I want [goal], so that [benefit]." — before the
descriptive sentences
- bug reproduction steps, expected/actual behaviour →
Requirements section
- spike research questions, time-box, exit criteria →
Requirements section
- epic initial stories →
Requirements section as a list
- Do not rename or add sections beyond those defined in the work item template
Populate the References section with any external material that
informed the work item — research artefacts surfaced by the web researcher,
related work items found in Step 2, design docs, or source specs. Leave it
empty if nothing external was consulted; do not invent references.
Populate the Drafting Notes section with the interpretations
carried over from the agreed proposal. If there were none (the user
confirmed every call), the section may be omitted or left as an empty
list — but do not leave placeholder bracketed text in it.
Present the full draft to the user:
Here's my draft work item. Please review and let me know if you'd like any
changes before I write it to disk:
[draft content]
- Continue to challenge during the review loop — flag untestable criteria,
vague requirements, or gaps surfaced by research that remain unaddressed.
Iterate until the user explicitly approves.
accelerator work next-number is never called during this loop.
In enrich-existing mode
Produce a complete updated draft incorporating the existing content plus the
additions approved in Step 3.
Apply the canonical Identity Field Rules (see Quality Guidelines) when
filling frontmatter — the rules are the single source of truth for which
fields are immutable, preserved, or proposable.
Apply the H1 sync rule (see Quality Guidelines).
Apply the Script avoidance rule (see Quality Guidelines).
Present the full updated draft, framed as an update preview:
Here's the updated work item. The Step 5 confirmation will name the file
path and ask for explicit approval before any write:
[draft content]
Continue to challenge during review — apply the same rules as the
normal-path Step 4. Iterate the draft until the user is happy with it. Do
not treat a "looks good" mid-iteration as approval to write — that
approval is gated by Step 5's single confirmation.
Step 5: Write Work Item
- Call
accelerator work next-number to get the next full ID under the
configured pattern:
accelerator work next-number
The output is the full ID (0001 under default {number:04d},
PROJ-0001 under {project}-{number:04d} with
work.default_project_code: "PROJ"). The allocator reads the pattern
and default project code from configuration; pass --project CODE if
the user explicitly wants a non-default project.
If the command exits non-zero (e.g., overflow, missing project value),
abort immediately and surface the error message verbatim — do not
proceed.
Resolve the target path: {work_dir}/<full-id>-kebab-slug.md
where <full-id> is the allocator's output and the slug is a
meaningful kebab-case summary of the title (not raw input text).
Check that the target path does not already exist. If it does, abort:
Path {path} already exists — another session may have written a work item
concurrently. Please re-run /create-work-item.
Create the work items directory if it does not exist.
Resolve author: configuration if present, then the current git/jj
user identity, then — only if both fail — ask the user once. Never pass
a placeholder. This value feeds both branches below.
No integration configured — write via accelerator work create.
Skip this step (go to step 7) when an integration is configured; the
push state machine in step 8 governs that case's single write instead.
- Write the drafted body (H1 through References, everything approved
across Steps 1–4) to a scratch file, with the
NNNN placeholder
still literally present everywhere it appears (the H1 line and
anywhere else) — do not substitute it yourself. work create
performs the one real NNNN → allocated-ID substitution as part of
the same atomic write that decides the ID, so the approved content
can never end up with an id/H1 mismatch.
- Call the dispatcher directly:
accelerator work create "<title>" <kind> <priority> \
--status draft \
--author "<resolved author>" \
--producer create-work-item \
--body-file <scratch-file> \
[--parent "work-item:NNNN"] \
[--tag <value>]... [--block "work-item:NNNN"]... \
[--blocked-by "work-item:NNNN"]... \
[--derived-from "plan:NNNN"]... [--relates-to <ref>]... \
[--source "issue-research:NNNN"] [--project <code>]
Include each bracketed flag only when that field has a value —
work create itself omits the corresponding frontmatter key when
the flag is absent, matching the template's own omit-when-empty
convention, so no separate omission logic is needed here. --tag/
--block/--blocked-by/--derived-from/--relates-to are each
repeatable for multiple values. external_id has no flag — work create never writes it (nothing to sync yet); this matches today's
behaviour of omitting it from a fresh draft.
3. If the command exits non-zero, surface its stderr message verbatim
and abort — do not retry and do not attempt a manual Write.
Otherwise its stdout is the path of the written file. Skip to
step 8.
Push state machine (only when Active integration is non-empty;
otherwise this whole step is skipped and the file was already written in
step 6). The drafted frontmatter is held in memory — no file exists yet.
Offer the push using the fail-safe gate. Preview the fields the push
would resolve through the dispatcher's own dry-run so the single
keystroke maps to an understood, non-destructive result. Write the
drafted body to a temp file and run:
accelerator work create "<title>" <kind> <priority> \
--push --dry-run --body-file <body-tmp>
It resolves the tracker from Active integration, contacts it to
resolve the fields, writes nothing, and creates no remote issue.
Branch on its exit and the line it prints on stdout:
- Exit 0, jira →
jira\t<issue type>\t<type source>\t<project>\t<project source>.
Render the type and project with their sources. A <project source> of
unresolvable means the configured work.default_project_code names a
project the tracker does not hold — surface that as a pre-create
failure before the gate (name work.default_project_code) and do
not offer the push; save locally instead. A default source is a
benign fallback, not a failure.
- Exit 0, linear →
linear\t(no user-resolvable type/project fields)
(the team and issue-type catalogue are fixed by /init-linear).
Offer the push.
- Exit 70 → the tracker was unreachable (distinct from an
unresolvable value). Do not hard-block: tell the user the preview
could not be resolved and offer to save locally now, or retry the
preview. The push itself carries its own retry (below), so a transient
outage here must not strand the draft.
Then, when a push is still on the table:
Use the AskUserQuestion tool with two options:
- Yes, push to [tracker] now — create the remote issue and save
locally
- No, save locally only — save as unsynced; push it later with
/sync-work-items (it offers to create unsynced local drafts on the
remote), which shares this external_id contract.
On decline → write the file now with external_id omitted (unsynced)
via the accelerator work create call from step 6 (no --push), then go
to step 8.
On accept → run the same accelerator work create call with
--push added (never a re-derived tracker — the CLI reads Active
integration itself):
accelerator work create "<title>" <kind> <priority> \
--status draft --author "<resolved author>" --producer create-work-item \
--push --body-file <body-tmp> [--parent …] [--tag …]… [linkage flags…]
This is one call that creates the remote issue and writes the local
file atomically — the retryable/terminal decision, the retry, and the
duplicate-create guard all live inside work create --push; do not
drive a retry loop yourself. On stdout it prints the written path on the
first line and <keyword>\t<external_id> on the second, where the keyword
is one of write-once, local-save, or loud-terminal. Render per the
table below.
Outcome table (work create --push returns the keyword; you render the
message). The 70-retryable / 71-terminal contract the keywords derive from
is documented in exit_codes and cross-referenced by work create --help:
| Second-line keyword |
Exit |
Action |
write-once |
0 |
The remote issue was created and the file written with its external_id. Confirm success (step 8), echoing the returned identifier. |
local-save |
0 |
The push could not be sent (retryable and retried once, or the tracker is not available/recognised/configured) and nothing left the machine — the file was written unsynced. Tell the user it saved unsynced and can be pushed later via /sync-work-items. |
loud-terminal |
71 |
A terminal failure at or after the create, or the create succeeded but the write-back failed — a remote issue may already exist. The file was saved unsynced. Print loud non-idempotent guidance naming the saved path: do not blindly re-run /create-work-item; check the tracker, and if the issue exists reconcile via /sync-work-items or set external_id: <KEY> by hand. |
Because the create and the local write are one atomic CLI operation, there
is no in-skill window where a remote issue exists but no file does — that
window, and its pending_push recovery marker, are handled inside the CLI.
The pre-create preview is a live, credentialed round-trip now, so a clean
preview does not guarantee the push succeeds; the authoritative outcome is
the keyword above.
Print a confirmation:
Work item created: `<path>`
<path> is always the first stdout line of the accelerator work create
call that wrote the file — whether step 6 (no integration) or step 7
(--push) — since its slugification is authoritative; do not re-derive it
or assume it matches step 2's preview path. When the item was saved unsynced
(decline, local-save, or loud-terminal), say so: Work item created (unsynced): … — push later with /sync-work-items.
In enrich-existing mode
Do not call accelerator work next-number. The target path is the
resolved existing_work_item_path cached in Step 0.
At-write identity-swap check (best-effort guard): immediately before
the confirmation prompt, re-read the target file's own identity from
disk via:
accelerator work show <existing_work_item_path> --field id
(This returns the value of id: on unified-shape files and falls
back to work_item_id: on legacy files.)
- If the command exits non-zero (file gone or frontmatter unparseable since
Step 0), abort with:
"Error: <path> is no longer present or its frontmatter is unparseable. Your proposed draft is below — copy it before re-running /create-work-item: <draft>"
- If the on-disk identity differs from the value cached in Step 0,
abort with:
"Error: <path> changed identity since Step 0 (was <cached>, now <current>). Your proposed draft is below — copy it before re-running /create-work-item to refresh: <draft>"
Single confirmation gate: present the path and a per-section change
summary, then require explicit y/n approval before any write:
I'm about to overwrite <existing_work_item_path>.
Sections changed:
Added: [...]
Modified: [...]
Frontmatter changed:
<field>: <cached> → <new> # repeated per modified field
(status: <cached> unchanged) # always show status explicitly
Sections preserved verbatim: <count> (<terse list or "none">)
Frontmatter fields preserved verbatim: id, date, author
[+ any unmodified proposable fields]
Then use the AskUserQuestion tool with two options:
- Yes, proceed — overwrite the work item with the changes shown
- No, cancel — make no changes
Confirmation interpretation (fail-safe):
- Exactly
y or Y (after trimming whitespace): proceed to step 5.
- Exactly
n or N: go to step 8.
- Anything else (empty input, "yes", "go ahead", "looks good but also...",
paragraph of feedback): treat as
n. Print:
"Did not recognise <response> as y/n — staying in review. What change would you like before I overwrite?" and go to step 8.
On y — substitute cached immutable fields, then write: immediately
before invoking the Write tool, re-read the cached immutable identity fields
(id, date, author) from conversation state and overwrite the
corresponding frontmatter lines in the draft text with those exact values,
even if they appear unchanged. Also write last_updated: to the current
Current Date/Time (UTC): value and last_updated_by: to the resolved
author. This textual substitution defends against drift during Step 4
iteration.
Write the file to existing_work_item_path. The path-existence guard from
the normal flow does not apply — overwrite is the intended behaviour.
Print:
Work item updated: <existing_work_item_path>
On n or unrecognised: stay in Step 4 / Step 5 review and iterate.
Do not re-run the identity-swap check until the next y; do not write.
Validate the frontmatter: after the work item is written, run
accelerator corpus frontmatter validate --file <written work item path>
If it exits non-zero, the document violates the canonical frontmatter
standard; report the emitted violation and fix the frontmatter before
completing.
Quality Guidelines
Never write a file without explicit user approval.
Never call accelerator work next-number before the user approves the draft.
The slug must be a meaningful kebab-case title, not raw input text.
Work item kind must come from the work item template's kind field (loaded at
the top of this skill), not a hardcoded list. Default to story when 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 (a quoted YAML string — see contract below), title
matching the user-approved title, date, author, producer
(create-work-item), status (draft), kind, priority (medium
unless the user specified otherwise), parent (empty string unless a
parent was established), 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>
where <full-id> is whatever the configured work.id_pattern
produces — kept in sync with the frontmatter title: field.
id frontmatter type contract: the own-identity field is
always a quoted YAML string, regardless of the configured
pattern. Files created under default {number:04d} write
id: "0001"; files created under {project}-{number:04d} write
id: "PROJ-0001". This contract is uniform so consumers can read
the field as a string without coercion. See
skills/config/configure/SKILL.md > work for the full contract.
Legacy files carry the same value under work_item_id:; work show
returns either key transparently so consumers do not need to know
which shape is on disk.
Identity Field Rules (apply in enrich-existing mode):
- Immutable —
id (or work_item_id on legacy files), date,
author. Cached from the source file in Step 0; never proposed for
change; the model substitutes the cached values back into the draft
frontmatter at write time (Step 5 step 5) as a defence against drift
during Step 4 iteration. This is a textual substitution the model
performs — the eval suite verifies the written file's values match
the cached values, which is the strongest guarantee the grader-
mediated harness can provide.
- Preserved unless explicitly changed —
status. Defaults to the cached
value. May only change if the user makes an explicit, direct request during
the conversation (e.g. "set status to in-progress"). The model must not
propose a status change unsolicited; if the user makes only an oblique
reference (e.g. "this is now in flight"), the model asks a clarifying
question rather than infer the transition. A proposed transition is shown
explicitly (e.g. "draft → in-progress") and requires confirmation in Step 3
before acceptance. The status: draft default applies only to
newly-created work items, not to enrichment.
- Proposable in Step 3 —
title, kind, priority, parent, tags.
Default to the cached values; can be replaced after explicit user agreement
in Step 3's augmentation review.
H1 sync (enrich-existing mode): the body H1 is # <id>: <title>,
using the cached immutable id (the full ID produced by the configured
pattern, never a placeholder; sourced from work_item_id on legacy
files) and the title as confirmed or replaced in Step 3.
Script avoidance (enrich-existing mode): accelerator work next-number is never called. The number is already cached. The path-existence guard in Step 5
does not apply — overwrite is the intended behaviour once the at-write
identity-swap check passes.
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
current git/jj user identity, then — only if both fail — ask the user
once before writing the file. Never write [author] or any placeholder.
Summary and Requirements must have substantive content — no
[bracketed placeholder text] in the final written file. The same
applies to every other body section that is populated: if a section
would only contain a bracketed placeholder, remove the placeholder and
leave the section empty (or omit optional sections entirely).
- Acceptance criteria must be specific and testable; prefer Given/When/Then
format. Challenge any criterion that is not measurable before accepting it.
- Populate
Drafting Notes with every meaningful interpretation made while
filling out the work item — who stakeholders are, what a vague term means,
where scope boundaries sit, which technical approach is implied. Use
Assumptions for scope-changing calls the user should confirm. Use
Open Questions for genuine unknowns that block progress. These three
sections serve different purposes; don't collapse them.
- Populate
References with any external material that informed the
work item — research artefacts, related work items, design docs, source specs.
Leave it empty if nothing external was consulted; do not invent
references.
- The model must contribute its own knowledge and research to the proposal —
not simply transcribe the user's answers. Bring domain expertise, surfaced
research, and reasoned suggestions to every work item.
- Restrict
{documents locator agent} to {work_dir} only. Do not search
research documents, plans, or the codebase — work items are about business
requirements, not implementation details.
- Spawn
{web-search-researcher agent} whenever there is uncertainty about any
aspect of the topic — business rules, domain concepts, competitive landscape,
industry standards, external technology, or otherwise. When in doubt,
prefer to spawn research — over-asking is cheaper than producing a
vague or poorly-grounded proposal.
- If
accelerator work next-number exits non-zero, abort and surface the
error message verbatim.
!accelerator config instructions create-work-item --fail-safe
1---2name: create-work-item3description: Interactively create a well-formed work item. Use when capturing a feature, bug, task, spike, or epic as a structured work item in meta/work/.4---56# Create Work Item78!`accelerator config context --skill create-work-item --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**Active integration**: !`accelerator config work integration --fail-safe`1920The **Active integration** line gates the post-draft push offer (Step 5). The21`accelerator config work integration` command above prints an **empty line**22when no integration is configured, so branch on the **string**: a non-empty value means23*integration configured* (offer the push); an empty value means *not configured*24(no push offer — behave exactly as today). This is the single resolution of the25active tracker for this invocation; the push dispatcher is told which tracker to26use from **this** value, so the gate and the route cannot diverge.2728## Work Item Template2930The template below defines the sections and frontmatter fields that every31work item must contain. Read it now — use it to guide what information you gather32in Step 1 and what structure you produce in Steps 3–4.3334!`accelerator config template work-item --fail-safe`3536You are tasked with guiding the user through creating a well-formed work item —37a structured document capturing a feature, bug, task, spike, or epic for38tracking and implementation. This is a collaborative, challenging conversation:39the model contributes its own knowledge and research alongside the user's input40rather than simply transcribing what the user says. The goal is a work item that41is well-reasoned and well-specified — one that would stand on its own without42needing the author present to explain it.4344The work item template has three sections that look similar but capture45different things — populate each deliberately:4647- **Assumptions** are interpretations you made that affect what gets built.48 Flag one only when using the wrong interpretation would lead someone to49 build something different. Example: *"Treating 'users' as end users50 rather than internal staff — if wrong, scope changes."*51- **Open Questions** are genuine unknowns a reader or implementer needs52 resolved before work can proceed. Example: *"What does 'better results'53 mean — improved relevance, faster delivery, or both?"*54- **Drafting Notes** capture interpretations you made while filling out the55 work item — business-context calls, scope decisions, or technical choices56 that someone should review if they turn out to be wrong. Actively57 populate this section. If you inferred who the stakeholders are, what a58 vague term means, where the scope boundary sits, or which technical59 approach is implied, write it down. Routine field selections (kind,60 priority, tags) don't need an entry unless the choice reflects a61 substantive scope or meaning interpretation a reviewer should be aware62 of.6364## Step 0: Parameter Check6566When this command is invoked:67681. **If an argument was provided**:6970 First, **try to resolve the argument as a reference to an existing71 work item** by invoking the resolver:7273 ```74 accelerator work resolve <argument>75 ```7677 The resolver respects `work.id_pattern` and accepts paths, full IDs78 (`PROJ-0042`), legacy bare numbers (`0042`), and short numbers (`42`,79 resolved against `work.default_project_code` when set).8081 - **Exit 0** (single match): the resolver echoes the absolute path on82 stdout. Continue to frontmatter validation below.83 - **Exit 1** (input invalid — neither path, full ID, nor bare number):84 proceed to topic-string handling below; treat the argument as a85 topic.86 - **Exit 2** (ambiguous match): the resolver lists every candidate87 with a source-category tag (`legacy`, `project-prepended`,88 `pattern-shape`, or a project code). Present the list to the user89 and ask them to disambiguate by re-running with a full ID (e.g.90 `PROJ-0042`) or a path.91 - **Exit 3** (no match): print92 `"No work item matching <argument> — interpreting as topic string.93 If that's wrong, abort and re-run with a different argument (or94 /list-work-items to find a valid reference)."` and proceed to95 topic-string handling below.96 - **Exit 6** (path outside the work directory): the argument names a97 real file that lies outside the managed work directory, so it is not98 a topic string. Stop, print the resolver's error, and offer to run99 `/list-work-items`.100101 **Frontmatter validation** (only reached after a file was successfully102 resolved). Run:103104 ```105 accelerator work show <path> --field id106 ```107108 The own-identity field is `id` on unified-shape files and109 `work_item_id` on legacy files; `work show` resolves both110 transparently, so either key name passed here would return the111 same value.112113 If it exits non-zero (frontmatter missing or unclosed), print:114115 ```116 Could not parse frontmatter in <path> — the file may be corrupted.117 Re-open it and check that the YAML frontmatter is bracketed by two118 `---` lines and contains all nine required fields.119 ```120121 and exit without spawning agents or writing any file. (The file clearly122 resolved, so the user intended a path — no fallback applies.)123124 If validation passes, read the file fully (frontmatter and body) and125 cache the identity fields in conversation state:126 `id` (or `work_item_id` on legacy files), `date`, `author`, `status`,127 `title`, `kind`, `priority`, `parent`, `tags`. For any missing128 optional field, use the template default — do not abort. Set the conversation into129 **enrich-existing mode** with `existing_work_item_path` cached, and130 skip directly to Step 1 in that mode — do not run the vagueness check.131132 **Topic-string handling**: if no resolution succeeded (discriminators133 did not trigger, or they triggered with a fallback warning), check134 whether the argument is too vague (no clear deliverable or subject).135 - Vague examples: "improve things", "fix the API", "add more features"136 - Clear examples: "add full-text search to the docs index page",137 "fix login timeout after password reset"138 - If vague, ask at least one clarifying question and wait for a more139 specific description before proceeding to Step 1.140 - If clear, proceed directly to Step 1.1411422. **If no argument was provided**, respond with:143144```145I'll help you create a well-specified work item through a collaborative conversation.146147To get started, describe what you want to achieve — what's the problem or goal?148For example: "add full-text search to the docs index page", or "users can't log in after resetting their password"149150I'll ask a few questions to understand the problem space, do some research, then151work with you to shape a thoroughly reasoned work item.152```153154Then wait for the user's input. Apply the same vagueness check to their155response — if still vague, ask a clarifying question before proceeding to156Step 1.157158## Step 1: Gather Business Context159160Once the topic is clear, ask 3–5 open questions to understand the business161context before investigating. Consult the work item template sections above to162understand what the work item will need — use them to guide which questions are163worth asking. Tailor the questions to the topic, but cover:164165- What pain point or problem does this address, and who experiences it?166- What is the desired outcome — what changes for people once this is done?167- Does the user have a solution or approach in mind? If so, surface it and168 ask whether it's a constraint or a preference to be explored further.169- Are there any constraints, deadlines, or dependencies worth knowing?170- For bug topics: what is the impact, and is it a blocker?171- Is there anything you are uncertain about, or that I should research?172173Ask all relevant questions at once rather than one at a time. Wait for the174user's answers before proceeding to Step 2.175176### In enrich-existing mode177178Do not ask the broad discovery questions above. Instead:1791801. Identify which body sections of the existing file are **substantive** (real181 content beyond `[bracketed placeholder]` text) and which are **gaps** (empty,182 placeholder-only, or missing entirely). Tag each gap with **exactly one** of183 the literal tokens:184 - `empty` — section is absent or contains no content185 - `placeholder-only` — section contains only template `[...]` blocks186 - `instructional-prose` — section contains the template's instructional187 prose carried over verbatim (e.g. "Describe the business value of this188 work item here…")189 - `partial` — section contains one or more substantive sentences alongside190 residual placeholders191192 Use the literal token; do not paraphrase. The eval grader pattern-matches193 on these exact strings.1941952. Present the gap analysis briefly:196197 ```198 I've read the existing work item (<resolved path>). Here's what looks199 complete and what still needs work:200201 Complete: [section list, or "none"]202 Gaps:203 - <Section> (<tag>)204 - ...205206 I'll ask targeted questions about the gaps.207 ```2082093. Ask only questions that address the identified gaps. Do not re-ask210 questions whose answers are already substantively present in the file.2112124. If the existing content is rich enough that no obvious gaps remain,213 briefly confirm this and ask what the user wants to add or improve, then214 proceed to Step 2.215216## Step 2: Investigate217218Using the topic and business context from Step 1, run investigation agents219in parallel:2202211. **Spawn {documents locator agent}** to search `{work_dir}` only —222 look for existing work items with similar titles, descriptions, or scope.223 Do not search research documents, plans, or other directories — work items224 capture business requirements, not implementation details.2252262. **Spawn {web-search-researcher agent}** when there is uncertainty or a need227 for richer context about any aspect of the topic — business rules, domain228 concepts, competitive landscape, industry standards, external technology, or229 anything the model lacks confidence on. Skip this agent only when the topic230 is entirely self-contained and well-understood from the user's description.231 When in doubt, prefer to spawn research — over-asking is cheaper than232 producing a vague or poorly-grounded proposal.233234Run both agents in parallel where both are warranted.235236Once agents complete, synthesise findings — what the model knows from training,237what research turned up, what prior work items exist — as the foundation for Step 3.238239**If a similar existing work item is found**: Check its status.240- If the status is `done`, `abandoned`, or `superseded` — mention the work item241 briefly and note it is already closed, then continue creating the new one.242- Otherwise — surface the work item and offer the user numbered options, for243 example:244 1. Proceed with a new work item (if the scope genuinely differs)245 2. Exit and update the existing work item instead (use `/update-work-item` once246 available; for now, update it manually)247 3. Continue creating a new work item linked to the existing one as a parent248249 Adapt the options to what makes sense given the work item's kind and status.250 Do not silently continue or modify the existing work item inline. Wait for251 the user's choice before proceeding.252253**In enrich-existing mode**: exclude the resolved input file from the254similarity scan. The {documents locator agent} search of `{work_dir}` will255find the file being enriched; do not surface it as a "potential duplicate" of256itself. Other near-duplicates discovered are handled per the unchanged rules257above.258259## Step 3: Propose and Refine260261Using the business context and investigation synthesis, the model leads with262a structured proposal. Do not ask the user to generate requirements or263acceptance criteria from scratch — propose them and invite challenge.2642651. **Recommend a work item kind** with a brief rationale. Valid kinds come from266 the work item template's `kind` field (loaded at the top of this skill) — do267 not hardcode the list. Default to `story` when the kind is genuinely268 ambiguous.2692. **Draft requirements** drawn from the business context and research.2703. **Draft acceptance criteria** — specific and testable; prefer Given/When/Then271 format for story/task. Draw on domain knowledge and research to make these272 thorough, not just what the user explicitly mentioned.2734. **Surface interpretations and gaps** using the right section:274 - Put scope-changing interpretations you made in `Assumptions` and invite275 the user to confirm or correct them.276 - Put genuine unknowns that block progress in `Open Questions`.277 - Put every meaningful drafting-time interpretation (who stakeholders are,278 what vague terms mean, scope boundaries, implied technical approach) in279 `Drafting Notes` so a reviewer can challenge them.280281Present as a structured proposal:282283```284Based on what you've told me and my research, here's what I think this work item needs:285286**Suggested kind**: [kind]287**Rationale**: [one sentence]288289**Requirements I'd suggest**:290- [requirement]291292**Out of scope** (explicitly not captured here):293- [item]294295**Acceptance criteria I'd suggest**:296- Given/When/Then...297298**Assumptions I've made** (scope-changing calls — confirm or correct):299- [assumption]300301**Drafting Notes** (interpretations a reviewer should see):302- [interpretation — e.g. who stakeholders are, what a vague term means,303 scope boundary, implied technical approach]304305**Open questions** (unknowns to resolve before work begins):306- [anything the user should clarify before drafting]307```308309Wait for the user to validate, push back, or refine. Challenge vague or310untestable responses — if an acceptance criterion is not measurable (e.g.,311"it works correctly"), first ask a clarifying question to understand the312intent ("what would a passing test actually look like here?"). Only after313understanding the intent should you help reformulate it into something314testable. Do not accept vague criteria into the draft. Iterate until the315proposal is well-specified and agreed.316317### In enrich-existing mode318319Do not lead with a from-scratch proposal. Instead present a section-by-section320review and augmentation:321322```323Here's how the existing work item reads against my research, with proposed324additions for the gaps:325326**[Section name]** — [complete | needs improvement: <reason> | missing]327[existing content excerpt or note that it is missing]328[proposed addition or replacement, when applicable]329330[repeat per section]331332**Title**: [keep / propose new title with rationale]333**Kind**: [keep existing <kind> / propose change to <kind> with rationale]334**Priority**: [keep / propose change with rationale]335**Parent**: [keep / propose change]336**Tags**: [keep / propose additions]337**Status**: [keep <cached> — say so if you'd like to transition it]338```339340Apply the canonical Identity Field Rules (see Quality Guidelines): propose341only the fields marked Proposable; never propose changes to immutable fields;342surface a status transition only if the user makes a direct explicit request343for one (the listing offers the affordance but never proposes a change344unsolicited).345346The refinement loop in this step (challenging untestable criteria, vague347requirements, etc.) applies equally to existing and proposed content.348349## Step 4: Draft Work Item3503511. **Draft a complete work item** from the agreed proposal using the template352 structure loaded at the top of this skill. Use `NNNN` as the placeholder353 work item number throughout. Do NOT call `accelerator work next-number` at this step.3543552. **Kind-specific content placement**:356 - story/epic: open the `Summary` section with a user story statement —357 "As a [role], I want [goal], so that [benefit]." — before the358 descriptive sentences359 - bug reproduction steps, expected/actual behaviour → `Requirements` section360 - spike research questions, time-box, exit criteria → `Requirements` section361 - epic initial stories → `Requirements` section as a list362 - Do not rename or add sections beyond those defined in the work item template3633643. **Populate the `References` section** with any external material that365 informed the work item — research artefacts surfaced by the web researcher,366 related work items found in Step 2, design docs, or source specs. Leave it367 empty if nothing external was consulted; do not invent references.3683694. **Populate the `Drafting Notes` section** with the interpretations370 carried over from the agreed proposal. If there were none (the user371 confirmed every call), the section may be omitted or left as an empty372 list — but do not leave placeholder bracketed text in it.3733745. **Present the full draft** to the user:375376```377Here's my draft work item. Please review and let me know if you'd like any378changes before I write it to disk:379380[draft content]381```3823836. **Continue to challenge** during the review loop — flag untestable criteria,384 vague requirements, or gaps surfaced by research that remain unaddressed.385 Iterate until the user explicitly approves. **`accelerator work386 next-number` is never called during this loop.**387388### In enrich-existing mode3893901. Produce a complete updated draft incorporating the existing content plus the391 additions approved in Step 3.3922. Apply the canonical Identity Field Rules (see Quality Guidelines) when393 filling frontmatter — the rules are the single source of truth for which394 fields are immutable, preserved, or proposable.3953. Apply the H1 sync rule (see Quality Guidelines).3964. Apply the Script avoidance rule (see Quality Guidelines).3975. Present the full updated draft, framed as an update preview:398399 ```400 Here's the updated work item. The Step 5 confirmation will name the file401 path and ask for explicit approval before any write:402403 [draft content]404 ```4054066. Continue to challenge during review — apply the same rules as the407 normal-path Step 4. Iterate the draft until the user is happy with it. Do408 **not** treat a "looks good" mid-iteration as approval to write — that409 approval is gated by Step 5's single confirmation.410411## Step 5: Write Work Item4124131. **Call `accelerator work next-number`** to get the next full ID under the414 configured pattern:415416```417accelerator work next-number418```419420The output is the full ID (`0001` under default `{number:04d}`,421`PROJ-0001` under `{project}-{number:04d}` with422`work.default_project_code: "PROJ"`). The allocator reads the pattern423and default project code from configuration; pass `--project CODE` if424the user explicitly wants a non-default project.425426If the command exits non-zero (e.g., overflow, missing project value),427abort immediately and surface the error message verbatim — do not428proceed.4294302. **Resolve the target path**: `{work_dir}/<full-id>-kebab-slug.md`431 where `<full-id>` is the allocator's output and the slug is a432 meaningful kebab-case summary of the title (not raw input text).4334343. **Check that the target path does not already exist**. If it does, abort:435436```437Path {path} already exists — another session may have written a work item438concurrently. Please re-run /create-work-item.439```4404414. **Create the work items directory** if it does not exist.4424435. **Resolve `author`**: configuration if present, then the current git/jj444 user identity, then — only if both fail — ask the user once. Never pass445 a placeholder. This value feeds both branches below.4464476. **No integration configured — write via `accelerator work create`.**448 Skip this step (go to step 7) when an integration *is* configured; the449 push state machine in step 8 governs that case's single write instead.450451 1. Write the drafted body (H1 through References, everything approved452 across Steps 1–4) to a scratch file, with the `NNNN` placeholder453 still literally present everywhere it appears (the H1 line and454 anywhere else) — do **not** substitute it yourself. `work create`455 performs the one real `NNNN` → allocated-ID substitution as part of456 the same atomic write that decides the ID, so the approved content457 can never end up with an id/H1 mismatch.458 2. Call the dispatcher directly:459460 ```461 accelerator work create "<title>" <kind> <priority> \462 --status draft \463 --author "<resolved author>" \464 --producer create-work-item \465 --body-file <scratch-file> \466 [--parent "work-item:NNNN"] \467 [--tag <value>]... [--block "work-item:NNNN"]... \468 [--blocked-by "work-item:NNNN"]... \469 [--derived-from "plan:NNNN"]... [--relates-to <ref>]... \470 [--source "issue-research:NNNN"] [--project <code>]471 ```472473 Include each bracketed flag only when that field has a value —474 `work create` itself omits the corresponding frontmatter key when475 the flag is absent, matching the template's own omit-when-empty476 convention, so no separate omission logic is needed here. `--tag`/477 `--block`/`--blocked-by`/`--derived-from`/`--relates-to` are each478 repeatable for multiple values. `external_id` has no flag — `work479 create` never writes it (nothing to sync yet); this matches today's480 behaviour of omitting it from a fresh draft.481 3. If the command exits non-zero, surface its stderr message verbatim482 and abort — do not retry and do not attempt a manual `Write`.483 Otherwise its stdout is the path of the written file. Skip to484 step 8.4854867. **Push state machine** (only when **Active integration** is non-empty;487 otherwise this whole step is skipped and the file was already written in488 step 6). The drafted frontmatter is held **in memory** — no file exists yet.489490 1. **Offer the push** using the fail-safe gate. Preview the fields the push491 would resolve **through the dispatcher's own dry-run** so the single492 keystroke maps to an understood, non-destructive result. Write the493 drafted body to a temp file and run:494495 ```496 accelerator work create "<title>" <kind> <priority> \497 --push --dry-run --body-file <body-tmp>498 ```499500 It resolves the tracker from **Active integration**, contacts it to501 resolve the fields, writes **nothing**, and creates **no** remote issue.502 Branch on its exit and the line it prints on stdout:503504 - **Exit 0, jira** → `jira\t<issue type>\t<type source>\t<project>\t<project source>`.505 Render the type and project with their sources. A `<project source>` of506 `unresolvable` means the configured `work.default_project_code` names a507 project the tracker does not hold — surface that as a pre-create508 failure **before** the gate (name `work.default_project_code`) and do509 **not** offer the push; save locally instead. A `default` source is a510 benign fallback, not a failure.511 - **Exit 0, linear** → `linear\t(no user-resolvable type/project fields)`512 (the team and issue-type catalogue are fixed by `/init-linear`).513 Offer the push.514 - **Exit 70** → the tracker was **unreachable** (distinct from an515 unresolvable value). Do **not** hard-block: tell the user the preview516 could not be resolved and offer to save locally now, or retry the517 preview. The push itself carries its own retry (below), so a transient518 outage here must not strand the draft.519520 Then, when a push is still on the table:521522 Use the `AskUserQuestion` tool with two options:523524 1. **Yes, push to [tracker] now** — create the remote issue and save525 locally526 2. **No, save locally only** — save as unsynced; push it later with527 `/sync-work-items` (it offers to create unsynced local drafts on the528 remote), which shares this `external_id` contract.529530 2. **On decline** → write the file now with `external_id` omitted (unsynced)531 via the `accelerator work create` call from step 6 (no `--push`), then go532 to step 8.533534 3. **On accept** → run the **same** `accelerator work create` call with535 `--push` added (never a re-derived tracker — the CLI reads **Active536 integration** itself):537538 ```539 accelerator work create "<title>" <kind> <priority> \540 --status draft --author "<resolved author>" --producer create-work-item \541 --push --body-file <body-tmp> [--parent …] [--tag …]… [linkage flags…]542 ```543544 This is **one** call that creates the remote issue and writes the local545 file atomically — the retryable/terminal decision, the retry, and the546 duplicate-create guard all live inside `work create --push`; do **not**547 drive a retry loop yourself. On stdout it prints the written path on the548 first line and `<keyword>\t<external_id>` on the second, where the keyword549 is one of `write-once`, `local-save`, or `loud-terminal`. Render per the550 table below.551552 **Outcome table** (`work create --push` returns the keyword; you render the553 message). The 70-retryable / 71-terminal contract the keywords derive from554 is documented in `exit_codes` and cross-referenced by `work create --help`:555556 | Second-line keyword | Exit | Action |557 |---|---|---|558 | `write-once` | 0 | The remote issue was created and the file written with its `external_id`. Confirm success (step 8), echoing the returned identifier. |559 | `local-save` | 0 | The push could not be sent (retryable and retried once, or the tracker is not available/recognised/configured) and nothing left the machine — the file was written **unsynced**. Tell the user it saved unsynced and can be pushed later via `/sync-work-items`. |560 | `loud-terminal` | 71 | A terminal failure **at or after** the create, or the create succeeded but the write-back failed — a remote issue **may already exist**. The file was saved unsynced. Print loud non-idempotent guidance naming the saved path: do **not** blindly re-run `/create-work-item`; check the tracker, and if the issue exists reconcile via `/sync-work-items` **or** set `external_id: <KEY>` by hand. |561562 Because the create and the local write are one atomic CLI operation, there563 is no in-skill window where a remote issue exists but no file does — that564 window, and its `pending_push` recovery marker, are handled inside the CLI.565 The pre-create preview is a **live, credentialed** round-trip now, so a clean566 preview does not guarantee the push succeeds; the authoritative outcome is567 the keyword above.5685698. **Print a confirmation**:570571```572Work item created: `<path>`573```574575 `<path>` is always the first stdout line of the `accelerator work create`576 call that wrote the file — whether step 6 (no integration) or step 7577 (`--push`) — since its slugification is authoritative; do not re-derive it578 or assume it matches step 2's preview path. When the item was saved unsynced579 (decline, `local-save`, or `loud-terminal`), say so: `Work item created580 (unsynced): … — push later with /sync-work-items`.581582### In enrich-existing mode5835841. Do **not** call `accelerator work next-number`. The target path is the585 resolved `existing_work_item_path` cached in Step 0.5865872. **At-write identity-swap check** (best-effort guard): immediately before588 the confirmation prompt, re-read the target file's own identity from589 disk via:590591 ```592 accelerator work show <existing_work_item_path> --field id593 ```594595 (This returns the value of `id:` on unified-shape files and falls596 back to `work_item_id:` on legacy files.)597598 - If the command exits non-zero (file gone or frontmatter unparseable since599 Step 0), abort with:600 `"Error: <path> is no longer present or its frontmatter is unparseable.601 Your proposed draft is below — copy it before re-running602 /create-work-item: <draft>"`603 - If the on-disk identity differs from the value cached in Step 0,604 abort with:605 `"Error: <path> changed identity since Step 0 (was <cached>, now606 <current>). Your proposed draft is below — copy it before re-running607 /create-work-item to refresh: <draft>"`6086093. **Single confirmation gate**: present the path and a per-section change610 summary, then require explicit y/n approval before any write:611612 ```613 I'm about to overwrite <existing_work_item_path>.614615 Sections changed:616 Added: [...]617 Modified: [...]618619 Frontmatter changed:620 <field>: <cached> → <new> # repeated per modified field621 (status: <cached> unchanged) # always show status explicitly622623 Sections preserved verbatim: <count> (<terse list or "none">)624 Frontmatter fields preserved verbatim: id, date, author625 [+ any unmodified proposable fields]626627 ```628629 Then use the `AskUserQuestion` tool with two options:630631 1. **Yes, proceed** — overwrite the work item with the changes shown632 2. **No, cancel** — make no changes6336344. **Confirmation interpretation** (fail-safe):635 - Exactly `y` or `Y` (after trimming whitespace): proceed to step 5.636 - Exactly `n` or `N`: go to step 8.637 - Anything else (empty input, "yes", "go ahead", "looks good but also...",638 paragraph of feedback): treat as `n`. Print:639 `"Did not recognise <response> as y/n — staying in review. What change640 would you like before I overwrite?"` and go to step 8.6416425. **On `y` — substitute cached immutable fields, then write**: immediately643 before invoking the Write tool, re-read the cached immutable identity fields644 (`id`, `date`, `author`) from conversation state and overwrite the645 corresponding frontmatter lines in the draft text with those exact values,646 even if they appear unchanged. Also write `last_updated:` to the current647 `Current Date/Time (UTC):` value and `last_updated_by:` to the resolved648 author. This textual substitution defends against drift during Step 4649 iteration.6506516. Write the file to `existing_work_item_path`. The path-existence guard from652 the normal flow does not apply — overwrite is the intended behaviour.6536547. Print:655656 ```657 Work item updated: <existing_work_item_path>658 ```6596608. **On `n` or unrecognised**: stay in Step 4 / Step 5 review and iterate.661 Do not re-run the identity-swap check until the next `y`; do not write.662663**Validate the frontmatter**: after the work item is written, run664665```bash666accelerator corpus frontmatter validate --file <written work item path>667```668669If it exits non-zero, the document violates the canonical frontmatter670standard; report the emitted violation and fix the frontmatter before671completing.672673## Quality Guidelines674675- Never write a file without explicit user approval.676- Never call `accelerator work next-number` before the user approves the draft.677- The slug must be a meaningful kebab-case title, not raw input text.678- Work item kind must come from the work item template's `kind` field (loaded at679 the top of this skill), not a hardcoded list. Default to `story` when the680 kind is genuinely ambiguous.681- All frontmatter fields defined in the work item template must be populated682 in every written work item: `type` (`work-item`), `id` matching the683 assigned full ID (a quoted YAML string — see contract below), `title`684 matching the user-approved title, `date`, `author`, `producer`685 (`create-work-item`), `status` (`draft`), `kind`, `priority` (medium686 unless the user specified otherwise), `parent` (empty string unless a687 parent was established), `external_id` (empty unless set), `tags` (a688 YAML array, possibly empty), `last_updated`, `last_updated_by`, and689 `schema_version: 1`. No field may contain unfilled placeholder text690 like `[author]` or `NNNN`. The body H1 format is `# <full-id>: <title>`691 where `<full-id>` is whatever the configured `work.id_pattern`692 produces — kept in sync with the frontmatter `title:` field.693694- **`id` frontmatter type contract**: the own-identity field is695 **always a quoted YAML string**, regardless of the configured696 pattern. Files created under default `{number:04d}` write697 `id: "0001"`; files created under `{project}-{number:04d}` write698 `id: "PROJ-0001"`. This contract is uniform so consumers can read699 the field as a string without coercion. See700 `skills/config/configure/SKILL.md > work` for the full contract.701 Legacy files carry the same value under `work_item_id:`; `work show`702 returns either key transparently so consumers do not need to know703 which shape is on disk.704705**Identity Field Rules** (apply in enrich-existing mode):706707- **Immutable** — `id` (or `work_item_id` on legacy files), `date`,708 `author`. Cached from the source file in Step 0; never proposed for709 change; the model substitutes the cached values back into the draft710 frontmatter at write time (Step 5 step 5) as a defence against drift711 during Step 4 iteration. This is a textual substitution the model712 performs — the eval suite verifies the written file's values match713 the cached values, which is the strongest guarantee the grader-714 mediated harness can provide.715- **Preserved unless explicitly changed** — `status`. Defaults to the cached716 value. May only change if the user makes an explicit, direct request during717 the conversation (e.g. "set status to in-progress"). The model must not718 propose a status change unsolicited; if the user makes only an oblique719 reference (e.g. "this is now in flight"), the model asks a clarifying720 question rather than infer the transition. A proposed transition is shown721 explicitly (e.g. "draft → in-progress") and requires confirmation in Step 3722 before acceptance. The `status: draft` default applies only to723 newly-created work items, not to enrichment.724- **Proposable in Step 3** — `title`, `kind`, `priority`, `parent`, `tags`.725 Default to the cached values; can be replaced after explicit user agreement726 in Step 3's augmentation review.727728**H1 sync** (enrich-existing mode): the body H1 is `# <id>: <title>`,729using the cached immutable `id` (the full ID produced by the configured730pattern, never a placeholder; sourced from `work_item_id` on legacy731files) and the title as confirmed or replaced in Step 3.732733**Script avoidance** (enrich-existing mode): `accelerator work734next-number` is never called. The number is already cached. The path-existence guard in Step 5735does not apply — overwrite is the intended behaviour once the at-write736identity-swap check passes.737738- `date` must use the work item template's `YYYY-MM-DDTHH:MM:SS+00:00` format739 in UTC (e.g. obtained via `date -u +%Y-%m-%dT%H:%M:%S+00:00`).740- `author` is sourced in this order: configuration if present, then the741 current git/jj user identity, then — only if both fail — ask the user742 once before writing the file. Never write `[author]` or any placeholder.743- `Summary` and `Requirements` must have substantive content — no744 `[bracketed placeholder text]` in the final written file. The same745 applies to every other body section that is populated: if a section746 would only contain a bracketed placeholder, remove the placeholder and747 leave the section empty (or omit optional sections entirely).748- Acceptance criteria must be specific and testable; prefer Given/When/Then749 format. Challenge any criterion that is not measurable before accepting it.750- Populate `Drafting Notes` with every meaningful interpretation made while751 filling out the work item — who stakeholders are, what a vague term means,752 where scope boundaries sit, which technical approach is implied. Use753 `Assumptions` for scope-changing calls the user should confirm. Use754 `Open Questions` for genuine unknowns that block progress. These three755 sections serve different purposes; don't collapse them.756- Populate `References` with any external material that informed the757 work item — research artefacts, related work items, design docs, source specs.758 Leave it empty if nothing external was consulted; do not invent759 references.760- The model must contribute its own knowledge and research to the proposal —761 not simply transcribe the user's answers. Bring domain expertise, surfaced762 research, and reasoned suggestions to every work item.763- Restrict `{documents locator agent}` to `{work_dir}` only. Do not search764 research documents, plans, or the codebase — work items are about business765 requirements, not implementation details.766- Spawn `{web-search-researcher agent}` whenever there is uncertainty about any767 aspect of the topic — business rules, domain concepts, competitive landscape,768 industry standards, external technology, or otherwise. When in doubt,769 prefer to spawn research — over-asking is cheaper than producing a770 vague or poorly-grounded proposal.771- If `accelerator work next-number` exits non-zero, abort and surface the772 error message verbatim.773774!`accelerator config instructions create-work-item --fail-safe`