skills/mine-research/SKILL.md
Use when the user says: "research adding X", "feasibility study", "evaluate approach", or wants a focused investigation before committing. Dispatches the researcher agent for codebase investigation and presents a structured brief.
npx skillsauth add NodeJSmith/Claudefiles mine-researchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Deep investigation of a codebase to evaluate a proposed change, new pattern, or architectural direction. Heavy on questions — surfaces what the user truly needs, not just what they initially say. Produces a structured research brief.
| Skill | Question it answers |
|-------|-------------------|
| /mine-research | "What would it take to do X in this codebase?" |
| /mine-define | "How should we build X?" |
Research comes before design docs and plans. It's the investigation that makes those possible.
$ARGUMENTS — the proposal to investigate. Can be:
/research "add SQLite database and command pattern"/research "should we use SQLAlchemy or raw sqlite3?"/research "would event sourcing work here?"/research "what would it take to move from files to a database?"/research "this app needs persistent state — what are our options?"Do not start exploring the codebase yet. First, understand what the user actually wants and why.
Use AskUserQuestion to probe motivation, constraints, and prior thinking. Ask 2-3 questions in a single call (multi-question, not multi-select).
The goal is to distinguish between:
Example opening questions — adapt the Motivation options to match the proposal's domain (the example below is for a persistence/data-layer proposal; generate domain-fitting options for architecture, technology-choice, or migration proposals). The snippets are items within the AskUserQuestion: questions: array:
- question: "What's driving this change?"
header: "Motivation"
options:
- label: "Data is getting lost"
description: "State doesn't survive restarts, crashes, or context switches"
- label: "Growing complexity"
description: "In-memory data structures are getting unwieldy"
- label: "New feature needs it"
description: "A planned feature requires persistent or queryable data"
The Flexibility question is consistent across all proposals:
- question: "How committed are you to the specific approach mentioned, vs. open to alternatives?"
header: "Flexibility"
options:
- label: "Exploring options"
description: "I mentioned one idea but I'm open to whatever works best"
- label: "Leaning this way"
description: "I have a preference but could be convinced otherwise"
- label: "Decided"
description: "I've already thought this through — I want to know how, not whether"
Generate domain-appropriate Motivation options based on the user's proposal — the examples above are illustrations, not templates. If the user mentioned multiple things (e.g., "SQLite + command pattern"), ask whether those are linked or separable. If the proposal is vague, ask more. If it's specific, ask fewer.
Based on the answers, ask 1-2 targeted follow-ups to fill in gaps:
Do not ask more than 2 rounds of questions before moving to Phase 2. If you still have uncertainties, note them as open questions to revisit after seeing the code.
Dispatch the research to a researcher agent. This runs the heavy codebase exploration, web research, and synthesis outside the main context window.
get-skill-tmpdir mine-research to get a temp directory.Agent(subagent_type: "researcher") with a prompt containing:
researcher.md<quick|normal|deep><tmpdir>/brief.md<tmpdir>/brief.md and check that it exists and contains the # Research Brief: header. If the file is missing, empty, or lacks the expected header, inform the user that the research agent failed to produce a complete brief and offer:
Research briefs are forward-looking — they evaluate a proposed change before committing to an approach. They may feed into a design doc (when a direction is chosen) or be abandoned (if the approach is rejected).
The recommended convention is a date-stamped topic directory under design/research/:
design/research/
└── YYYY-MM-DD-topic-name/
├── research.md Main research brief
├── prereq-01-name.md Prerequisite breakdowns (if applicable)
└── ... Additional artifacts
AskUserQuestion:
question: "Where should I save the research brief?"
header: "Output"
multiSelect: false
options:
- label: "design/research/ (Recommended)"
description: "Save as design/research/YYYY-MM-DD-<topic>/research.md — with room for prereq breakdowns"
- label: "docs/research/"
description: "Save as docs/research/YYYY-MM-DD-<topic>.md"
- label: "Just show me"
description: "Display in the conversation, don't save a file"
Create the design/research/ directory if it doesn't exist. If the project already has research in docs/, follow the existing convention.
Copy (never move) the brief from the temp file to the user's chosen location, or display it inline if they chose "Just show me". The tmpdir copy must always remain intact — downstream challenge and design handoffs reference it.
After the save step, set <research_brief_path>:
<research_brief_path> = the saved file path<research_brief_path> = <tmpdir>/brief.mdPresent the key findings conversationally and ask what the user wants to do next.
AskUserQuestion:
question: "Research is done. What would you like to do next?"
header: "Next step"
multiSelect: false
options:
- label: "Challenge these findings first"
description: "Run /mine-challenge on the research brief before committing to a direction"
- label: "Design it (/mine-define)"
description: "Formalize findings into a design doc — the research brief will be passed as prior work"
- label: "Build it (/mine-build)"
description: "Skip design — route straight to implementation"
- label: "I need to think about it"
description: "The brief has what I need — I'll come back when I'm ready"
If "Challenge these findings first" is selected: invoke /mine-challenge --mode=passthrough --target-type=research <research_brief_path>. After challenge completes, loop back to this gate.
If "Design it (/mine-define)" is selected: invoke /mine-define and pass <research_brief_path> so mine-define can use it as prior work and skip its own researcher dispatch.
If "Build it (/mine-build)" is selected: invoke /mine-build with context: "Prior research brief available at <research_brief_path>." This ensures mine-build's prior-analysis detection fires reliably.
| Rationalization | Reality | |---|---| | "I have extensive prior analysis — skip research" | Prior analysis covers the problem space. Research covers the solution space — competing approaches, existing patterns in the codebase, API constraints. They answer different questions. Skipping research has led to shipping with suboptimal designs that a brief investigation would have caught. | | "The approach is obvious, no need to investigate" | The "obviously correct" approach is by definition the least-investigated one. Research has repeatedly surfaced better designs — method-based vs persona-based splits, orthogonal dimensions the intuitive approach didn't consider. Research is cheap relative to a design revision after challenge finds gaps. | | "Research will slow us down" | A 2-minute research dispatch is cheaper than a design revision after challenge finds holes that research would have prevented. The brief feeds forward into design — skipping it means the design phase compensates with ad-hoc investigation anyway. | | "This question implies we should design/file/ship" | A scoped question ("can X be done?") is not a workflow trigger. Answer the question by completing the brief and presenting the Phase 3 next-step gate — that gate is the escalation offer. Don't silently launch issue filing, design, or shipping from a scoped question. |
/mine-define to formalize decisions./mine-build to route to the right implementation workflow./mine-challenge for general health assessment.development
Use when the user says: "document how X works", "write up how this works", "durable explanation", "explain this for the docs", "document this subsystem". Writes a durable, architectural-altitude explanation that survives code churn.
development
Use when picking up a fresh session after /clear, a stop, or an unanswered AskUserQuestion. Reconstructs the prior session's intent from its transcript tail and surfaces any unresolved decision; user-invoked only — for a hand-written end-of-day handoff use /mine-good-morning instead.
development
Use when the user says: "what did we discuss", "continue where we left off", "remember when", "as I mentioned", "you suggested", "we decided", "search my conversations", "find the conversation where", "what did we work on", or uses implicit signals like past-tense references, possessives without context, or assumptive questions. Direct search over past Claude Code sessions via cass.
tools
Use when the user says: "what context do I have", "relevant history for this task", "what have we done related to this". Also usable proactively when starting work that likely has prior history. Assembles a structured context brief from past session history via cass, scoped to the current task and workspace.