/agent-toolkit:refine-ticketfrom Agent Toolkit
Transforms raw tickets or ideas into validated REQUIREMENTS documents by analyzing the codebase to verify feasibility, scope, and dependencies. For the Refine phase of Refine → Plan → Act.
Ships in Agent Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The Refine phase of Refine → Plan → Act: turn a raw ticket — or an idea to brainstorm — into a validated requirements document a fresh session can plan from. Analysis only — it defines what must be true when the work is done, never how to build it, and never touches code.
An idea is a ticket that doesn't exist yet: treat the user's words as the ticket text, and grill to shape the idea itself — goal, in vs out of scope — before closing the branches that block implementation.
A .TICKET.md path, a ticket URL or bare id, or an idea in words. When the harness has subagents
and fetch-ticket is available (../fetch-ticket/SKILL.md beside this skill), a URL or id is
fetched first by a subagent per fetch-ticket's delegate.md — one
ticket per run; several → point at a fetch session instead, which handles sets. A non-empty warn
list stops for one question: supply the files now (/attach-to-ticket when available; answered
by running it → resume with the supplied files once it reports) or refine without them. The
fetched file is then the local ticket file. No subagents, or fetch-ticket not available → read
the ticket from its tracker and refine with no local ticket file.
An existing .REQUIREMENTS.md (a re-run, e.g. once a blocking answer is in): read it and its
ticket file (.REQUIREMENTS → .TICKET, or its latest -vN re-fetch, file or directory) first
— none for a tracker ticket → re-read it there, asking for its URL or id when the file doesn't
name it; grill only on what changed since, and update it in place.
You cannot define the "what" in a vacuum. Every requirement must be checked against the actual code, config, and design — a ticket may be stale, ambiguous, contradicted by the codebase, or depend on upstream work that isn't implemented yet (e.g. a prerequisite ticket still open). Reading the code here is for validating requirements, not for designing the solution.
The actual code is the base the work starts from, per repo: a branch named by the user, the
project's docs or the ticket, or one holding unmerged work the ticket depends on (in doubt, ask
first), else the default branch (of the upstream remote when one exists, else origin). Fetch
it and read at that ref (git show <ref>:<path>, git grep <pattern> <ref>) wherever the working
tree differs from it; no remote, or a failed fetch → the ref as it stands locally. Local-only work
the ticket depends on (unpushed, uncommitted) is read as it stands.
When a ticket points at a design (mockup, screenshot, prototype, design-tool link), that design is part of the spec. Visual decisions made without seeing it lock in wrong defaults.
When the ticket references others that matter to it (BE/FE counterparts, dependencies, follow-ups),
or others build on it, read them too — they complete the picture and sharpen how this ticket's
requirements are meant. A ticket seldom names its dependents: search the tracker once for others
citing this ticket's id. No tool can search it, or nothing relevant turns up → move on; a hit whose
reliance on this ticket stays unclear once read (e.g. that part still TBD) is a grill question. A
## Ticket set section in the ticket file lists locally fetched siblings: read every linked
.TICKET.md before grilling; for tracker-only references, judge relevance before fetching, then
fetch one the way Input does. What a sibling supplies — execution order, contracts it owns,
superseded-spec notes — is context only, never requirements: scope stays this ticket's, and
anything a sibling suggests changing is a question for the user, never a silent scope change.
A related ticket's own .REQUIREMENTS.md or .PLAN.md, finished or not (beside its ticket file,
or under its id among the planning documents), may claim work this ticket asks for too: read each
before grilling, and just before writing any that changed or appeared since, as another session
may be refining it meanwhile. Each deliverable both claim is a grill question on who builds it;
one this ticket gives up is an Override naming the ticket that builds it, and a change the other
ticket's file then needs is drafted for the user in the closing message, never written. None found
or reachable → nothing more to check.
Unless one was passed in, look for a .TICKET-REVIEW.md next to the ticket or in its set
directory, preferring the one whose base matches the ticket file's -vN base — an earlier
session's triage; say which one you use, or that none exists. Challenge and re-verify everything
in it before relying on it (its citations make that cheap). Its shipped questions are blocking
items: grill first whether the owner answered. The defaults it assumed for dropped cheap details
are decisions to close here — grilled or recorded as Open questions, never adopted silently.
Handoffs are out-of-scope dependencies; verdict and walkthrough are context only. The ticket file
and the code always win; a review older than the ticket file has likely been overtaken — say so.
Before the first grill question, look for this ticket's requirements: the .REQUIREMENTS.md at
the target path (Location below) or, for a ticket with -vN versions and none under its own base,
the highest earlier version's (down to the unsuffixed base). A tracker ticket with no local file
has its slug and target path confirmed before the first grill question, so the check runs there;
an idea in words has them confirmed once its goal and scope are shaped, before the branch
grilling, and the check runs then, at that path only. Found and not the input → say so, name the
.PLAN/.MANUAL-TEST of that base that would go stale, and ask once:
-vN ticket first, grill only
on what changed, keep settled decisions, update the same file.Never a -vN REQUIREMENTS copy beside a ticket of another base; never asked again at write time.
After gathering and code-verifying, grill the user — interview relentlessly, never guessing what they could clarify — to close every remaining decision:
explain-in-simple-language when available.Separate two kinds of uncertainty:
A blocking question only someone else can answer: write the file anyway, with the question under
Open questions marked blocking, naming who answers it and the question drafted ready to send
(via use-conversational-language when available). Print no hand-off commands while a blocking
entry exists, only the one for once the answer is in: /refine-ticket <path>.REQUIREMENTS.md.
A ticket is a bug when its tracker type says so (a fetched file's **Type** header line, else the
tracker's type field); with no type (an idea, pasted text, a typeless tracker), when its text
reports existing behaviour breaking what should already work, not a wish to change what works as
intended. A non-bug type whose text reads like a bug, or a case neither settles, is a grill
question.
For a bug, try to reproduce it with what the project already provides (running the app, an existing command or test), the smallest that shows it: a unit test before an integration test before e2e or the running app, a larger one only when the bug lies in how parts connect. No scratch script, no source edit, no tracked file written. A run's side outputs (build output, caches, coverage, reports, snapshots) may land only in scratch space or git-ignored paths; a run that would write elsewhere is not made, and the bug counts as not reproduced. A run acting on shared or external state (a remote service, a shared database) is a grill question, never made unasked. A run exercises the checkout: where that differs from the base, the Reproduction part names the commit and any uncommitted changes it ran on, and a result the base's code contradicts is a grill question.
Not reproduced (the attempt didn't show it, or nothing in the project can try it, e.g. a production-only or external-integration bug) is a grill question on where it occurred (environment, data, version), per the Golden rule's local-environment line; never assume it fixed or invalid. Still unreproduced after grilling → the Reproduction part says so and why; that alone is not blocking.
When the ticket says a capability exists or names something to reuse, find what's behind it (the service method, query, SP it calls) and anchor the requirement on the smallest extension — relax a parameter, widen a filter, lift a guard. "Not an exact match" doesn't license a net-new build: reuse-vs-build-new is a blocking question for the user, never a silent default.
Must stand alone for a fresh session with no memory of this conversation and no access to the ticket — this is the single most important constraint. No "as discussed", "we agreed", or "see ticket".
Location:
.TICKET with .REQUIREMENTS (e.g. FOO.TICKET.md → FOO.REQUIREMENTS.md); if the
input doesn't follow that convention, append .REQUIREMENTS before .md..agents/plans/). Propose a kebab-case <slug> (prefix the tracker id when the ticket is bound
to one) and the target path, confirm both with the user (timing under Existing
requirements), then write <slug>/<slug>.REQUIREMENTS.md there.Six parts (Verified codebase facts, Overrides, and Open questions may be empty — don't pad):
git diff <old>..<new> -- <cited paths>).(Description), (AC), (Comment)), the user's idea statement
((Idea)), a grilling answer ((Grilling)), a review comment by its opening words and
path:line (("Validate both new option arguments", install.sh:88)) — never an answers-sheet
row number. Group by area when it aids reading. Cite the concrete file path / identifier inline
wherever a requirement touches code; cite a reused pattern as path:line-range.A bug adds a Reproduction part right after Context: the steps, what they show now (observed), what they should show (expected), and whether you reproduced it and how, or why not.
Each requirement is self-contained; user-facing strings that must stay in a given language are quoted verbatim.
Done when the six parts, plus Reproduction for a bug, are present and
grep -niE "as discussed|we agreed|see ticket|as mentioned" on the file returns nothing.
/attach-to-ticket run in answer to the attachments
question writes.When done, state — in project-relative paths — that the requirements file is ready, then hand
off each next phase as its own fenced block under the label quoted below, holding the bare prompt,
after one line saying to run one in a fresh session or after clearing this one (/clear is only the
example); a block only when its skill is available (look in the agent's skills and plugin dirs, as
manual-only skills are missing from the in-session list):
"Harden the requirements first, so a fresh reviewer challenges them before planning:"
/harden-artifact <path>.REQUIREMENTS.md
"Plan the implementation:" (starting "or" when the harden block precedes it)
/create-implementation-plan <path>.REQUIREMENTS.md
"Write the QA manual test:"
/create-manual-test-instructions <path>.REQUIREMENTS.md
What SKILL.md sets; muted values are Claude Code's defaults
31 skills in this plugin
/agentify-projectMake a project agent-ready by converging it toward a canonical agent-neutral structure. Re-runnable, and doubles as an audit./attach-to-ticketAttach pasted images, files or URLs to a fetched ticket, saved beside its ticket file and referenced from it, or fill an attachment the fetch could not download. Local only — never queries or edits the tracker./check-ticket-implementationCheck how much of a ticket is already implemented and save a per-requirement status report.npx claudepluginhub eai-org/agent-toolkit --plugin agent-toolkitOther plugins' skills for the same job