用测试驱动方式编写流程文档,先验证再成稿,提升技能说明的可靠性。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "Creating Skills" 技能: 1. 下载 https://raw.githubusercontent.com/obra/clank/main/skills/meta/creating-skills/SKILL.md 2. 保存为 ~/.claude/skills/creating-skills/SKILL.md 3. 装好后重载技能,告诉我可以用了
请用测试驱动的方法帮我写一份新员工入职流程文档:先列出关键步骤与可能失败点,再设计由子代理执行的检查用例,迭代修正文档直到步骤清晰、无歧义、可执行。
一份经过测试用例验证并多轮修订的入职流程文档,包含步骤、风险点和改进说明。
我有一份技能说明草稿,请先模拟不同子代理按文档执行任务,找出理解偏差、遗漏条件和失败场景,再重写成更严谨的最终版本。
一份基于执行测试结果优化后的技能说明,结构更清晰、边界条件更完整。
请把这份团队SOP当作待测试文档处理:先生成验收标准,再用多个角色视角逐步执行并记录卡点,最后输出修订后的标准操作流程。
一份附带验收标准、测试发现和修订结果的可执行SOP。
Creating skills IS Test-Driven Development applied to process documentation.
You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
Core principle: If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing.
See skills/testing/test-driven-development for the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
A skill is a reference guide for proven techniques, patterns, or tools. Skills help future Claude instances find and apply effective approaches.
Skills are: Reusable techniques, patterns, tools, reference guides
Skills are NOT: Narratives about how you solved a problem once
| TDD Concept | Skill Creation |
|---|---|
| Test case | Pressure scenario with subagent |
| Production code | Skill document (SKILL.md) |
| Test fails (RED) | Agent violates rule without skill (baseline) |
| Test passes (GREEN) | Agent complies with skill present |
| Refactor | Close loopholes while maintaining compliance |
| Write test first | Run baseline scenario BEFORE writing skill |
| Watch it fail | Document exact rationalizations agent uses |
| Minimal code | Write skill addressing those specific violations |
| Watch it pass | Verify agent now complies |
| Refactor cycle | Find new rationalizations → plug → re-verify |
The entire skill creation process follows RED-GREEN-REFACTOR.
Create when:
Don't create for:
Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)
Way of thinking about problems (flatten-with-flags, test-invariants)
API docs, syntax guides, tool documentation (office docs)
skills/
skill-name/
SKILL.md # Main reference (required)
supporting-file.* # Only if needed
Flat namespace - all skills in one searchable location
Separate files for:
Keep inline:
---
name: Human-Readable Name
description: One-line summary of what this does
when_to_use: Symptoms and situations when you need this (CSO-critical)
version: 1.0.0
languages: all | [typescript, python] | etc
dependencies: (optional) Required tools/libraries
---
# Skill Name
## Overview
What is this? Core principle in 1-2 sentences.
## When to Use
[Small inline flowchart IF decision non-obvious]
Bullet list with SYMPTOMS and use cases
When NOT to use
## Core Pattern (for techniques/patterns)
Before/after code comparison
## Quick Reference
Table or bullets for scanning common operations
## Implementation
Inline code for simple patterns
@link to file for heavy reference or reusable tools
## Common Mistakes
What goes wrong + fixes
## Real-World Impact (optional)
Concrete results
Critical for discovery: Future Claude needs to FIND your skill
Include SYMPTOMS not just abstract use cases:
# ❌ BAD: Too abstract
when_to_use: For async testing
# ✅ GOOD: Symptoms and context
when_to_use: When tests use setTimeout/sleep and are flaky, timing-dependent,
pass locally but fail in CI, or timeout when run in parallel
…
帮助你撰写不过时的代码注释,聚焦做什么与为什么而非时序背景。
系统性沿调用链逆向排查缺陷,快速定位问题的最初触发点
帮助开发者为代码补充设计意图注释,聚焦原因与关键取舍而非表面功能。
并行分派多个智能体,同时调查并修复彼此独立的问题
帮助开发者规范完成开发分支收尾,支持合并、提 PR 或清理流程。
通过为每个任务分派独立子代理并穿插代码审查,稳步推进实现计划。
用红绿重构式迭代测试流程文档,发现漏洞并持续完善说明。
用测试驱动开发流程编写新功能、修复缺陷并安全重构代码。
通过测试驱动开发流程,先写测试再实现功能或修复缺陷。
在发现关键经验后,帮助沉淀并更新可复用的技能与操作指引
帮助你编写、审查并规范符合 agentskills.io 规范的技能文档
帮助团队持续维护代码仓库文档、进度记录与交接上下文,便于协作开发