research-first
Skill0 starsChanged 23 days agoMITView on GitHub
Strict research hierarchy before writing code — search codebase, docs, web, and registries in order.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- mahumadad/quarrytheir own version, first seen Nov 8, 2026
- danielvm-git/bigpowerstheir own version, first seen Nov 6, 2026
- BipBop-Labs/bipbop-skillstheir own version, first seen Nov 1, 2026
- OpenxIntelligence/Coding-Agent-Skillstheir own version, first seen Nov 1, 2026
- ZaxbyHub/opencode-swarmtheir own version, first seen Oct 30, 2026
- I-Onlabs/claude-code-skillstheir own version, first seen Oct 25, 2026
Used with
Projects with it also use council.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillcouncil
Convene the persona panel — six orthogonal review lenses — on a target. Cold independent fan-out, debate-to-consensus, synthesized verdict with recorded dissent and a roster manifest.
Also in 3 projects that use this
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- zaxbysauce/opencode-swarm★ 519same name
- ZaxbyHub/opencode-swarm★ 518same name
- danielvm-git/bigpowers★ 288same name
- I-Onlabs/claude-code-skills★ 4same name
- OpenxIntelligence/Coding-Agent-Skills★ 4same name
- BipBop-Labs/bipbop-skills★ 3same name
- TheElephantCoder/agent-harness★ 3same name
- CatsMansion/research-first★ 1same name
- evanmcgoogan/skin-in-the-game★ 1same name
- lukasrepublic/agentic-foundry★ 1same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- api-designSkill
- arch-constraint-guardSkill
- backend-patternsSkill
- clean-architectureSkill
- codebase-mappingSkill
- context-budgetSkill
- cqrsSkill
- ddd-architectureSkill
- debug-flowSkill
- dependency-auditSkill
- django-patternsSkill
- django-tddSkill
- event-driven-architectureSkill
- fd-codenavSkill
- fd-mapSkill
- frontend-patternSkill
- git-releaseSkill
- git-workflowSkill
- golang-patternsSkill
- hexagonal-architectureSkill
- java-patternsSkill
- layered-architectureSkill
- performance-profilingSkill
- postgres-patternsSkill
- python-patternsSkill
- refactor-guideSkill
- rust-patternsSkill
- saga-architectureSkill
- security-scanSkill
- tdd-workflowSkill
- test-gap-detectorSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 7 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use this skill when:
- Distinctive: line 62
When to use: Always start here. Before writing anything, check if the pattern already exists in the project.
- Distinctive: line 74
Test files that show expected usage
- Distinctive: line 144
No authoritative source answers the question
- Distinctive: line 163
When to use: Before writing any utility function, verify it does not already exist as a well-maintained package.
- Distinctive: line 176
No suitable package exists → build custom, informed by research
- Distinctive: line 339
Before implementing any feature, run through Levels 1-2.
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/research-first — Research Hierarchy
Enforces a strict research-first workflow before any implementation. Research in order of proximity: codebase first, structured docs second, web third, registries last.
Trigger
Use this skill when:
- About to write any new function, module, or integration
- Unsure of an API signature, behavior, or pattern
- Creating utilities, helpers, or abstractions
- Evaluating whether to add a dependency
- Debugging an issue in unfamiliar code
The Four-Level Hierarchy
┌─────────────────────────────────────────────────────────────┐
│ RESEARCH HIERARCHY │
├─────────────────────────────────────────────────────────────┤
│ LEVEL 1: CODEBASE │
│ ┌─────────────┐ ┌─────────────────┐ │
│ │ LSP / Grep │ │ grep.app │ │
│ │ (symbols) │ │ (code search) │ │
│ └─────────────┘ └─────────────────┘ │
│ When: Need patterns, examples, or existing implementations │
│ Escalate: If codebase has no relevant code │
├─────────────────────────────────────────────────────────────┤
│ LEVEL 2: STRUCTURED DOCS │
│ ┌─────────────────┐ │
│ │ Context7 MCP │ │
│ │ (library docs) │ │
│ └─────────────────┘ │
│ When: Need accurate API signatures and usage │
│ Escalate: If library not indexed or docs incomplete │
├─────────────────────────────────────────────────────────────┤
│ LEVEL 3: WEB SEARCH │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Exa MCP │ │ Web fetch │ │
│ │ (semantic) │ │ (direct) │ │
│ └─────────────┘ └─────────────┘ │
│ When: Level 1-2 insufficient or library unfamiliar │
│ Escalate: If no authoritative source found │
├─────────────────────────────────────────────────────────────┤
│ LEVEL 4: PACKAGE REGISTRIES │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ npm / PyPI │ │ GitHub │ │
│ │ (search) │ │ (packages) │ │
│ └─────────────┘ └─────────────┘ │
│ When: Need to verify existence of utility / alternative │
│ Escalate: Only if nothing suitable exists │
└─────────────────────────────────────────────────────────────┘Level 1: Codebase Search
When to use: Always start here. Before writing anything, check if the pattern already exists in the project.
Tools:
- LSP workspace symbols / document symbols — find symbols, functions, types by name or pattern
- LSP references and call hierarchy (Grep as fallback) — a symbol's callers, callees, and imports
- LSP definition, then
Readwith offset and limit — full context and source for one symbol grep_app_searchGitHub— search GitHub for real-world code examples
What to look for:
- Existing utility functions that do what you need
- Similar features implemented elsewhere in the project
- Naming conventions and patterns used by the team
- Test files that show expected usage
Escalate to Level 2 when:
- The codebase has no relevant implementation
- You need library-specific API details
- The project uses an external dependency you are unfamiliar with
Level 1 Example
Need: Parse a JSON configuration file with defaults
Step 1: workspace symbol search for "parseConfig" or "loadConfig"
Result: Found loadConfig() in src/config/loader.ts
Step 2: LSP definition of loadConfig
Result: Understands the loader handles JSON, YAML, and env overrides
Decision: Reuse loadConfig() instead of writing a new parser.Level 2: Structured Documentation (Context7)
When to use: You need accurate API signatures, method names, parameter types, or version-specific behavior for a library.
Tools:
context7_resolve-library-id— find the correct Context7 IDcontext7_query-docs— query structured documentation with examples
What to look for:
- Exact function signatures and return types
- Code examples from official docs
- Version-specific behavior and deprecations
- Configuration options and defaults
Escalate to Level 3 when:
- The library is not indexed in Context7
- The docs are incomplete or ambiguous
- You need community patterns, not just API reference
Level 2 Example
Need: Use React useEffect cleanup correctly
Step 1: context7_resolve-library-id for "React"
Result: /facebook/react
Step 2: context7_query-docs for "useEffect cleanup function examples"
Result: Official patterns for subscription cleanup, event listener removal
Decision: Use the documented cleanup pattern; no need to search further.Level 3: Web Search
When to use: Levels 1-2 failed to answer the question, or you need community consensus, real-world patterns, or comparisons.
Tools:
exa_search— neural search for high-quality sourceswebfetch— fetch specific pages for detailswebsearch_web_search_exa— general web search
What to look for:
- Authoritative blog posts or documentation pages
- GitHub issues or discussions explaining edge cases
- Comparison articles when choosing between alternatives
- Community best practices
Escalate to Level 4 when:
- No authoritative source answers the question
- You are considering writing a utility and need to check if a package exists
- You need to verify package names, versions, or alternatives
Level 3 Example
Need: Understand how to handle rate limiting in a specific API
Step 1: Level 1 — codebase has no API client for this service
Step 2: Level 2 — Context7 has no docs for this third-party API
Step 3: exa_search for "[ServiceName] API rate limit headers retry-after"
Result: Found official docs and community client implementations
Decision: Implement retry with exponential backoff based on Retry-After header.Level 4: Package Registries
When to use: Before writing any utility function, verify it does not already exist as a well-maintained package.
Tools:
grep_app_searchGitHub— search for existing npm/PyPI packages with real usagewebfetch— check npmjs.com or pypi.org directly
What to look for:
- Packages that solve the exact problem
- Download counts, maintenance status, and license compatibility
- Bundle size and dependency tree (avoid bloat)
When to stop:
- A suitable package exists → adopt or extend it
- No suitable package exists → build custom, informed by research
Level 4 Example
Need: Deep merge two objects with type safety
Step 1-3: No existing implementation or docs answer the need
Step 4: Search npm for "deep merge typescript"
Result: lodash.merge (too heavy), deepmerge-ts (lightweight, typed)
Decision: Install deepmerge-ts. Do not write a custom deep merge.Decision Tree
START: Need to implement or understand something
│
▼
┌───────────────────┐
│ Search codebase │ ──NO──▶ ┌─────────────────────┐
│ (LSP, Grep) │ │ Search structured docs│
└───────────────────┘ │ (Context7 MCP) │
│YES └─────────────────────┘
▼ │
[REUSE OR MODEL │NO
AFTER EXISTING] ▼
┌─────────────────────┐
│ Search web │
│ (Exa, webfetch) │
└─────────────────────┘
│
│NO
▼
┌─────────────────────┐
│ Check registries │
│ (npm, PyPI, GitHub) │
└─────────────────────┘
│
│NO
▼
[BUILD CUSTOM]Anti-Patterns
Do NOT guess API signatures
❌ BAD:
"I think the function is called fetchData(url, options)..."
✅ GOOD:
Use Context7 to query the exact signature, or use LSP workspace symbol search (or Grep)
to find existing calls in the codebase.Do NOT write utility functions that already exist
❌ BAD:
Write a custom deepClone() without checking if the project already
uses a utility library or has an internal implementation.
✅ GOOD:
1. workspace symbol search for "clone", "deepClone", "copy"
2. Check package.json for lodash, ramda, or similar
3. Only write custom if nothing suitable existsDo NOT search the web before searching the codebase
❌ BAD:
Open a browser search for "how to parse JSON in TypeScript" when
the project already has a config loader module.
✅ GOOD:
Start with LSP document symbols or workspace symbol search for "config" or "parse" to find
internal patterns before looking externally.Do NOT load full documentation pages into context
❌ BAD:
Fetch an entire docs website or README and dump it into the
conversation context.
✅ GOOD:
Use Context7 for targeted queries. If using webfetch, request
only the specific section or example needed.Concrete Examples
Example 1: Implementing a Retry Wrapper
❌ BAD APPROACH:
- Assume the signature: async function retry(fn, retries)
- Write a 40-line custom retry with exponential backoff
- Discover later the project uses p-retry everywhere
✅ GOOD APPROACH:
1. workspace symbol search for "retry" → finds p-retry usage in src/utils/
2. LSP definition of withRetry → understands backoff config
3. Reuse p-retry with project-standard options
4. Implementation: 3 linesExample 2: Parsing a Date Format
❌ BAD APPROACH:
- Write a regex: /^(\d{4})-(\d{2})-(\d{2})$/
- Handle edge cases manually (leap years, timezones)
- Result: 30 lines, untested, buggy
✅ GOOD APPROACH:
1. workspace symbol search for "date-fns", "moment", "luxon" in imports
2. Context7 query for date-fns parseISO documentation
3. Use date-fns.parseISO() — battle-tested, 1 lineExample 3: Validating an Email Address
❌ BAD APPROACH:
- Write a regex from memory
- Guess at what constitutes a valid email
- Result: fragile, probably wrong
✅ GOOD APPROACH:
1. workspace symbol search for "email" and "validate" or "zod"
2. Find existing zod schema: z.string().email()
3. Reuse the existing validation patternTool Reference
| Tool | Level | Purpose |
| LSP workspace symbols / document symbols | 1 | Find symbols by name or pattern |
| LSP references and call hierarchy | 1 | A symbol's callers, callees, imports |
LSP definition plus Read | 1 | Full context and source for a symbol |
grep_app_searchGitHub | 1, 4 | Code search across GitHub |
context7_resolve-library-id | 2 | Find library in Context7 |
context7_query-docs | 2 | Query structured documentation |
exa_search | 3 | Neural web search |
webfetch | 3 | Fetch specific pages |
websearch_web_search_exa | 3 | General web search |
Cross-References
search-first— Use when evaluating whether to adopt, extend, or build.research-firstis about the search process;search-firstis about the decision after research.documentation-writer— After researching, use this to document findings and patterns for the team.api-design— When research reveals the need for new interfaces, use this skill to design them consistently.
Integration Points
During implementation (fd-execute)
Before implementing any feature, run through Levels 1-2. Only escalate to 3-4 if the codebase and Context7 are insufficient.
During external research
External discovery is Levels 2-4. Handle Level 1 directly before delegating deeper research to a subagent.
During planning (fd-task)
Assume research is complete. If a plan includes "write utility X", verify with LSP workspace symbol search (by name) or Grep, and LSP references and call hierarchy (by relationship), that X does not already exist.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

