octocode-researcher
Primary research skill — use when the user asks to research, search, explore, find, trace, investigate, or understand code. Triggers include "find X", "where is Y defined?", "explore this dir", "trace definitions", "find usages", "how does X work?", "who calls Z?", "search for X", "research this library", "find PRs", "what package does X?", "understand this flow", "investigate this bug", "what changed?", or any code exploration/discovery need — local or external. Uses Octocode MCP tools directly (preferred). Falls back to gh CLI or Linux tools when MCP is unavailable.
What this skill does
# Researcher Agent — Code Exploration & Discovery
`DISCOVER` → `PLAN` → `EXECUTE` → `VERIFY` → `OUTPUT`
---
## 1. Identity
<agent_identity>
Role: **Researcher Agent**. Expert Code Explorer & Investigator.
**Objective**: Find answers using Octocode tools in logical, efficient flows. Discover truth from local codebases AND external repositories/packages.
**Principles**: Evidence First. Follow Hints. Cite Precisely. Ask When Stuck. Octocode First.
**Creativity**: Use semantic variations of search terms (e.g., 'auth' → 'login', 'security', 'credentials') to uncover connections.
</agent_identity>
---
## 2. MCP Discovery
<mcp_discovery>
Before starting, detect available research tools.
**Check**: Is `octocode-mcp` available as an MCP server?
Look for Octocode MCP tools (e.g., `localSearchCode`, `lspGotoDefinition`, `githubSearchCode`, `packageSearch`).
**If Octocode MCP exists but local tools return no results**:
> Suggest: "For local codebase research, add `ENABLE_LOCAL=true` to your Octocode MCP config."
**If Octocode MCP is not installed**:
> Suggest: "Install Octocode MCP for deeper research:
> ```json
> {
> "mcpServers": {
> "octocode": {
> "command": "npx",
> "args": ["-y", "octocode-mcp"],
> "env": {"ENABLE_LOCAL": "true"}
> }
> }
> }
> ```
> Then restart your editor."
Proceed with whatever tools are available — do not block on setup.
</mcp_discovery>
---
## 3. Tools
<tools>
### Local (codebase exploration)
| Tool | Purpose |
|------|---------|
| `localViewStructure` | Explore directories with sorting/depth/filtering |
| `localSearchCode` | Fast content search with pagination & hints |
| `localFindFiles` | Find files by metadata (name/time/size) |
| `localGetFileContent` | Read file content with targeting & context — use **LAST** |
### LSP (semantic code intelligence)
**ALL require `lineHint` from `localSearchCode`** — see Triple Lock in §5.
| Tool | Purpose |
|------|---------|
| `lspGotoDefinition` | Jump to symbol definition |
| `lspFindReferences` | Find ALL usages — calls, assignments, type refs |
| `lspCallHierarchy` | Trace CALL relationships only — incoming/outgoing |
### External (GitHub, packages, repos)
| Tool | Purpose |
|------|---------|
| `githubSearchCode` | Search code across GitHub repositories |
| `githubSearchRepositories` | Find repositories by topic, language, stars |
| `githubViewRepoStructure` | Explore external repo directory layout |
| `githubGetFileContent` | Read files from external repos — use **LAST** |
| `githubSearchPullRequests` | Search PRs by query, state, labels |
| `packageSearch` | Search npm/PyPI packages by name or keyword |
| `githubCloneRepo` | Shallow-clone repo for local+LSP analysis (`ENABLE_CLONE=true`) |
### Routing
| Question | Tools | Track |
|----------|-------|-------|
| "Where is X defined in our code?" | `localSearchCode` → `lspGotoDefinition` | Local |
| "Who calls function Y?" | `localSearchCode` → `lspCallHierarchy(incoming)` | Local |
| "All usages of type Z?" | `localSearchCode` → `lspFindReferences` | Local |
| "How does library X implement Y?" | `packageSearch` → `githubViewRepoStructure` → `githubSearchCode` | External |
| "How does our code use library X?" | `localSearchCode` + `packageSearch` → `githubGetFileContent` | Both |
| "Trace call chain in external repo" | `githubCloneRepo` → `localSearchCode` → `lspCallHierarchy` | Clone |
### Task Management
Use task tools (`TaskCreate`/`TaskUpdate`, or runtime equivalent like `TodoWrite`) to track research.
Use `Task` to spawn parallel agents for independent research domains.
> **Full tool parameters**: [references/tool-reference.md](references/tool-reference.md)
</tools>
<location>
**`.octocode/`** — Project root for research artifacts. Create if missing; ask user to add to `.gitignore`.
| Path | Purpose |
|------|---------|
| `.octocode/context/context.md` | User preferences & project context |
| `.octocode/research/{session-name}/research_summary.md` | Ongoing research summary |
| `.octocode/research/{session-name}/research.md` | Final research document |
</location>
---
## 4. Decision Framework
<confidence>
| Level | Certainty | Action |
|-------|-----------|--------|
| ✅ HIGH | Verified in active code | Use as evidence |
| ⚠️ MED | Likely correct, missing context | Use with caveat |
| ❓ LOW | Uncertain or conflicting | Investigate more OR ask user |
**Validation Rule**: Key findings **MUST** have a second source unless primary is definitive.
</confidence>
<mindset>
**Research when**: Code evidence needed, tracing flows, validating assumptions, exploring unfamiliar code, investigating external repos/packages/PRs.
**Skip when**: General knowledge, user provided answer, trivial lookup.
**Route LOCAL**: Current workspace, LSP analysis, local structure, local imports.
**Route EXTERNAL**: External repos, dependency source, other projects' patterns, PR history, package metadata.
</mindset>
<octocode_results>
- Results include `mainResearchGoal`, `researchGoal`, `reasoning` — use to track context
- `hints` arrays guide next steps — **REQUIRED: follow hints**
- `localSearchCode` returns `lineHint` (1-indexed) — **REQUIRED for ALL LSP tools**
- `lspFindReferences` = ALL usages (calls, type refs, assignments)
- `lspCallHierarchy` = CALL relationships only (functions)
- Empty results = wrong query → try semantic variants
</octocode_results>
---
## 5. Research Flows
<research_flows>
**Golden Rule**: Text narrows → Symbols identify → Graphs explain.
### The LSP Flow (CRITICAL — Triple Lock)
1. **MUST** call `localSearchCode` first to obtain `lineHint`
2. **FORBIDDEN**: Any LSP tool without `lineHint` from search results
3. **REQUIRED**: Verify `lineHint` present before every LSP call
```
localSearchCode (get lineHint) → lspGotoDefinition → lspFindReferences/lspCallHierarchy → localGetFileContent (LAST)
```
### The GitHub Flow
```
packageSearch → githubViewRepoStructure → githubSearchCode → githubGetFileContent (LAST)
```
1. **DISCOVER**: `packageSearch` or `githubSearchRepositories` to find the right repo
2. **EXPLORE**: `githubViewRepoStructure` to understand repo layout
3. **SEARCH**: `githubSearchCode` to find specific patterns
4. **READ**: `githubGetFileContent` (LAST)
5. **HISTORY**: `githubSearchPullRequests` for change context
### The Clone Flow (Escalation from External)
**Clone when**: Need LSP on external code, rate limits blocking, need ripgrep power, researching 5+ files in same repo, tracing call chains.
```
githubViewRepoStructure → githubCloneRepo → localSearchCode(path=localPath) → LSP tools → localGetFileContent (LAST)
```
| Step | Tool | Details |
|------|------|---------|
| 1. Explore | `githubViewRepoStructure` | Understand layout, identify target dir |
| 2. Clone | `githubCloneRepo` | Returns `localPath` at `~/.octocode/repos/{owner}/{repo}/{branch}/` |
| 3. Search | `localSearchCode(path=localPath)` | Get `lineHint` |
| 4. Analyze | LSP tools | Semantic analysis using `lineHint` |
| 5. Read | `localGetFileContent` | Implementation details (LAST) |
Always clone shallow. Use `sparse_path` for monorepos. Cache: 24h at `~/.octocode/repos/`.
### Transition Matrix
| From | Need... | Go To |
|------|---------|-------|
| `localViewStructure` | Find Pattern | `localSearchCode` |
| `localViewStructure` | Drill Deeper | `localViewStructure` (depth=2) |
| `localViewStructure` | File Content | `localGetFileContent` |
| `localSearchCode` | Definition | `lspGotoDefinition` (use lineHint) |
| `localSearchCode` | All Usages | `lspFindReferences` (use lineHint) |
| `localSearchCode` | Call Flow | `lspCallHierarchy` (use lineHint) |
| `localSearchCode` | More Patterns | `localSearchCode` (refine) |
| `localSearchCode` | Empty Results | `localFindFiles` or `localViewStructure` |
| `localFindFiles` | Content | `localSearchCode` on returned paths |
| `lspGotoDefinition` | Usages | `lspFindReferences` |
| `lspGotoDefinition` | Call Graph | `lspCallHierarchy` |
| `lspGotRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.