Skip to content

Guide for writing, editing, and testing agent skills using a red-green-refactor cycle applied to documentation.

CCM score
65 of 100
skills.sh installs
976
GitHub stars
8.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the skill creation flow: baseline pressure tests, writing the minimal skill, then closing loopholes through refactoring
  • Includes a TDD-adapted creation checklist, rationalization tables, discovery optimization, and per-type testing for discipline, technique, pattern, and reference skills
  • Enforces a rule that no skill is written or edited without first observing a failing baseline test
  • Designed for authors building or revising agent skills who need to verify behavior before deployment

Install

$ npx -y skills add jnmetacode/superpowers-zh --skill writing-skills -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

编写技能

概述

编写技能就是将测试驱动开发应用于流程文档。

个人技能存放在你所用运行环境的技能目录中(Claude Code 上是 ~/.claude/skills/)——其他运行环境的路径见 codex-tools.md 或 gemini-tools.md。Codex、Copilot CLI 和 Gemini CLI 也都认 ~/.agents/skills/,作为跨运行环境的别名。

你编写测试用例(带子智能体的压力场景),观察它们失败(基线行为),编写技能(文档),观察测试通过(智能体遵守规则),然后重构(堵住漏洞)。

核心原则: 如果你没有观察到智能体在没有该技能时失败,你就不知道这个技能是否教了正确的东西。

必需背景: 在使用此技能前,你必须理解 test-driven-development。该技能定义了基本的红-绿-重构循环。本技能将 TDD 适配到文档编写中。

官方指南: Anthropic 官方的技能编写最佳实践请参见 anthropic-best-practices.md。该文档提供了补充本技能 TDD 导向方法的额外模式和指南。

什么是技能?

技能是经过验证的技术、模式或工具的参考指南。技能帮助未来的 Claude 实例找到并应用有效的方法。

技能是: 可复用的技术、模式、工具、参考指南

技能不是: 关于你某次如何解决问题的叙事

TDD 映射到技能

TDD 概念技能创建
测试用例带子智能体的压力场景
生产代码技能文档(SKILL.md)
测试失败(红)智能体在没有技能时违反规则(基线)
测试通过(绿)智能体在有技能时遵守规则
重构在保持合规的同时堵住漏洞
先写测试在编写技能之前先运行基线场景
观察失败记录智能体使用的确切合理化借口
最小代码编写针对那些具体违规行为的技能
观察通过验证智能体现在遵守规则
重构循环发现新的合理化借口 → 堵住 → 重新验证

整个技能创建过程遵循红-绿-重构。

何时创建技能

Details

Repository
github.com/jnmetacode/superpowers-zh
Categories
Skill & Plugin Building, Technical Documentation
First seen
Jun 3, 2026

Questions

What does the writing-skills skill do?

It guides you through creating a new skill, editing an existing one, or checking a skill before deployment. It applies test-driven development to process documentation, writing baseline stress scenarios, then the skill, then closing loopholes.

How do I install the writing-skills skill?

Run npx -y skills add jnmetacode/superpowers-zh --skill writing-skills -y in your project. After that, the agent can use it when creating, editing, or validating skills.

Who is the writing-skills skill for?

It is for developers who author agent skills and want to verify them before shipping. It assumes familiarity with test-driven development, which the skill builds on.

Where does writing-skills stand in its category?

It sits in the Skill and Plugin Building category on Claude Marketplaces, alongside find-skills, writing-for-agents, skill-creator and others. It differs by treating skill authoring as test-driven, with red, green and refactor steps.

More from jnmetacode/superpowers-zh

All 20

Similar to Writing Skills

More Skill & Plugin Building