agentleFS
samwelmungasamwelmunga/jenga-npm/.agents/skills/j-distribute/SKILL.md

j.distribute

Skill0 starsChanged 23 days agoApache-2.0View on GitHub

Distribute Jenga AI framework files from this private monorepo to one or more consuming projects via the local filesystem. Manages release type selection, version bumping, dry-run preview, per-target file copy, and a post-distribution git commit.

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. About 0 are common, 7 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow these steps in order.

    line 31
  2. Very specific:

    If the user passed a path argument (e.g.

    line 35
  3. Distinctive:

    Verify the path exists on disk.

    line 37
  4. Very specific:

    Read distribute.config.json at the repo root.

    line 38
  5. Very specific:

    Add a new entry to the targets array:

    line 40
  6. Very specific:

    Write the updated distribute.config.json.

    line 44
  7. Distinctive:

    If no path argument was passed, skip this step.

    line 47
  8. Distinctive:

    Ask the user to choose a release type.

    line 51
  9. Distinctive:

    Wait for the user's answer before continuing.

    line 60
  10. Very specific:

    If active is false: print Skipping <name> — inactive.

    line 67
  11. Very specific:

    If the path does not exist on disk: print Skipping <name> — path not found: <path>.

    line 68
  12. Very specific:

    If release type is amend: run bash skills/j-distribute/scripts/check-version.sh <path>.

    line 69
  13. Distinctive:

    Run this at the monorepo root.

    line 87
  14. Distinctive:

    If at least one target failed and at least one succeeded, note that the version bump commit reflects the distributed version.

    line 143
  15. Very specific:

    Do not invoke /self-sync or /mirror-public at any point in this flow.

    line 147
  16. Very specific:

    Never call /self-sync or /mirror-public from this skill.

    line 175
  17. Very specific:

    Never inline file copy logic — all filesystem work goes through distribute-changes.sh.

    line 176
  18. Very specific:

    Never commit anything other than package.json via commit-version-bump.sh.

    line 177
  19. Very specific:

    Never skip the dry-run confirmation gate — even in non-interactive contexts, print the dry-run output and require explicit y from the user.

    line 178
  20. Very specific:

    Never proceed past Step 4 if npm version fails.

    line 179

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

Distribute

skills/j-distribute/ is the canonical, hand-edited directory for this skill, per CLAUDE.md's "The Canonical Naming Contract" (the E50 reopening of 2026-09-09, which promoted skills/j-distribute/ from generated twin to sole canonical form). The j- prefix is there for collision safety — a real directory under a distinct name, so a host tool shipping its own same-named built-in command cannot shadow it (Claude Code's native skill resolution is a literal-string, directory-name-based match; see project/documentation/skill-authoring.md's "Invocation Convention").

⚠️ scripts/generate-j-alias.sh was retired by E50_S14 and no longer exists — there is nothing to run. This file was previously generated from a bare skills/distribute/SKILL.md source; E50_S15 deleted that directory. This file is now the sole canonical, hand-edited source for this skill — edit it directly.

Copies Jenga AI framework files from this monorepo to all active consuming projects registered in distribute.config.json. Manages the full version lifecycle: release type selection, package.json version bump, dry-run preview, per-target file copy, and a final git commit of the version bump.

Distinct from /self-sync (which mirrors root → in-repo .claude/.agents/) and /mirror-public (which syncs to the public GitHub repo). Do not call either of those skills from within this flow.

Instructions

Follow these steps in order. Do not skip any step.

Step 1 — Path argument check

If the user passed a path argument (e.g. /distribute /path/to/project):

  1. Verify the path exists on disk. If it does not, print an error and halt.
  2. Read distribute.config.json at the repo root.
  3. Derive name from the directory name of the path (e.g. my-project from /home/user/my-project).
  4. Add a new entry to the targets array:
    { "name": "<derived-name>", "path": "<absolute-or-relative-path>", "active": true }
  5. Write the updated distribute.config.json.
  6. Confirm the addition to the user: Added <name> (<path>) to distribute.config.json.

If no path argument was passed, skip this step.

Step 2 — Release type prompt

Ask the user to choose a release type. Present all four options:

TypeEffect
majorBreaking change. Bumps major version in package.json. Distributes to ALL active targets.
minorNew feature. Bumps minor version in package.json. Distributes to ALL active targets.
patchBug fix. Bumps patch version in package.json. Distributes to ALL active targets.
amendNo version bump. Distributes only to targets whose jenga.config.json version is behind the current package.json version, or targets that have no jenga.config.json.

Wait for the user's answer before continuing.

Step 3 — Config validation

Read distribute.config.json.

For each entry in targets:

  • If active is false: print Skipping <name> — inactive. Do not include it in the distribution run.
  • If the path does not exist on disk: print Skipping <name> — path not found: <path>. Do not include it in the distribution run.
  • If release type is amend: run bash skills/j-distribute/scripts/check-version.sh <path>.
    • Exit 0 → include the target.
    • Exit 1 → print Skipping <name> — already up to date. Do not include it in the distribution run (record it in the final report as "already up to date").
    • Exit 2 → print Skipping <name> — invalid path or config. Do not include it.
  • Otherwise (major / minor / patch): include all active, path-valid targets.

Print the final list of targets that will receive distribution. If the list is empty, print No targets eligible for distribution. and halt.

Step 4 — Version bump (non-amend only)

Skip this step entirely for amend.

For major, minor, or patch:

npm version <type> --no-git-tag-version

Run this at the monorepo root. If the command fails (non-zero exit), print the error, and halt — do not proceed to distribution with an unbumped or failed version.

On success, read the new version from package.json and print: Version bumped to <new-version>.

Step 5 — Dry-run preview

For each eligible target (from Step 3), run:

bash skills/j-distribute/scripts/distribute-changes.sh <project_path> --dry-run

Display the full output for each target. Then ask the user:

Proceed with distribution to the above targets? [y/N]

Wait for confirmation. If the user does not confirm, halt without making any changes. If a version bump was already applied in Step 4 and the user aborts here, inform them that package.json has been bumped but not committed, and they must either re-run /distribute or revert manually.

Step 6 — Execute distribution

For each eligible target in sequence:

bash skills/j-distribute/scripts/distribute-changes.sh <project_path>

Record the exit code and any output. If a target fails (non-zero exit), record the failure and continue to the next target. Do not abort the run on partial failure.

Step 7 — Report results

Print a per-target summary:

Succeeded:

  • List each target name and the version distributed (read from package.json)

Failed:

  • List each target name and the error output; note that manual retry is required

Already up to date (amend mode only):

  • List each target skipped due to version match

Skipped:

  • List inactive or missing-path targets from Step 3

Step 8 — Commit version bump (non-amend only, only if at least one target succeeded)

Skip this step for amend. Skip this step if no targets succeeded in Step 6.

Call:

bash skills/j-distribute/scripts/commit-version-bump.sh

Report the resulting commit SHA to the user.

If at least one target failed and at least one succeeded, note that the version bump commit reflects the distributed version; failed targets need manual retry and will receive the same version on retry.

Step 9 — Do not call downstream skills

Do not invoke /self-sync or /mirror-public at any point in this flow. They are separate skills with separate responsibilities and separate triggers.

Scripts

ScriptPurpose
skills/j-distribute/scripts/distribute-changes.sh <path> [--dry-run]Copy framework files to a single consuming project
skills/j-distribute/scripts/commit-version-bump.shCommit the package.json version bump
skills/j-distribute/scripts/check-version.sh <path>Amend mode: exits 0 if target needs update, 1 if up to date, 2 if invalid

Config

distribute.config.json at the repo root is the registry of consuming projects.

Schema reference: skills/j-distribute/CONFIG_SCHEMA.md

Each target entry:

{
  "name": "my-project",
  "path": "/absolute/or/relative/path/to/project",
  "active": true
}

Guard Rails

  • Never call /self-sync or /mirror-public from this skill.
  • Never inline file copy logic — all filesystem work goes through distribute-changes.sh.
  • Never commit anything other than package.json via commit-version-bump.sh.
  • Never skip the dry-run confirmation gate — even in non-interactive contexts, print the dry-run output and require explicit y from the user.
  • Never proceed past Step 4 if npm version fails.

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.