writing-skills

writing-skills is a skill for Claude Code from jnMetaCode/superpowers-zh. It costs 23 tokens per session (7,007 once invoked), scanned A, original, MIT.

A guide for creating and testing reusable instructions for AI agents, called skills. It applies test-driven development, or TDD—the practice of writing tests before implementation—to instruction documents.

In plain words
What is it for?
Creating or revising skills, testing agent behavior with pressure scenarios, and validating skills before deployment.
Why use it?
It helps verify that a skill changes agent behavior in the intended way instead of merely describing a desired process.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is ./render-graphs.js ../some-skill # 每个图表分别渲染.

Part of the superpowers-zh plugin — 20 skills, 1 hook shipped together

Good fit Creating or revising skills, testing agent behavior with pressure scenarios, and validating skills before deployment.

Compare 6 skills from other repositories ↓
About the project

superpowers-zh is a Chinese community edition of superpowers, a collection of practical skills and development methods for AI coding tools. It helps users apply workflows such as brainstorming, test-driven development, debugging, code review, and other programming tasks across supported coding agents. The catalogue add-ons are the project's translated and original skills, instructions, hook, and plugin components.

jnMetaCode/superpowers-zh · 8,051 stars · on GitHub · sp.aiolaola.com

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/jnMetaCode/superpowers-zh
agentmods
npx agentmods add skills/jnmetacode/superpowers-zh/writing-skills

Made for: Claude Code.

Or install superpowers-zh, the plugin that ships this one along with the rest of its 20 skills, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for writing-skills

README.md
[![agentmods](https://agentmods.dev/badge/skills/jnmetacode/superpowers-zh/writing-skills/github.svg)](https://agentmods.dev/skills/jnmetacode/superpowers-zh/writing-skills)
Your own site
<a href="https://agentmods.dev/skills/jnmetacode/superpowers-zh/writing-skills"><img src="https://agentmods.dev/badge/skills/jnmetacode/superpowers-zh/writing-skills/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for writing-skills

Your own site · 80×15
<a href="https://agentmods.dev/skills/jnmetacode/superpowers-zh/writing-skills"><img src="https://agentmods.dev/badge/skills/jnmetacode/superpowers-zh/writing-skills.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,007 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 27 Mar 2026
  • Snyk warn 27 Mar 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Agent Snooping · line 267
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.07007
Opus 5 $0.00012 $0.03504
Sonnet 5 $0.00005 $0.01401
Haiku 4.5 $0.00002 $0.00701

Measured 4d ago against content hash 15786b494151, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

writing-skills scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (render-graphs.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/writing-skills/SKILL.md · 680 lines

How it starts

The opening of the file, as written. The whole thing — 680 lines — stays where its author put it; the contents beside it link to each section on GitHub.

编写技能

概述

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

个人技能存放在智能体特定的目录中(Claude Code 用 ~/.claude/skills,Codex 用 ~/.agents/skills/

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

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

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

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

什么是技能?

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

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

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

TDD 映射到技能

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

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

何时创建技能

创建条件:

  • 技术对你来说不是直觉上显而易见的
  • 你会在不同项目中反复引用
  • 模式具有广泛适用性(非项目特定)
  • 其他人也会受益

不要创建:

  • 一次性解决方案
  • 其他地方有充分文档的标准实践
  • 项目特定的约定(放在 CLAUDE.md 中)
  • 机械性约束(如果可以用正则/验证强制执行,就自动化——文档留给需要判断的场景)

技能类型

技术类

有具体步骤的方法(condition-based-waiting、root-cause-tracing)

模式类

思考问题的方式(flatten-with-flags、test-invariants)

参考类

API 文档、语法指南、工具文档(office docs)

目录结构

skills/
  skill-name/
    SKILL.md              # 主参考文档(必需)
    supporting-file.*     # 仅在需要时

扁平命名空间 - 所有技能在一个可搜索的命名空间中

分离文件的情况:

  1. 大量参考内容(100+ 行)- API 文档、全面的语法说明
  2. 可复用工具 - 脚本、实用程序、模板

保持内联:

  • 原则和概念
  • 代码模式(< 50 行)
  • 其他所有内容

SKILL.md 结构

Frontmatter(YAML):

  • 两个必需字段:namedescription(完整支持字段参见 agentskills.io/specification
  • 总计最多 1024 字符
  • name:只使用字母、数字和连字符(不要用括号、特殊字符)
  • description:第三人称,仅描述何时使用(不是做什么)
    • 以"Use when..."开头,聚焦于触发条件
    • 包含具体的症状、场景和上下文
    • 绝不总结技能的流程或工作流(参见 SDO 章节了解原因)
    • 尽量控制在 500 字符以内
---
name: Skill-Name-With-Hyphens
description: Use when [具体的触发条件和症状]
---

# 技能名称

## 概述
这是什么?用 1-2 句话说明核心原则。

## 何时使用
[如果决策不明显,使用小型内联流程图]

症状和用例的要点列表
不适用的场景

## 核心模式(技术/模式类)
前后代码对比

## 快速参考
用于快速浏览常见操作的表格或要点

## 实现
简单模式内联代码
大量参考或可复用工具链接到文件

## 常见错误
常见问题 + 修复方法

## 实际效果(可选)
具体结果

Read the full file on GitHub · 680 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed 15786b494151
  2. 11d ago First seen · 680 lines · 23 tokens per session scan A 729d4eebd071

Subscribe to this mod's changes

writing-skills is a skill published in the GitHub repository jnMetaCode/superpowers-zh (8,051 stars, last pushed yesterday), licensed MIT. It adds 23 tokens to every session and 7,007 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

test-driven

A test-driven development guide. TDD means writing a test for the desired behaviour first, seeing it fail, then writing the smallest implementation that makes it pass.

Wade-DevCode/awesome-coding-skills-cn · 22 tokens

test-driven-development

Drives development with tests using the red-green-refactor loop. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality.

addyosmani/agent-skills · 57 tokens

skillshare-implement-feature

Implement a feature from a spec file or description using TDD workflow. Use this skill whenever the user asks to: add a new CLI command, implement a feature from a spec, build new functionality, add a flag, create a new internal package, or write Go code for skillshare. This skill enforces test-first development…

runkids/skillshare · 114 tokens

old-coder

Evidence-first development — surround the implementation with an executable spec and a gauntlet of constraints (tests, types, coverage, mutation) so line-by-line review becomes optional. Use when the user explicitly asks for high-assurance or evidence-first work ("reliable", "TDD", "prove it works", "I won't read the…

AmazingAng/old-coder · 116 tokens

ijfw-tdd

RED-GREEN-REFACTOR enforcement. Use when implementing a feature or bugfix before writing implementation code. Trigger: tdd, test first, red green refactor, /ijfw-tdd.

FerroxLabs/ijfw · 45 tokens

tdd

Guidance for test-driven development (TDD), a method where you write a failing test, make it pass with a small change, and then improve the code. It focuses on tests that check user-visible behavior through public interfaces.

devcxl/mattpocock-skills-zh · 39 tokens