agentleFS
YehudaFrankelYehudaFrankel/clankbrain/.claude/skills/search-first/SKILL.md

search-first

Skill16 starsChanged 7 months agoMITView on GitHub

Enforces research-before-coding. Before writing any new code, search the existing codebase for reusable patterns, existing implementations, and prior art. Prevents duplicated logic. Triggers on Automatically before any new feature implementation, or \"search first\" or \"check if this exists\".

42 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use continuous-agent-loop, agent-harness-construction and 10 more.

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.
  • junimnjwSkill

    continuous-agent-loop

    Patterns for continuous autonomous agent loops with quality gates, evals, and recovery controls.

    Also in 4 projects that use this

  • junimnjwSkill

    agent-harness-construction

    Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates.

    Also in 4 projects that use this

  • loulanyueSkill

    safety-guard

    Also in 3 projects that use this

  • loulanyueSkill

    rules-distill

    Scan skills to extract cross-cutting principles and distill them into rules — append, revise, or create new rule files

    Also in 3 projects that use this

  • dcs-soniSkill

    codebase-onboarding

    Help developers understand unfamiliar codebases quickly. Use when

    Also in 3 projects that use this

  • MicrosoftSkill

    error-handling

    统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。

    Also in 3 projects that use this

  • +2 more from junimnjw

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 36 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Allowed Tools: Read, Glob, Grep, Bash

    line 12
  2. Very specific:

    Check function indexes / API reference in .claude/memory/

    line 23
  3. Distinctive:

    Check architecture docs for existing patterns

    line 24
  4. Distinctive:

    Search memory indexes first (faster) before reading source files

    line 53
  5. Distinctive:

    If a pattern appears in 3+ places, it should be extracted into a shared utility

    line 54
  6. Distinctive:

    After finding existing code: check if it needs to be updated vs reused as-is

    line 55

“Common” is measured: kept by at least 6 in 10 of the 36 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: search-first

Trigger: Automatically before any new feature implementation, or "search first" or "check if this exists"

Description: Enforces research-before-coding. Before writing any new code, search the existing codebase for reusable patterns, existing implementations, and prior art. Prevents duplicated logic.

Allowed Tools: Read, Glob, Grep, Bash


Steps

  1. Search existing code for similar functionality:
    • Grep for method names, endpoint names, or key terms
    • Does something already do what's being requested?
  2. Search memory indexes:
    • Check function indexes / API reference in .claude/memory/
    • Check architecture docs for existing patterns
  3. Search for existing patterns:
    • Is there a helper or utility that already handles this?
    • Can an existing function be extended rather than duplicating?
  4. Check for existing data fetching:
    • Is there already an API endpoint that returns this data?
    • Can the frontend reuse an existing call?
  5. Report findings:
    • ✅ "Found existing: [method/function] in [file] — reuse this, no new code needed"
    • ⚠️ "Partial match: [method] — extend this instead of creating new"
    • 🆕 "No existing pattern found — safe to create new"
  6. Only proceed to plan/code after search is complete

Why This Matters

  • Duplicate logic = two places to fix when bugs appear
  • Searching takes 2 minutes and can save hours of debugging
  • The best code is code you don't write

Notes

  • Search memory indexes first (faster) before reading source files
  • If a pattern appears in 3+ places, it should be extracted into a shared utility
  • After finding existing code: check if it needs to be updated vs reused as-is
  • This skill pairs with plan-before-coding — search → plan → confirm → code

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.