From patchy-bot
This skill should be used when the user asks to "check if this exists", "reuse check", "don't reinvent the wheel", "find existing solution", "is there already a", or before implementing any new function, utility, class, component, or wrapper. Systematically scans the codebase and installed packages for existing solutions that could be reused, extended, or wrapped instead of built from scratch.
npx claudepluginhub kman182401/patchy-operationalThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Avoid duplicate code and wasted effort by finding existing solutions before building new ones. This is a prefix skill -- run it before writing any new function, utility, class, or component. The goal is to surface what already exists so the implementation decision is informed, not blind.
$ARGUMENTS
Before searching, clearly state the specification of the planned implementation:
This specification becomes the search target. Without it, the search will be unfocused and miss relevant matches.
Run these searches in parallel where possible:
Grep for function names, class names, and variable names related to the planned functionality. Think about what a previous developer might have named it:
format_date, parse_date, convert_date, date_to_stringfmt_date, dt_format, date_fmtget_, create_, build_, make_, parse_, format_, validate_, ensure_Search for the core noun (e.g., date, user, config, request) across the codebase to find all related code.
Glob for files in directories where shared utilities typically live:
**/utils/**, **/helpers/**, **/lib/**, **/common/**, **/shared/****/core/**, **/base/**, **/internal/**, **/pkg/****/middleware/**, **/decorators/**, **/mixins/**Read the files found in these directories. Utilities are often undiscoverable by name alone because they use generic names like helpers.py or utils.ts.
Check imports in files related to the current task. Follow the import chain:
import or from statements referencing utility modulesThis often reveals utility modules that are well-used but not obviously named.
Read the project's dependency files to check for installed libraries that might already handle the need:
pyproject.toml, setup.py, setup.cfg, requirements*.txt, Pipfilepackage.jsonCargo.tomlgo.modGemfileFor each dependency found, consider whether it provides the needed functionality as a built-in feature. Many libraries include utility functions beyond their primary purpose.
Before reaching for third-party code, check if the language's standard library handles this:
pathlib, itertools, functools, collections, dataclasses, datetime, json, re, shutil, textwrap, urllib.parseArray methods, Object methods, URL, crypto, path, fsFor dependencies already in the project, check their docs or source for the needed capability:
pip show <package> or check the package's module contentsDo not add a new dependency if an existing one already handles it.
Classify each finding into one of three categories:
An existing function, class, or library method does exactly what is needed. Action: use it directly. Provide the import path and usage example.
Something exists that handles part of the need, or handles a similar but different case. Action: evaluate whether to extend the existing code or wrap it. Extending is preferred when:
Building new is preferred when:
Nothing relevant was found. Action: proceed with the new implementation, but document in the output what was searched so the decision is traceable.
Produce a brief report with this structure:
## Reuse Check: [what was being built]
**Searched for:** [one-line description of the capability]
**Codebase findings:**
- [file path] -- [what it does, relevance level]
- [file path] -- [what it does, relevance level]
- (or "No relevant code found in codebase")
**Package findings:**
- [package name] -- [relevant capability]
- (or "No relevant installed packages found")
**Standard library:**
- [module.function] -- [relevant capability]
- (or "No standard library match")
**Recommendation:** Reuse [path/package] | Extend [path] | Build new
**Reason:** [one sentence]
If the recommendation is "reuse" or "extend," include the import statement and a brief usage example so the implementing agent can proceed immediately.
datetime.strftime, dateutil, or an existing format_date() utility already existsrequests when httpx is already installed and configuredcore/config.pytenacity is already a dependencypathlib handles it natively