Lesson 7 / 25
Skills with Scripts
Move deterministic work into scripts the skill calls rather than asking the model to redo it.
Code for exactness, model for judgment
Models are good at judgment and wording but can make small mistakes in arithmetic, formatting and file handling. Put those deterministic steps in a script inside the skill folder and have the instructions say "run this script". The result is repeatable and cheaper.
A skill folder with a script
The instructions call scripts/changelog.py instead of asking the model to sort and format commits by hand.
release-notes/
├── SKILL.md
├── scripts/
│ └── changelog.py # groups commits, prints Markdown
└── templates/
└── notes.mdTreat scripts as code
Skill scripts run with your permissions. Review them like any dependency, and never install skills from sources you do not trust.
Quick check: Which task is best moved into a script?
- Deciding the tone of an apology
- Exact sorting and formatting of a list
- Choosing a project name
- Judging if code is elegant
Answer
Exact sorting and formatting of a list — Deterministic, exact work belongs in code; judgment stays with the model.