search-before-building
Skill6 starsChanged 4 months agoApache-2.0View on GitHub
Use when about to add a new helper, utility, or abstraction, a task sounds like a solved problem, a new external dependency is being considered, or custom code is proposed without checking what already exists.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- vectaosporley/failstoptheir own version, first seen Oct 15, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- vectaosporley/failstop★ 0same name
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 repository116 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/graphify/references/CLAUDE.mdCLAUDE.md
- agent-config-security-auditSkill
- agent-harness-designSkill
- agent-readable-docsSkill
- agent-runtime-patternsSkill
- agent-session-forensicsSkill
- ai-regression-testingSkill
- ai-slop-cleanerSkill
- api-doc-reviewSkill
- architecture-decision-recordsSkill
- architecture-simplificationSkill
- ask-claudeSkill
- ask-codexSkill
- ask-geminiSkill
- autonomous-delivery-pipelineSkill
- baseline-comparison-reviewSkill
- bigquery-cost-auditSkill
- brainstormingSkill
- browser-automation-safetySkill
- bug-huntSkill
- build-fix-minimal-diffSkill
- canonical-advisor-routingSkill
- change-impact-checkSkill
- changelog-generatorSkill
- ci-failure-readoutSkill
- codebase-migration-batchesSkill
- context-compressionSkill
- context-docsSkill
- context-minimizationSkill
- context-retrieval-loopSkill
- data-qualitySkill
- dataset-split-reviewSkill
- dbt-incremental-strategy-auditSkill
- dbt-preflightSkill
- dbt-strategySkill
- dead-code-removalSkill
- defuddleSkill
- dependency-cleanupSkill
- deploy-pipeline-runbookSkill
- dispatching-parallel-agentsSkill
- doc-consistency-checkSkill
- environment-doctorSkill
- experiment-tracking-reviewSkill
- failure-triageSkill
- filesystem-mcp-guardrailsSkill
- finishing-a-development-branchSkill
- flaky-test-investigationSkill
- gh-address-commentsSkill
- github-ci-failure-triageSkill
- graphifySkill
- handoff-disciplineSkill
- hard-won-skill-extractorSkill
- hook-safety-reviewSkill
- incident-readoutSkill
- incremental-migrationSkill
- json-canvasSkill
- local-rag-mcpSkill
- log-driven-diagnosisSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
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 8
Before implementing new functionality, verify it does not already exist and that the best option has been considered.
- Distinctive: line 19
Run in order. Stop when you find a satisfactory answer.
- Distinctive: line 23
Search the current codebase before anything else:
- Distinctive: line 30
Check: Does equivalent logic already exist?
- Distinctive: line 34
Search the relevant registry for the project language:
- Distinctive: line 52
Check whether an MCP server already provides this capability:
- Distinctive: line 59
Check the Agent Powerups catalog for MCP configs:
- Distinctive: line 65
If a server covers the need, prefer configuring it over writing code.
- Distinctive: line 69
Before adopting a package, verify:
- Distinctive: line 94
If time-boxed, spend at most 5 minutes on Steps 1–2 before deciding.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Search Before Building
Before implementing new functionality, verify it does not already exist and that the best option has been considered.
When to Use
- About to add a new helper, utility, or abstraction
- Task says "add X" and X sounds like a solved problem
- Considering a new external dependency
- Agent proposes writing something from scratch without checking first
Four-Step Check
Run in order. Stop when you find a satisfactory answer.
Step 1 — Repo-first
Search the current codebase before anything else:
rg "<keyword>" src/ lib/ --type ts --type js -l
rg "<keyword>" --glob "*.py" -lCheck: Does equivalent logic already exist? Is it importable as-is, or would it need wrapper work?
Step 2 — Package registry
Search the relevant registry for the project language:
| Language | Registry | Search method |
| TypeScript/JS | npm | npm search <keyword> or npmjs.com |
| Python | PyPI | pip index search <keyword> or pypi.org |
| Go | pkg.go.dev | web search site:pkg.go.dev <keyword> |
| Rust | crates.io | cargo search <keyword> |
Score each candidate:
- Maintenance: last commit < 1 year, open issues ratio
- Popularity: weekly downloads or GitHub stars
- License: MIT / Apache-2.0 / BSD preferred; check for GPL/commercial constraints
- Size: avoid heavy packages for a single feature
Step 3 — MCP / tool servers
Check whether an MCP server already provides this capability:
# List currently configured MCP servers
cat .mcp.json 2>/dev/null || cat ~/.claude/settings.json | grep -A5 '"mcpServers"'Check the Agent Powerups catalog for MCP configs:
apx list --type mcp-configIf a server covers the need, prefer configuring it over writing code.
Step 4 — Maintenance and license risk
Before adopting a package, verify:
- Not abandoned (last release within 18 months)
- License compatible with this project
- No known critical CVEs (
npm audit/pip-audit/cargo audit) - Dependency count is reasonable (< 20 transitive for small utilities)
Decision
| Finding | Action |
| Exact match in repo | Reuse — import and use; refactor only if the interface is incompatible |
| Exact external match, acceptable risk | Adopt — install and use directly; do not wrap unless the API is hostile |
| Partial match | Wrap — install, write a thin adapter; keep the adapter < 50 lines |
| Multiple weak matches | Compose — combine 2–3 small packages; document why |
| No suitable option | Build — write custom code; document the gap search found |
Constraint: Do Not Skip
This check is mandatory before:
- Writing any utility over 20 lines that solves a generic problem
- Adding a new external dependency
- Configuring a new MCP server
If time-boxed, spend at most 5 minutes on Steps 1–2 before deciding.
Anti-Patterns
- Repo-skip: Writing code without checking if an internal equivalent exists
- Registry-skip: Adding a package without checking simpler alternatives
- Over-wrapping: Encapsulating a library so heavily that the benefits are lost
- Dependency bloat: Pulling in a 5 MB package for a single 10-line feature
Verification
- The Step 1 repo search ran before any custom code was written
- Registry candidates were scored on maintenance, popularity, license, and size
- MCP/tool-server coverage was checked before writing new integration code
- Any adopted package passed the abandonment, license, CVE, and dependency-count checks
- The decision (reuse / adopt / wrap / compose / build) is recorded — and for build, the gap the search found is documented
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.

