Agent skill

TDD Enforce

by jmagly in jmagly/aiwg

Configure TDD enforcement via pre-commit hooks and CI coverage gates.

MITAuto-check passedTesting & QA

Install TDD Enforce

skills CLI
$ npx skills add jmagly/aiwg --skill tdd-enforce -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jmagly/aiwg tdd-enforce --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jmagly/aiwg.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agentic/code/addons/testing-quality/skills/tdd-enforce .claude/skills/tdd-enforce && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tdd-enforce
GitHub stars
220
Token cost
~2.1k tokens
SKILL.md length
442 words
Files
2 (incl. scripts)
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Configure TDD enforcement via pre-commit hooks and CI coverage gates.

  • Works in 7 steps: Detect Project Type → Install Pre-commit Hooks → Configure CI Coverage Gates → …
  • Setting up test-first workflows
  • SKILL.md covers Purpose, Research Foundation, When This Skill Applies and Trigger Phrases, plus 8 more sections
  • Runs Python scripts from its folder; calls python, npm and npx

What it does

TDD Enforce is an agent skill from jmagly/aiwg. Configure TDD enforcement via pre-commit hooks and CI coverage gates. Use when setting up test-first workflows or adding coverage gates.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/tdd_setup.py`).

It sits in Testing & QA, covering Test-driven development. The repository describes itself as: Cognitive architecture for AI-augmented software development. Specialized agents, structured workflows, and multi-platform deployment. Claude Code · Codex · Copilot · Cursor ·… The licence is MIT.

When your agent uses it

  • Setting up test-first workflows
  • Adding coverage gates

Example prompts

  • “/tdd-enforce”

Requirements

  • Python 3
  • Node.js

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Detect Project Type
  2. Install Pre-commit Hooks
  3. Configure CI Coverage Gates
  4. Configure Test Presence Validation
  5. Audit Mode (Week 1-2)
  6. New Code Only (Week 3-4)
  7. Full Enforcement (Week 5+)

What it can do on your machine

Read from SKILL.md and the folder at commit dda238f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • npm
    • npx
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • testing.googleblog.com
    • typicode.github.io
    • pre-commit.com
    • istqb.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

TDD Enforce loads about 2.1k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 442 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jmagly/aiwg at commit dda238f, republished under its MIT licence (© jmagly). 442 words, ~2,138 tokens.

Download SKILL.mdSave it as .claude/skills/tdd-enforce/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
tdd-enforce
description
Configure TDD enforcement via pre-commit hooks and CI coverage gates. Use when setting up test-first workflows or adding coverage gates.
namespace
aiwg
version
1.0.0
platforms
all
<!-- AIWG-SKILL-CALLOUT -->

Skill access pattern (post-kernel-pivot, 2026.5+)

Skill names referenced in this document are AIWG skills, not slash commands. Most are not kernel-listed and cannot be invoked as /skill-name by the platform. Reach them via:

bash
aiwg discover "<capability>"
aiwg show skill <name>

Only kernel-listed skills (aiwg-doctor, aiwg-refresh, aiwg-status, aiwg-help, use, steward) are directly invokable as slash commands. See skill-discovery rule.

TDD Enforce Skill

Purpose

Configure Test-Driven Development enforcement through pre-commit hooks, CI coverage gates, and automated test execution. Ensures code cannot be committed or merged without adequate test coverage.

Research Foundation

PrincipleSourceReference
TDD MethodologyKent Beck (2002)"Test-Driven Development by Example"
80% CoverageGoogle Testing Blog (2010)Code Coverage Goal
Pre-commit HooksIndustry Best PracticeHusky, pre-commit
CI GatesISTQB CT-TASTest Automation Strategy

When This Skill Applies

  • User asks to "set up TDD" or "enforce test-first"
  • User wants to "add coverage gates" or "block commits without tests"
  • User mentions "pre-commit hooks for tests" or "CI test gates"
  • Project needs test quality enforcement
  • Brownfield project needs TDD adoption

Trigger Phrases

Natural LanguageAction
"Set up TDD enforcement"Configure pre-commit + CI gates
"Add coverage gates"Configure CI coverage thresholds
"Block commits without tests"Set up pre-commit test hooks
"Enforce test-first development"Full TDD setup
"Run tests on commit"Configure pre-commit test execution
"Check if tests exist for new code"Configure test presence validation

Configuration Options

Coverage Thresholds
yaml
coverage:
  line: 80        # Google standard: 80% minimum
  branch: 75      # Branch coverage threshold
  function: 90    # Function coverage threshold
  critical_paths: 100  # Auth, payments, validation
Enforcement Levels
LevelPre-commitCI GateDescription
strictBlockFailNo exceptions, 100% enforcement
standardWarn + BlockFailStandard TDD enforcement
gradualWarnWarnFor TDD adoption in brownfield
auditLog onlyReportVisibility without blocking

Implementation Process

Show full SKILL.md (177 more words)Show less
1. Detect Project Type
python
def detect_project():
    """Identify project language and tooling"""
    if exists("package.json"):
        return "javascript"  # Use Husky
    elif exists("pyproject.toml") or exists("setup.py"):
        return "python"      # Use pre-commit
    elif exists("pom.xml") or exists("build.gradle"):
        return "java"        # Use maven/gradle hooks
    # ... etc
2. Install Pre-commit Hooks

JavaScript (Husky + lint-staged):

bash
npm install --save-dev husky lint-staged
npx husky init

.husky/pre-commit:

bash
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# Run tests for staged files
npx lint-staged

# Check coverage delta
npm run test:coverage -- --changedSince=HEAD~1

Python (pre-commit):

bash
pip install pre-commit
pre-commit install

.pre-commit-config.yaml:

yaml
repos:
  - repo: local
    hooks:
      - id: pytest-check
        name: pytest-check
        entry: pytest --cov=src --cov-fail-under=80
        language: system
        types: [python]
        pass_filenames: false
3. Configure CI Coverage Gates

GitHub Actions:

yaml
name: Test Coverage Gate
on: [pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run tests with coverage
        run: npm test -- --coverage

      - name: Check coverage threshold
        run: |
          COVERAGE=$(jq '.total.lines.pct' coverage/coverage-summary.json)
          if (( $(echo "$COVERAGE < 80" | bc -l) )); then
            echo "Coverage $COVERAGE% is below 80% threshold"
            exit 1
          fi

      - name: Comment coverage on PR
        uses: actions/github-script@v7
        with:
          script: |
            const coverage = require('./coverage/coverage-summary.json');
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: `## Coverage Report\n- Lines: ${coverage.total.lines.pct}%\n- Branches: ${coverage.total.branches.pct}%`
            });
4. Configure Test Presence Validation

Check that new/modified files have corresponding tests:

python
def validate_test_presence(changed_files):
    """Ensure every source file has a test file"""
    missing_tests = []

    for src_file in changed_files:
        if is_source_file(src_file):
            test_file = get_test_file_path(src_file)
            if not exists(test_file):
                missing_tests.append(src_file)

    if missing_tests:
        print("ERROR: Missing tests for:")
        for f in missing_tests:
            print(f"  - {f}")
        return False
    return True

Output Format

When reporting TDD enforcement setup:

markdown
## TDD Enforcement Configured

### Pre-commit Hooks
- [x] Husky installed and initialized
- [x] Pre-commit hook: Run affected tests
- [x] Pre-commit hook: Check test presence for new files

### Coverage Gates
- Line coverage threshold: 80%
- Branch coverage threshold: 75%
- Critical path coverage: 100%

### CI Integration
- [x] GitHub Actions workflow created
- [x] Coverage gate: Fail PR if coverage < 80%
- [x] PR comment: Coverage report

### Files Created/Modified
- `.husky/pre-commit`
- `.github/workflows/test-coverage.yml`
- `package.json` (scripts updated)

### Next Steps
1. Run `npm test` to verify baseline coverage
2. Commit and push to test CI gates
3. Review coverage report on first PR

Gradual Adoption for Brownfield

For existing projects without tests:

Phase 1: Audit Mode (Week 1-2)
yaml
enforcement: audit
# Log coverage but don't block
# Establish baseline
Phase 2: New Code Only (Week 3-4)
yaml
enforcement: gradual
coverage_delta: true  # Only check new code
threshold: 80
Phase 3: Full Enforcement (Week 5+)
yaml
enforcement: standard
threshold: 80
block_on_decrease: true

Integration Points

  • Works with setup-tdd command
  • Integrates with mutation-test skill for quality validation
  • Feeds into flow-gate-check for phase transitions
  • Reports to Test Architect agent
  • mutation-test - Validate test quality beyond coverage
  • flaky-detect - Identify unreliable tests
  • generate-factory - Create test data infrastructure
  • test-sync - Maintain test-code alignment

Script Reference

tdd_setup.py

Configure TDD enforcement for project:

bash
# Standard enforcement (80% line, 75% branch)
python scripts/tdd_setup.py --level standard

# Custom thresholds
python scripts/tdd_setup.py --threshold 90 --branch-threshold 85

# Gradual adoption for brownfield projects
python scripts/tdd_setup.py --level gradual

# Preview without making changes
python scripts/tdd_setup.py --dry-run

Options:

  • --level: Enforcement level (strict, standard, gradual, audit)
  • --threshold: Line coverage threshold (default: 80)
  • --branch-threshold: Branch coverage threshold (default: 75)
  • --dry-run: Show what would be done without making changes

References

  • @$AIWG_ROOT/agentic/code/addons/testing-quality/README.md — Testing quality addon overview
  • @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/README.md — SDLC framework context for quality gates and phase transitions
  • @$AIWG_ROOT/agentic/code/addons/aiwg-utils/rules/vague-discretion.md — Measurable enforcement thresholds
  • @$AIWG_ROOT/docs/cli-reference.md — CLI reference for setup-tdd command

© jmagly, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in agentic/code/addons/testing-quality/skills/tdd-enforce of jmagly/aiwg.

  • SKILL.md
  • scripts/tdd_setup.py

Open the folder on GitHubat commit dda238f

Compare with similar skills

TDD Enforce next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

TDD Enforce compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TDD Enforce this skilljmagly/aiwg220—~2.1kAutomated safety check: PassMIT
TDDpietheinstrengholt/rssmonster56430 repos~906Automated safety check: PassMIT
TDD WorkflowhellangleZ/burn-in-cceverywhere-ralph11211 repos~2.4kAutomated safety check: PassNone
TDDsanity-io/sanity6.4k20 repos~1kAutomated safety check: PassMIT
Test Driven Developmentfarm-fe/farm5.6k51 repos~2.5kAutomated safety check: PassMIT
Tapd Story PipelineTencentBlueKing/bk-bcs841—~2.6kAutomated safety check: PassCustom licence

Similar skills

  • TDD

    pietheinstrengholt/rssmonster

    Test-driven development. An agent skill from pietheinstrengholt/rssmonster.

    564 GitHub starsUsed in 30 repos~906 tokens
    Testing & QAAuto-check passed
  • TDD Workflow

    hellangleZ/burn-in-cceverywhere-ralph

    A skill your agent uses when writing new features, fixing bugs, or refactoring code.

    112 GitHub starsUsed in 11 repos~2.4k tokens
    Testing & QAAuto-check passed
  • TDD

    sanity-io/sanity

    Official

    Test-driven development with red-green-refactor loop. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 20 repos~1k tokens
    Testing & QAAuto-check passed
  • A skill your agent uses when implementing any feature or bugfix, before writing implementation code

    5.6k GitHub starsUsed in 51 repos~2.5k tokens
    Testing & QAAuto-check passed
  • Tapd Story Pipeline

    TencentBlueKing/bk-bcs

    单需求实现流水线——把一个 TAPD 需求从零推进到代码提交。自动串联技术澄清、 开发计划、任务拆分、TDD 实现、架构/安全校验、代码提交六个阶段。

    841 GitHub stars~2.6k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Absolute Init

    maddhruv/absolute

    One-time setup for absolute: interview how you want it to behave (output style, autonomy, TDD strictness, spec dir, families) + detect the stack once, then write .absolute.config.json (project…

    218 GitHub starsUsed in 1 repo~3k tokens
    Testing & QAAuto-check passed

More from jmagly/aiwg

All 11 skills in this repo
  • Review editorial phrase patterns and suggest contextual alternatives; legacy name does not imply authorship detection.

    220 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Voice Apply

    jmagly/aiwg

    Apply a voice profile to transform content. An agent skill from jmagly/aiwg.

    220 GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Mutation Test

    jmagly/aiwg

    Run mutation testing to validate test quality beyond code coverage.

    220 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Detect project type, AIWG framework state, team configuration, and active work to summarize status and recommend next actions

    220 GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Manage artifact metadata, versioning, ownership, and review history across the SDLC lifecycle

    220 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Banned API Audit

    jmagly/aiwg

    Scan source code for banned APIs/forbidden functions per project banlist; report violations with paths, line numbers, and recommended replacements

    220 GitHub stars~2.2k tokensUpdated today
    Auto-check passed

Categories

Questions about TDD Enforce

What does TDD Enforce do?

Configure TDD enforcement via pre-commit hooks and CI coverage gates. TDD Enforce is an agent skill from jmagly/aiwg. Configure TDD enforcement via pre-commit hooks and CI coverage gates.

When should I use TDD Enforce?

TDD Enforce fits situations like: setting up test-first workflows; adding coverage gates.

How do I install TDD Enforce in Claude Code?

Run `npx skills add jmagly/aiwg --skill tdd-enforce -a claude-code`. Or copy the skill folder (agentic/code/addons/testing-quality/skills/tdd-enforce in jmagly/aiwg) into .claude/skills/tdd-enforce in your project. Claude Code loads it when a task matches its description.

How do I install TDD Enforce in Codex?

Run `npx skills add jmagly/aiwg --skill tdd-enforce -a codex`. Or copy the skill folder (agentic/code/addons/testing-quality/skills/tdd-enforce in jmagly/aiwg) into .agents/skills/tdd-enforce in your project. Codex loads it when a task matches its description.

Can I use TDD Enforce in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jmagly/aiwg --skill tdd-enforce -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tdd-enforce, .gemini/skills/tdd-enforce, .github/skills/tdd-enforce and .opencode/skills/tdd-enforce in your project.

What does TDD Enforce need to run?

Going by SKILL.md and its folder, TDD Enforce needs Python for the scripts in its folder and the command-line tools its instructions call (python, npm, npx and pip). Our summary lists: Python 3; Node.js.

Does TDD Enforce access the network?

SKILL.md names 4 domains. As links in the text: testing.googleblog.com, typicode.github.io, pre-commit.com and istqb.org. This is read from the text; nothing was executed.

Is TDD Enforce safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does TDD Enforce use?

TDD Enforce is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does TDD Enforce use?

About 2.1k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to TDD Enforce?

Skills that share tags, products or a category with TDD Enforce: TDD (pietheinstrengholt/rssmonster, 564 stars), TDD Workflow (hellangleZ/burn-in-cceverywhere-ralph, 112 stars), TDD (sanity-io/sanity, 6.4k stars) and Test Driven Development (farm-fe/farm, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains TDD Enforce?

jmagly (a GitHub user) maintains it in jmagly/aiwg, which has 220 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 8, 2026.

Source: jmagly/aiwg on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.