plugins/dev/skills/research-codebase/SKILL.md
Conduct comprehensive codebase research using parallel sub-agents. **ALWAYS use when** the user asks to 'research', 'investigate', 'explore the codebase', 'how does X work', 'find out about', or needs deep analysis of how existing code is structured. Produces a research document in thoughts/shared/research/ with file:line references.
npx skillsauth add coalesce-labs/catalyst research-codebaseInstall 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.
You are tasked with conducting comprehensive research across the codebase to answer user questions by spawning parallel sub-agents and synthesizing their findings.
You are a documentarian, not a critic. Document what EXISTS without suggesting improvements, critiquing implementation, or proposing changes unless the user explicitly asks.
CRITICAL REQUIREMENTS — read these before doing anything else:
thoughts/shared/research/YYYY-MM-DD-description.md# Check project setup (thoughts, CLAUDE.md snippet, config)
if [[ -f "${CLAUDE_PLUGIN_ROOT}/scripts/check-project-setup.sh" ]]; then
"${CLAUDE_PLUGIN_ROOT}/scripts/check-project-setup.sh" || exit 1
fi
SESSION_SCRIPT="${CLAUDE_PLUGIN_ROOT}/scripts/catalyst-session.sh"
if [[ -x "$SESSION_SCRIPT" ]]; then
CATALYST_SESSION_ID=$("$SESSION_SCRIPT" start --skill "research-codebase" \
--ticket "${TICKET_ID:-}" \
--workflow "${CATALYST_SESSION_ID:-}")
export CATALYST_SESSION_ID
fi
When this command is invoked, respond with:
I'm ready to research the codebase. Please provide your research question or area of interest,
and I'll analyze it thoroughly by exploring relevant components and connections.
Then wait for the user's research query.
Before reading files or spawning sub-agents, get a high-level understanding from DeepWiki. This provides a compressed overview of the codebase that guides all subsequent research and saves tokens.
Prerequisite check — only run this step if both conditions are met:
mcp__deepwiki__ask_question tool is available (DeepWiki MCP is installed)If either condition fails, skip to Step 1 — do not retry or warn the user.
Steps:
gh repo view --json nameWithOwner -q .nameWithOwner
mcp__deepwiki__ask_question({
repoName: "<owner/repo>",
question: "<rephrase the user's research query for DeepWiki>"
})
Guidelines:
stateMap.research)Create multiple Task agents to research different aspects concurrently.
Specialized agents available:
The key is to use these agents intelligently:
After spawning agents, record the phase transition:
if [[ -n "${CATALYST_SESSION_ID:-}" && -x "$SESSION_SCRIPT" ]]; then
"$SESSION_SCRIPT" phase "$CATALYST_SESSION_ID" "researching" --phase 1
fi
file.ext:line)Collect metadata using git commands:
git rev-parse HEADgit branch --show-currentDocument location: thoughts/shared/research/YYYY-MM-DD-{ticket}-{description}.md
thoughts/shared/research/YYYY-MM-DD-PROJ-XXXX-description.mdthoughts/shared/research/YYYY-MM-DD-description.mdPROJ with your ticket prefix from .catalyst/config.jsonIMPORTANT: Document Storage Rules
thoughts/shared/research/thoughts/searchable/ (read-only search index)Create a structured research document:
---
date: YYYY-MM-DDTHH:MM:SS+TZ
researcher: { your-name }
git_commit: { commit-hash }
branch: { branch-name }
repository: { repo-name }
topic: "{User's Research Question}"
tags: [research, codebase, { component-names }]
status: complete
last_updated: YYYY-MM-DD
last_updated_by: { your-name }
type: research
source_ticket: { TICKET-ID or null }
---
# Research: {User's Research Question}
**Date**: {date/time with timezone} **Researcher**: {your-name} **Git Commit**: {commit-hash}
**Branch**: {branch-name} **Repository**: {repo-name}
## Research Question
{Original user query, verbatim}
## Summary
{High-level documentation of what you found. 2-3 paragraphs explaining the current state of the
system in this area. Focus on WHAT EXISTS, not what should exist.}
## Detailed Findings
### {Component/Area 1}
**What exists**: {Describe the current implementation}
- File location: `path/to/file.ext:123`
- Current behavior: {what it does}
- Key functions/classes: {list with file:line references}
**Connections**: {How this component integrates with others}
### {Component/Area N}
{Continue for all major findings}
## Code References
- `path/to/file1.ext:123-145` - {What this code does}
- `path/to/file2.ext:67` - {What this code does}
## Architecture Documentation
{Document current architectural patterns and data flow. Descriptive, not prescriptive.}
## Historical Context (from thoughts/)
{Include insights from thoughts/ documents that provide context, if applicable}
## Open Questions
{Areas that would benefit from further investigation}
## Related Documents
{List related thoughts documents using wiki-links, e.g.:}
- [[YYYY-MM-DD-source-ticket|Source Ticket]]
- [[YYYY-MM-DD-related-research|Related Research]]
https://github.com/{owner}/{repo}/blob/{commit}/{file}#L{line}MANDATORY — do all three sub-steps before presenting results to the user.
8a. Sync thoughts:
humanlayer thoughts sync
8b. Linear comment (if ticket detected): Add a comment noting research is complete and
linking the document path. Use Linearis CLI (run linearis comments usage for syntax).
8e. Present summary to user:
Research complete!
**Research document**: {exact file path you wrote}
**Summary**: {2-3 sentence summary}
**Key files**: {Top 3-5 file references}
Would you like me to:
1. Dive deeper into any specific area?
2. Explore related topics?
End session tracking:
if [[ -n "${CATALYST_SESSION_ID:-}" && -x "$SESSION_SCRIPT" ]]; then
"$SESSION_SCRIPT" end "$CATALYST_SESSION_ID" --status done
fi
STOP HERE. Do NOT offer to create plans, use EnterPlanMode, or start implementing. Research is complete.
If the user has follow-up questions:
last_updated, last_updated_by, add last_updated_note## Follow-up Research: {Question}/create_plan's jobthoughts/searchable/ paths should be documented as thoughts/shared/ equivalentsIf a ticket is detected (provided as argument, mentioned in query, or from context):
stateMap.research from config
using Linearis CLI (run linearis issues usage for syntax).linearis comments usage for syntax).testing
Phase-agent that fixes a failing verify verdict so the pipeline self-heals instead of stalling to needs-human (CTL-653). Reads `${ORCH_DIR}/workers/<ticket>/verify.json`, fixes the `findings[]` (every severity:"high" plus the regression_risk drivers) directly via Edit/Write, commits the remediation, and emits `phase.remediate.complete.<ticket>`. The scheduler's router then re-dispatches `verify` to re-check (the verify⇄remediate cycle, cap 3). Dispatched as a `claude --bg` job by `phase-agent-dispatch`, which invokes it via slash command — hence `user-invocable: true`.
development
Phase agent for the verify step of the 9-phase orchestrator pipeline (CTL-450). NEW skill — has no canonical wrapper. Runs read-only adversarial verification against the implement-phase diff: tsc, tests, lint, security scan, reward-hacking scan, code review, test coverage, silent-failure hunt. Writes ${ORCH_DIR}/workers/<TICKET>/verify.json then emits phase.verify.complete.<ticket>. Reads phase-implement.json as its prior-phase artifact. NEVER writes application code — only test files allowed. Spawned via phase-agent-dispatch via slash command — hence `user-invocable: true`.
tools
--- name: phase-triage description: Phase agent that triages a Linear ticket — expands acronyms, classifies (feature/bug/docs/refactor/chore), identifies dependencies, estimates scope, writes triage.json, and posts a triage analysis comment to Linear. Triage completion is signaled by that comment plus the local triage.json — there is no `triaged` label. Emits phase.triage.complete.<TICKET> on success and phase.triage.failed.<TICKET> on error. Dispatched by the phase-agent orchestrator (CTL-452)
testing
Phase agent for the review step of the 9-phase orchestrator pipeline (CTL-450). Wraps the /review skill (gstack) — explicitly skips /ultrareview per user decision. Reads verify.json from the prior phase, runs /review against the diff, writes ${ORCH_DIR}/workers/<TICKET>/review.json, and creates a remediation commit for any HIGH-severity finding that has a deterministic fix. Emits phase.review.complete.<ticket>. Spawned via phase-agent-dispatch via slash command — hence `user-invocable: true`.