/magpie-setup:override-upstream [skill-name]from magpie-setup
Promotes a local `.apache-magpie-overrides/<skill>.md` into a PR against `apache/magpie`, then removes the override once upstreamed.
Ships in magpie-setup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Golden rule — a step the sandbox blocks becomes a vetted operation, never a bypass. This holds for the whole run. When anything you need to do fails on a sandbox restriction (a blocked host or transport, a read-only path, a denied credential or socket):
vetted-op-read, vetted-op,
vetted-op-tracker, vetted-op-git), launched with the literal ~ path.
Publishing a change is covered end to end by vetted-op-git:
git-worktree-add, git-fetch, git-stage, git-commit,
git-push-branch, git-pr-create. Run the checks in the sandbox first
with vetted-op-checks (git-commit refuses what they did not pass),
and never hand those steps to the user as commands to paste./magpie-setup:upstream-fix for it: a
closed-shape vetted operation (fixed argv, validated parameters, destination
from the approved policy, no repository code or configuration steering it,
behind a confirmation) or a documented in-sandbox route. Opening that PR
needs the user's go-ahead, like any other publication.This skill turns a local override into a framework feature.
It takes one .apache-magpie-overrides/<skill>.md file in an adopter repo, helps the user decide whether the change is worth upstreaming, designs the framework-level abstraction, implements it in apache/magpie, and opens a PR.
Overrides (per docs/setup/agentic-overrides.md) are deliberately agentic and adopter-local: no schema, no anchors, no patch tool.
That makes them quick to write but hard to share, since every adopter who wants the same behaviour writes their own.
Upstreaming is the escape hatch: when an override starts looking like a missing feature, a PR bakes it into the framework default, and every adopter gets it on their next setup update.
Before running its default behaviour, this skill consults
setup-override-upstream.md in the personal layer
(.apache-magpie-local/ when the project adopted Magpie, falling back to the main checkout's in a linked worktree,
or <git-common-dir>/apache-magpie/ when Magpie is only installed; applied first, wins on conflict) and
.apache-magpie-overrides/setup-override-upstream.md (committed, project-wide)
in the adopter repo, if present, and applies any agent-readable overrides it finds.
See docs/setup/agentic-overrides.md for the contract.
Hard rule: agents NEVER modify the snapshot under <adopter-repo>/.apache-magpie/.
Local modifications go in the override file; framework changes go via PR to apache/magpie.
Golden rule 1 — not every override should be upstreamed. Many overrides encode project-specific choices: canned-response wording, the scope-label taxonomy, a milestone-format regex, a tone-of-voice preference. These stay in the adopter repo. The skill walks through this decision explicitly and stops early if the change does not generalise.
Golden rule 2 — write to <framework-clone>, never to
the snapshot.
The framework PR is implemented in the user's local apache-magpie clone, a separate working directory from the adopter's gitignored, read-only .apache-magpie/ snapshot.
If the user has no clone yet, the skill helps set one up.
Golden rule 3 — assistant proposes, user fires.
Per the framework convention (see AGENTS.md), every state-changing action (clone, branch, commit, push, opening the PR) is proposed and runs only on explicit user confirmation.
Public PR content is shown to the user before it is posted.
Golden rule 4 — decouple PR from override deletion.
Opening the framework PR is one step.
Deleting the now-redundant override file is a separate step, AFTER the PR has merged AND the adopter has run setup update to pick up the change.
The skill ends with a pointer at that cleanup; it does not delete the override preemptively.
<adopter-repo>/.apache-magpie.lock and <adopter-repo>/.apache-magpie-overrides/).
If not, stop — the skill is for adopters with at least one override file.setup update first.<framework-clone>, the user's local clone of apache/magpie.
Common locations: ~/code/magpie/, ~/work/magpie/.
If not found, ask the user where it is, or help them clone it (git clone [email protected]:apache/magpie.git).
The clone is separate from <adopter-repo>/.apache-magpie/ (the snapshot).<framework-clone>? An adopter repo's sandbox usually cannot, so it cannot do Steps 5–6 there.
Then run Steps 1–4 here and hand Steps 5–6 over as handoff.md describes:
the target repository is apache/magpie, the base main, and the brief carries the Step 4 design and the override text it generalises, scrubbed of anything project-specific the PR would not carry.
The receiver, in the framework clone, does only Steps 5–6 and skips these adopter-only checks, as that file says.
The PR URL it reports back goes into the skill-end output.List <adopter-repo>/.apache-magpie-overrides/*.md (excluding the directory's own README.md).
For each, print the file name + first headline.
Also list .apache-magpie-overrides/tools/local-tracker/parsers/*.py: a body-field parser setup config generated is upstreamed as a format adapter, by cases/parser-adapters.md.
Read the chosen override file. Surface to the user:
### Override N — ...)Then read the framework skill it modifies, from the snapshot at <adopter-repo>/.apache-magpie/skills/<framework-skill>/.
Surface:
Goal: the user and the agent both know what the change is and where it applies.
A delegate: block is never upstreamed.
If the file's frontmatter carries one, it names a skill that exists only in the adopter's repository, so it is excluded: it is not part of the design, the diff, or the PR body, and the PR does not name the project's skill.
Say so, and carry on with the ### Override sections alone.
A file that holds nothing but a delegate block has nothing generic to upstream: stop at Step 3.
Delegation itself is already the framework's extension point (agentic-overrides.md); if the project's skill does something every adopter would want, design that as a change to the Magpie skill's own steps, described by what it does.
Walk through with the user. Common categories:
If the user is unsure, lean toward stop — keep the override local until a second adopter wants the same thing.
Once the user confirms the change is upstreamable, design the framework-side change. Pick one of:
| Shape | When |
|---|---|
Add a config knob in <project-config>/ | The change is opt-in per-adopter; default behaviour is unchanged. |
| Change a default | The new behaviour is better for the majority; the framework's existing default becomes a <project-config>/ opt-out. |
| Add an optional step | The change is an additional step (not a substitute for an existing one). |
| Refactor existing step | The change rewrites how an existing step works. No new config; the new behaviour is universal. |
Surface the proposal to the user and iterate. The output is a concrete plan: which framework files to modify, what to add / remove / change, and which existing framework tests or verification may need updating.
In <framework-clone>.
The git steps are the vetted operations in vetted-git-publish.md, run with --caller setup-override-upstream and <framework-clone> as the working directory, so they act on apache/magpie's own policy; each is confirmed by the user.
When no [git] values are configured there, hand the user the equivalent commands, as that file says.
git-fetch <framework-clone> main, then git-worktree-add <framework-clone> <path> feat/<short-description> <sha of upstream/main>.AGENTS.md, the modified skill's supporting files) to match conventions.prek run --all-files.
Fix anything that fires; the vetted commit and push run no hooks, so this run is the check.git diff).
Get explicit confirmation before committing.git-stage and commit with git-commit, with a message matching the framework's conventions (Conventional-Commits prefix: feat(skills): ... for new framework behaviour, refactor(skills): ... for restructure, etc.).
End the message file with a Generated-by: <agent> (<model>) trailer as its own last paragraph (git-commit takes no --trailer), where <agent> and <model> are the actual agent and model you are running as (e.g. Claude (Opus 4.8), OpenCode (Big Pickle)).
It is the framework repository's own convention (commit-attribution.md), whatever the adopter uses; do not hardcode either value, per the framework's no-coauthored-by hook.Push to the fork: git-push-branch <worktree> feat/<short-description> fork feat/<short-description> new, after the pre-push checks pass in the sandbox.
Draft the PR title + body. Include:
Adversarial review by other models. Run it now, per pre-pr-adversarial-review.md.
Confirm with the user before posting. Show the exact title + body. Wait for "OK to post" / "yes" / "send" / similar before opening the PR.
Pick the labels. Every framework PR carries at least one family:* and one capability:* label per docs/labels-and-capabilities.md.
The override is upstreaming a change to skill <skill>, so:
family:* — follow the skill's family (family:pr-management for pr-management-*, family:security for security-*, family:setup for setup-*, family:issue for issue-*, etc.).capability:* — the capability the change is implementing, not the file paths touched.
Look it up in the skill-to-capability map at docs/labels-and-capabilities.md#capability-to-skill-map.kind:* and mode:* when they apply per the same doc.Show the chosen labels in the confirmation preview alongside the PR title and body, so the user sees them before posting.
Write the PR body to <workspace>/override-pr-body.md, then open the PR and add the labels:
uvx --from ~/.claude/magpie/vetted-ops vetted-op-git --caller setup-override-upstream git-pr-create \
<worktree> feat/<short-description> "<title>" <workspace>/override-pr-body.md
then gh pr edit <N> --repo apache/magpie --add-label "family:<family>" --add-label "capability:<capability>".
On the fallback, gh pr create --web --repo apache/magpie --base main --head <user>:feat/<short-description> --title … --body-file … --label … --label … does both in one step.
After the PR is open, surface to the user:
Framework PR opened: <PR URL>
Next steps once it merges:
1. setup update (in <adopter-repo>)
- Bumps the snapshot to the new framework version.
- .apache-magpie.lock will reflect the new pin.
2. Delete .apache-magpie-overrides/<skill>.md in <adopter-repo>
- The override is now redundant; the framework does
what the override used to do.
3. Commit the deletion + the bumped lock together.
The skill does not delete the override file itself. Deletion happens after the PR merges, which the skill cannot predict (or whether reviewers accept it at all); it is the user's manual cleanup once the PR lands.
✓ Override picked: .apache-magpie-overrides/<skill>.md
✓ Framework skill: <framework-skill>
✓ Decision: upstreamable as <shape from Step 4>
✓ Framework clone: <framework-clone>
✓ Branch: feat/<short-description>
✓ Commits: <count>
✓ PR opened: <PR URL>
Next: wait for the PR to merge, then in <adopter-repo>:
setup update
rm .apache-magpie-overrides/<skill>.md
git add -A && git commit -m "Remove override <skill>: upstreamed in apache/magpie#<N>"
| Symptom | Likely cause | Remediation |
|---|---|---|
<adopter-repo> has no .apache-magpie-overrides/ | not adopted, or adopted without the overrides scaffold | run setup install (idempotent) |
| Step 1 finds zero overrides | nothing to upstream — adopter has no local modifications recorded | stop |
<framework-clone> not found | user has not cloned apache/magpie yet | help them clone, then resume |
Writing <framework-clone> fails with "Operation not permitted" | the adopter's sandbox cannot write another checkout | hand Steps 5–6 over per handoff.md; never widen or leave the sandbox |
| Framework pre-commit fails after the implementation | the change does not match framework conventions | iterate with the user, re-run pre-commit, do not bypass with --no-verify |
| User decides mid-flow that the override is project-specific after all | wrong call in Step 3 | stop without opening a PR; the override file in the adopter repo is unchanged, no harm done |
docs/setup/agentic-overrides.md.setup override <skill>.setup update.
Run that BEFORE this skill if drift exists.docs/setup/agentic-overrides.md — the override contract.setup/overrides.md — how to create / open an override.setup/update.md — how to upgrade the snapshot post-merge.What SKILL.md sets; muted values are Claude Code's defaults
When the user wants a local override contributed back to the framework — typically after living with it for a while and deciding it belongs upstream.
Three short reads, in order
npx claudepluginhub apache/magpie --plugin magpie-setup12 skills in this plugin
/isolated-setup-doctorProbe the secure-agent setup for restrictions that block legitimate work — SSH agent reachability, port binding, containers, the scratch directory, the signing key, `gh` outside the sandbox, `prek` and `uv` inside it, the global git hook dir. Names the troubleshooting entry and settings fix for each. Read-only./isolated-setup-installWalk an adopter through the first-time install of the secure agent setup (sandbox, approval and clean-environment layers) for Claude Code, Codex, Antigravity, Pi or Goose. Interactive throughout; never runs sudo, edits a shell rc, or overwrites settings on its own./isolated-setup-updateReport drift between the installed secure setup and the framework's current one — checkout, pinned tools, user-scope script copies, denial commands, MCP checkouts. Read-only: it surfaces diffs and the user decides./isolated-setup-verifyCheck the secure agent setup against its checklist and report done, missing or partial for each item, with the evidence — paths, command output, versions. Covers Claude Code, Codex, Antigravity, Pi, Goose and Copilot CLI. Read-only./privacy-llmDecide which LLMs this project's skills may send private foundation content to, then prove it. Detects the stack in use, writes <project-config>/privacy-llm.md, and runs the approved-model gate and the PII redactor end to end so the result is demonstrated rather than declared./setupInstall Magpie, configure it for yourself, or adopt it for a repo. Installing touches only this machine; configuring writes gitignored local files; adopting commits a floor and the project's configuration for every contributor. Marketplace by default, pinned snapshot as fallback.Other plugins' skills for the same job