writing-skills
Skill này làm gì
Skill giải thích cách tạo hoặc sửa một skill cho agent AI và xác nhận nó hoạt động trước khi bạn dựa vào nó. Dành cho người xây dựng hoặc cải thiện skill cho agent.
Khi nào nên dùng
- ✓Khi bạn muốn tạo một skill mới từ đầu cho agent của mình.
- ✓Khi bạn cần sửa một skill hiện có và xác nhận nó vẫn hoạt động.
- ✓Khi bạn muốn kiểm tra một skill hoạt động trước khi triển khai.
Liên kết skill
https://github.com/obra/superpowers/blob/main/skills/writing-skills/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi muốn viết một skill mới cho trợ lý AI của mình, và tôi muốn kiểm tra xem nó có thực sự hoạt động không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill xem mỗi skill như một bài kiểm thử. Trước tiên agent xem việc thất bại khi không có skill, rồi viết skill, sau đó xác nhận agent làm theo nó.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Writing Skills
Overview
Writing skills IS Test-Driven Development applied to process documentation.
Personal skills live in your runtime's skills directory (~/.claude/skills/ on Claude Code) — see codex-tools.md or gemini-tools.md for the path on those runtimes. Codex, Copilot CLI, and Gemini CLI all also recognize ~/.agents/skills/ as a cross-runtime alias.
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.
REQUIRED BACKGROUND: You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
Official guidance: For Anthropic's official skill authoring best practices, see references/anthropic-best-practices.md. This document provides additional patterns and guidelines that complement the TDD-focused approach in this skill.
What is a Skill?
A skill is a reference guide for proven techniques, patterns, or tools. Skills help future agents 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 Mapping for Skills
| 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.
When to Create a Skill
Create when:
- Technique wasn't intuitively obvious to you
- You'd reference this again across projects
- Pattern applies broadly (not project-specific)
- Others would benefit
Don't create for:
- One-off solutions
- Standard practices well-documented elsewhere
- Project-specific conventions (put in your instructions file)
- Mechanical constraints (if it's enforceable with regex/validation, automate it—save documentation for judgment calls)
Skill Types
Technique
Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)
Pattern
Way of thinking about problems (flatten-with-flags, test-invariants)
Reference
API docs, syntax guides, tool documentation (office docs)
Directory Structure
skills/
skill-name/
SKILL.md # Main reference (required)
supporting-file.* # Only if needed
Flat namespace - all skills in one searchable namespace
Separate files for:
- Heavy reference (100+ lines) - API docs, comprehensive syntax
- Reusable tools - Scripts, utilities, templates
Keep inline:
- Principles and concepts
- Code patterns (< 50 lines)
- Everything else
Writing SKILL.md
A skill's description says only when to use it: triggering conditions and
symptoms, starting with "Use when...". It never summarizes the skill's
workflow, because an agent that reads a workflow summary follows it instead
of reading the skill.
When you write or change a skill's frontmatter, name or description, or need to cut its size, read references/discovery.md: the SKILL.md template, description and keyword guidance, naming, token budgets, and cross-referencing other skills.
Flowcharts
When you add or change a flowchart in a skill, read references/flowcharts.md first: when a flowchart earns its place, the graphviz conventions, and how to render one.
Code Examples
One excellent example beats many mediocre ones
Choose most relevant language:
- Testing techniques → TypeScript/JavaScript
- System debugging → Shell/Python
- Data processing → Python
Câu hỏi thường gặp
Tôi có cần biết lập trình để dùng skill này không?
Không nhất thiết. Skill là các chỉ dẫn văn bản thuần, nên được viết cho người biết trình bày các bước rõ ràng.
Skill này có giải thích cách kiểm thử skill không?
Có. Nó yêu cầu bạn chạy agent có và không có skill, rồi so sánh kết quả trước khi hoàn thành.
Skill cá nhân nên được lưu ở đâu?
Skill nói rằng skill cá nhân thuộc về thư mục skills của runtime, chẳng hạn thư mục skills trong cài đặt Claude Code của bạn.
Chi tiết
Mô tả gốc của tác giả
Use when creating new skills, editing existing skills, or verifying skills work before deployment
repo: obra/superpowers
Độ phổ biến
- Sao GitHub
- 311k
- Vị trí xếp hạng
- #99
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
brainstorming
311kGiúp agent của bạn tìm ra điều bạn thực sự muốn trước khi xây dựng bất cứ thứ gì mới, bằng các câu hỏi tập trung và những lựa chọn rõ ràng.
executing-plans
311kGiúp agent của bạn thực hiện một kế hoạch triển khai đã viết từng bước trong phiên hiện tại, kiểm thử từng bước trước khi chuyển sang bước tiếp theo.
finishing-a-development-branch
311kGiúp agent của bạn hoàn tất mã đã xong bằng cách chạy kiểm thử, rồi đưa ra các lựa chọn rõ ràng để merge, mở pull request hoặc giữ nhánh.
receiving-code-review
311kGiúp agent của bạn cân nhắc kỹ các góp ý đánh giá mã, kiểm tra từng điểm với mã trước khi thay đổi bất cứ thứ gì.
Skill tương tự
writing-for-agents
310kGiải thích cách viết hướng dẫn rõ ràng cho agent AI, gồm skill, tệp AGENTS.md và CLAUDE.md, để agent cư xử nhất quán.
bengali-nlp
280kGiúp agent của bạn xử lý văn bản tiếng Bengali, hỗ trợ hiểu ngôn ngữ này, chuẩn hóa văn bản và xử lý các đặc điểm riêng của nó.
prompt-caching-strategy
280kGiúp agent tối ưu prompt cho các mô hình ngôn ngữ. Phân tích cách prompt được xây dựng để giảm chi phí và tăng tốc phản hồi bằng cách tái sử dụng thông tin.