Agent测试
- 作者仓库星标 213
- 作者更新于 实时读取
- 作者仓库 molyanov-ai-dev
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @pavel-molyanov · 未声明 license
- Token 消耗评级
- 中等消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skill-tester
description: | Design tests, run them, grade results, evaluate description triggering, produce actionable rep…
category: 工程开发
runtime: 无特殊运行时
---
# skill-tester 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Phase 1: Understand & Design / 1a. Read the target skill / 1b. Design test prompts”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Phase 1: Understand & Design / 1a. Read the target skill / 1b. Design test prompts”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Phase 1: Understand & Design / 1a. Read the target skill / 1b. Design test prompts”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: skill-tester
description: | Design tests, run them, grade results, evaluate description triggering, produce actionable rep…
category: 工程开发
source: pavel-molyanov/molyanov-ai-dev
---
# skill-tester
## 什么时候使用
- 用于组织测试、定位失败并形成修复闭环 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Phase 1: Understand & Design / 1a. Read the target skill / 1b. Design test prompts」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "skill-tester" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Phase 1: Understand & Design / 1a. Read the target skill / 1b. Design test prompts
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Skill Tester
Design tests, run them, grade results, evaluate description triggering, produce actionable report. All in one workflow — no separate test-design step needed.
You are team lead, test designer, user actor, and analyst — all in one.
Phase 1: Understand & Design
1a. Read the target skill
- User provides skill name or path
- Read the target skill's SKILL.md + ALL referenced files completely
- Map out:
- Skill type: procedural / informational
- Input: what does the skill expect? (user message, task file, structured data)
- Output: what should the skill produce? (files, messages, actions, decisions)
- Phases: list all phases/steps with their checkpoints
- References: list all files the skill tells agents to read
- Decision points: where does the skill branch based on input?
- Dialogue points: where does the skill ask the user questions?
1b. Design test prompts
Design test prompts applying criteria from test-design-guide.md (realistic prompts, assertion design, persona setup):
- Propose 2-3 test prompts:
- 1 happy-path: the most common, standard use case
- 1-2 edge cases: where the skill might break or behave unexpectedly
- For each prompt, propose assertions — binary, observable checks.
Categories:
- [Process]: Did the agent follow the skill's workflow?
- [Outcome]: Is the result correct and complete?
- [Compliance]: Did the agent obey all skill instructions?
1c. Design trigger eval queries
Design trigger eval queries applying patterns from trigger-eval-guide.md:
- Generate 15-20 trigger eval queries:
- 8-10 should-trigger: varied phrasings of the skill's intended use
- 8-10 should-not-trigger: near-misses that share keywords but need something different
- These will be used in Phase 4 to test description accuracy
1d. Confirm with user
Present the full test plan:
- Test prompts with assertions
- Trigger eval queries
- Proposed model for runners
- Persona (use default, modify only if user requests)
"Here are the test cases and trigger queries I've prepared. Do these look right, or do you want to adjust anything?"
Wait for confirmation before proceeding.
Checkpoint: User confirmed test plan. All prompts have assertions. Trigger eval queries prepared.
Phase 2: Execute Tests
2a. Setup
- Create workspace:
~/.claude/skill-tests/{skill-name}/iteration-{N}/(N = 1 for first run, increment for re-runs) - Save test plan to workspace:
evals.jsonwith all prompts and assertionstrigger-evals.jsonwith all trigger queries
- TeamCreate(team_name="skill-test-{skill-name}")
- Plan runners: per scenario = 2 with-skill + 1 baseline without skill
Show plan to user: "I'll run {N} scenarios, {M} runners total. Model: {model}. Proceed?"
2b. Spawn runners
For each scenario, spawn all runners in parallel:
With-skill runners (2 per scenario):
- Prompt = scenario's task prompt (natural, as user would write)
- Each runner loads the tested skill:
Skill(skill="{tested-skill-name}") - Model: as confirmed with user
- Use
run_in_background: true
Baseline runner (1 per scenario):
- Same task prompt, same model
- Receives no skill to load
- Use
run_in_background: true
Save each runner's task_id — needed for grader agents to retrieve transcripts.
Scenarios run sequentially. Runners within a scenario run in parallel.
2c. Interact as user persona
If runners send questions, answer in character per the scenario's persona. Rules:
- Stay in character: answer as the user would
- Be consistent: same question from different runners → same answer
- Answer naturally — without guidance toward any specific behavior
- Keep conversation purely about the task itself
- Baseline runner may ask different questions (no skill to guide it) — this is expected, answer them too
2d. Capture timing data
When each runner completes, immediately save timing data:
{
"total_tokens": 84852,
"duration_ms": 23332,
"total_duration_seconds": 23.3
}
This is the only opportunity to capture this data — it comes through the task notification and isn't persisted elsewhere. Process each notification as it arrives rather than trying to batch them.
Save to timing.json in each runner's result directory.
Checkpoint: All runners completed. Timing data captured.
Phase 3: Grade & Analyze
3a. Grade via grader agents
When all runners for a scenario finish, spawn grader agents — one per runner. Delegate transcript analysis to grader agents — transcripts are large and reading them directly would exhaust the lead agent's context, leaving no room for report compilation.
Each grader receives instructions from grading-guide.md and:
- The runner's task_id (grader calls
TaskOutput(task_id)for transcript) - The scenario's assertions (copy the criteria list into the prompt)
- The skill's SKILL.md path (grader reads it for compliance check)
- Whether this is a skill-runner or baseline
Spawn all graders in parallel. Wait for all to return.
3b. Compile results per scenario
Using only grader outputs (not transcripts):
- Build results table (assertions × runners)
- Cross-runner consistency: where did skill-runners diverge?
- Divergence on a criterion = ambiguous instruction in the skill
- Baseline comparison:
- Passed by skill-runners ONLY → skill adds value
- Passed by ALL → criterion too easy or skill doesn't help here
- Failed by ALL → criterion may be unrealistic
- Passed by baseline ONLY → skill might be harmful for this case
Clean up runners for this scenario before moving to the next one.
3c. Benchmark aggregation
Across all scenarios, compute:
- Pass rate per assertion per config (with-skill / baseline)
- Timing comparison: tokens and duration per config
- Overall skill value: how many assertions improve vs baseline
3d. Analyst pass
Surface patterns the aggregate stats might hide:
- Non-discriminating assertions: pass regardless of whether skill is used. These don't prove the skill helps — consider removing or replacing with harder assertions.
- High-variance assertions: one skill-runner passes, other fails on same criterion. Usually means the skill's instruction is ambiguous — identify the specific instruction and quote it.
- Time/token tradeoffs: skill adds value but costs 2x tokens? Flag it. The user should know the cost of improvement.
- Repeated code in transcripts: if multiple runners independently wrote
similar helper scripts, flag this as a candidate for bundling in
the skill's
scripts/directory.
Checkpoint: All scenarios graded. Benchmark computed. Analyst observations recorded.
Phase 4: Test Description Triggering
4a. Evaluate trigger accuracy
For each trigger eval query from trigger-evals.json:
- Assess whether the skill's current description would cause Claude to invoke the skill for this query
- Consider: does the query's intent match the description's keywords and contexts? Would Claude see this as the skill's domain?
Categorize each query:
- True positive: should-trigger → would trigger
- True negative: should-not-trigger → would not trigger
- False negative: should-trigger → would NOT trigger (undertriggering)
- False positive: should-not-trigger → would trigger (overtriggering)
4b. Calculate trigger accuracy
Trigger accuracy = (true positives + true negatives) / total queries
False negative rate = false negatives / should-trigger queries
False positive rate = false positives / should-not-trigger queries
False negatives (undertriggering) are the most costly — users won't discover the skill exists. False positives waste time but are less harmful.
4c. Suggest improved description
If trigger accuracy < 85% or false negative rate > 20%:
- Analyze which queries fail and why
- Draft an improved description that would trigger correctly
- Show before/after comparison in the report
Checkpoint: Trigger accuracy calculated. Description improvement suggested if needed.
Phase 5: Report
Structure the report according to report-template.md.
The report includes:
- Results per scenario — assertions × runners table with evidence
- Skill compliance — phase-by-phase execution check
- Benchmark summary — pass_rate, tokens, time per config
- Analyst observations — non-discriminating, high-variance, cost analysis
- Description trigger accuracy — accuracy metrics + suggested improvement
- Scripts to bundle — if repeated code found across transcripts
- Recommendations — priority-ordered specific fixes for skill-master
Save to: ~/.claude/skill-tests/{skill-name}/reports/{timestamp}-report.md
Show report to user: "Here's the test report. Key findings: [summary]. The report is at [path] — you can share it with skill-master to apply fixes."
TeamDelete after report delivery.
Improving the Skill (Iteration)
If the user wants to iterate after receiving the report:
- User (or skill-master) applies fixes to the skill
- Run skill-tester again → results go to
iteration-{N+1}/ - Previous iteration results are available for comparison
- Report shows delta: what improved, what regressed
When iterating, keep these principles in mind:
- Generalize from feedback: resist fiddly changes targeted at specific test cases. If a skill works only for its test cases, it's useless at scale.
- Keep the prompt lean: read transcripts. If the skill makes the model waste time doing unproductive things, remove those parts.
- Explain the why: rather than adding rigid ALWAYS/NEVER rules, explain reasoning so the model understands the intent.
Self-Verification
- Target skill fully read (SKILL.md + all references)
- All scenarios executed (2 skill-runners + 1 baseline each)
- Grader agents used for transcript analysis (not read by lead directly)
- Every assertion graded with cited evidence from tool call transcripts
- Skill compliance checked per runner (phase-by-phase)
- Baseline comparison completed per assertion
- Benchmark aggregated (pass_rate, tokens, time)
- Analyst pass completed (non-discriminating, high-variance, cost, repeated code)
- Trigger eval queries tested against description
- Description improvement suggested if accuracy < 85%
- Report saved and shown to user
- Team deleted after report delivery
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核