spec-driven
以规范驱动的开发工作流程。在实现新功能、技能或游戏机制时使用。确保在编写代码之前存在规范。
📖 中文导读:以规范驱动的开发工作流程。在实现新功能、技能或游戏机制时使用。确保在编写代码之前存在规范。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: spec-driven description: Spec-driven development workflow. Use when implementing new features, skills, or game mechanics. Ensures specs exist before code.
Spec-Driven Development
Workflow
Before writing ANY implementation code:
- Check for existing spec in
/specs/ - If no spec exists, create one first
- If spec exists, follow it exactly
Spec Structure
Every spec should define:
## Input
What data the skill/feature receives (use Pydantic models)
## Process
Step-by-step logic (reference SRD rules if applicable)
## Output
Structured result (use Pydantic models)
## Edge Cases
What happens on invalid input, failures, etc.
Implementation Rules
- Use
from __future__ import annotations - Use Pydantic for all input/output validation
- Skills MUST be stateless (no global variables)
- Skills MUST NOT call LLMs directly
- Use type hints:
str | NonenotOptional[str] - Follow existing patterns in
src/skills/
Testing
- Write tests BEFORE or alongside implementation
- Tests live in
tests/test_<module>.py - Use pytest with AAA pattern (Arrange-Act-Assert)
- Aim for 100% coverage