Files
2025-12-15 18:53:39 +08:00

141 lines
4.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# /aide:setup 命令设计文档
## 一、概述
`/aide:setup` 是环境配置命令,专注于环境依赖分析、配置、检测和修复。
### 1.1 设计目标
| 目标 | 说明 |
|------|------|
| 独立运行 | 通常在新项目开始时单独执行 |
| 环境专注 | 只处理环境问题,不涉及任务执行 |
| 自动化 | 尽可能自动检测和修复环境问题 |
### 1.2 与旧命令的关系
本命令从原 `/aide:init` 中拆分出环境相关功能。
---
## 二、执行流程
```
┌─────────────────────────────────────────┐
│ /aide:setup │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ 强制触发 env-config skill │
│ (获取详细环境配置指导) │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ aide env ensure --runtime │
│ (检查 aide 运行时环境) │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ aide init │
│ (初始化 .aide 目录) │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ 分析项目依赖 │
│ (识别项目类型和所需模块) │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ aide env set modules ... │
│ (配置环境模块) │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ aide env ensure │
│ (执行环境检测) │
└─────────────────────────────────────────┘
┌──────────┴──────────┐
▼ ▼
[成功] [失败]
│ │
▼ ▼
完成汇报 故障排除
重试(最多3次)
```
---
## 三、职责边界
### 3.1 本命令负责
- 检测 aide 运行时环境
- 初始化 .aide 目录
- 分析项目类型和依赖
- 配置环境检测模块
- 执行环境检测和修复
- 处理环境问题
### 3.2 本命令不负责
- 项目认知和文档载入(由 `/aide:load` 负责)
- 任务准备和执行(由 `/aide:run` 负责)
- 项目文档管理(由 `/aide:docs` 负责)
---
## 四、触发的 Skill
| Skill | 触发方式 | 用途 |
|-------|----------|------|
| env-config | 强制触发 | 提供详细的环境配置和故障排除指导 |
---
## 五、使用场景
### 5.1 新项目开始
```bash
# 用户执行
/aide:setup
# LLM 执行流程
1. 触发 env-config skill
2. aide env ensure --runtime
3. aide init
4. 分析项目(检查 package.json、Cargo.toml 等)
5. aide env set modules <根据项目类型>
6. aide env ensure
7. 汇报结果
```
### 5.2 环境问题排查
当任务执行中遇到环境错误时,用户可重新执行此命令进行诊断和修复。
---
## 六、相关文档
- [执行文件](../../commands/setup.md)
- [env-config skill](../../skills/env-config/SKILL.md)
- [aide env 子命令](../../../../aide-program/docs/commands/env.md)
- [plugin 导览](../README.md)
---
## 七、版本信息
- 创建日期2025-12-15
-`/aide:init` 拆分而来