@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,51 @@
1
+ # Logging Guidelines
2
+
3
+ > How logging is done in this project.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ <!--
10
+ Document your project's logging conventions here.
11
+
12
+ Questions to answer:
13
+ - What logging library do you use?
14
+ - What are the log levels and when to use each?
15
+ - What should be logged?
16
+ - What should NOT be logged (PII, secrets)?
17
+ -->
18
+
19
+ (To be filled by the team)
20
+
21
+ ---
22
+
23
+ ## Log Levels
24
+
25
+ <!-- When to use each level: debug, info, warn, error -->
26
+
27
+ (To be filled by the team)
28
+
29
+ ---
30
+
31
+ ## Structured Logging
32
+
33
+ <!-- Log format, required fields -->
34
+
35
+ (To be filled by the team)
36
+
37
+ ---
38
+
39
+ ## What to Log
40
+
41
+ <!-- Important events to log -->
42
+
43
+ (To be filled by the team)
44
+
45
+ ---
46
+
47
+ ## What NOT to Log
48
+
49
+ <!-- Sensitive data, PII, secrets -->
50
+
51
+ (To be filled by the team)
@@ -0,0 +1,51 @@
1
+ # Quality Guidelines
2
+
3
+ > Code quality standards for backend development.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ <!--
10
+ Document your project's quality standards here.
11
+
12
+ Questions to answer:
13
+ - What patterns are forbidden?
14
+ - What linting rules do you enforce?
15
+ - What are your testing requirements?
16
+ - What code review standards apply?
17
+ -->
18
+
19
+ (To be filled by the team)
20
+
21
+ ---
22
+
23
+ ## Forbidden Patterns
24
+
25
+ <!-- Patterns that should never be used and why -->
26
+
27
+ (To be filled by the team)
28
+
29
+ ---
30
+
31
+ ## Required Patterns
32
+
33
+ <!-- Patterns that must always be used -->
34
+
35
+ (To be filled by the team)
36
+
37
+ ---
38
+
39
+ ## Testing Requirements
40
+
41
+ <!-- What level of testing is expected -->
42
+
43
+ (To be filled by the team)
44
+
45
+ ---
46
+
47
+ ## Code Review Checklist
48
+
49
+ <!-- What reviewers should check -->
50
+
51
+ (To be filled by the team)
@@ -0,0 +1,467 @@
1
+ # Script Conventions
2
+
3
+ > Standards for Python scripts in the `.aim-studio/scripts/` directory.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ All workflow scripts are written in **Python 3.10+** for cross-platform compatibility. Scripts use only the standard library (no external dependencies).
10
+
11
+ ---
12
+
13
+ ## Directory Structure
14
+
15
+ ```
16
+ .aim-studio/scripts/
17
+ ├── __init__.py # Package init
18
+ ├── common/ # Shared modules
19
+ │ ├── __init__.py
20
+ │ ├── paths.py # Path constants and functions
21
+ │ ├── developer.py # Developer identity management
22
+ │ ├── task_queue.py # Task queue CRUD
23
+ │ ├── task_utils.py # Task helper functions
24
+ │ ├── phase.py # Multi-agent phase tracking
25
+ │ ├── registry.py # Agent registry management
26
+ │ ├── worktree.py # Git worktree utilities
27
+ │ └── git_context.py # Git/session context
28
+ ├── multi_agent/ # Multi-agent pipeline scripts
29
+ │ ├── __init__.py
30
+ │ ├── start.py # Start worktree agent
31
+ │ ├── status.py # Monitor agent status
32
+ │ ├── plan.py # Start plan agent
33
+ │ ├── cleanup.py # Cleanup worktree
34
+ │ └── create_pr.py # Create PR from task
35
+ ├── task.py # Main task management CLI
36
+ ├── get_context.py # Session context retrieval
37
+ ├── init_developer.py # Developer initialization
38
+ ├── get_developer.py # Get current developer
39
+ ├── add_session.py # Session recording
40
+ └── create_bootstrap.py # Bootstrap task creation
41
+ ```
42
+
43
+ ---
44
+
45
+ ## Script Types
46
+
47
+ ### Library Modules (`common/*.py`)
48
+
49
+ Shared utilities imported by other scripts. **Never run directly.**
50
+
51
+ ```python
52
+ # common/paths.py - Example library module
53
+
54
+ from __future__ import annotations
55
+
56
+ from pathlib import Path
57
+
58
+ # Constants
59
+ DIR_WORKFLOW = ".aim-studio"
60
+ DIR_SCRIPTS = "scripts"
61
+ DIR_TASKS = "tasks"
62
+
63
+ def get_repo_root() -> Path | None:
64
+ """Find repository root by looking for .aim-studio directory."""
65
+ current = Path.cwd().resolve()
66
+ while current != current.parent:
67
+ if (current / DIR_WORKFLOW).is_dir():
68
+ return current
69
+ current = current.parent
70
+ return None
71
+ ```
72
+
73
+ ### Entry Scripts (`*.py`)
74
+
75
+ CLI tools that users run directly. Include docstring with usage.
76
+
77
+ ```python
78
+ #!/usr/bin/env python3
79
+ """
80
+ Task Management Script.
81
+
82
+ Usage:
83
+ python3 task.py create "<title>" [--slug <name>]
84
+ python3 task.py list [--mine] [--status <status>]
85
+ python3 task.py start <dir>
86
+ python3 task.py finish
87
+ python3 task.py archive <task-name>
88
+ """
89
+
90
+ from __future__ import annotations
91
+
92
+ import argparse
93
+ import sys
94
+ from pathlib import Path
95
+
96
+ from common.paths import get_repo_root, DIR_WORKFLOW
97
+
98
+
99
+ def main() -> int:
100
+ """Main entry point."""
101
+ parser = argparse.ArgumentParser(description="Task management")
102
+ # ... argument setup
103
+ args = parser.parse_args()
104
+ # ... command dispatch
105
+ return 0
106
+
107
+
108
+ if __name__ == "__main__":
109
+ sys.exit(main())
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Coding Standards
115
+
116
+ ### Type Hints
117
+
118
+ Use modern type hints (Python 3.10+ syntax):
119
+
120
+ ```python
121
+ # Good
122
+ def get_tasks(status: str | None = None) -> list[dict]:
123
+ ...
124
+
125
+ def read_json(path: Path) -> dict | None:
126
+ ...
127
+
128
+ # Bad - old style
129
+ from typing import Optional, List, Dict
130
+ def get_tasks(status: Optional[str] = None) -> List[Dict]:
131
+ ...
132
+ ```
133
+
134
+ ### Path Handling
135
+
136
+ Always use `pathlib.Path`:
137
+
138
+ ```python
139
+ # Good
140
+ from pathlib import Path
141
+
142
+ def read_file(path: Path) -> str:
143
+ return path.read_text(encoding="utf-8")
144
+
145
+ config_path = repo_root / DIR_WORKFLOW / "config.json"
146
+
147
+ # Bad - string concatenation
148
+ config_path = repo_root + "/" + DIR_WORKFLOW + "/config.json"
149
+ ```
150
+
151
+ ### JSON Operations
152
+
153
+ Use helper functions for consistent error handling:
154
+
155
+ ```python
156
+ import json
157
+ from pathlib import Path
158
+
159
+
160
+ def read_json(path: Path) -> dict | None:
161
+ """Read JSON file, return None on error."""
162
+ try:
163
+ return json.loads(path.read_text(encoding="utf-8"))
164
+ except (FileNotFoundError, json.JSONDecodeError):
165
+ return None
166
+
167
+
168
+ def write_json(path: Path, data: dict) -> bool:
169
+ """Write JSON file, return success status."""
170
+ try:
171
+ path.write_text(
172
+ json.dumps(data, indent=2, ensure_ascii=False),
173
+ encoding="utf-8"
174
+ )
175
+ return True
176
+ except Exception:
177
+ return False
178
+ ```
179
+
180
+ ### Subprocess Execution
181
+
182
+ ```python
183
+ import subprocess
184
+ from pathlib import Path
185
+
186
+
187
+ def run_command(
188
+ cmd: list[str],
189
+ cwd: Path | None = None
190
+ ) -> tuple[int, str, str]:
191
+ """Run command and return (returncode, stdout, stderr)."""
192
+ result = subprocess.run(
193
+ cmd,
194
+ cwd=cwd,
195
+ capture_output=True,
196
+ text=True
197
+ )
198
+ return result.returncode, result.stdout, result.stderr
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Cross-Platform Compatibility
204
+
205
+ ### CRITICAL: Windows stdout Encoding
206
+
207
+ On Windows, Python's stdout defaults to the system code page (e.g., GBK/CP936 in China, CP1252 in Western locales). This causes `UnicodeEncodeError` when printing non-ASCII characters.
208
+
209
+ **The Problem Chain**:
210
+
211
+ ```
212
+ Windows code page = GBK (936)
213
+
214
+ Python stdout defaults to GBK encoding
215
+
216
+ Subprocess output contains special chars → replaced with \ufffd (replacement char)
217
+
218
+ json.dumps(ensure_ascii=False) → print()
219
+
220
+ GBK cannot encode \ufffd → UnicodeEncodeError: 'gbk' codec can't encode character
221
+ ```
222
+
223
+ **Root Cause**: Even if you set `PYTHONIOENCODING` in subprocess calls, the **parent process's stdout** still uses the system code page. The error occurs when `print()` tries to write to stdout.
224
+
225
+ ---
226
+
227
+ #### GOOD: Use `sys.stdout.reconfigure()` (Python 3.7+)
228
+
229
+ ```python
230
+ import sys
231
+
232
+ # MUST be at the top of the script, before any print() calls
233
+ if sys.platform == "win32":
234
+ sys.stdout.reconfigure(encoding="utf-8", errors="replace")
235
+ sys.stderr.reconfigure(encoding="utf-8", errors="replace")
236
+ ```
237
+
238
+ **Why this works**: `reconfigure()` modifies the existing stream **in-place**, changing its encoding settings directly. This affects all subsequent writes to stdout.
239
+
240
+ **Best Practice**: Add this to `common/__init__.py` so all scripts that `from common import ...` automatically get the fix:
241
+
242
+ ```python
243
+ # common/__init__.py
244
+ import sys
245
+
246
+ if sys.platform == "win32":
247
+ sys.stdout.reconfigure(encoding="utf-8", errors="replace")
248
+ sys.stderr.reconfigure(encoding="utf-8", errors="replace")
249
+
250
+ # ... rest of exports
251
+ ```
252
+
253
+ ---
254
+
255
+ #### BAD: Do NOT use `io.TextIOWrapper`
256
+
257
+ ```python
258
+ # BAD - This does NOT reliably fix the encoding issue!
259
+ import sys
260
+ import io
261
+
262
+ if sys.platform == "win32":
263
+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
264
+ ```
265
+
266
+ **Why this fails**:
267
+
268
+ 1. **Creates a new wrapper, doesn't fix the underlying issue**: `TextIOWrapper` wraps `sys.stdout.buffer`, but the original stdout object and its encoding settings may still interfere in some code paths.
269
+
270
+ 2. **Loses original stdout properties**: The new wrapper may not preserve all attributes of the original `sys.stdout` (like `isatty()`, line buffering behavior).
271
+
272
+ 3. **Race condition with buffering**: If any output was buffered before the replacement, it may still be encoded with the old encoding.
273
+
274
+ 4. **Not idempotent**: Calling this multiple times creates nested wrappers, while `reconfigure()` is safe to call multiple times.
275
+
276
+ **Real-world failure case**: Users reported that `io.TextIOWrapper` did not fix the `UnicodeEncodeError` on Windows, while `sys.stdout.reconfigure()` worked immediately.
277
+
278
+ ---
279
+
280
+ #### Summary
281
+
282
+ | Method | Works? | Reason |
283
+ |--------|--------|--------|
284
+ | `sys.stdout.reconfigure(encoding="utf-8")` | ✅ Yes | Modifies stream in-place |
285
+ | `io.TextIOWrapper(sys.stdout.buffer, ...)` | ❌ No | Creates wrapper, doesn't fix underlying encoding |
286
+ | `PYTHONIOENCODING=utf-8` env var | ⚠️ Partial | Only works if set **before** Python starts |
287
+
288
+ ### CRITICAL: Always Use `python3` Explicitly
289
+
290
+ Windows does not support shebang (`#!/usr/bin/env python3`). Always document invocation with explicit `python3`:
291
+
292
+ ```python
293
+ # In docstrings
294
+ """
295
+ Usage:
296
+ python3 task.py create "My Task"
297
+ python3 task.py list --mine
298
+ """
299
+
300
+ # In error messages
301
+ print("Usage: python3 task.py <command>")
302
+ print("Run: python3 ./.aim-studio/scripts/init_developer.py <name>")
303
+
304
+ # In help text
305
+ print("Next steps:")
306
+ print(" python3 task.py start <dir>")
307
+ ```
308
+
309
+ ### Path Separators
310
+
311
+ Use `pathlib.Path` - it handles separators automatically:
312
+
313
+ ```python
314
+ # Good - works on all platforms
315
+ path = Path(".aim-studio") / "scripts" / "task.py"
316
+
317
+ # Bad - Unix-only
318
+ path = ".aim-studio/scripts/task.py"
319
+ ```
320
+
321
+ ---
322
+
323
+ ## Error Handling
324
+
325
+ ### Exit Codes
326
+
327
+ | Code | Meaning |
328
+ |------|---------|
329
+ | 0 | Success |
330
+ | 1 | General error |
331
+ | 2 | Usage error (wrong arguments) |
332
+
333
+ ### Error Messages
334
+
335
+ Print errors to stderr with context:
336
+
337
+ ```python
338
+ import sys
339
+
340
+ def error(msg: str) -> None:
341
+ """Print error message to stderr."""
342
+ print(f"Error: {msg}", file=sys.stderr)
343
+
344
+ # Usage
345
+ if not repo_root:
346
+ error("Not in a AIM Studio project (no .aim-studio directory found)")
347
+ sys.exit(1)
348
+ ```
349
+
350
+ ---
351
+
352
+ ## Argument Parsing
353
+
354
+ Use `argparse` for consistent CLI interface:
355
+
356
+ ```python
357
+ import argparse
358
+
359
+
360
+ def main() -> int:
361
+ parser = argparse.ArgumentParser(
362
+ description="Task management",
363
+ formatter_class=argparse.RawDescriptionHelpFormatter,
364
+ epilog="""
365
+ Examples:
366
+ python3 task.py create "Add login" --slug add-login
367
+ python3 task.py list --mine --status in_progress
368
+ """
369
+ )
370
+
371
+ subparsers = parser.add_subparsers(dest="command", required=True)
372
+
373
+ # create command
374
+ create_parser = subparsers.add_parser("create", help="Create new task")
375
+ create_parser.add_argument("title", help="Task title")
376
+ create_parser.add_argument("--slug", help="URL-friendly name")
377
+
378
+ # list command
379
+ list_parser = subparsers.add_parser("list", help="List tasks")
380
+ list_parser.add_argument("--mine", "-m", action="store_true")
381
+ list_parser.add_argument("--status", "-s", choices=["planning", "in_progress", "review", "completed"])
382
+
383
+ args = parser.parse_args()
384
+
385
+ if args.command == "create":
386
+ return cmd_create(args)
387
+ elif args.command == "list":
388
+ return cmd_list(args)
389
+
390
+ return 0
391
+ ```
392
+
393
+ ---
394
+
395
+ ## Import Conventions
396
+
397
+ ### Relative Imports Within Package
398
+
399
+ ```python
400
+ # In task.py (root level)
401
+ from common.paths import get_repo_root, DIR_WORKFLOW
402
+ from common.developer import get_developer
403
+
404
+ # In common/developer.py
405
+ from .paths import get_repo_root, DIR_WORKFLOW
406
+ ```
407
+
408
+ ### Standard Library Imports
409
+
410
+ Group and order imports:
411
+
412
+ ```python
413
+ # 1. Future imports
414
+ from __future__ import annotations
415
+
416
+ # 2. Standard library
417
+ import argparse
418
+ import json
419
+ import os
420
+ import subprocess
421
+ import sys
422
+ from datetime import datetime
423
+ from pathlib import Path
424
+
425
+ # 3. Local imports
426
+ from common.paths import get_repo_root
427
+ from common.developer import get_developer
428
+ ```
429
+
430
+ ---
431
+
432
+ ## DO / DON'T
433
+
434
+ ### DO
435
+
436
+ - Use `pathlib.Path` for all path operations
437
+ - Use type hints (Python 3.10+ syntax)
438
+ - Return exit codes from `main()`
439
+ - Print errors to stderr
440
+ - Always use `python3` in documentation and messages
441
+ - Use `encoding="utf-8"` for all file operations
442
+
443
+ ### DON'T
444
+
445
+ - Don't use string path concatenation
446
+ - Don't use `os.path` when `pathlib` works
447
+ - Don't rely on shebang for invocation documentation
448
+ - Don't use `print()` for errors (use stderr)
449
+ - Don't hardcode paths - use constants from `common/paths.py`
450
+ - Don't use external dependencies (stdlib only)
451
+
452
+ ---
453
+
454
+ ## Example: Complete Script
455
+
456
+ See `.aim-studio/scripts/task.py` for a comprehensive example with:
457
+ - Multiple subcommands
458
+ - Argument parsing
459
+ - JSON file operations
460
+ - Error handling
461
+ - Cross-platform path handling
462
+
463
+ ---
464
+
465
+ ## Migration Note
466
+
467
+ > **Historical Context**: Scripts were migrated from Bash to Python in v0.3.0 for cross-platform compatibility. The old shell scripts are archived in `.aim-studio/scripts-shell-archive/` (if preserved).
@@ -0,0 +1,59 @@
1
+ # Component Guidelines
2
+
3
+ > How components are built in this project.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ <!--
10
+ Document your project's component conventions here.
11
+
12
+ Questions to answer:
13
+ - What component patterns do you use?
14
+ - How are props defined?
15
+ - How do you handle composition?
16
+ - What accessibility standards apply?
17
+ -->
18
+
19
+ (To be filled by the team)
20
+
21
+ ---
22
+
23
+ ## Component Structure
24
+
25
+ <!-- Standard structure of a component file -->
26
+
27
+ (To be filled by the team)
28
+
29
+ ---
30
+
31
+ ## Props Conventions
32
+
33
+ <!-- How props should be defined and typed -->
34
+
35
+ (To be filled by the team)
36
+
37
+ ---
38
+
39
+ ## Styling Patterns
40
+
41
+ <!-- How styles are applied (CSS modules, styled-components, Tailwind, etc.) -->
42
+
43
+ (To be filled by the team)
44
+
45
+ ---
46
+
47
+ ## Accessibility
48
+
49
+ <!-- A11y requirements and patterns -->
50
+
51
+ (To be filled by the team)
52
+
53
+ ---
54
+
55
+ ## Common Mistakes
56
+
57
+ <!-- Component-related mistakes your team has made -->
58
+
59
+ (To be filled by the team)
@@ -0,0 +1,54 @@
1
+ # Directory Structure
2
+
3
+ > How frontend code is organized in this project.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ <!--
10
+ Document your project's frontend directory structure here.
11
+
12
+ Questions to answer:
13
+ - Where do components live?
14
+ - How are features/modules organized?
15
+ - Where are shared utilities?
16
+ - How are assets organized?
17
+ -->
18
+
19
+ (To be filled by the team)
20
+
21
+ ---
22
+
23
+ ## Directory Layout
24
+
25
+ ```
26
+ <!-- Replace with your actual structure -->
27
+ src/
28
+ ├── ...
29
+ └── ...
30
+ ```
31
+
32
+ ---
33
+
34
+ ## Module Organization
35
+
36
+ <!-- How should new features be organized? -->
37
+
38
+ (To be filled by the team)
39
+
40
+ ---
41
+
42
+ ## Naming Conventions
43
+
44
+ <!-- File and folder naming rules -->
45
+
46
+ (To be filled by the team)
47
+
48
+ ---
49
+
50
+ ## Examples
51
+
52
+ <!-- Link to well-organized modules as examples -->
53
+
54
+ (To be filled by the team)