skill-authoring
ACTIVATE when creating SKILL.md files, writing frontmatter (name/description), structuring skill packages for discovery, or publishing to the Agent Skills ecosystem. ACTIVATE for 'SKILL.md', 'npx skills', 'skill frontmatter', 'skill discovery', 'skill description length'. Covers: SKILL.md frontmatter schema, description as routing mechanism, hard platform limits sourced across three loaders (Anthropic's agentskills.io spec, VS Code Copilot's agent-skills docs, the OpenAI Codex parser), progressive disclosure, directory structure, discovery mechanics. DO NOT use for: plugin.json/marketplace.json/hooks.json (see plugin-conventions), agent .md format (see agent-authoring).
- License 许可
- MIT
- 最近更新
- 2026-10-13
- Stars
- ★ 9
- Forks
- 2
01 前言 Front Matter
- name
- skill-authoring
- metadata
- { "version": "1.0" }
- description
- ACTIVATE when creating SKILL.md files, writing frontmatter (name/description), structuring skill packages for discovery, or publishing to the Agent Skills ecosystem. ACTIVATE for 'SKILL.md', 'npx skills', 'skill frontmatter', 'skill discovery', 'skill description length'. Covers: SKILL.md frontmatter schema, description as routing mechanism, hard platform limits sourced across three loaders (Anthropic's agentskills.io spec, VS Code Copilot's agent-skills docs, the OpenAI Codex parser), progressive disclosure, directory structure, discovery mechanics. DO NOT use for: plugin.json/marketplace.json/hooks.json (see plugin-conventions), agent .md format (see agent-authoring).
02 资源文件 1
- 参考文档evals/evals.json1.0 KB
03 SKILL.md 正文
Skill Authoring Conventions
Best practices for writing SKILL.md, based on the specification and on the hard limits enforced by the three loaders this marketplace certifies against: agentskills.io/specification, code.visualstudio.com/docs/agent-customization/agent-skills (VS Code Copilot), and the OpenAI Codex parser (openai/codex codex-rs/skills/src/parser.rs, constant MAX_DESCRIPTION_LEN).
Frontmatter Schema
Agent Skills Standard (cross-platform, agentskills.io/specification)
| Field | Required | Constraints |
|---|---|---|
name |
Yes | Max 64 chars, [a-z0-9-] only, no leading/trailing/consecutive hyphens, must match parent directory name |
description |
Yes | Max 1024 chars (the limit shared by agentskills.io, VS Code Copilot and the Codex parser — see Platform Limits below), no angle brackets, single-line string |
license |
No | SPDX identifier (MIT, Apache-2.0) |
compatibility |
No | Max 500 chars, platform/dependency requirements |
metadata |
No | Arbitrary string->string key-value map |
allowed-tools |
No | Space-delimited pre-approved tools |
A top-level version key is a de-facto convention — Anthropic's own template ships it, but
the spec's reference validator rejects unlisted keys. The spec-compliant location is
metadata.version. Claude Code itself ignores both.
Claude Code Extensions (Claude-specific)
| Field | Description |
|---|---|
disable-model-invocation |
true prevents Claude from auto-loading (manual /name only) |
user-invocable |
false hides from / menu |
context |
fork to run in isolated subagent |
agent |
Subagent type for context: fork (Explore, Plan, general-purpose) |
model |
Model override when active |
Critical: name must match directory
php-8-3/ <- directory name
└── SKILL.md
name: php-8-3 <- must match exactly
Platform Limits — Sourced Across Three Loaders
The description hard cap is 1024 characters on all three platforms this repo certifies against:
| Platform | Source |
|---|---|
| Agent Skills spec | agentskills.io/specification |
| VS Code Copilot | code.visualstudio.com/docs/agent-customization/agent-skills |
| OpenAI Codex | openai/codex codex-rs/skills/src/parser.rs, constant MAX_DESCRIPTION_LEN |
Beyond that shared hard limit, treat 300 characters as the advisory target: a description that
still fits in 300 chars stays legible in a / menu and in narrow routing UIs, while the 1024 cap
exists to accommodate the trigger-phrase-heavy style this marketplace uses. Certification (level 4,
non-blocking) does not enforce the 300-char target — it is prose guidance for authors, not a gate.
Description -- The Most Important Field
The description is the primary routing mechanism for both skills.sh indexing and Claude activation. Write it as activation triggers.
Rules:
- Third person: "This skill should be used when..." or an
ACTIVATE when...imperative - Include specific trigger phrases users would say
- Single-line string (Claude Code indexer doesn't parse YAML multiline)
- Under 1024 characters (hard), aim for under 300 (advisory)
- No angle brackets (
<or>)
Skill Directory Structure
skill-name/
├── SKILL.md # Core instructions (<2000 words, <=500 lines)
├── references/ # Detailed docs (loaded on demand)
│ └── patterns.md
└── examples/ # Working examples
└── sample.sh
Progressive Disclosure
Skills use 3-level loading for context efficiency:
- Metadata (~100 tokens) -- always in context (name + description)
- SKILL.md body (<5000 tokens) -- loaded when skill triggers
- Bundled resources (unlimited) -- loaded on demand by Claude
Keep SKILL.md under 2000 words. Move detailed content to references/.
Discovery Mechanics
CLI discovery (npx skills add)
The CLI searches these directories in order: skills/, .claude/skills/, .agents/skills/, and 30+ agent-specific paths.
Leaderboard discovery (skills.sh)
Skills appear automatically when users install them via npx skills add. No registration step needed.
Agent-side discovery (Claude Code)
- Metadata loaded at startup for all installed skills
- Claude reads descriptions to match tasks
- Full SKILL.md body loaded only on activation
- Resources loaded only when referenced
Installation Scopes
| Scope | Path | Command |
|---|---|---|
| Project | .claude/skills/ |
npx skills add repo |
| Personal | ~/.claude/skills/ |
npx skills add repo --global |
| Plugin | <plugin>/skills/ |
claude plugin install |
See also: agent-authoring for the agent .md format (VS Code Copilot custom agents, Claude Code subagents), plugin-conventions for plugin.json/marketplace.json/hooks.json and evals/evals.json.
04 同仓库更多 Skills
vitest-test-conventions
ACTIVATE when writing Vitest tests, creating test files, using vi.fn()/vi.mock()/vi.spyOn(), or test factories. ACTIVATE for 'Vitest', 'it.each', 'NestJS testing module', 'supertest', 'vi.fn', 'vi.mock', 'spyOn'. Provides Vitest/NestJS-specific testing patterns; cross-language testing principles (DAMP, AAA, spy over mock, what NOT to test) live in craft:testing-principles. DO NOT use for: node:test files (a file importing node:test) or a project whose tests run under node --test (see node-test:node-test-conventions), TDD workflow/iterations (see vitest:vitest-tdd-workflow), PHP/PHPUnit tests (see phpunit:php-test-conventions).
vitest-tdd-workflow
ACTIVATE when building new features, endpoints, or user stories using TDD with Vitest in a TypeScript/NestJS context. ACTIVATE for '/feature-tdd-dev', 'TDD', 'red-green-refactor' in TS context. Provides Vitest/NestJS-specific TDD examples and commands; cross-language TDD workflow (cross-layer iterations, RED-GREEN-REFACTOR, working app, bug-fix-first-test, mocks-hiding-bugs) lives in craft:tdd-workflow-principles. DO NOT use for: node:test files (a file importing node:test) or a project whose tests run under node --test (see node-test:node-test-conventions), test writing conventions (see vitest:vitest-test-conventions), PHP TDD (see phpunit:php-tdd-workflow).
ts-refactoring
ACTIVATE when refactoring TypeScript code. ACTIVATE for 'refactor', 'extract', 'redesign', 'simplify', or 'clean up' in a TypeScript / Node / NestJS context. This skill provides TS-specific examples for the cross-language refactoring rules defined in craft:refactoring-principles. DO NOT use for: writing new features from scratch, general OOP patterns (see ts-oop).
ts-ports-adapters
ACTIVATE when a TypeScript codebase with no dependency-injection container has to declare a port and wire its adapter — a repository, a clock, an id generator, an event dispatcher the domain depends on. ACTIVATE for 'port', 'adapter', 'SPI', 'dependency inversion' or 'composition root' in a codebase that wires its dependencies by hand. Covers: the port as a type of functions in the domain layer, the adapter as an object literal annotated with it, the handler that takes its dependencies first and its data second, the composition root in the infrastructure layer, and the in-memory stub that substitutes for the adapter in a unit test. DO NOT use for: NestJS, or any container-based DI with decorators and tokens (see nest-ddd-conventions), aggregate operations and smart constructors (see ddd-ts-fp), the Result type itself (see ts-functional).
ts-oop
ACTIVATE when designing TypeScript classes, and the value objects or collections modelled as classes, or when the user asks about object design, encapsulation, Tell Don't Ask, or Symbol.iterator. Provides TS-specific examples for the cross-language OOP rules defined in craft:oop-principles, plus TS-specific patterns (Symbol.iterator, branded types for primitive identifiers). DO NOT use for: a value object or an aggregate modelled as an immutable record rather than a class (see ddd-ts-fp), refactoring methodology (see ts-refactoring).
ts-layer-boundaries
ACTIVATE when wiring a Worker entry point, a Router, a controller, or a domain event consumer in a TypeScript CQRS codebase, or when deciding where a port belongs. ACTIVATE for 'composition root', 'layer boundary', 'ESLint zones', 'domain must not import infrastructure'. Covers: the *Worker.ts composition root, the curried consumer, Router wiring of command endpoints, the five-gesture controller, the domain-to-infrastructure import boundary enforced by ESLint, infrastructure-only ports, in-memory doubles for every port, the read-can-reach-write asymmetry, and read endpoints going through a domain handler. DO NOT use for: the port's own shape and adapter binding (see ts-ports-adapters), the Result type (see ts-functional), domain event structure (see ts-ddd-events).