Contributing Extensions
The devkit core stays framework-free: everything that knows a stack (Nuxt, Shopware, Laravel …) or an optional tool (Pen first) lives in an extension that anyone on the team can contribute to. This page is for internal onedot teams who add or maintain one. Contributions arrive as pull requests on this repository from a branch, never a fork, and need no CLA.
Contracts stay in their own files; this page links to them and does not restate their fields.
Extension kinds
| Kind | Path | Selected by | Contract |
|---|---|---|---|
stack | content/stacks/<id>/extension.json | detect-stack matches exports.detection | Stack Packs |
integration | content/integrations/<id>/extension.json | per project: .agents/extensions.json, else a present probe | devkit/specs/961-pen-integration-extension.md > Contract items 1–3, devkit/research/pen-integration-extension-contract.md items 4–9 |
overlay | .agents/stacks/<id>/extension.json in a target project | devkit stack trust | Stack Packs > Gates and overlays; lives in the project, never contributed here |
Every manifest is {schema: 1, id, kind, core_api: 1, exports} with a kebab-case id; unknown fields and versions reject. Integrations are central only and never take part in stack detection, overlays or stack trust.
The integration kind is a draft: Spec 961 builds it with Pen as the first case. Until its Slice 1 lands, no integration loader, no devkit extension command and no content/integrations/ directory exist.
The Python extensions/<name>/extension.json of .agents/context/CONVENTIONS.md > Runtime & Naming is unrelated: another directory, another schema.
Ownership
Extensions have no per-pack owner: anyone on the team can contribute to any stack pack or integration. A core maintainer reviews every extension pull request; .github/CODEOWNERS requests one through the core fallbacks /content/stacks/ and /content/integrations/, which cover every extension. A per-extension CODEOWNERS line would replace that fallback, so none is added.
An extension that needs a core change (a new export, a new predicate, a loader field) is two pull requests: the core change first, reviewed by a core maintainer alone, then the extension change on top. A pure pack change touches no Rust source under rust/devkit/src/, only test registrations and fixtures; Spec 821's unseen-stack proof holds this line for stacks.
Scaffold
- Stack:
devkit maint stack-new <id> [dir], run against a sample project, prints a draft manifest. It refuses a taken id (STACK_NEW_ID_TAKEN), a directory an existing pack already matches (STACK_NEW_MATCHED: extend that pack or write a project overlay) and a directory without a known manifest (STACK_NEW_NO_MANIFEST). Save the draft ascontent/stacks/<id>/extension.json. The command ships in the maintainer satellite, so it needs a checkout build fromdevkit maint dev-sync. - Integration: no scaffold exists yet. Copy
content/integrations/pen/extension.jsononce Spec 961 Slice 1 has landed; the todointegration-scaffold-and-check-commandsproposes a scaffold and a check.
What a pull request must carry
| Evidence | Stack | Integration |
|---|---|---|
| Manifest loads under the installed catalog | yes | yes |
| Fixture project and frozen snapshots | rust/devkit/tests/fixtures/stack_parity/<id>/, FIXTURES entry in stack_parity.rs, expected output under _expected/<id>/ | enablement cases per Spec 961 Step 2 (enablement_* unit tests) |
Routing rows in tests/affected-map.txt | content/stacks/<id>/** stack_parity (plus the suites the pack's exports feed) | content/integrations/** extension_cmd |
| Latency verdict | only when hooks or delivery change | LATENCY_VERDICT lands from devkit maint latency --verdict on every slice (Spec 962) |
| Changelog | docs/changelog.md ## Unreleased when users notice the change | same |
Drivers are .mjs files under driver/ and edit formatters .cjs under gates/. devkit maint rust-only exempts them only while a valid manifest of the same pack references them; any other non-Rust executable fails the check.
An integration must cost a project that has it disabled nothing: no process on a hook path, no skill or MCP tokens (contract items 2 and 9). The latency verdict is the proof, run through Spec 962's Protocol with its case manifest and ledger; a slice without LATENCY_VERDICT lands does not merge.
Migrating legacy graph exports
The retired exports.import_graph field is rejected, even when its value is empty or null. Remove it and declare exports.index.graph with driver, output and sources instead; do not move the old graph discriminator value into the new field. The driver implements the graph protocol, and sources declares the source directories and extensions it reads. See Stack Packs — Manifest and Graph drivers for the manifest shape and protocol.
Versioning and compatibility
An extension has no version of its own. It ships inside the release payload (content/ is copied whole into every release archive) and carries that release's version.
core_api is the compatibility line: the loader rejects any value other than the one the running core provides (unsupported core_api …). Raising it is a core-maintainer decision, and the same pull request migrates every extension in the central catalog, because all of them ship together.
An integration's optional binary component is signed per release tag with the same version as the core (contract item 7); a mismatched component is refused, never loaded.
From merge to developers
- Try the change before merging:
devkit maint dev-sync --worktreebuilds the working tree into the runtime, effective in the next session. - Merge to
mainafter a core maintainer's approval and a green CI. - A user-visible change gets an entry under
## Unreleasedindocs/changelog.md. - A core maintainer tags the next release; CI builds, signs and publishes it (PUBLISH).
- Developers receive it with their next
devkit sync. There is no separate extension release.
Agent checklist
- Kind → contract: stack →
docs/reference/stack-packs.md; integration → Spec 961 Contract 1–3 +devkit/research/pen-integration-extension-contract.md4–9. Never copy contract text into another file. - Pack-only diff:
content/stacks/<id>/, its fixture dir,stack_parity.rsFIXTURES,tests/affected-map.txt,docs/changelog.md. A path underrust/devkit/src/in the diff → split out a core PR. - Checks:
devkit maint rust-only,devkit test-prep --affected-only(Rust targets on spark viadevkit maint ci-cleanroom --worktree <cargo test args>),devkit quality-gate; snapshots re-bless withSTACK_PARITY_BLESS=$(git rev-parse HEAD)in a commit that names the behaviour change. - Integration slice: no merge without
LATENCY_VERDICT lands; quote the verdict line in the pull request. - Pull request body from
.github/PULL_REQUEST_TEMPLATE/extension.md: an agent passesgh pr create --title <t> --body-file .github/PULL_REQUEST_TEMPLATE/extension.mdand fills it in;--template extension.mdonly seeds the interactive prompt; on the web, append?template=extension.mdto the compare URL. - Skill changes add
devkit maint skill-lint. Run every check from a dev-synced build, becausedevkit maintresolves to the installed runtime, not the working tree.