Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cristoslc avatar

Skills Engineering

  • 5 installs
  • Updated June 13, 2026
  • cristoslc/skills-engineering-skill

Author, evaluate, and iteratively improve Agent Skills using a nine-phase TDD/BDD lifecycle covering spec, behavioral contracts, script tests, adversarial testing, and eval.

About

Guides an agent through authoring, evaluating, and improving SKILL.md-based Agent Skills using a rigorous nine-phase TDD lifecycle with behavioral contracts and subagent-driven grading. A developer uses it when creating a new skill, evaluating an existing one, or improving a skill from eval feedback.

  • Nine-phase TDD/BDD lifecycle from spec through refactor
  • Adversarial boundary testing and subagent-driven eval grading

Skills Engineering by the numbers

  • 5 all-time installs (skills.sh)
  • Ranked #568 of 782 Skill Development skills by installs in the Skillselion catalog
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cristoslc/skills-engineering-skill --skill skills-engineering

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs5
Last updatedJune 13, 2026
Repositorycristoslc/skills-engineering-skill

What it does

Author, evaluate, and iteratively improve Agent Skills using a nine-phase TDD/BDD lifecycle covering spec, behavioral contracts, script tests, adversarial testing, and eval.

Files

SKILL.mdMarkdownGitHub ↗

Skills Engineering

This skill teaches an agent how to author, evaluate, and iteratively improve Agent Skills. It follows a rigorous TDD lifecycle with nine phases. Each phase has one job. Each phase's output feeds the next phase's red state.

Do not reference this file for phase instructions. Call scripts/generate.sh — the script output is the guidance.

Phase routing

#PhaseTDD stateJob
1specDeclare intent, boundaries, and script contracts in spec.md
2behavioralRedWrite BDD contracts: Given X, When skill activates, Then agent does Y
3script-testRedWrite acceptance tests for every script before the scripts exist
4scriptGreenWrite scripts AC-by-AC until tests pass
5skillGreenWrite SKILL.md + references to pass behavioral tests
6adversaryRedWrite boundary attacks now that the skill's surface is known
7evalAssertFull run: script tests → behavioral → adversarial. Grade and aggregate.
8improveFix failures from eval, loop back to eval
9refactorClean up internal structure without changing behavior (optional)

How to invoke

bash skills/skills-engineering/scripts/generate.sh \
  --phase <spec|behavioral|script-test|script|skill|adversary|eval|improve|refactor> \
  --skill-path .agents/skills/<skill-name>

The script emits a targeted prompt and the next phase name. Follow its output — it handles tier detection, test set selection, and phase sequencing. The LLM never sees cross-phase content.

Skill directory layout

<skill-name>/
├── SKILL.md                     # Required: YAML frontmatter + instructions
├── spec.md                      # Lightweight intent + script contracts
├── references/                  # Documentation loaded on demand
├── scripts/                     # Executable code (Bash, Python)
├── assets/                      # Templates, images, data files
└── tests/
    ├── behavioral-tests.json    # BDD: Given/When/Then behavioral contracts
    ├── adversarial-tests.json   # Boundary attacks
    ├── smoke-tests.json         # Fast subset for trivial changes
    └── test-<script>.sh         # Acceptance tests for each script

Progressive disclosure in skill design

1. Metadata (name + description) — loaded at startup. Teaches the agent when to use the skill. 2. SKILL.md body — loaded on activation. Route to references for detail, don't embed everything. 3. References — loaded on demand. Encyclopedic knowledge, schemas, detailed procedures.

Complexity tiers

The phase router detects change scope and selects the appropriate test level:

TierTriggerTests
SmokeTypo, wording change, single-line non-structural editsmoke-tests.json
BehavioralAdding references, modifying workflows, changing phase instructionsbehavioral-tests.json
FullRouting table changes, phase additions/removals, spec.md changes, structural reworkbehavioral-tests.json + adversarial-tests.json

Key design principles

  • Every script gets TDD. Write acceptance tests first (script-test phase), then implement AC-by-AC (script phase). Scripts are code — same discipline as .py or .sh.
  • Adversarial tests come after the skill exists. You can't write effective boundary attacks against a skill you haven't read. The adversary phase studies the concrete skill and crafts targeted attacks.
  • The context window is the API. Phase isolation protects context. Authoring never sees eval criteria. Eval never sees authoring instructions.
  • Skills are code. Skill files are markdown syntax. Non-trivial edits require worktree isolation.
  • Description is the trigger. The description field is the primary discovery mechanism. Write it to describe both what the skill does and when to use it.
  • Behavioral expectations live in the skill, not in agent memory. When a user gives feedback about how a skill should behave (output format, required sections, mandatory steps, prohibitions), that requirement MUST be encoded in SKILL.md, a referenced file, or a script/template inside the skill directory. NEVER store it as agent memory — memory is invisible to other consumers of the skill (other users, other sessions, CI runs). If you find yourself reaching for the memory tool to record a skill's required behavior, stop and update the skill instead. Memory is for cross-skill, cross-project preferences about how the operator wants to collaborate; skills carry their own behavioral contracts.
  • Shaped outputs get a Jinja2 template. When a skill produces structured/formatted output (summaries, reports, documents, serialized data), place a Jinja2 template in assets/ that declaratively defines the output shape — variable slots ({{ var }}), conditionals ({% if %}), and loops ({% for %}). Agents default to manually writing output that follows the template, without requiring a full data-collection-and-render pipeline.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.