Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

tdd-enforce

БесплатноЗапускает вложенные скриптыНе проверен

Configure TDD enforcement via pre-commit hooks and CI coverage gates. Use when setting up test-first workflows or adding coverage gates.

jmaglyот jmagly★ 233 звезды на GitHub

Об этом скилле

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:

aiwg discover "<capability>"
aiwg show skill <name> --body

Only kernel-listed skills (aiwg-doctor, aiwg-refresh, aiwg-status, aiwg-help, use, aiwg-steward-routing on Claude Code) 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

Principle Source Reference
TDD Methodology Kent Beck (2002) "Test-Driven Development by Example"
80% Coverage Google Testing Blog (2010) Code Coverage Goal
Pre-commit Hooks Industry Best Practice Husky, pre-commit
CI Gates ISTQB CT-TAS Test 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 Language Action
"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

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

Level Pre-commit CI Gate Description
strict Block Fail No exceptions, 100% enforcement
standard Warn + Block Fail Standard TDD enforcement
gradual Warn Warn For TDD adoption in brownfield
audit Log only Report Visibility without blocking

Implementation Process

1. Detect Project Type

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):

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

.husky/pre-commit:

#!/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):

pip install pre-commit
pre-commit install

.pre-commit-config.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:

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}%`
            });
Полный SKILL.md на GitHub

Установить tdd-enforce в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

scripts/tdd_setup.py

FAQ

Что делает скилл tdd-enforce?

Configure TDD enforcement via pre-commit hooks and CI coverage gates. Use when setting up test-first workflows or adding coverage gates.

Как установить скилл tdd-enforce?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл tdd-enforce запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить tdd-enforce с