enhance-linear-issues
npx skills add https://github.com/super-mega-lab/toolkit --skill enhance-linear-issues
Agent 安装分布
Skill 文档
Enhance Linear Issues
Version: 2 â This is the single source of truth for the skill version. All version references below mean this value.
Overview
Enhance hastily-written Linear issues with clearer writing, better structure, and actionable detail â without over-engineering or losing the author’s voice. Optionally decompose complex issues into sub-issues and link related issues.
Core principle: Enhance to the issue’s potential, not to some idealized template. A quick feature idea shouldn’t become an implementation spec.
Workspace limitation: Linear MCP tools operate on the authenticated user’s workspace implicitly. There is no workspace switching â “team-aware” means discovering teams/projects in the current workspace, not switching between workspaces.
When to Use
NOT for: Creating new issues from scratch, triaging, or status updates.
Linear MCP Tools
Load all needed tools with a single ToolSearch call: +linear. Tools used by this skill:
list_teamsâ list workspace teamslist_projectsâ list workspace projectslist_issuesâ list/filter issuesget_issueâ get issue details (supportsincludeRelations)list_commentsâ get issue commentsextract_imagesâ extract and view images from issue descriptionsupdate_issueâ update issue fieldscreate_issueâ create new issues (for decomposition)
Workflow
Enhancement Progress:
- [ ] Step 1: Prerequisites checked
- [ ] Step 2: Issues gathered, workspace context loaded
- [ ] Step 3: Scope confirmed with user
- [ ] Step 4: Already-processed issues filtered
- [ ] Step 5: Issues processed
- [ ] Step 6: Proposals collected and presented
- [ ] Step 7: Safety review complete
- [ ] Step 8: Approval obtained
- [ ] Step 9: Changes applied
Phase 1 â Discover and Analyze
Step 1: Announce and Select Mode
- Display:
ð« enhance-linear-issues v[current version] - Check git prerequisite: Run
git --version. If it fails, note that file linking will be unavailable. Include this in the scope summary. - Detect mode from user’s request:
- Auto (no trigger needed): Runs end-to-end without prompts. Auto-applies all proposals that pass safety review. Flagged proposals are skipped (not applied) and reported.
- Preview (opt-in): Runs the full analysis pipeline without prompts, then presents results for review before applying.
Preview triggers: “preview”, “show me first”, “don’t apply yet”, “dry run”
If mode is ambiguous, default to auto.
Step 2: Gather Issues and Workspace Context
Run in parallel:
A. Gather issues based on user’s criteria:
- “issues I created today” â
Linear:list_issueswithcreatedAtfilter andassignee: "me" - “issues in backlog” â
Linear:list_issueswithstate: "backlog" - “issues in project X” â
Linear:list_issueswithprojectfilter - Specific issue â
Linear:get_issuewith identifier
If Linear:list_issues returns paginated results, fetch all pages to build the complete issue set before proceeding.
B. Discover workspace context:
Linear:list_teamsâ fetch all teams (for team reassignment). If this call fails, stop with: “Linear MCP server is required but not available. Ensure the Linear MCP server is configured in your agent’s MCP settings.”Linear:list_projectsâ fetch all projects (for context and linking)
C. Discover git/repo context (run in the shell):
- Construct
REPO_BROWSE_URLfromgit remote get-url originand current branch:{https-base}/blob/{branch} - If git commands fail, set
REPO_BROWSE_URLto empty and note file linking is unavailable
D. Discover workspace slug:
- Extract
WORKSPACE_SLUGfrom any issue’surlfield (e.g.,https://linear.app/{WORKSPACE_SLUG}/issue/...). If unavailable, fall back to plain text identifiers.
Step 3: Confirm Scope
Show the user what will be processed:
Mode: [Auto/Preview]
Enhancing the following issues:
- TEAM-101: [title] (status: [status], team: [team])
- TEAM-102: [title] (status: [status], team: [team])
- TEAM-103: [title] (status: [status], team: [team])
Available teams: [team1, team2, ...]
Available projects: [project1, project2, ...]
Repo: [REPO_BROWSE_URL or "unavailable"]
Workspace: [WORKSPACE_SLUG or "unavailable"]
Display scope summary and proceed to analysis.
Batching (>10 issues):
- Auto mode: Process in batches of 10 automatically. After each batch, report results and continue with the next batch. No prompting.
- Preview mode: Prompt with options: “Process all [N] issues” or “Process in batches of 10.”
Step 4: Filter Already-Processed Issues
Before processing, check each issue’s description for _Last enhanced: v[current version],:
- If the version matches AND the issue’s
updatedAttimestamp is within ~1 minute of the footer timestamp â skip this issue - Report: “Already processed by current version, no changes since last run”
- Otherwise â proceed to Step 5
This avoids redundant processing when re-running the skill on the same batch.
Step 5: Process Issues
Choose a processing strategy based on batch size:
Small batches (â¤10 issues): Process each issue sequentially in the current agent using the Enhancement Process below. Context (tools, calibration criteria, workspace info) loads once and is reused across all issues.
Large batches (>10 issues): Dispatch a separate parallel sub-task for each issue to prevent context degradation. Each sub-task prompt must include:
- The issue ID and the Enhancement Process steps below
- The full Enhancement Calibration and Decomposition Criteria sections from this skill
- The Guard Rails, Linking Rules, and Enhancement Footer sections
- Dynamic context: workspace slug, repo browse URL, team list, project list, batch issue list
Launch sub-tasks in parallel where possible.
Enhancement Process
For each issue (whether processed inline or via sub-task):
- Fetch the issue with
Linear:get_issue(include relations) â reuse data from Step 2 when available - Fetch comments with
Linear:list_comments - Assess issue quality using the Enhancement Calibration scale (see below)
- If quality is Excellent, add enhancement footer and report, but make no content changes
- Identify issue type (bug/feature/task)
- Gather context:
- If issue has images in description, use
Linear:extract_imagesto view them, then describe what they show - If screenshot analysis fails, note “Screenshot attached (not analyzed)” â do NOT guess content
- Search for related issues among other issue IDs in the batch
- Search for related issues via
Linear:list_issueswith similar terms - If issue mentions a feature/bug area, check project documentation and relevant source files
- Verify all code references before citing them
- If issue has images in description, use
- Evaluate whether this issue should be decomposed (see Decomposition Criteria below)
- Check if the issue’s team assignment makes sense given available teams
- Draft enhanced title and description (calibrated to quality gap)
- Run safety checks (see Safety Review section)
- Return results in the Output Format specified below
Linking Rules
Use these URL patterns for all references in descriptions:
- Issues:
https://linear.app/WORKSPACE_SLUG/issue/ISSUE-IDâ WORKSPACE_SLUG: [dynamic] - Source files:
REPO_BROWSE_URL/file#Lstart-Lendâ REPO_BROWSE_URL: [dynamic] - Documents:
REPO_BROWSE_URL/path/to/document - If slugs/URLs are unavailable, fall back to plain text
Enhancement Footer
ALWAYS append a single footer line to the description, even for NoChangesNeeded issues. Format:
_Last enhanced: v[VERSION], [ISO-8601-TIMESTAMP]_
Example: _Last enhanced: v2, 2024-01-15T12:00:00Z_
Rules:
- If description already has a
_Last enhanced:line, replace it (never duplicate) - Remove any old-format blocks (
<enhance-linear-issues>,<EnhanceLinearSkills>) during enhancement - Use the current version number and UTC timestamp
Phase 2 â Review and Apply
Step 6: Collect and Present Proposals
After all issues are processed, collect the proposals and present a unified change plan showing all issues at once:
# Enhancement Plan
**Mode:** [Auto/Preview]
**Issues analyzed:** [N]
**Proposed changes:** [N] (Skipped: [N], Flagged: [N])
[For each issue, use the Output Format below]
Step 7: Safety Review
Run automated sanity checks on each proposal before presenting/applying:
| Check | Fail Condition | Action |
|---|---|---|
| Description shrinkage | Proposed description >20% shorter than original | FLAG |
| Title radical change | Edit distance >50% of original title length | FLAG |
| Data loss | Screenshots/links in original but missing in proposal | FLAG |
| Invalid team | Team reassignment to non-existent team | FLAG |
| Orphaned sub-issues | Decomposition creates children without updating parent description | FLAG |
| Circular relations | relatedTo would create self-reference |
FLAG |
Auto mode: Flagged proposals are skipped (not applied) and reported in the summary. Preview mode: Flagged proposals require explicit selection even when choosing “Apply all passing.”
Step 8: Approval
Auto mode:
- Auto-apply all proposals that pass safety review (PASS status)
- Skip any flagged proposals â do not apply them
- Report what was applied and what was skipped (with reasons)
- No user interaction at any point
Preview mode:
- Present the unified change plan with safety status per issue
- Show a single menu prompt with these options:
- Complete preview (default) â Report only, no changes applied
- Apply all passing â Apply all proposals that passed safety review
- Choose which to apply â Let user pick specific issues by ID
- Flagged proposals require explicit selection even with “Apply all passing”
Step 9: Apply Changes
For each approved issue:
- Call
Linear:update_issuewith new title and/or description - If decomposing: create sub-issues with
Linear:create_issueusingparentId, then update parent description - If linking related issues: call
Linear:update_issuewithrelatedTo - Confirm what was changed
Error recovery: If Linear:update_issue fails for an issue, log the error, continue with remaining issues, and report failures in the summary. Never stop the entire batch for a single failure.
Guard Rails
DO NOT:
- Remove anything â Screenshots, comments, links, attachments stay intact
- Invent details â If you don’t know, don’t guess. Say “needs investigation”
- Over-specify features â Don’t turn “add labels” into a Prisma schema
- Sanitize voice â “I clicked like a crazy person” is personality, not a grammar error
- Add implementation details unless the issue is clearly meant to be a spec
- Assume vagueness is error â Sometimes flexibility is intentional
- Auto-assign to individuals â We lack workload knowledge; only recommend team reassignment
- Nest sub-issues â Don’t decompose issues that are already sub-issues without strong justification
DO:
- Fix actual errors â Typos, grammar, trailing punctuation
- Add structure â Headers make long descriptions scannable
- Describe screenshots â “Screenshot shows: repeated text in grouping expansion for segment S-14”
- Link related issues â If you find related issues, add them via
relatedTo - Add enhancement footer â Always append
_Last enhanced: v[VERSION], [TIMESTAMP]_; replace existing; never duplicate - Cite specific code as links â Use REPO_BROWSE_URL for file:line references, but ONLY if verified
- Recommend team changes â When an issue clearly belongs on a different team, say so with reasoning
Output Format
For each issue, report under a ## TEAM-XXX: [Title] heading:
- Quality assessment and recommendation (NoChangesNeeded/LightTouch/Moderate/Significant/Decomposed)
- Title: current vs proposed (or NO CHANGE)
- Description: current vs proposed (or NO CHANGE)
- Sub-issues (if decomposing): child titles, descriptions, and parent update
- Related issues: issue IDs with relationship reason
- Team assignment: current vs proposed with reasoning (or NO CHANGE)
- Safety check: PASS or FLAG with explanation
- Changes summary: what changed and why
Enhancement Calibration
Quality Assessment Scale
| Current Quality | Enhancement Level | What It Looks Like |
|---|---|---|
| Excellent (structured, clear, actionable) | NoChangesNeeded | Has Problem/Expected/Criteria sections, code refs, links |
| Good (clear intent, some structure) | LightTouch: grammar, minor clarity | Fix typos, preserve author’s structure |
| Medium (understandable but sparse) | Moderate: add structure, clarify | Add sections, expand terse points |
| Poor (screenshot + few sentences) | Significant: full restructure | Add Problem/Causes/Investigation sections |
By Issue Type
Bug Issues benefit from:
- Problem statement (what’s broken, where)
- Reproduction steps (if known or inferable)
- Expected vs actual behavior
- Investigation pointers (relevant files/functions â verified only)
- Possible causes (if codebase context helps)
Feature Issues benefit from:
- Clear description of desired outcome
- Reasoning/motivation (preserve if present)
- Acceptance criteria (if straightforward to infer)
- NOT implementation specs unless issue is clearly meant to be a spec
Task Issues benefit from:
- Clear definition of done
- Context links (related issues, docs)
Common Mistakes
| Mistake | Example | Fix |
|---|---|---|
| Over-enhancement | Turning feature request into implementation spec | Match enhancement to issue type |
| Lost personality | Removing casual language | Only fix actual grammar errors |
| Hallucinated details | “See line 165 in foo.ts” (wrong) | Verify every code reference |
| Scope creep | Adding “Out of Scope” sections to simple issues | Keep additions proportional |
| Template forcing | Every issue gets Problem/Expected/Criteria | Adapt structure to issue type |
| Description inflation | Adding filler text that doesn’t add information | Every added sentence must carry new signal |
Calibration Examples
Poor issue (bug report) â Significant enhancement:
Before: Title “Data export broken:” / Description: [screenshot] “Noticed this happening a few times. Maybe we should add validation?”
Appropriate: Fix trailing colon in title. Add Problem/Possible Causes/Investigation structure. Add verified file paths. Describe screenshot. Add footer.
Good issue (feature request) â LightTouch:
Before: Well-reasoned feature request with screenshots and flexibility notes like “feel free to simplify if needed”
Appropriate: Fix typos. Light restructure with headers IF it helps readability. Preserve flexibility language. Do NOT add implementation details. Add footer.
Excellent issue â NoChangesNeeded:
Before: Structured with Problem, Root Cause, Solution, Tasks, References sections. Includes exact error codes, code snippets, and documentation links.
Appropriate: Add enhancement footer only. No content changes. Note in report why: “Already excellent â structured with problem/cause/solution, includes code examples and references.”
Decomposition Criteria
When to Decompose
Decompose when ALL of these are true:
- Issue describes 2+ distinct deliverables (not just sequential steps of one task)
- Each deliverable is independently verifiable
- Parallel work OR incremental delivery has clear value
When NOT to Decompose
Do NOT decompose when ANY of these are true:
- Issue is a single coherent task (even if multi-step)
- Steps are sequential and tightly coupled (step 2 can’t start without step 1’s output)
- Total effort is small (< 1 day of work)
- Issue is already a sub-issue (don’t nest further without strong justification)
- Issue author explicitly notes it should stay as one unit
Decomposition Implementation
When decomposing:
- Original issue becomes the parent
- Create sub-issues with
parentIdpointing to the original - Update original description to reference children and serve as an overview
- Each sub-issue gets its own clear scope and acceptance criteria
- Preserve the original issue’s labels and priority on children
Decomposition Examples
DECOMPOSE â Multi-deliverable feature: “Add label support â create label management UI, add label picker to annotations, add label filtering to views” â Three distinct deliverables, each independently verifiable, can be worked in parallel.
DON’T DECOMPOSE â Sequential, coupled steps: “Fix advisory lock timeout â add DIRECT_DATABASE_URL env var, update prisma.config.ts to use directUrl, optionally increase lock timeout” â Steps are tightly sequential. Single coherent fix for one root cause.
DON’T DECOMPOSE â Single task with multiple aspects: “Grouping expansions have repeated text â might need post-LLM scrubbing or prompt tweaks” â One problem, one investigation. Alternative approaches to the same fix.
DECOMPOSE â Bug affecting multiple systems: “Dark mode colors are wrong â sidebar uses hardcoded colors, concept tree doesn’t respect theme, settings page has white backgrounds” â Three independent UI areas, each independently fixable and verifiable.
DON’T DECOMPOSE â Small task: “Update the logo on the landing page and in the sidebar” â Two instances of the same trivial change. Less than an hour of work.
Recommendation Confidence
When proposing decomposition, state confidence:
- High confidence: Clear multiple deliverables, obvious parallel value
- Medium confidence: Could go either way â present reasoning, let user decide
- Low confidence: Lean toward keeping together â mention as possibility but recommend against