Skip to content

Commit 7fe4fa3

Browse files
Merge branch 'main' into 54079-remove-dsskey
2 parents 80bdc52 + d122d03 commit 7fe4fa3

39 files changed

Lines changed: 1034 additions & 167 deletions

File tree

.agents/skills/magpie-setup/SKILL.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ description: |
1010
`/magpie-setup upgrade` - refresh the gitignored snapshot per the committed lock (main-checkout only)
1111
`/magpie-setup worktree-init` - symlink a worktree's snapshot to the main's
1212
`/magpie-setup verify` - health check + drift detection
13+
`/magpie-setup skill-sources` - fetch/pin/symlink skills from trusted external sources listed in the adopter trust list (main-checkout only)
1314
`/magpie-setup override <skill>` - open or scaffold an agentic override in `.apache-magpie-overrides/`
1415
`/magpie-setup unadopt` - reverse the adoption (snapshot, locks, symlinks, hook, doc sections); preserves `.apache-magpie-overrides/` by default (main-checkout only)
1516
when_to_use: |
@@ -163,13 +164,32 @@ The drift check on every framework-skill invocation compares
163164
this against `<committed-lock>` and surfaces any mismatch as a
164165
proposed `/magpie-setup upgrade`.
165166

167+
### Source locks — the same split, for trusted external sources
168+
169+
Skills pulled from [trusted external
170+
sources](../../docs/skill-sources/README.md) use their **own**
171+
pair of locks with the identical committed-pin / local-fingerprint
172+
split, kept separate from the framework locks so a source re-pin
173+
never entangles a framework upgrade:
174+
175+
- **`.apache-magpie.sources.lock`** (committed) — the project's
176+
per-source pins, one block per source keyed by `id`
177+
(`method`/`url`/`ref` + `commit`|`sha512`).
178+
- **`.apache-magpie.sources.local.lock`** (gitignored) — this
179+
machine's per-source fetch fingerprint.
180+
181+
They are written and reconciled by
182+
[`skill-sources.md`](skill-sources.md) and re-fetched on
183+
`upgrade`; the format and drift semantics live there.
184+
166185
## Detail files in this directory
167186

168187
| File | Purpose |
169188
|---|---|
170189
| [`adopt.md`](adopt.md) | First-time adoption walk-through — recognise existing-snapshot vs needs-bootstrap, write the two lock files, ask the user which skill families to wire up, create the gitignored symlinks, scaffold `.apache-magpie-overrides/`, install the post-checkout hook, update project docs. The default sub-action. |
171190
| [`upgrade.md`](upgrade.md) | Refresh the gitignored snapshot per the committed lock, reconcile any agentic overrides + symlinks against the new framework structure, surface conflicts. Drives the on-drift remediation flow. |
172191
| [`verify.md`](verify.md) | Read-only health check — snapshot present + intact, both lock files in sync, symlinks point at live targets, `.gitignore` correct, `.apache-magpie-overrides/` exists, drift status (committed vs local), the `setup` skill itself is current. |
192+
| [`skill-sources.md`](skill-sources.md) | Fetch/verify skills from trusted external sources listed in `<project-config>/skill-sources.md`, pin them in the committed `.apache-magpie.sources.lock`, and symlink the provided skills in exactly like framework skills. The runnable half of [trusted external skill sources](../../docs/skill-sources/README.md); the install gate is the adopter trust list. |
173193
| [`agents.md`](agents.md) | The agent-target registry — *which* directories framework-skill symlinks land in across vendors, and the **canonical-plus-relay** model: `.agents/skills/` is the one canonical home (links into the snapshot/source); every other target (`claude-code`, `github`, holdout natives like Windsurf / Goose) gets a per-skill relay symlink into `.agents/skills/`. Defines active-target selection, SKILL.md format portability, and the Claude-Code-only layer (sandbox/hooks). The source of truth every sub-action consults for the target set. |
174194
| [`overrides.md`](overrides.md) | Agentic-override file management — open / scaffold an override for a framework skill, list existing overrides, help reconcile when the framework changes the underlying skill's structure on upgrade. |
175195
| [`unadopt.md`](unadopt.md) | Reverse the adoption — remove snapshot, locks, symlinks, post-checkout hook, `.gitignore` entries, the adoption sections in `README.md` / `AGENTS.md` / `CONTRIBUTING.md`, and the committed `setup` skill itself. Preserves `.apache-magpie-overrides/` by default; `--purge-overrides` removes it too. Surfaces the full removal plan before any write. |
@@ -217,7 +237,7 @@ accept, `upgrade`:
217237
5. Updates `<local-lock>` to the new fetch.
218238

219239
**Golden rule 4 — `.gitignore` keeps the adopter repo clean.**
220-
Three things gitignored in the adopter repo:
240+
Gitignored in the adopter repo:
221241

222242
- `<snapshot-dir>` (the entire framework snapshot — gigabytes
223243
potentially).
@@ -228,12 +248,19 @@ Three things gitignored in the adopter repo:
228248
`.claude/skills/` / `.github/skills/` / holdouts (they target
229249
the canonical entries) — both would dangle in a fresh clone.
230250
The one exception un-ignored in each dir is `magpie-setup`.
251+
- `.apache-magpie-sources/` (the gitignored fetch of every
252+
trusted external skill source) and
253+
`.apache-magpie.sources.local.lock` (per-machine source-fetch
254+
fingerprint), when the adopter trusts any source. See
255+
[`skill-sources.md`](skill-sources.md).
231256

232257
**Committed**: this skill (`setup`, as the canonical
233258
`.agents/skills/magpie-setup/` plus its relays), the
234-
`<committed-lock>`, the `.apache-magpie-overrides/`
235-
directory, the `.gitignore` entries themselves, any
236-
project-doc updates the `adopt` sub-action makes.
259+
`<committed-lock>`, the **`.apache-magpie.sources.lock`**
260+
per-source pins (the project's committed vouch for each trusted
261+
source), the `.apache-magpie-overrides/` directory, the
262+
`.gitignore` entries themselves, any project-doc updates the
263+
`adopt` sub-action makes.
237264

238265
**Golden rule 5 — `.agents/skills/` is canonical; everything
239266
else just relays into it.** Regardless of how an adopting
@@ -334,6 +361,7 @@ The skill dispatches by the first positional argument:
334361
| `/magpie-setup upgrade` | [`upgrade.md`](upgrade.md) | Refresh snapshot per `<committed-lock>` + reconcile overrides + refresh symlinks. **Main-checkout only** — worktrees pick up upgrades automatically via the symlink installed by `worktree-init`. |
335362
| `/magpie-setup worktree-init` | [`worktree-init.md`](worktree-init.md) | **Worktree-only.** Symlink the worktree's `<snapshot-dir>` to the main checkout's so this worktree shares one framework state. No fetch, no lock files written; idempotent. |
336363
| `/magpie-setup verify` | [`verify.md`](verify.md) | Read-only health check + drift status report. Works in both main and worktrees. |
364+
| `/magpie-setup skill-sources` (aka `skill-sources add <id>`) | [`skill-sources.md`](skill-sources.md) | Fetch/verify/pin/symlink skills from the trusted external sources the adopter listed in `<project-config>/skill-sources.md`. **Main-checkout only** — worktrees share the source snapshots via `worktree-init`. |
337365
| `/magpie-setup override <skill>` | [`overrides.md`](overrides.md) | Open / scaffold an override file. |
338366
| `/magpie-setup unadopt` | [`unadopt.md`](unadopt.md) | Reverse the adoption. Removes snapshot, locks, symlinks, hook, doc sections, and this skill itself. Preserves `.apache-magpie-overrides/` unless `--purge-overrides` is passed. **Main-checkout only.** |
339367

.agents/skills/magpie-setup/adopt.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,28 @@ idempotent — re-add them if they're missing.
502502
```text
503503
/.apache-magpie/
504504
/.apache-magpie.local.lock
505+
/.apache-magpie-sources/
506+
/.apache-magpie.sources.local.lock
505507
/.claude/settings.local.json
506508
/.claude/hooks/agent-guard.py
507509
/.claude/hooks/guards.d/
508510
__pycache__/
509511
*.pyc
510512
```
511513

514+
The `/.apache-magpie-sources/` and
515+
`/.apache-magpie.sources.local.lock` lines keep the gitignored
516+
fetch of every [trusted external skill
517+
source](../../docs/skill-sources/README.md) and its per-machine
518+
fetch fingerprint out of the tree — the source counterpart of
519+
`/.apache-magpie/` + `/.apache-magpie.local.lock`. The committed
520+
per-source pins (`.apache-magpie.sources.lock`) are **not** ignored;
521+
they travel with the repo like `<committed-lock>`. These two lines
522+
are harmless when the adopter trusts no source (the paths simply
523+
never appear); [`skill-sources.md`](skill-sources.md) also adds
524+
them idempotently the first time a source is pinned on an older
525+
adoption.
526+
512527
The `__pycache__/` and `*.pyc` lines (non-anchored — they match at
513528
any depth) keep the byte-compiled artefacts that framework skill
514529
scripts emit when run from the adopter checkout (e.g.
@@ -643,6 +658,25 @@ confirm, then create them. Always-on entries are surfaced
643658
read-only — the prompt is "confirm this list" not "edit this
644659
list".
645660

661+
## Step 8b — Wire up trusted external-source skills
662+
663+
If `<project-config>/skill-sources.md` (the adopter trust list)
664+
exists and lists any source, run the
665+
[`skill-sources`](skill-sources.md) sub-action now as a content
666+
pass: fetch + verify each trusted source into
667+
`.apache-magpie-sources/<id>/`, write both source locks, and
668+
create the canonical + relay `magpie-<name>` symlinks for the
669+
skills each source `provides` — the same wiring Step 8 does for
670+
framework skills, just targeting the source snapshots. Nothing is
671+
fetched if the trust list is absent or empty (the common case);
672+
this step is then a no-op.
673+
674+
Source skills are `magpie-`-prefixed and gitignored exactly like
675+
framework skills, so the `.gitignore` block from
676+
[Step 7](#step-7--gitignore-entries-fresh-only) already covers
677+
their symlinks; the `.apache-magpie-sources/` snapshot dir and
678+
`.apache-magpie.sources.local.lock` were added there too.
679+
646680
## Step 9 — Scaffold `.apache-magpie-overrides/` (FRESH only)
647681

648682
Create `<repo-root>/.apache-magpie-overrides/` (directory)

0 commit comments

Comments
 (0)