package-reuse

package-reuse is a cursor rule for Cursor from bernierllc/agents-environment-config. It costs 0 tokens per session (532 once invoked), scanned A, original, MIT.

Rules for reusing existing packages from the @bernierllc package collection before creating new ones. Packages are shared code components that projects can depend on.

In plain words
What is it for?
It is for deciding whether to reuse an existing @bernierllc package when adding functionality to a project.
Why use it?
They help avoid duplicating code and creating a new package when an existing component may already meet the need.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for deciding whether to reuse an existing @bernierllc package when adding functionality to a project.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/bernierllc/agents-environment-config/package-reuse
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/bernierllc/agents-environment-config

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for package-reuse

README.md
[![agentmods](https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/package-reuse/github.svg)](https://agentmods.dev/rules/bernierllc/agents-environment-config/package-reuse)
Your own site
<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/package-reuse"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/package-reuse/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for package-reuse

Your own site · 80×15
<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/package-reuse"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/package-reuse.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 532 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00532
Opus 5.5 $0.00000 $0.00213
Sonnet 5.5 $0.00000 $0.00106
Haiku 4.5 $0.00000 $0.00053

Measured 2mo ago against content hash 15b447e05405, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

package-reuse scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/packages/package-reuse.mdc · 59 lines

How it starts

The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Package Reuse Rules

Core Principle

Reuse first, create second. Before writing new functionality or a new package, check whether it already exists: in this repository, in your organization's packages, or as a well-maintained public package.

Pre-Development Checklist

1. Check what already exists

  • This repository: list its workspace packages (packages/, apps/, or the workspace tool's list command) and search for the functionality by name and by behavior.
  • Your organization: check its internal registry or package scope, if it has one.
  • Public registries: prefer a widely used, maintained package over writing your own for well-solved problems (retries, CSV parsing, markdown, email, tokens, queues).

2. Ask what the feature actually needs

  • Retry logic, state machines, metrics, parsing, rendering, messaging, auth tokens: each is usually a solved problem. Name the existing package that solves it before writing code.

3. Evaluate candidates

For each potentially relevant package:

  • Review the README and API documentation
  • Check it supports your specific use case
  • Consider whether it can be extended rather than replaced
  • Look for integration patterns in its examples
  • Check maintenance health (recent releases, open issues, license)

Implementation Steps

  1. Before starting: list what exists (step 1 above)
  2. Research: read candidate READMEs and examples
  3. Plan integration: design how to use the existing package
  4. Implement: add it as a dependency
  5. Test: make sure the integration works
  6. Document: note which package provides the behavior and why it was chosen

Benefits

  • Faster development - Leverage existing, tested code
  • Better consistency - Use proven patterns across packages
  • Reduced maintenance - Single source of truth for common functionality
  • Improved reliability - Use battle-tested implementations

When to Create New Packages

Only create a new package when:

  • No existing package provides the needed functionality
  • The functionality is truly atomic and reusable
  • It follows MECE architecture principles
  • It provides clear value as a standalone package

Read the full file on GitHub · 59 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · -14 lines 15b447e05405
  2. 3mo ago First seen · 73 lines · 0 tokens per session scan A 9b70985b6cc7

Subscribe to this mod's changes

package-reuse is a cursor rule published in the GitHub repository bernierllc/agents-environment-config (11 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 532 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

package-reuse compared with cursor rules from other repositories

package-reuse next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
package-reusebernierllc/agents-environment-configCursor rule11yesterdayMITA0Cursor
no-mvn-compiletheonedev/onedevCursor rule15kyesterdayMITA131Cursor
devSynkraAI/aiox-coreCursor rule3.2kyesterdaynoneA10Cursor
qaSynkraAI/aiox-coreCursor rule3.2kyesterdaynoneA12Cursor
github-workflowgiantswarm/musterCursor rule42todayApache-2.0A987Cursor
aiox-masterSynkraAI/aiox-coreCursor rule3.2kyesterdaynoneA19Cursor
poSynkraAI/aiox-coreCursor rule3.2kyesterdaynoneA9Cursor