AgentSkillsCN

spec-writing

按照标准模板与规范编写项目规格说明书。在创建规格书、技术规格、功能规格或系统设计文档时使用此功能。当收到“为X编写规格书”“创建一份规格说明”“为这一功能进行规格化”或“记录Y的需求”等请求时,可触发此功能。同时调用/doc-coauthoring,以实现结构化的协作。

SKILL.md
--- frontmatter
name: spec-writing
description: Write project specifications following standard templates and conventions. Use when creating specs, technical specifications, feature specs, or system design documents. Triggers on requests like "write a spec for X", "create a specification", "spec out this feature", or "document the requirements for Y". Invokes /doc-coauthoring for structured collaboration.

Spec Writing

Write specifications for this project using a standard template and conventions.

Constraints

  • Specs live in docs/specs/ (subfolders allowed for logical grouping)
  • Filenames: lowercase, hyphenated (e.g., authentication.md, job-scheduler.md)
  • All template sections required (use "None" if not applicable)
  • Acceptance criteria must be verifiable by an agent (observable outcomes, no subjective judgment)
  • New specs start with status: draft

Workflow

  1. Ask clarifying questions to gather context about what spec is needed
  2. Invoke /doc-coauthoring to develop the spec through structured collaboration
  3. Ensure output conforms to the template structure
  4. If separable concerns exist (multiple distinct features that could be implemented independently), advise splitting into separate specs

Template

All specs follow this structure:

markdown
---
title: <Title>
version: 0.1.0
last_updated: <ISO 8601 date>
status: draft | review | approved | deprecated
---

# <Title>

## Overview

What this is and why it exists.

## Constraints

Hard boundaries. Must/must not. Non-negotiable rules.

## Specification

The core details. What it does, how it works. Precise enough to implement against.

## Acceptance Criteria

- [ ] Given <precondition>, when <action>, then <outcome>

## Dependencies

What this relies on to function.

## References

Related specs, external docs, prior art.

Frontmatter

FieldDescription
titleHuman-readable name
versionSemver. MAJOR for breaking changes to acceptance criteria, MINOR for additions/clarifications, PATCH for typos
last_updatedISO 8601 date (e.g., 2026-02-06)
statusdraft (WIP), review (ready for approval), approved (ready for implementation), deprecated (no longer active)

Section Guidance

SectionPurpose
OverviewOne paragraph. What this is, why it exists. Orient the reader.
ConstraintsHard rules. What it must/must not do. Non-negotiable.
SpecificationThe core details. How it works. Precise enough to implement against. Use subsections if needed.
Acceptance CriteriaVerifiable conditions for completeness. Agent must be able to confirm pass/fail.
DependenciesWhat this requires to function. Other specs, skills, tools, external systems.
ReferencesRelated context. Links to other specs, external docs, prior art. Not required to function.

Acceptance Criteria Format

Use Given/When/Then format. Each criterion must be verifiable with observable outcomes.

Good examples:

markdown
- [ ] Given a valid spec file path, when the skill is invoked, then the output file exists in `docs/specs/`
- [ ] Given the generated spec, when reviewed, then all sections from the template are present
- [ ] Given acceptance criteria in the output, when evaluated, then each criterion references an observable outcome

What makes these good:

  • Precondition is clear (Given)
  • Action is specific (When)
  • Outcome is observable and verifiable (Then)
  • No subjective judgment required

Avoid:

  • "Given X, when reviewed, then it is well-written" (subjective)
  • "Given X, when tested, then it works correctly" (vague)