Agent Skills › antiwork/gumroad › test-confidence

test-confidence

GitHub

基于代码差异,由AI分析风险并动态规划测试执行策略。自动跳过已知失败,智能判断回归与预存缺陷,提供置信度里程碑,优化测试效率与覆盖率。

.agents/skills/test-confidence/SKILL.md antiwork/gumroad

Trigger Scenarios

提交前验证代码变更 需要智能筛选和执行测试用例 分析代码差异以评估测试风险

Install

npx skills add antiwork/gumroad --skill test-confidence -g -y
More Options

Non-standard path

npx skills add https://github.com/antiwork/gumroad/tree/main/.agents/skills/test-confidence -g -y

Use without installing

npx skills use antiwork/gumroad@test-confidence

指定 Agent (Claude Code)

npx skills add antiwork/gumroad --skill test-confidence -a claude-code -g -y

安装 repo 全部 skill

npx skills add antiwork/gumroad --all -g -y

预览 repo 内 skill

npx skills add antiwork/gumroad --list

SKILL.md

Frontmatter
{
    "name": "test-confidence",
    "description": "AI-driven test execution. Opus decides what to run and how confident to be, based on your diff.",
    "allowed-tools": "Bash(git *), Bash(bundle exec rspec *), Bash(cat *), Bash(find *), Bash(wc *), Bash(head *), Bash(tail *), Bash(grep *), Bash(bin\/test-confidence *)",
    "argument-hint": "--full to run to 100% | --strict to halt on pre-existing failures"
}

Test Confidence

Run bin/test-confidence to have Opus 4.7 analyze your diff, decide the risk level, plan which tests to run and in what order, and set confidence milestones. The AI decides the shape of the curve based on this specific diff.

Usage

bin/test-confidence            # Run to 99%, stop. Skips past pre-existing failures.
bin/test-confidence --full     # Run to 100%
bin/test-confidence --strict   # Halt on any failure, including pre-existing

ANTHROPIC_API_KEY is auto-sourced from .env if not exported.

If $ARGUMENTS is provided, pass it through: bin/test-confidence $ARGUMENTS

How it works

  1. Finds changed files (branch diff vs main for PR branches, local diff on main)
  2. Hashes the diff and checks tmp/test-confidence/ for a cached plan; reuses if found
  3. Otherwise sends the diff + spec tree + touched directories to Opus 4.7 in one call
  4. Opus returns a plan: risk level, ordered test list, confidence milestones
  5. Script executes the plan, showing yellow progress bar toward 99%
  6. At 99%, bar turns green. Safe to commit.
  7. With --full, continues running remaining tests toward 100%

Pre-existing failure detection

When a spec fails, the script applies a two-step check:

  1. Path heuristic — does the failing spec file or its source counterpart (e.g., app/models/user.rb for spec/models/user_spec.rb) appear in the diff?
    • In the diff → real regression. Halt immediately.
    • Not in the diff → suspect pre-existing. Verify on merge-base.
  2. Merge-base verify — re-run the failing rspec examples in a temporary worktree at the branch's merge-base with main.
    • Still fails on merge-base → confirmed pre-existing. Continue.
    • Passes on merge-base → cross-file regression caught. Halt.

The verify step is skipped (heuristic verdict trusted) when the diff includes a db/migrate/*.rb (DB schema drift) or Gemfile.lock (bundler drift), or when no merge-base is available. --strict skips both checks and halts on every failure.

Cost profile: zero overhead in the common no-failure case; verify only runs on heuristic-flagged "pre-existing" failures. Catches the dangerous direction (silent regression skipped) while keeping false-alarm investigation costs bounded.

The key insight: Opus decides ad hoc how many tests are needed for each confidence level. A comment-only change might need 2 tests for 99%. A payment model refactor might need 100.

When to use

Run this before every commit. It replaces manually picking which specs to run.

$ARGUMENTS

Version History

  • 92e22de Current 2026-08-20 17:15

Same Skill Collection

.agents/skills/commit/SKILL.md
.agents/skills/create-issue/SKILL.md
.agents/skills/email-blast/SKILL.md
.agents/skills/gumroad-prod-console/SKILL.md
.agents/skills/review-pr/SKILL.md

Metadata

Files
0
Version
ebb8b3a
Hash
c4b7ce1d
Indexed
2026-08-20 17:15

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-20 07:49
浙ICP备14020137号-1