Agent skill
extern-researcher
Research external open-source repositories to learn patterns and implementations. This skill should be used when agents need to study external codebases, check for existing research before cloning, manage temporary workspaces, and persist findings to the global thoughts system. Triggers include: studying external repos, learning from open source, cloning for pattern research, or checking what has been researched.
Install this agent skill to your Project
npx add-skill https://github.com/malhashemi/dotfiles/tree/main/dot_config/opencode/skill/extern-researcher
SKILL.md
Extern Researcher
Overview
Enable agents to efficiently study external open-source repositories by leveraging existing research first, using temporary workspaces for clones, and persisting findings to the global thoughts system.
When to Use
- When needing to study patterns or implementations from external repositories
- When checking if a repository has already been researched
- When cloning an external repo for temporary study
- When persisting research findings about external code
- When cleaning up temporary workspace after research is complete
Key Concepts
Research-Centric Model
The catalog tracks research studies, not cloned repositories. Clones are temporary workspaces; research is the persistent artifact.
Directory Structure
thoughts/global/extern/ # Persistent research storage
├── catalog.md # Global research catalog (markdown + YAML frontmatter)
└── repos/{org-repo}/ # Research documents per repository
{any-project}/.extern/ # Temporary workspace (disposable)
└── {org-repo}/ # Cloned repos for study
Catalog Format
The catalog at thoughts/global/extern/catalog.md uses markdown with YAML frontmatter:
---
type: extern-research-catalog
version: 1.0
last_updated: YYYY-MM-DD
total_repos_studied: N
total_studies: N
repos:
- name: "org/repo"
url: "https://github.com/org/repo"
first_studied: "YYYY-MM-DD"
study_count: N
topics: ["topic1", "topic2"]
---
Scripts
Execute via justfile or directly with uv:
Via Justfile (Recommended)
just -f {base_dir}/justfile <recipe> [args...]
| Recipe | Arguments | Description |
|---|---|---|
list |
List all research in catalog | |
search |
term |
Search catalog by repo or topic |
stats |
Show catalog statistics | |
add-study |
repo url topic document context |
Add a new study to catalog |
Direct Execution
uv run {base_dir}/scripts/catalog.py <command> [args...]
| Command | Arguments | Description |
|---|---|---|
list |
List all research studies | |
search |
<term> |
Search by repo name or topic |
stats |
Show catalog statistics | |
add-study |
--repo --url --topic --document --context |
Add new study |
Core Workflow
Phase 1: Discovery (ALWAYS FIRST)
Before cloning any repository:
- Read the global catalog:
thoughts/global/extern/catalog.md - Search for the repo by name, URL, or topic
- If found:
- Read existing research documents
- Evaluate: Is this sufficient for current needs?
- If YES: Use existing research, skip cloning
- If NO: Proceed to Phase 2, noting what gaps exist
- If not found: Proceed to Phase 2
Phase 2: Workspace Initialization
If cloning is needed:
- Check if
.extern/exists in current project - If not, create it:
bash
mkdir -p .extern - MUST copy AGENTS.md template to workspace:
bashThis provides agent guidance for future sessions working in this directory.
cp {base_dir}/assets/workspace-agents.md .extern/AGENTS.md - Ensure .gitignore includes
.extern/
Phase 3: Clone Repository
- Parse the input (URL, clone command, org/repo format)
- Derive directory name:
{org}-{repo}(lowercase, kebab-case)https://github.com/facebook/react→facebook-reacthttps://github.com/vercel/next.js→vercel-next-js
- Clone with shallow depth (unless full history needed):
bash
git clone --single-branch --depth 1 {url} .extern/{org-repo}/ - Verify success
Phase 4: Research
- Focus on the specific question/topic
- Use appropriate subagents:
codebase-pattern-finder- Find implementations, usage examplescodebase-analyzer- Deep dive on specific componentscodebase-locator- Find files by purpose/feature
- Document findings with file:line references
- Note connections to current project needs
Phase 5: Persist Research
-
Create research document:
- Location:
thoughts/global/extern/repos/{org-repo}/ - Filename:
{YYYY-MM-DD}_{topic-slug}.md - Use the research document template below
- Location:
-
MUST update global catalog using the script (not manual file edits):
bashjust -f {base_dir}/justfile add-study \ "org/repo" \ "https://github.com/org/repo" \ "Topic studied" \ "repos/org-repo/YYYY-MM-DD_topic.md" \ "Why this was studied"The script ensures consistent catalog formatting and validates entries.
-
Sync thoughts if configured:
bashthoughts sync
Phase 6: Cleanup (Optional)
When workspace is no longer needed:
- Confirm with user before deletion
- Remove .extern/ directory:
bash
rm -rf .extern/ - Research remains in thoughts/global/extern/
Research Document Template
When creating research documents, use this structure:
---
date: {ISO timestamp}
repo: "{org}/{repo}"
url: "{full URL}"
topic: "{research topic}"
context: "{why this was studied}"
project: "{project that prompted this}"
tags: [extern-research, {domain-tags}]
---
# {Topic}: {Repo Name}
## Research Question
{What we set out to learn}
## Key Findings
### Finding 1: {Title}
{Description with code examples and file:line references}
### Finding 2: {Title}
{...}
## Applicable Patterns
{How these findings could apply to our work}
## References
- `{file}:{line}` - {description}
Suitable Subagents
| Agent | Use Case |
|---|---|
codebase-pattern-finder |
Find implementations, usage examples |
codebase-analyzer |
Deep dive on specific components |
codebase-locator |
Find files by purpose/feature |
web-search-researcher |
Additional context about the project |
Important Constraints
- ALWAYS check catalog first - Never clone without checking existing research
- Workspace is temporary - Do not store valuable data in .extern/
- Research is permanent - Always persist to thoughts/global/extern/
- Update catalog - Every study must update the global catalog
- Respect clone depth - Use shallow clones unless full history needed
- Use org-repo naming - Include organization to avoid conflicts
Error Handling
- Catalog not found → Create initial catalog at
thoughts/global/extern/catalog.md - Clone fails → Check URL format, network, permissions; report to user
- Research exists but stale → Proceed with new research, reference existing findings
- Workspace already exists → Reuse existing .extern/, check if repo is already cloned
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
phase-execution
Your bulletproof guide to executing implementation phases! Handles commits, detects when phases are too big, and knows when to bail cleanly. Load this whenever you're implementing a phase - it provides clean commit protocol and signals the orchestrator when things go sideways.
parallel-research
Research scope too big? This skill decomposes large questions into independent parts, spawns parallel researchers, and synthesizes findings. Essential when comprehensive research would overflow a single context window.
plan-review
Catch oversized phases BEFORE implementation begins! This skill reviews plans for sizing, dependencies, and completeness - flagging phases that need decomposition before a single line of code is written. Load this when validating plans pre-implementation.
brand-palette
Brand color discovery and palette generation skill. This skill should be used when helping users create brand color palettes, design systems, or Tailwind color configs. It guides through hue selection (RYB color wheel), chroma/tone decisions, and generates Obsidian-compatible palette reports with APCA accessibility validation. Supports starting from hex color or OKLCH values for refinement workflows. Triggers: "brand colors", "palette", "color scheme", "design system colors", "Tailwind colors", "generate palette from hex", "generate palette from OKLCH", or when users describe brand values that imply color decisions.
pr-review-orchestration
Automated PR review cycle for RPIV orchestration. Waits for Gemini reviews, assesses feedback, implements fixes, and manages the review loop. Used by Planner agent after RPIV opens PRs. This skill is triggered automatically by RPIV when entering the PR Review phase.
pr-review
This skill provides a complete workflow for handling GitHub Pull Request reviews, specifically optimized for @gemini-code-assist automated reviews. This skill should be used when addressing PR review comments, responding to reviewers, resolving threads, requesting re-reviews, or merging PRs after feedback is addressed. Triggers include: /pr-review command, "address PR feedback", "handle review comments", "respond to gemini", or any PR review lifecycle management request.
Didn't find tool you were looking for?