agentleFS
fjrevoredofjrevoredo/mini-diarium/.agents/skills/sync-lockfiles/SKILL.md

sync-lockfiles

Skill318 starsChanged 14 days agoMITView on GitHub

Regenerate both npm lockfiles after any manual change to package.json. Use this skill when the user has added, removed, or bumped a dependency in package.json and needs bun.lock and package-lock.json kept in sync. Triggers: "sync lockfiles", "update lockfiles", "I edited package.json", "regenerate lockfiles". Distinct from apply-dependency-prs, which handles the PR-discovery workflow — this skill handles lockfile sync only.

  • Installs packages

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When package.json changes, two lockfiles and the Nix dependency hash must all be updated and committed together:

    line 11
  2. Very specific:

    Linux with Nix: run nix run nixpkgs#prefetch-npm-deps -- package-lock.json and paste the printed hash.

    line 33
  3. Very specific:

    Commit package.json, bun.lock, package-lock.json, and nix/package.nix together (on Windows, nix/package.nix follows in the step 3 follow-up …

    line 39
  4. Very specific:

    Never commit only one lockfile.

    line 49

≈ “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

When package.json changes, two lockfiles and the Nix dependency hash must all be updated and committed together:

FileUsed by
bun.lockDev workflow
package-lock.jsonFlathub flatpak-node-generator (offline Linux build)
nix/package.nix (npmDepsHash)Nix build (nix build .#default, .github/workflows/nix.yml)

Steps

  1. Regenerate bun.lock:
    cmd.exe /c bun install
  2. Regenerate package-lock.json:
    cmd.exe /c npm install --package-lock-only --legacy-peer-deps
  3. Refresh npmDepsHash in nix/package.nix (in the frontend = buildNpmPackage { ... } block):
    • Linux with Nix: run nix run nixpkgs#prefetch-npm-deps -- package-lock.json and paste the printed hash.
    • Windows: Nix is not available. Push the lockfile change. The Nix CI workflow then fails and prints the new hash in an error annotation and in the job summary. Copy that hash into nix/package.nix and push it as a follow-up commit.
  4. Commit package.json, bun.lock, package-lock.json, and nix/package.nix together (on Windows, nix/package.nix follows in the step 3 follow-up commit).

Why --legacy-peer-deps

eslint-plugin-solid declares a peer of eslint@^9 but the project uses eslint@10. bun resolves this silently; npm does not. The flag is required or npm install errors out.

Gotcha

Never commit only one lockfile. package-lock.json is required by Flathub's flatpak-node-generator to resolve npm dependencies during the offline Flatpak build. A stale or missing package-lock.json causes the Flathub CI build to fail.

A changed package-lock.json without a matching npmDepsHash breaks nix build .#default. The Nix CI workflow fails on it and prints the correct hash; it does not commit the fix by itself.

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.