| name | issue:refine |
| description | Refining issues with technical context and structured details. Use when expanding a brief bug, feature, or refactor description into a detailed issue suitable for developers and AI agents. |
| argument-hint | [--type bug|feature|refactor|spike] [--compact] |
Issue Refinement
Arguments
Parse $ARGUMENTS:
--type bug|feature|refactor|spike: skip type identification and read that guide directly. Default: infer the type from the description per Issue Types.
--compact: force the trivial body per Section Selection. Frontmatter is always emitted. Default: size the body to the issue.
Issue Types
| Type | When to Use | Guide |
|---|
| Bug | Something is broken | bug.md |
| Feature | New capability | feature.md |
| Refactor | Internal improvement, no behavior change | refactor.md |
| Spike | Timeboxed investigation; output is a recommendation, not a shipped change | spike.md |
Workflow
Read the type guide, gather context from code and related issues, and draft the refinement following the type's structure. Write it to tmp/issue-<slug>.md and output it for approval. After approval, hand the file to the platform skill (for Linear, linear:linear), which maps the frontmatter to tracker fields and saves the body. Defer all save mechanics to that skill.
Output Structure
YAML frontmatter for the metadata a tracker stores as fields, then the body below the closing ---. The body leads with the summary prose directly, under no heading.
---
title: fix connection pool exhaustion under load # sentence case, one line, no long parentheticals
type: bug # bug | feature | refactor | spike
labels: [performance, database] # optional; neutral tags
priority: high # optional; urgent | high | medium | low
relations: # optional; tracker links per relation
blocks: []
blocked-by: []
related:
- https://linear.app/acme/issue/ENG-1970
duplicate-of: []
---
The nightly export marks its run successful even when per-object retrievals
time out, so downstream jobs read a partial snapshot as if it were complete.
[Type-specific sections from guide (select, don't fill)]
## 🤖 Agent Context
Populate only the keys you can infer: title, type, labels, priority, relations. Omit any optional key you can't fill, and drop empty relation lists. The platform skill fills routing and workspace fields (team, assignee, state, estimate) at save time.
A related issue you found belongs under relations as a tracker link, kept out of the body. Mention another issue in the body only when it tells the reader something the relation can't: what a prior attempt tried, why upstream work matters. Never append a standalone Related Issues section. It just restates links the relation already expresses. Put links the tracker has no field for (cross-tracker issues, upstream bug reports) under Agent Context.
Section Selection
Every section must tell the reader something they couldn't have guessed. Cut sections whose content is tautological ("tests must pass"), template residue ("no behavior change"), or obvious given the issue's size.
For a substantial issue, the opening summary plus one type section is the floor. Grow only when content demands. A trivial issue needs none of that frame: a sentence or two that names the problem and points at the code is enough.
Agent Context
What you learned exploring the codebase, so the implementing agent doesn't explore it again. Last in the body, under a ## 🤖 Agent Context heading. The platform skill turns that heading into a collapsible. Where no platform skill covers the tracker, wrap it in GFM <details> at save time.
Write for an agent. Use lists of paths, symbols, and commands. Style does not apply. Line numbers, ranges, and bare enumeration are fine when they save a search.
Emit only what exploration produced. Drop subsections you can't fill, and the whole section when you explored nothing.
Open the block with the commit you read (git rev-parse --short HEAD) and today's date. Pair every line number with its symbol, which survives drift.
## 🤖 Agent Context
Gathered at `a1b2c3d` on 1970-01-01.
### Related Code
- `acquire` at `src/pool.ts:88` blocks on an exhausted pool with no deadline
- `release` at `src/pool.ts:140` early-returns on a closed connection, leaking the slot
### Prior Art
- `f0e9d8c` added the same deadline to the write pool. Mirror its test setup.
Subsections, in order:
| Section | Content |
|---|
| Related Code | Files to change or read, with the symbol and why it matters |
| Prior Art | Commits, PRs, or issues that solved a similar problem, and what to take |
| Verification | Test file to extend, suite to run, gate covering this area |
| Search Hints | Search patterns and entry points that found the code |
Style
Human-facing body only. Agent Context has its own rules.
State facts and drop the hedging. Name the function, file, or behavior rather than describing it vaguely. Every sentence should add information.
Section headings are title-case noun phrases. Keep them free of sentences, slogans, and "X, not Y" antithesis. Write "Connection Lifecycle" rather than "Pin, don't invalidate".
Plain words over jargon and marketing. Drop terms like "spike" (as a verb), "seam", "disposition", "reality". Say what the thing does.
Reference code by symbol. Name the function or type and quote the few relevant lines inline. Skip bare line ranges (file.py:26-56, #L26-L56): they go stale as the file changes. Use a SHA-pinned permalink only when a stable anchor is genuinely needed.
Reference issues and PRs as tracker links that expand inline, never as bare numbers (ENG-1970, !578, #123) a reader can't resolve. The platform skill owns the link syntax.