implement

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Implement from Spec (with GitHub Spec Kit)

基于规范实现功能(借助GitHub Spec Kit)

Step 6 of 6 in the Reverse Engineering to Spec-Driven Development process.
Estimated Time: Hours to days (depends on gaps) Prerequisites: Step 5 completed (all specs finalized, no
[NEEDS CLARIFICATION]
markers) Output: Fully implemented application with all specs marked ✅ COMPLETE

逆向工程转向规范驱动开发流程的第6步(共6步)
预计耗时: 数小时到数天(取决于功能缺口大小) 前置条件: 已完成第5步(所有规范已最终确定,无
[NEEDS CLARIFICATION]
标记) 输出结果: 功能完全实现的应用,所有规范均标记为✅ COMPLETE

When to Use This Skill

何时使用该技能

Use this skill when:
  • You've completed Step 5 (Complete Specification)
  • All specifications in
    specs/
    are finalized
  • Implementation plans exist in
    specs/
  • Ready to use
    /speckit.implement
    to build features
Trigger Phrases:
  • "Implement missing features"
  • "Use speckit to implement"
  • "Build from specifications"
  • "Run speckit implement"

在以下场景使用该技能:
  • 已完成第5步(规范定稿)
  • specs/目录中的所有规范均已最终确定
  • specs/目录中存在实现计划
  • 准备使用/speckit.implement命令构建功能
触发话术:
  • "实现缺失功能"
  • "使用speckit进行实现"
  • "基于规范构建功能"
  • "运行speckit implement命令"

What This Skill Does

该技能的作用

Uses GitHub Spec Kit's implementation workflow to systematically build features:
  1. Use /speckit.tasks - Generate actionable task lists from implementation plans
  2. Use /speckit.implement - Execute tasks step-by-step for each feature
  3. Validate with /speckit.analyze - Verify implementation matches specs
  4. Update Specs Automatically - Spec Kit marks features ✅ COMPLETE as you implement
  5. Track Progress - Monitor completion via
    .specify/memory/
    status markers
  6. Achieve 100% Completion - All specs implemented and validated
Key Benefit: Spec Kit's
/speckit.implement
command guides you through implementation plans, updates specs automatically, and validates work against acceptance criteria.

借助GitHub Spec Kit的实现工作流系统性地构建功能:
  1. 使用/speckit.tasks - 从实现计划生成可执行的任务列表
  2. 使用/speckit.implement - 逐步执行每个功能的任务
  3. 使用/speckit.analyze验证 - 验证实现是否符合规范
  4. 自动更新规范 - 当你完成功能实现时,Spec Kit会自动将功能标记为✅ COMPLETE
  5. 跟踪进度 - 通过.specify/memory/目录中的状态标记监控完成情况
  6. 实现100%覆盖率 - 所有规范均被实现并验证
核心优势: Spec Kit的/speckit.implement命令会引导你完成实现计划,自动更新规范,并对照验收标准验证工作成果。

⚠️ Two Contexts: Handoff vs Standard Implementation

⚠️ 两种场景:交接与标准实现

This skill works differently based on context:
该技能在不同场景下的工作方式不同:

Context A: Handoff (After Reverse Engineering)

场景A:交接(逆向工程完成后)

When: Just completed Gears 1-5, on main branch, gaps identified What happens: Handoff procedure (celebrate, explain transition, offer feature branch setup)
适用时机: 刚完成第1-5步,处于主分支,已识别功能缺口 执行操作: 交接流程(确认完成、说明过渡、提供功能分支设置建议)

Context B: Standard Implementation (Ongoing)

场景B:标准实现(持续开发中)

When: On feature branch (002-, 003-), working on specific feature What happens: Standard GitHub Spec Kit implementation workflow See: Process Overview below
The handoff only happens ONCE (after initial reverse engineering). After that, you always use standard /speckit.* workflow on feature branches.

适用时机: 处于功能分支(002-, 003-),正在开发特定功能 执行操作: 标准GitHub Spec Kit实现工作流 参考: 下方的流程概述
交接流程仅执行一次(初始逆向工程完成后)。之后,你将始终在功能分支上使用标准的/speckit.*工作流。

GitHub Spec Kit Implementation Workflow

GitHub Spec Kit实现工作流

The standard Spec Kit workflow is:
/speckit.specify → /speckit.plan → /speckit.tasks → /speckit.implement → /speckit.analyze
For reverse engineering, we've already done the first two steps:
  • /speckit.specify
    - Done in Step 3 (created specifications)
  • /speckit.plan
    - Done in Step 3 (created implementation plans)
Now we use the remaining commands:
  • /speckit.tasks
    - Generate task lists
  • /speckit.implement
    - Build features
  • /speckit.analyze
    - Validate

标准的Spec Kit工作流如下:
/speckit.specify → /speckit.plan → /speckit.tasks → /speckit.implement → /speckit.analyze
对于逆向工程,我们已经完成了前两步:
  • /speckit.specify
    - 第3步已完成(创建规范)
  • /speckit.plan
    - 第3步已完成(创建实现计划)
现在我们使用剩余的命令:
  • /speckit.tasks
    - 生成任务列表
  • /speckit.implement
    - 构建功能
  • /speckit.analyze
    - 验证实现

Process Overview

流程概述

Step 1: Review Implementation Roadmap

步骤1:查看实现路线图

From
docs/gap-analysis-report.md
, review the phased plan:
Phase 1: P0 Critical (~12 hours)
  • Essential features
  • Security fixes
  • Blocking issues
Phase 2: P1 High Value (~20 hours)
  • Important features
  • High user impact
  • Key improvements
Phase 3: P2/P3 (~TBD)
  • Nice-to-have
  • Future enhancements
Confirm with user:
  • Start with Phase 1 (P0 items)?
  • Any blockers to address first?
  • Time constraints?
从docs/gap-analysis-report.md文件中,查看分阶段计划:
阶段1:P0关键功能(约12小时)
  • 核心功能
  • 安全修复
  • 阻塞性问题
阶段2:P1高价值功能(约20小时)
  • 重要功能
  • 高用户影响功能
  • 关键改进项
阶段3:P2/P3功能(时间待定)
  • 锦上添花的功能
  • 未来增强项
与用户确认:
  • 从阶段1(P0项)开始?
  • 是否有需要优先处理的阻塞问题?
  • 时间限制?

Step 2: For Each Feature - Generate Tasks

步骤2:针对每个功能生成任务

Use
/speckit.tasks
to generate actionable tasks from implementation plan:
bash
undefined
使用/speckit.tasks命令从实现计划生成可执行任务:
bash
undefined

Example: Implement user authentication frontend

示例:实现用户认证前端

/speckit.tasks user-authentication-frontend

**What this does:**
- Reads `specs/user-authentication-frontend.md`
- Breaks down plan into specific, actionable tasks
- Creates task checklist

**Output example:**
```markdown
/speckit.tasks user-authentication-frontend

**该命令的作用:**
- 读取specs/user-authentication-frontend.md文件
- 将实现计划拆解为具体、可执行的任务
- 创建任务清单

**输出示例:**
```markdown

Tasks: User Authentication Frontend

任务:用户认证前端

Based on implementation plan in
specs/user-authentication-frontend.md
基于specs/user-authentication-frontend.md中的实现计划

Tasks

任务列表

  • Create LoginPage component (app/login/page.tsx)
  • Create RegistrationPage component (app/register/page.tsx)
  • Create PasswordResetPage component (app/reset-password/page.tsx)
  • Add Zod validation schemas (lib/validation/auth.ts)
  • Create useAuth hook (hooks/useAuth.ts)
  • Implement API integration (lib/api/auth.ts)
  • Add loading states to all forms
  • Add error handling and display
  • Write component tests (LoginPage.test.tsx, etc.)
  • Update routing configuration (app/layout.tsx)
  • 创建LoginPage组件(app/login/page.tsx)
  • 创建RegistrationPage组件(app/register/page.tsx)
  • 创建PasswordResetPage组件(app/reset-password/page.tsx)
  • 添加Zod验证模式(lib/validation/auth.ts)
  • 创建useAuth钩子(hooks/useAuth.ts)
  • 实现API集成(lib/api/auth.ts)
  • 为所有表单添加加载状态
  • 添加错误处理与展示
  • 编写组件测试(LoginPage.test.tsx等)
  • 更新路由配置(app/layout.tsx)

Dependencies

依赖项

  • Backend API endpoints must be functional
  • UI component library installed
  • 后端API端点必须可用
  • UI组件库已安装

Acceptance Criteria (from specification)

验收标准(来自规范)

  • User can register with email and password
  • User can log in with credentials
  • User can reset forgotten password
  • JWT tokens stored securely
  • Forms validate input before submission
  • Loading states shown during API calls
  • Error messages displayed clearly
undefined
  • 用户可通过邮箱和密码注册
  • 用户可通过凭证登录
  • 用户可重置遗忘的密码
  • JWT令牌被安全存储
  • 表单在提交前验证输入
  • API调用期间显示加载状态
  • 错误信息清晰展示
undefined

Step 3: Implement Feature with /speckit.implement

步骤3:使用/speckit.implement实现功能

Use
/speckit.implement
to execute the implementation plan:
bash
undefined
使用/speckit.implement命令执行实现计划:
bash
undefined

Implement the feature step-by-step

逐步实现功能

/speckit.implement user-authentication-frontend

**What this does:**
1. Loads tasks from `/speckit.tasks` output
2. Walks through each task systematically
3. Generates code for each task
4. Tests implementation against acceptance criteria
5. Updates specification status markers
6. Commits changes with descriptive messages

**Interactive flow:**
/speckit.implement user-authentication-frontend
Starting implementation of: User Authentication Frontend Plan: specs/user-authentication-frontend.md
Task 1/10: Create LoginPage component
I'll create app/login/page.tsx with:
  • Email/password form
  • Form validation
  • Submit handler
  • Link to registration and password reset
[Code generated]
✅ Task 1 complete
Task 2/10: Create RegistrationPage component [...]
All tasks complete! Running validation...
✅ All acceptance criteria met ✅ Tests passing (8/8) ✅ No TypeScript errors
Updating specification status... user-authentication.md: ⚠️ PARTIAL → ✅ COMPLETE
Implementation complete!
undefined
/speckit.implement user-authentication-frontend

**该命令的作用:**
1. 加载/speckit.tasks输出的任务
2. 系统地逐步完成每个任务
3. 为每个任务生成代码
4. 对照验收标准测试实现
5. 更新规范的状态标记
6. 提交带有描述性信息的变更

**交互式流程示例:**
/speckit.implement user-authentication-frontend
开始实现:用户认证前端 计划文件:specs/user-authentication-frontend.md
任务1/10:创建LoginPage组件
我将创建app/login/page.tsx,包含:
  • 邮箱/密码表单
  • 表单验证
  • 提交处理函数
  • 指向注册和密码重置的链接
[代码已生成]
✅ 任务1完成
任务2/10:创建RegistrationPage组件 [...]
所有任务完成!正在执行验证...
✅ 所有验收标准已满足 ✅ 测试通过(8/8) ✅ 无TypeScript错误
正在更新规范状态... user-authentication.md: ⚠️ PARTIAL → ✅ COMPLETE
实现完成!
undefined

Step 4: Validate Implementation

步骤4:验证实现

After implementing, use
/speckit.analyze
to verify:
bash
> /speckit.analyze
What it checks:
  • Implementation matches specification
  • All acceptance criteria met
  • No inconsistencies with related specs
  • Status markers accurate
If issues found:
⚠️ Issues detected:

1. user-authentication.md marked COMPLETE
   - Missing: Token refresh mechanism
   - Action: Add token refresh or update spec

2. Inconsistency with user-profile.md
   - user-profile depends on authentication
   - user-profile marked PARTIAL
   - Recommendation: Complete user-profile next
Fix any issues and re-run
/speckit.analyze
until clean.
完成实现后,使用/speckit.analyze命令进行验证:
bash
> /speckit.analyze
验证内容:
  • 实现是否与规范匹配
  • 所有验收标准是否满足
  • 与相关规范是否存在不一致
  • 状态标记是否准确
若发现问题:
⚠️ 检测到问题:

1. user-authentication.md标记为COMPLETE
   - 缺失:令牌刷新机制
   - 操作:添加令牌刷新功能或更新规范

2. 与user-profile.md存在不一致
   - user-profile依赖于认证功能
   - user-profile标记为PARTIAL
   - 建议:接下来完成user-profile
修复所有问题后,重新运行/speckit.analyze直到无问题。

Step 5: Update Progress and Continue

步骤5:更新进度并继续

After each feature:
  1. Check progress:
    bash
    > /speckit.analyze
    # Shows: X/Y features complete
  2. Update gap report:
    • Mark feature as ✅ COMPLETE
    • Update overall completion percentage
    • Move to next priority feature
  3. Commit changes:
    bash
    git commit -m "feat: implement user authentication frontend (user-authentication.md)"
  4. Select next feature:
    • Follow prioritized roadmap
    • Choose next P0 item, or move to P1 if P0 complete
完成每个功能后:
  1. 检查进度:
    bash
    > /speckit.analyze
    # 显示:已完成X/Y个功能
  2. 更新缺口报告:
    • 将功能标记为✅ COMPLETE
    • 更新整体完成百分比
    • 转向下一个优先级的功能
  3. 提交变更:
    bash
    git commit -m "feat: implement user authentication frontend (user-authentication.md)"
  4. 选择下一个功能:
    • 遵循优先级路线图
    • 选择下一个P0项,若P0项已完成则转向P1项

Step 6: Iterate Until 100% Complete

步骤6:循环直到100%完成

Repeat Steps 2-5 for each feature in the roadmap:
bash
undefined
对路线图中的每个功能重复步骤2-5:
bash
undefined

Phase 1: P0 Critical

阶段1:P0关键功能

/speckit.tasks fish-management-ui /speckit.implement fish-management-ui /speckit.analyze
/speckit.tasks photo-upload-api /speckit.implement photo-upload-api /speckit.analyze
/speckit.tasks fish-management-ui /speckit.implement fish-management-ui /speckit.analyze
/speckit.tasks photo-upload-api /speckit.implement photo-upload-api /speckit.analyze

Phase 2: P1 High Value

阶段2:P1高价值功能

/speckit.tasks analytics-dashboard /speckit.implement analytics-dashboard /speckit.analyze
/speckit.tasks analytics-dashboard /speckit.implement analytics-dashboard /speckit.analyze

Continue until all features complete...

持续直到所有功能完成...


**Track progress:**
- Phase 1: 3/3 complete (100%) ✅
- Phase 2: 2/4 complete (50%) 🔄
- Phase 3: 0/5 complete (0%) ⏳

---

**进度跟踪:**
- 阶段1:3/3完成(100%)✅
- 阶段2:2/4完成(50%)🔄
- 阶段3:0/5完成(0%)⏳

---

Example: Complete Implementation Flow

示例:完整实现流程

bash
undefined
bash
undefined

1. Review roadmap

1. 查看路线图

User: "Let's implement the missing features" Claude: Reviews docs/gap-analysis-report.md Claude: "I see 3 P0 items. Let's start with fish-management-ui?" User: "Yes, let's do it"
用户:"我们来实现缺失的功能" Claude:查看docs/gap-analysis-report.md Claude:"我看到有3个P0项。我们从fish-management-ui开始?" 用户:"好的,开始吧"

2. Generate tasks

2. 生成任务

/speckit.tasks fish-management-ui Output: 12 tasks identified
/speckit.tasks fish-management-ui 输出:识别出12个任务

3. Implement

3. 实现功能

/speckit.implement fish-management-ui
Starting implementation...
Task 1/12: Create FishEditPage component [Code generated for app/fish/[id]/edit/page.tsx] ✅ Task 1 complete
Task 2/12: Add photo upload UI [Code generated for components/PhotoUpload.tsx] ✅ Task 2 complete
[... continues through all 12 tasks ...]
Implementation complete! ✅ All acceptance criteria met ✅ Tests passing (15/15)
/speckit.implement fish-management-ui
开始实现...
任务1/12:创建FishEditPage组件 [为app/fish/[id]/edit/page.tsx生成代码] ✅ 任务1完成
任务2/12:添加图片上传UI [为components/PhotoUpload.tsx生成代码] ✅ 任务2完成
[... 继续完成所有12个任务 ...]
实现完成! ✅ 所有验收标准已满足 ✅ 测试通过(15/15)

4. Validate

4. 验证

/speckit.analyze ✅ No issues found fish-management.md: ⚠️ PARTIAL → ✅ COMPLETE
/speckit.analyze ✅ 未发现问题 fish-management.md: ⚠️ PARTIAL → ✅ COMPLETE

5. Commit

5. 提交变更

git commit -m "feat: complete fish management UI (fish-management.md)"
git commit -m "feat: complete fish management UI (fish-management.md)"

6. Next feature

6. 下一个功能

Claude: "Phase 1 progress: 1/3 complete. Next: photo-upload-api?" User: "Yes"
Claude:"阶段1进度:1/3完成。下一个是photo-upload-api?" 用户:"好的"

Repeat...

重复上述流程...


---

---

Integration with Reverse Engineering Process

与逆向工程流程的集成

Your reverse-engineered codebase is now:
  1. ✅ Fully documented (Step 2)
  2. ✅ Formal specs created (Step 3)
  3. ✅ Gaps identified (Step 4)
  4. ✅ Clarifications resolved (Step 5)
  5. 🔄 Being implemented systematically (Step 6)
Spec Kit ensures:
  • Implementation matches specs exactly
  • Specs stay up-to-date with code
  • No drift between docs and reality
  • Continuous validation
After completion:
  • Use
    /speckit.specify
    for new features
  • Use
    /speckit.plan
    /speckit.tasks
    /speckit.implement
    for development
  • Use
    /speckit.analyze
    to maintain consistency
  • Your codebase is now fully spec-driven!

你的逆向工程代码库现在处于:
  1. ✅ 文档完整(第2步)
  2. ✅ 已创建正式规范(第3步)
  3. ✅ 已识别功能缺口(第4步)
  4. ✅ 已解决所有疑问(第5步)
  5. 🔄 正在系统性地实现功能(第6步)
Spec Kit确保:
  • 实现与规范完全匹配
  • 规范与代码保持同步
  • 文档与实际代码无偏差
  • 持续验证
完成后:
  • 使用/speckit.specify创建新功能
  • 使用/speckit.plan → /speckit.tasks → /speckit.implement进行开发
  • 使用/speckit.analyze保持一致性
  • 你的代码库现在完全是规范驱动的!

Success Criteria

成功标准

After running this skill (implementing all features), you should have:
  • ✅ All P0 features implemented (Phase 1 complete)
  • ✅ All P1 features implemented (Phase 2 complete)
  • ✅ P2/P3 features implemented or intentionally deferred
  • ✅ All specifications marked ✅ COMPLETE
  • /speckit.analyze
    shows no issues
  • ✅ All tests passing
  • ✅ Application at 100% completion
  • ✅ Ready for production deployment
Ongoing spec-driven development established:
  • New features start with
    /speckit.specify
  • Implementation uses
    /speckit.plan
    /speckit.tasks
    /speckit.implement
  • Continuous validation with
    /speckit.analyze

运行该技能(实现所有功能)后,你应达到:
  • ✅ 所有P0功能已实现(阶段1完成)
  • ✅ 所有P1功能已实现(阶段2完成)
  • ✅ P2/P3功能已实现或已明确延期
  • ✅ 所有规范标记为✅ COMPLETE
  • ✅ /speckit.analyze显示无问题
  • ✅ 所有测试通过
  • ✅ 应用实现100%完成
  • ✅ 可部署到生产环境
已建立持续的规范驱动开发流程:
  • 新功能从/speckit.specify开始
  • 实现使用/speckit.plan → /speckit.tasks → /speckit.implement流程
  • 使用/speckit.analyze持续验证

Best Practices

最佳实践

During Implementation

实现期间

  1. One feature at a time - Don't start multiple features in parallel
  2. Follow the roadmap - Respect P0 → P1 → P2 priority order
  3. Use
    /speckit.implement
    - Don't implement manually, let Spec Kit guide you
  4. Validate frequently - Run
    /speckit.analyze
    after each feature
  5. Commit often - Commit after each feature completion
  6. Update specs - If you discover new requirements, update specs first
  1. 一次实现一个功能 - 不要同时开始多个功能
  2. 遵循路线图 - 严格按照P0 → P1 → P2的优先级顺序
  3. 使用/speckit.implement - 不要手动实现,让Spec Kit引导你
  4. 频繁验证 - 完成每个功能后运行/speckit.analyze
  5. 频繁提交 - 完成每个功能后提交变更
  6. 更新规范 - 若发现新需求,先更新规范

Quality Standards

质量标准

For each implementation:
  • ✅ Meets all acceptance criteria
  • ✅ Tests added and passing
  • ✅ TypeScript types correct (if applicable)
  • ✅ Error handling implemented
  • ✅ Loading states for async operations
  • ✅ Responsive design (if UI)
  • ✅ Accessibility standards met
每个实现需满足:
  • ✅ 符合所有验收标准
  • ✅ 添加并通过测试
  • ✅ TypeScript类型正确(若适用)
  • ✅ 已实现错误处理
  • ✅ 异步操作有加载状态
  • ✅ 响应式设计(若为UI功能)
  • ✅ 符合可访问性标准

When Issues Arise

问题处理

If
/speckit.analyze
finds problems:
  1. Fix the implementation to match spec, OR
  2. Update the spec if requirements changed
  3. Never leave specs and code out of sync

若/speckit.analyze发现问题:
  1. 修改实现以匹配规范,或者
  2. 若需求变更则更新规范
  3. 永远不要让规范与代码不同步

Continuous Spec-Driven Development

持续规范驱动开发

After completing the reverse engineering process:
完成逆向工程流程后:

For New Features

新功能开发

bash
undefined
bash
undefined

1. Create specification

1. 创建规范

/speckit.specify
/speckit.specify

2. Create implementation plan

2. 创建实现计划

/speckit.plan
/speckit.plan

3. Generate tasks

3. 生成任务

/speckit.tasks
/speckit.tasks

4. Implement

4. 实现功能

/speckit.implement
/speckit.implement

5. Validate

5. 验证

/speckit.analyze
undefined
/speckit.analyze
undefined

For Refactoring

代码重构

bash
undefined
bash
undefined

1. Update affected specifications

1. 更新受影响的规范

/speckit.specify
/speckit.specify

2. Update implementation plan

2. 更新实现计划

/speckit.plan
/speckit.plan

3. Implement changes

3. 实现变更

/speckit.implement
/speckit.implement

4. Validate no regression

4. 验证无回归

/speckit.analyze
undefined
/speckit.analyze
undefined

For Bug Fixes

Bug修复

bash
undefined
bash
undefined

1. Update spec if bug reveals requirement gap

1. 若Bug暴露出需求缺口,更新规范

/speckit.specify
/speckit.specify

2. Fix implementation

2. 修复实现

[manual fix or /speckit.implement]
[手动修复或使用/speckit.implement]

3. Validate

3. 验证

/speckit.analyze

---
/speckit.analyze

---

Technical Notes

技术说明

  • Spec Kit's
    /speckit.implement
    generates code - review before committing
  • Implementation plans should be detailed for best results
  • /speckit.tasks
    output can be refined if tasks are too broad
  • Use
    /speckit.clarify
    if you discover ambiguities during implementation
  • Keep
    .specify/memory/
    in version control
  • specs/
    is the source of truth

  • Spec Kit的/speckit.implement会生成代码,提交前请先审核
  • 实现计划越详细,结果越好
  • 若任务过于宽泛,可优化/speckit.tasks的输出
  • 若实现期间发现歧义,使用/speckit.clarify
  • 将.specify/memory/目录纳入版本控制
  • specs/是唯一可信来源

Final Outcome

最终成果

You've transformed:
  • Partially-complete codebase with no specs
  • → Fully spec-driven development workflow
  • → 100% implementation aligned with specifications
  • → Continuous validation with
    /speckit.analyze
  • → Sustainable spec-first development process
Your application is now:
  • ✅ Fully documented
  • ✅ Completely specified
  • ✅ 100% implemented
  • ✅ Continuously validated
  • ✅ Ready for ongoing spec-driven development

你已完成以下转变:
  • 从功能不完整、无规范的代码库
  • → 拥有完整的规范驱动开发工作流
  • → 100%的实现与规范对齐
  • → 使用/speckit.analyze持续验证
  • → 可持续的规范优先开发流程
你的应用现在:
  • ✅ 文档完整
  • ✅ 规范明确
  • ✅ 100%实现
  • ✅ 持续验证
  • ✅ 可进行持续的规范驱动开发

Gear 6.5: Validate & Review

第6.5步:验证与评审

Before finalizing, let's ensure everything meets quality standards through systematic validation.
最终确定前,我们将通过系统性验证确保所有内容符合质量标准。

Step 1: Run Validation

步骤1:运行验证

bash
undefined
bash
undefined

Validate implementation against specs

验证实现是否符合规范

/stackshift.validate --fix

This will:
1. ✅ Run full test suite
2. ✅ Validate TypeScript compilation
3. ✅ Check spec compliance
4. ✅ Categorize any issues
5. ✅ Auto-fix issues (with --fix flag)
6. ✅ Rollback if fixes fail

**Expected result:**
✅ VALIDATION PASSED
All tests passing: ✅ TypeScript compiling: ✅ Spec compliance: ✅ Code quality: ✅
🚀 Implementation is production-ready!

If validation finds issues, they'll be fixed automatically. If critical issues are found that can't be auto-fixed, I'll report them for manual resolution.
/stackshift.validate --fix

该命令将:
1. ✅ 运行完整测试套件
2. ✅ 验证TypeScript编译
3. ✅ 检查规范合规性
4. ✅ 分类所有问题
5. ✅ 自动修复问题(使用--fix参数)
6. ✅ 若修复失败则回滚

**预期结果:**
✅ 验证通过
所有测试通过:✅ TypeScript编译通过:✅ 规范合规:✅ 代码质量:✅
🚀 实现可部署到生产环境!

若验证发现问题,将自动修复。若发现无法自动修复的严重问题,我会报告并等待手动解决。

Step 2: Code Review

步骤2:代码评审

bash
undefined
bash
undefined

Perform comprehensive code review

执行全面代码评审

/stackshift.review

This reviews across 5 dimensions:
1. 🔍 **Correctness** - Works as intended, meets requirements
2. 📏 **Standards** - Follows conventions, well documented
3. 🔒 **Security** - No vulnerabilities, proper validation
4. ⚡ **Performance** - Efficient, scalable implementation
5. 🧪 **Testing** - Adequate coverage, edge cases handled

**Expected result:**
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📋 Review Report ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
/stackshift.review

评审涵盖5个维度:
1. 🔍 **正确性** - 功能正常,符合需求
2. 📏 **规范性** - 遵循编码规范,文档完善
3. 🔒 **安全性** - 无漏洞,验证正确
4. ⚡ **性能** - 高效、可扩展
5. 🧪 **测试** - 覆盖充分,处理边缘情况

**预期结果:**
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📋 评审报告 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✅ APPROVED

✅ 已批准

All quality checks passed Ready for deployment
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

If issues are found, I'll provide specific feedback with line numbers and recommendations.
所有质量检查通过 可部署
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

若发现问题,我会提供包含行号和建议的具体反馈。

Step 3: Generate Spec Coverage Map

步骤3:生成规范覆盖图

After validation passes, let's create the coverage map...

验证通过后,我们来创建覆盖图...

Final Step: Generate Spec Coverage Map

最终步骤:生成规范覆盖图

Now let's create a visual coverage map showing the relationship between your specifications and code:
bash
undefined
现在我们来创建可视化的覆盖图,展示规范与代码之间的关系:
bash
undefined

Generate coverage map

生成覆盖图


I'll analyze all specs in `.specify/specs/` and create:

1. **ASCII box diagrams** - Visual map of each spec's files
2. **Reverse index** - Which spec(s) cover each file
3. **Coverage statistics** - Percentages by category
4. **Heat map** - Visual coverage representation
5. **Gap analysis** - Files not covered by specs
6. **Shared files** - High-risk files used by multiple specs

**Output:** `docs/spec-coverage-map.md`

This provides crucial visibility into spec-code alignment and helps identify any gaps!

---

我将分析.specify/specs/中的所有规范,并生成:

1. **ASCII框图** - 每个规范对应的文件可视化地图
2. **反向索引** - 每个文件对应的规范
3. **覆盖统计** - 各分类的覆盖率百分比
4. **热图** - 可视化覆盖率展示
5. **缺口分析** - 未被规范覆盖的文件
6. **共享文件** - 被多个规范使用的高风险文件

**输出文件:** `docs/spec-coverage-map.md`

这将提供规范与代码对齐情况的关键可见性,帮助识别任何缺口!

---

Spec Coverage Health Report

规范覆盖健康报告

After generating the coverage map, I'll show you a summary:
📊 Spec Coverage Health Report

Overall Coverage: 91% (99/109 files)

By Category:
  Backend:       93% [████████████████░░]
  Frontend:      92% [████████████████░░]
  Infrastructure: 83% [███████████████░░░]
  Database:      100% [████████████████████]
  Scripts:       67% [█████████░░░░░░░░░]

Status:
  ✅ 12 specs covering 99 files
  ⚠️  10 gap files identified (need review)
  🔴 2 high-risk shared files (used by 4+ specs)

Full report: docs/spec-coverage-map.md

Congratulations! You've completed the 6-step Reverse Engineering to Spec-Driven Development process. Your codebase is now enterprise-grade, fully specified, and ready for sustainable development using GitHub Spec Kit or continue using StackShift to help develop new functionality. 🎉

Remember: Maintain the spec-driven workflow going forward:
  1. Requirements change → Update specs first (
    /speckit.specify
    )
  2. Plan implementation (
    /speckit.plan
    )
  3. Generate tasks (
    /speckit.tasks
    )
  4. Implement (
    /speckit.implement
    )
  5. Validate (
    /speckit.analyze
    )
This ensures specs and code never drift apart.
生成覆盖图后,我会展示摘要:
📊 规范覆盖健康报告

整体覆盖率:91% (99/109文件)

按分类:
  后端:       93% [████████████████░░]
  前端:      92% [████████████████░░]
  基础设施: 83% [███████████████░░░]
  数据库:      100% [████████████████████]
  脚本:       67% [█████████░░░░░░░░░]

状态:
  ✅ 12个规范覆盖99个文件
  ⚠️  识别出10个缺口文件(需评审)
  🔴 2个高风险共享文件(被4+个规范使用)

完整报告: docs/spec-coverage-map.md

恭喜! 你已完成从逆向工程到规范驱动开发的6步流程。你的代码库现在达到企业级标准,规范完整,并可使用GitHub Spec Kit或StackShift持续开发新功能。 🎉

请记住: 未来保持规范驱动的工作流:
  1. 需求变更 → 先更新规范(
    /speckit.specify
  2. 规划实现(
    /speckit.plan
  3. 生成任务(
    /speckit.tasks
  4. 实现功能(
    /speckit.implement
  5. 验证(
    /speckit.analyze
这将确保规范与代码永远不会脱节。