Bundle scripts, references, and assets
Decide when a script beats prose
Bundle deterministic logic when repeated agent improvisation creates inconsistency, wasted work, or avoidable risk.
10 minute lesson
Do not add a script because skills have a scripts/ folder. Add one when execution traces show the agent rebuilding the same deterministic step.
Good script candidates parse a known format, validate a structured output, compute a result, or perform a repeatable conversion. The release-readiness skill does not need a script to run Git or tests; the agent and project tooling already know how. It can benefit from a validator that checks whether the final report contains every required section and a valid decision.
Prose remains better for judgment. A script cannot decide whether a warning blocks this particular release unless you encode product policy. Keep that judgment visible in the instructions and report.
Before adding code, compare three options:
- Can one precise instruction solve the problem?
- Does the repository already provide the command?
- Would a bundled script produce a more consistent, testable result?
Choose the smallest option that works.
Review two trial runs of your skill. Mark every place the agent writes temporary parsing or validation logic. If the same logic appears twice, design one script. If the runs differ because the task genuinely differs, keep the flexibility.
For the project, choose scripts/validate-report.mjs. Its only job is to check the report structure. It must never infer GO from the presence of headings.
Lesson completed