issue-214: Implement and run fetch-penpot-docs.mjs and commit the vendored Penpot reference #247
No reviewers
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills!247
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-214/implement-and-run-fetch-penpot-docs-mjs-and-commit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
214: Implement and run fetch-penpot-docs.mjs and commit the vendored Penpot reference
Closes #214 — 214.
Generated in 11m 36s.
Review findings
Now let me apply the fixes. First, the fetch script:I've applied the fixes and re-run the gates. Final state:
npm test→ 864 tests, 862 pass, 1 fail, 1 skip. The only failure is the pre-existingscripts/local-install.test.mjs:1875mongodb-manifest assertion (unchanged onHEAD/HEAD~1, unrelated to this diff). Thefetch-penpot-docs.test.mjssuite passes 37/37 (was 28).docs/openapi.jsonnow has every server-generatedexamplestripped and is pretty-printed (73,130 lines, trailing newline);docs/README.mdre-emitted fromrenderReadme.Review Findings — 214
Summary
Fixed all Critical/High/Medium findings and two of the three Low findings. The spec is now canonicalised before writing —
writeDocsserialisesserializeSpec(collected.spec), which recursively drops everyexamplefield (Penpot fills them with random values plus the process start time) and pretty-prints with a trailing newline — and the docstring,SKILL.mdanddocs/README.mdnow say so; the vendoreddocs/openapi.json/docs/README.mdwere regenerated with the new writers.SKILL.mdnow gives the repo-root-relative refresh command.README.mdline 7 and the layout block were updated. Stale-schema pruning is now gated to the defaultdocs/directory (custom--outis never pruned) and documented. Tests added: canonicalisation stability across differing examples, stale-cleanup pruning, custom---outsafety, plus drift guards for the committeddocs/README.md,docs/VERSIONanddocs/openapi.json. Remaining: the pre-existingscripts/local-install.test.mjs:1875failure, explicitly out of scope for this issue.Critical
High
writeDocspersistscollected.openapiTextverbatim, but the spec'sexamplepayloads come from Penpot'sbackend/src/app/rpc/doc.clj, whereopenapi-json-handlerwraps(openapi-context options)in a per-processdelayandgen-params-doc/gen-response-doccallsm/generate(random UUIDs/strings/numbers). The committed spec's examples embed the generation timestamp (2026-09-14T13:22:07Z, ~18 h before the2026-09-15T07:37Zfetch), so the doc is only stable while that process lives; after any restart the same version produces different bytes. This makes the claims atskills/penpot/SKILL.md:324(“re-running reproduces the committed bytes, exceptVERSION”) andskills/penpot/docs/README.md:12(“The only file that changes between refreshes”) and the upgrade step atskills/penpot/docs/README.md:20(“everything else should be a reviewable content diff”) misleading, and the stub-based test atskills/penpot/scripts/fetch-penpot-docs.test.mjs:342cannot detect it. Suggested fix: canonicalise the spec before writing — parse the JSON and strip/normalise (or drop and regenerate) everyexamplefield, then re-serialise — and update the docstring/SKILL.md/docs/README.mdto state that examples are server-generated; add a unit test that runswriteDocson two fixture specs with different examples and asserts identical output.Medium
node scripts/fetch-penpot-docs.mjsdoes not resolve from the repository root, unlike the neighbouring root-relative references in the same file (extensions/penpot/src/librarySpec.tsat line 304). I confirmednode scripts/fetch-penpot-docs.mjsfrom the repo root fails with MODULE_NOT_FOUND whilenode skills/penpot/scripts/fetch-penpot-docs.mjsworks. Suggested fix: write the repo-root-relative pathPENPOT_URL=<instance> node skills/penpot/scripts/fetch-penpot-docs.mjs(or explicitly say "run fromskills/penpot" if a skill-relative path is intended).skills/penpot/shipsscripts/*.mjsand a 1.4 MB generateddocs/tree; the repository-layout block at README.md:137 likewise only mentionsSKILL.md. Suggested fix: update both spots (e.g. "15 skills;penpotadditionally ships a dependency-free fetch script and the vendored reference underskills/penpot/docs/" and annotate theskills/line in the layout block).JSON.stringify(collected.spec, null, 2) + "\n") and update the reproducibility test to still compare the written bytes; combined with the High-severity normalisation this yields a reviewable, line-oriented diff.Low
unlinkSyncfor anyschema/*.cljcnot inSCHEMA_FILES) is destructive and also runs when the user passes--outpointing at an unrelated directory, potentially deleting.cljcfiles the script did not create. Suggested fix: warn in--help/docs/README.mdthat--outis treated as generated output, or only prune files that match a script-written list (e.g. track previously written names) and skip pruning whenoutDir !== DEFAULT_OUT_DIR.unlinkSync/orphaned.cljc), and nothing asserts that the committeddocs/README.mdanddocs/VERSIONstill matchrenderReadme/renderVersionFile(I checked this manually; a drift guard would catch future edits to the renderers). Suggested fix: add a test that pre-seedsschema/obsolete.cljc, runssyncDocs, and asserts it is removed; add a test comparingrenderReadme({tag: PINNED_VERSION})withskills/penpot/docs/README.md(and the VERSION lines excludingfetched_at_utc).npm testcurrently exits non-zero because this assertion requiresextensions/mongodb/index.tsinpackage.json'spi.extensions, which is absent on bothHEADandHEAD~1. Suggested fix (out of scope for this issue, but it keeps the test gate red): either addextensions/mongodb/index.tstopi.extensionsor relax the assertion; flagging so the red gate is not attributed to this change.Documentation
Updated files: