Loading...
Loading...
Compare original and translation side by side
| Forbidden | Allowed |
|---|---|
| Code blocks or snippets | Behavioral descriptions |
| Variable names or function signatures | Observable outcomes |
| Technology choices ("use React", "use PostgreSQL") | Capability requirements ("renders in browser", "persists data") |
| Algorithm suggestions ("use K-means clustering") | Success criteria ("extracts 5-10 dominant colors") |
| Architecture patterns ("use MVC") | User-facing behaviors |
| Library references ("use Zod for validation") | Validation requirements ("rejects malformed input") |
| 禁止内容 | 允许内容 |
|---|---|
| 代码块或代码片段 | 行为描述 |
| 变量名或函数签名 | 可观测结果 |
| 技术选型("使用React"、"使用PostgreSQL") | 能力要求("在浏览器中渲染"、"持久化存储数据") |
| 算法建议("使用K-means聚类") | 成功标准("提取5-10个主色") |
| 架构模式("使用MVC") | 用户侧行为 |
| 库引用("使用Zod做校验") | 校验要求("拒绝格式错误的输入") |
When [situation], I want to [motivation], so I can [expected outcome].When [场景], I want to [动机], so I can [预期结果].| Test | Result | Action |
|---|---|---|
| "This spec covers color extraction." | PASS | Single topic — one spec file |
| "This spec covers color extraction and palette rendering." | FAIL | Two topics — split into two spec files |
| "This spec covers user authentication and session management." | FAIL | Split into two specs |
| "This spec covers input validation for the registration form." | PASS | Single topic — one spec file |
| 测试内容 | 结果 | 操作 |
|---|---|---|
| "This spec covers color extraction." | 通过 | 单一主题——对应一份规范文件 |
| "This spec covers color extraction and palette rendering." | 不通过 | 两个主题——拆分为两份规范文件 |
| "This spec covers user authentication and session management." | 不通过 | 拆分为两份规范 |
| "This spec covers input validation for the registration form." | 通过 | 单一主题——对应一份规范文件 |
<int>-<descriptive-name>.mdspecs/
├── 01-color-extraction.md
├── 02-palette-rendering.md
├── 03-export-formats.md
└── 04-color-accessibility.md<数字>-<描述性名称>.mdspecs/
├── 01-color-extraction.md
├── 02-palette-rendering.md
├── 03-export-formats.md
└── 04-color-accessibility.mdundefinedundefinedundefinedundefined| Rule | Good Example | Bad Example |
|---|---|---|
| Observable behavioral outcome | "Extracts 5-10 dominant colors from any image" | "Use K-means clustering with k=8" |
| Testable | "Color data persists across sessions" | "Store in PostgreSQL JSONB column" |
| Specific and measurable | "Palette changes appear within 500ms" | "Use WebSocket for real-time updates" |
| Independent (stands alone) | "Palette renders when image loads" | "Implement with React useEffect hook" |
| Implementation-free | "Passwords cannot be recovered from stored data" | "Use bcrypt with 12 salt rounds" |
| 规则 | 正面示例 | 反面示例 |
|---|---|---|
| 可观测的行为结果 | "从任意图片中提取5-10个主色" | "使用k=8的K-means聚类" |
| 可测试 | "颜色数据跨会话持久化" | "存储在PostgreSQL JSONB列中" |
| 具体可量化 | "调色板变更在500ms内生效" | "使用WebSocket实现实时更新" |
| 独立(可单独成立) | "图片加载完成后渲染调色板" | "使用React useEffect钩子实现" |
| 无实现细节 | "无法从存储数据中恢复密码" | "使用12次盐轮的bcrypt加密" |
| # | Check | Pass Criteria |
|---|---|---|
| 1 | No implementation details | Zero code, function names, or tech choices |
| 2 | One Sentence Without 'And' test | Each spec covers exactly one topic |
| 3 | All criteria are Given/When/Then | No free-form prose criteria |
| 4 | All criteria are testable | Each can be verified by a test |
| 5 | Edge cases documented | At least 2 per spec |
| 6 | Data contracts defined | Input and output shapes specified |
| 7 | Consistent naming | |
| # | 检查项 | 通过标准 |
|---|---|---|
| 1 | 无实现细节 | 无代码、函数名、技术选型内容 |
| 2 | 通过"不含'和'的单句"测试 | 每份规范仅覆盖一个主题 |
| 3 | 所有标准都是Given/When/Then格式 | 无自由格式的验收标准 |
| 4 | 所有标准都可测试 | 每条标准都可以通过测试验证 |
| 5 | 边界case已记录 | 每份规范至少包含2个边界case |
| 6 | 数据契约已定义 | 明确了输入和输出结构 |
| 7 | 命名统一 | 符合 |
CAPABILITY 1 CAPABILITY 2 CAPABILITY 3 CAPABILITY 4
───────────── ───────────── ───────────── ─────────────
basic upload auto-extract manual arrange export PNG
bulk upload palette gen templates export SVG
drag-drop color names grid layout share link
accessibility animation collaborateCAPABILITY 1 CAPABILITY 2 CAPABILITY 3 CAPABILITY 4
───────────── ───────────── ───────────── ─────────────
basic upload auto-extract manual arrange export PNG
bulk upload palette gen templates export SVG
drag-drop color names grid layout share link
accessibility animation collaborate| Criterion | Question | Standard |
|---|---|---|
| Simple | Can it ship fast with narrow scope? | Weeks, not months |
| Lovable | Will people actually want to use it? | Delightful, not just functional |
| Complete | Does it fully accomplish a job? | End-to-end, not half-done |
| 标准 | 问题 | 要求 |
|---|---|---|
| 简单 | 能否在小范围下快速发布? | 以周为单位交付,而非月 |
| 易用 | 用户会不会真的想用? | 体验愉悦,而非仅能用 |
| 完整 | 是否能完整完成一个任务? | 端到端可用,而非半完成 |
specs/Agentsubagent_type="Explore"specs/Agentsubagent_type="Explore"| Mistake | Why It Is Wrong | What To Do Instead |
|---|---|---|
| Including code snippets in specs | Locks implementation approach | Describe behavior, not mechanism |
| Naming technologies ("use Redis") | Prevents better alternatives | Describe capability ("caches results") |
| Combining topics with "and" | Spec too broad, hard to implement/test | Split into separate spec files |
| Vague acceptance criteria ("works well") | Cannot write a test for it | Specific measurable outcome |
| Missing edge cases | Bugs in boundary conditions | Document at least 2 edge cases per spec |
| Skipping data contracts | Input/output ambiguity | Always define shapes and constraints |
| Writing specs after code | Specs justify code instead of driving it | Specs come BEFORE implementation |
| Acceptance criteria that describe UI layout | Implementation detail | Describe what the user can accomplish |
| 错误 | 错误原因 | 正确做法 |
|---|---|---|
| 在规范中包含代码片段 | 锁死了实现方案 | 描述行为,而非实现机制 |
| 指定技术("使用Redis") | 排除了更优的替代方案 | 描述能力("缓存结果") |
| 用"和"合并多个主题 | 规范太宽泛,难以实现/测试 | 拆分为独立的规范文件 |
| 模糊的验收标准("运行良好") | 无法对应编写测试 | 给出具体可量化的结果 |
| 缺失边界case | 边界条件下容易出Bug | 每份规范至少记录2个边界case |
| 缺失数据契约 | 输入输出存在歧义 | 始终定义结构和约束 |
| 代码写完后再补规范 | 规范变成了代码的 justification,而非指导 | 规范在实现前编写 |
| 验收标准描述UI布局 | 属于实现细节 | 描述用户可以完成的目标 |
| Skill | Relationship |
|---|---|
| Planning mode reads specs to identify implementation gaps |
| Tests are derived directly from spec acceptance criteria |
| Generates specs from existing code (brownfield) |
| PRD provides high-level requirements; specs detail them |
| Plans reference spec acceptance criteria for task definition |
| Red phase writes tests matching spec acceptance criteria |
| Skills can be specified using this methodology |
| 技能 | 关联关系 |
|---|---|
| 规划模式读取规范识别实现缺口 |
| 测试直接从规范的验收标准衍生而来 |
| 从已有代码生成规范( brownfield 场景) |
| PRD提供高层需求,规范细化需求 |
| 规划参考规范验收标准定义任务 |
| 红阶段编写匹配规范验收标准的测试 |
| 可以用这套方法论定义技能规范 |
undefinedundefinedundefinedundefined