2026-11-25 18:50:23 -05:00
|
|
|
|
# Instruction package contract
|
|
|
|
|
|
|
|
|
|
|
|
An instruction package is one closed directory: `SKILL.md`, optional declared
|
|
|
|
|
|
`.md`/`.txt` resources, and the `relayview-skill.json` sidecar.
|
2026-11-25 19:01:50 -05:00
|
|
|
|
`tools/packages.py` enforces this contract. Its `check` action prints a
|
|
|
|
|
|
package's identity and its `pack` action builds the release archive and prints
|
|
|
|
|
|
its SHA-256, for example:
|
|
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
|
python3 -m tools.packages check packages/planner-scope
|
|
|
|
|
|
python3 -m tools.packages pack packages/planner-scope dist/planner-scope.zip
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
RelayView's owner applies its own admission check, which stays authoritative:
|
|
|
|
|
|
a package that passes here can still be refused by an owner that does not yet
|
|
|
|
|
|
support its role/step pair.
|
2026-11-25 18:50:23 -05:00
|
|
|
|
|
|
|
|
|
|
## Role and step
|
|
|
|
|
|
|
|
|
|
|
|
Each package guides exactly one role during that role's one step.
|
|
|
|
|
|
|
|
|
|
|
|
| `role` | `step` | Schemas |
|
|
|
|
|
|
| --- | --- | --- |
|
|
|
|
|
|
| `planner` | `planning` | 1, 2, 3 |
|
|
|
|
|
|
| `implementer` | `implementation` | 1, 3 |
|
|
|
|
|
|
| `reviewer` | `review` | 1, 3 |
|
|
|
|
|
|
| `designer` | `design` | 1 |
|
|
|
|
|
|
| `tester` | `testing` | 1, 3 |
|
|
|
|
|
|
| `coordinator` | `coordination` | 1, 3 |
|
|
|
|
|
|
|
|
|
|
|
|
Any other pairing, including a known role with another role's step, fails the
|
|
|
|
|
|
check. Role and step names are lower-case strings.
|
|
|
|
|
|
|
|
|
|
|
|
## Sidecar fields
|
|
|
|
|
|
|
|
|
|
|
|
The sidecar is UTF-8 JSON without a BOM or NUL bytes, at most 64 KiB, with
|
|
|
|
|
|
exactly the fields its integer `schemaVersion` names:
|
|
|
|
|
|
|
|
|
|
|
|
- **Schema 1** — `schemaVersion`, `source`, `role`, `step`, `files`.
|
|
|
|
|
|
- **Schema 2** — schema 1 plus `issueClaim: {"statusLabel": <label or null>}`;
|
|
|
|
|
|
`planner`/`planning` only. A label matches `status/[a-z][a-z0-9-]{0,63}` and
|
|
|
|
|
|
is never `status/ready-for-agent`.
|
|
|
|
|
|
- **Schema 3** — schema 1 plus `treatment: "communication_context"`; every
|
|
|
|
|
|
pair except `designer`/`design`. The treatment marks the package's ablation
|
|
|
|
|
|
boundary and grants no tools or authority.
|
|
|
|
|
|
|
|
|
|
|
|
`source` is exactly `{"kind": "first-party" | "user", "reference": <1–128 of
|
|
|
|
|
|
[A-Za-z0-9._:-]>}`. `files` lists 1–16 `{"path", "sha256"}` entries: unique
|
|
|
|
|
|
relative paths without `.`/`..`/empty segments or backslashes, at most 256
|
|
|
|
|
|
characters, `SKILL.md` required, other paths ending `.md` or `.txt`, and
|
|
|
|
|
|
lower-case 64-hex SHA-256 digests. Any additional field — such as `tools`,
|
|
|
|
|
|
`permissions`, or `network` — fails the check.
|
|
|
|
|
|
|
|
|
|
|
|
## Package contents
|
|
|
|
|
|
|
|
|
|
|
|
- Every file in the directory except the sidecar is declared, and every
|
|
|
|
|
|
declared file is present with exactly its declared SHA-256.
|
2026-11-25 18:56:09 -05:00
|
|
|
|
- The package directory is a real directory, not a symbolic link, and the
|
|
|
|
|
|
sidecar is a regular file.
|
2026-11-25 18:50:23 -05:00
|
|
|
|
- No symbolic links, executable bits, or non-regular files; at most 64 entries
|
2026-11-25 18:53:47 -05:00
|
|
|
|
(files and directories), and no relative path longer than 8 segments
|
|
|
|
|
|
including the file name.
|
2026-11-25 18:50:23 -05:00
|
|
|
|
- Each file is non-empty UTF-8 without a BOM or NUL bytes; the sidecar plus all
|
|
|
|
|
|
declared files total at most 128 KiB.
|
|
|
|
|
|
|
|
|
|
|
|
## `SKILL.md` frontmatter
|
|
|
|
|
|
|
2026-11-25 18:56:09 -05:00
|
|
|
|
`SKILL.md` opens with a frontmatter block between `---` lines. The block
|
2026-11-25 19:01:50 -05:00
|
|
|
|
requires `name`, `description`, and `metadata`, and allows only these keys,
|
|
|
|
|
|
each at most once:
|
2026-11-25 18:50:23 -05:00
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
|
name: <the directory name: hyphen-separated lower-case letters and digits, at most 64 characters>
|
|
|
|
|
|
description: <non-empty, at most 1024 characters>
|
2026-11-25 18:56:09 -05:00
|
|
|
|
disable-model-invocation: true
|
2026-11-25 18:50:23 -05:00
|
|
|
|
metadata:
|
|
|
|
|
|
relayview-display-name: <at most 128 characters>
|
|
|
|
|
|
relayview-version: <major.minor.patch>
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-11-25 18:56:09 -05:00
|
|
|
|
`disable-model-invocation` is optional and is exactly `true` or `false`; `true`
|
|
|
|
|
|
makes the package manual-only. Every key other than `metadata` is written
|
|
|
|
|
|
`key: value` with a non-empty value. `metadata:` stands alone on its line,
|
|
|
|
|
|
followed by exactly those two keys, each indented two spaces. The block has no
|
2026-11-25 19:04:47 -05:00
|
|
|
|
blank or comment lines. The block and its delimiters contain no line-break
|
|
|
|
|
|
character other than LF (such as CR, vertical tab, form feed, or a Unicode
|
|
|
|
|
|
line or paragraph separator), and the closing `---` ends with LF or the end of
|
|
|
|
|
|
the file. This line-break rule does not apply to the Markdown body. Any other
|
|
|
|
|
|
key, such as `tools` or `allowed-tools`, fails the check.
|
2026-11-25 18:50:23 -05:00
|
|
|
|
|
|
|
|
|
|
## Identity and archive
|
|
|
|
|
|
|
|
|
|
|
|
The package identity is the SHA-256 of `relayview-instruction-package-v1\0`
|
|
|
|
|
|
followed by length-framed parts (a 4-byte big-endian length, then the bytes):
|
2026-11-25 18:56:09 -05:00
|
|
|
|
the raw sidecar bytes, then for each declared path, sorted as whole strings
|
|
|
|
|
|
by Unicode code point, the UTF-8 path and the file bytes.
|
2026-11-25 18:50:23 -05:00
|
|
|
|
|
|
|
|
|
|
The release archive is an uncompressed ZIP containing the repository
|
2026-11-25 18:53:47 -05:00
|
|
|
|
`LICENSE` and `NOTICE.md`, then every package file under `<package-name>/`,
|
|
|
|
|
|
sorted segment by segment (so `a/b.md` precedes `a-b/c.md`, unlike the
|
2026-11-25 18:58:35 -05:00
|
|
|
|
whole-string order the identity uses). Every entry carries the timestamp
|
|
|
|
|
|
1980-01-01 00:00:00 and mode `0644`. ZIP headers also record the creating
|
|
|
|
|
|
system, so release digests are computed on a POSIX host, as this repository's
|
|
|
|
|
|
CI does; on such a host the archive digest depends only on those bytes.
|
2026-11-25 18:50:23 -05:00
|
|
|
|
|
|
|
|
|
|
RelayView's `scripts/verify-first-party-skills-source.py` recomputes both
|
|
|
|
|
|
values from a tagged release and compares them with its
|
|
|
|
|
|
`first-party-skills/<tag>/bundle-lock.json`. The tests in
|
|
|
|
|
|
`tests/test_role_steps.py` mirror that computation and pin the identity
|
|
|
|
|
|
framing. The `v0.1.0` archive predates the bundled `LICENSE` and `NOTICE.md`;
|
|
|
|
|
|
every later release uses the archive format above.
|
|
|
|
|
|
|
|
|
|
|
|
## Releases are immutable
|
|
|
|
|
|
|
|
|
|
|
|
A published tag is never moved or rebuilt. A change to any package byte ships
|
|
|
|
|
|
under a new release tag; RelayView keeps earlier bundles to reconstruct
|
|
|
|
|
|
retained sessions.
|
|
|
|
|
|
|
|
|
|
|
|
## RelayView adoption of the Tester and Coordinator pairs
|
|
|
|
|
|
|
2026-11-25 18:53:47 -05:00
|
|
|
|
RelayView's owner admits only `planner`, `implementer`, `reviewer`, and
|
|
|
|
|
|
`designer` packages. No released package declares `tester` or `coordinator`
|
|
|
|
|
|
yet. The planned releases below are proposed, not published:
|
2026-11-25 18:50:23 -05:00
|
|
|
|
|
2026-11-25 18:53:47 -05:00
|
|
|
|
| Proposed release | New pair | Planned packages |
|
2026-11-25 18:50:23 -05:00
|
|
|
|
| --- | --- | --- |
|
2026-11-25 18:53:47 -05:00
|
|
|
|
| `v0.15.0` | `tester`/`testing` | Tester inspection (schema 1) and Tester communication (schema 3) |
|
|
|
|
|
|
| `v0.17.0` | `coordinator`/`coordination` | Coordinator automatic and manual methods (schema 1) and Coordinator communication (schema 3) |
|
2026-11-25 18:50:23 -05:00
|
|
|
|
|
2026-11-25 18:53:47 -05:00
|
|
|
|
Before RelayView pins a release containing either pair, it must:
|
2026-11-25 18:50:23 -05:00
|
|
|
|
|
2026-11-25 18:53:47 -05:00
|
|
|
|
1. **Know the role.** Add it to the owner's role types (`SkillWorkflowRole` /
|
|
|
|
|
|
`TrustedSkillRole` in `src/owner/workflowPresets.ts`) and give it an
|
|
|
|
|
|
explicit step in `roleStep()`, which otherwise answers `design` for any
|
|
|
|
|
|
role it does not name.
|
|
|
|
|
|
2. **Admit the sidecar.** In `loadInstructionPackage`, accept the role in its
|
|
|
|
|
|
explicit role check and map it to its step in `expectedStep`. Accept schema 1
|
|
|
|
|
|
and schema 3, keep schema 2 Planner-only, and keep schema 3 closed to
|
|
|
|
|
|
`designer`.
|
|
|
|
|
|
3. **Expose it in Skills settings.** Add the role and step to the package,
|
|
|
|
|
|
assignment, and set-selection schemas in `src/api/contract-skill-settings.ts`
|
|
|
|
|
|
and the generated owner schemas, and to named-set role and step validation
|
|
|
|
|
|
in `src/owner/workflowPresets.ts`, so the role's sets can be selected.
|
|
|
|
|
|
4. **Pin and verify the release.** Add `first-party-skills/<tag>/` with its
|
|
|
|
|
|
`bundle-lock.json`, and add the bundle to
|
|
|
|
|
|
`scripts/verify-first-party-skills-source.py`.
|
2026-11-25 18:50:23 -05:00
|
|
|
|
|
|
|
|
|
|
The identity framing, archive format, file rules, and frontmatter rules do not
|
2026-11-25 18:53:47 -05:00
|
|
|
|
change for these pairs, so existing bundle locks stay valid.
|
2026-11-25 19:54:53 -05:00
|
|
|
|
|
|
|
|
|
|
## RelayView adoption of the Specification Designer default
|
|
|
|
|
|
|
|
|
|
|
|
From `v0.15.0`, `specification-designer-default` replaces
|
|
|
|
|
|
`issue-designer-default` as the automatic `designer`/`design` package.
|
|
|
|
|
|
`issue-designer-default` stays in `packages/` with its `v0.13.0` bytes, so its
|
|
|
|
|
|
identity and every earlier release are unchanged; it is no longer a maintained
|
|
|
|
|
|
default. The eight manual Designer methods keep their IDs.
|
|
|
|
|
|
|
|
|
|
|
|
RelayView's owner names its Designer default by ID. Before RelayView pins a
|
|
|
|
|
|
release whose Designer default is `specification-designer-default`, it must:
|
|
|
|
|
|
|
|
|
|
|
|
1. **Rename the default.** In `src/owner/workflowPresets.ts`, use the new ID
|
2026-11-25 19:58:49 -05:00
|
|
|
|
where the owner assigns the Designer default and its maintained comparison
|
|
|
|
|
|
selection, checks that optional Designer skills differ from it, and
|
|
|
|
|
|
requires it to be the one automatic pinned Designer package.
|
2026-11-25 20:02:29 -05:00
|
|
|
|
2. **Load the new release as current.** New Designer sessions capture the
|
|
|
|
|
|
nine `v0.15.0` packages with their new identities. Today the current
|
|
|
|
|
|
catalog takes its Designer packages from the operator release:
|
|
|
|
|
|
`loadRelease` hard-codes their release as `v0.13.0`, and
|
|
|
|
|
|
`OPERATOR_RELEASE_PACKAGES` holds their identities.
|
|
|
|
|
|
3. **Keep reconstructing `v0.13.0` sessions.** A session that recorded the
|
|
|
|
|
|
`v0.13.0` Designer packages, including `issue-designer-default`, must still
|
|
|
|
|
|
resolve to those exact bytes, and earlier lineages must keep resolving as
|
|
|
|
|
|
they do now. Today `resolveDesignerSkills` decides whether to pass a
|
|
|
|
|
|
recorded assignment down the retained catalog chain by comparing its
|
|
|
|
|
|
recorded release with the fixed string `v0.13.0`, so that routing must
|
|
|
|
|
|
change with the new current release.
|
2026-11-25 19:54:53 -05:00
|
|
|
|
4. **Pin and verify the release.** Add `first-party-skills/v0.15.0/` with its
|
|
|
|
|
|
`bundle-lock.json`, and add the bundle to
|
|
|
|
|
|
`scripts/verify-first-party-skills-source.py`.
|