Imported from wyattowalsh/wild-web-wrap-up (
scripts/AGENTS.md). Install upstream withnpx skills add wyattowalsh/wild-web-wrap-up --skill scripts. Copyright stays with the author.
Scripts Agent Instructions
These instructions apply to scripts/.
Script Style
- Use Node ESM
.mjsscripts. - Keep scripts deterministic and repo-local.
- Use structured parsers and schemas instead of ad hoc string parsing when practical.
- Keep filesystem writes scoped to known output directories and guard cleanup paths against escaping those directories.
Content And Buttondown Scripts
scripts/lib/issues.mjsis the shared issue parser for scripts.scripts/validate-content.mjsvalidates issue frontmatter, template tokens, snippet frontmatter, contrast, catalog drift, email-safe HTML restrictions, and the Buttondown snippet microsurface contract for outer presentation tables, image alt text, meaningful text size, button tap targets, and gradient fallbacks.scripts/build-buttondown.mjsgenerates Buttondown email and snippet output. It treatsbuttondown/emails/*.mdandbuttondown/snippets/*.mdas fully managed generated output.scripts/run-buttondown.mjswraps the local Buttondown CLI and forces failure on known error output that the CLI may otherwise exit with as success.scripts/sync-buttondown-api.mjssyncs generated emails and snippets through Buttondown's API because the installed CLI push path currently sends full frontmatter files instead of parsed bodies.scripts/verify-buttondown-api.mjsreads Buttondown's API after sync and verifies managed generated email/snippet payloads against the live platform without printing secrets or content bodies.
Verification
- After changing scripts, run the narrow affected script first.
- Then run
pnpm run content:validate,pnpm run content:buttondown,pnpm run lint,pnpm run typecheck, andpnpm run buildwhen behavior could affect generated output or the app.
