Vendored from everything-claude-code under MIT. Paths adapted for Cursor; inference-framework triggers added.
Search First — Research Before You Code
Systematizes "search for existing solutions before implementing."
Trigger
Use when:
- Adding a feature to a mature framework (find similar implementations first)
- Starting functionality that likely already exists in-repo or upstream
- Before creating a new utility, helper, registry entry, or abstraction
- User says "add X" and you are about to write code
Workflow
0. TOOL PREFLIGHT — which search channels are available; report gaps honestly
1. NEED ANALYSIS — what is needed; language/framework constraints
2. PARALLEL SEARCH — repo rg + framework docs + package registry + GitHub
3. EVALUATE — score candidates (fit, maintenance, license, deps)
4. DECIDE — Adopt / Extend / Compose / Build
5. IMPLEMENT — minimal custom code informed by research
Decision Matrix
| Signal |
Action |
| Exact match in repo or upstream, well-maintained |
Adopt — use directly |
| Partial match or existing hook/plugin point |
Extend — thin wrapper at seam |
| Multiple weak matches |
Compose — combine 2–3 small pieces |
| Nothing suitable |
Build — custom, but informed by research |
Step 0: Tool Availability Preflight
| Channel |
Check |
If missing |
| Repository search |
rg through modules, tests, configs |
State only visible files were inspected |
| Framework patterns |
Similar features, registries, plugins, custom op hooks |
Read adjacent files + tests |
| Package registry |
pip, npm, project lockfile |
Web/docs search only |
| GitHub CLI |
gh auth status |
Public web or local git history |
| MCP / docs tools |
Available MCP tool list |
Official docs / web search |
| Skills |
~/.cursor/skills/ |
Say no local skill catalog was checked |
Quick Mode (default for small changes)
Before writing code, run through:
- Does this already exist in the repo? →
rg modules/tests for similar names and call sites
- How did the framework add similar features? → find 1–2 reference implementations
- Is there an upstream API / plugin / registry? → extend instead of invent
- Is there a maintained library? → npm/PyPI/GitHub
- Is there a Cursor skill? →
~/.cursor/skills/
Full Mode (non-trivial features)
Launch parallel explore subagents via Cursor Task tool:
Task(subagent_type="explore", prompt="
Find how [FRAMEWORK] implements [FEATURE] or closest equivalent.
Return: file paths, extension points, test patterns, recommendation Adopt/Extend/Build.
")
Combine with parallel-exploring when the codebase is large.
Mature Framework Checklist
When touching vLLM / SGLang / TRT-LLM / serving stacks:
Anti-Patterns
- Jumping to code without searching the repo
- Reinventing framework mechanisms (custom registry when one exists)
- Silent skipping — claiming "nothing found" when search was incomplete
- Over-customizing a library until it loses its benefits
- Dependency bloat — massive package for one small helper
Integration
| Phase |
Pair with |
| Before design |
parallel-exploring, brainstorming |
| After plan |
writing-plans, tdd |
| Before PR |
simplify-code, verification-before-completion |
1---2name: search-first3description: Research-before-coding workflow. Search the repo, framework APIs, libraries, and existing patterns before writing custom code. Use when adding a feature to a mature framework (vLLM, SGLang, TRT-LLM, benchmark harness), before creating a utility/helper, or when the user asks to "add X functionality".4license: MIT5---67> **Vendored from [everything-claude-code](https://github.com/affaan-m/everything-claude-code) under MIT.** Paths adapted for Cursor; inference-framework triggers added.89# Search First — Research Before You Code1011Systematizes "search for existing solutions before implementing."1213## Trigger1415Use when:16- Adding a feature to a **mature framework** (find similar implementations first)17- Starting functionality that likely already exists in-repo or upstream18- Before creating a new utility, helper, registry entry, or abstraction19- User says "add X" and you are about to write code2021## Workflow2223```240. TOOL PREFLIGHT — which search channels are available; report gaps honestly251. NEED ANALYSIS — what is needed; language/framework constraints262. PARALLEL SEARCH — repo rg + framework docs + package registry + GitHub273. EVALUATE — score candidates (fit, maintenance, license, deps)284. DECIDE — Adopt / Extend / Compose / Build295. IMPLEMENT — minimal custom code informed by research30```3132## Decision Matrix3334| Signal | Action |35|--------|--------|36| Exact match in repo or upstream, well-maintained | **Adopt** — use directly |37| Partial match or existing hook/plugin point | **Extend** — thin wrapper at seam |38| Multiple weak matches | **Compose** — combine 2–3 small pieces |39| Nothing suitable | **Build** — custom, but informed by research |4041## Step 0: Tool Availability Preflight4243| Channel | Check | If missing |44|---------|-------|------------|45| Repository search | `rg` through modules, tests, configs | State only visible files were inspected |46| Framework patterns | Similar features, registries, plugins, custom op hooks | Read adjacent files + tests |47| Package registry | `pip`, `npm`, project lockfile | Web/docs search only |48| GitHub CLI | `gh auth status` | Public web or local git history |49| MCP / docs tools | Available MCP tool list | Official docs / web search |50| Skills | `~/.cursor/skills/` | Say no local skill catalog was checked |5152## Quick Mode (default for small changes)5354Before writing code, run through:55560. **Does this already exist in the repo?** → `rg` modules/tests for similar names and call sites571. **How did the framework add similar features?** → find 1–2 reference implementations582. **Is there an upstream API / plugin / registry?** → extend instead of invent593. **Is there a maintained library?** → npm/PyPI/GitHub604. **Is there a Cursor skill?** → `~/.cursor/skills/`6162## Full Mode (non-trivial features)6364Launch parallel explore subagents via Cursor `Task` tool:6566```67Task(subagent_type="explore", prompt="68 Find how [FRAMEWORK] implements [FEATURE] or closest equivalent.69 Return: file paths, extension points, test patterns, recommendation Adopt/Extend/Build.70")71```7273Combine with `parallel-exploring` when the codebase is large.7475## Mature Framework Checklist7677When touching vLLM / SGLang / TRT-LLM / serving stacks:7879- [ ] Found at least one **in-repo reference implementation** of similar scope80- [ ] Identified the **public seam** (registry, plugin, model class, runner hook)81- [ ] Checked tests for how the feature is exercised82- [ ] Confirmed change follows **existing file layout and naming**83- [ ] Documented why **Extend** beats **Build** (or why Build is unavoidable)8485## Anti-Patterns8687- **Jumping to code** without searching the repo88- **Reinventing framework mechanisms** (custom registry when one exists)89- **Silent skipping** — claiming "nothing found" when search was incomplete90- **Over-customizing** a library until it loses its benefits91- **Dependency bloat** — massive package for one small helper9293## Integration9495| Phase | Pair with |96|-------|-----------|97| Before design | `parallel-exploring`, `brainstorming` |98| After plan | `writing-plans`, `tdd` |99| Before PR | `simplify-code`, `verification-before-completion` |