# Skills with Scripts — Advanced Agent Workflows and Skills

Source: https://www.geekswithgeeks.com/en/agent-workflows/skills-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.

```text
release-notes/
├── SKILL.md
├── scripts/
│   └── changelog.py     # groups commits, prints Markdown
└── templates/
    └── notes.md
```

## Treat scripts as code

Skill scripts run with your permissions. Review them like any dependency, and never install skills from sources you do not trust.

**Quiz:** Which task is best moved into a script?

- [ ] Deciding the tone of an apology
- [x] 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.
