Skip to content

feat(skills): add search-first skill#262

Merged
affaan-m merged 1 commit intoaffaan-m:mainfrom
shimo4228:feat/skills/search-first
Feb 21, 2026
Merged

feat(skills): add search-first skill#262
affaan-m merged 1 commit intoaffaan-m:mainfrom
shimo4228:feat/skills/search-first

Conversation

@shimo4228
Copy link
Copy Markdown
Contributor

@shimo4228 shimo4228 commented Feb 21, 2026

Re-submission of #258 (closed due to broken fork relationship)

Summary

Adds a search-first skill that enforces a research-before-coding workflow: search for existing tools, libraries, and patterns before writing custom code.

Test plan

  • Verify YAML frontmatter is valid
  • Confirm description starts with "Use when..."

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 21, 2026

📝 Walkthrough

Walkthrough

A new Markdown documentation file is added at skills/search-first/SKILL.md that formalizes a "search-before-you-code" workflow, defining trigger conditions, a multi-step process, decision matrices, usage modes, search shortcuts, and integration points with other agents.

Changes

Cohort / File(s) Summary
Search-First Skill Documentation
skills/search-first/SKILL.md
New file documenting the search-before-you-code workflow with trigger conditions, five workflow steps (NEED ANALYSIS, PARALLEL SEARCH, EVALUATE, DECIDE, IMPLEMENT), decision matrices for adopting/extending/composing/building solutions, quick and full usage modes, categorized search shortcuts, integration points with planner and architect agents, usage examples, and anti-pattern guidance.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • affaan-m

Poem

🐰 Before you code, pause and explore,
Five steps to open up the door,
Search for answers, evaluate well,
Let the best solutions tell,
A rabbit's guide to getting more! 🔍

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(skills): add search-first skill' directly and clearly describes the main change—adding a new search-first skill to the skills directory.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/search-first/SKILL.md`:
- Around line 1-3: The frontmatter "description" value in SKILL.md must begin
with the exact phrase "Use when…"; update the existing description field (the
YAML key "description") so it starts with "Use when…" followed by the existing
content (e.g., "Use when researching before coding: Research-before-coding
workflow. Search for existing tools, libraries, and patterns before writing
custom code. Invokes the researcher agent.") ensuring you preserve the original
intent and punctuation.
- Around line 9-15: Rename the section heading "## Trigger" to "## When to Use"
and rename the existing "## Workflow" (or any "## How to Use") heading to "##
How It Works" in SKILL.md so the file contains the required top-level sections:
"When to Use", "How It Works", and "Examples"; ensure content under each heading
remains unchanged except for the heading text so the guidance maps correctly to
the new section names.
- Around line 1-158: The file name SKILL.md violates the lowercase-with-hyphens
rule; rename it to a compliant name (e.g., search-first.md or skill.md) and
update any internal references to SKILL.md (look for occurrences of "SKILL.md"
or the "/search-first" skill title in documentation/config) so links and imports
still resolve; ensure repository metadata or any index that listed SKILL.md is
updated accordingly.
- Around line 36-54: The DECIDE workflow diagram is missing the "Compose"
outcome, causing inconsistency with the Decision Matrix; update the DECIDE box
in SKILL.md so it lists all four outcomes — "Adopt", "Extend / Wrap", "Compose"
(or "Compose / Combine"), and "Build Custom" — matching the Decision Matrix
wording, and ensure spacing/connector lines in the ASCII diagram remain aligned
and the label "DECIDE" (the DECIDE box) and the Decision Matrix table use
identical terminology.

Comment on lines +1 to +3
---
description: Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. Invokes the researcher agent.
---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

description must start with "Use when…" per the PR's own test plan.

The current description (Research-before-coding workflow. Search for...) doesn't satisfy the unchecked test-plan criterion.

🛠️ Proposed fix
-description: Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. Invokes the researcher agent.
+description: Use when starting new functionality to enforce a research-before-coding workflow — searches for existing tools, libraries, and patterns before writing custom code. Invokes the researcher agent.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
description: Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. Invokes the researcher agent.
---
---
description: Use when starting new functionality to enforce a research-before-coding workflow — searches for existing tools, libraries, and patterns before writing custom code. Invokes the researcher agent.
---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/search-first/SKILL.md` around lines 1 - 3, The frontmatter
"description" value in SKILL.md must begin with the exact phrase "Use when…";
update the existing description field (the YAML key "description") so it starts
with "Use when…" followed by the existing content (e.g., "Use when researching
before coding: Research-before-coding workflow. Search for existing tools,
libraries, and patterns before writing custom code. Invokes the researcher
agent.") ensuring you preserve the original intent and punctuation.

Comment on lines +1 to +158
---
description: Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. Invokes the researcher agent.
---

# /search-first — Research Before You Code

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

## Trigger

Use this skill when:
- Starting a new feature that likely has existing solutions
- Adding a dependency or integration
- The user asks "add X functionality" and you're about to write code
- Before creating a new utility, helper, or abstraction

## Workflow

```
┌─────────────────────────────────────────────┐
│ 1. NEED ANALYSIS │
│ Define what functionality is needed │
│ Identify language/framework constraints │
├─────────────────────────────────────────────┤
│ 2. PARALLEL SEARCH (researcher agent) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ npm / │ │ MCP / │ │ GitHub / │ │
│ │ PyPI │ │ 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

| Signal | Action |
|--------|--------|
| Exact match, well-maintained, MIT/Apache | **Adopt** — install and use directly |
| Partial match, good foundation | **Extend** — install + write thin wrapper |
| Multiple weak matches | **Compose** — combine 2-3 small packages |
| Nothing suitable found | **Build** — write custom, but informed by research |

## How to Use

### Quick Mode (inline)

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

1. Is this a common problem? → Search npm/PyPI
2. Is there an MCP for this? → Check `~/.claude/settings.json` and search
3. Is there a skill for this? → Check `~/.claude/skills/`
4. Is there a GitHub template? → Search GitHub

### Full Mode (agent)

For non-trivial functionality, launch the researcher agent:

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

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

## Search Shortcuts by Category

### Development Tooling
- Linting → `eslint`, `ruff`, `textlint`, `markdownlint`
- Formatting → `prettier`, `black`, `gofmt`
- Testing → `jest`, `pytest`, `go test`
- Pre-commit → `husky`, `lint-staged`, `pre-commit`

### AI/LLM Integration
- Claude SDK → Context7 for latest docs
- Prompt management → Check MCP servers
- Document processing → `unstructured`, `pdfplumber`, `mammoth`

### Data & APIs
- HTTP clients → `httpx` (Python), `ky`/`got` (Node)
- Validation → `zod` (TS), `pydantic` (Python)
- Database → Check for MCP servers first

### Content & Publishing
- Markdown processing → `remark`, `unified`, `markdown-it`
- Image optimization → `sharp`, `imagemin`

## Integration Points

### With planner agent
The planner should invoke researcher before Phase 1 (Architecture Review):
- Researcher identifies available tools
- Planner incorporates them into the implementation plan
- Avoids "reinventing the wheel" in the plan

### With architect agent
The architect should consult researcher for:
- Technology stack decisions
- Integration pattern discovery
- Existing reference architectures

### With iterative-retrieval skill
Combine for progressive discovery:
- Cycle 1: Broad search (npm, PyPI, MCP)
- Cycle 2: Evaluate top candidates in detail
- Cycle 3: Test compatibility with project constraints

## Examples

### Example 1: "Add dead link checking"
```
Need: Check markdown files for broken links
Search: npm "markdown dead link checker"
Found: textlint-rule-no-dead-link (score: 9/10)
Action: ADOPT — npm install textlint-rule-no-dead-link
Result: Zero custom code, battle-tested solution
```

### Example 2: "Add HTTP client wrapper"
```
Need: Resilient HTTP client with retries and timeout handling
Search: npm "http client retry", PyPI "httpx retry"
Found: got (Node) with retry plugin, httpx (Python) with built-in retry
Action: ADOPT — use got/httpx directly with retry config
Result: Zero custom code, production-proven libraries
```

### Example 3: "Add config file linter"
```
Need: Validate project config files against a schema
Search: npm "config linter schema", "json schema validator cli"
Found: ajv-cli (score: 8/10)
Action: ADOPT + EXTEND — install ajv-cli, write project-specific schema
Result: 1 package + 1 schema file, no custom validation logic
```

## 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
- **Dependency bloat**: Installing a massive package for one small feature
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Rename file to comply with lowercase-with-hyphens naming convention.

The filename SKILL.md is all-uppercase. The guideline requires lowercase with hyphens (e.g., skill.md or search-first.md).

♻️ Suggested rename
-skills/search-first/SKILL.md
+skills/search-first/skill.md

As per coding guidelines: "Use lowercase with hyphens for file naming (e.g., python-reviewer.md, tdd-workflow.md)".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/search-first/SKILL.md` around lines 1 - 158, The file name SKILL.md
violates the lowercase-with-hyphens rule; rename it to a compliant name (e.g.,
search-first.md or skill.md) and update any internal references to SKILL.md
(look for occurrences of "SKILL.md" or the "/search-first" skill title in
documentation/config) so links and imports still resolve; ensure repository
metadata or any index that listed SKILL.md is updated accordingly.

Comment on lines +9 to +15
## Trigger

Use this skill when:
- Starting a new feature that likely has existing solutions
- Adding a dependency or integration
- The user asks "add X functionality" and you're about to write code
- Before creating a new utility, helper, or abstraction
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Rename "Trigger" to "When to Use" and add/rename a "How It Works" section.

The skill guidelines require clear sections named When to Use, How It Works, and Examples:

  • Line 9: ## Trigger → should be ## When to Use
  • Neither ## Workflow nor ## How to Use matches the required ## How It Works heading; the ## Workflow section is the natural fit.
♻️ Proposed rename
-## Trigger
+## When to Use
-## Workflow
+## How It Works

Based on learnings: "Skills should be formatted as Markdown with clear sections for When to Use, How It Works, and Examples."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/search-first/SKILL.md` around lines 9 - 15, Rename the section heading
"## Trigger" to "## When to Use" and rename the existing "## Workflow" (or any
"## How to Use") heading to "## How It Works" in SKILL.md so the file contains
the required top-level sections: "When to Use", "How It Works", and "Examples";
ensure content under each heading remains unchanged except for the heading text
so the guidance maps correctly to the new section names.

Comment on lines +36 to +54
│ ┌─────────┐ ┌──────────┐ ┌─────────┐ │
│ │ Adopt │ │ Extend │ │ Build │ │
│ │ as-is │ │ /Wrap │ │ Custom │ │
│ └─────────┘ └──────────┘ └─────────┘ │
├─────────────────────────────────────────────┤
│ 5. IMPLEMENT │
│ Install package / Configure MCP / │
│ Write minimal custom code │
└─────────────────────────────────────────────┘
```

## Decision Matrix

| Signal | Action |
|--------|--------|
| Exact match, well-maintained, MIT/Apache | **Adopt** — install and use directly |
| Partial match, good foundation | **Extend** — install + write thin wrapper |
| Multiple weak matches | **Compose** — combine 2-3 small packages |
| Nothing suitable found | **Build** — write custom, but informed by research |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

"Compose" decision is missing from the workflow diagram's DECIDE step.

The Decision Matrix (lines 49–54) defines four outcomes — Adopt, Extend, Compose, Build — but the DECIDE box in the workflow diagram (lines 36–39) only shows three: Adopt, Extend/Wrap, Build Custom. The "Compose" option is silently dropped, making the diagram inconsistent with the matrix.

🛠️ Proposed fix
-│  4. DECIDE                                  │
-│     ┌─────────┐  ┌──────────┐  ┌─────────┐  │
-│     │  Adopt  │  │  Extend  │  │  Build   │  │
-│     │ as-is   │  │  /Wrap   │  │  Custom  │  │
-│     └─────────┘  └──────────┘  └─────────┘  │
+│  4. DECIDE                                  │
+│  ┌────────┐ ┌────────┐ ┌─────────┐ ┌──────┐ │
+│  │ Adopt  │ │ Extend │ │ Compose │ │Build │ │
+│  │ as-is  │ │ /Wrap  │ │ 2-3 pkg │ │Custom│ │
+│  └────────┘ └────────┘ └─────────┘ └──────┘ │
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
┌─────────┐ ┌──────────┐ ┌─────────┐
│ Adopt │ │ Extend │ │ Build │
as-is │ /Wrap │ Custom │
└─────────┘ └──────────┘ └─────────┘
─────────────────────────────────────────────┤
│ 5. IMPLEMENT │
Install package / Configure MCP /
Write minimal custom code
└─────────────────────────────────────────────┘
```
## Decision Matrix
| Signal | Action |
|--------|--------|
| Exact match, well-maintained, MIT/Apache | **Adopt** — install and use directly |
| Partial match, good foundation | **Extend** — install + write thin wrapper |
| Multiple weak matches | **Compose** — combine 2-3 small packages |
| Nothing suitable found | **Build** — write custom, but informed by research |
4. DECIDE
┌────────┐ ┌────────┐ ┌─────────┐ ┌──────┐
│ Adopt│ Extend│ Compose│Build │
│ as-is │ │ /Wrap │ │ 2-3 pkg │ │Custom│
│ └────────┘ └────────┘ └─────────┘ └──────┘ │
├─────────────────────────────────────────────┤
5. IMPLEMENT
Install package / Configure MCP /
│ Write minimal custom code │
└─────────────────────────────────────────────┘
## Decision Matrix
| Signal | Action |
|--------|--------|
| Exact match, well-maintained, MIT/Apache | **Adopt** — install and use directly |
| Partial match, good foundation | **Extend** — install + write thin wrapper |
| Multiple weak matches | **Compose** — combine 2-3 small packages |
| Nothing suitable found | **Build** — write custom, but informed by research |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/search-first/SKILL.md` around lines 36 - 54, The DECIDE workflow
diagram is missing the "Compose" outcome, causing inconsistency with the
Decision Matrix; update the DECIDE box in SKILL.md so it lists all four outcomes
— "Adopt", "Extend / Wrap", "Compose" (or "Compose / Combine"), and "Build
Custom" — matching the Decision Matrix wording, and ensure spacing/connector
lines in the ASCII diagram remain aligned and the label "DECIDE" (the DECIDE
box) and the Decision Matrix table use identical terminology.

Copy link
Copy Markdown
Owner

@affaan-m affaan-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: doc-only changes look good. Approving.

@affaan-m affaan-m merged commit 7e57d1b into affaan-m:main Feb 21, 2026
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants