Skip to main content

Spec Driven Development

在 issue #452, AutoDev 现已集成两个强大的 AI 功能,实现结构化、可重复的开发工作流:

  1. GitHub Spec-Kit - 规范驱动开发工具包,通过优先关注规范来帮助构建软件
  2. Anthropic Claude Skills - 通过可发现、可重用的技能模块实现动态代理能力

这两个集成允许 AI 代理利用预定义的工作流、模板和最佳实践,提供一致的高质量结果。

graph TD
A[SketchRunContext.create] --> B{Check SpecKit Available}
B -->|Yes| C[Load SpecKit Commands]
B -->|No| D[Return Empty String]
C --> E[Format as Markdown]
E --> F[Include in System Prompt]
F --> G[sketch.vm Template]

H[.github/prompts/] --> I[speckit.plan.prompt.md]
H --> J[speckit.clarify.prompt.md]
H --> K[speckit.*.prompt.md]

I --> C
J --> C
K --> C

G --> L[AI Assistant Context]

style A fill:#e1f5ff
style G fill:#fff4e1
style L fill:#e8f5e9
style H fill:#f3e5f5

快速开始:Spec-Kit

  1. 在项目中初始化 SpecKit:
# 使用 specify CLI(推荐)
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
specify init my-project --ai copilot
  1. 或手动创建命令文件:
mkdir -p .github/prompts
# 添加你的 speckit.*.prompt.md 文件
  1. 在 AutoDev 中使用:
/speckit.constitution 创建项目原则

快速开始:Claude Skills

  1. 创建技能目录:
mkdir -p my-custom-skill
  1. 创建 SKILL.md:
---
name: my-custom-skill
description: 做一些很棒的事情
---

# 我的自定义技能

## 指令
[你的指令在这里]
  1. 在 AutoDev 中使用:
/skill.my-custom-skill 做一些很棒的事情

资源