Linear Research Document Generator
Create a comprehensive, well-researched Linear document by gathering context from multiple sources.
Overview
This skill creates a Linear document that synthesizes:
- •Recent work context - what the user was just working on
- •Codebase research - relevant code, patterns, and architecture
- •Web research - best practices, documentation, related articles
- •PR information - any related pull requests
- •Linear tickets - any related existing issues
Workflow
Phase 1: Gather Context
1.1 Determine the Topic
If the user provided a topic via $ARGUMENTS, use that. Otherwise, analyze recent work:
# Check recent git activity git log --oneline -20 2>/dev/null || echo "No git history" git diff --stat HEAD~5 2>/dev/null || echo "No recent changes" git branch --show-current 2>/dev/null || echo "Not in a git repo"
Ask the user to confirm or clarify the topic if it's ambiguous.
1.2 Gather Git/PR Context
Search for related PRs and recent commits:
# Get current branch and recent commits git log --oneline -10 --format="%h %s" 2>/dev/null # Check for open PRs on current branch gh pr list --head $(git branch --show-current 2>/dev/null) --json number,title,url,body 2>/dev/null # Get PR details if one exists gh pr view --json number,title,body,url,additions,deletions,changedFiles,commits 2>/dev/null
1.3 Search Linear for Related Tickets
Use the Linear MCP tools to find related issues:
- •Search for issues matching the topic keywords
- •Look for issues assigned to the current user
- •Check for issues updated recently that might be related
Phase 2: Research
2.1 Codebase Research
Use exploration tools to understand the relevant code:
- •Find related files - Use Glob and Grep to locate relevant code
- •Read key files - Understand the implementation details
- •Identify patterns - Note architectural decisions and conventions
- •Find dependencies - Understand what the code interacts with
2.2 Web Research
Use WebSearch and WebFetch to gather external information:
- •Official documentation - For any libraries/frameworks involved
- •Best practices - Industry standards and recommendations
- •Similar implementations - How others solved similar problems
- •Security considerations - Any relevant security guidance
Phase 3: Compile the Document
Create a Linear document with the following structure:
# [Topic Title] ## Summary [2-3 sentence overview of what this document covers] ## Background [Context about why this work was done, what problem it solves] ## Technical Details ### Implementation [Key technical decisions, architecture, code patterns] ### Key Files [List of important files with brief descriptions] ### Dependencies [External libraries, services, or internal modules used] ## Related Work ### Pull Requests [Link to any related PRs with brief descriptions] ### Linear Tickets [Link to any related Linear issues] ## Research & References ### Documentation [Links to relevant official docs] ### Best Practices [Industry standards and recommendations discovered] ### External Resources [Helpful articles, tutorials, or examples found] ## Open Questions / Future Work [Any unresolved questions or potential improvements] ## Appendix [Additional details, code snippets, or diagrams if needed]
Phase 4: Create the Linear Document
Use the mcp__plugin_linear_linear__create_document tool to create the document:
- •Title: Clear, descriptive title for the document
- •Project: Ask user which Linear project to use (or detect from context)
- •Content: The compiled markdown content
Important Notes
- •Always verify context - Confirm with the user that you've identified the correct topic
- •Be thorough but concise - Include important details without overwhelming
- •Link, don't copy - Reference external resources rather than copying content
- •Structured for scanning - Use headers, bullets, and formatting for readability
- •Include the PR - If there's a related PR, always include it prominently
Example Invocations
- •
/linear-research-doc- Auto-detect topic from recent work - •
/linear-research-doc OAuth implementation- Create doc about OAuth work - •
/linear-research-docafter completing a feature - Document the completed work
Output
After creating the document, provide:
- •Link to the created Linear document
- •Brief summary of what was included
- •Any gaps or areas that might need manual additions