Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

blueprint-derive-tests蓝图导出测试

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

753

周安装

32

GitHub Stars

28

下载量

264
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:blueprint-derive-tests(蓝图导出测试)
来源仓库:https://github.com/laurigates/claude-plugins
仓库路径:skills/blueprint-derive-tests
安装命令:
npx skills add https://github.com/laurigates/claude-plugins --skill blueprint-derive-tests
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/laurigates/claude-plugins --skill blueprint-derive-tests

简介

blueprint-derive-tests 用于分析 git 历史并生成测试回归计划(TRP),填补测试覆盖缺口。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。
  • 基于未测试的修复和功能提交,生成优先级的测试 backlog 文档。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

/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 testsYou need to run existing tests (/test:run)
Want a prioritized test backlog from historyWriting tests for a specific feature (manual TDD)
Onboarding a project and assessing test healthChecking current test coverage metrics
Need to find which fixes lack test coverageDesigning a test strategy from scratch (/test:architecture)

Context

  • Git repository:!git rev-parse --git-dir
  • Blueprint initialized:!find docs/blueprint -maxdepth 1 -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 context values above:

  1. If git repository is empty → Error: "This directory is not a git repository. Run from project root."
  2. If total commits = "0" → Error: "Repository has no commit history."
  3. 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

Step 2: Determine analysis scope

Parse $ARGUMENTS for --quick, --since, and --scope:

  1. If --quick → scope = last 50 commits
  2. If --since DATE → scope = commits from DATE to now
  3. If --scope AREA → filter commits to those with scope matching AREA or touching files in AREA directory
  4. 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:

  1. Identify test framework from context (vitest, jest, pytest, cargo test, go test)
  2. Detect test file naming convention:

- *.test.ts, *.spec.ts (JS/TS) - test_*.py, *_test.py (Python) - *_test.rs, tests/ directory (Rust) - *_test.go (Go)

  1. Map source directories to test directories (e.g., src/tests/, src/src/__tests__/)
  2. 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: Extract and classify commits

Extract fix and feature commits within scope:

  1. Primary targetsfix: commits (highest priority for regression tests): git log --format="%H %s" {scope} | grep -E "^[a-f0-9]+ fix(\(.*\))?:"
  2. Secondary targetsfeat: commits (should have accompanying tests): git log --format="%H %s" {scope} | grep -E "^[a-f0-9]+ feat(\(.*\))?:"
  3. Fallback — If conventional commit percentage < 20%, use keyword detection: git log --format="%H %s" {scope} | grep -iE "(fix|bug|hotfix|patch|resolve|correct)"

For each commit, record: SHA, subject, date, files changed, scope (if conventional).

Step 5: Analyze test coverage gaps

For each commit from Step 4, check for corresponding tests:

  1. Inline test changes — Did the same commit modify test files? git diff-tree --no-commit-id --name-only -r {SHA} | grep -E "(test|spec|_test\.|\.test\.)"
  2. Nearby test commits — Within 5 commits after the fix, was a test commit added? git log --format="%H %s" {SHA}..{SHA~5} | grep -iE "^[a-f0-9]+ test(\(.*\))?:|add.*test|test.*for"
  3. Test file exists — For each modified source file, does a corresponding test file exist? Use the source-to-test mapping from Step 3 (see REFERENCE.md for rules per language).

Classify each gap using the severity matrix from REFERENCE.md:

SeverityCriteria
Criticalfix: commit, no test changes, no test file exists for modified source
Highfix: commit, no inline test changes but test file exists (test not updated)
Mediumfeat: commit, no test changes, core module affected
Lowfeat: commit, no inline tests but nearby test commit exists

Step 6: Generate TRP document

  1. Create output directory: mkdir -p docs/trps
  2. Determine TRP ID:

- If manifest exists, read id_registry.last_trp, increment by 1 - Otherwise start at TRP-001

  1. Generate slug from scope or date range (e.g., regression-gaps-2024-q3)
  2. Write TRP document to docs/trps/{slug}.md using template from REFERENCE.md

Include in the document:

  • YAML frontmatter with id, status: Active, scope, date_range, commits_analyzed
  • Executive summary with gap counts by severity
  • Detailed gap table: commit SHA, subject, severity, affected files, suggested test type
  • Recommended test creation order (Critical first, then High, etc.)
  • Suggested test type per gap (see REFERENCE.md)

Step 7: Update manifest

If Blueprint is initialized:

  1. Update id_registry.last_trp with the new TRP number
  2. Register the document in id_registry.documents: {"TRP-NNN": {"path": "docs/trps/{slug}.md", "title": "{TRP title}", "status": "Active", "created": "{date}"}}
  3. Update task registry: jq --arg now "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \ --arg sha "$(git rev-parse HEAD 2>/dev/null)" \ --argjson analyzed "{commits_analyzed}" \ --argjson gaps "{gaps_found}" \ '.task_registry["derive-tests"].last_completed_at = $now |.task_registry["derive-tests"].last_result = "success" |.task_registry["derive-tests"].stats.runs_total = ((.task_registry["derive-tests"].stats.runs_total // 0) + 1) |.task_registry["derive-tests"].stats.items_processed = $analyzed |.task_registry["derive-tests"].stats.items_created = $gaps |.task_registry["derive-tests"].context.commits_analyzed_up_to = $sha' \ docs/blueprint/manifest.json > tmp.json && mv tmp.json docs/blueprint/manifest.json

Step 8: Report results and suggest next actions

Print summary:

Test Regression Plan Generated!

**Analysis Summary**
- Commits analyzed: {N} ({date_range})
- Fix commits found: {N}
- Feature commits found: {N}

**Coverage Gaps Found**
- Critical: {N} (fix commits with no tests at all)
- High: {N} (fix commits with stale test files)
- Medium: {N} (feature commits missing tests)
- Low: {N} (feature commits with nearby tests)

**Document**: docs/trps/{slug}.md (TRP-{NNN})

**Top Priority Gaps**
1. {commit subject} — {severity} — {affected file}
2. {commit subject} — {severity} — {affected file}
3. {commit subject} — {severity} — {affected file}

Prompt user for next action:

  • "Create PRPs for top-priority gaps (Recommended)" — Generate PRP documents for Critical/High gaps
  • "Review the TRP document" — Open the generated TRP for manual review
  • "Run again with different scope" — Re-run with --since or --scope
  • "Done for now" — Exit with document saved

Agentic Optimizations

ContextCommand
Fix commits only`git log --format="%H %s" \grep -E "^[a-f0-9]+ fix"`
Check test in commit`git diff-tree --no-commit-id --name-only -r {SHA} \grep -E "test\spec"`
Files changedgit diff-tree --no-commit-id --name-only -r {SHA}
Fast scanUse --quick for last 50 commits
Scope filterUse --scope auth to limit to specific area

For detailed templates, severity classification matrix, test mapping rules, and error handling, see REFERENCE.md.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.72%
按下载量换算100

Claude

29.64%
按下载量换算78

Cursor

18.75%
按下载量换算50

Gemini CLI

8.14%
按下载量换算21

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/laurigates/claude-plugins --skill blueprint-derive-tests 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills