agentleFS
plebpleb/graft/skills/update/SKILL.md

update

Skill9 starsChanged 15 days agoMITView on GitHub

Merges the latest Graft from upstream into your clone, keeping your mods, reviews the merge when the registry has mods, and pushes it to your Graft repo, or raises a PR for an interstock or pleb/graft. Asks before merging unless the arguments, or update.mode when they name no mode, say auto.

  • Deletes or force-pushes

70 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use end, pause and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • torarnvSkill

    end

    Wrap up a work session. Updates memory files, logs decisions and lessons, appends to the session log.

    Also in 3 projects that use this

  • kennethleungtySkill

    pause

    Pause — stop the music (alias for /stop)

    Also in 4 projects that use this

  • MicrosoftSkill

    create

    Also in 4 projects that use this

  • renatoworksSkill

    tutorial

    Learn Strudel step by step. Use when the user wants to learn live coding, understand the syntax, or improve their skills.

    Also in 3 projects that use this

  • MicrosoftSkill

    help

    Entry point for the MedImageInsight plugin, covering the getting-started walkthrough, how the skills work, what MI2 is, and troubleshooting.

    Also in 9 projects that use this

  • p0Skill

    tools

    Also in 3 projects that use this

  • +1 more from microsoft

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 68 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 14

    Very specific

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

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

    Read ${CLAUDE_SKILL_DIR}/../common.md and follow its sections ## Ask the user, ## Command failures, ## Settings, ## Target clone, ## Mod …

    line 11
  2. Very specific:

    Follow common.md's ## Claude Code version, then its ## Sync the clone.

    line 23
  3. Very specific:

    Follow common.md's ## Personal clone.

    line 56
  4. Very specific:

    When it is false, ask the user to enable merge commits on the repo, then check again.

    line 62
  5. Very specific:

    When the registry is MODS.md, mirror upstream's site/.

    line 72
  6. Very specific:

    Only when git -C <target> cat-file -e upstream/main:site succeeds, restore it from upstream.

    line 78
  7. Very specific:

    Run this step for an interstock.

    line 109
  8. Very specific:

    When it names <origin-repo>, use its form.

    line 119
  9. Distinctive:

    Ask before a fix that would undo a registry mod's intent.

    line 125
  10. Distinctive:

    Run this step when the registry has at least one mod row.

    line 129
  11. Distinctive:

    Check the marketplace, the plugin manifest, and every agent and skill.

    line 145
  12. Very specific:

    When Node 24 or npm ci is unavailable, say so and ask whether to go on.

    line 157
  13. Very specific:

    If claude plugin validate fails, fix what the merge broke, or ask the user.

    line 159
  14. Distinctive:

    Start the body with this alert, verbatim:

    line 174
  15. Very specific:

    When the user went on past a test:site failure, require a note that npm run test:site fails and deploys fail until the scenarios pass.

    line 182
  16. Very specific:

    When Review ran, keep the PR skill's Graft line.

    line 183
  17. Very specific:

    When ## Personal clone set the gh default, say so.

    line 193
  18. Very specific:

    When the target is ~/.my-graft, ask the user to run /reload-plugins.

    line 194

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

You bring <target> up to date with Graft and keep the user's mods.

Read ${CLAUDE_SKILL_DIR}/../common.md and follow its sections ## Ask the user, ## Command failures, ## Settings, ## Target clone, ## Mod registry, ## Personal clone and ## Publish the change.

Once ## Target clone sets <target>, get settings.

node ${CLAUDE_SKILL_DIR}/../settings.ts <target>

Arguments: $ARGUMENTS

Sync

Follow common.md's ## Claude Code version, then its ## Sync the clone.

Migrate plans

Run this step when the target is ~/.my-graft, ~/.my-graft/.claude/plans/ holds files, and git -C ~/.my-graft check-ignore -q .claude/graft/.probe.md succeeds. Move each file there that git -C ~/.my-graft ls-files does not list (ignored ones included) to the same relative path under ~/.my-graft/.claude/graft/plans/, creating folders. When that path exists, add -2, -3 and so on before the extension; never overwrite. Tell the user each moved file's new path.

Check upstream

upstream is where the target gets Graft from: pleb/graft, or an interstock (an organisation's copy of Graft). Use it as it is. When the target has no upstream remote, add the URL in <target>/agent-install.md's remote add upstream command, or https://github.com/pleb/graft.git when that URL is the target's origin.

git -C <target> remote add upstream <url>

Fetch Graft and list what is new.

git -C <target> fetch upstream
git -C <target> log --oneline HEAD..upstream/main

The target is an interstock when the registry is INTERSTOCK-MODS.md.

With nothing new, say Graft is up to date and stop. If Sync pulled any commits and the target is ~/.my-graft, first ask the user to run /reload-plugins.

Otherwise, summarise the incoming changes in a few lines from the commit subjects and the files they change.

git -C <target> diff --stat HEAD...upstream/main

The mode is ask or auto from the arguments, else update.mode. With ask, ask before merging.

Follow common.md's ## Personal clone. For a shared stock, check that origin allows merge commits.

gh repo view <origin-repo> --json mergeCommitAllowed

When it is false, ask the user to enable merge commits on the repo, then check again; stop if they decline.

Merge

Merge Graft into the clone without committing.

git -C <target> merge --no-ff --no-commit upstream/main

When the registry is MODS.md, mirror upstream's site/.

git -C <target> rm -rfq --ignore-unmatch -- site

Only when git -C <target> cat-file -e upstream/main:site succeeds, restore it from upstream.

git -C <target> restore --source=upstream/main --staged --worktree -- site

In an interstock, site/ merges under the mod rule below like any other file. Merge, never rebase.

For the rest of the update, follow <target>/AGENTS.md (paths relative to the clone) if it exists, resolving it first if it is conflicted. For an interstock, resolve a conflicted <target>/interstock.md next.

For each conflicted file, list the mods that changed it.

git -C <target> log --no-merges --format=%s upstream/main..HEAD -- <file>

This prints their Change names, and the registry gives their intent. Resolve the file so upstream's change lands and each mod's intent still holds. Ask when both cannot hold, when no mod explains the clone's side, or when upstream now does what a mod did (offer to drop the mod and its row). auto never skips these questions. Record the conflicted files and each decision the user makes.

For an interstock, step 3 of the merged interstock.md also explains the clone's side. Where it alone explains a hunk, take upstream's side. Where the hunk also carries a mod's content, resolve it by the mod rule above.

To stop at any point before the commit, clear the merge and any fixes, including new files.

git -C <target> reset --hard
git -C <target> clean -fd

This is safe because Sync required a clean tree. (merge --abort can refuse once a fix is on disk.)

Interstock compliance

Run this step for an interstock. When the merged clone has no interstock.md, skip it.

Make each property in step 3 of <target>/interstock.md true, reading <dir> as <target> and <owner>/<repo> as <origin-repo>. Never create the registry, commit or push here.

For the install command's form, read the pre-merge install command under ## Install.

git -C <target> show HEAD:README.md

When it names <origin-repo>, use its form. Otherwise read the repo's visibility; anything but PUBLIC is private.

gh repo view <origin-repo> --json visibility

Ask before a fix that would undo a registry mod's intent. Record each compliance fix.

Review

Run this step when the registry has at least one mod row. Stage everything.

git -C <target> add -A

Run graft:reviewer and graft:adversarial-reviewer in parallel, both on common.reviewerModel, else Opus. The target is the staged merge against upstream, with <target> by absolute path and the conflicted files named. The intent is the registry rows, the Merge decisions, and that upstream's incoming changes land intact. For an interstock, it also includes step 3 of the merged interstock.md and the compliance fixes. Unless the target is a publishing interstock (gh variable get GRAFT_SIMULATOR -R <origin-repo> prints publish), tell the reviewers and the worker that site/, npm run test:site and type errors confined to site/ are out of scope.

git -C <target> diff --cached upstream/main

Weigh the findings and send fixes to a graft:worker, which leaves them in the uncommitted merge. Ask the user before a fix that changes a mod's behaviour or reverses a Merge decision. Record the findings acted on and their fixes.

Validate

Check the marketplace, the plugin manifest, and every agent and skill.

claude plugin validate --strict <target>

For a publishing interstock, also check the simulator.

(cd <target> && npm ci && npm run test:site)

When Node 24 or npm ci is unavailable, say so and ask whether to go on.

If claude plugin validate fails, fix what the merge broke, or ask the user. If npm run test:site fails, ask whether to fix the scenarios now or go on. If the user chooses to stop, clear the clone as Merge says.

Commit and push

Commit the merge.

git -C <target> add -A
git -C <target> commit --no-edit

Staging everything is safe because Sync required a clean tree.

Then follow common.md's ## Publish the change with the branch graft/update-<YYYY-MM-DD> (today's date) and this PR guidance:

  • Start the body with this alert, verbatim:
> [!IMPORTANT]
> Merge this PR with a merge commit. Squash or rebase merging drops upstream's history, and the next `/graft:update` re-conflicts.
  • Require as listed items the incoming changes, each conflict resolution, each compliance fix, and each review finding acted on with its fix.
  • When the user went on past a test:site failure, require a note that npm run test:site fails and deploys fail until the scenarios pass.
  • When Review ran, keep the PR skill's Graft line; otherwise the Graft line is _Graft: validated, not AI-reviewed._.

Report

  • What came in from upstream.
  • Each conflict and how it was resolved.
  • For an interstock, each compliance fix, or that compliance was skipped because the merged clone has no interstock.md.
  • Mods revised or dropped, with their registry rows.
  • Review findings acted on, with their fixes.
  • For a shared stock, the PR URL and that it needs merging with a merge commit, not squash or rebase. When no PR was raised, the branch, with the PR guidance above (the Graft line chosen and the items filled in) as the arguments to pass to /graft:pr.
  • When ## Personal clone set the gh default, say so.
  • When the target is ~/.my-graft, ask the user to run /reload-plugins.

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.