search-before-building

search-before-building is a skill for Claude Code from yeaight7/agent-powerups. It costs 45 tokens per session (927 once invoked), scanned C, original, Apache-2.0.

A checklist for checking whether a helper, utility, abstraction, or dependency already exists before building something new.

In plain words
What is it for?
Use it when adding functionality, evaluating a dependency, or deciding whether to reuse repository code, a package, or a custom implementation.
Why use it?
It prevents duplicate code and helps compare existing options for maintenance, fit, and other practical concerns.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the codebase-intelligence plugin — 4 skills, 1 command, 3 agents shipped together

Good fit Use it when adding functionality, evaluating a dependency, or deciding whether to reuse repository code, a package, or a custom implementation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yeaight7/agent-powerups/search-before-building
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add yeaight7/agent-powerups --skill search-before-building
Clone the repo
git clone --depth 1 https://github.com/yeaight7/agent-powerups

Made for: Claude Code.

Or install codebase-intelligence, the plugin that ships this one along with the rest of its 4 skills, 1 command, 3 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for search-before-building

README.md
[![agentmods](https://agentmods.dev/badge/skills/yeaight7/agent-powerups/search-before-building/github.svg)](https://agentmods.dev/skills/yeaight7/agent-powerups/search-before-building)
Your own site
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/search-before-building"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/search-before-building/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for search-before-building

Your own site · 80×15
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/search-before-building"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/search-before-building.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 927 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.00927
Opus 5 $0.00023 $0.00464
Sonnet 5 $0.00009 $0.00185
Haiku 4.5 $0.00005 $0.00093

Measured 9d ago against content hash 5a2016de6024, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

search-before-building scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat .mcp.json 2>/dev/null || cat ~/.claude/settings.json | grep -A5 '"mcpServers"'

Reads MCP configurationmediumAgent snooping

mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.

cat .mcp.json 2>/dev/null || cat ~/.claude/settings.json | grep -A5 '"mcpServers"'
plugins/codebase-intelligence/skills/search-before-building/SKILL.md · 110 lines

How it starts

The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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" -l

Check: 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-config

If 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)

Read the full file on GitHub · 110 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 110 lines · 45 tokens per session scan C 5a2016de6024

Subscribe to this mod's changes

search-before-building is a skill published in the GitHub repository yeaight7/agent-powerups (6 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 45 tokens to every session and 927 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (reads agent configuration directories, reads mcp configuration). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.