规格说明书编写
specification-authoring
正式规格文档的结构化编写指导。适用于起草机器可读的需求、填写仓库规格模板,或将接口和验收标准细化为自包含的规格说明。不适用于:实现规划(使用 plan-authoring)或广泛的设计探索(使用 brainstorming)。
- License 许可
- MIT
- 最近更新
- 2026-08-16
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- specification-authoring
- description
- Structured authoring guidance for formal specification documents. Use when drafting machine-readable requirements, filling the repository specification template, or refining interfaces and acceptance criteria into a self-contained spec. DO NOT USE FOR: implementation planning (use plan-authoring) or broad design exploration (use brainstorming)
03 SKILL.md 正文
<!-- platform-assumptions: markdown skill guidance for VS Code custom agents in Agent Orchestra; outputs repository-local specification documents. --> <!-- markdownlint-disable-file MD041 MD003 -->
Specification Authoring
Reusable process for drafting precise, self-contained specification documents.
When to Use
- When a formal specification document must be created or updated
- When requirements, constraints, interfaces, and acceptance criteria need a machine-readable structure
- When a specification must be complete enough for downstream implementation or review without hidden context
- When examples and edge cases need to be captured in a durable spec format
Purpose
Produce specifications that read as contracts, not notes. Every requirement should be explicit, scoped, and testable, with a structure that downstream humans and models can parse consistently.
Authoring Principles
- Use precise, unambiguous language
- Distinguish requirements, constraints, recommendations, and patterns explicitly
- Prefer structured sections, tables, and numbered requirement IDs over narrative prose
- Define acronyms, domain terms, and assumptions in the document itself
- Include examples and edge cases when they materially reduce ambiguity
- Keep the document self-contained unless an external reference is truly authoritative and unavoidable
Authoring Workflow
- Clarify the specification scope, audience, and primary purpose.
- Gather the constraints, interfaces, dependencies, and acceptance criteria that belong in the contract.
- Fill the full repository specification template in order.
- Convert vague statements into explicit requirements, constraints, or guidelines.
- Add concrete examples and edge cases where ambiguity would otherwise remain.
- Verify the document is internally consistent and does not depend on unstated context.
Required Template
---
title: [Concise Title Describing the Specification's Focus]
version: [Optional: e.g., 1.0, Date]
date_created: [YYYY-MM-DD]
last_updated: [Optional: YYYY-MM-DD]
owner: [Optional: Team/Individual responsible for this spec]
tags: [Optional: List of relevant tags or categories, e.g., `infrastructure`, `process`, `design`, `app` etc]
---
# Introduction
[A short concise introduction to the specification and the goal it is intended to achieve.]
## 1. Purpose & Scope
[Provide a clear, concise description of the specification's purpose and the scope of its application. State the intended audience and any assumptions.]
## 2. Definitions
[List and define all acronyms, abbreviations, and domain-specific terms used in this specification.]
## 3. Requirements, Constraints & Guidelines
[Explicitly list all requirements, constraints, rules, and guidelines. Use bullet points or tables for clarity.]
- **REQ-001**: Requirement 1
- **SEC-001**: Security Requirement 1
- **[3 LETTERS]-001**: Other Requirement 1
- **CON-001**: Constraint 1
- **GUD-001**: Guideline 1
- **PAT-001**: Pattern to follow 1
## 4. Interfaces & Data Contracts
[Describe the interfaces, APIs, data contracts, or integration points. Use tables or code blocks for schemas and examples.]
## 5. Acceptance Criteria
[Define clear, testable acceptance criteria for each requirement using Given-When-Then format where appropriate.]
- **AC-001**: Given [context], When [action], Then [expected outcome]
- **AC-002**: The system shall [specific behavior] when [condition]
- **AC-003**: [Additional acceptance criteria as needed]
## 6. Test Automation Strategy
[Define the testing approach, frameworks, and automation requirements.]
- **Test Levels**: Unit, Integration, End-to-End
- **Frameworks**: Project-approved test frameworks (see `.github/copilot-instructions.md`)
- **Test Data Management**: [approach for test data creation and cleanup]
- **CI/CD Integration**: [automated testing in GitHub Actions pipelines]
- **Coverage Requirements**: [minimum code coverage thresholds]
- **Performance Testing**: [approach for load and performance testing]
## 7. Rationale & Context
[Explain the reasoning behind the requirements, constraints, and guidelines. Provide context for design decisions.]
## 8. Dependencies & External Integrations
[Define the external systems, services, and architectural dependencies required for this specification. Focus on **what** is needed rather than **how** it's implemented. Avoid specific package or library versions unless they represent architectural constraints.]
### External Systems
- **EXT-001**: [External system name] - [Purpose and integration type]
### Third-Party Services
- **SVC-001**: [Service name] - [Required capabilities and SLA requirements]
### Infrastructure Dependencies
- **INF-001**: [Infrastructure component] - [Requirements and constraints]
### Data Dependencies
- **DAT-001**: [External data source] - [Format, frequency, and access requirements]
### Technology Platform Dependencies
- **PLT-001**: [Platform/runtime requirement] - [Version constraints and rationale]
### Compliance Dependencies
- **COM-001**: [Regulatory or compliance requirement] - [Impact on implementation]
**Note**: This section should focus on architectural and business dependencies, not specific package implementations. For example, specify "OAuth 2.0 authentication library" rather than a framework-specific package name and version.
## 9. Examples & Edge Cases
```code
// Code snippet or data example demonstrating the correct application of the guidelines, including edge cases
```
## 10. Validation Criteria
[List the criteria or tests that must be satisfied for compliance with this specification.]
## 11. Related Specifications / Further Reading
[Link to related spec 1]
[Link to relevant external documentation]
Quality Checklist
- Requirements use stable IDs and testable wording
- Constraints and recommendations are not mixed together
- Interfaces and dependencies describe the contract, not incidental implementation details
- Acceptance criteria can be validated without guessing at intent
- Definitions section covers every acronym and domain-specific term that could confuse a reader
Related Guidance
- Load
software-architecturewhen the specification defines architectural constraints or layer boundaries - Load project-specific skills when documenting domain rules or framework-specific constraints
Gotchas
| Trigger | Gotcha | Fix |
|---|---|---|
| Writing recommendations as requirements | The spec over-commits optional guidance as mandatory behavior | Label requirements, constraints, and guidelines separately |
| Trigger | Gotcha | Fix |
|---|---|---|
| Depending on unstated repo context | Readers cannot implement or review the spec without side input | Expand definitions, assumptions, and interfaces until self-contained |
04 同仓库更多 Skills
Playwright 端到端测试
webapp-testing
面向 Web 应用的 Playwright 端到端测试指南,包含实用模式和设置步骤。在创建或改进基于浏览器的 E2E 覆盖率、测试稳定性和 CI 执行时使用。不要用于:React 组件测试(使用 ui-testing)、Canvas 游戏交互(使用 browser-canvas-testing)、TDD 工作流(使用 test-driven-development)、失败调试(使用 systematic-debugging)或随机化属性测试(使用 property-based-testing)。
任务完成前验证
verification-before-completion
在将工作标记为完成前使用的基于证据的验证清单。适用于提交 PR、发布、将工单标记为完成,或任何「我已完成」的声明之前;也适用于为差异测试套件的主张指定基线提交、设计变异测试活动或红灯运行证据、做出「不存在」的主张、普遍性主张,或将一次性演示作为长期保证提供时、归因某项测量结果或声称某次扫描或验证循环已完成时,以及陈述某项检查或 CI 套件将如何处理某个变更时。不要用于:合并后清理或归档(使用 post-pr-review),或处理 GitHub 审查意见(使用 code-review-intake)。
验证与审查方法论
validation-methodology
用于分阶段验证、故障分诊和追查深度设置的可复用验证与审查方法论。在运行验证阶梯、对失败进行分诊或执行对抗性审查时使用。不要用于:CE Gate 编排、专家派发的职责归属或步骤执行流程(这些保留在 Code-Conductor 中)。
上游智能体接手协议
upstream-onboarding
供上游智能体(Experience-Owner、Solution-Designer、Issue-Planner)与 Code-Conductor 在针对现有 GitHub issue 被调用时使用的共享开场阶段协议。它会生成适配规模的上下文简报,并在每个阶段边界对承接的工作执行标准检查。当用户可调用的智能体收到引用现有 GitHub issue 的请求、且必须在开场阶段加载 solution-authoring 与 upstream-onboarding 时使用。不要用于:子智能体派发(其已在经评估的会话上下文中运行)、合并后审查(使用 post-pr-review)、研究类或非树形子智能体。
React 组件测试策略
ui-testing
以用户行为为核心的弹性 React 组件测试策略。适用于编写或审阅组件级 React 测试、修复不稳定的组件测试,或建立 React 测试模式。不适用于:Playwright E2E 测试(使用 webapp-testing)、canvas 游戏交互(使用 browser-canvas-testing)、TDD 工作流(使用 test-driven-development)、失败调试(使用 systematic-debugging)、UI 组件设计(使用 frontend-design),或随机属性测试(使用 property-based-testing)。
UI 界面视觉迭代优化
ui-iteration
可复用的截图驱动 UI 打磨工作流,用于迭代式视觉优化。适用于通过反复审阅与调整来改进布局、层级、间距、反馈或基于 Tailwind 的呈现效果。不适用于:功能性 Bug 修复、仅针对无障碍的审计,或重大重设计策略工作(使用 Code-Smith 或 frontend-design)。