agentleFS
phatnguyen03022001phatnguyen03022001/agent-skills/reuse-first/SKILL.md

reuse-first

Skill2 starsChanged 3 months agoApache-2.0View on GitHub

Use when a task may duplicate existing repository code, a standard protocol, platform capability, maintained library, framework feature, or upstream reference implementation.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 4

    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:

    Prefer reuse before invention, but never dependency before thinking.

    line 8
  2. Distinctive:

    Before designing a new subsystem or utility, inspect:

    line 12
  3. Distinctive:

    Prefer the smallest adoption surface that solves the problem.

    line 37
  4. Distinctive:

    BUILD: no acceptable existing option satisfies the constraints.

    line 46
  5. Very specific:

    Use simplicity to reduce the shape of the chosen solution.

    line 54

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

Reuse First

Prefer reuse before invention, but never dependency before thinking.

Search from nearest to farthest

Before designing a new subsystem or utility, inspect:

  1. the target repository for an existing implementation, abstraction, helper, or pattern;
  2. the language/runtime standard library and native APIs;
  3. the framework or platform already in use;
  4. established protocols, formats, and ecosystem conventions;
  5. mature maintained libraries;
  6. upstream reference implementations or small adapters.

A new implementation needs a reason stronger than “we can write it.”

Evaluate reuse, do not worship it

For a candidate dependency or platform feature, check:

  • fitness for the actual requirement;
  • maintenance activity and ownership;
  • security and supply-chain implications;
  • license compatibility;
  • API stability and migration path;
  • lock-in and portability;
  • runtime, bundle, storage, and operational cost;
  • transitive complexity and configuration burden;
  • whether a thin adapter isolates the dependency cleanly.

Prefer the smallest adoption surface that solves the problem. Reuse an existing repository primitive when it is already the project convention. Prefer a standard protocol over a proprietary mechanism when project constraints permit.

Decision outcomes

A good review can conclude:

  • REUSE: existing capability already fits;
  • WRAP: reuse behind a small project-owned adapter;
  • EXTEND: modify an existing project abstraction;
  • BUILD: no acceptable existing option satisfies the constraints.

Record why rejected options fail the project’s constraints so a later agent does not repeat the same search. If an existing capability solves 90% of the requirement, compare the cost of a small adapter with the long-term cost of owning the missing 10% yourself.

Failure modes

Do not add a package for a trivial function. Do not create internal infrastructure because a mature platform feature feels “too easy.” Do not copy an upstream implementation and silently inherit its maintenance burden. Do not force a dependency whose abstraction is larger than the problem.

Use simplicity to reduce the shape of the chosen solution. Use research when candidate behavior, maturity, licensing, security, or current support must be verified externally.

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.