@fifine/aim-studio 0.0.1

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.
Files changed (289) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +159 -0
  3. package/bin/aim.js +3 -0
  4. package/dist/cli/index.d.ts +3 -0
  5. package/dist/cli/index.d.ts.map +1 -0
  6. package/dist/cli/index.js +89 -0
  7. package/dist/cli/index.js.map +1 -0
  8. package/dist/commands/init.d.ts +13 -0
  9. package/dist/commands/init.d.ts.map +1 -0
  10. package/dist/commands/init.js +513 -0
  11. package/dist/commands/init.js.map +1 -0
  12. package/dist/commands/update.d.ts +27 -0
  13. package/dist/commands/update.d.ts.map +1 -0
  14. package/dist/commands/update.js +1275 -0
  15. package/dist/commands/update.js.map +1 -0
  16. package/dist/configurators/claude.d.ts +32 -0
  17. package/dist/configurators/claude.d.ts.map +1 -0
  18. package/dist/configurators/claude.js +98 -0
  19. package/dist/configurators/claude.js.map +1 -0
  20. package/dist/configurators/index.d.ts +51 -0
  21. package/dist/configurators/index.d.ts.map +1 -0
  22. package/dist/configurators/index.js +113 -0
  23. package/dist/configurators/index.js.map +1 -0
  24. package/dist/configurators/shared.d.ts +12 -0
  25. package/dist/configurators/shared.d.ts.map +1 -0
  26. package/dist/configurators/shared.js +21 -0
  27. package/dist/configurators/shared.js.map +1 -0
  28. package/dist/configurators/workflow.d.ts +28 -0
  29. package/dist/configurators/workflow.d.ts.map +1 -0
  30. package/dist/configurators/workflow.js +147 -0
  31. package/dist/configurators/workflow.js.map +1 -0
  32. package/dist/constants/paths.d.ts +68 -0
  33. package/dist/constants/paths.d.ts.map +1 -0
  34. package/dist/constants/paths.js +77 -0
  35. package/dist/constants/paths.js.map +1 -0
  36. package/dist/constants/version.d.ts +9 -0
  37. package/dist/constants/version.d.ts.map +1 -0
  38. package/dist/constants/version.js +15 -0
  39. package/dist/constants/version.js.map +1 -0
  40. package/dist/index.d.ts +9 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +9 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/migrations/index.d.ts +54 -0
  45. package/dist/migrations/index.d.ts.map +1 -0
  46. package/dist/migrations/index.js +160 -0
  47. package/dist/migrations/index.js.map +1 -0
  48. package/dist/migrations/manifests/0.0.1.json +9 -0
  49. package/dist/migrations/manifests/0.1.9.json +30 -0
  50. package/dist/migrations/manifests/0.2.0.json +49 -0
  51. package/dist/migrations/manifests/0.2.12.json +9 -0
  52. package/dist/migrations/manifests/0.2.13.json +9 -0
  53. package/dist/migrations/manifests/0.2.14.json +175 -0
  54. package/dist/migrations/manifests/0.2.15.json +33 -0
  55. package/dist/migrations/manifests/0.3.0-beta.0.json +278 -0
  56. package/dist/migrations/manifests/0.3.0-beta.1.json +9 -0
  57. package/dist/migrations/manifests/0.3.0-beta.10.json +9 -0
  58. package/dist/migrations/manifests/0.3.0-beta.11.json +9 -0
  59. package/dist/migrations/manifests/0.3.0-beta.12.json +9 -0
  60. package/dist/migrations/manifests/0.3.0-beta.13.json +9 -0
  61. package/dist/migrations/manifests/0.3.0-beta.14.json +9 -0
  62. package/dist/migrations/manifests/0.3.0-beta.15.json +9 -0
  63. package/dist/migrations/manifests/0.3.0-beta.16.json +9 -0
  64. package/dist/migrations/manifests/0.3.0-beta.2.json +9 -0
  65. package/dist/migrations/manifests/0.3.0-beta.3.json +9 -0
  66. package/dist/migrations/manifests/0.3.0-beta.4.json +9 -0
  67. package/dist/migrations/manifests/0.3.0-beta.5.json +9 -0
  68. package/dist/migrations/manifests/0.3.0-beta.6.json +9 -0
  69. package/dist/migrations/manifests/0.3.0-beta.7.json +11 -0
  70. package/dist/migrations/manifests/0.3.0-beta.8.json +9 -0
  71. package/dist/migrations/manifests/0.3.0-beta.9.json +9 -0
  72. package/dist/migrations/manifests/0.3.0-rc.0.json +9 -0
  73. package/dist/migrations/manifests/0.3.0-rc.1.json +9 -0
  74. package/dist/migrations/manifests/0.3.0-rc.2.json +9 -0
  75. package/dist/templates/CLAUDE.md +71 -0
  76. package/dist/templates/aim/gitignore.txt +29 -0
  77. package/dist/templates/aim/index.d.ts +49 -0
  78. package/dist/templates/aim/index.d.ts.map +1 -0
  79. package/dist/templates/aim/index.js +92 -0
  80. package/dist/templates/aim/index.js.map +1 -0
  81. package/dist/templates/aim/scripts/__init__.py +5 -0
  82. package/dist/templates/aim/scripts/add_session.py +392 -0
  83. package/dist/templates/aim/scripts/common/__init__.py +80 -0
  84. package/dist/templates/aim/scripts/common/cli_adapter.py +435 -0
  85. package/dist/templates/aim/scripts/common/developer.py +190 -0
  86. package/dist/templates/aim/scripts/common/git_context.py +383 -0
  87. package/dist/templates/aim/scripts/common/paths.py +347 -0
  88. package/dist/templates/aim/scripts/common/phase.py +253 -0
  89. package/dist/templates/aim/scripts/common/registry.py +366 -0
  90. package/dist/templates/aim/scripts/common/task_queue.py +255 -0
  91. package/dist/templates/aim/scripts/common/task_utils.py +178 -0
  92. package/dist/templates/aim/scripts/common/worktree.py +219 -0
  93. package/dist/templates/aim/scripts/create_bootstrap.py +290 -0
  94. package/dist/templates/aim/scripts/get_context.py +16 -0
  95. package/dist/templates/aim/scripts/get_developer.py +26 -0
  96. package/dist/templates/aim/scripts/init_developer.py +51 -0
  97. package/dist/templates/aim/scripts/multi_agent/__init__.py +5 -0
  98. package/dist/templates/aim/scripts/multi_agent/cleanup.py +403 -0
  99. package/dist/templates/aim/scripts/multi_agent/create_pr.py +329 -0
  100. package/dist/templates/aim/scripts/multi_agent/plan.py +233 -0
  101. package/dist/templates/aim/scripts/multi_agent/start.py +461 -0
  102. package/dist/templates/aim/scripts/multi_agent/status.py +817 -0
  103. package/dist/templates/aim/scripts/task.py +1068 -0
  104. package/dist/templates/aim/scripts-shell-archive/add-session.sh +384 -0
  105. package/dist/templates/aim/scripts-shell-archive/common/developer.sh +129 -0
  106. package/dist/templates/aim/scripts-shell-archive/common/git-context.sh +263 -0
  107. package/dist/templates/aim/scripts-shell-archive/common/paths.sh +208 -0
  108. package/dist/templates/aim/scripts-shell-archive/common/phase.sh +150 -0
  109. package/dist/templates/aim/scripts-shell-archive/common/registry.sh +247 -0
  110. package/dist/templates/aim/scripts-shell-archive/common/task-queue.sh +142 -0
  111. package/dist/templates/aim/scripts-shell-archive/common/task-utils.sh +151 -0
  112. package/dist/templates/aim/scripts-shell-archive/common/worktree.sh +128 -0
  113. package/dist/templates/aim/scripts-shell-archive/create-bootstrap.sh +299 -0
  114. package/dist/templates/aim/scripts-shell-archive/get-context.sh +7 -0
  115. package/dist/templates/aim/scripts-shell-archive/get-developer.sh +15 -0
  116. package/dist/templates/aim/scripts-shell-archive/init-developer.sh +34 -0
  117. package/dist/templates/aim/scripts-shell-archive/multi-agent/cleanup.sh +396 -0
  118. package/dist/templates/aim/scripts-shell-archive/multi-agent/create-pr.sh +241 -0
  119. package/dist/templates/aim/scripts-shell-archive/multi-agent/plan.sh +207 -0
  120. package/dist/templates/aim/scripts-shell-archive/multi-agent/start.sh +317 -0
  121. package/dist/templates/aim/scripts-shell-archive/multi-agent/status.sh +828 -0
  122. package/dist/templates/aim/scripts-shell-archive/task.sh +1204 -0
  123. package/dist/templates/aim/tasks/.gitkeep +0 -0
  124. package/dist/templates/aim/workflow.md +258 -0
  125. package/dist/templates/aim/worktree.yaml +47 -0
  126. package/dist/templates/claude/agents/check.md +122 -0
  127. package/dist/templates/claude/agents/debug.md +106 -0
  128. package/dist/templates/claude/agents/dispatch.md +230 -0
  129. package/dist/templates/claude/agents/implement.md +96 -0
  130. package/dist/templates/claude/agents/plan.md +396 -0
  131. package/dist/templates/claude/agents/research.md +120 -0
  132. package/dist/templates/claude/agents/story.md +53 -0
  133. package/dist/templates/claude/commands/aim/before-backend-dev.md +13 -0
  134. package/dist/templates/claude/commands/aim/before-frontend-dev.md +13 -0
  135. package/dist/templates/claude/commands/aim/break-loop.md +153 -0
  136. package/dist/templates/claude/commands/aim/check-backend.md +13 -0
  137. package/dist/templates/claude/commands/aim/check-cross-layer.md +153 -0
  138. package/dist/templates/claude/commands/aim/check-frontend.md +13 -0
  139. package/dist/templates/claude/commands/aim/check-story.md +59 -0
  140. package/dist/templates/claude/commands/aim/create-command.md +154 -0
  141. package/dist/templates/claude/commands/aim/export.md +187 -0
  142. package/dist/templates/claude/commands/aim/finish-work.md +104 -0
  143. package/dist/templates/claude/commands/aim/integrate-skill.md +219 -0
  144. package/dist/templates/claude/commands/aim/onboard.md +358 -0
  145. package/dist/templates/claude/commands/aim/parallel.md +217 -0
  146. package/dist/templates/claude/commands/aim/portrait.md +170 -0
  147. package/dist/templates/claude/commands/aim/record-session.md +92 -0
  148. package/dist/templates/claude/commands/aim/start.md +112 -0
  149. package/dist/templates/claude/commands/aim/story.md +140 -0
  150. package/dist/templates/claude/commands/aim/update-spec.md +285 -0
  151. package/dist/templates/claude/commands/aim/visualize.md +182 -0
  152. package/dist/templates/claude/commands/trellis/before-backend-dev.md +13 -0
  153. package/dist/templates/claude/commands/trellis/before-frontend-dev.md +13 -0
  154. package/dist/templates/claude/commands/trellis/break-loop.md +125 -0
  155. package/dist/templates/claude/commands/trellis/check-backend.md +13 -0
  156. package/dist/templates/claude/commands/trellis/check-cross-layer.md +153 -0
  157. package/dist/templates/claude/commands/trellis/check-frontend.md +13 -0
  158. package/dist/templates/claude/commands/trellis/create-command.md +154 -0
  159. package/dist/templates/claude/commands/trellis/finish-work.md +129 -0
  160. package/dist/templates/claude/commands/trellis/integrate-skill.md +219 -0
  161. package/dist/templates/claude/commands/trellis/onboard.md +358 -0
  162. package/dist/templates/claude/commands/trellis/parallel.md +193 -0
  163. package/dist/templates/claude/commands/trellis/record-session.md +62 -0
  164. package/dist/templates/claude/commands/trellis/start.md +280 -0
  165. package/dist/templates/claude/commands/trellis/update-spec.md +285 -0
  166. package/dist/templates/claude/hooks/inject-subagent-context.py +772 -0
  167. package/dist/templates/claude/hooks/ralph-loop.py +388 -0
  168. package/dist/templates/claude/hooks/session-start.py +142 -0
  169. package/dist/templates/claude/index.d.ts +54 -0
  170. package/dist/templates/claude/index.d.ts.map +1 -0
  171. package/dist/templates/claude/index.js +85 -0
  172. package/dist/templates/claude/index.js.map +1 -0
  173. package/dist/templates/claude/settings.json +41 -0
  174. package/dist/templates/extract.d.ts +68 -0
  175. package/dist/templates/extract.d.ts.map +1 -0
  176. package/dist/templates/extract.js +128 -0
  177. package/dist/templates/extract.js.map +1 -0
  178. package/dist/templates/markdown/agents.md +25 -0
  179. package/dist/templates/markdown/gitignore.txt +12 -0
  180. package/dist/templates/markdown/index.d.ts +32 -0
  181. package/dist/templates/markdown/index.d.ts.map +1 -0
  182. package/dist/templates/markdown/index.js +58 -0
  183. package/dist/templates/markdown/index.js.map +1 -0
  184. package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +51 -0
  185. package/dist/templates/markdown/spec/backend/directory-structure.md.txt +54 -0
  186. package/dist/templates/markdown/spec/backend/error-handling.md.txt +51 -0
  187. package/dist/templates/markdown/spec/backend/index.md +40 -0
  188. package/dist/templates/markdown/spec/backend/index.md.txt +38 -0
  189. package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +51 -0
  190. package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +51 -0
  191. package/dist/templates/markdown/spec/backend/script-conventions.md +467 -0
  192. package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +59 -0
  193. package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +54 -0
  194. package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +51 -0
  195. package/dist/templates/markdown/spec/frontend/index.md.txt +39 -0
  196. package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +51 -0
  197. package/dist/templates/markdown/spec/frontend/state-management.md.txt +51 -0
  198. package/dist/templates/markdown/spec/frontend/type-safety.md.txt +51 -0
  199. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md +118 -0
  200. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +92 -0
  201. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +94 -0
  202. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md +394 -0
  203. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +319 -0
  204. package/dist/templates/markdown/spec/guides/index.md.txt +89 -0
  205. package/dist/templates/markdown/spec/story/character.md.txt +95 -0
  206. package/dist/templates/markdown/spec/story/index.md.txt +31 -0
  207. package/dist/templates/markdown/spec/story/script.md.txt +313 -0
  208. package/dist/templates/markdown/spec/story/world.md.txt +92 -0
  209. package/dist/templates/markdown/workspace-index.md +123 -0
  210. package/dist/templates/markdown/worktree.yaml.txt +58 -0
  211. package/dist/templates/trellis/gitignore.txt +29 -0
  212. package/dist/templates/trellis/index.d.ts +49 -0
  213. package/dist/templates/trellis/index.d.ts.map +1 -0
  214. package/dist/templates/trellis/index.js +92 -0
  215. package/dist/templates/trellis/index.js.map +1 -0
  216. package/dist/templates/trellis/scripts/__init__.py +5 -0
  217. package/dist/templates/trellis/scripts/add_session.py +392 -0
  218. package/dist/templates/trellis/scripts/common/__init__.py +80 -0
  219. package/dist/templates/trellis/scripts/common/cli_adapter.py +435 -0
  220. package/dist/templates/trellis/scripts/common/developer.py +190 -0
  221. package/dist/templates/trellis/scripts/common/git_context.py +383 -0
  222. package/dist/templates/trellis/scripts/common/paths.py +347 -0
  223. package/dist/templates/trellis/scripts/common/phase.py +253 -0
  224. package/dist/templates/trellis/scripts/common/registry.py +366 -0
  225. package/dist/templates/trellis/scripts/common/task_queue.py +255 -0
  226. package/dist/templates/trellis/scripts/common/task_utils.py +178 -0
  227. package/dist/templates/trellis/scripts/common/worktree.py +219 -0
  228. package/dist/templates/trellis/scripts/create_bootstrap.py +290 -0
  229. package/dist/templates/trellis/scripts/get_context.py +16 -0
  230. package/dist/templates/trellis/scripts/get_developer.py +26 -0
  231. package/dist/templates/trellis/scripts/init_developer.py +51 -0
  232. package/dist/templates/trellis/scripts/multi_agent/__init__.py +5 -0
  233. package/dist/templates/trellis/scripts/multi_agent/cleanup.py +403 -0
  234. package/dist/templates/trellis/scripts/multi_agent/create_pr.py +329 -0
  235. package/dist/templates/trellis/scripts/multi_agent/plan.py +233 -0
  236. package/dist/templates/trellis/scripts/multi_agent/start.py +461 -0
  237. package/dist/templates/trellis/scripts/multi_agent/status.py +817 -0
  238. package/dist/templates/trellis/scripts/task.py +1056 -0
  239. package/dist/templates/trellis/scripts-shell-archive/add-session.sh +384 -0
  240. package/dist/templates/trellis/scripts-shell-archive/common/developer.sh +129 -0
  241. package/dist/templates/trellis/scripts-shell-archive/common/git-context.sh +263 -0
  242. package/dist/templates/trellis/scripts-shell-archive/common/paths.sh +208 -0
  243. package/dist/templates/trellis/scripts-shell-archive/common/phase.sh +150 -0
  244. package/dist/templates/trellis/scripts-shell-archive/common/registry.sh +247 -0
  245. package/dist/templates/trellis/scripts-shell-archive/common/task-queue.sh +142 -0
  246. package/dist/templates/trellis/scripts-shell-archive/common/task-utils.sh +151 -0
  247. package/dist/templates/trellis/scripts-shell-archive/common/worktree.sh +128 -0
  248. package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +299 -0
  249. package/dist/templates/trellis/scripts-shell-archive/get-context.sh +7 -0
  250. package/dist/templates/trellis/scripts-shell-archive/get-developer.sh +15 -0
  251. package/dist/templates/trellis/scripts-shell-archive/init-developer.sh +34 -0
  252. package/dist/templates/trellis/scripts-shell-archive/multi-agent/cleanup.sh +396 -0
  253. package/dist/templates/trellis/scripts-shell-archive/multi-agent/create-pr.sh +241 -0
  254. package/dist/templates/trellis/scripts-shell-archive/multi-agent/plan.sh +207 -0
  255. package/dist/templates/trellis/scripts-shell-archive/multi-agent/start.sh +317 -0
  256. package/dist/templates/trellis/scripts-shell-archive/multi-agent/status.sh +828 -0
  257. package/dist/templates/trellis/scripts-shell-archive/task.sh +1204 -0
  258. package/dist/templates/trellis/tasks/.gitkeep +0 -0
  259. package/dist/templates/trellis/workflow.md +416 -0
  260. package/dist/templates/trellis/worktree.yaml +47 -0
  261. package/dist/types/ai-tools.d.ts +48 -0
  262. package/dist/types/ai-tools.d.ts.map +1 -0
  263. package/dist/types/ai-tools.js +32 -0
  264. package/dist/types/ai-tools.js.map +1 -0
  265. package/dist/types/migration.d.ts +86 -0
  266. package/dist/types/migration.d.ts.map +1 -0
  267. package/dist/types/migration.js +8 -0
  268. package/dist/types/migration.js.map +1 -0
  269. package/dist/utils/compare-versions.d.ts +12 -0
  270. package/dist/utils/compare-versions.d.ts.map +1 -0
  271. package/dist/utils/compare-versions.js +76 -0
  272. package/dist/utils/compare-versions.js.map +1 -0
  273. package/dist/utils/file-writer.d.ts +23 -0
  274. package/dist/utils/file-writer.d.ts.map +1 -0
  275. package/dist/utils/file-writer.js +140 -0
  276. package/dist/utils/file-writer.js.map +1 -0
  277. package/dist/utils/project-detector.d.ts +16 -0
  278. package/dist/utils/project-detector.d.ts.map +1 -0
  279. package/dist/utils/project-detector.js +188 -0
  280. package/dist/utils/project-detector.js.map +1 -0
  281. package/dist/utils/template-fetcher.d.ts +51 -0
  282. package/dist/utils/template-fetcher.d.ts.map +1 -0
  283. package/dist/utils/template-fetcher.js +174 -0
  284. package/dist/utils/template-fetcher.js.map +1 -0
  285. package/dist/utils/template-hash.d.ts +78 -0
  286. package/dist/utils/template-hash.d.ts.map +1 -0
  287. package/dist/utils/template-hash.js +239 -0
  288. package/dist/utils/template-hash.js.map +1 -0
  289. package/package.json +87 -0
@@ -0,0 +1,285 @@
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
@@ -0,0 +1,182 @@
1
+ ---
2
+ name: visualize
3
+ description: 生成场景图片提示词(Qwen-Image优化)
4
+ ---
5
+
6
+ # 场景图片生成
7
+
8
+ 将当前剧本段落转换为 AI 绘画提示词,针对 Qwen-Image 优化。
9
+
10
+ ## Qwen-Image 核心优势
11
+
12
+ | 能力维度 | 技术特点 | 优势 |
13
+ |---------|---------|------|
14
+ | **复杂文本渲染** | 中英文多行文本、段落级语义 | 中文渲染 58.30%,远超竞品 |
15
+ | **精准图像编辑** | 语义一致性与视觉保真度 | 支持链式编辑 |
16
+ | **空间关系** | MSRoPE 位置编码 | 精确布局控制 |
17
+
18
+ ---
19
+
20
+ ## Prompt 结构原则
21
+
22
+ Qwen-Image 使用 **Qwen2.5-VL 作为文本编码器**,最优 Prompt 应包含:
23
+
24
+ ```
25
+ 【主体对象】+ 【属性细节(颜色/数量/形状/材质)】+ 【空间关系】+ 【文本内容(如需要)】+ 【环境背景】+ 【风格/光影】
26
+ ```
27
+
28
+ ---
29
+
30
+ ## 执行步骤
31
+
32
+ ### 1. 生成提示词
33
+
34
+ 直接读取当前选中的剧本段落,将其转换为 Qwen-Image 优化的提示词。
35
+
36
+ ### 2. 输出格式
37
+
38
+ 每个场次生成以下格式的提示词:
39
+
40
+ ```markdown
41
+ ## 场次 X 图片提示词
42
+
43
+ ### 主体描述
44
+ [主体对象],[颜色],[数量],[形状],[材质]
45
+
46
+ ### 属性细节
47
+ - 面部特征:[脸型、眼睛、眉毛、发型等]
48
+ - 服装:[颜色、材质、款式]
49
+ - 配饰:[如有]
50
+
51
+ ### 空间关系
52
+ [主体在画面中的位置],[与其他物体的距离],[前景/背景关系]
53
+
54
+ ### 文本内容(如需要)
55
+ - 文字内容:"需要渲染的文字"
56
+ - 文字位置:[左上角/中央/底部等]
57
+ - 字体样式:[手写体/宋体/霓虹灯管字体等]
58
+
59
+ ### 环境背景
60
+ [场景描述],[时间],[天气],[氛围]
61
+
62
+ ### 风格光影
63
+ [整体风格],[色调],[光源方向],[参考作品]
64
+
65
+ ### 完整英文提示词
66
+ ```
67
+ {Subject}, {Appearance details}, {Clothing}, {Position},
68
+ {Environment}, {Lighting}, {Style}, {Quality tags}
69
+ ```
70
+
71
+ ### 负面提示词
72
+ ```
73
+ ugly, deformed, bad anatomy, extra limbs, blurry, low quality,
74
+ western style (if Chinese style needed), modern clothing (if period piece)
75
+ ```
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 中文场景特化技巧
81
+
82
+ ### 1. 直接使用中文字符
83
+
84
+ ```
85
+ ✅ "招牌上写着'云计算'"
86
+ ❌ "sign with Chinese characters meaning cloud computing"
87
+ ```
88
+
89
+ ### 2. 利用成语、诗句、对联
90
+
91
+ ```
92
+ 一首古诗书法作品,内容为:
93
+ "毕竟西湖六月中,风光不与四时同。
94
+ 接天莲叶无穷碧,映日荷花别样红。"
95
+ 字体为楷书,背景是水墨画风格的西湖景色。
96
+ ```
97
+
98
+ ### 3. 复杂排版布局
99
+
100
+ ```
101
+ 一张信息图表,标题为"情绪健康习惯",周围环绕六个模块:
102
+ 左上:"练习正念" - 莲花图标
103
+ 右上:"持续学习" - 书本图标
104
+ 左中:"培养感恩" - 双手图标
105
+ 右中:"定期运动" - 跑步图标
106
+ 左下:"保持联结" - 对话图标
107
+ 右下:"优先睡眠" - 月亮图标
108
+ 整体为优雅的信息图风格,对称布局。
109
+ ```
110
+
111
+ ---
112
+
113
+ ## 避坑指南
114
+
115
+ | ❌ 避免 | ✅ 替代 |
116
+ |--------|--------|
117
+ | "高质量"、"精美" 等空泛词 | 具体描述材质、光影、分辨率要求 |
118
+ | 模糊的文本描述 | 用引号明确标注每个文字 |
119
+ | 忽略空间位置词 | 使用"左上角"、"中央"、"底部"等明确位置 |
120
+ | 过长的无结构句子 | 分段描述不同元素,使用分号或换行 |
121
+ | 假设模型懂特定IP或风格 | 详细描述视觉特征 |
122
+
123
+ ---
124
+
125
+ ## 示例
126
+
127
+ ### 输入剧本
128
+
129
+ ```
130
+ 场次 1:青云峰主殿内 - 清晨 - 萧条落寞
131
+
132
+ 白衣中年沈安在瘫坐在太师椅上,神情苦涩。殿外,少年慕容天背着大包小包,站在门口。
133
+ ```
134
+
135
+ ### 输出提示词
136
+
137
+ ```markdown
138
+ ## 场次 1 图片提示词
139
+
140
+ ### 主体描述
141
+ - 人物1:沈安在,白衣中年男子,两鬓霜白,面容俊俏,神情苦涩
142
+ - 人物2:慕容天,少年身形,背着大包小包
143
+
144
+ ### 属性细节
145
+ - 沈安在服装:白色道袍,材质为丝绸,款式宽松
146
+ - 慕容天服装:青色布衣,背着布包裹
147
+ - 场景道具:太师椅(深棕色木质)、残破窗棂
148
+
149
+ ### 空间关系
150
+ 沈安在位于画面中央偏左,瘫坐在太师椅上;慕容天位于画面右侧门口处,两人之间有一定距离
151
+
152
+ ### 环境背景
153
+ 青云峰主殿内部,破旧的大殿,阳光透过残破窗棂洒落,萧条冷清的氛围,清晨光线
154
+
155
+ ### 风格光影
156
+ 中国仙侠风格,水墨画质感,柔和晨光从左侧打入,产生柔和阴影,色调偏冷
157
+
158
+ ### 完整英文提示词
159
+ ```
160
+ A middle-aged Chinese man in white Taoist robe, sitting slumped on a wooden chair,
161
+ bitter expression, white hair at temples, handsome face.
162
+ In the background, a young man in blue clothes standing at the doorway, carrying large cloth bundles.
163
+ Dilapidated temple interior, morning sunlight through broken windows,
164
+ melancholic atmosphere, Chinese xianxia style, ink painting texture,
165
+ soft lighting from left, cool color tone, cinematic composition
166
+ ```
167
+
168
+ ### 负面提示词
169
+ ```
170
+ ugly, deformed, bad anatomy, extra limbs, blurry, low quality,
171
+ modern clothing, western style, bright colors, happy expression
172
+ ```
173
+ ```
174
+
175
+ ---
176
+
177
+ ## 注意事项
178
+
179
+ 1. **文本渲染**:如需要在图片中渲染文字,必须用引号明确标注
180
+ 2. **中文优化**:Qwen-Image 对中文渲染有独特优势,直接使用汉字
181
+ 3. **空间布局**:使用明确的位置词(左上角、中央、底部等)
182
+ 4. **结构化描述**:分段描述不同元素,避免过长的无结构句子
@@ -0,0 +1,13 @@
1
+ Read the backend development guidelines before starting your development task.
2
+
3
+ Execute these steps:
4
+ 1. Read `.trellis/spec/backend/index.md` to understand available guidelines
5
+ 2. Based on your task, read the relevant guideline files:
6
+ - Database work → `.trellis/spec/backend/database-guidelines.md`
7
+ - Error handling → `.trellis/spec/backend/error-handling.md`
8
+ - Logging → `.trellis/spec/backend/logging-guidelines.md`
9
+ - Type questions → `.trellis/spec/backend/type-safety.md`
10
+ 3. Understand the coding standards and patterns you need to follow
11
+ 4. Then proceed with your development plan
12
+
13
+ This step is **mandatory** before writing any backend code.
@@ -0,0 +1,13 @@
1
+ Read the frontend development guidelines before starting your development task.
2
+
3
+ Execute these steps:
4
+ 1. Read `.trellis/spec/frontend/index.md` to understand available guidelines
5
+ 2. Based on your task, read the relevant guideline files:
6
+ - Component work → `.trellis/spec/frontend/component-guidelines.md`
7
+ - Hook work → `.trellis/spec/frontend/hook-guidelines.md`
8
+ - State management → `.trellis/spec/frontend/state-management.md`
9
+ - Type questions → `.trellis/spec/frontend/type-safety.md`
10
+ 3. Understand the coding standards and patterns you need to follow
11
+ 4. Then proceed with your development plan
12
+
13
+ This step is **mandatory** before writing any frontend code.
@@ -0,0 +1,125 @@
1
+ # Break the Loop - Deep Bug Analysis
2
+
3
+ When debug is complete, use this command for deep analysis to break the "fix bug -> forget -> repeat" cycle.
4
+
5
+ ---
6
+
7
+ ## Analysis Framework
8
+
9
+ Analyze the bug you just fixed from these 5 dimensions:
10
+
11
+ ### 1. Root Cause Category
12
+
13
+ Which category does this bug belong to?
14
+
15
+ | Category | Characteristics | Example |
16
+ |----------|-----------------|---------|
17
+ | **A. Missing Spec** | No documentation on how to do it | New feature without checklist |
18
+ | **B. Cross-Layer Contract** | Interface between layers unclear | API returns different format than expected |
19
+ | **C. Change Propagation Failure** | Changed one place, missed others | Changed function signature, missed call sites |
20
+ | **D. Test Coverage Gap** | Unit test passes, integration fails | Works alone, breaks when combined |
21
+ | **E. Implicit Assumption** | Code relies on undocumented assumption | Timestamp seconds vs milliseconds |
22
+
23
+ ### 2. Why Fixes Failed (if applicable)
24
+
25
+ If you tried multiple fixes before succeeding, analyze each failure:
26
+
27
+ - **Surface Fix**: Fixed symptom, not root cause
28
+ - **Incomplete Scope**: Found root cause, didn't cover all cases
29
+ - **Tool Limitation**: grep missed it, type check wasn't strict
30
+ - **Mental Model**: Kept looking in same layer, didn't think cross-layer
31
+
32
+ ### 3. Prevention Mechanisms
33
+
34
+ What mechanisms would prevent this from happening again?
35
+
36
+ | Type | Description | Example |
37
+ |------|-------------|---------|
38
+ | **Documentation** | Write it down so people know | Update thinking guide |
39
+ | **Architecture** | Make the error impossible structurally | Type-safe wrappers |
40
+ | **Compile-time** | TypeScript strict, no any | Signature change causes compile error |
41
+ | **Runtime** | Monitoring, alerts, scans | Detect orphan entities |
42
+ | **Test Coverage** | E2E tests, integration tests | Verify full flow |
43
+ | **Code Review** | Checklist, PR template | "Did you check X?" |
44
+
45
+ ### 4. Systematic Expansion
46
+
47
+ What broader problems does this bug reveal?
48
+
49
+ - **Similar Issues**: Where else might this problem exist?
50
+ - **Design Flaw**: Is there a fundamental architecture issue?
51
+ - **Process Flaw**: Is there a development process improvement?
52
+ - **Knowledge Gap**: Is the team missing some understanding?
53
+
54
+ ### 5. Knowledge Capture
55
+
56
+ Solidify insights into the system:
57
+
58
+ - [ ] Update `.trellis/spec/guides/` thinking guides
59
+ - [ ] Update `.trellis/spec/backend/` or `frontend/` docs
60
+ - [ ] Create issue record (if applicable)
61
+ - [ ] Create feature ticket for root fix
62
+ - [ ] Update check commands if needed
63
+
64
+ ---
65
+
66
+ ## Output Format
67
+
68
+ Please output analysis in this format:
69
+
70
+ ```markdown
71
+ ## Bug Analysis: [Short Description]
72
+
73
+ ### 1. Root Cause Category
74
+ - **Category**: [A/B/C/D/E] - [Category Name]
75
+ - **Specific Cause**: [Detailed description]
76
+
77
+ ### 2. Why Fixes Failed (if applicable)
78
+ 1. [First attempt]: [Why it failed]
79
+ 2. [Second attempt]: [Why it failed]
80
+ ...
81
+
82
+ ### 3. Prevention Mechanisms
83
+ | Priority | Mechanism | Specific Action | Status |
84
+ |----------|-----------|-----------------|--------|
85
+ | P0 | ... | ... | TODO/DONE |
86
+
87
+ ### 4. Systematic Expansion
88
+ - **Similar Issues**: [List places with similar problems]
89
+ - **Design Improvement**: [Architecture-level suggestions]
90
+ - **Process Improvement**: [Development process suggestions]
91
+
92
+ ### 5. Knowledge Capture
93
+ - [ ] [Documents to update / tickets to create]
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Core Philosophy
99
+
100
+ > **The value of debugging is not in fixing the bug, but in making this class of bugs never happen again.**
101
+
102
+ Three levels of insight:
103
+ 1. **Tactical**: How to fix THIS bug
104
+ 2. **Strategic**: How to prevent THIS CLASS of bugs
105
+ 3. **Philosophical**: How to expand thinking patterns
106
+
107
+ 30 minutes of analysis saves 30 hours of future debugging.
108
+
109
+ ---
110
+
111
+ ## After Analysis: Immediate Actions
112
+
113
+ **IMPORTANT**: After completing the analysis above, you MUST immediately:
114
+
115
+ 1. **Update spec/guides** - Don't just list TODOs, actually update the relevant files:
116
+ - If it's a cross-platform issue → update `cross-platform-thinking-guide.md`
117
+ - If it's a cross-layer issue → update `cross-layer-thinking-guide.md`
118
+ - If it's a code reuse issue → update `code-reuse-thinking-guide.md`
119
+ - If it's domain-specific → update `backend/*.md` or `frontend/*.md`
120
+
121
+ 2. **Sync templates** - After updating `.trellis/spec/`, sync to `src/templates/markdown/spec/`
122
+
123
+ 3. **Commit the spec updates** - This is the primary output, not just the analysis text
124
+
125
+ > **The analysis is worthless if it stays in chat. The value is in the updated specs.**
@@ -0,0 +1,13 @@
1
+ Check if the code you just wrote follows the backend development guidelines.
2
+
3
+ Execute these steps:
4
+ 1. Run `git status` to see modified files
5
+ 2. Read `.trellis/spec/backend/index.md` to understand which guidelines apply
6
+ 3. Based on what you changed, read the relevant guideline files:
7
+ - Database changes → `.trellis/spec/backend/database-guidelines.md`
8
+ - Error handling → `.trellis/spec/backend/error-handling.md`
9
+ - Logging changes → `.trellis/spec/backend/logging-guidelines.md`
10
+ - Type changes → `.trellis/spec/backend/type-safety.md`
11
+ - Any changes → `.trellis/spec/backend/quality-guidelines.md`
12
+ 4. Review your code against the guidelines
13
+ 5. Report any violations and fix them if found