{
  "id": 4420805,
  "title": "Build a Tested Agent Skill with SKILL.md and Python Scripts",
  "url": "https://urgent.news/2026/08/30/build-a-tested-agent-skill-with-skill-md-and-python-scripts",
  "topic": "ai",
  "section": "AI",
  "published": "2026-08-30T12:34:17.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/paladini/build-a-tested-agent-skill-with-skillmd-and-python-scripts-3777"
  },
  "original_language": "en",
  "account": "Creating a Validated Agent Skill with SKILL.md and Python Scripts\n\nArtificial intelligence excels at understanding intentions, yet ambiguous instructions risk misinterpretation. The open-source how-to-create-a-skill-tutorial demonstrates a practical approach: rely on the agent to make judgments while employing small local scripts to enforce repeatable rules. This tutorial constructs the most basic version of that pattern: a commit-crafter skill comprising a SKILL.md file, a Python validator, and tests utilizing Python's standard library. TL;DR An Agent Skill is a directory containing at least a SKILL.md file, where workflows and safety boundaries reside in the former, and exact validation occurs in the latter. The finished repository includes a skill that verifies Conventional Commit messages. This structure can be replicated for release notes, configuration generation, research reports, or any workflow with rules amenable to mechanical verification.\n\nPrerequisites:\n- Python 3.12 or newer for the repository's CI example\n- Git for inspecting staged changes\n- An agent compatible with the Agent Skills directory convention\n- A shell, designed using POSIX syntax with files adaptable for Windows\n- No stable release tag at the time of writing, with examples checked against the current main branch\n\nSkill Directory Structure:\n1. Create the skill directory with two scopes:\n- A personal skill in the user skills directory\n- A project skill within the repository for team review and installation\n2. Required directory layout:\n- commit-crafter/\n- SKILL.md\n- scripts/\n- check_message.py\n- references/\n- conventional-commits.md\n- examples.md\nOnly SKILL.md is mandatory, with scripts/, references/, and assets/ directories acting as templates for executable code, documentation, and reusable resources.\n\nWriting the Agent-Facing Contract:\n1. The frontmatter serves as the discovery contract, matching the directory name in lowercase letters, numbers, and hyphens.\n2. The description should elucidate the capability and the user vocabulary triggering it.\n3. The skill validates Conventional Commit messages, with two key boundaries:\n- The skill may inspect staged work but cannot stage files\n- Drafting a message and executing git commit are separate actions\n\nScripting Exact Rules:\n1. The tutorial's design principle is: let the model decide, let the script verify, and let the script calculate.\n2. The example validator exposes a validate(message) function and a CLI, using only the standard library for a package-free validation path.\n3. Validation checks include subject line format, length, blank-line separator, and breaking-change footers.\n4. The script returns deterministic violations, aiding the agent in providing useful next actions.\n\nTesting Before Installation:\n1. The repository includes unit tests for the validator, covering valid messages, malformed subjects, missing blank lines, breaking changes, warnings, and CLI exit codes.\n2. Run the tests with `python examples/commit-crafter/tests/test_check_message.py -v`, ensuring all 16 tests pass on the current main checkout.",
  "summary": "AI agents are good at interpreting goals, but prose instructions are a weak place to enforce exact rules. If a skill says \"keep the commit subject short\" or \"never commit without approval,\" an agent can still misunderstand the boundary. The open-source how-to-create-a-skill-tutorial shows a practical split: let the agent make judgments, and let small local scripts validate repeatable rules. This…",
  "key_points": [
    "SKILL.md file defines agent skill's contract and validation boundaries",
    "Python validator enforces Conventional Commit message rules",
    "Repository includes unit tests for validator's accuracy"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}