blueprint-derive-tests
БесплатноЗапускает вложенные скриптыНе проверенDerive test regression plans from git history by finding commits lacking tests. Use when finding untested bug fixes, coverage gaps, or generating a test…
от laurigates★ 61 звезда на GitHubОб этом скилле
/blueprint:derive-tests
Analyze git history to identify fix and feature commits lacking corresponding test changes, then generate a structured Test Regression Plan (TRP) document as a prioritized test backlog.
Use case: Systematically close test coverage gaps by mining commit history for bug fixes and features that shipped without regression tests.
When to Use This Skill
| Use this skill when... | Use alternative when... |
|---|---|
| Bug fixes ship without regression tests | You need to run existing tests (/test:run) |
| Want a prioritized test backlog from history | Writing tests for a specific feature (manual TDD) |
| Onboarding a project and assessing test health | Checking current test coverage metrics |
| Need to find which fixes lack test coverage | Designing a test strategy from scratch (/test:consult) |
Context
- Git repository: !
git rev-parse --git-dir - Blueprint initialized: !
find . -path '*/docs/blueprint/*' -maxdepth 3 -name 'manifest.json' -type f - Total commits: !
git rev-list --count HEAD - Test framework: !
find . -maxdepth 3 \( -name 'vitest.config.*' -o -name 'jest.config.*' -o -name 'pytest.ini' -o -name 'pyproject.toml' -o -name 'Cargo.toml' -o -name 'go.mod' \) -type f -print -quit - Test files: !
find . -maxdepth 4 -type f \( -name '*.test.*' -o -name '*.spec.*' -o -name 'test_*' -o -name '*_test.*' \) -print - Conventional commits sample: !
git log --format="%s" --max-count=10
Parameters
Parse these from $ARGUMENTS:
--quick: Fast scan (last 50 commits only)--since DATE: Analyze commits from specific date (e.g.,--since 2024-06-01)--scope AREA: Filter to commits touching a specific area/scope (e.g.,--scope auth)
Default behavior without flags: Analyze last 200 commits.
For detailed templates, severity matrix, and test mapping rules, see REFERENCE.md.
Execution
Execute this test regression plan derivation workflow:
Step 1: Verify prerequisites
Check the values in Context:
- If git repository is empty → Error: "This directory is not a git repository. Run from project root."
- If total commits = "0" → Error: "Repository has no commit history."
- If Blueprint initialized is empty → Ask user: "Blueprint not initialized. Initialize now (Recommended) or continue without manifest tracking?"
- If "Initialize now" → Use Task tool to invoke
/blueprint:init, then continue - If "Continue without" → Skip manifest updates in Step 7
- If "Initialize now" → Use Task tool to invoke
Step 2: Determine analysis scope
Parse $ARGUMENTS for --quick, --since, and --scope:
- If
--quick→ scope = last 50 commits - If
--since DATE→ scope = commits from DATE to now - If
--scope AREA→ filter commits to those with scope matching AREA or touching files in AREA directory - Otherwise → scope = last 200 commits
Store scope parameters for git log commands in subsequent steps.
Step 3: Detect test infrastructure
Scan for test framework and conventions:
- Identify test framework from context (vitest, jest, pytest, cargo test, go test)
- Detect test file naming convention:
*.test.ts,*.spec.ts(JS/TS)test_*.py,*_test.py(Python)*_test.rs,tests/directory (Rust)*_test.go(Go)
- Map source directories to test directories (e.g.,
src/→tests/,src/→src/__tests__/) - Record framework, naming pattern, and directory mapping for Step 5
If no test framework detected → Warn user, continue with file-based detection only.
Step 4: Classify commits and detect coverage gaps
Run the helper. It owns the deterministic core: classifying fix:/feat:
commits from git log, detecting whether each commit carried an inline
test-file change (git show --name-only), and assigning a severity via the
fixed matrix (fix: + no inline test → CRITICAL; feat: + no inline test →
MEDIUM; any commit shipping a test → COVERED). Pass --limit to cap the scan
(default 200; pass --limit 50 for --quick):
bash "${CLAUDE_SKILL_DIR}/scripts/blueprint-derive-tests.sh" --home-dir "$HOME"
Parse STATUS= and ISSUES: from the output. FIX_COMMITS/FEAT_COMMITS are
the classification counts; GAPS_CRITICAL/GAPS_MEDIUM/GAPS_TOTAL are the
coverage gaps; each coverage_gap issue carries SHA=, TYPE=, SEVERITY=,
and SUBJECT= for the TRP table. STATUS=ERROR means at least one CRITICAL
(untested fix) gap.
The script's inline-test detection and base severity (CRITICAL/MEDIUM) are the
deterministic floor. When you need the finer High/Low tiers, nearby-test-commit
softening, or the per-language source-to-test mapping, apply the modifiers from
REFERENCE.md and the mapping rules in
REFERENCE.md. For --since/--scope
filtering, narrow the git scope with the commands in
REFERENCE.md before reading the gap set.
Step
Установить blueprint-derive-tests в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteGlobGrepBash(bash ${CLAUDE_SKILL_DIR}/scripts/blueprint-derive-tests.sh *)Bash(bash ${CLAUDE_SKILL_DIR}/../../scripts/blueprint-next-id.sh *)Bash(git rev-parse *)Bash(git rev-list *)Bash(git log *)Bash(git diff-tree *)Bash(find *)Bash(grep *)Bash(sed *)Bash(basename *)Bash(mkdir *)Bash(jq *)Bash(date *)Bash(mv *)AskUserQuestionTaskВложенные файлы
FAQ
Что делает скилл blueprint-derive-tests?
Derive test regression plans from git history by finding commits lacking tests. Use when finding untested bug fixes, coverage gaps, or generating a test backlog.
Как установить скилл blueprint-derive-tests?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл blueprint-derive-tests запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic