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
uv run --script .../release_audit.py --tree=src-context
uv run --script .../release_audit.py --tree=both
Exit code 0 = clean (0 ERRORs). Exit code 1 = at least one ERROR found.
The default context tree is the live dogfood/project tree. src-context
audits the shipped release deliverable tree under src/context/ and does
not warn when dogfood-only entity directories such as workitems/ or
decisions/ are absent.
The four checks
entity_files — walks every selected tree's <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/v2 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 selected tree's skills/**/SKILL.md. For each
file verifies:
- Frontmatter has
name, description,
metadata.processkit.apiVersion, metadata.processkit.id,
metadata.processkit.version, metadata.processkit.category, and
metadata.processkit.layer for processkit-category skills.
- Body contains the four required sections:
## Intro, ## Overview,
## Gotchas, ## Full reference.
mcp_annotations — walks every selected tree's 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 selected tree's 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. Use --tree=src-context when auditing only the shipped
release deliverable.
- 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] [--tree=context|src-context|both]
| Flag |
Meaning |
--repo-root |
Explicit repo root path. Defaults to git rev-parse --show-toplevel. |
--tree |
context audits the live tree, src-context audits the release deliverable tree, and both audits both. |
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.apiVersion (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-audit3description: |4 Detect-only pre-release validation sweep over the processkit content tree.5 Walks entity files, SKILL.md definitions, MCP server tools, and6 cross-references, then emits a single human-readable report with7 ERROR / WARN / INFO counts. Use when the user invokes `/pk-release-audit`,8 before tagging a release, or any time you need a comprehensive structural9 health check beyond what pk-doctor covers. Detect-only; never modifies any10 file under `context/`.11metadata:12 source: https://skillmd.com/skills/projectious-work/release-audit13 processkit:14 apiVersion: processkit.projectious.work/v215 id: SKILL-release-audit16 version: "1.0.0"17 created: 2026-04-26T00:00:00Z18 category: processkit19 layer: 320 uses:21 - skill: pk-doctor22 purpose: Complementary health check — pk-doctor covers schema/drift/migration checks; release-audit covers entity frontmatter, skill structure, MCP tool annotations, and cross-references.23 commands:24 - name: pk-release-audit25 args: "[--repo-root=<path>] [--tree=context|src-context|both]"26 description: "Run the pre-release validation sweep and print a single report."27---2829# release-audit3031## Intro3233`/pk-release-audit` is the structural correctness sweep you run before34tagging a processkit release. It answers: "are all entity files, skill35definitions, MCP server tools, and cross-references internally consistent?"36without modifying any file.3738The skill complements `pk-doctor`: doctor covers schema validation, drift39between `context/` and `src/context/`, and pending migrations; release-audit40covers entity frontmatter correctness, SKILL.md structural requirements, MCP41tool annotation completeness, and `uses:` cross-reference resolution.4243Exit code is `0` if there are no ERRORs (WARNs are permitted), `1` if any44ERROR is found. This makes it suitable as a blocking CI gate before `git tag`.4546## Overview4748### Invocation4950```51/pk-release-audit # detect-only; all four checks; report to stdout52uv run --script context/skills/processkit/release-audit/scripts/release_audit.py53uv run --script .../release_audit.py --repo-root=/path/to/repo54uv run --script .../release_audit.py --tree=src-context55uv run --script .../release_audit.py --tree=both56```5758Exit code `0` = clean (0 ERRORs). Exit code `1` = at least one ERROR found.59The default `context` tree is the live dogfood/project tree. `src-context`60audits the shipped release deliverable tree under `src/context/` and does61not warn when dogfood-only entity directories such as `workitems/` or62`decisions/` are absent.6364### The four checks65661. **`entity_files`** — walks every selected tree's `<dir>/*.md` for the registered67 entity directories (`workitems`, `decisions`, `logs`, `artifacts`, `actors`,68 `bindings`, `scopes`, `gates`, `roles`, `migrations`, `team`, `team-members`,69 `notes`, `discussions`). For each file verifies:70 - YAML frontmatter is present and parseable (between `---` markers).71 - `apiVersion: processkit.projectious.work/v2` is present.72 - `kind:` is present and is one of the 13 registered kinds.73 - `metadata.id` is present and matches the filename stem.74752. **`skill_structure`** — walks every selected tree's `skills/**/SKILL.md`. For each76 file verifies:77 - Frontmatter has `name`, `description`,78 `metadata.processkit.apiVersion`, `metadata.processkit.id`,79 `metadata.processkit.version`, `metadata.processkit.category`, and80 `metadata.processkit.layer` for processkit-category skills.81 - Body contains the four required sections: `## Intro`, `## Overview`,82 `## Gotchas`, `## Full reference`.83843. **`mcp_annotations`** — walks every selected tree's `skills/**/mcp/server.py`.85 For each file verifies that every `@server.tool(...)` decoration includes86 an `annotations=ToolAnnotations(...)` argument containing all four required87 hint keys: `readOnlyHint`, `destructiveHint`, `idempotentHint`,88 `openWorldHint`.89904. **`cross_references`** — walks every selected tree's `skills/**/SKILL.md` and reads91 `metadata.processkit.uses[*].skill`. For each named skill, checks that a92 corresponding `SKILL.md` exists at `context/skills/<category>/<name>/SKILL.md`93 (searches all category directories, not just `processkit/`). ERROR per94 unresolvable reference.9596### What release-audit will NEVER do9798- Modify any file under `context/` or `src/context/`.99- Validate YAML schemas against `src/context/schemas/` — that is pk-doctor's100 `schema_filename` check.101- Write to `context/logs/` — this tool is a CLI script, not an MCP server.102- Block on missing `context/templates/` — the template mirror is not consulted.103104### Report shape105106```107# pk-release-audit v1.0.0108repo_root: /path/to/repo109110## entity_files — 0 ERROR / 0 WARN / 47 INFO111 [i] BACK-20260409_1449-BoldVale-fts5-full-text-search (workitems) — OK112113## skill_structure — 1 ERROR / 0 WARN / 36 INFO114 [E] skill.missing-section — context/skills/foo/bar/SKILL.md missing section: ## Gotchas115116## mcp_annotations — 0 ERROR / 0 WARN / 12 INFO117 [i] skill-gate:acknowledge_contract — annotations present118119## cross_references — 0 ERROR / 0 WARN / 14 INFO120 [i] pk-doctor → event-log — resolved121122## totals — 1 ERROR / 0 WARN / 109 INFO123```124125## Gotchas126127Agent-specific failure modes — provider-neutral pause-and-self-check items:128129- **Running release-audit as a replacement for pk-doctor.** The two tools130 complement each other. Release-audit does NOT check schema conformance,131 drift, or pending migrations. Always run both before tagging.132- **Treating cross-reference ERRORs as false positives.** The `uses:` resolver133 searches all `context/skills/<category>/<name>/SKILL.md` paths. If a skill134 truly exists but is in an unexpected location, the fix is to correct the135 `uses:` entry, not to suppress the check.136- **Fixing ERRORs by editing files directly without understanding the cause.**137 A `metadata.id` mismatch ERROR means either the file was renamed without138 updating the frontmatter, or the frontmatter was edited without renaming the139 file. The correct fix depends on which copy is canonical — check git history.140- **Running release-audit against a partial tree.** The script walks the live141 `context/` tree from the detected repo root. Running it in a worktree or142 checkout missing some files will produce false ERRORs for every absent entity143 directory. Use `--tree=src-context` when auditing only the shipped144 release deliverable.145- **Ignoring WARNs before a release.** WARNs indicate structural drift that146 does not prevent the release but will accumulate into ERRORs in future147 versions. Address all WARNs before a minor or major release.148149## Full reference150151### CLI contract152153```154release_audit.py [--repo-root=PATH] [--tree=context|src-context|both]155```156157| Flag | Meaning |158|------|---------|159| `--repo-root` | Explicit repo root path. Defaults to `git rev-parse --show-toplevel`. |160| `--tree` | `context` audits the live tree, `src-context` audits the release deliverable tree, and `both` audits both. |161162### Registered entity kinds163164| kind | directory |165|------|-----------|166| `WorkItem` | `workitems/` |167| `DecisionRecord` | `decisions/` |168| `LogEntry` | `logs/` |169| `Artifact` | `artifacts/` |170| `Actor` | `actors/` |171| `Binding` | `bindings/` |172| `Scope` | `scopes/` |173| `Gate` | `gates/` |174| `Role` | `roles/` |175| `Migration` | `migrations/` |176| `TeamMember` | `team-members/` |177| `Note` | `notes/` |178| `Discussion` | `discussions/` |179180### Required SKILL.md frontmatter fields181182- `name` (string)183- `description` (string)184- `metadata.processkit.apiVersion` (string)185- `metadata.processkit.id` (string, must start with `SKILL-`)186- `metadata.processkit.version` (string)187- `metadata.processkit.category` (string)188- `metadata.processkit.layer` (integer or null)189190### Required SKILL.md body sections191192- `## Intro`193- `## Overview`194- `## Gotchas`195- `## Full reference`196197### Required MCP tool annotation keys198199- `readOnlyHint`200- `destructiveHint`201- `idempotentHint`202- `openWorldHint`203204### Adding a check in future versions2052061. Add a new check function in `release_audit.py` following the207 `run_<name>(repo_root) -> list[Finding]` pattern.2082. Register it in `CHECKS` at the bottom of the file.2093. Add a gotcha for that check in this SKILL.md.2104. Mirror the updated script to `src/context/skills/processkit/release-audit/scripts/`.