release-audit
Intro
/pk-release-audit is the structural correctness sweep you run before
tagging a processkit release. It answers: "are all entity files, skill
definitions, MCP server tools, and cross-references internally consistent?"
without modifying any file.
The skill complements pk-doctor: doctor covers schema validation, drift
between context/ and src/context/, and pending migrations; release-audit
covers entity frontmatter correctness, SKILL.md structural requirements, MCP
tool annotation completeness, and uses: cross-reference resolution.
Exit code is 0 if there are no ERRORs (WARNs are permitted), 1 if any
ERROR is found. This makes it suitable as a blocking CI gate before git tag.
Overview
Invocation
/pk-release-audit # detect-only; all four checks; report to stdout
uv run --script context/skills/processkit/release-audit/scripts/release_audit.py
uv run --script .../release_audit.py --repo-root=/path/to/repo
Exit code 0 = clean (0 ERRORs). Exit code 1 = at least one ERROR found.
The four checks
entity_files — walks every context/<dir>/*.md for the registered
entity directories (workitems, decisions, logs, artifacts, actors,
bindings, scopes, gates, roles, migrations, team, team-members,
notes, discussions). For each file verifies:
- YAML frontmatter is present and parseable (between
--- markers).
apiVersion: processkit.projectious.work/v1 is present.
kind: is present and is one of the 13 registered kinds.
metadata.id is present and matches the filename stem.
skill_structure — walks every context/skills/**/SKILL.md. For each
file verifies:
- Frontmatter has
name, description, metadata.processkit.id,
metadata.processkit.version, metadata.processkit.category,
metadata.processkit.layer.
- Body contains the four required sections:
## Intro, ## Overview,
## Gotchas, ## Full reference.
mcp_annotations — walks every context/skills/**/mcp/server.py.
For each file verifies that every @server.tool(...) decoration includes
an annotations=ToolAnnotations(...) argument containing all four required
hint keys: readOnlyHint, destructiveHint, idempotentHint,
openWorldHint.
cross_references — walks every context/skills/**/SKILL.md and reads
metadata.processkit.uses[*].skill. For each named skill, checks that a
corresponding SKILL.md exists at context/skills/<category>/<name>/SKILL.md
(searches all category directories, not just processkit/). ERROR per
unresolvable reference.
What release-audit will NEVER do
- Modify any file under
context/ or src/context/.
- Validate YAML schemas against
src/context/schemas/ — that is pk-doctor's
schema_filename check.
- Write to
context/logs/ — this tool is a CLI script, not an MCP server.
- Block on missing
context/templates/ — the template mirror is not consulted.
Report shape
# pk-release-audit v1.0.0
repo_root: /path/to/repo
## entity_files — 0 ERROR / 0 WARN / 47 INFO
[i] BACK-20260409_1449-BoldVale-fts5-full-text-search (workitems) — OK
## skill_structure — 1 ERROR / 0 WARN / 36 INFO
[E] skill.missing-section — context/skills/foo/bar/SKILL.md missing section: ## Gotchas
## mcp_annotations — 0 ERROR / 0 WARN / 12 INFO
[i] skill-gate:acknowledge_contract — annotations present
## cross_references — 0 ERROR / 0 WARN / 14 INFO
[i] pk-doctor → event-log — resolved
## totals — 1 ERROR / 0 WARN / 109 INFO
Gotchas
Agent-specific failure modes — provider-neutral pause-and-self-check items:
- Running release-audit as a replacement for pk-doctor. The two tools
complement each other. Release-audit does NOT check schema conformance,
drift, or pending migrations. Always run both before tagging.
- Treating cross-reference ERRORs as false positives. The
uses: resolver
searches all context/skills/<category>/<name>/SKILL.md paths. If a skill
truly exists but is in an unexpected location, the fix is to correct the
uses: entry, not to suppress the check.
- Fixing ERRORs by editing files directly without understanding the cause.
A
metadata.id mismatch ERROR means either the file was renamed without
updating the frontmatter, or the frontmatter was edited without renaming the
file. The correct fix depends on which copy is canonical — check git history.
- Running release-audit against a partial tree. The script walks the live
context/ tree from the detected repo root. Running it in a worktree or
checkout missing some files will produce false ERRORs for every absent entity
directory. Always run from the full working tree.
- Ignoring WARNs before a release. WARNs indicate structural drift that
does not prevent the release but will accumulate into ERRORs in future
versions. Address all WARNs before a minor or major release.
Full reference
CLI contract
release_audit.py [--repo-root=PATH]
| Flag |
Meaning |
--repo-root |
Explicit repo root path. Defaults to git rev-parse --show-toplevel. |
Registered entity kinds
| kind |
directory |
WorkItem |
workitems/ |
DecisionRecord |
decisions/ |
LogEntry |
logs/ |
Artifact |
artifacts/ |
Actor |
actors/ |
Binding |
bindings/ |
Scope |
scopes/ |
Gate |
gates/ |
Role |
roles/ |
Migration |
migrations/ |
TeamMember |
team-members/ |
Note |
notes/ |
Discussion |
discussions/ |
Required SKILL.md frontmatter fields
name (string)
description (string)
metadata.processkit.id (string, must start with SKILL-)
metadata.processkit.version (string)
metadata.processkit.category (string)
metadata.processkit.layer (integer or null)
Required SKILL.md body sections
## Intro
## Overview
## Gotchas
## Full reference
Required MCP tool annotation keys
readOnlyHint
destructiveHint
idempotentHint
openWorldHint
Adding a check in future versions
- Add a new check function in
release_audit.py following the
run_<name>(repo_root) -> list[Finding] pattern.
- Register it in
CHECKS at the bottom of the file.
- Add a gotcha for that check in this SKILL.md.
- Mirror the updated script to
src/context/skills/processkit/release-audit/scripts/.
1---2name: release-audit-23description: Detect-only pre-release validation sweep over the processkit content tree. Walks entity files, SKILL.md definitions, MCP server tools, and cross-references, then emits a single human-readable report with ERROR / WARN / INFO counts. Use when the user invokes `/pk-release-audit`, before tagging a release, or any time you need a comprehensive structural health check beyond what pk-doctor covers. Detect-only; never modifies any file under `context/`.4---56# release-audit78## Intro910`/pk-release-audit` is the structural correctness sweep you run before11tagging a processkit release. It answers: "are all entity files, skill12definitions, MCP server tools, and cross-references internally consistent?"13without modifying any file.1415The skill complements `pk-doctor`: doctor covers schema validation, drift16between `context/` and `src/context/`, and pending migrations; release-audit17covers entity frontmatter correctness, SKILL.md structural requirements, MCP18tool annotation completeness, and `uses:` cross-reference resolution.1920Exit code is `0` if there are no ERRORs (WARNs are permitted), `1` if any21ERROR is found. This makes it suitable as a blocking CI gate before `git tag`.2223## Overview2425### Invocation2627```28/pk-release-audit # detect-only; all four checks; report to stdout29uv run --script context/skills/processkit/release-audit/scripts/release_audit.py30uv run --script .../release_audit.py --repo-root=/path/to/repo31```3233Exit code `0` = clean (0 ERRORs). Exit code `1` = at least one ERROR found.3435### The four checks36371. **`entity_files`** — walks every `context/<dir>/*.md` for the registered38 entity directories (`workitems`, `decisions`, `logs`, `artifacts`, `actors`,39 `bindings`, `scopes`, `gates`, `roles`, `migrations`, `team`, `team-members`,40 `notes`, `discussions`). For each file verifies:41 - YAML frontmatter is present and parseable (between `---` markers).42 - `apiVersion: processkit.projectious.work/v1` is present.43 - `kind:` is present and is one of the 13 registered kinds.44 - `metadata.id` is present and matches the filename stem.45462. **`skill_structure`** — walks every `context/skills/**/SKILL.md`. For each47 file verifies:48 - Frontmatter has `name`, `description`, `metadata.processkit.id`,49 `metadata.processkit.version`, `metadata.processkit.category`,50 `metadata.processkit.layer`.51 - Body contains the four required sections: `## Intro`, `## Overview`,52 `## Gotchas`, `## Full reference`.53543. **`mcp_annotations`** — walks every `context/skills/**/mcp/server.py`.55 For each file verifies that every `@server.tool(...)` decoration includes56 an `annotations=ToolAnnotations(...)` argument containing all four required57 hint keys: `readOnlyHint`, `destructiveHint`, `idempotentHint`,58 `openWorldHint`.59604. **`cross_references`** — walks every `context/skills/**/SKILL.md` and reads61 `metadata.processkit.uses[*].skill`. For each named skill, checks that a62 corresponding `SKILL.md` exists at `context/skills/<category>/<name>/SKILL.md`63 (searches all category directories, not just `processkit/`). ERROR per64 unresolvable reference.6566### What release-audit will NEVER do6768- Modify any file under `context/` or `src/context/`.69- Validate YAML schemas against `src/context/schemas/` — that is pk-doctor's70 `schema_filename` check.71- Write to `context/logs/` — this tool is a CLI script, not an MCP server.72- Block on missing `context/templates/` — the template mirror is not consulted.7374### Report shape7576```77# pk-release-audit v1.0.078repo_root: /path/to/repo7980## entity_files — 0 ERROR / 0 WARN / 47 INFO81 [i] BACK-20260409_1449-BoldVale-fts5-full-text-search (workitems) — OK8283## skill_structure — 1 ERROR / 0 WARN / 36 INFO84 [E] skill.missing-section — context/skills/foo/bar/SKILL.md missing section: ## Gotchas8586## mcp_annotations — 0 ERROR / 0 WARN / 12 INFO87 [i] skill-gate:acknowledge_contract — annotations present8889## cross_references — 0 ERROR / 0 WARN / 14 INFO90 [i] pk-doctor → event-log — resolved9192## totals — 1 ERROR / 0 WARN / 109 INFO93```9495## Gotchas9697Agent-specific failure modes — provider-neutral pause-and-self-check items:9899- **Running release-audit as a replacement for pk-doctor.** The two tools100 complement each other. Release-audit does NOT check schema conformance,101 drift, or pending migrations. Always run both before tagging.102- **Treating cross-reference ERRORs as false positives.** The `uses:` resolver103 searches all `context/skills/<category>/<name>/SKILL.md` paths. If a skill104 truly exists but is in an unexpected location, the fix is to correct the105 `uses:` entry, not to suppress the check.106- **Fixing ERRORs by editing files directly without understanding the cause.**107 A `metadata.id` mismatch ERROR means either the file was renamed without108 updating the frontmatter, or the frontmatter was edited without renaming the109 file. The correct fix depends on which copy is canonical — check git history.110- **Running release-audit against a partial tree.** The script walks the live111 `context/` tree from the detected repo root. Running it in a worktree or112 checkout missing some files will produce false ERRORs for every absent entity113 directory. Always run from the full working tree.114- **Ignoring WARNs before a release.** WARNs indicate structural drift that115 does not prevent the release but will accumulate into ERRORs in future116 versions. Address all WARNs before a minor or major release.117118## Full reference119120### CLI contract121122```123release_audit.py [--repo-root=PATH]124```125126| Flag | Meaning |127|---------------|---------|128| `--repo-root` | Explicit repo root path. Defaults to `git rev-parse --show-toplevel`. |129130### Registered entity kinds131132| kind | directory |133|------|-----------|134| `WorkItem` | `workitems/` |135| `DecisionRecord` | `decisions/` |136| `LogEntry` | `logs/` |137| `Artifact` | `artifacts/` |138| `Actor` | `actors/` |139| `Binding` | `bindings/` |140| `Scope` | `scopes/` |141| `Gate` | `gates/` |142| `Role` | `roles/` |143| `Migration` | `migrations/` |144| `TeamMember` | `team-members/` |145| `Note` | `notes/` |146| `Discussion` | `discussions/` |147148### Required SKILL.md frontmatter fields149150- `name` (string)151- `description` (string)152- `metadata.processkit.id` (string, must start with `SKILL-`)153- `metadata.processkit.version` (string)154- `metadata.processkit.category` (string)155- `metadata.processkit.layer` (integer or null)156157### Required SKILL.md body sections158159- `## Intro`160- `## Overview`161- `## Gotchas`162- `## Full reference`163164### Required MCP tool annotation keys165166- `readOnlyHint`167- `destructiveHint`168- `idempotentHint`169- `openWorldHint`170171### Adding a check in future versions1721731. Add a new check function in `release_audit.py` following the174 `run_<name>(repo_root) -> list[Finding]` pattern.1752. Register it in `CHECKS` at the bottom of the file.1763. Add a gotcha for that check in this SKILL.md.1774. Mirror the updated script to `src/context/skills/processkit/release-audit/scripts/`.