소스 정보
- 저장소
- jmagly/aiwg
- 최근 소스 활동
- 2026년 4월 30일 21:44
- 감지된 SKILL.md 언어
- 영어
- 스타
- 178
- 포크
- 26
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/jmagly/aiwg --skill setup-tdd명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| namespace | aiwg |
| name | setup-tdd |
| platforms | ["all"] |
| description | One-command TDD infrastructure setup with pre-commit hooks and CI coverage gates |
| commandHint | {"argumentHint":"[--level strict|standard|gradual|audit] [--threshold 80 --interactive --guidance \"text\"]","category":"testing"} |
Configure Test-Driven Development enforcement for the current project with a single command.
This command implements TDD enforcement based on established research:
| Principle | Source | Reference |
|---|---|---|
| TDD Methodology | Kent Beck (2002) | "Test-Driven Development by Example" |
| 80% Coverage | Google (2010) | Code Coverage Goal |
| Pre-commit Hooks | Industry Practice | Husky, pre-commit |
| CI Gates | ISTQB CT-TAS | Test Automation Strategy |
/setup-tdd [options]
| Option | Values | Default | Description |
|---|---|---|---|
--level | strict, standard, gradual, audit | standard | Enforcement strictness |
--threshold | 0-100 | 80 | Line coverage threshold |
--branch-threshold | 0-100 | 75 | Branch coverage threshold |
| Level | Pre-commit | CI Gate | Best For |
|---|---|---|---|
strict | Block | Fail | New projects, critical systems |
standard | Warn + Block | Fail | Most projects |
gradual | Warn | Warn | Brownfield TDD adoption |
audit | Log only | Report | Assessment before enforcement |
When this command is invoked, perform these steps:
For JavaScript projects:
npm install --save-dev husky lint-staged
npx husky init
Create .husky/pre-commit:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Run tests for staged files
npx lint-staged
# Check coverage threshold
npm test -- --coverage
For Python projects:
pip install pre-commit pytest-cov
pre-commit install
Create .pre-commit-config.yaml:
repos:
- repo: local
hooks:
- id: pytest-coverage
name: pytest with coverage
entry: pytest --cov=src --cov-fail-under=80
language: system
types: [python]
pass_filenames: false
Create .github/workflows/tdd-coverage-gate.yml:
name: TDD Coverage Gate
on:
pull_request:
branches: [main, master]
jobs:
test-coverage:
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 "::error::Coverage $COVERAGE% below 80% threshold"
exit 1
fi
- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
// Add coverage report as PR comment
Add script to validate new code has tests:
// scripts/check-test-presence.js
const changedFiles = getChangedFiles();
const srcFiles = changedFiles.filter(f => f.startsWith('src/'));
for (const src of srcFiles) {
const testFile = src.replace('src/', 'test/').replace('.ts', '.test.ts');
if (!fs.existsSync(testFile)) {
console.error(`Missing test: ${testFile}`);
process.exit(1);
}
}
Create docs/TDD_WORKFLOW.md:
# TDD Workflow
This project enforces Test-Driven Development.
## The TDD Cycle
1. **Red**: Write a failing test
2. **Green**: Write minimum code to pass
3. **Refactor**: Clean up while keeping tests green
## Coverage Requirements
- Line coverage: ≥80%
- Branch coverage: ≥75%
- Critical paths: 100%
## Pre-commit Checks
Every commit runs:
- Tests for staged files
- Coverage threshold validation
## CI Gates
Every PR requires:
- All tests passing
- Coverage ≥ threshold
- No coverage decrease
Report setup results:
## TDD Enforcement Configured
**Project**: [project-name]
**Type**: JavaScript (Vitest)
**Level**: standard
### Pre-commit Hooks
- [x] Husky installed
- [x] lint-staged configured
- [x] Coverage check on commit
### CI Gates
- [x] GitHub Actions workflow created
- [x] Coverage threshold: 80%
- [x] PR comment integration
### Files Created
- `.husky/pre-commit`
- `.github/workflows/tdd-coverage-gate.yml`
- `docs/TDD_WORKFLOW.md`
### Files Modified
- `package.json` (added scripts)
### Next Steps
1. Run `npm test` to establish baseline
2. Commit changes to enable hooks
3. Create first PR to verify CI gates
For projects without tests, use gradual adoption:
/setup-tdd --level gradual --threshold 40
This:
| Week | Threshold | Enforcement |
|---|---|---|
| 1-2 | 40% | Audit only |
| 3-4 | 50% | Warn on commit |
| 5-6 | 60% | Block on PR |
| 7-8 | 70% | Standard enforcement |
| 9+ | 80% | Full enforcement |
This command uses the tdd-enforce skill from the testing-quality addon:
@$AIWG_ROOT/agentic/code/addons/testing-quality/skills/tdd-enforce/