agentleFS
LedgerHQLedgerHQ/ledger-live/.agents/skills/dependency-patches/SKILL.md

dependency-patches

Skill627 starsChanged 10 days agoMITView on GitHub

Decide when a pnpm dependency patch is justified and how to maintain `patches/*.patch` and `patchedDependencies` in `pnpm-workspace.yaml`. Read before creating or changing `patches/*.patch`, `patchedDependencies` (`pnpm-workspace.yaml`), or using `pnpm patch` to modify third-party dependency source.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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:

    Check the upstream issue tracker, pull requests, and releases for the fix.

    line 12
  2. Distinctive:

    Do not put Ledger product logic in a dependency.

    line 14

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “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

Dependency patches

A pnpm patch is a content fork of a third-party dependency. Do not choose one casually: prefer an upstream release, configuration, or application-side workaround. This policy applies to new patches; existing patches require a migration/removal decision before being expanded or carried to a new version.

Before creating a patch

  1. Check the upstream issue tracker, pull requests, and releases for the fix. Use an available upstream release instead of a patch.
  2. Assess whether the dependency is outdated, still needed, and has a maintained alternative. Prefer replacing an unmaintained or unnecessary dependency over carrying a patch.
  3. Do not put Ledger product logic in a dependency. A small generic, opt-in hook may be patched only when it is suitable for upstreaming.
  4. Use a local patch only when the equivalent upstream fix is open or merged but unreleased. Otherwise, a patch is an exception: a revert, an unmaintained dependency, or an urgent production/CI fix. Record the justification and the removal plan in the tracking ticket, and still open the upstream PR when one applies.

Every patch requires

  • A tech-debt backlog ticket linking the upstream PR/reference (when applicable), naming an owner, and stating the removal condition, such as “remove after upstream version X.Y.Z”.
  • An adjacent comment in the patched file using that file's native comment syntax, with the upstream reference and removal condition. For formats without comments (for example JSON), put those details in the tracking ticket.
  • Minimal, generic changes that can be removed cleanly. Never use a patch to inject undeclared dependencies; see pnpm-resolution.

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.