agentleFS
jiten-singh-shahijiten-singh-shahi/salesforce-claude-code/.cursor/skills/search-first/SKILL.md

search-first

Skill15 starsChanged 7 months agoMITView on GitHub

Use when researching existing Salesforce tools, Apex libraries, or metadata patterns before writing custom code. Search-first workflow with agent. Do NOT use for implementing code — only for discovery and evaluation.

42 other projects use a version of this, 23 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use agent-harness-construction, safety-guard and 9 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

    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

  • junimnjwSkill

    ai-first-engineering

    Engineering operating model for teams where AI agents generate a large share of implementation output.

    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

  • +1 more from junimnjw

The file

We split this skill into the rules it gives an agent

8 rules. 2 are common, 6 are distinctive, and 0 are very specific to this project.

  • 2

    Common

    Most of the 36 edited versions we read keep these.

  • 6

    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
  1. Distinctive:

    Before writing any custom utility, library, or integration code

    line 13
  2. Distinctive:

    When evaluating whether to use npm, AppExchange, or MCP packages for a requirement

    line 14
  3. Distinctive:

    When starting a new feature that likely has existing open-source or platform solutions

    line 15
  4. Distinctive:

    When deciding between adopting, extending, composing, or building custom code

    line 16
  5. Distinctive:

    When the user asks to "add X functionality" and you're about to write net-new code

    line 17
  6. Common:

    Before writing a utility or adding functionality, mentally run through:

    line 62
  7. Distinctive:

    Before building custom tooling, check if an MCP server handles it:

    line 99
  8. Common:

    Ignoring MCP: Not checking if an MCP server already provides the capability

    line 137

“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

/search-first — Research Before You Code

Systematizes the "search for existing solutions before implementing" workflow.

When to Use

  • Before writing any custom utility, library, or integration code
  • When evaluating whether to use npm, AppExchange, or MCP packages for a requirement
  • When starting a new feature that likely has existing open-source or platform solutions
  • When deciding between adopting, extending, composing, or building custom code
  • When the user asks to "add X functionality" and you're about to write net-new code

Workflow

+---------------------------------------------+
|  1. NEED ANALYSIS                           |
|     Define what functionality is needed      |
|     Identify language/framework constraints  |
+---------------------------------------------+
|  2. PARALLEL SEARCH (general-purpose agent)  |
|     +----------+ +----------+ +----------+  |
|     |  npm /   | |  MCP /   | |  GitHub / |  |
|     |  AppExch | |  Skills  | |  Web      |  |
|     +----------+ +----------+ +----------+  |
+---------------------------------------------+
|  3. EVALUATE                                |
|     Score candidates (functionality, maint, |
|     community, docs, license, deps)         |
+---------------------------------------------+
|  4. DECIDE                                  |
|     +---------+  +----------+  +---------+  |
|     |  Adopt  |  |  Extend  |  |  Build   |  |
|     | as-is   |  |  /Wrap   |  |  Custom  |  |
|     +---------+  +----------+  +---------+  |
+---------------------------------------------+
|  5. IMPLEMENT                               |
|     Install package / Configure MCP /       |
|     Write minimal custom code               |
+---------------------------------------------+

Decision Matrix

SignalAction
Exact match, well-maintained, MIT/ApacheAdopt — install and use directly
Partial match, good foundationExtend — install + write thin wrapper
Multiple weak matchesCompose — combine 2-3 small packages
Nothing suitable foundBuild — write custom, but informed by research

How to Use

Quick Mode (inline)

Before writing a utility or adding functionality, mentally run through:

  1. Does this already exist in the repo? -> rg through relevant modules/tests first
  2. Is this a common problem? -> Search npm/AppExchange
  3. Is there an MCP for this? -> Check ~/.claude/settings.json and search
  4. Is there a skill for this? -> Check ~/.claude/skills/
  5. Is there a GitHub implementation/template? -> Run GitHub code search

Full Mode (agent)

For non-trivial functionality, launch a general-purpose agent:

Task(subagent_type="general-purpose", prompt="
  Research existing tools for: [DESCRIPTION]
  Language/framework: [LANG]
  Constraints: [ANY]

  Search: npm/AppExchange, MCP servers, Claude Code skills, GitHub
  Return: Structured comparison with recommendation
")

Salesforce-Specific Tool Discovery

CategoryTools to CheckNotes
TestingApexMocks, FFLib, at4dx, Apex Replay DebuggerFFLib is the industry standard
CI/CDCumulusCI, sfdx-git-delta, sf scanner, GitHub Actionssfdx-git-delta for delta deployments
DataSFDX Data Loader, DLRS (Declarative Lookup Rollup Summary), DataWeaveDLRS replaces rollup trigger code
SecurityShield Platform Encryption, Event Monitoring, SF Code AnalyzerScanner catches PMD violations
DocumentationApexDox, SfApexDocAuto-generate Apex docs
MCP@salesforce/mcp (official), community MCP serversCheck official first
Package MgmtCumulusCI, SFDX Package commandsFor managed/unlocked packages

MCP Server Evaluation

Before building custom tooling, check if an MCP server handles it:

  1. @salesforce/mcp (official) — orgs, metadata, data, testing, code-analysis, LWC, DevOps
  2. Community MCP servers — search npm for mcp + your domain
  3. Build custom only if — no existing server covers your specific business logic

Salesforce Decision Examples

Scenario 1: "We need rollup summary fields on lookup relationships"

Search: AppExchange "rollup summary lookup"
Found: DLRS (Declarative Lookup Rollup Summaries) — 4.8★, 5000+ installs
Decision: ADOPT — install DLRS, configure declaratively
Result: Zero custom Apex code for rollup calculations

Scenario 2: "We need delta deployments in CI"

Search: npm "salesforce delta deployment"
Found: sfdx-git-delta — actively maintained, 1000+ stars
Decision: ADOPT — add as sf plugin, configure in GitHub Actions
Result: Deploy only changed metadata, 10x faster CI

Scenario 3: "We need custom approval routing based on territory"

Search: AppExchange "dynamic approval routing territory"
Found: Several packages but none match exact business rules
Decision: BUILD — custom Apex approval process with territory-based routing
Result: Custom code, but informed by research (knew no package fit)

Anti-Patterns

  • Jumping to code: Writing a utility without checking if one exists
  • Ignoring MCP: Not checking if an MCP server already provides the capability
  • Over-customizing: Wrapping a library so heavily it loses its benefits
  • Not checking AppExchange: Many common patterns have managed packages with support
  • Reinventing DLRS: Writing rollup trigger code when DLRS handles it declaratively

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.