Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ repos:
# (plugins/magpie-security-tools/plugins/...): the copy is regenerated
# from its source, which this list already skips, so a TOC added here
# is reverted by that hook on the next run.
exclude: ^(plugins/magpie-[^/]+/plugins/.*|plugins/magpie-[^/]+/commands/.*|tools/adversarial-review/commands/.*|\.claude/skills/.*|\.agents/skills/.*|\.github/skills/.*|skills/.*|plugins/magpie-[^/]+/skills/.*|tools/cve-tool-vulnogram/generate-cve-json/SKILL\.md|tools/skill-evals/.*|tools/spec-loop/.*|\.github/PULL_REQUEST_TEMPLATE\.md|tools/dev/blocks/.*|tools/dev/preflight-block\.md|tools/setup-preflight/src/setup_preflight/sections/.*)$
exclude: ^(plugins/magpie-[^/]+/plugins/.*|plugins/magpie-[^/]+/commands/.*|tools/adversarial-review/commands/.*|\.claude/skills/.*|\.agents/skills/.*|\.github/skills/.*|skills/.*|plugins/magpie-[^/]+/skills/.*|tools/cve-tool-vulnogram/generate-cve-json/GUIDE\.md|tools/skill-evals/.*|tools/spec-loop/.*|\.github/PULL_REQUEST_TEMPLATE\.md|tools/dev/blocks/.*|tools/dev/preflight-block\.md|tools/setup-preflight/src/setup_preflight/sections/.*)$
args:
- "--maxlevel"
- "3"
Expand Down
28 changes: 17 additions & 11 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,14 @@ Repo-root files:
- [`docs/security/how-the-security-team-works.md`](docs/security/how-the-security-team-works.md) — how the security team operates, and the onboarding guide for new members.
- [`projects/_template/`](plugins/magpie-setup/templates/) — bootstrap scaffold for a new adopter's `<project-config>/`.
- [`tools/<name>/`](tools/) — tool adapters (GitHub operations, issue-template schema, project-board GraphQL, …) for the external tools the skills invoke.
- [`skills/<name>/SKILL.md`](skills/) — the agentic workflows.
- [`plugins/magpie-<family>/skills/<alias>/SKILL.md`](plugins/) — the agentic workflows, each in its family plugin; [`skills/<name>`](skills/) is the flat tree of symlinks into them.
- `.agents/skills/magpie-<name>/`, `.claude/skills/magpie-<name>/`, `.github/skills/magpie-<name>/` — committed symlinks created by this repo's self-adoption (`/magpie-setup method:local`) so the framework's own skills are callable from any harness while developing it; targets are in-repo so no snapshot or remote fetch is involved. Mechanics: [`skills/setup/install.md`](skills/setup/install.md) → "Local self-adoption".

There is no source code to build or test in this framework
repository itself. Adopting projects may include project-specific
There is no application to build here: the skills are Markdown the agent reads.
The code the repository does carry is the Python tooling under `tools/`
(the Python projects there are members of one `uv` workspace) and the `tools/dev/` checks,
which the `ruff` / `mypy` / `pytest` hooks gate (see [Local setup](#local-setup)).
Adopting projects may include project-specific
build artifacts (e.g. a `<project-config>/cve-json/` Python helper)
in their tracker repo.

Expand Down Expand Up @@ -631,9 +634,7 @@ to a home-dir path and update the tool to read from there.
plain command (`gh pr close <N>`, `gh issue close <N> --reason "not planned"`).
- **Target branch for this repository is declared in the project manifest** — see
[`<project-config>/project.md`](<project-config>/project.md#repositories)
(`tracker_default_branch`). The non-default branch (`main`) is used only as a
staging branch for the private-PR fallback described in
[`README.md`](README.md). Unless the user explicitly says otherwise, base
(`tracker_default_branch`). Unless the user explicitly says otherwise, base
PRs on the tracker's default branch.
- **Spec-sync pre-check before pushing a functionality PR.** The specs in
[`tools/spec-loop/specs/`](tools/spec-loop/specs/) are the source of truth
Expand Down Expand Up @@ -1122,8 +1123,10 @@ and

## Reusable skills

Reusable, agent-friendly task definitions live under
[`skills/`](skills/). Each skill is a plain Markdown file with YAML
Reusable, agent-friendly task definitions live in the family plugins,
`plugins/magpie-<family>/skills/<alias>/`,
and the flat [`skills/`](skills/) tree links to each of them by its full name.
Each skill is a plain Markdown file with YAML
frontmatter, so it can be picked up by Claude Code, GitHub Copilot, and
any other agent that follows the emerging skill convention. When a new
recurring task is automated, add it as a skill rather than burying the
Expand All @@ -1138,12 +1141,15 @@ for its full contract):
- [`security-issue-sync`](skills/security-issue-sync/SKILL.md) — reconciles an issue with its GitHub discussion, mail thread, and fixing PRs; proposes label / milestone / field / draft-email updates and refreshes the CVE JSON attachment at the end of every run.
- [`security-cve-allocate`](skills/security-cve-allocate/SKILL.md) — walks the user through the PMC-gated CVE-allocation form (or reshapes it into a relay message for a non-PMC user), normalises the title, updates the tracker in one pass, and hands off to `security-issue-sync`.
- [`security-issue-fix`](skills/security-issue-fix/SKILL.md) — runs `security-issue-sync`, then (when the fix is clear and small) writes the change in the local `<upstream>` clone, runs checks, and opens a scrubbed public PR via `gh pr create --web`; every public surface is scrubbed for CVE / tracker-slug / `vulnerability` / `security fix` leakage.
- [`generate-cve-json`](tools/cve-tool-vulnogram/generate-cve-json/SKILL.md) — deterministic `uv run` script that emits a paste-ready CVE 5.x JSON record (Vulnogram shape) from a tracking issue, filtering the CVE-tool and `<tracker>` URLs out of `references[]`.

These skills build the CVE record with the [`generate-cve-json`](tools/cve-tool-vulnogram/generate-cve-json/README.md) tool,
a deterministic `uv run` script (not a skill) that emits a paste-ready CVE 5.x JSON record (Vulnogram shape) from a tracking issue,
filtering the CVE-tool and `<tracker>` URLs out of `references[]`.

When adding a new skill:

- place it under `skills/<skill-name>/SKILL.md`;
- start with YAML frontmatter containing `name`, `description`, and `when_to_use`;
- place its content in its family plugin, `plugins/magpie-<family>/skills/<alias>/SKILL.md`, and link it into the flat tree as `skills/<skill-name>` → `../plugins/magpie-<family>/skills/<alias>` (the [`write-skill`](skills/write-skill/SKILL.md) scaffold and `tools/dev/check-family-plugins.py` cover the details);
- start with YAML frontmatter containing every key the validator requires: `name` (the `<alias>`), `description`, `when_to_use`, `license`, `capability`, `family` and `mode`;
- make every state-changing action a *proposal* that requires explicit user confirmation before it runs;
- avoid agent-specific syntax so the skill remains portable across tools;
- **ship a behavioural eval suite** under [`tools/skill-evals/evals/<skill-name>/`](tools/skill-evals/) — see [Keeping evals and mode-economics in sync](#keeping-evals-and-mode-economics-in-sync). The [`write-skill`](skills/write-skill/SKILL.md) skill prompts for the capability frontmatter on every new-skill scaffold. A skill PR without a matching eval suite is incomplete.
Expand Down
4 changes: 2 additions & 2 deletions PRINCIPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Releases are reproducible from signed source to the extent the toolchain permits

## 13. The framework is project-agnostic; concrete names live in adopter config

Skills, tool adapters, and root docs use `<PROJECT>` / `<tracker>` / `<upstream>` / `<security-list>` placeholders and resolve them at runtime from `<project-config>/project.md` and the resolved `user.md`. A concrete name (`apache/airflow`, a real CVE ID, a mailing list address) inside `.claude/skills/` or `tools/` is a refactor bug, not a shortcut. Swapping projects is a config change, never a code change.
Skills, tool adapters, and root docs use `<PROJECT>` / `<tracker>` / `<upstream>` / `<security-list>` placeholders and resolve them at runtime from `<project-config>/project.md` and the resolved `user.md`. A concrete name (`apache/airflow`, a real CVE ID, a mailing list address) inside a skill (`plugins/magpie-<family>/skills/`) or `tools/` is a refactor bug, not a shortcut. Swapping projects is a config change, never a code change.

## 14. One easy install that upgrades and reconciles, never vendored copies

Expand All @@ -144,7 +144,7 @@ The concrete install methods are described in [`docs/quick-start/`](docs/quick-s

## 15. Skills are the unit of authorship

A skill is always a directory under `.claude/skills/<skill-name>/` with `SKILL.md` as its entrypoint, even when the workflow fits in a single file. `SKILL.md` stays under 500 lines; reference material beyond that moves into sibling markdown linked one level deep, with no unreferenced siblings. Skills are code in every meaningful sense: reviewed in PRs, versioned, signed by the same release process as the rest of the framework. Refactor at the skill boundary, never below it.
A skill is always a directory with `SKILL.md` as its entrypoint, even when the workflow fits in a single file: in this repository `plugins/magpie-<family>/skills/<alias>/`, which the flat `skills/<skill-name>` tree links to. `SKILL.md` stays under 500 lines; reference material beyond that moves into sibling markdown linked one level deep, with no unreferenced siblings. Skills are code in every meaningful sense: reviewed in PRs, versioned, signed by the same release process as the rest of the framework. Refactor at the skill boundary, never below it.

## 16. Tracker identifiers are public-safe; tracker contents are not

Expand Down
9 changes: 6 additions & 3 deletions ai-tutors/lesson-04-your-first-skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,18 @@ Apache-2.0 licensed.
> ## Step 2 — Create the starter skill file
>
> The framework ships a script that creates a starter file for you. Run it from
> the repository root, passing the skill name and the output directory:
> the repository root, passing the skill's short name (its alias) and its family:
>
> ```bash
> python3 skills/write-skill/scripts/init_skill.py <name> --path skills/<name>
> python3 skills/write-skill/scripts/init_skill.py <name> --family <family>
> ```
>
> This creates `skills/<name>/SKILL.md` with the required settings keys,
> This creates `plugins/magpie-<family>/skills/<name>/SKILL.md` with the required settings keys,
> the SPDX comment, the placeholder comment, and the adopter-overrides section
> already in place.
> Link it into the flat `skills/` tree with a symlink:
> `ln -s ../plugins/magpie-<family>/skills/<name> skills/<family>-<name>`.
> The rest of this guide reaches the skill through that link.
>
> Fill in the settings (the frontmatter) before you write the body:
>
Expand Down
4 changes: 3 additions & 1 deletion docs/education/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ A broken local setup is the most common thing that stalls this tutorial.

```bash
python3 skills/write-skill/scripts/init_skill.py dependency-licence-check \
--path skills/dependency-licence-check
--family repo-health
ln -s ../plugins/magpie-repo-health/skills/dependency-licence-check \
skills/dependency-licence-check
```

2. Fill in the frontmatter. A filled-in version looks like this:
Expand Down
9 changes: 6 additions & 3 deletions docs/education/your-first-skill.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,18 @@ review, and harder to improve. Pick the smallest piece you can check.
## Step 2 — Create the starter skill file

The framework ships a script that creates a starter file for you. Run it from
the repository root, passing the skill name and the output directory:
the repository root, passing the skill's short name (its alias) and its family:

```bash
python3 skills/write-skill/scripts/init_skill.py <name> --path skills/<name>
python3 skills/write-skill/scripts/init_skill.py <name> --family <family>
```

This creates `skills/<name>/SKILL.md` with the required settings keys,
This creates `plugins/magpie-<family>/skills/<name>/SKILL.md` with the required settings keys,
the SPDX comment, the placeholder comment, and the adopter-overrides section
already in place.
Link it into the flat `skills/` tree with a symlink:
`ln -s ../plugins/magpie-<family>/skills/<name> skills/<family>-<name>`.
The rest of this guide reaches the skill through that link.

Fill in the settings (the frontmatter) before you write the body:

Expand Down
4 changes: 2 additions & 2 deletions docs/security/roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ for the full detail.
proposal.
- [`security-cve-allocate`](../../skills/security-cve-allocate/SKILL.md) — *"allocate a CVE
for <issue-ref>"*.
- [`generate-cve-json`](../../tools/cve-tool-vulnogram/generate-cve-json/SKILL.md) — to
- [`generate-cve-json`](../../tools/cve-tool-vulnogram/generate-cve-json/GUIDE.md) — to
refresh the paste-ready JSON embedded in the issue body on demand.
(The named example here is the Vulnogram adapter under
`tools/cve-tool-vulnogram/`; resolved from `cve_authority.tool` in
Expand Down Expand Up @@ -476,7 +476,7 @@ relay is the ASF security team.) See
current record state). Subsequent syncs by the security team drive the
post-advisory close-out automatically when the archive URL appears on
`<users-list>`.
- [`generate-cve-json`](../../tools/cve-tool-vulnogram/generate-cve-json/SKILL.md) — to
- [`generate-cve-json`](../../tools/cve-tool-vulnogram/generate-cve-json/GUIDE.md) — to
regenerate the attachment on demand when a body field changes after the
URL has been captured (rarely needed — sync regenerates and re-pushes
on every relevant body change). The link points at the named ASF
Expand Down
2 changes: 1 addition & 1 deletion docs/security/threat-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Defaults alone do not decide routing: a report that needs a non-default knob rou
| Text returned to the LLM by adapters | Carries external content verbatim; not taint-marked | — | that it was sanitised (only private-list bodies pass the privacy-LLM redactor). `documented` ([tools/mail-source/contract.md](../../tools/mail-source/contract.md)) |
| Public PRs, comments, commits, mail drafts | Agent-authored | Created only after operator confirmation; mail is drafted, never sent. `documented` (AGENTS.md; [tools/gmail/tool.md](../../tools/gmail/tool.md)) | that agent text is free of errors — the operator reviews it |
| Email drafts | Agent-authored | Plain text only through the Magpie Gmail MCP. `documented` ([tools/gmail/oauth-draft/README.md](../../tools/gmail/oauth-draft/README.md)) | that drafts made through other connectors are free of tracking |
| CVE JSON | Built from tracker fields | Tracker and CVE-tool URLs are never exported to `references[]`. `documented` ([generate-cve-json/SKILL.md](../../tools/cve-tool-vulnogram/generate-cve-json/SKILL.md)) | that reporter-derived fields (credit, summary) were verified — a human confirms them |
| CVE JSON | Built from tracker fields | Tracker and CVE-tool URLs are never exported to `references[]`. `documented` ([generate-cve-json/GUIDE.md](../../tools/cve-tool-vulnogram/generate-cve-json/GUIDE.md)) | that reporter-derived fields (credit, summary) were verified — a human confirms them |
| GitHub Security Advisory fields | Built from tracker fields | A state change like any other: written only after operator confirmation (C-G1). `documented` | that reporter-derived fields were verified |
| Commit metadata | — | Attribution follows the project's convention; no AI `Co-Authored-By:` on this repository. `documented` (AGENTS.md) | — |
| Adversarial-review and typed-decision results | Other models' output | Advisory; never applied without the operator. `documented` | that findings are correct |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ argument-hint: "<github-handle> [window:Nm]"
capability: capability:stats
surface_hash: sha256:a39919af92a37e2d
license: Apache-2.0
measured_tokens: 3713
measured_tokens: 3712
---

<!-- SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -72,9 +72,9 @@ Never add one.
or personal layer (any of the directories below),
nothing has been set up here and there is
nothing to reconcile — resolve this skill's `requires_config:` entries
yourself (first match wins: `.apache-magpie-local/<file>`, the main
checkout's `.apache-magpie-local/<file>`, `<git-common-dir>/apache-magpie/<file>`,
`.svn/apache-magpie/<file>`, then `.apache-magpie-overrides/<file>`), stay silent if they all resolve, and
yourself (first match wins: `<git-common-dir>/apache-magpie/<file>`
or, in a Subversion working copy, `.svn/apache-magpie/<file>`; then a legacy
in-tree `.apache-magpie-local/<file>`; then `.apache-magpie-overrides/<file>`), stay silent if they all resolve, and
run `/magpie-setup:setup config` for this skill if any does not, which also
installs the checker. Otherwise the project *is* set up and its checker
is missing or stale: say so, propose `/magpie-setup:setup config` to install
Expand Down
8 changes: 4 additions & 4 deletions plugins/magpie-contributor-growth/skills/calibrate/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ argument-hint: "[since:YYYY-MM-DD] [holdout:YYYY-MM-DD] [exclude-thread:<id>] [w
capability: capability:stats
surface_hash: sha256:9c623c35a58589e5
license: Apache-2.0
measured_tokens: 4185
measured_tokens: 4184
---

<!-- SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -79,9 +79,9 @@ Never add one.
or personal layer (any of the directories below),
nothing has been set up here and there is
nothing to reconcile — resolve this skill's `requires_config:` entries
yourself (first match wins: `.apache-magpie-local/<file>`, the main
checkout's `.apache-magpie-local/<file>`, `<git-common-dir>/apache-magpie/<file>`,
`.svn/apache-magpie/<file>`, then `.apache-magpie-overrides/<file>`), stay silent if they all resolve, and
yourself (first match wins: `<git-common-dir>/apache-magpie/<file>`
or, in a Subversion working copy, `.svn/apache-magpie/<file>`; then a legacy
in-tree `.apache-magpie-local/<file>`; then `.apache-magpie-overrides/<file>`), stay silent if they all resolve, and
run `/magpie-setup:setup config` for this skill if any does not, which also
installs the checker. Otherwise the project *is* set up and its checker
is missing or stale: say so, propose `/magpie-setup:setup config` to install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ argument-hint: "[target:committer|pmc|both] [window:6m] [end:YYYY-MM-DD]"
capability: capability:stats
surface_hash: sha256:0d00099fe9910caa
license: Apache-2.0
measured_tokens: 4921
measured_tokens: 4920
---

<!-- SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -77,9 +77,9 @@ Never add one.
or personal layer (any of the directories below),
nothing has been set up here and there is
nothing to reconcile — resolve this skill's `requires_config:` entries
yourself (first match wins: `.apache-magpie-local/<file>`, the main
checkout's `.apache-magpie-local/<file>`, `<git-common-dir>/apache-magpie/<file>`,
`.svn/apache-magpie/<file>`, then `.apache-magpie-overrides/<file>`), stay silent if they all resolve, and
yourself (first match wins: `<git-common-dir>/apache-magpie/<file>`
or, in a Subversion working copy, `.svn/apache-magpie/<file>`; then a legacy
in-tree `.apache-magpie-local/<file>`; then `.apache-magpie-overrides/<file>`), stay silent if they all resolve, and
run `/magpie-setup:setup config` for this skill if any does not, which also
installs the checker. Otherwise the project *is* set up and its checker
is missing or stale: say so, propose `/magpie-setup:setup config` to install
Expand Down
Loading
Loading