@fifine/aim-studio 0.0.4 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -41
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +42 -8
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +4 -104
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/templates/aim/scripts/export.py +2 -2
- package/dist/templates/claude/commands/aim/legitimize.md +268 -0
- package/dist/templates/claude/commands/aim/start.md +92 -179
- package/dist/templates/claude/commands/aim/story.md +60 -10
- package/dist/templates/markdown/index.d.ts +1 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +1 -0
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/spec/story/style-guide.md.txt +96 -0
- package/package.json +1 -1
- package/dist/migrations/manifests/0.3.0-rc.2.json +0 -9
- package/dist/templates/aim/scripts/multi_agent/__init__.py +0 -5
- package/dist/templates/aim/scripts/multi_agent/cleanup.py +0 -403
- package/dist/templates/aim/scripts/multi_agent/create_pr.py +0 -329
- package/dist/templates/aim/scripts/multi_agent/plan.py +0 -233
- package/dist/templates/aim/scripts/multi_agent/start.py +0 -461
- package/dist/templates/aim/scripts/multi_agent/status.py +0 -817
- package/dist/templates/aim/scripts-shell-archive/add-session.sh +0 -384
- package/dist/templates/aim/scripts-shell-archive/common/developer.sh +0 -129
- package/dist/templates/aim/scripts-shell-archive/common/git-context.sh +0 -263
- package/dist/templates/aim/scripts-shell-archive/common/paths.sh +0 -208
- package/dist/templates/aim/scripts-shell-archive/common/phase.sh +0 -150
- package/dist/templates/aim/scripts-shell-archive/common/registry.sh +0 -247
- package/dist/templates/aim/scripts-shell-archive/common/task-queue.sh +0 -142
- package/dist/templates/aim/scripts-shell-archive/common/task-utils.sh +0 -151
- package/dist/templates/aim/scripts-shell-archive/common/worktree.sh +0 -128
- package/dist/templates/aim/scripts-shell-archive/create-bootstrap.sh +0 -299
- package/dist/templates/aim/scripts-shell-archive/get-context.sh +0 -7
- package/dist/templates/aim/scripts-shell-archive/get-developer.sh +0 -15
- package/dist/templates/aim/scripts-shell-archive/init-developer.sh +0 -34
- package/dist/templates/aim/scripts-shell-archive/multi-agent/cleanup.sh +0 -396
- package/dist/templates/aim/scripts-shell-archive/multi-agent/create-pr.sh +0 -241
- package/dist/templates/aim/scripts-shell-archive/multi-agent/plan.sh +0 -207
- package/dist/templates/aim/scripts-shell-archive/multi-agent/start.sh +0 -317
- package/dist/templates/aim/scripts-shell-archive/multi-agent/status.sh +0 -828
- package/dist/templates/aim/scripts-shell-archive/task.sh +0 -1204
- package/dist/templates/claude/agents/check.md +0 -122
- package/dist/templates/claude/agents/debug.md +0 -106
- package/dist/templates/claude/agents/dispatch.md +0 -230
- package/dist/templates/claude/agents/implement.md +0 -96
- package/dist/templates/claude/agents/plan.md +0 -396
- package/dist/templates/claude/agents/research.md +0 -120
- package/dist/templates/claude/commands/aim/before-backend-dev.md +0 -13
- package/dist/templates/claude/commands/aim/before-frontend-dev.md +0 -13
- package/dist/templates/claude/commands/aim/break-loop.md +0 -153
- package/dist/templates/claude/commands/aim/check-backend.md +0 -13
- package/dist/templates/claude/commands/aim/check-cross-layer.md +0 -153
- package/dist/templates/claude/commands/aim/check-frontend.md +0 -13
- package/dist/templates/claude/commands/aim/create-command.md +0 -154
- package/dist/templates/claude/commands/aim/integrate-skill.md +0 -219
- package/dist/templates/claude/commands/aim/parallel.md +0 -217
- package/dist/templates/claude/commands/aim/update-spec.md +0 -285
- package/dist/templates/claude/hooks/ralph-loop.py +0 -388
- package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +0 -51
- package/dist/templates/markdown/spec/backend/directory-structure.md.txt +0 -54
- package/dist/templates/markdown/spec/backend/error-handling.md.txt +0 -51
- package/dist/templates/markdown/spec/backend/index.md +0 -40
- package/dist/templates/markdown/spec/backend/index.md.txt +0 -38
- package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +0 -51
- package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +0 -51
- package/dist/templates/markdown/spec/backend/script-conventions.md +0 -467
- package/dist/templates/markdown/spec/cli/directory-structure.md.txt +0 -71
- package/dist/templates/markdown/spec/cli/error-handling.md.txt +0 -91
- package/dist/templates/markdown/spec/cli/index.md.txt +0 -37
- package/dist/templates/markdown/spec/cli/options-flags.md.txt +0 -71
- package/dist/templates/markdown/spec/cli/output-formatting.md.txt +0 -93
- package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +0 -59
- package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +0 -54
- package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +0 -51
- package/dist/templates/markdown/spec/frontend/index.md.txt +0 -39
- package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +0 -51
- package/dist/templates/markdown/spec/frontend/state-management.md.txt +0 -51
- package/dist/templates/markdown/spec/frontend/type-safety.md.txt +0 -51
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md +0 -118
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +0 -92
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +0 -94
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md +0 -394
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +0 -319
- package/dist/templates/markdown/spec/guides/index.md.txt +0 -89
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
# 多 Agent 并行创作
|
|
2
|
-
|
|
3
|
-
启动多终端并行创作模式,让多个 AI Agent 同时创作不同剧集。
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## ⚠️ 重要安全说明
|
|
8
|
-
|
|
9
|
-
### 不会冲突的情况(安全)
|
|
10
|
-
|
|
11
|
-
| 资源 | 原因 |
|
|
12
|
-
|------|------|
|
|
13
|
-
| **Git Worktree** | 每个 Agent 有独立的工作树目录 |
|
|
14
|
-
| **Git 分支** | 每个 Agent 在独立分支上工作 |
|
|
15
|
-
| **任务目录** | 每个 Agent 有独立的 `.aim-studio/tasks/任务名/` |
|
|
16
|
-
| **进度日志** | 每个 Agent 有独立的日志文件 |
|
|
17
|
-
|
|
18
|
-
### 可能冲突的情况(需要注意)
|
|
19
|
-
|
|
20
|
-
| 资源 | 风险 | 解决方案 |
|
|
21
|
-
|------|------|----------|
|
|
22
|
-
| **创作输出** | 多 Agent 写入同一 workspace | ⚠️ **必须分配不同的剧集** |
|
|
23
|
-
| **角色设定** | 多 Agent 同时修改 character.md | ⚠️ **创作前完成所有角色设定** |
|
|
24
|
-
| **世界观** | 多 Agent 同时修改 world.md | ⚠️ **创作前完成世界观设定** |
|
|
25
|
-
|
|
26
|
-
### 🚨 核心规则
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
✅ 安全:Agent A 写第1集,Agent B 写第2集(不同剧集)
|
|
30
|
-
❌ 危险:Agent A 和 Agent B 同时写第1集(同一剧集)
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## 使用场景
|
|
36
|
-
|
|
37
|
-
| 场景 | 安全性 | 说明 |
|
|
38
|
-
|------|--------|------|
|
|
39
|
-
| **多剧集并行** | ✅ 安全 | Agent A 写第1集,Agent B 写第2集 |
|
|
40
|
-
| **主线/支线分离** | ✅ 安全 | Agent A 写主线,Agent B 写支线 |
|
|
41
|
-
| **创作+质检** | ⚠️ 需协调 | 质检 Agent 只读,不修改文件 |
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## 快速开始
|
|
46
|
-
|
|
47
|
-
### 步骤 0:完成共享设定(必须)
|
|
48
|
-
|
|
49
|
-
**在启动多 Agent 之前,必须完成所有角色和世界观设定!**
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
# 确保角色设定已完成
|
|
53
|
-
cat .aim-studio/spec/story/character.md
|
|
54
|
-
|
|
55
|
-
# 确保世界观设定已完成
|
|
56
|
-
cat .aim-studio/spec/story/world.md
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### 步骤 1:创建多个任务
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
# 创建任务 A(第1集)
|
|
63
|
-
aim task create "第1集:系统觉醒" --slug 第1集_系统觉醒
|
|
64
|
-
|
|
65
|
-
# 创建任务 B(第2集)
|
|
66
|
-
aim task create "第2集:初入江湖" --slug 第2集_初入江湖
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### 步骤 2:启动并行 Agent
|
|
70
|
-
|
|
71
|
-
**重要:每个 Agent 必须在不同的终端中运行!**
|
|
72
|
-
|
|
73
|
-
**终端 1:**
|
|
74
|
-
```bash
|
|
75
|
-
python3 ./.aim-studio/scripts/multi_agent/start.py .aim-studio/tasks/第1集_系统觉醒
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**终端 2:**
|
|
79
|
-
```bash
|
|
80
|
-
python3 ./.aim-studio/scripts/multi_agent/start.py .aim-studio/tasks/第2集_初入江湖
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### 步骤 3:监控进度
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
# 查看所有 Agent 状态
|
|
87
|
-
python3 ./.aim-studio/scripts/multi_agent/status.py
|
|
88
|
-
|
|
89
|
-
# 实时监控
|
|
90
|
-
python3 ./.aim-studio/scripts/multi_agent/status.py --watch
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## 隔离机制详解
|
|
96
|
-
|
|
97
|
-
### Git Worktree 隔离
|
|
98
|
-
|
|
99
|
-
每个 Agent 在独立的 Git Worktree 中运行:
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
主仓库 (main)
|
|
103
|
-
├── .aim-studio/
|
|
104
|
-
│ ├── spec/story/ # 共享设定(只读)
|
|
105
|
-
│ ├── tasks/ # 任务目录
|
|
106
|
-
│ │ ├── 第1集_系统觉醒/ # Agent A 的任务
|
|
107
|
-
│ │ └── 第2集_初入江湖/ # Agent B 的任务
|
|
108
|
-
│ └── workspace/ # 创作输出
|
|
109
|
-
│ └── 我的故事/
|
|
110
|
-
│ ├── 第1集_*/ # Agent A 的输出
|
|
111
|
-
│ └── 第2集_*/ # Agent B 的输出
|
|
112
|
-
│
|
|
113
|
-
└── .agents/ # Agent 工作树(自动创建)
|
|
114
|
-
├── registry.json # Agent 注册表
|
|
115
|
-
├── worktree-第1集/ # Agent A 的独立环境
|
|
116
|
-
│ └── .aim-studio/
|
|
117
|
-
│ └── .current-task → 第1集
|
|
118
|
-
└── worktree-第2集/ # Agent B 的独立环境
|
|
119
|
-
└── .aim-studio/
|
|
120
|
-
└── .current-task → 第2集
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### 数据安全保证
|
|
124
|
-
|
|
125
|
-
| 隔离级别 | 说明 |
|
|
126
|
-
|----------|------|
|
|
127
|
-
| **文件系统隔离** | 每个 Worktree 是独立的文件副本 |
|
|
128
|
-
| **Git 分支隔离** | 每个 Agent 在独立分支上工作 |
|
|
129
|
-
| **任务目录隔离** | 每个 Agent 有独立的任务配置 |
|
|
130
|
-
| **进度追踪隔离** | 每个 Agent 有独立的进度日志 |
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## 完成后合并
|
|
135
|
-
|
|
136
|
-
### 步骤 1:确认所有 Agent 完成
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
python3 ./.aim-studio/scripts/multi_agent/status.py
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
确保所有 Agent 状态为 `completed` 或 `finished`。
|
|
143
|
-
|
|
144
|
-
### 步骤 2:合并创作内容
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
# 将各 Agent 的创作内容合并到主仓库
|
|
148
|
-
# Agent A 的输出
|
|
149
|
-
cp -r .agents/worktree-第1集/.aim-studio/workspace/我的故事/第1集_* .aim-studio/workspace/我的故事/
|
|
150
|
-
|
|
151
|
-
# Agent B 的输出
|
|
152
|
-
cp -r .agents/worktree-第2集/.aim-studio/workspace/我的故事/第2集_* .aim-studio/workspace/我的故事/
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### 步骤 3:清理 Worktree
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
python3 ./.aim-studio/scripts/multi_agent/cleanup.py feature/第1集
|
|
159
|
-
python3 ./.aim-studio/scripts/multi_agent/cleanup.py feature/第2集
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## 故障排除
|
|
165
|
-
|
|
166
|
-
### Agent 启动失败
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
# 检查任务目录是否存在
|
|
170
|
-
ls .aim-studio/tasks/
|
|
171
|
-
|
|
172
|
-
# 检查 task.json 是否有效
|
|
173
|
-
cat .aim-studio/tasks/<任务名>/task.json
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Worktree 冲突
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
# 手动清理 Worktree
|
|
180
|
-
git worktree list
|
|
181
|
-
git worktree remove .agents/worktree-<name>
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Registry 损坏
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
# 重置 Registry
|
|
188
|
-
rm .agents/registry.json
|
|
189
|
-
python3 ./.aim-studio/scripts/multi_agent/status.py
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## 最佳实践
|
|
195
|
-
|
|
196
|
-
### ✅ 应该做
|
|
197
|
-
|
|
198
|
-
1. **创作前完成所有共享设定**(角色、世界观)
|
|
199
|
-
2. **为每个 Agent 分配不同的剧集**
|
|
200
|
-
3. **定期检查 Agent 状态**
|
|
201
|
-
4. **完成后及时合并和清理**
|
|
202
|
-
|
|
203
|
-
### ❌ 不应该做
|
|
204
|
-
|
|
205
|
-
1. **不要让多个 Agent 同时创作同一剧集**
|
|
206
|
-
2. **不要在创作过程中修改共享设定**
|
|
207
|
-
3. **不要忘记清理完成的 Worktree**
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
## 相关命令
|
|
212
|
-
|
|
213
|
-
| 命令 | 说明 |
|
|
214
|
-
|------|------|
|
|
215
|
-
| `/aim:start` | 单 Agent 创作模式 |
|
|
216
|
-
| `/aim:story` | 漫剧创作模式 |
|
|
217
|
-
| `/aim:finish-work` | 完成工作并记录进度 |
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
# Update Spec - Capture Knowledge into Specifications
|
|
2
|
-
|
|
3
|
-
When you learn something valuable (from debugging, implementing, or discussion), use this command to update the relevant spec documents.
|
|
4
|
-
|
|
5
|
-
**Timing**: After completing a task, fixing a bug, or discovering a new pattern
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## When to Update Specs
|
|
10
|
-
|
|
11
|
-
| Trigger | Example | Target Spec |
|
|
12
|
-
|---------|---------|-------------|
|
|
13
|
-
| **Implemented a feature** | Added template download with giget | Relevant `backend/` or `frontend/` file |
|
|
14
|
-
| **Made a design decision** | Used type field + mapping table for extensibility | Relevant spec + "Design Decisions" section |
|
|
15
|
-
| **Fixed a bug** | Found a subtle issue with error handling | `backend/error-handling.md` |
|
|
16
|
-
| **Discovered a pattern** | Found a better way to structure code | Relevant `backend/` or `frontend/` file |
|
|
17
|
-
| **Hit a gotcha** | Learned that X must be done before Y | Relevant spec + "Common Mistakes" section |
|
|
18
|
-
| **Established a convention** | Team agreed on naming pattern | `quality-guidelines.md` |
|
|
19
|
-
| **New thinking trigger** | "Don't forget to check X before doing Y" | `guides/*.md` (as a checklist item, not detailed rules) |
|
|
20
|
-
|
|
21
|
-
**Key Insight**: Spec updates are NOT just for problems. Every feature implementation contains design decisions and project conventions that future AI/developers need to know.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Spec Structure Overview
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
.aim-studio/spec/
|
|
29
|
-
├── backend/ # Backend coding standards
|
|
30
|
-
│ ├── index.md # Overview and links
|
|
31
|
-
│ └── *.md # Topic-specific guidelines
|
|
32
|
-
├── frontend/ # Frontend coding standards
|
|
33
|
-
│ ├── index.md # Overview and links
|
|
34
|
-
│ └── *.md # Topic-specific guidelines
|
|
35
|
-
└── guides/ # Thinking checklists (NOT coding specs!)
|
|
36
|
-
├── index.md # Guide index
|
|
37
|
-
└── *.md # Topic-specific guides
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### CRITICAL: Spec vs Guide - Know the Difference
|
|
41
|
-
|
|
42
|
-
| Type | Location | Purpose | Content Style |
|
|
43
|
-
|------|----------|---------|---------------|
|
|
44
|
-
| **Spec** | `backend/*.md`, `frontend/*.md` | Tell AI "how to write code" | Detailed rules, code examples, forbidden patterns |
|
|
45
|
-
| **Guide** | `guides/*.md` | Help AI "what to think about" | Checklists, questions, pointers to specs |
|
|
46
|
-
|
|
47
|
-
**Decision Rule**: Ask yourself:
|
|
48
|
-
|
|
49
|
-
- "This is **how to write** the code" → Put in `backend/` or `frontend/`
|
|
50
|
-
- "This is **what to consider** before writing" → Put in `guides/`
|
|
51
|
-
|
|
52
|
-
**Example**:
|
|
53
|
-
|
|
54
|
-
| Learning | Wrong Location | Correct Location |
|
|
55
|
-
|----------|----------------|------------------|
|
|
56
|
-
| "Use `reconfigure()` not `TextIOWrapper` for Windows stdout" | ❌ `guides/cross-platform-thinking-guide.md` | ✅ `backend/script-conventions.md` |
|
|
57
|
-
| "Remember to check encoding when writing cross-platform code" | ❌ `backend/script-conventions.md` | ✅ `guides/cross-platform-thinking-guide.md` |
|
|
58
|
-
|
|
59
|
-
**Guides should be short checklists that point to specs**, not duplicate the detailed rules.
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Update Process
|
|
64
|
-
|
|
65
|
-
### Step 1: Identify What You Learned
|
|
66
|
-
|
|
67
|
-
Answer these questions:
|
|
68
|
-
|
|
69
|
-
1. **What did you learn?** (Be specific)
|
|
70
|
-
2. **Why is it important?** (What problem does it prevent?)
|
|
71
|
-
3. **Where does it belong?** (Which spec file?)
|
|
72
|
-
|
|
73
|
-
### Step 2: Classify the Update Type
|
|
74
|
-
|
|
75
|
-
| Type | Description | Action |
|
|
76
|
-
|------|-------------|--------|
|
|
77
|
-
| **Design Decision** | Why we chose approach X over Y | Add to "Design Decisions" section |
|
|
78
|
-
| **Project Convention** | How we do X in this project | Add to relevant section with examples |
|
|
79
|
-
| **New Pattern** | A reusable approach discovered | Add to "Patterns" section |
|
|
80
|
-
| **Forbidden Pattern** | Something that causes problems | Add to "Anti-patterns" or "Don't" section |
|
|
81
|
-
| **Common Mistake** | Easy-to-make error | Add to "Common Mistakes" section |
|
|
82
|
-
| **Convention** | Agreed-upon standard | Add to relevant section |
|
|
83
|
-
| **Gotcha** | Non-obvious behavior | Add warning callout |
|
|
84
|
-
|
|
85
|
-
### Step 3: Read the Target Spec
|
|
86
|
-
|
|
87
|
-
Before editing, read the current spec to:
|
|
88
|
-
- Understand existing structure
|
|
89
|
-
- Avoid duplicating content
|
|
90
|
-
- Find the right section for your update
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
cat .aim-studio/spec/<category>/<file>.md
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Step 4: Make the Update
|
|
97
|
-
|
|
98
|
-
Follow these principles:
|
|
99
|
-
|
|
100
|
-
1. **Be Specific**: Include concrete examples, not just abstract rules
|
|
101
|
-
2. **Explain Why**: State the problem this prevents
|
|
102
|
-
3. **Show Code**: Add code snippets for patterns
|
|
103
|
-
4. **Keep it Short**: One concept per section
|
|
104
|
-
|
|
105
|
-
### Step 5: Update the Index (if needed)
|
|
106
|
-
|
|
107
|
-
If you added a new section or the spec status changed, update the category's `index.md`.
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Update Templates
|
|
112
|
-
|
|
113
|
-
### Adding a Design Decision
|
|
114
|
-
|
|
115
|
-
```markdown
|
|
116
|
-
### Design Decision: [Decision Name]
|
|
117
|
-
|
|
118
|
-
**Context**: What problem were we solving?
|
|
119
|
-
|
|
120
|
-
**Options Considered**:
|
|
121
|
-
1. Option A - brief description
|
|
122
|
-
2. Option B - brief description
|
|
123
|
-
|
|
124
|
-
**Decision**: We chose Option X because...
|
|
125
|
-
|
|
126
|
-
**Example**:
|
|
127
|
-
\`\`\`typescript
|
|
128
|
-
// How it's implemented
|
|
129
|
-
code example
|
|
130
|
-
\`\`\`
|
|
131
|
-
|
|
132
|
-
**Extensibility**: How to extend this in the future...
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Adding a Project Convention
|
|
136
|
-
|
|
137
|
-
```markdown
|
|
138
|
-
### Convention: [Convention Name]
|
|
139
|
-
|
|
140
|
-
**What**: Brief description of the convention.
|
|
141
|
-
|
|
142
|
-
**Why**: Why we do it this way in this project.
|
|
143
|
-
|
|
144
|
-
**Example**:
|
|
145
|
-
\`\`\`typescript
|
|
146
|
-
// How to follow this convention
|
|
147
|
-
code example
|
|
148
|
-
\`\`\`
|
|
149
|
-
|
|
150
|
-
**Related**: Links to related conventions or specs.
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Adding a New Pattern
|
|
154
|
-
|
|
155
|
-
```markdown
|
|
156
|
-
### Pattern Name
|
|
157
|
-
|
|
158
|
-
**Problem**: What problem does this solve?
|
|
159
|
-
|
|
160
|
-
**Solution**: Brief description of the approach.
|
|
161
|
-
|
|
162
|
-
**Example**:
|
|
163
|
-
\`\`\`
|
|
164
|
-
// Good
|
|
165
|
-
code example
|
|
166
|
-
|
|
167
|
-
// Bad
|
|
168
|
-
code example
|
|
169
|
-
\`\`\`
|
|
170
|
-
|
|
171
|
-
**Why**: Explanation of why this works better.
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Adding a Forbidden Pattern
|
|
175
|
-
|
|
176
|
-
```markdown
|
|
177
|
-
### Don't: Pattern Name
|
|
178
|
-
|
|
179
|
-
**Problem**:
|
|
180
|
-
\`\`\`
|
|
181
|
-
// Don't do this
|
|
182
|
-
bad code example
|
|
183
|
-
\`\`\`
|
|
184
|
-
|
|
185
|
-
**Why it's bad**: Explanation of the issue.
|
|
186
|
-
|
|
187
|
-
**Instead**:
|
|
188
|
-
\`\`\`
|
|
189
|
-
// Do this instead
|
|
190
|
-
good code example
|
|
191
|
-
\`\`\`
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### Adding a Common Mistake
|
|
195
|
-
|
|
196
|
-
```markdown
|
|
197
|
-
### Common Mistake: Description
|
|
198
|
-
|
|
199
|
-
**Symptom**: What goes wrong
|
|
200
|
-
|
|
201
|
-
**Cause**: Why this happens
|
|
202
|
-
|
|
203
|
-
**Fix**: How to correct it
|
|
204
|
-
|
|
205
|
-
**Prevention**: How to avoid it in the future
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Adding a Gotcha
|
|
209
|
-
|
|
210
|
-
```markdown
|
|
211
|
-
> **Warning**: Brief description of the non-obvious behavior.
|
|
212
|
-
>
|
|
213
|
-
> Details about when this happens and how to handle it.
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
|
-
## Interactive Mode
|
|
219
|
-
|
|
220
|
-
If you're unsure what to update, answer these prompts:
|
|
221
|
-
|
|
222
|
-
1. **What did you just finish?**
|
|
223
|
-
- [ ] Fixed a bug
|
|
224
|
-
- [ ] Implemented a feature
|
|
225
|
-
- [ ] Refactored code
|
|
226
|
-
- [ ] Had a discussion about approach
|
|
227
|
-
|
|
228
|
-
2. **What did you learn or decide?**
|
|
229
|
-
- Design decision (why X over Y)
|
|
230
|
-
- Project convention (how we do X)
|
|
231
|
-
- Non-obvious behavior (gotcha)
|
|
232
|
-
- Better approach (pattern)
|
|
233
|
-
|
|
234
|
-
3. **Would future AI/developers need to know this?**
|
|
235
|
-
- To understand how the code works → Yes, update spec
|
|
236
|
-
- To maintain or extend the feature → Yes, update spec
|
|
237
|
-
- To avoid repeating mistakes → Yes, update spec
|
|
238
|
-
- Purely one-off implementation detail → Maybe skip
|
|
239
|
-
|
|
240
|
-
4. **Which area does it relate to?**
|
|
241
|
-
- [ ] Backend code
|
|
242
|
-
- [ ] Frontend code
|
|
243
|
-
- [ ] Cross-layer data flow
|
|
244
|
-
- [ ] Code organization/reuse
|
|
245
|
-
- [ ] Quality/testing
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
## Quality Checklist
|
|
250
|
-
|
|
251
|
-
Before finishing your spec update:
|
|
252
|
-
|
|
253
|
-
- [ ] Is the content specific and actionable?
|
|
254
|
-
- [ ] Did you include a code example?
|
|
255
|
-
- [ ] Did you explain WHY, not just WHAT?
|
|
256
|
-
- [ ] Is it in the right spec file?
|
|
257
|
-
- [ ] Does it duplicate existing content?
|
|
258
|
-
- [ ] Would a new team member understand it?
|
|
259
|
-
|
|
260
|
-
---
|
|
261
|
-
|
|
262
|
-
## Relationship to Other Commands
|
|
263
|
-
|
|
264
|
-
```
|
|
265
|
-
Development Flow:
|
|
266
|
-
Learn something → /aim:update-spec → Knowledge captured
|
|
267
|
-
↑ ↓
|
|
268
|
-
/aim:break-loop ←──────────────────── Future sessions benefit
|
|
269
|
-
(deep bug analysis)
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
- `/aim:break-loop` - Analyzes bugs deeply, often reveals spec updates needed
|
|
273
|
-
- `/aim:update-spec` - Actually makes the updates (this command)
|
|
274
|
-
- `/aim:finish-work` - Reminds you to check if specs need updates
|
|
275
|
-
|
|
276
|
-
---
|
|
277
|
-
|
|
278
|
-
## Core Philosophy
|
|
279
|
-
|
|
280
|
-
> **Specs are living documents. Every debugging session, every "aha moment" is an opportunity to make the spec better.**
|
|
281
|
-
|
|
282
|
-
The goal is **institutional memory**:
|
|
283
|
-
- What one person learns, everyone benefits from
|
|
284
|
-
- What AI learns in one session, persists to future sessions
|
|
285
|
-
- Mistakes become documented guardrails
|