Agent测试
- 作者仓库星标 386
- 作者更新于 实时读取
- 作者仓库 vexjoy-agent
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @notque · 未声明 license
- Token 消耗评级
- 较高消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skill-eval
description: Evaluate skills: trigger testing, A/B benchmarks, structure validation, head-to-head bake-offs.…
category: 工程开发
runtime: 无特殊运行时
---
# skill-eval 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Reference Loading Table / Instructions / Phase 1: ASSESS — Determine what to evaluate”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Reference Loading Table / Instructions / Phase 1: ASSESS — Determine what to evaluate”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“Reference Loading Table / Instructions / Phase 1: ASSESS — Determine what to evaluate”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: skill-eval
description: Evaluate skills: trigger testing, A/B benchmarks, structure validation, head-to-head bake-offs.…
category: 工程开发
source: notque/vexjoy-agent
---
# skill-eval
## 什么时候使用
- 用于组织测试、定位失败并形成修复闭环 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Reference Loading Table / Instructions / Phase 1: ASSESS — Determine what to evaluate」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "skill-eval" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Reference Loading Table / Instructions / Phase 1: ASSESS — Determine what to evaluate
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Skill Evaluation & Improvement
Measure and improve skill quality through empirical testing — because structure doesn't guarantee behavior, and measurement beats assumption. Also covers head-to-head bake-offs of two peer implementations of the same artifact (Mode F).
Reference Loading Table
| Signal | Load These Files | Why |
|---|---|---|
| tasks related to this reference | schemas.md |
Loads detailed guidance from schemas.md. |
| tasks related to this reference | self-improve-loop.md |
Loads detailed guidance from self-improve-loop.md. |
| "bake-off", "head-to-head", "compare implementations", "grade two versions", "which Feynman skill is better" | bake-off-methodology.md |
Loads the bake-off rubric, anti-rationalization gate, fold-filter, and worked Feynman example. |
Instructions
Phase 1: ASSESS — Determine what to evaluate
Step 1: Identify the skill
# Validate skill structure first
python3 -m scripts.skill_eval.quick_validate <path/to/skill>
This checks: SKILL.md exists, valid frontmatter, required fields (name, description), kebab-case naming, description under 1024 chars, no angle brackets.
Step 2: Choose evaluation mode based on user intent
| Intent | Mode | Script |
|---|---|---|
| "Test if description triggers correctly" | Trigger eval | run_eval.py |
| "Optimize/improve the description through autoresearch" | Route to agent-comparison |
optimize_loop.py |
| "Compare skill vs no-skill output" | Output benchmark | Manual + aggregate_benchmark.py |
| "Validate skill structure" | Quick validate | quick_validate.py |
| "Self-improve skill" / "optimize skill" / "improve skill with A/B" | Self-improvement loop | references/self-improve-loop.md |
| "Bake-off" / "head-to-head grade these two" / "compare X vs Y implementation" | Head-to-head bake-off | references/bake-off-methodology.md |
GATE: Skill path confirmed, mode selected.
Phase 2: EVALUATE — Run the appropriate evaluation
Mode A: Trigger Evaluation
Test whether a skill's description causes Claude to invoke it for the right queries.
Step 1: Create eval set (or use existing)
Create a JSON file with 8-20 test queries. Eval set quality matters — use realistic prompts with detail (file paths, context, casual phrasing), not abstract one-liners. Focus on edge cases where the skill competes with adjacent skills.
Example of good eval queries:
[
{"query": "ok so my boss sent me this xlsx file (Q4 sales final FINAL v2.xlsx) and she wants profit margin as a percentage", "should_trigger": true},
{"query": "Format this data", "should_trigger": false}
]
Why: Real users write detailed, specific prompts. Abstract queries don't test real triggering behavior. Overfitting descriptions to abstract test cases bloats the description and fails on real usage.
Step 2: Run evaluation
python3 -m scripts.skill_eval.run_eval \
--eval-set evals.json \
--skill-path <path/to/skill> \
--runs-per-query 3 \
--verbose
This spawns claude -p for each query, checking whether it invokes the skill. Runs each query 3 times for reliability. Output includes pass/fail per query with trigger rates. Default 30s timeout; increase with --timeout 60 if needed for complex queries.
Constraints applied:
- Always run baseline eval before making improvements
- 3 runs per query ensures statistical reliability
- Verbose output shows per-query pass/fail during eval runs
GATE: Eval results available. Proceed to improvement if failures found.
Mode B: Description Optimization
Automated loop that tests, improves, and re-tests descriptions using Claude with extended thinking.
python3 -m scripts.skill_eval.run_loop \
--eval-set evals.json \
--skill-path <path/to/skill> \
--max-iterations 5 \
--verbose
This will:
- Split eval set 60/40 train/test (stratified by should_trigger) — prevents overfitting to test cases
- Evaluate current description on all queries (3 runs each for reliability)
- Use
claude -pto propose improvements based on training failures - Re-evaluate the new description
- Repeat until all pass or max iterations reached
- Select best description by test score (not train score — prevents overfitting)
- Open an HTML report in the browser
Why 60/40 split: Improvements should help across many prompts, not just test cases. Training on failures, validating on holdout ensures generalization.
Why report HTML: Visual reports enable quick review of which queries improved, which regressed, and what the new description looks like.
GATE: Loop complete. Best description identified.
Mode C: Output Benchmark
Compare skill quality by running prompts with and without the skill.
Step 1: Create test prompts — 2-3 realistic user prompts
Step 2: Run with-skill and without-skill in parallel subagents:
For each test prompt, spawn two agents:
- With skill: Load the skill, run the prompt, save outputs
- Without skill (baseline): Same prompt, no skill, save outputs
Why baseline matters: Can't prove the skill adds value without a baseline. Maybe Claude handles it fine without the skill. The delta is what matters.
Step 3: Grade outputs
Spawn a grader subagent using agents/grader.md. It evaluates assertions against the outputs.
Step 4: Aggregate
python3 -m scripts.skill_eval.aggregate_benchmark <workspace>/iteration-1 --skill-name <name>
Produces benchmark.json and benchmark.md with pass rates, timing, and token usage.
Step 5: Analyze (optional)
For blind comparison, use agents/comparator.md to judge outputs without knowing which skill produced them. Then use agents/analyzer.md to understand why the winner won.
GATE: Benchmark results available.
Mode D: Quick Validate
python3 -m scripts.skill_eval.quick_validate <path/to/skill>
Checks: SKILL.md exists, valid frontmatter, required fields (name, description), kebab-case naming, description under 1024 chars, no angle brackets.
Mode E: Self-Improvement Loop
Automatically generate variants of a skill, A/B test them against the original, and promote winners. This is a closed-loop pipeline — baseline, hypothesize, generate, test, promote.
Read the full protocol: ${CLAUDE_SKILL_DIR}/references/self-improve-loop.md
The loop runs 5 phases: BASELINE (establish metrics with 3+ test cases), HYPOTHESIZE (2-3 single-variable changes), GENERATE VARIANTS (minimal diffs), BLIND A/B TEST (paired comparison via agents/comparator.md), PROMOTE OR KEEP (60%+ win rate required, no regressions). All outcomes — wins and losses — are recorded to the learning DB to prevent re-testing failed hypotheses.
GATE: Self-improvement protocol loaded from reference. Proceed through the 5 phases.
Mode F: Head-to-Head Bake-Off
Score two peer implementations of the same artifact (e.g., toolkit voice-feynman vs an external Feynman voice profile) on a numeric rubric and declare a decisive winner. Use when the user says "bake-off", "head-to-head", "compare implementations", "grade these two", or "which X is better".
Read the full protocol: ${CLAUDE_SKILL_DIR}/references/bake-off-methodology.md
The protocol runs 5 phases: PREPARE (read both artifacts in full, pick a verifier that built neither side), RUBRIC (define 5–12 criteria scored 0–10, pre-state the loser-of-each-criterion before reading evidence), GRADE (every score cites a path/line range or quote; build the matrix; apply anti-rationalization gate), FOLD (filter loser-wins through docs/PHILOSOPHY.md before recommending any folds into the winner), REPORT (output to tmp/<topic>-bakeoff-report.md, gitignored).
The Feynman bake-off (toolkit 86 vs external 74 across 11 criteria, 12-point margin) is the canonical worked example carried in the reference.
GATE: Bake-off protocol loaded from reference. Proceed through the 5 phases.
Phase 3: IMPROVE — Apply results
Step 1: Review results
For trigger eval / description optimization:
- Show the best description vs original
- Show per-query results (which queries improved, which regressed)
- Show train vs test scores
For output benchmark:
- Show pass rate delta (with-skill vs without-skill)
- Show timing and token cost delta
- Highlight assertions that only pass with the skill (value-add)
Step 2: Apply changes (with user confirmation)
If description optimization found a better description:
- Show before/after with scores
- Ask user to confirm
- Update the skill's SKILL.md frontmatter
- Re-run quick_validate to confirm the update is valid
Constraint: Always show results before/after with metrics. This enables informed decisions.
GATE: Changes applied and validated, or user chose to keep original.
Error Handling
Error: "No SKILL.md found"
Cause: Skill path doesn't point to a valid skill directory
Solution: Verify path contains a SKILL.md file. Skills must follow the skill-name/SKILL.md structure.
Error: "claude: command not found"
Cause: Claude CLI not available for trigger evaluation
Solution: Install Claude Code CLI. Trigger eval requires claude -p to test skill invocation.
Error: "legacy SDK dependency"
Cause: Outdated instructions or an old checkout still expects a direct SDK client
Solution: Update to the current scripts. Description optimization now runs through claude -p.
Error: "CLAUDECODE environment variable"
Cause: Running eval from inside a Claude Code session blocks nested instances
Solution: The scripts automatically strip the CLAUDECODE env var. If issues persist, run from a separate terminal.
Error: "All queries timeout"
Cause: Default 30s timeout too short for complex queries
Solution: Increase with --timeout 60. Simple trigger queries should complete in <15s.
References
Scripts (in scripts/skill_eval/)
run_eval.py— Trigger evaluation: tests description against query setrun_loop.py— Eval+improve loop: automated description optimizationimprove_description.py— Single-shot description improvement via Claude APIgenerate_report.py— HTML report from loop outputaggregate_benchmark.py— Benchmark aggregation from grading resultsquick_validate.py— Structural validation of SKILL.md
Bundled Agents (in skills/meta/skill-eval/agents/)
grader.md— Evaluates assertions against execution outputscomparator.md— Blind A/B comparison of two outputsanalyzer.md— Post-hoc analysis of why one version beat another
Reference Files
${CLAUDE_SKILL_DIR}/references/schemas.md— JSON schemas for evals.json, grading.json, benchmark.json${CLAUDE_SKILL_DIR}/references/self-improve-loop.md— Self-improvement loop protocol: variant generation, blind A/B testing, promotion criteria${CLAUDE_SKILL_DIR}/references/bake-off-methodology.md— Head-to-head bake-off protocol: rubric construction, anti-rationalization gate, philosophy-filtered fold-list, Feynman worked example
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核