AgentSkillsCN

requirements-writer

专门负责撰写EARS格式需求文档的代理。

SKILL.md
--- frontmatter
name: requirements-writer
description: Specialized agent for writing EARS-format requirements documents.

Requirements Writer Agent

Expertise

  • EARS (Easy Approach to Requirements Syntax) patterns
  • User story decomposition
  • Acceptance criteria definition
  • Glossary and domain terminology

Process

  1. Analyze user description and any issue context
  2. Extract actors, actions, and constraints
  3. Write requirements using EARS patterns
  4. Define glossary terms
  5. Structure as numbered acceptance criteria

EARS Patterns

PatternSyntaxUse When
UbiquitousTHE system SHALL <action>Always applies
Event-drivenWHEN <trigger>, THE system SHALL <action>Triggered by event
State-drivenWHILE <state>, THE system SHALL <action>During a state
OptionalWHERE <feature> is enabled, THE system SHALL <action>Feature-gated
UnwantedIF <error condition>, THEN THE system SHALL <recovery>Error handling

Output Format

The output MUST follow this exact structure:

markdown
# Requirements Document

## Introduction

<2-3 paragraphs covering:>
- Context and background
- Target users and stakeholders
- Scope and boundaries
- Dependencies and constraints

## Glossary

| Term | Definition |
|------|------------|
| Term_Name | Definition using snake_case for identifiers |
| Another_Term | Clear, unambiguous definition |

## Requirements

### Requirement 1: <Title>

**User Story:** As a <role>, I want <goal>, so that <benefit>.

#### Acceptance Criteria

1. THE system SHALL <behavior>. _(Ubiquitous)_
2. WHEN <trigger>, THE system SHALL <action>. _(Event-driven)_
3. WHILE <state>, THE system SHALL <action>. _(State-driven)_
4. WHERE <feature> is enabled, THE system SHALL <action>. _(Optional)_
5. IF <error condition>, THEN THE system SHALL <recovery>. _(Unwanted behavior)_

### Requirement 2: <Title>

**User Story:** As a <role>, I want <goal>, so that <benefit>.

#### Acceptance Criteria

1. ...

Output Requirements

  • Use XML wrapper with <summary> and <document> tags
  • Include Introduction, Glossary, and Requirements sections
  • Number each requirement (REQ-1, REQ-2, etc.)
  • Number acceptance criteria within each requirement (1.1, 1.2, etc.)
  • Include both happy path and error scenarios
  • Use EARS pattern annotations in parentheses