Description
skills/creating-plugins/references/hooks.md documents the content:beforeSave event as:
Event: `{ content: Record<string, unknown>, collection: string, isNew: boolean }`
It is missing id, which #2897 added and which shipped in 0.37.0.
The rest of the project is consistent and correct — this is only the skills/ copy drifting:
| Source |
Documents id? |
ContentHookEvent typings (dist/types-*.d.mts, 0.37.0) |
yes, with a doc comment |
| docs site — reference/hooks |
yes, full interface |
| docs site — plugins/creating-plugins/hooks |
yes |
skills/creating-plugins/references/hooks.md |
no |
#2897 updated docs/src/content/docs/plugins/creating-plugins/hooks.mdx and docs/src/content/docs/reference/hooks.mdx, but not the parallel skills/ copy. That file does appear to be maintained alongside changes like this normally — #2858, #2617, #1659 and #1658 all touched it — so this looks like an oversight rather than intent.
Why it seemed worth reporting
The skills/ files are written to be read by coding agents. An agent building a plugin from this reference will not learn that event.id exists, and will reach for a workaround to get at the stored item — which is the exact situation the changeset for #2897 gives as the reason for adding the field.
The correct text is already written; it is the sentence #2897 put in hooks.mdx:
On an update, id is the ID of the existing item and content holds only the submitted field values; load the stored item with ctx.content.get(event.collection, event.id).
One thing I could not check from outside: scripts/sync-template-skills.sh suggests these skills propagate somewhere, so it may be worth confirming nothing downstream inherited the stale copy.
Steps to reproduce
- Check out
main (verified 2026-09-10; also identical in the emdash@0.37.0 tag).
- Open
skills/creating-plugins/references/hooks.md and find the content:beforeSave section.
- Read the
Event: line — { content, collection, isNew }, no id.
- Compare against
ContentHookEvent in the published typings, or against either docs-site page above, both of which include id?: string.
Environment
- emdash version: 0.37.0 (also present on
main at time of writing)
- Node.js version: 24
- Runtime: Cloudflare Workers
- OS: macOS
Screenshots
Not applicable — this is a documentation file, not interface behaviour.
Logs / error output
Not applicable. For reference, the shipped typings this file disagrees with:
interface ContentHookEvent {
content: Record<string, unknown>;
collection: string;
isNew: boolean;
/**
* ID of the existing item on `content:beforeSave` for an update. Absent on
* creates, where the ID is assigned when the save completes, and on
* `content:afterSave`, where `content.id` carries it.
*/
id?: string;
}
Found while re-vendoring these skills for a 0.36.0 → 0.37.0 upgrade. Investigated and drafted with Claude Code (Claude Opus 5); the findings above were each verified against main and the published package before filing.
Description
skills/creating-plugins/references/hooks.mddocuments thecontent:beforeSaveevent as:It is missing
id, which #2897 added and which shipped in 0.37.0.The rest of the project is consistent and correct — this is only the
skills/copy drifting:id?ContentHookEventtypings (dist/types-*.d.mts, 0.37.0)skills/creating-plugins/references/hooks.md#2897 updated
docs/src/content/docs/plugins/creating-plugins/hooks.mdxanddocs/src/content/docs/reference/hooks.mdx, but not the parallelskills/copy. That file does appear to be maintained alongside changes like this normally — #2858, #2617, #1659 and #1658 all touched it — so this looks like an oversight rather than intent.Why it seemed worth reporting
The
skills/files are written to be read by coding agents. An agent building a plugin from this reference will not learn thatevent.idexists, and will reach for a workaround to get at the stored item — which is the exact situation the changeset for #2897 gives as the reason for adding the field.The correct text is already written; it is the sentence #2897 put in
hooks.mdx:One thing I could not check from outside:
scripts/sync-template-skills.shsuggests these skills propagate somewhere, so it may be worth confirming nothing downstream inherited the stale copy.Steps to reproduce
main(verified 2026-09-10; also identical in theemdash@0.37.0tag).skills/creating-plugins/references/hooks.mdand find thecontent:beforeSavesection.Event:line —{ content, collection, isNew }, noid.ContentHookEventin the published typings, or against either docs-site page above, both of which includeid?: string.Environment
mainat time of writing)Screenshots
Not applicable — this is a documentation file, not interface behaviour.
Logs / error output
Not applicable. For reference, the shipped typings this file disagrees with:
Found while re-vendoring these skills for a 0.36.0 → 0.37.0 upgrade. Investigated and drafted with Claude Code (Claude Opus 5); the findings above were each verified against
mainand the published package before filing.