aios-core 2.1.5 → 2.2.0

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 (392) hide show
  1. package/.aios-core/core/README.md +229 -229
  2. package/.aios-core/core/data/agent-config-requirements.yaml +368 -368
  3. package/.aios-core/core/data/aios-kb.md +923 -923
  4. package/.aios-core/core/data/workflow-patterns.yaml +267 -267
  5. package/.aios-core/core/docs/SHARD-TRANSLATION-GUIDE.md +335 -335
  6. package/.aios-core/core/docs/component-creation-guide.md +457 -457
  7. package/.aios-core/core/docs/session-update-pattern.md +307 -307
  8. package/.aios-core/core/docs/template-syntax.md +266 -266
  9. package/.aios-core/core/docs/troubleshooting-guide.md +624 -624
  10. package/.aios-core/core/elicitation/elicitation-engine.js +1 -1
  11. package/.aios-core/core/index.esm.js +42 -42
  12. package/.aios-core/core/index.js +1 -1
  13. package/.aios-core/core/migration/migration-config.yaml +83 -83
  14. package/.aios-core/core/migration/module-mapping.yaml +89 -89
  15. package/.aios-core/core/quality-gates/layer2-pr-automation.js +1 -1
  16. package/.aios-core/core/quality-gates/quality-gate-config.yaml +86 -86
  17. package/.aios-core/core/registry/README.md +179 -179
  18. package/.aios-core/core/utils/security-utils.js +1 -1
  19. package/.aios-core/core-config.yaml +391 -382
  20. package/.aios-core/data/agent-config-requirements.yaml +368 -368
  21. package/.aios-core/data/aios-kb.md +923 -923
  22. package/.aios-core/data/technical-preferences.md +3 -3
  23. package/.aios-core/data/workflow-patterns.yaml +267 -267
  24. package/.aios-core/development/README.md +142 -142
  25. package/.aios-core/development/agent-teams/team-all.yaml +15 -15
  26. package/.aios-core/development/agent-teams/team-fullstack.yaml +18 -18
  27. package/.aios-core/development/agent-teams/team-ide-minimal.yaml +10 -10
  28. package/.aios-core/development/agent-teams/team-no-ui.yaml +13 -13
  29. package/.aios-core/development/agent-teams/team-qa-focused.yaml +155 -155
  30. package/.aios-core/development/agents/aios-master.md +339 -339
  31. package/.aios-core/development/agents/analyst.md +195 -195
  32. package/.aios-core/development/agents/architect.md +359 -359
  33. package/.aios-core/development/agents/data-engineer.md +468 -468
  34. package/.aios-core/development/agents/dev.md +390 -390
  35. package/.aios-core/development/agents/devops.md +398 -398
  36. package/.aios-core/development/agents/pm.md +198 -198
  37. package/.aios-core/development/agents/po.md +256 -256
  38. package/.aios-core/development/agents/qa.md +312 -312
  39. package/.aios-core/development/agents/sm.md +220 -220
  40. package/.aios-core/development/agents/ux-design-expert.md +451 -451
  41. package/.aios-core/development/scripts/greeting-config-cli.js +85 -85
  42. package/.aios-core/development/tasks/add-mcp.md +319 -319
  43. package/.aios-core/development/tasks/advanced-elicitation.md +318 -318
  44. package/.aios-core/development/tasks/analyst-facilitate-brainstorming.md +341 -341
  45. package/.aios-core/development/tasks/analyze-brownfield.md +456 -0
  46. package/.aios-core/development/tasks/analyze-framework.md +696 -696
  47. package/.aios-core/development/tasks/analyze-performance.md +637 -637
  48. package/.aios-core/development/tasks/apply-qa-fixes.md +340 -340
  49. package/.aios-core/development/tasks/architect-analyze-impact.md +826 -826
  50. package/.aios-core/development/tasks/audit-codebase.md +429 -429
  51. package/.aios-core/development/tasks/audit-tailwind-config.md +270 -270
  52. package/.aios-core/development/tasks/audit-utilities.md +358 -358
  53. package/.aios-core/development/tasks/bootstrap-shadcn-library.md +286 -286
  54. package/.aios-core/development/tasks/brownfield-create-epic.md +485 -485
  55. package/.aios-core/development/tasks/brownfield-create-story.md +356 -356
  56. package/.aios-core/development/tasks/build-component.md +478 -478
  57. package/.aios-core/development/tasks/calculate-roi.md +455 -455
  58. package/.aios-core/development/tasks/ci-cd-configuration.md +764 -764
  59. package/.aios-core/development/tasks/cleanup-utilities.md +670 -670
  60. package/.aios-core/development/tasks/collaborative-edit.md +1108 -1108
  61. package/.aios-core/development/tasks/compose-molecule.md +284 -284
  62. package/.aios-core/development/tasks/consolidate-patterns.md +414 -414
  63. package/.aios-core/development/tasks/correct-course.md +279 -279
  64. package/.aios-core/development/tasks/create-agent.md +321 -321
  65. package/.aios-core/development/tasks/create-brownfield-story.md +726 -726
  66. package/.aios-core/development/tasks/create-deep-research-prompt.md +498 -498
  67. package/.aios-core/development/tasks/create-doc.md +316 -316
  68. package/.aios-core/development/tasks/create-next-story.md +774 -774
  69. package/.aios-core/development/tasks/create-suite.md +283 -283
  70. package/.aios-core/development/tasks/create-task.md +371 -371
  71. package/.aios-core/development/tasks/create-workflow.md +370 -370
  72. package/.aios-core/development/tasks/db-analyze-hotpaths.md +572 -572
  73. package/.aios-core/development/tasks/db-apply-migration.md +381 -381
  74. package/.aios-core/development/tasks/db-bootstrap.md +642 -642
  75. package/.aios-core/development/tasks/db-domain-modeling.md +693 -693
  76. package/.aios-core/development/tasks/db-dry-run.md +293 -293
  77. package/.aios-core/development/tasks/db-env-check.md +260 -260
  78. package/.aios-core/development/tasks/db-expansion-pack-integration.md +663 -663
  79. package/.aios-core/development/tasks/db-explain.md +631 -631
  80. package/.aios-core/development/tasks/db-impersonate.md +495 -495
  81. package/.aios-core/development/tasks/db-load-csv.md +593 -593
  82. package/.aios-core/development/tasks/db-policy-apply.md +653 -653
  83. package/.aios-core/development/tasks/db-rls-audit.md +411 -411
  84. package/.aios-core/development/tasks/db-rollback.md +739 -739
  85. package/.aios-core/development/tasks/db-run-sql.md +613 -613
  86. package/.aios-core/development/tasks/db-schema-audit.md +1011 -1011
  87. package/.aios-core/development/tasks/db-seed.md +390 -390
  88. package/.aios-core/development/tasks/db-smoke-test.md +351 -351
  89. package/.aios-core/development/tasks/db-snapshot.md +569 -569
  90. package/.aios-core/development/tasks/db-supabase-setup.md +712 -712
  91. package/.aios-core/development/tasks/db-verify-order.md +515 -515
  92. package/.aios-core/development/tasks/deprecate-component.md +956 -956
  93. package/.aios-core/development/tasks/dev-apply-qa-fixes.md +318 -318
  94. package/.aios-core/development/tasks/dev-backlog-debt.md +469 -469
  95. package/.aios-core/development/tasks/dev-develop-story.md +846 -846
  96. package/.aios-core/development/tasks/dev-improve-code-quality.md +872 -872
  97. package/.aios-core/development/tasks/dev-optimize-performance.md +1033 -1033
  98. package/.aios-core/development/tasks/dev-suggest-refactoring.md +870 -870
  99. package/.aios-core/development/tasks/dev-validate-next-story.md +348 -348
  100. package/.aios-core/development/tasks/document-project.md +552 -552
  101. package/.aios-core/development/tasks/environment-bootstrap.md +1311 -1311
  102. package/.aios-core/development/tasks/execute-checklist.md +301 -301
  103. package/.aios-core/development/tasks/export-design-tokens-dtcg.md +274 -274
  104. package/.aios-core/development/tasks/extend-pattern.md +269 -269
  105. package/.aios-core/development/tasks/extract-tokens.md +467 -467
  106. package/.aios-core/development/tasks/facilitate-brainstorming-session.md +518 -518
  107. package/.aios-core/development/tasks/generate-ai-frontend-prompt.md +260 -260
  108. package/.aios-core/development/tasks/generate-documentation.md +284 -284
  109. package/.aios-core/development/tasks/generate-migration-strategy.md +522 -522
  110. package/.aios-core/development/tasks/generate-shock-report.md +501 -501
  111. package/.aios-core/development/tasks/github-devops-github-pr-automation.md +427 -427
  112. package/.aios-core/development/tasks/github-devops-pre-push-quality-gate.md +733 -733
  113. package/.aios-core/development/tasks/github-devops-repository-cleanup.md +374 -374
  114. package/.aios-core/development/tasks/github-devops-version-management.md +483 -483
  115. package/.aios-core/development/tasks/improve-self.md +822 -822
  116. package/.aios-core/development/tasks/index-docs.md +387 -387
  117. package/.aios-core/development/tasks/init-project-status.md +506 -506
  118. package/.aios-core/development/tasks/integrate-expansion-pack.md +314 -314
  119. package/.aios-core/development/tasks/kb-mode-interaction.md +283 -283
  120. package/.aios-core/development/tasks/learn-patterns.md +900 -900
  121. package/.aios-core/development/tasks/mcp-workflow.md +437 -437
  122. package/.aios-core/development/tasks/modify-agent.md +381 -381
  123. package/.aios-core/development/tasks/modify-task.md +424 -424
  124. package/.aios-core/development/tasks/modify-workflow.md +465 -465
  125. package/.aios-core/development/tasks/po-backlog-add.md +370 -370
  126. package/.aios-core/development/tasks/po-manage-story-backlog.md +523 -523
  127. package/.aios-core/development/tasks/po-pull-story-from-clickup.md +540 -540
  128. package/.aios-core/development/tasks/po-pull-story.md +316 -316
  129. package/.aios-core/development/tasks/po-stories-index.md +351 -351
  130. package/.aios-core/development/tasks/po-sync-story-to-clickup.md +457 -457
  131. package/.aios-core/development/tasks/po-sync-story.md +303 -303
  132. package/.aios-core/development/tasks/pr-automation.md +701 -701
  133. package/.aios-core/development/tasks/propose-modification.md +842 -842
  134. package/.aios-core/development/tasks/qa-backlog-add-followup.md +425 -425
  135. package/.aios-core/development/tasks/qa-gate.md +373 -373
  136. package/.aios-core/development/tasks/qa-generate-tests.md +1174 -1174
  137. package/.aios-core/development/tasks/qa-nfr-assess.md +557 -557
  138. package/.aios-core/development/tasks/qa-review-proposal.md +1157 -1157
  139. package/.aios-core/development/tasks/qa-review-story.md +682 -682
  140. package/.aios-core/development/tasks/qa-risk-profile.md +566 -566
  141. package/.aios-core/development/tasks/qa-run-tests.md +277 -277
  142. package/.aios-core/development/tasks/qa-test-design.md +387 -387
  143. package/.aios-core/development/tasks/qa-trace-requirements.md +476 -476
  144. package/.aios-core/development/tasks/release-management.md +723 -723
  145. package/.aios-core/development/tasks/security-audit.md +554 -554
  146. package/.aios-core/development/tasks/security-scan.md +790 -790
  147. package/.aios-core/development/tasks/setup-database.md +741 -741
  148. package/.aios-core/development/tasks/setup-design-system.md +462 -462
  149. package/.aios-core/development/tasks/setup-github.md +874 -874
  150. package/.aios-core/development/tasks/setup-llm-routing.md +1 -1
  151. package/.aios-core/development/tasks/setup-mcp-docker.md +584 -584
  152. package/.aios-core/development/tasks/setup-project-docs.md +440 -0
  153. package/.aios-core/development/tasks/shard-doc.md +537 -537
  154. package/.aios-core/development/tasks/sm-create-next-story.md +480 -480
  155. package/.aios-core/development/tasks/sync-documentation.md +864 -864
  156. package/.aios-core/development/tasks/tailwind-upgrade.md +294 -294
  157. package/.aios-core/development/tasks/test-as-user.md +621 -621
  158. package/.aios-core/development/tasks/test-validation-task.md +171 -171
  159. package/.aios-core/development/tasks/undo-last.md +346 -346
  160. package/.aios-core/development/tasks/update-manifest.md +409 -409
  161. package/.aios-core/development/tasks/ux-create-wireframe.md +617 -617
  162. package/.aios-core/development/tasks/ux-ds-scan-artifact.md +672 -672
  163. package/.aios-core/development/tasks/ux-user-research.md +559 -559
  164. package/.aios-core/development/tasks/validate-next-story.md +422 -422
  165. package/.aios-core/development/workflows/README.md +83 -83
  166. package/.aios-core/development/workflows/brownfield-fullstack.yaml +297 -297
  167. package/.aios-core/development/workflows/brownfield-service.yaml +187 -187
  168. package/.aios-core/development/workflows/brownfield-ui.yaml +197 -197
  169. package/.aios-core/development/workflows/greenfield-fullstack.yaml +333 -333
  170. package/.aios-core/development/workflows/greenfield-service.yaml +206 -206
  171. package/.aios-core/development/workflows/greenfield-ui.yaml +235 -235
  172. package/.aios-core/docs/SHARD-TRANSLATION-GUIDE.md +335 -335
  173. package/.aios-core/docs/component-creation-guide.md +457 -457
  174. package/.aios-core/docs/session-update-pattern.md +307 -307
  175. package/.aios-core/docs/standards/AGENT-PERSONALIZATION-STANDARD-V1.md +572 -572
  176. package/.aios-core/docs/standards/AIOS-COLOR-PALETTE-QUICK-REFERENCE.md +185 -185
  177. package/.aios-core/docs/standards/AIOS-COLOR-PALETTE-V2.1.md +354 -354
  178. package/.aios-core/docs/standards/AIOS-FRAMEWORK-MASTER.md +1963 -1963
  179. package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-COMPLETE.md +821 -821
  180. package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1-SUMMARY.md +1190 -1190
  181. package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.1.md +439 -439
  182. package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO-V2.2-SUMMARY.md +1339 -1339
  183. package/.aios-core/docs/standards/AIOS-LIVRO-DE-OURO.md +5398 -5398
  184. package/.aios-core/docs/standards/EXECUTOR-DECISION-TREE.md +697 -697
  185. package/.aios-core/docs/standards/OPEN-SOURCE-VS-SERVICE-DIFFERENCES.md +511 -511
  186. package/.aios-core/docs/standards/QUALITY-GATES-SPECIFICATION.md +556 -556
  187. package/.aios-core/docs/standards/STANDARDS-INDEX.md +210 -210
  188. package/.aios-core/docs/standards/STORY-TEMPLATE-V2-SPECIFICATION.md +550 -550
  189. package/.aios-core/docs/standards/TASK-FORMAT-SPECIFICATION-V1.md +1414 -1414
  190. package/.aios-core/docs/standards/V3-ARCHITECTURAL-DECISIONS.md +523 -523
  191. package/.aios-core/docs/template-syntax.md +266 -266
  192. package/.aios-core/docs/troubleshooting-guide.md +624 -624
  193. package/.aios-core/index.esm.js +15 -15
  194. package/.aios-core/index.js +1 -1
  195. package/.aios-core/infrastructure/README.md +126 -126
  196. package/.aios-core/infrastructure/integrations/pm-adapters/README.md +59 -59
  197. package/.aios-core/infrastructure/scripts/approval-workflow.js +1 -1
  198. package/.aios-core/infrastructure/scripts/batch-creator.js +1 -1
  199. package/.aios-core/infrastructure/scripts/component-generator.js +3 -3
  200. package/.aios-core/infrastructure/scripts/component-metadata.js +1 -1
  201. package/.aios-core/infrastructure/scripts/component-search.js +1 -1
  202. package/.aios-core/infrastructure/scripts/coverage-analyzer.js +1 -1
  203. package/.aios-core/infrastructure/scripts/dependency-analyzer.js +1 -1
  204. package/.aios-core/infrastructure/scripts/dependency-impact-analyzer.js +1 -1
  205. package/.aios-core/infrastructure/scripts/documentation-integrity/brownfield-analyzer.js +501 -0
  206. package/.aios-core/infrastructure/scripts/documentation-integrity/config-generator.js +368 -0
  207. package/.aios-core/infrastructure/scripts/documentation-integrity/deployment-config-loader.js +308 -0
  208. package/.aios-core/infrastructure/scripts/documentation-integrity/doc-generator.js +331 -0
  209. package/.aios-core/infrastructure/scripts/documentation-integrity/gitignore-generator.js +312 -0
  210. package/.aios-core/infrastructure/scripts/documentation-integrity/index.js +74 -0
  211. package/.aios-core/infrastructure/scripts/documentation-integrity/mode-detector.js +389 -0
  212. package/.aios-core/infrastructure/scripts/framework-analyzer.js +1 -1
  213. package/.aios-core/infrastructure/scripts/improvement-engine.js +1 -1
  214. package/.aios-core/infrastructure/scripts/llm-routing/install-llm-routing.js +26 -13
  215. package/.aios-core/infrastructure/scripts/llm-routing/templates/claude-free-tracked.cmd +127 -0
  216. package/.aios-core/infrastructure/scripts/llm-routing/templates/claude-free-tracked.sh +108 -0
  217. package/.aios-core/infrastructure/scripts/llm-routing/templates/deepseek-proxy.cmd +71 -0
  218. package/.aios-core/infrastructure/scripts/llm-routing/templates/deepseek-proxy.sh +65 -0
  219. package/.aios-core/infrastructure/scripts/llm-routing/templates/deepseek-usage.cmd +51 -0
  220. package/.aios-core/infrastructure/scripts/llm-routing/templates/deepseek-usage.sh +16 -0
  221. package/.aios-core/infrastructure/scripts/llm-routing/usage-tracker/index.js +549 -0
  222. package/.aios-core/infrastructure/scripts/modification-risk-assessment.js +1 -1
  223. package/.aios-core/infrastructure/scripts/performance-analyzer.js +1 -1
  224. package/.aios-core/infrastructure/scripts/pm-adapter.js +134 -134
  225. package/.aios-core/infrastructure/scripts/repository-detector.js +3 -3
  226. package/.aios-core/infrastructure/scripts/template-engine.js +1 -1
  227. package/.aios-core/infrastructure/scripts/template-validator.js +1 -1
  228. package/.aios-core/infrastructure/scripts/test-generator.js +1 -1
  229. package/.aios-core/infrastructure/scripts/test-quality-assessment.js +1 -1
  230. package/.aios-core/infrastructure/scripts/transaction-manager.js +1 -1
  231. package/.aios-core/infrastructure/scripts/usage-analytics.js +1 -1
  232. package/.aios-core/infrastructure/scripts/visual-impact-generator.js +2 -2
  233. package/.aios-core/infrastructure/templates/core-config/core-config-brownfield.tmpl.yaml +176 -0
  234. package/.aios-core/infrastructure/templates/core-config/core-config-greenfield.tmpl.yaml +127 -0
  235. package/.aios-core/infrastructure/templates/github-workflows/README.md +109 -109
  236. package/.aios-core/infrastructure/templates/gitignore/gitignore-aios-base.tmpl +63 -0
  237. package/.aios-core/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +18 -0
  238. package/.aios-core/infrastructure/templates/gitignore/gitignore-node.tmpl +85 -0
  239. package/.aios-core/infrastructure/templates/gitignore/gitignore-python.tmpl +145 -0
  240. package/.aios-core/infrastructure/templates/project-docs/coding-standards-tmpl.md +346 -0
  241. package/.aios-core/infrastructure/templates/project-docs/source-tree-tmpl.md +177 -0
  242. package/.aios-core/infrastructure/templates/project-docs/tech-stack-tmpl.md +267 -0
  243. package/.aios-core/infrastructure/tests/regression-suite-v2.md +621 -621
  244. package/.aios-core/infrastructure/tools/README.md +222 -222
  245. package/.aios-core/infrastructure/tools/cli/github-cli.yaml +200 -200
  246. package/.aios-core/infrastructure/tools/cli/railway-cli.yaml +260 -260
  247. package/.aios-core/infrastructure/tools/cli/supabase-cli.yaml +224 -224
  248. package/.aios-core/infrastructure/tools/local/ffmpeg.yaml +261 -261
  249. package/.aios-core/infrastructure/tools/mcp/21st-dev-magic.yaml +127 -127
  250. package/.aios-core/infrastructure/tools/mcp/browser.yaml +103 -103
  251. package/.aios-core/infrastructure/tools/mcp/clickup.yaml +534 -534
  252. package/.aios-core/infrastructure/tools/mcp/context7.yaml +78 -78
  253. package/.aios-core/infrastructure/tools/mcp/desktop-commander.yaml +180 -180
  254. package/.aios-core/infrastructure/tools/mcp/exa.yaml +103 -103
  255. package/.aios-core/infrastructure/tools/mcp/google-workspace.yaml +930 -930
  256. package/.aios-core/infrastructure/tools/mcp/n8n.yaml +551 -551
  257. package/.aios-core/infrastructure/tools/mcp/supabase.yaml +808 -808
  258. package/.aios-core/install-manifest.yaml +347 -347
  259. package/.aios-core/product/README.md +56 -56
  260. package/.aios-core/product/checklists/accessibility-wcag-checklist.md +80 -0
  261. package/.aios-core/product/checklists/architect-checklist.md +443 -443
  262. package/.aios-core/product/checklists/change-checklist.md +182 -182
  263. package/.aios-core/product/checklists/component-quality-checklist.md +74 -0
  264. package/.aios-core/product/checklists/database-design-checklist.md +119 -119
  265. package/.aios-core/product/checklists/dba-predeploy-checklist.md +97 -97
  266. package/.aios-core/product/checklists/dba-rollback-checklist.md +99 -99
  267. package/.aios-core/product/checklists/migration-readiness-checklist.md +75 -0
  268. package/.aios-core/product/checklists/pattern-audit-checklist.md +88 -0
  269. package/.aios-core/product/checklists/pm-checklist.md +375 -375
  270. package/.aios-core/product/checklists/po-master-checklist.md +441 -441
  271. package/.aios-core/product/checklists/pre-push-checklist.md +108 -108
  272. package/.aios-core/product/checklists/release-checklist.md +122 -122
  273. package/.aios-core/product/checklists/story-dod-checklist.md +101 -101
  274. package/.aios-core/product/checklists/story-draft-checklist.md +215 -215
  275. package/.aios-core/product/data/atomic-design-principles.md +108 -0
  276. package/.aios-core/product/data/brainstorming-techniques.md +36 -36
  277. package/.aios-core/product/data/consolidation-algorithms.md +142 -0
  278. package/.aios-core/product/data/database-best-practices.md +182 -0
  279. package/.aios-core/product/data/design-token-best-practices.md +107 -0
  280. package/.aios-core/product/data/elicitation-methods.md +134 -134
  281. package/.aios-core/product/data/integration-patterns.md +207 -0
  282. package/.aios-core/product/data/migration-safety-guide.md +329 -0
  283. package/.aios-core/product/data/mode-selection-best-practices.md +471 -471
  284. package/.aios-core/product/data/postgres-tuning-guide.md +300 -0
  285. package/.aios-core/product/data/rls-security-patterns.md +333 -0
  286. package/.aios-core/product/data/roi-calculation-guide.md +142 -0
  287. package/.aios-core/product/data/supabase-patterns.md +330 -0
  288. package/.aios-core/product/data/test-levels-framework.md +148 -148
  289. package/.aios-core/product/data/test-priorities-matrix.md +174 -174
  290. package/.aios-core/product/data/wcag-compliance-guide.md +267 -0
  291. package/.aios-core/product/templates/1mcp-config.yaml +225 -225
  292. package/.aios-core/product/templates/activation-instructions-inline-greeting.yaml +63 -63
  293. package/.aios-core/product/templates/activation-instructions-template.md +258 -258
  294. package/.aios-core/product/templates/agent-template.yaml +120 -120
  295. package/.aios-core/product/templates/architecture-tmpl.yaml +650 -650
  296. package/.aios-core/product/templates/brainstorming-output-tmpl.yaml +155 -155
  297. package/.aios-core/product/templates/brownfield-architecture-tmpl.yaml +475 -475
  298. package/.aios-core/product/templates/brownfield-prd-tmpl.yaml +279 -279
  299. package/.aios-core/product/templates/changelog-template.md +134 -134
  300. package/.aios-core/product/templates/command-rationalization-matrix.md +152 -152
  301. package/.aios-core/product/templates/competitor-analysis-tmpl.yaml +292 -292
  302. package/.aios-core/product/templates/design-story-tmpl.yaml +587 -587
  303. package/.aios-core/product/templates/ds-artifact-analysis.md +70 -70
  304. package/.aios-core/product/templates/front-end-architecture-tmpl.yaml +205 -205
  305. package/.aios-core/product/templates/front-end-spec-tmpl.yaml +348 -348
  306. package/.aios-core/product/templates/fullstack-architecture-tmpl.yaml +804 -804
  307. package/.aios-core/product/templates/github-pr-template.md +67 -67
  308. package/.aios-core/product/templates/gordon-mcp.yaml +140 -140
  309. package/.aios-core/product/templates/ide-rules/antigravity-rules.md +115 -115
  310. package/.aios-core/product/templates/ide-rules/claude-rules.md +221 -221
  311. package/.aios-core/product/templates/ide-rules/cline-rules.md +84 -84
  312. package/.aios-core/product/templates/ide-rules/copilot-rules.md +92 -92
  313. package/.aios-core/product/templates/ide-rules/cursor-rules.md +115 -115
  314. package/.aios-core/product/templates/ide-rules/gemini-rules.md +85 -85
  315. package/.aios-core/product/templates/ide-rules/roo-rules.md +86 -86
  316. package/.aios-core/product/templates/ide-rules/trae-rules.md +104 -104
  317. package/.aios-core/product/templates/ide-rules/windsurf-rules.md +80 -80
  318. package/.aios-core/product/templates/index-strategy-tmpl.yaml +53 -53
  319. package/.aios-core/product/templates/market-research-tmpl.yaml +251 -251
  320. package/.aios-core/product/templates/mcp-workflow.js +271 -271
  321. package/.aios-core/product/templates/migration-plan-tmpl.yaml +1022 -1022
  322. package/.aios-core/product/templates/migration-strategy-tmpl.md +524 -524
  323. package/.aios-core/product/templates/personalized-agent-template.md +258 -258
  324. package/.aios-core/product/templates/personalized-checklist-template.md +340 -340
  325. package/.aios-core/product/templates/personalized-task-template-v2.md +905 -905
  326. package/.aios-core/product/templates/personalized-task-template.md +344 -344
  327. package/.aios-core/product/templates/personalized-template-file.yaml +322 -322
  328. package/.aios-core/product/templates/personalized-workflow-template.yaml +460 -460
  329. package/.aios-core/product/templates/prd-tmpl.yaml +201 -201
  330. package/.aios-core/product/templates/project-brief-tmpl.yaml +220 -220
  331. package/.aios-core/product/templates/qa-gate-tmpl.yaml +240 -240
  332. package/.aios-core/product/templates/rls-policies-tmpl.yaml +1203 -1203
  333. package/.aios-core/product/templates/schema-design-tmpl.yaml +428 -428
  334. package/.aios-core/product/templates/state-persistence-tmpl.yaml +219 -219
  335. package/.aios-core/product/templates/story-tmpl.yaml +331 -331
  336. package/.aios-core/product/templates/task-execution-report.md +495 -495
  337. package/.aios-core/product/templates/task-template.md +122 -122
  338. package/.aios-core/product/templates/token-exports-tailwind-tmpl.js +395 -395
  339. package/.aios-core/product/templates/tokens-schema-tmpl.yaml +305 -305
  340. package/.aios-core/product/templates/workflow-template.yaml +133 -133
  341. package/.aios-core/scripts/README.md +354 -354
  342. package/.aios-core/scripts/aios-doc-template.md +325 -325
  343. package/.aios-core/scripts/elicitation-engine.js +1 -1
  344. package/.aios-core/scripts/test-template-system.js +1 -1
  345. package/.aios-core/scripts/workflow-management.md +69 -69
  346. package/.aios-core/user-guide.md +1413 -1413
  347. package/.aios-core/working-in-the-brownfield.md +361 -361
  348. package/LICENSE +1 -1
  349. package/README.md +702 -703
  350. package/bin/aios-init-old.js +3 -3
  351. package/bin/aios-init-v4.js +1 -1
  352. package/bin/aios-init.backup-v1.1.4.js +1 -1
  353. package/bin/aios-init.js +3 -3
  354. package/bin/aios.js +279 -279
  355. package/bin/utils/install-errors.js +339 -339
  356. package/bin/utils/install-transaction.js +445 -445
  357. package/index.d.ts +18 -18
  358. package/index.esm.js +20 -20
  359. package/index.js +6 -6
  360. package/package.json +8 -10
  361. package/packages/installer/src/config/templates/env-template.js +27 -4
  362. package/packages/installer/src/detection/detect-project-type.js +81 -81
  363. package/packages/installer/src/wizard/wizard.js +185 -34
  364. package/packages/installer/tests/integration/environment-configuration.test.js +2 -1
  365. package/packages/installer/tests/integration/wizard-detection.test.js +8 -6
  366. package/packages/installer/tests/unit/env-template.test.js +11 -10
  367. package/src/config/ide-configs.js +1 -1
  368. package/src/wizard/feedback.js +2 -2
  369. package/src/wizard/index.js +1 -1
  370. package/src/wizard/validation/report-generator.js +1 -1
  371. package/src/wizard/validation/troubleshooting-system.js +13 -13
  372. package/.aios-core/development/tasks/validate-structure.md +0 -243
  373. package/.aios-core/infrastructure/scripts/_archived/final-todo-count.js +0 -122
  374. package/.aios-core/infrastructure/scripts/_archived/fix-yaml-formatting.js +0 -89
  375. package/.aios-core/infrastructure/scripts/_archived/migration-generator.js +0 -780
  376. package/.aios-core/infrastructure/scripts/_archived/migration-path-generator.js +0 -950
  377. package/.aios-core/infrastructure/scripts/_archived/phase2-entrada-saida-errors.js +0 -425
  378. package/.aios-core/infrastructure/scripts/_archived/phase2-spot-check.js +0 -132
  379. package/.aios-core/infrastructure/scripts/_archived/phase3-tools-scripts-validation.js +0 -381
  380. package/.aios-core/infrastructure/scripts/_archived/phase4-metadata-performance.js +0 -203
  381. package/.aios-core/infrastructure/scripts/_archived/test-yaml-parsing.js +0 -24
  382. package/.aios-core/infrastructure/scripts/_archived/verify-yaml-fix.js +0 -51
  383. package/.aios-core/infrastructure/scripts/source-tree-guardian/index.js +0 -375
  384. package/.aios-core/infrastructure/scripts/source-tree-guardian/manifest-generator.js +0 -410
  385. package/.aios-core/infrastructure/scripts/source-tree-guardian/rules/naming-rules.yaml +0 -285
  386. package/.aios-core/infrastructure/scripts/source-tree-guardian/rules/placement-rules.yaml +0 -262
  387. package/.aios-core/infrastructure/scripts/source-tree-guardian/validator.js +0 -468
  388. package/.aios-core/tasks/find-component.md.legacy +0 -391
  389. package/.aios-core/tasks/generate-commit-message.md.legacy +0 -426
  390. package/.aios-core/tasks/generate-migration.md.legacy +0 -382
  391. package/.aios-core/tasks/rollback-modification.md.legacy +0 -307
  392. package/.aios-core/tasks/update-tests.md.legacy +0 -283
@@ -1,1311 +1,1311 @@
1
- # environment-bootstrap
2
-
3
- **Task ID:** environment-bootstrap
4
- **Version:** 1.1.0
5
- **Created:** 2025-12-02
6
- **Updated:** 2025-12-02
7
- **Agent:** @devops (Gage)
8
-
9
- ---
10
-
11
- ## Purpose
12
-
13
- Complete environment bootstrap for new AIOS projects. Verifies and installs all required CLIs, authenticates services, initializes Git/GitHub repository, and validates the development environment before starting the greenfield workflow.
14
-
15
- **This task should be the FIRST step in any new project**, executed BEFORE the PRD creation.
16
-
17
- ---
18
-
19
- ## Execution Modes
20
-
21
- **Choose your execution mode:**
22
-
23
- ### 1. YOLO Mode - Fast, Autonomous (0-1 prompts)
24
- - Autonomous decision making with logging
25
- - Skips optional tools, installs only essential
26
- - **Best for:** Experienced developers, quick setup
27
-
28
- ### 2. Interactive Mode - Balanced, Educational (5-10 prompts) **[DEFAULT]**
29
- - Explicit decision checkpoints
30
- - Educational explanations for each tool
31
- - **Best for:** Learning, first-time setup, team onboarding
32
-
33
- ### 3. Pre-Flight Planning - Comprehensive Upfront Planning
34
- - Full analysis phase before any installation
35
- - Zero ambiguity execution
36
- - **Best for:** Enterprise environments, strict policies
37
-
38
- **Parameter:** `mode` (optional, default: `interactive`)
39
-
40
- ---
41
-
42
- ## Task Definition (AIOS Task Format V1.0)
43
-
44
- ```yaml
45
- task: environmentBootstrap()
46
- responsável: Gage (Operator)
47
- responsavel_type: Agente
48
- atomic_layer: Organism
49
-
50
- **Entrada:**
51
- - campo: project_name
52
- tipo: string
53
- origem: User Input
54
- obrigatório: true
55
- validação: Valid project name (lowercase, hyphens allowed)
56
-
57
- - campo: project_path
58
- tipo: string
59
- origem: User Input
60
- obrigatório: false
61
- validação: Valid directory path (defaults to current directory)
62
-
63
- - campo: github_org
64
- tipo: string
65
- origem: User Input
66
- obrigatório: false
67
- validação: Valid GitHub organization or username
68
-
69
- - campo: options
70
- tipo: object
71
- origem: User Input
72
- obrigatório: false
73
- validação: Bootstrap options (skip_optional, force_reinstall, etc.)
74
-
75
- **Saída:**
76
- - campo: environment_report
77
- tipo: object
78
- destino: File system (.aios/environment-report.yaml)
79
- persistido: true
80
-
81
- - campo: git_initialized
82
- tipo: boolean
83
- destino: Return value
84
- persistido: false
85
-
86
- - campo: github_repo_url
87
- tipo: string
88
- destino: Return value
89
- persistido: false
90
- ```
91
-
92
- ---
93
-
94
- ## Pre-Conditions
95
-
96
- **Purpose:** Validate prerequisites BEFORE task execution (blocking)
97
-
98
- **Checklist:**
99
-
100
- ```yaml
101
- pre-conditions:
102
- - [ ] Operating system is Windows, macOS, or Linux
103
- tipo: pre-condition
104
- blocker: true
105
- validação: |
106
- Detect OS via process.platform or uname
107
- error_message: "Unsupported operating system"
108
-
109
- - [ ] User has admin/sudo privileges for installations
110
- tipo: pre-condition
111
- blocker: false
112
- validação: |
113
- Check if user can run elevated commands
114
- error_message: "Some installations may require elevated privileges"
115
-
116
- - [ ] Internet connection available
117
- tipo: pre-condition
118
- blocker: true
119
- validação: |
120
- Ping github.com or check connectivity
121
- error_message: "Internet connection required for tool installation and authentication"
122
- ```
123
-
124
- ---
125
-
126
- ## Post-Conditions
127
-
128
- **Purpose:** Validate execution success AFTER task completes
129
-
130
- **Checklist:**
131
-
132
- ```yaml
133
- post-conditions:
134
- - [ ] All essential CLIs installed and accessible in PATH
135
- tipo: post-condition
136
- blocker: true
137
- validação: |
138
- Verify git, gh, node commands are executable
139
- error_message: "Essential CLI installation failed"
140
-
141
- - [ ] Git repository initialized with .gitignore
142
- tipo: post-condition
143
- blocker: true
144
- validação: |
145
- Check .git directory exists and .gitignore is configured
146
- error_message: "Git initialization failed"
147
-
148
- - [ ] Environment report generated
149
- tipo: post-condition
150
- blocker: false
151
- validação: |
152
- Check .aios/environment-report.yaml exists
153
- error_message: "Environment report not generated"
154
- ```
155
-
156
- ---
157
-
158
- ## Acceptance Criteria
159
-
160
- **Purpose:** Definitive pass/fail criteria for task completion
161
-
162
- **Checklist:**
163
-
164
- ```yaml
165
- acceptance-criteria:
166
- - [ ] Essential CLIs (git, gh, node) are installed and working
167
- tipo: acceptance-criterion
168
- blocker: true
169
- validação: |
170
- Assert all essential CLI commands return valid version output
171
- error_message: "Essential CLI verification failed"
172
-
173
- - [ ] GitHub CLI is authenticated
174
- tipo: acceptance-criterion
175
- blocker: true
176
- validação: |
177
- gh auth status returns authenticated
178
- error_message: "GitHub CLI not authenticated"
179
-
180
- - [ ] Git repository created locally and on GitHub
181
- tipo: acceptance-criterion
182
- blocker: true
183
- validação: |
184
- .git exists and gh repo view succeeds
185
- error_message: "Repository not properly initialized"
186
-
187
- - [ ] Project structure follows AIOS conventions
188
- tipo: acceptance-criterion
189
- blocker: false
190
- validação: |
191
- Check docs/, .aios/, and package.json exist
192
- error_message: "Project structure incomplete"
193
- ```
194
-
195
- ---
196
-
197
- ## Tools
198
-
199
- **External/shared resources used by this task:**
200
-
201
- - **Tool:** os-detector
202
- - **Purpose:** Detect operating system and package manager
203
- - **Source:** Built-in (process.platform, uname)
204
-
205
- - **Tool:** cli-checker
206
- - **Purpose:** Verify CLI installations and versions
207
- - **Source:** .aios-core/infrastructure/scripts/cli-checker.js
208
-
209
- - **Tool:** github-cli
210
- - **Purpose:** Repository creation and authentication
211
- - **Source:** .aios-core/infrastructure/tools/cli/github-cli.yaml
212
-
213
- ---
214
-
215
- ## Error Handling
216
-
217
- **Strategy:** retry-with-alternatives
218
-
219
- **Common Errors:**
220
-
221
- 1. **Error:** CLI Installation Failed
222
- - **Cause:** Package manager unavailable or network issues
223
- - **Resolution:** Try alternative package manager or manual install
224
- - **Recovery:** Provide manual installation instructions
225
-
226
- 2. **Error:** GitHub Authentication Failed
227
- - **Cause:** Token expired or user cancelled
228
- - **Resolution:** Re-run gh auth login
229
- - **Recovery:** Offer to skip GitHub setup and continue locally
230
-
231
- 3. **Error:** Permission Denied
232
- - **Cause:** Insufficient privileges for installation
233
- - **Resolution:** Run with elevated privileges or use user-scoped install
234
- - **Recovery:** Document required permissions for manual fix
235
-
236
- ---
237
-
238
- ## Performance
239
-
240
- **Expected Metrics:**
241
-
242
- ```yaml
243
- duration_expected: 5-15 min (depending on installations needed)
244
- cost_estimated: $0.00 (no AI tokens, CLI operations only)
245
- token_usage: ~500-1,000 tokens (for guidance only)
246
- ```
247
-
248
- **Optimization Notes:**
249
- - Parallel CLI checks to reduce total time
250
- - Cache detection results in .aios/environment-report.yaml
251
- - Skip already-installed tools
252
-
253
- ---
254
-
255
- ## Metadata
256
-
257
- ```yaml
258
- story: N/A (Framework enhancement)
259
- version: 1.1.0
260
- dependencies:
261
- - github-cli.yaml
262
- - supabase-cli.yaml
263
- - railway-cli.yaml
264
- - coderabbit
265
- tags:
266
- - bootstrap
267
- - environment
268
- - setup
269
- - greenfield
270
- updated_at: 2025-12-02
271
- changelog:
272
- 1.1.0:
273
- - Fixed: Git workflow - commit before gh repo create --push
274
- - Fixed: PowerShell vs bash syntax separation
275
- - Added: CLI update detection and offer for outdated tools
276
- - Added: Enhanced CodeRabbit CLI verification with WSL support
277
- - Improved: Clear separation of Windows/Unix commands
278
- ```
279
-
280
- ---
281
-
282
- ## Elicitation
283
-
284
- ```yaml
285
- elicit: true
286
- interaction_points:
287
- - project_name: "What is the project name?"
288
- - github_org: "GitHub organization or username for repository?"
289
- - optional_tools: "Which optional tools do you want to install?"
290
- - git_provider: "Git provider preference (GitHub/GitLab/Bitbucket)?"
291
- ```
292
-
293
- ---
294
-
295
- ## Process
296
-
297
- ### Step 1: Detect Operating System
298
-
299
- **Action:** Identify OS and available package managers
300
-
301
- **IMPORTANT:** The agent executing this task should detect the OS using native commands appropriate for the current shell. Do NOT mix PowerShell and bash syntax.
302
-
303
- **For Windows (PowerShell):**
304
- ```powershell
305
- # Windows PowerShell detection - use in PowerShell context only
306
- Write-Host "Detecting operating system..."
307
- Write-Host "OS: Windows"
308
- Write-Host "Architecture: $([System.Environment]::Is64BitOperatingSystem ? '64-bit' : '32-bit')"
309
-
310
- # Check package managers
311
- $pkgMgrs = @()
312
- if (Get-Command winget -ErrorAction SilentlyContinue) { $pkgMgrs += "winget" }
313
- if (Get-Command choco -ErrorAction SilentlyContinue) { $pkgMgrs += "chocolatey" }
314
- if (Get-Command scoop -ErrorAction SilentlyContinue) { $pkgMgrs += "scoop" }
315
- Write-Host "Package managers: $($pkgMgrs -join ', ')"
316
- ```
317
-
318
- **For macOS/Linux (bash):**
319
- ```bash
320
- # Unix bash detection - use in bash/zsh context only
321
- echo "Detecting operating system..."
322
- OS=$(uname -s)
323
- ARCH=$(uname -m)
324
-
325
- echo "OS: $OS"
326
- echo "Architecture: $ARCH"
327
-
328
- # Check available package managers
329
- if [ "$OS" = "Darwin" ]; then
330
- command -v brew >/dev/null 2>&1 && echo "Package manager: Homebrew"
331
- elif [ "$OS" = "Linux" ]; then
332
- command -v apt >/dev/null 2>&1 && echo "Package manager: apt"
333
- command -v dnf >/dev/null 2>&1 && echo "Package manager: dnf"
334
- command -v pacman >/dev/null 2>&1 && echo "Package manager: pacman"
335
- fi
336
- ```
337
-
338
- **Agent Guidance:**
339
- - On Windows: Use PowerShell commands directly (no bash wrapper needed)
340
- - On macOS/Linux: Use bash commands directly
341
- - NEVER mix syntax (e.g., don't use `${}` bash variables in PowerShell context)
342
- - Simple version checks work cross-platform: `git --version`, `node --version`, etc.
343
-
344
- **Output:** Store OS info for subsequent steps
345
-
346
- ---
347
-
348
- ### Step 2: CLI Tools Audit
349
-
350
- **Action:** Check all required and optional CLIs
351
-
352
- Present comprehensive status table:
353
-
354
- ```
355
- ╔════════════════════════════════════════════════════════════════════════╗
356
- ║ AIOS ENVIRONMENT AUDIT ║
357
- ╠════════════════════════════════════════════════════════════════════════╣
358
- ║ Category │ Tool │ Status │ Version │ Required ║
359
- ╠═══════════════╪═══════════════╪═══════════╪════════════╪══════════════╣
360
- ║ ESSENTIAL │ git │ ✅ OK │ 2.43.0 │ YES ║
361
- ║ │ gh (GitHub) │ ❌ MISSING│ - │ YES ║
362
- ║ │ node │ ✅ OK │ 20.10.0 │ YES ║
363
- ║ │ npm │ ✅ OK │ 10.2.4 │ YES ║
364
- ╠═══════════════╪═══════════════╪═══════════╪════════════╪══════════════╣
365
- ║ INFRASTRUCTURE│ supabase │ ❌ MISSING│ - │ RECOMMENDED ║
366
- ║ │ railway │ ❌ MISSING│ - │ OPTIONAL ║
367
- ║ │ docker │ ✅ OK │ 24.0.7 │ RECOMMENDED ║
368
- ╠═══════════════╪═══════════════╪═══════════╪════════════╪══════════════╣
369
- ║ QUALITY │ coderabbit │ ⚠️ CHECK │ 0.8.0 │ RECOMMENDED ║
370
- ║ │ │ (WSL/Win) │ │ ║
371
- ╠═══════════════╪═══════════════╪═══════════╪════════════╪══════════════╣
372
- ║ OPTIONAL │ pnpm │ ❌ MISSING│ - │ OPTIONAL ║
373
- ║ │ bun │ ❌ MISSING│ - │ OPTIONAL ║
374
- ╚════════════════════════════════════════════════════════════════════════╝
375
-
376
- Summary: 4/10 tools installed | 2 essential missing | 4 recommended missing
377
- ```
378
-
379
- **Update Detection:**
380
-
381
- When a tool is installed but outdated, display additional information:
382
-
383
- ```
384
- ║ ⚠️ UPDATES AVAILABLE ║
385
- ╠═══════════════╪═══════════════╪═══════════════╪═══════════════╪══════════════╣
386
- ║ Tool │ Current │ Latest │ Update Command ║
387
- ╠═══════════════╪═══════════════╪═══════════════╪═══════════════════════════════╣
388
- ║ supabase │ 2.24.3 │ 2.62.10 │ npm update -g supabase ║
389
- ║ gh │ 2.40.0 │ 2.63.0 │ winget upgrade GitHub.cli ║
390
- ╚═══════════════════════════════════════════════════════════════════════════════╝
391
-
392
- Would you like to update outdated tools? (Y/n): _
393
- ```
394
-
395
- **Update Check Commands:**
396
-
397
- ```yaml
398
- update_checks:
399
- supabase:
400
- check_latest: "npm view supabase version"
401
- update:
402
- npm: "npm update -g supabase"
403
- scoop: "scoop update supabase"
404
- brew: "brew upgrade supabase"
405
-
406
- gh:
407
- check_latest: "gh api repos/cli/cli/releases/latest --jq .tag_name"
408
- update:
409
- windows: "winget upgrade GitHub.cli"
410
- macos: "brew upgrade gh"
411
- linux: "gh upgrade"
412
-
413
- node:
414
- note: "Consider using nvm/fnm for Node.js version management"
415
- check_latest: "npm view node version"
416
-
417
- railway:
418
- check_latest: "npm view @railway/cli version"
419
- update:
420
- npm: "npm update -g @railway/cli"
421
- ```
422
-
423
- **CLI Check Commands:**
424
-
425
- ```yaml
426
- cli_checks:
427
- essential:
428
- git:
429
- check: "git --version"
430
- expected: "git version 2.x"
431
- install:
432
- windows: "winget install --id Git.Git"
433
- macos: "xcode-select --install"
434
- linux: "sudo apt install git"
435
-
436
- gh:
437
- check: "gh --version"
438
- expected: "gh version 2.x"
439
- install:
440
- windows: "winget install --id GitHub.cli"
441
- macos: "brew install gh"
442
- linux: "sudo apt install gh"
443
- post_install: "gh auth login"
444
-
445
- node:
446
- check: "node --version"
447
- expected: "v18.x or v20.x"
448
- install:
449
- windows: "winget install --id OpenJS.NodeJS.LTS"
450
- macos: "brew install node@20"
451
- linux: "curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt install nodejs"
452
-
453
- npm:
454
- check: "npm --version"
455
- expected: "10.x"
456
- note: "Installed with Node.js"
457
-
458
- infrastructure:
459
- supabase:
460
- check: "supabase --version"
461
- expected: "1.x"
462
- install:
463
- npm: "npm install -g supabase"
464
- scoop: "scoop bucket add supabase https://github.com/supabase/scoop-bucket.git && scoop install supabase"
465
- brew: "brew install supabase/tap/supabase"
466
- post_install: "supabase login"
467
-
468
- railway:
469
- check: "railway --version"
470
- expected: "3.x"
471
- install:
472
- npm: "npm install -g @railway/cli"
473
- brew: "brew install railway"
474
- post_install: "railway login"
475
-
476
- docker:
477
- check: "docker --version"
478
- expected: "24.x or 25.x"
479
- install:
480
- windows: "winget install --id Docker.DockerDesktop"
481
- macos: "brew install --cask docker"
482
- linux: "See https://docs.docker.com/engine/install/"
483
- note: "Required for local Supabase development"
484
-
485
- quality:
486
- coderabbit:
487
- check_windows: |
488
- # Windows: CodeRabbit CLI is installed in WSL, not native Windows
489
- # First check if WSL is available
490
- wsl --version
491
- if ($LASTEXITCODE -eq 0) {
492
- # Then check CodeRabbit in WSL
493
- wsl bash -c 'if [ -f ~/.local/bin/coderabbit ]; then ~/.local/bin/coderabbit --version; else echo "NOT_INSTALLED"; fi'
494
- } else {
495
- Write-Host "WSL not available - CodeRabbit requires WSL on Windows"
496
- }
497
- check_unix: |
498
- # macOS/Linux: Check direct installation
499
- if command -v coderabbit >/dev/null 2>&1; then
500
- coderabbit --version
501
- elif [ -f ~/.local/bin/coderabbit ]; then
502
- ~/.local/bin/coderabbit --version
503
- else
504
- echo "NOT_INSTALLED"
505
- fi
506
- expected: "0.8.x or higher"
507
- install:
508
- windows_wsl: |
509
- # 1. Ensure WSL is installed: wsl --install
510
- # 2. In WSL terminal:
511
- curl -fsSL https://coderabbit.ai/install.sh | bash
512
- # 3. Authenticate:
513
- ~/.local/bin/coderabbit auth login
514
- macos: "curl -fsSL https://coderabbit.ai/install.sh | bash"
515
- linux: "curl -fsSL https://coderabbit.ai/install.sh | bash"
516
- note: |
517
- WINDOWS USERS: CodeRabbit CLI runs in WSL, not native Windows.
518
- - Requires WSL with Ubuntu/Debian distribution
519
- - Binary located at ~/.local/bin/coderabbit (inside WSL)
520
- - All coderabbit commands must use: wsl bash -c 'command'
521
- - See: docs/guides/coderabbit/README.md for full setup guide
522
- verification:
523
- windows: "wsl bash -c '~/.local/bin/coderabbit --version'"
524
- unix: "coderabbit --version"
525
-
526
- optional:
527
- pnpm:
528
- check: "pnpm --version"
529
- expected: "8.x"
530
- install:
531
- npm: "npm install -g pnpm"
532
- note: "Faster alternative to npm"
533
-
534
- bun:
535
- check: "bun --version"
536
- expected: "1.x"
537
- install:
538
- windows: "powershell -c \"irm bun.sh/install.ps1 | iex\""
539
- unix: "curl -fsSL https://bun.sh/install | bash"
540
- note: "Ultra-fast JavaScript runtime"
541
- ```
542
-
543
- ---
544
-
545
- ### Step 3: Interactive Installation
546
-
547
- **Action:** Offer to install missing tools
548
-
549
- **Elicitation Point:**
550
-
551
- ```
552
- Missing tools detected. How would you like to proceed?
553
-
554
- 1. INSTALL ALL - Install all missing essential + recommended tools
555
- 2. ESSENTIAL ONLY - Install only essential tools (git, gh, node)
556
- 3. CUSTOM - Choose which tools to install
557
- 4. SKIP - Continue without installing (not recommended)
558
-
559
- Select option (1/2/3/4): _
560
- ```
561
-
562
- **If CUSTOM selected:**
563
-
564
- ```
565
- Select tools to install (comma-separated numbers):
566
-
567
- ESSENTIAL (required for AIOS):
568
- [1] gh (GitHub CLI) - Repository management, PR creation
569
-
570
- INFRASTRUCTURE (recommended):
571
- [2] supabase - Database management, local development
572
- [3] railway - Cloud deployment
573
- [4] docker - Containerization, local Supabase
574
-
575
- QUALITY (recommended):
576
- [5] coderabbit - Pre-PR code review (WSL required on Windows)
577
-
578
- OPTIONAL:
579
- [6] pnpm - Fast package manager
580
- [7] bun - Ultra-fast JavaScript runtime
581
-
582
- Enter selection (e.g., 1,2,3,5): _
583
- ```
584
-
585
- **Installation Execution:**
586
-
587
- ```bash
588
- # Example: Installing GitHub CLI on Windows
589
- echo "Installing GitHub CLI..."
590
- winget install --id GitHub.cli --accept-source-agreements --accept-package-agreements
591
-
592
- if ($LASTEXITCODE -eq 0) {
593
- Write-Host "✅ GitHub CLI installed successfully"
594
-
595
- # Refresh PATH
596
- $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
597
-
598
- # Verify installation
599
- gh --version
600
- } else {
601
- Write-Host "❌ Installation failed. Manual installation required."
602
- Write-Host " Download: https://cli.github.com/"
603
- }
604
- ```
605
-
606
- ---
607
-
608
- ### Step 4: Service Authentication
609
-
610
- **Action:** Authenticate required services
611
-
612
- **Elicitation Point:**
613
-
614
- ```
615
- Service authentication required. The following services need login:
616
-
617
- 1. GitHub CLI (gh) - Required for repository creation
618
- 2. Supabase CLI - Required for database management
619
- 3. Railway CLI - Required for deployment
620
-
621
- Authenticate now? (Y/n): _
622
- ```
623
-
624
- **GitHub Authentication:**
625
-
626
- ```bash
627
- echo "=== GitHub CLI Authentication ==="
628
- echo ""
629
-
630
- # Check current auth status
631
- $authStatus = gh auth status 2>&1
632
-
633
- if ($LASTEXITCODE -eq 0) {
634
- Write-Host "✅ Already authenticated to GitHub"
635
- gh auth status
636
- } else {
637
- Write-Host "Starting GitHub authentication..."
638
- Write-Host ""
639
- Write-Host "Options:"
640
- Write-Host " 1. Login with browser (recommended)"
641
- Write-Host " 2. Login with token"
642
- Write-Host ""
643
-
644
- gh auth login
645
-
646
- if ($LASTEXITCODE -eq 0) {
647
- Write-Host "✅ GitHub authentication successful"
648
- } else {
649
- Write-Host "❌ GitHub authentication failed"
650
- Write-Host " Try again: gh auth login"
651
- }
652
- }
653
- ```
654
-
655
- **Supabase Authentication:**
656
-
657
- ```bash
658
- echo "=== Supabase CLI Authentication ==="
659
-
660
- # Check if already logged in
661
- $supabaseStatus = supabase projects list 2>&1
662
-
663
- if ($LASTEXITCODE -eq 0) {
664
- Write-Host "✅ Already authenticated to Supabase"
665
- } else {
666
- Write-Host "Starting Supabase authentication..."
667
- supabase login
668
-
669
- if ($LASTEXITCODE -eq 0) {
670
- Write-Host "✅ Supabase authentication successful"
671
- }
672
- }
673
- ```
674
-
675
- **Railway Authentication:**
676
-
677
- ```bash
678
- echo "=== Railway CLI Authentication ==="
679
-
680
- $railwayStatus = railway whoami 2>&1
681
-
682
- if ($LASTEXITCODE -eq 0) {
683
- Write-Host "✅ Already authenticated to Railway"
684
- railway whoami
685
- } else {
686
- Write-Host "Starting Railway authentication..."
687
- railway login
688
- }
689
- ```
690
-
691
- ---
692
-
693
- ### Step 5: Git Repository Initialization
694
-
695
- **Action:** Initialize local Git repository and create GitHub remote
696
-
697
- **Elicitation Point:**
698
-
699
- ```
700
- Git Repository Setup
701
-
702
- Project name: my-awesome-project
703
-
704
- Options:
705
- 1. Create NEW repository on GitHub (recommended for greenfield)
706
- 2. Link to EXISTING GitHub repository
707
- 3. LOCAL ONLY - Initialize git without GitHub
708
- 4. SKIP - No git initialization
709
-
710
- Select option (1/2/3/4): _
711
- ```
712
-
713
- **If NEW repository:**
714
-
715
- ```
716
- GitHub Repository Configuration:
717
-
718
- Repository name: my-awesome-project
719
- Visibility:
720
- 1. Public
721
- 2. Private (recommended)
722
-
723
- GitHub Organization/Username:
724
- Found organizations: Pedrovaleriolopez, AllFluence
725
- Or use personal account: your-username
726
-
727
- Select owner: _
728
-
729
- Description (optional): _
730
- ```
731
-
732
- **Repository Creation:**
733
-
734
- ```bash
735
- echo "=== Creating Git Repository ==="
736
-
737
- # Initialize local git
738
- git init
739
-
740
- # Create .gitignore
741
- @"
742
- # Dependencies
743
- node_modules/
744
- .pnpm-store/
745
-
746
- # Build outputs
747
- dist/
748
- build/
749
- .next/
750
- out/
751
-
752
- # Environment files
753
- .env
754
- .env.local
755
- .env.*.local
756
-
757
- # IDE
758
- .idea/
759
- .vscode/
760
- *.swp
761
- *.swo
762
-
763
- # OS files
764
- .DS_Store
765
- Thumbs.db
766
-
767
- # AIOS generated files
768
- .aios/project-status.yaml
769
- .aios/environment-report.yaml
770
-
771
- # Logs
772
- logs/
773
- *.log
774
- npm-debug.log*
775
-
776
- # Testing
777
- coverage/
778
- .nyc_output/
779
-
780
- # Temporary files
781
- tmp/
782
- temp/
783
- *.tmp
784
- "@ | Out-File -FilePath .gitignore -Encoding utf8
785
-
786
- # Create initial README
787
- @"
788
- # $PROJECT_NAME
789
-
790
- > Created with AIOS-FULLSTACK
791
-
792
- ## Getting Started
793
-
794
- \`\`\`bash
795
- npm install
796
- npm run dev
797
- \`\`\`
798
-
799
- ## Documentation
800
-
801
- - [PRD](docs/prd.md)
802
- - [Architecture](docs/architecture.md)
803
-
804
- ---
805
- *Generated by AIOS Environment Bootstrap*
806
- "@ | Out-File -FilePath README.md -Encoding utf8
807
-
808
- # CRITICAL: Create initial commit BEFORE gh repo create --push
809
- # The --push flag requires at least one commit to exist
810
- git add .
811
- git commit -m "chore: initial project setup
812
-
813
- - Initialize AIOS-FULLSTACK project structure
814
- - Add .gitignore with standard exclusions
815
- - Add README.md with project placeholder
816
-
817
- 🤖 Generated by AIOS Environment Bootstrap"
818
-
819
- if ($LASTEXITCODE -ne 0) {
820
- Write-Host "⚠️ Initial commit failed. Checking if already committed..."
821
- $hasCommits = git rev-parse HEAD 2>$null
822
- if (-not $hasCommits) {
823
- Write-Host "❌ Cannot proceed without initial commit"
824
- exit 1
825
- }
826
- }
827
-
828
- # Now create GitHub repository with --push (requires existing commits)
829
- gh repo create $PROJECT_NAME --private --description "$DESCRIPTION" --source . --remote origin --push
830
-
831
- if ($LASTEXITCODE -eq 0) {
832
- Write-Host "✅ Repository created and pushed to GitHub"
833
- gh repo view --web
834
- } else {
835
- Write-Host "❌ GitHub repository creation failed"
836
- Write-Host " Trying alternative approach..."
837
-
838
- # Alternative: Create repo without push, then push manually
839
- gh repo create $PROJECT_NAME --private --description "$DESCRIPTION" --source . --remote origin
840
- if ($LASTEXITCODE -eq 0) {
841
- git push -u origin main
842
- Write-Host "✅ Repository created and pushed (alternative method)"
843
- } else {
844
- Write-Host "❌ Please create repository manually: gh repo create"
845
- }
846
- }
847
- ```
848
-
849
- ---
850
-
851
- ### Step 6: Project Structure Scaffold
852
-
853
- **Action:** Create AIOS-compliant project structure
854
-
855
- ```bash
856
- echo "=== Creating Project Structure ==="
857
-
858
- # Create directory structure
859
- $directories = @(
860
- "docs",
861
- "docs/stories",
862
- "docs/architecture",
863
- "docs/guides",
864
- ".aios",
865
- "src",
866
- "tests"
867
- )
868
-
869
- foreach ($dir in $directories) {
870
- New-Item -ItemType Directory -Path $dir -Force | Out-Null
871
- Write-Host " Created: $dir/"
872
- }
873
-
874
- # Create .aios/config.yaml
875
- @"
876
- # AIOS Project Configuration
877
- version: 2.1.0
878
- project:
879
- name: $PROJECT_NAME
880
- type: greenfield
881
- created: $(Get-Date -Format "yyyy-MM-dd")
882
-
883
- environment:
884
- bootstrapped: true
885
- bootstrap_date: $(Get-Date -Format "yyyy-MM-ddTHH:mm:ss")
886
-
887
- workflow:
888
- current: greenfield-fullstack
889
- phase: 0-bootstrap-complete
890
-
891
- settings:
892
- auto_update_status: true
893
- quality_gates_enabled: true
894
- "@ | Out-File -FilePath ".aios/config.yaml" -Encoding utf8
895
-
896
- # Create package.json if not exists
897
- if (-not (Test-Path "package.json")) {
898
- @"
899
- {
900
- "name": "$PROJECT_NAME",
901
- "version": "0.1.0",
902
- "description": "Created with AIOS-FULLSTACK",
903
- "scripts": {
904
- "dev": "echo 'Add your dev script'",
905
- "build": "echo 'Add your build script'",
906
- "test": "echo 'Add your test script'",
907
- "lint": "echo 'Add your lint script'",
908
- "typecheck": "echo 'Add your typecheck script'"
909
- },
910
- "keywords": [],
911
- "author": "",
912
- "license": "ISC"
913
- }
914
- "@ | Out-File -FilePath "package.json" -Encoding utf8
915
- }
916
-
917
- Write-Host "✅ Project structure created"
918
- ```
919
-
920
- ---
921
-
922
- ### Step 6.5: Docker MCP Setup (Optional but Recommended)
923
-
924
- **Condition:** Docker Desktop 4.50+ is installed AND Docker MCP Toolkit is available
925
-
926
- **Action:** Configure Docker MCP Toolkit with HTTP transport for Claude Code integration
927
-
928
- **Elicitation Point:**
929
-
930
- ```
931
- ╔════════════════════════════════════════════════════════════════════════╗
932
- ║ DOCKER MCP SETUP ║
933
- ╠════════════════════════════════════════════════════════════════════════╣
934
- ║ ║
935
- ║ Docker Desktop detected with MCP Toolkit! ║
936
- ║ ║
937
- ║ Configure MCP servers for Claude Code? ║
938
- ║ ║
939
- ║ 1. MINIMAL - context7 + desktop-commander + playwright (no API keys) ║
940
- ║ 2. FULL - minimal + exa (requires EXA_API_KEY) ║
941
- ║ 3. SKIP - Configure later with *setup-mcp-docker ║
942
- ║ ║
943
- ║ Select option (1/2/3): _ ║
944
- ║ ║
945
- ╚════════════════════════════════════════════════════════════════════════╝
946
- ```
947
-
948
- **YOLO Mode Behavior:** Auto-select MINIMAL (no API keys required)
949
-
950
- **If MINIMAL or FULL selected:**
951
-
952
- **Step 6.5.1: Start Gateway Service**
953
-
954
- ```powershell
955
- # Windows
956
- Write-Host "Starting MCP Gateway service..."
957
-
958
- # Create gateway service file if not exists
959
- if (-not (Test-Path ".docker/mcp/gateway-service.yml")) {
960
- # Copy from template or create
961
- New-Item -ItemType Directory -Path ".docker/mcp" -Force | Out-Null
962
- # Gateway service will be started by Docker Compose
963
- }
964
-
965
- # Start gateway as persistent service
966
- docker compose -f .docker/mcp/gateway-service.yml up -d
967
-
968
- # Wait for gateway to be healthy
969
- $maxRetries = 12
970
- $retryCount = 0
971
- do {
972
- Start-Sleep -Seconds 5
973
- $health = Invoke-WebRequest -Uri "http://localhost:8080/health" -UseBasicParsing -ErrorAction SilentlyContinue
974
- $retryCount++
975
- } while ($health.StatusCode -ne 200 -and $retryCount -lt $maxRetries)
976
-
977
- if ($health.StatusCode -eq 200) {
978
- Write-Host "✅ MCP Gateway is healthy"
979
- } else {
980
- Write-Host "⚠️ MCP Gateway health check failed - continuing anyway"
981
- }
982
- ```
983
-
984
- **Step 6.5.2: Enable Default MCPs**
985
-
986
- ```powershell
987
- # Enable minimal preset MCPs (no API keys required)
988
- Write-Host "Enabling MCP servers..."
989
-
990
- docker mcp server enable context7
991
- docker mcp server enable desktop-commander
992
- docker mcp server enable playwright
993
-
994
- # If FULL preset selected and EXA_API_KEY exists
995
- if ($PRESET -eq "FULL" -and $env:EXA_API_KEY) {
996
- docker mcp server enable exa
997
- Write-Host "✅ Exa MCP enabled (web search)"
998
- }
999
-
1000
- # Configure desktop-commander with user home path
1001
- $userHome = $env:USERPROFILE
1002
- docker mcp config write "desktop-commander:`n paths:`n - $userHome"
1003
-
1004
- Write-Host "✅ MCP servers enabled"
1005
- docker mcp server ls
1006
- ```
1007
-
1008
- **Step 6.5.3: Configure Claude Code (HTTP Transport)**
1009
-
1010
- ```powershell
1011
- Write-Host "Configuring Claude Code for MCP Gateway..."
1012
-
1013
- $claudeConfigPath = Join-Path $env:USERPROFILE ".claude.json"
1014
-
1015
- if (Test-Path $claudeConfigPath) {
1016
- # Read existing config
1017
- $claudeConfig = Get-Content $claudeConfigPath | ConvertFrom-Json
1018
-
1019
- # Add or update docker-gateway with HTTP transport
1020
- if (-not $claudeConfig.mcpServers) {
1021
- $claudeConfig | Add-Member -NotePropertyName "mcpServers" -NotePropertyValue @{} -Force
1022
- }
1023
-
1024
- $claudeConfig.mcpServers.'docker-gateway' = @{
1025
- type = "http"
1026
- url = "http://localhost:8080/mcp"
1027
- }
1028
-
1029
- # Save config
1030
- $claudeConfig | ConvertTo-Json -Depth 10 | Set-Content $claudeConfigPath -Encoding UTF8
1031
- Write-Host "✅ Claude Code configured with HTTP transport"
1032
- } else {
1033
- Write-Host "⚠️ ~/.claude.json not found - please configure manually"
1034
- Write-Host " Add to mcpServers: { 'docker-gateway': { 'type': 'http', 'url': 'http://localhost:8080/mcp' } }"
1035
- }
1036
- ```
1037
-
1038
- **Step 6.5.4: Verify MCP Setup**
1039
-
1040
- ```powershell
1041
- Write-Host "Verifying MCP setup..."
1042
-
1043
- # Check gateway health
1044
- $health = Invoke-WebRequest -Uri "http://localhost:8080/health" -UseBasicParsing -ErrorAction SilentlyContinue
1045
- if ($health.StatusCode -eq 200) {
1046
- Write-Host "✅ Gateway: Healthy"
1047
- } else {
1048
- Write-Host "❌ Gateway: Not responding"
1049
- }
1050
-
1051
- # Check enabled servers
1052
- $servers = docker mcp server ls
1053
- Write-Host "✅ Enabled servers: $servers"
1054
-
1055
- # Summary
1056
- Write-Host ""
1057
- Write-Host "═══════════════════════════════════════════════════════════════"
1058
- Write-Host " MCP SETUP COMPLETE"
1059
- Write-Host "═══════════════════════════════════════════════════════════════"
1060
- Write-Host " Gateway: http://localhost:8080 (HTTP/SSE)"
1061
- Write-Host " MCPs: context7, desktop-commander, playwright"
1062
- Write-Host " Claude Config: ~/.claude.json (HTTP transport)"
1063
- Write-Host ""
1064
- Write-Host " ⚠️ IMPORTANT: Restart Claude Code to connect to MCP Gateway"
1065
- Write-Host "═══════════════════════════════════════════════════════════════"
1066
- ```
1067
-
1068
- **Skip Conditions:**
1069
- - Docker not installed or not running
1070
- - Docker MCP Toolkit not available
1071
- - User selected SKIP option
1072
-
1073
- **Output:** MCP setup status added to environment report
1074
-
1075
- ---
1076
-
1077
- ### Step 7: Environment Report Generation
1078
-
1079
- **Action:** Generate comprehensive environment report
1080
-
1081
- ```bash
1082
- echo "=== Generating Environment Report ==="
1083
-
1084
- # Collect all environment information
1085
- $report = @{
1086
- generated_at = Get-Date -Format "yyyy-MM-ddTHH:mm:ss"
1087
- project_name = $PROJECT_NAME
1088
-
1089
- system = @{
1090
- os = [System.Environment]::OSVersion.VersionString
1091
- architecture = if ([System.Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" }
1092
- user = $env:USERNAME
1093
- hostname = $env:COMPUTERNAME
1094
- }
1095
-
1096
- cli_tools = @{
1097
- git = @{
1098
- installed = $true
1099
- version = (git --version) -replace "git version ", ""
1100
- path = (Get-Command git).Source
1101
- }
1102
- gh = @{
1103
- installed = (Get-Command gh -ErrorAction SilentlyContinue) -ne $null
1104
- version = if (Get-Command gh -ErrorAction SilentlyContinue) { (gh --version | Select-Object -First 1) -replace "gh version ", "" } else { $null }
1105
- authenticated = (gh auth status 2>&1) -match "Logged in"
1106
- }
1107
- node = @{
1108
- installed = (Get-Command node -ErrorAction SilentlyContinue) -ne $null
1109
- version = if (Get-Command node -ErrorAction SilentlyContinue) { (node --version) -replace "v", "" } else { $null }
1110
- }
1111
- npm = @{
1112
- installed = (Get-Command npm -ErrorAction SilentlyContinue) -ne $null
1113
- version = if (Get-Command npm -ErrorAction SilentlyContinue) { npm --version } else { $null }
1114
- }
1115
- supabase = @{
1116
- installed = (Get-Command supabase -ErrorAction SilentlyContinue) -ne $null
1117
- version = if (Get-Command supabase -ErrorAction SilentlyContinue) { (supabase --version) } else { $null }
1118
- authenticated = $false # Check separately
1119
- }
1120
- railway = @{
1121
- installed = (Get-Command railway -ErrorAction SilentlyContinue) -ne $null
1122
- version = if (Get-Command railway -ErrorAction SilentlyContinue) { (railway --version) } else { $null }
1123
- }
1124
- docker = @{
1125
- installed = (Get-Command docker -ErrorAction SilentlyContinue) -ne $null
1126
- version = if (Get-Command docker -ErrorAction SilentlyContinue) { (docker --version) -replace "Docker version ", "" -replace ",.*", "" } else { $null }
1127
- running = (docker info 2>&1) -notmatch "error"
1128
- }
1129
- }
1130
-
1131
- repository = @{
1132
- initialized = Test-Path ".git"
1133
- remote_url = if (Test-Path ".git") { git remote get-url origin 2>$null } else { $null }
1134
- branch = if (Test-Path ".git") { git branch --show-current } else { $null }
1135
- }
1136
-
1137
- validation = @{
1138
- essential_complete = $true
1139
- recommended_complete = $false
1140
- ready_for_development = $true
1141
- }
1142
- }
1143
-
1144
- # Convert to YAML and save
1145
- # (Simplified - in practice use ConvertTo-Yaml module or js-yaml)
1146
- $report | ConvertTo-Json -Depth 5 | Out-File -FilePath ".aios/environment-report.json" -Encoding utf8
1147
-
1148
- Write-Host "✅ Environment report saved to .aios/environment-report.json"
1149
- ```
1150
-
1151
- ---
1152
-
1153
- ### Step 8: Final Validation & Summary
1154
-
1155
- **Action:** Validate environment and display summary
1156
-
1157
- ```
1158
- ╔═══════════════════════════════════════════════════════════════════════════╗
1159
- ║ ✅ AIOS ENVIRONMENT BOOTSTRAP COMPLETE ║
1160
- ╠═══════════════════════════════════════════════════════════════════════════╣
1161
- ║ ║
1162
- ║ Project: my-awesome-project ║
1163
- ║ Repository: https://github.com/username/my-awesome-project ║
1164
- ║ Branch: main ║
1165
- ║ ║
1166
- ╠═══════════════════════════════════════════════════════════════════════════╣
1167
- ║ CLI Tools Status ║
1168
- ╠═══════════════════════════════════════════════════════════════════════════╣
1169
- ║ ✅ git 2.43.0 ✅ gh 2.40.1 (authenticated) ║
1170
- ║ ✅ node 20.10.0 ✅ npm 10.2.4 ║
1171
- ║ ✅ supabase 1.123.0 ✅ railway 3.5.0 ║
1172
- ║ ✅ docker 24.0.7 ⚠️ coderabbit (WSL only) ║
1173
- ║ ║
1174
- ╠═══════════════════════════════════════════════════════════════════════════╣
1175
- ║ Project Structure ║
1176
- ╠═══════════════════════════════════════════════════════════════════════════╣
1177
- ║ my-awesome-project/ ║
1178
- ║ ├── .aios/ # AIOS configuration ║
1179
- ║ │ ├── config.yaml # Project config ║
1180
- ║ │ └── environment-report.json ║
1181
- ║ ├── docs/ # Documentation (PRD, architecture) ║
1182
- ║ │ ├── stories/ # User stories ║
1183
- ║ │ ├── architecture/ # Architecture docs ║
1184
- ║ │ └── guides/ # Developer guides ║
1185
- ║ ├── src/ # Source code ║
1186
- ║ ├── tests/ # Test files ║
1187
- ║ ├── .gitignore # Git ignore rules ║
1188
- ║ ├── package.json # NPM configuration ║
1189
- ║ └── README.md # Project readme ║
1190
- ║ ║
1191
- ╠═══════════════════════════════════════════════════════════════════════════╣
1192
- ║ NEXT STEPS ║
1193
- ╠═══════════════════════════════════════════════════════════════════════════╣
1194
- ║ ║
1195
- ║ Your environment is ready! Continue with the Greenfield workflow: ║
1196
- ║ ║
1197
- ║ 1. @analyst → Create Project Brief ║
1198
- ║ Start a new chat: @analyst ║
1199
- ║ Command: *create-doc project-brief ║
1200
- ║ ║
1201
- ║ 2. @pm → Create PRD ║
1202
- ║ After project brief is approved ║
1203
- ║ Command: *create-doc prd ║
1204
- ║ ║
1205
- ║ 3. Continue with greenfield-fullstack workflow... ║
1206
- ║ ║
1207
- ║ Full workflow: .aios-core/development/workflows/greenfield-fullstack.yaml ║
1208
- ║ ║
1209
- ╠═══════════════════════════════════════════════════════════════════════════╣
1210
- ║ Quick Reference ║
1211
- ╠═══════════════════════════════════════════════════════════════════════════╣
1212
- ║ • View environment report: cat .aios/environment-report.json ║
1213
- ║ • Check GitHub repo: gh repo view --web ║
1214
- ║ • AIOS help: @aios-master *help ║
1215
- ║ • Re-run bootstrap: @devops *environment-bootstrap ║
1216
- ║ ║
1217
- ╚═══════════════════════════════════════════════════════════════════════════╝
1218
-
1219
- Environment bootstrap completed in 8m 32s
1220
-
1221
- — Gage, environment configured with confidence 🚀
1222
- ```
1223
-
1224
- ---
1225
-
1226
- ## Validation Checklist
1227
-
1228
- - [ ] Operating system detected correctly
1229
- - [ ] All essential CLIs installed (git, gh, node, npm)
1230
- - [ ] GitHub CLI authenticated
1231
- - [ ] Git repository initialized
1232
- - [ ] GitHub remote repository created
1233
- - [ ] .gitignore configured
1234
- - [ ] Project structure created
1235
- - [ ] .aios/config.yaml created
1236
- - [ ] Environment report generated
1237
- - [ ] Initial commit pushed to GitHub
1238
-
1239
- ---
1240
-
1241
- ## Troubleshooting
1242
-
1243
- ### Issue 1: winget not recognized
1244
-
1245
- **Error:** `winget: The term 'winget' is not recognized`
1246
-
1247
- **Fix:**
1248
- 1. Update Windows to latest version (winget requires Windows 10 1809+)
1249
- 2. Or install App Installer from Microsoft Store
1250
- 3. Or use alternative: `choco install gh` or `scoop install gh`
1251
-
1252
- ### Issue 2: gh auth login fails
1253
-
1254
- **Error:** `error connecting to api.github.com`
1255
-
1256
- **Fix:**
1257
- 1. Check internet connection
1258
- 2. Check if behind corporate proxy: `gh config set http_proxy http://proxy:port`
1259
- 3. Try token-based auth: `gh auth login --with-token`
1260
-
1261
- ### Issue 3: Permission denied creating repository
1262
-
1263
- **Error:** `Resource not accessible by personal access token`
1264
-
1265
- **Fix:**
1266
- 1. Re-authenticate with correct scopes: `gh auth login --scopes repo,workflow`
1267
- 2. Check if organization requires SSO: `gh auth login --hostname github.com`
1268
-
1269
- ### Issue 4: Docker not starting
1270
-
1271
- **Error:** `Cannot connect to Docker daemon`
1272
-
1273
- **Fix:**
1274
- 1. Windows: Ensure Docker Desktop is running
1275
- 2. macOS: Open Docker.app
1276
- 3. Linux: `sudo systemctl start docker`
1277
-
1278
- ---
1279
-
1280
- ## Rollback
1281
-
1282
- To undo environment bootstrap:
1283
-
1284
- ```bash
1285
- # Remove local git
1286
- rm -rf .git
1287
-
1288
- # Remove AIOS files
1289
- rm -rf .aios
1290
- rm -f .gitignore
1291
- rm -f README.md
1292
-
1293
- # Delete GitHub repository (CAUTION!)
1294
- gh repo delete REPO_NAME --yes
1295
- ```
1296
-
1297
- ---
1298
-
1299
- ## References
1300
-
1301
- - [GitHub CLI Documentation](https://cli.github.com/manual/)
1302
- - [Supabase CLI Documentation](https://supabase.com/docs/guides/cli)
1303
- - [Railway CLI Documentation](https://docs.railway.app/reference/cli-api)
1304
- - [AIOS Greenfield Workflow](.aios-core/development/workflows/greenfield-fullstack.yaml)
1305
- - [CodeRabbit Setup Guide](docs/guides/coderabbit/README.md)
1306
-
1307
- ---
1308
-
1309
- **Status:** ✅ Production Ready
1310
- **Tested On:** Windows 11, macOS Sonoma, Ubuntu 22.04
1311
- **Minimum Requirements:** Windows 10 1809+, macOS 12+, Ubuntu 20.04+
1
+ # environment-bootstrap
2
+
3
+ **Task ID:** environment-bootstrap
4
+ **Version:** 1.1.0
5
+ **Created:** 2025-12-02
6
+ **Updated:** 2025-12-02
7
+ **Agent:** @devops (Gage)
8
+
9
+ ---
10
+
11
+ ## Purpose
12
+
13
+ Complete environment bootstrap for new AIOS projects. Verifies and installs all required CLIs, authenticates services, initializes Git/GitHub repository, and validates the development environment before starting the greenfield workflow.
14
+
15
+ **This task should be the FIRST step in any new project**, executed BEFORE the PRD creation.
16
+
17
+ ---
18
+
19
+ ## Execution Modes
20
+
21
+ **Choose your execution mode:**
22
+
23
+ ### 1. YOLO Mode - Fast, Autonomous (0-1 prompts)
24
+ - Autonomous decision making with logging
25
+ - Skips optional tools, installs only essential
26
+ - **Best for:** Experienced developers, quick setup
27
+
28
+ ### 2. Interactive Mode - Balanced, Educational (5-10 prompts) **[DEFAULT]**
29
+ - Explicit decision checkpoints
30
+ - Educational explanations for each tool
31
+ - **Best for:** Learning, first-time setup, team onboarding
32
+
33
+ ### 3. Pre-Flight Planning - Comprehensive Upfront Planning
34
+ - Full analysis phase before any installation
35
+ - Zero ambiguity execution
36
+ - **Best for:** Enterprise environments, strict policies
37
+
38
+ **Parameter:** `mode` (optional, default: `interactive`)
39
+
40
+ ---
41
+
42
+ ## Task Definition (AIOS Task Format V1.0)
43
+
44
+ ```yaml
45
+ task: environmentBootstrap()
46
+ responsável: Gage (Operator)
47
+ responsavel_type: Agente
48
+ atomic_layer: Organism
49
+
50
+ **Entrada:**
51
+ - campo: project_name
52
+ tipo: string
53
+ origem: User Input
54
+ obrigatório: true
55
+ validação: Valid project name (lowercase, hyphens allowed)
56
+
57
+ - campo: project_path
58
+ tipo: string
59
+ origem: User Input
60
+ obrigatório: false
61
+ validação: Valid directory path (defaults to current directory)
62
+
63
+ - campo: github_org
64
+ tipo: string
65
+ origem: User Input
66
+ obrigatório: false
67
+ validação: Valid GitHub organization or username
68
+
69
+ - campo: options
70
+ tipo: object
71
+ origem: User Input
72
+ obrigatório: false
73
+ validação: Bootstrap options (skip_optional, force_reinstall, etc.)
74
+
75
+ **Saída:**
76
+ - campo: environment_report
77
+ tipo: object
78
+ destino: File system (.aios/environment-report.yaml)
79
+ persistido: true
80
+
81
+ - campo: git_initialized
82
+ tipo: boolean
83
+ destino: Return value
84
+ persistido: false
85
+
86
+ - campo: github_repo_url
87
+ tipo: string
88
+ destino: Return value
89
+ persistido: false
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Pre-Conditions
95
+
96
+ **Purpose:** Validate prerequisites BEFORE task execution (blocking)
97
+
98
+ **Checklist:**
99
+
100
+ ```yaml
101
+ pre-conditions:
102
+ - [ ] Operating system is Windows, macOS, or Linux
103
+ tipo: pre-condition
104
+ blocker: true
105
+ validação: |
106
+ Detect OS via process.platform or uname
107
+ error_message: "Unsupported operating system"
108
+
109
+ - [ ] User has admin/sudo privileges for installations
110
+ tipo: pre-condition
111
+ blocker: false
112
+ validação: |
113
+ Check if user can run elevated commands
114
+ error_message: "Some installations may require elevated privileges"
115
+
116
+ - [ ] Internet connection available
117
+ tipo: pre-condition
118
+ blocker: true
119
+ validação: |
120
+ Ping github.com or check connectivity
121
+ error_message: "Internet connection required for tool installation and authentication"
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Post-Conditions
127
+
128
+ **Purpose:** Validate execution success AFTER task completes
129
+
130
+ **Checklist:**
131
+
132
+ ```yaml
133
+ post-conditions:
134
+ - [ ] All essential CLIs installed and accessible in PATH
135
+ tipo: post-condition
136
+ blocker: true
137
+ validação: |
138
+ Verify git, gh, node commands are executable
139
+ error_message: "Essential CLI installation failed"
140
+
141
+ - [ ] Git repository initialized with .gitignore
142
+ tipo: post-condition
143
+ blocker: true
144
+ validação: |
145
+ Check .git directory exists and .gitignore is configured
146
+ error_message: "Git initialization failed"
147
+
148
+ - [ ] Environment report generated
149
+ tipo: post-condition
150
+ blocker: false
151
+ validação: |
152
+ Check .aios/environment-report.yaml exists
153
+ error_message: "Environment report not generated"
154
+ ```
155
+
156
+ ---
157
+
158
+ ## Acceptance Criteria
159
+
160
+ **Purpose:** Definitive pass/fail criteria for task completion
161
+
162
+ **Checklist:**
163
+
164
+ ```yaml
165
+ acceptance-criteria:
166
+ - [ ] Essential CLIs (git, gh, node) are installed and working
167
+ tipo: acceptance-criterion
168
+ blocker: true
169
+ validação: |
170
+ Assert all essential CLI commands return valid version output
171
+ error_message: "Essential CLI verification failed"
172
+
173
+ - [ ] GitHub CLI is authenticated
174
+ tipo: acceptance-criterion
175
+ blocker: true
176
+ validação: |
177
+ gh auth status returns authenticated
178
+ error_message: "GitHub CLI not authenticated"
179
+
180
+ - [ ] Git repository created locally and on GitHub
181
+ tipo: acceptance-criterion
182
+ blocker: true
183
+ validação: |
184
+ .git exists and gh repo view succeeds
185
+ error_message: "Repository not properly initialized"
186
+
187
+ - [ ] Project structure follows AIOS conventions
188
+ tipo: acceptance-criterion
189
+ blocker: false
190
+ validação: |
191
+ Check docs/, .aios/, and package.json exist
192
+ error_message: "Project structure incomplete"
193
+ ```
194
+
195
+ ---
196
+
197
+ ## Tools
198
+
199
+ **External/shared resources used by this task:**
200
+
201
+ - **Tool:** os-detector
202
+ - **Purpose:** Detect operating system and package manager
203
+ - **Source:** Built-in (process.platform, uname)
204
+
205
+ - **Tool:** cli-checker
206
+ - **Purpose:** Verify CLI installations and versions
207
+ - **Source:** .aios-core/infrastructure/scripts/cli-checker.js
208
+
209
+ - **Tool:** github-cli
210
+ - **Purpose:** Repository creation and authentication
211
+ - **Source:** .aios-core/infrastructure/tools/cli/github-cli.yaml
212
+
213
+ ---
214
+
215
+ ## Error Handling
216
+
217
+ **Strategy:** retry-with-alternatives
218
+
219
+ **Common Errors:**
220
+
221
+ 1. **Error:** CLI Installation Failed
222
+ - **Cause:** Package manager unavailable or network issues
223
+ - **Resolution:** Try alternative package manager or manual install
224
+ - **Recovery:** Provide manual installation instructions
225
+
226
+ 2. **Error:** GitHub Authentication Failed
227
+ - **Cause:** Token expired or user cancelled
228
+ - **Resolution:** Re-run gh auth login
229
+ - **Recovery:** Offer to skip GitHub setup and continue locally
230
+
231
+ 3. **Error:** Permission Denied
232
+ - **Cause:** Insufficient privileges for installation
233
+ - **Resolution:** Run with elevated privileges or use user-scoped install
234
+ - **Recovery:** Document required permissions for manual fix
235
+
236
+ ---
237
+
238
+ ## Performance
239
+
240
+ **Expected Metrics:**
241
+
242
+ ```yaml
243
+ duration_expected: 5-15 min (depending on installations needed)
244
+ cost_estimated: $0.00 (no AI tokens, CLI operations only)
245
+ token_usage: ~500-1,000 tokens (for guidance only)
246
+ ```
247
+
248
+ **Optimization Notes:**
249
+ - Parallel CLI checks to reduce total time
250
+ - Cache detection results in .aios/environment-report.yaml
251
+ - Skip already-installed tools
252
+
253
+ ---
254
+
255
+ ## Metadata
256
+
257
+ ```yaml
258
+ story: N/A (Framework enhancement)
259
+ version: 1.1.0
260
+ dependencies:
261
+ - github-cli.yaml
262
+ - supabase-cli.yaml
263
+ - railway-cli.yaml
264
+ - coderabbit
265
+ tags:
266
+ - bootstrap
267
+ - environment
268
+ - setup
269
+ - greenfield
270
+ updated_at: 2025-12-02
271
+ changelog:
272
+ 1.1.0:
273
+ - Fixed: Git workflow - commit before gh repo create --push
274
+ - Fixed: PowerShell vs bash syntax separation
275
+ - Added: CLI update detection and offer for outdated tools
276
+ - Added: Enhanced CodeRabbit CLI verification with WSL support
277
+ - Improved: Clear separation of Windows/Unix commands
278
+ ```
279
+
280
+ ---
281
+
282
+ ## Elicitation
283
+
284
+ ```yaml
285
+ elicit: true
286
+ interaction_points:
287
+ - project_name: "What is the project name?"
288
+ - github_org: "GitHub organization or username for repository?"
289
+ - optional_tools: "Which optional tools do you want to install?"
290
+ - git_provider: "Git provider preference (GitHub/GitLab/Bitbucket)?"
291
+ ```
292
+
293
+ ---
294
+
295
+ ## Process
296
+
297
+ ### Step 1: Detect Operating System
298
+
299
+ **Action:** Identify OS and available package managers
300
+
301
+ **IMPORTANT:** The agent executing this task should detect the OS using native commands appropriate for the current shell. Do NOT mix PowerShell and bash syntax.
302
+
303
+ **For Windows (PowerShell):**
304
+ ```powershell
305
+ # Windows PowerShell detection - use in PowerShell context only
306
+ Write-Host "Detecting operating system..."
307
+ Write-Host "OS: Windows"
308
+ Write-Host "Architecture: $([System.Environment]::Is64BitOperatingSystem ? '64-bit' : '32-bit')"
309
+
310
+ # Check package managers
311
+ $pkgMgrs = @()
312
+ if (Get-Command winget -ErrorAction SilentlyContinue) { $pkgMgrs += "winget" }
313
+ if (Get-Command choco -ErrorAction SilentlyContinue) { $pkgMgrs += "chocolatey" }
314
+ if (Get-Command scoop -ErrorAction SilentlyContinue) { $pkgMgrs += "scoop" }
315
+ Write-Host "Package managers: $($pkgMgrs -join ', ')"
316
+ ```
317
+
318
+ **For macOS/Linux (bash):**
319
+ ```bash
320
+ # Unix bash detection - use in bash/zsh context only
321
+ echo "Detecting operating system..."
322
+ OS=$(uname -s)
323
+ ARCH=$(uname -m)
324
+
325
+ echo "OS: $OS"
326
+ echo "Architecture: $ARCH"
327
+
328
+ # Check available package managers
329
+ if [ "$OS" = "Darwin" ]; then
330
+ command -v brew >/dev/null 2>&1 && echo "Package manager: Homebrew"
331
+ elif [ "$OS" = "Linux" ]; then
332
+ command -v apt >/dev/null 2>&1 && echo "Package manager: apt"
333
+ command -v dnf >/dev/null 2>&1 && echo "Package manager: dnf"
334
+ command -v pacman >/dev/null 2>&1 && echo "Package manager: pacman"
335
+ fi
336
+ ```
337
+
338
+ **Agent Guidance:**
339
+ - On Windows: Use PowerShell commands directly (no bash wrapper needed)
340
+ - On macOS/Linux: Use bash commands directly
341
+ - NEVER mix syntax (e.g., don't use `${}` bash variables in PowerShell context)
342
+ - Simple version checks work cross-platform: `git --version`, `node --version`, etc.
343
+
344
+ **Output:** Store OS info for subsequent steps
345
+
346
+ ---
347
+
348
+ ### Step 2: CLI Tools Audit
349
+
350
+ **Action:** Check all required and optional CLIs
351
+
352
+ Present comprehensive status table:
353
+
354
+ ```
355
+ ╔════════════════════════════════════════════════════════════════════════╗
356
+ ║ AIOS ENVIRONMENT AUDIT ║
357
+ ╠════════════════════════════════════════════════════════════════════════╣
358
+ ║ Category │ Tool │ Status │ Version │ Required ║
359
+ ╠═══════════════╪═══════════════╪═══════════╪════════════╪══════════════╣
360
+ ║ ESSENTIAL │ git │ ✅ OK │ 2.43.0 │ YES ║
361
+ ║ │ gh (GitHub) │ ❌ MISSING│ - │ YES ║
362
+ ║ │ node │ ✅ OK │ 20.10.0 │ YES ║
363
+ ║ │ npm │ ✅ OK │ 10.2.4 │ YES ║
364
+ ╠═══════════════╪═══════════════╪═══════════╪════════════╪══════════════╣
365
+ ║ INFRASTRUCTURE│ supabase │ ❌ MISSING│ - │ RECOMMENDED ║
366
+ ║ │ railway │ ❌ MISSING│ - │ OPTIONAL ║
367
+ ║ │ docker │ ✅ OK │ 24.0.7 │ RECOMMENDED ║
368
+ ╠═══════════════╪═══════════════╪═══════════╪════════════╪══════════════╣
369
+ ║ QUALITY │ coderabbit │ ⚠️ CHECK │ 0.8.0 │ RECOMMENDED ║
370
+ ║ │ │ (WSL/Win) │ │ ║
371
+ ╠═══════════════╪═══════════════╪═══════════╪════════════╪══════════════╣
372
+ ║ OPTIONAL │ pnpm │ ❌ MISSING│ - │ OPTIONAL ║
373
+ ║ │ bun │ ❌ MISSING│ - │ OPTIONAL ║
374
+ ╚════════════════════════════════════════════════════════════════════════╝
375
+
376
+ Summary: 4/10 tools installed | 2 essential missing | 4 recommended missing
377
+ ```
378
+
379
+ **Update Detection:**
380
+
381
+ When a tool is installed but outdated, display additional information:
382
+
383
+ ```
384
+ ║ ⚠️ UPDATES AVAILABLE ║
385
+ ╠═══════════════╪═══════════════╪═══════════════╪═══════════════╪══════════════╣
386
+ ║ Tool │ Current │ Latest │ Update Command ║
387
+ ╠═══════════════╪═══════════════╪═══════════════╪═══════════════════════════════╣
388
+ ║ supabase │ 2.24.3 │ 2.62.10 │ npm update -g supabase ║
389
+ ║ gh │ 2.40.0 │ 2.63.0 │ winget upgrade GitHub.cli ║
390
+ ╚═══════════════════════════════════════════════════════════════════════════════╝
391
+
392
+ Would you like to update outdated tools? (Y/n): _
393
+ ```
394
+
395
+ **Update Check Commands:**
396
+
397
+ ```yaml
398
+ update_checks:
399
+ supabase:
400
+ check_latest: "npm view supabase version"
401
+ update:
402
+ npm: "npm update -g supabase"
403
+ scoop: "scoop update supabase"
404
+ brew: "brew upgrade supabase"
405
+
406
+ gh:
407
+ check_latest: "gh api repos/cli/cli/releases/latest --jq .tag_name"
408
+ update:
409
+ windows: "winget upgrade GitHub.cli"
410
+ macos: "brew upgrade gh"
411
+ linux: "gh upgrade"
412
+
413
+ node:
414
+ note: "Consider using nvm/fnm for Node.js version management"
415
+ check_latest: "npm view node version"
416
+
417
+ railway:
418
+ check_latest: "npm view @railway/cli version"
419
+ update:
420
+ npm: "npm update -g @railway/cli"
421
+ ```
422
+
423
+ **CLI Check Commands:**
424
+
425
+ ```yaml
426
+ cli_checks:
427
+ essential:
428
+ git:
429
+ check: "git --version"
430
+ expected: "git version 2.x"
431
+ install:
432
+ windows: "winget install --id Git.Git"
433
+ macos: "xcode-select --install"
434
+ linux: "sudo apt install git"
435
+
436
+ gh:
437
+ check: "gh --version"
438
+ expected: "gh version 2.x"
439
+ install:
440
+ windows: "winget install --id GitHub.cli"
441
+ macos: "brew install gh"
442
+ linux: "sudo apt install gh"
443
+ post_install: "gh auth login"
444
+
445
+ node:
446
+ check: "node --version"
447
+ expected: "v18.x or v20.x"
448
+ install:
449
+ windows: "winget install --id OpenJS.NodeJS.LTS"
450
+ macos: "brew install node@20"
451
+ linux: "curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt install nodejs"
452
+
453
+ npm:
454
+ check: "npm --version"
455
+ expected: "10.x"
456
+ note: "Installed with Node.js"
457
+
458
+ infrastructure:
459
+ supabase:
460
+ check: "supabase --version"
461
+ expected: "1.x"
462
+ install:
463
+ npm: "npm install -g supabase"
464
+ scoop: "scoop bucket add supabase https://github.com/supabase/scoop-bucket.git && scoop install supabase"
465
+ brew: "brew install supabase/tap/supabase"
466
+ post_install: "supabase login"
467
+
468
+ railway:
469
+ check: "railway --version"
470
+ expected: "3.x"
471
+ install:
472
+ npm: "npm install -g @railway/cli"
473
+ brew: "brew install railway"
474
+ post_install: "railway login"
475
+
476
+ docker:
477
+ check: "docker --version"
478
+ expected: "24.x or 25.x"
479
+ install:
480
+ windows: "winget install --id Docker.DockerDesktop"
481
+ macos: "brew install --cask docker"
482
+ linux: "See https://docs.docker.com/engine/install/"
483
+ note: "Required for local Supabase development"
484
+
485
+ quality:
486
+ coderabbit:
487
+ check_windows: |
488
+ # Windows: CodeRabbit CLI is installed in WSL, not native Windows
489
+ # First check if WSL is available
490
+ wsl --version
491
+ if ($LASTEXITCODE -eq 0) {
492
+ # Then check CodeRabbit in WSL
493
+ wsl bash -c 'if [ -f ~/.local/bin/coderabbit ]; then ~/.local/bin/coderabbit --version; else echo "NOT_INSTALLED"; fi'
494
+ } else {
495
+ Write-Host "WSL not available - CodeRabbit requires WSL on Windows"
496
+ }
497
+ check_unix: |
498
+ # macOS/Linux: Check direct installation
499
+ if command -v coderabbit >/dev/null 2>&1; then
500
+ coderabbit --version
501
+ elif [ -f ~/.local/bin/coderabbit ]; then
502
+ ~/.local/bin/coderabbit --version
503
+ else
504
+ echo "NOT_INSTALLED"
505
+ fi
506
+ expected: "0.8.x or higher"
507
+ install:
508
+ windows_wsl: |
509
+ # 1. Ensure WSL is installed: wsl --install
510
+ # 2. In WSL terminal:
511
+ curl -fsSL https://coderabbit.ai/install.sh | bash
512
+ # 3. Authenticate:
513
+ ~/.local/bin/coderabbit auth login
514
+ macos: "curl -fsSL https://coderabbit.ai/install.sh | bash"
515
+ linux: "curl -fsSL https://coderabbit.ai/install.sh | bash"
516
+ note: |
517
+ WINDOWS USERS: CodeRabbit CLI runs in WSL, not native Windows.
518
+ - Requires WSL with Ubuntu/Debian distribution
519
+ - Binary located at ~/.local/bin/coderabbit (inside WSL)
520
+ - All coderabbit commands must use: wsl bash -c 'command'
521
+ - See: docs/guides/coderabbit/README.md for full setup guide
522
+ verification:
523
+ windows: "wsl bash -c '~/.local/bin/coderabbit --version'"
524
+ unix: "coderabbit --version"
525
+
526
+ optional:
527
+ pnpm:
528
+ check: "pnpm --version"
529
+ expected: "8.x"
530
+ install:
531
+ npm: "npm install -g pnpm"
532
+ note: "Faster alternative to npm"
533
+
534
+ bun:
535
+ check: "bun --version"
536
+ expected: "1.x"
537
+ install:
538
+ windows: "powershell -c \"irm bun.sh/install.ps1 | iex\""
539
+ unix: "curl -fsSL https://bun.sh/install | bash"
540
+ note: "Ultra-fast JavaScript runtime"
541
+ ```
542
+
543
+ ---
544
+
545
+ ### Step 3: Interactive Installation
546
+
547
+ **Action:** Offer to install missing tools
548
+
549
+ **Elicitation Point:**
550
+
551
+ ```
552
+ Missing tools detected. How would you like to proceed?
553
+
554
+ 1. INSTALL ALL - Install all missing essential + recommended tools
555
+ 2. ESSENTIAL ONLY - Install only essential tools (git, gh, node)
556
+ 3. CUSTOM - Choose which tools to install
557
+ 4. SKIP - Continue without installing (not recommended)
558
+
559
+ Select option (1/2/3/4): _
560
+ ```
561
+
562
+ **If CUSTOM selected:**
563
+
564
+ ```
565
+ Select tools to install (comma-separated numbers):
566
+
567
+ ESSENTIAL (required for AIOS):
568
+ [1] gh (GitHub CLI) - Repository management, PR creation
569
+
570
+ INFRASTRUCTURE (recommended):
571
+ [2] supabase - Database management, local development
572
+ [3] railway - Cloud deployment
573
+ [4] docker - Containerization, local Supabase
574
+
575
+ QUALITY (recommended):
576
+ [5] coderabbit - Pre-PR code review (WSL required on Windows)
577
+
578
+ OPTIONAL:
579
+ [6] pnpm - Fast package manager
580
+ [7] bun - Ultra-fast JavaScript runtime
581
+
582
+ Enter selection (e.g., 1,2,3,5): _
583
+ ```
584
+
585
+ **Installation Execution:**
586
+
587
+ ```bash
588
+ # Example: Installing GitHub CLI on Windows
589
+ echo "Installing GitHub CLI..."
590
+ winget install --id GitHub.cli --accept-source-agreements --accept-package-agreements
591
+
592
+ if ($LASTEXITCODE -eq 0) {
593
+ Write-Host "✅ GitHub CLI installed successfully"
594
+
595
+ # Refresh PATH
596
+ $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
597
+
598
+ # Verify installation
599
+ gh --version
600
+ } else {
601
+ Write-Host "❌ Installation failed. Manual installation required."
602
+ Write-Host " Download: https://cli.github.com/"
603
+ }
604
+ ```
605
+
606
+ ---
607
+
608
+ ### Step 4: Service Authentication
609
+
610
+ **Action:** Authenticate required services
611
+
612
+ **Elicitation Point:**
613
+
614
+ ```
615
+ Service authentication required. The following services need login:
616
+
617
+ 1. GitHub CLI (gh) - Required for repository creation
618
+ 2. Supabase CLI - Required for database management
619
+ 3. Railway CLI - Required for deployment
620
+
621
+ Authenticate now? (Y/n): _
622
+ ```
623
+
624
+ **GitHub Authentication:**
625
+
626
+ ```bash
627
+ echo "=== GitHub CLI Authentication ==="
628
+ echo ""
629
+
630
+ # Check current auth status
631
+ $authStatus = gh auth status 2>&1
632
+
633
+ if ($LASTEXITCODE -eq 0) {
634
+ Write-Host "✅ Already authenticated to GitHub"
635
+ gh auth status
636
+ } else {
637
+ Write-Host "Starting GitHub authentication..."
638
+ Write-Host ""
639
+ Write-Host "Options:"
640
+ Write-Host " 1. Login with browser (recommended)"
641
+ Write-Host " 2. Login with token"
642
+ Write-Host ""
643
+
644
+ gh auth login
645
+
646
+ if ($LASTEXITCODE -eq 0) {
647
+ Write-Host "✅ GitHub authentication successful"
648
+ } else {
649
+ Write-Host "❌ GitHub authentication failed"
650
+ Write-Host " Try again: gh auth login"
651
+ }
652
+ }
653
+ ```
654
+
655
+ **Supabase Authentication:**
656
+
657
+ ```bash
658
+ echo "=== Supabase CLI Authentication ==="
659
+
660
+ # Check if already logged in
661
+ $supabaseStatus = supabase projects list 2>&1
662
+
663
+ if ($LASTEXITCODE -eq 0) {
664
+ Write-Host "✅ Already authenticated to Supabase"
665
+ } else {
666
+ Write-Host "Starting Supabase authentication..."
667
+ supabase login
668
+
669
+ if ($LASTEXITCODE -eq 0) {
670
+ Write-Host "✅ Supabase authentication successful"
671
+ }
672
+ }
673
+ ```
674
+
675
+ **Railway Authentication:**
676
+
677
+ ```bash
678
+ echo "=== Railway CLI Authentication ==="
679
+
680
+ $railwayStatus = railway whoami 2>&1
681
+
682
+ if ($LASTEXITCODE -eq 0) {
683
+ Write-Host "✅ Already authenticated to Railway"
684
+ railway whoami
685
+ } else {
686
+ Write-Host "Starting Railway authentication..."
687
+ railway login
688
+ }
689
+ ```
690
+
691
+ ---
692
+
693
+ ### Step 5: Git Repository Initialization
694
+
695
+ **Action:** Initialize local Git repository and create GitHub remote
696
+
697
+ **Elicitation Point:**
698
+
699
+ ```
700
+ Git Repository Setup
701
+
702
+ Project name: my-awesome-project
703
+
704
+ Options:
705
+ 1. Create NEW repository on GitHub (recommended for greenfield)
706
+ 2. Link to EXISTING GitHub repository
707
+ 3. LOCAL ONLY - Initialize git without GitHub
708
+ 4. SKIP - No git initialization
709
+
710
+ Select option (1/2/3/4): _
711
+ ```
712
+
713
+ **If NEW repository:**
714
+
715
+ ```
716
+ GitHub Repository Configuration:
717
+
718
+ Repository name: my-awesome-project
719
+ Visibility:
720
+ 1. Public
721
+ 2. Private (recommended)
722
+
723
+ GitHub Organization/Username:
724
+ Found organizations: SynkraAI, AllFluence
725
+ Or use personal account: your-username
726
+
727
+ Select owner: _
728
+
729
+ Description (optional): _
730
+ ```
731
+
732
+ **Repository Creation:**
733
+
734
+ ```bash
735
+ echo "=== Creating Git Repository ==="
736
+
737
+ # Initialize local git
738
+ git init
739
+
740
+ # Create .gitignore
741
+ @"
742
+ # Dependencies
743
+ node_modules/
744
+ .pnpm-store/
745
+
746
+ # Build outputs
747
+ dist/
748
+ build/
749
+ .next/
750
+ out/
751
+
752
+ # Environment files
753
+ .env
754
+ .env.local
755
+ .env.*.local
756
+
757
+ # IDE
758
+ .idea/
759
+ .vscode/
760
+ *.swp
761
+ *.swo
762
+
763
+ # OS files
764
+ .DS_Store
765
+ Thumbs.db
766
+
767
+ # AIOS generated files
768
+ .aios/project-status.yaml
769
+ .aios/environment-report.yaml
770
+
771
+ # Logs
772
+ logs/
773
+ *.log
774
+ npm-debug.log*
775
+
776
+ # Testing
777
+ coverage/
778
+ .nyc_output/
779
+
780
+ # Temporary files
781
+ tmp/
782
+ temp/
783
+ *.tmp
784
+ "@ | Out-File -FilePath .gitignore -Encoding utf8
785
+
786
+ # Create initial README
787
+ @"
788
+ # $PROJECT_NAME
789
+
790
+ > Created with Synkra AIOS
791
+
792
+ ## Getting Started
793
+
794
+ \`\`\`bash
795
+ npm install
796
+ npm run dev
797
+ \`\`\`
798
+
799
+ ## Documentation
800
+
801
+ - [PRD](docs/prd.md)
802
+ - [Architecture](docs/architecture.md)
803
+
804
+ ---
805
+ *Generated by AIOS Environment Bootstrap*
806
+ "@ | Out-File -FilePath README.md -Encoding utf8
807
+
808
+ # CRITICAL: Create initial commit BEFORE gh repo create --push
809
+ # The --push flag requires at least one commit to exist
810
+ git add .
811
+ git commit -m "chore: initial project setup
812
+
813
+ - Initialize Synkra AIOS project structure
814
+ - Add .gitignore with standard exclusions
815
+ - Add README.md with project placeholder
816
+
817
+ 🤖 Generated by AIOS Environment Bootstrap"
818
+
819
+ if ($LASTEXITCODE -ne 0) {
820
+ Write-Host "⚠️ Initial commit failed. Checking if already committed..."
821
+ $hasCommits = git rev-parse HEAD 2>$null
822
+ if (-not $hasCommits) {
823
+ Write-Host "❌ Cannot proceed without initial commit"
824
+ exit 1
825
+ }
826
+ }
827
+
828
+ # Now create GitHub repository with --push (requires existing commits)
829
+ gh repo create $PROJECT_NAME --private --description "$DESCRIPTION" --source . --remote origin --push
830
+
831
+ if ($LASTEXITCODE -eq 0) {
832
+ Write-Host "✅ Repository created and pushed to GitHub"
833
+ gh repo view --web
834
+ } else {
835
+ Write-Host "❌ GitHub repository creation failed"
836
+ Write-Host " Trying alternative approach..."
837
+
838
+ # Alternative: Create repo without push, then push manually
839
+ gh repo create $PROJECT_NAME --private --description "$DESCRIPTION" --source . --remote origin
840
+ if ($LASTEXITCODE -eq 0) {
841
+ git push -u origin main
842
+ Write-Host "✅ Repository created and pushed (alternative method)"
843
+ } else {
844
+ Write-Host "❌ Please create repository manually: gh repo create"
845
+ }
846
+ }
847
+ ```
848
+
849
+ ---
850
+
851
+ ### Step 6: Project Structure Scaffold
852
+
853
+ **Action:** Create AIOS-compliant project structure
854
+
855
+ ```bash
856
+ echo "=== Creating Project Structure ==="
857
+
858
+ # Create directory structure
859
+ $directories = @(
860
+ "docs",
861
+ "docs/stories",
862
+ "docs/architecture",
863
+ "docs/guides",
864
+ ".aios",
865
+ "src",
866
+ "tests"
867
+ )
868
+
869
+ foreach ($dir in $directories) {
870
+ New-Item -ItemType Directory -Path $dir -Force | Out-Null
871
+ Write-Host " Created: $dir/"
872
+ }
873
+
874
+ # Create .aios/config.yaml
875
+ @"
876
+ # AIOS Project Configuration
877
+ version: 2.1.0
878
+ project:
879
+ name: $PROJECT_NAME
880
+ type: greenfield
881
+ created: $(Get-Date -Format "yyyy-MM-dd")
882
+
883
+ environment:
884
+ bootstrapped: true
885
+ bootstrap_date: $(Get-Date -Format "yyyy-MM-ddTHH:mm:ss")
886
+
887
+ workflow:
888
+ current: greenfield-fullstack
889
+ phase: 0-bootstrap-complete
890
+
891
+ settings:
892
+ auto_update_status: true
893
+ quality_gates_enabled: true
894
+ "@ | Out-File -FilePath ".aios/config.yaml" -Encoding utf8
895
+
896
+ # Create package.json if not exists
897
+ if (-not (Test-Path "package.json")) {
898
+ @"
899
+ {
900
+ "name": "$PROJECT_NAME",
901
+ "version": "0.1.0",
902
+ "description": "Created with Synkra AIOS",
903
+ "scripts": {
904
+ "dev": "echo 'Add your dev script'",
905
+ "build": "echo 'Add your build script'",
906
+ "test": "echo 'Add your test script'",
907
+ "lint": "echo 'Add your lint script'",
908
+ "typecheck": "echo 'Add your typecheck script'"
909
+ },
910
+ "keywords": [],
911
+ "author": "",
912
+ "license": "ISC"
913
+ }
914
+ "@ | Out-File -FilePath "package.json" -Encoding utf8
915
+ }
916
+
917
+ Write-Host "✅ Project structure created"
918
+ ```
919
+
920
+ ---
921
+
922
+ ### Step 6.5: Docker MCP Setup (Optional but Recommended)
923
+
924
+ **Condition:** Docker Desktop 4.50+ is installed AND Docker MCP Toolkit is available
925
+
926
+ **Action:** Configure Docker MCP Toolkit with HTTP transport for Claude Code integration
927
+
928
+ **Elicitation Point:**
929
+
930
+ ```
931
+ ╔════════════════════════════════════════════════════════════════════════╗
932
+ ║ DOCKER MCP SETUP ║
933
+ ╠════════════════════════════════════════════════════════════════════════╣
934
+ ║ ║
935
+ ║ Docker Desktop detected with MCP Toolkit! ║
936
+ ║ ║
937
+ ║ Configure MCP servers for Claude Code? ║
938
+ ║ ║
939
+ ║ 1. MINIMAL - context7 + desktop-commander + playwright (no API keys) ║
940
+ ║ 2. FULL - minimal + exa (requires EXA_API_KEY) ║
941
+ ║ 3. SKIP - Configure later with *setup-mcp-docker ║
942
+ ║ ║
943
+ ║ Select option (1/2/3): _ ║
944
+ ║ ║
945
+ ╚════════════════════════════════════════════════════════════════════════╝
946
+ ```
947
+
948
+ **YOLO Mode Behavior:** Auto-select MINIMAL (no API keys required)
949
+
950
+ **If MINIMAL or FULL selected:**
951
+
952
+ **Step 6.5.1: Start Gateway Service**
953
+
954
+ ```powershell
955
+ # Windows
956
+ Write-Host "Starting MCP Gateway service..."
957
+
958
+ # Create gateway service file if not exists
959
+ if (-not (Test-Path ".docker/mcp/gateway-service.yml")) {
960
+ # Copy from template or create
961
+ New-Item -ItemType Directory -Path ".docker/mcp" -Force | Out-Null
962
+ # Gateway service will be started by Docker Compose
963
+ }
964
+
965
+ # Start gateway as persistent service
966
+ docker compose -f .docker/mcp/gateway-service.yml up -d
967
+
968
+ # Wait for gateway to be healthy
969
+ $maxRetries = 12
970
+ $retryCount = 0
971
+ do {
972
+ Start-Sleep -Seconds 5
973
+ $health = Invoke-WebRequest -Uri "http://localhost:8080/health" -UseBasicParsing -ErrorAction SilentlyContinue
974
+ $retryCount++
975
+ } while ($health.StatusCode -ne 200 -and $retryCount -lt $maxRetries)
976
+
977
+ if ($health.StatusCode -eq 200) {
978
+ Write-Host "✅ MCP Gateway is healthy"
979
+ } else {
980
+ Write-Host "⚠️ MCP Gateway health check failed - continuing anyway"
981
+ }
982
+ ```
983
+
984
+ **Step 6.5.2: Enable Default MCPs**
985
+
986
+ ```powershell
987
+ # Enable minimal preset MCPs (no API keys required)
988
+ Write-Host "Enabling MCP servers..."
989
+
990
+ docker mcp server enable context7
991
+ docker mcp server enable desktop-commander
992
+ docker mcp server enable playwright
993
+
994
+ # If FULL preset selected and EXA_API_KEY exists
995
+ if ($PRESET -eq "FULL" -and $env:EXA_API_KEY) {
996
+ docker mcp server enable exa
997
+ Write-Host "✅ Exa MCP enabled (web search)"
998
+ }
999
+
1000
+ # Configure desktop-commander with user home path
1001
+ $userHome = $env:USERPROFILE
1002
+ docker mcp config write "desktop-commander:`n paths:`n - $userHome"
1003
+
1004
+ Write-Host "✅ MCP servers enabled"
1005
+ docker mcp server ls
1006
+ ```
1007
+
1008
+ **Step 6.5.3: Configure Claude Code (HTTP Transport)**
1009
+
1010
+ ```powershell
1011
+ Write-Host "Configuring Claude Code for MCP Gateway..."
1012
+
1013
+ $claudeConfigPath = Join-Path $env:USERPROFILE ".claude.json"
1014
+
1015
+ if (Test-Path $claudeConfigPath) {
1016
+ # Read existing config
1017
+ $claudeConfig = Get-Content $claudeConfigPath | ConvertFrom-Json
1018
+
1019
+ # Add or update docker-gateway with HTTP transport
1020
+ if (-not $claudeConfig.mcpServers) {
1021
+ $claudeConfig | Add-Member -NotePropertyName "mcpServers" -NotePropertyValue @{} -Force
1022
+ }
1023
+
1024
+ $claudeConfig.mcpServers.'docker-gateway' = @{
1025
+ type = "http"
1026
+ url = "http://localhost:8080/mcp"
1027
+ }
1028
+
1029
+ # Save config
1030
+ $claudeConfig | ConvertTo-Json -Depth 10 | Set-Content $claudeConfigPath -Encoding UTF8
1031
+ Write-Host "✅ Claude Code configured with HTTP transport"
1032
+ } else {
1033
+ Write-Host "⚠️ ~/.claude.json not found - please configure manually"
1034
+ Write-Host " Add to mcpServers: { 'docker-gateway': { 'type': 'http', 'url': 'http://localhost:8080/mcp' } }"
1035
+ }
1036
+ ```
1037
+
1038
+ **Step 6.5.4: Verify MCP Setup**
1039
+
1040
+ ```powershell
1041
+ Write-Host "Verifying MCP setup..."
1042
+
1043
+ # Check gateway health
1044
+ $health = Invoke-WebRequest -Uri "http://localhost:8080/health" -UseBasicParsing -ErrorAction SilentlyContinue
1045
+ if ($health.StatusCode -eq 200) {
1046
+ Write-Host "✅ Gateway: Healthy"
1047
+ } else {
1048
+ Write-Host "❌ Gateway: Not responding"
1049
+ }
1050
+
1051
+ # Check enabled servers
1052
+ $servers = docker mcp server ls
1053
+ Write-Host "✅ Enabled servers: $servers"
1054
+
1055
+ # Summary
1056
+ Write-Host ""
1057
+ Write-Host "═══════════════════════════════════════════════════════════════"
1058
+ Write-Host " MCP SETUP COMPLETE"
1059
+ Write-Host "═══════════════════════════════════════════════════════════════"
1060
+ Write-Host " Gateway: http://localhost:8080 (HTTP/SSE)"
1061
+ Write-Host " MCPs: context7, desktop-commander, playwright"
1062
+ Write-Host " Claude Config: ~/.claude.json (HTTP transport)"
1063
+ Write-Host ""
1064
+ Write-Host " ⚠️ IMPORTANT: Restart Claude Code to connect to MCP Gateway"
1065
+ Write-Host "═══════════════════════════════════════════════════════════════"
1066
+ ```
1067
+
1068
+ **Skip Conditions:**
1069
+ - Docker not installed or not running
1070
+ - Docker MCP Toolkit not available
1071
+ - User selected SKIP option
1072
+
1073
+ **Output:** MCP setup status added to environment report
1074
+
1075
+ ---
1076
+
1077
+ ### Step 7: Environment Report Generation
1078
+
1079
+ **Action:** Generate comprehensive environment report
1080
+
1081
+ ```bash
1082
+ echo "=== Generating Environment Report ==="
1083
+
1084
+ # Collect all environment information
1085
+ $report = @{
1086
+ generated_at = Get-Date -Format "yyyy-MM-ddTHH:mm:ss"
1087
+ project_name = $PROJECT_NAME
1088
+
1089
+ system = @{
1090
+ os = [System.Environment]::OSVersion.VersionString
1091
+ architecture = if ([System.Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" }
1092
+ user = $env:USERNAME
1093
+ hostname = $env:COMPUTERNAME
1094
+ }
1095
+
1096
+ cli_tools = @{
1097
+ git = @{
1098
+ installed = $true
1099
+ version = (git --version) -replace "git version ", ""
1100
+ path = (Get-Command git).Source
1101
+ }
1102
+ gh = @{
1103
+ installed = (Get-Command gh -ErrorAction SilentlyContinue) -ne $null
1104
+ version = if (Get-Command gh -ErrorAction SilentlyContinue) { (gh --version | Select-Object -First 1) -replace "gh version ", "" } else { $null }
1105
+ authenticated = (gh auth status 2>&1) -match "Logged in"
1106
+ }
1107
+ node = @{
1108
+ installed = (Get-Command node -ErrorAction SilentlyContinue) -ne $null
1109
+ version = if (Get-Command node -ErrorAction SilentlyContinue) { (node --version) -replace "v", "" } else { $null }
1110
+ }
1111
+ npm = @{
1112
+ installed = (Get-Command npm -ErrorAction SilentlyContinue) -ne $null
1113
+ version = if (Get-Command npm -ErrorAction SilentlyContinue) { npm --version } else { $null }
1114
+ }
1115
+ supabase = @{
1116
+ installed = (Get-Command supabase -ErrorAction SilentlyContinue) -ne $null
1117
+ version = if (Get-Command supabase -ErrorAction SilentlyContinue) { (supabase --version) } else { $null }
1118
+ authenticated = $false # Check separately
1119
+ }
1120
+ railway = @{
1121
+ installed = (Get-Command railway -ErrorAction SilentlyContinue) -ne $null
1122
+ version = if (Get-Command railway -ErrorAction SilentlyContinue) { (railway --version) } else { $null }
1123
+ }
1124
+ docker = @{
1125
+ installed = (Get-Command docker -ErrorAction SilentlyContinue) -ne $null
1126
+ version = if (Get-Command docker -ErrorAction SilentlyContinue) { (docker --version) -replace "Docker version ", "" -replace ",.*", "" } else { $null }
1127
+ running = (docker info 2>&1) -notmatch "error"
1128
+ }
1129
+ }
1130
+
1131
+ repository = @{
1132
+ initialized = Test-Path ".git"
1133
+ remote_url = if (Test-Path ".git") { git remote get-url origin 2>$null } else { $null }
1134
+ branch = if (Test-Path ".git") { git branch --show-current } else { $null }
1135
+ }
1136
+
1137
+ validation = @{
1138
+ essential_complete = $true
1139
+ recommended_complete = $false
1140
+ ready_for_development = $true
1141
+ }
1142
+ }
1143
+
1144
+ # Convert to YAML and save
1145
+ # (Simplified - in practice use ConvertTo-Yaml module or js-yaml)
1146
+ $report | ConvertTo-Json -Depth 5 | Out-File -FilePath ".aios/environment-report.json" -Encoding utf8
1147
+
1148
+ Write-Host "✅ Environment report saved to .aios/environment-report.json"
1149
+ ```
1150
+
1151
+ ---
1152
+
1153
+ ### Step 8: Final Validation & Summary
1154
+
1155
+ **Action:** Validate environment and display summary
1156
+
1157
+ ```
1158
+ ╔═══════════════════════════════════════════════════════════════════════════╗
1159
+ ║ ✅ AIOS ENVIRONMENT BOOTSTRAP COMPLETE ║
1160
+ ╠═══════════════════════════════════════════════════════════════════════════╣
1161
+ ║ ║
1162
+ ║ Project: my-awesome-project ║
1163
+ ║ Repository: https://github.com/username/my-awesome-project ║
1164
+ ║ Branch: main ║
1165
+ ║ ║
1166
+ ╠═══════════════════════════════════════════════════════════════════════════╣
1167
+ ║ CLI Tools Status ║
1168
+ ╠═══════════════════════════════════════════════════════════════════════════╣
1169
+ ║ ✅ git 2.43.0 ✅ gh 2.40.1 (authenticated) ║
1170
+ ║ ✅ node 20.10.0 ✅ npm 10.2.4 ║
1171
+ ║ ✅ supabase 1.123.0 ✅ railway 3.5.0 ║
1172
+ ║ ✅ docker 24.0.7 ⚠️ coderabbit (WSL only) ║
1173
+ ║ ║
1174
+ ╠═══════════════════════════════════════════════════════════════════════════╣
1175
+ ║ Project Structure ║
1176
+ ╠═══════════════════════════════════════════════════════════════════════════╣
1177
+ ║ my-awesome-project/ ║
1178
+ ║ ├── .aios/ # AIOS configuration ║
1179
+ ║ │ ├── config.yaml # Project config ║
1180
+ ║ │ └── environment-report.json ║
1181
+ ║ ├── docs/ # Documentation (PRD, architecture) ║
1182
+ ║ │ ├── stories/ # User stories ║
1183
+ ║ │ ├── architecture/ # Architecture docs ║
1184
+ ║ │ └── guides/ # Developer guides ║
1185
+ ║ ├── src/ # Source code ║
1186
+ ║ ├── tests/ # Test files ║
1187
+ ║ ├── .gitignore # Git ignore rules ║
1188
+ ║ ├── package.json # NPM configuration ║
1189
+ ║ └── README.md # Project readme ║
1190
+ ║ ║
1191
+ ╠═══════════════════════════════════════════════════════════════════════════╣
1192
+ ║ NEXT STEPS ║
1193
+ ╠═══════════════════════════════════════════════════════════════════════════╣
1194
+ ║ ║
1195
+ ║ Your environment is ready! Continue with the Greenfield workflow: ║
1196
+ ║ ║
1197
+ ║ 1. @analyst → Create Project Brief ║
1198
+ ║ Start a new chat: @analyst ║
1199
+ ║ Command: *create-doc project-brief ║
1200
+ ║ ║
1201
+ ║ 2. @pm → Create PRD ║
1202
+ ║ After project brief is approved ║
1203
+ ║ Command: *create-doc prd ║
1204
+ ║ ║
1205
+ ║ 3. Continue with greenfield-fullstack workflow... ║
1206
+ ║ ║
1207
+ ║ Full workflow: .aios-core/development/workflows/greenfield-fullstack.yaml ║
1208
+ ║ ║
1209
+ ╠═══════════════════════════════════════════════════════════════════════════╣
1210
+ ║ Quick Reference ║
1211
+ ╠═══════════════════════════════════════════════════════════════════════════╣
1212
+ ║ • View environment report: cat .aios/environment-report.json ║
1213
+ ║ • Check GitHub repo: gh repo view --web ║
1214
+ ║ • AIOS help: @aios-master *help ║
1215
+ ║ • Re-run bootstrap: @devops *environment-bootstrap ║
1216
+ ║ ║
1217
+ ╚═══════════════════════════════════════════════════════════════════════════╝
1218
+
1219
+ Environment bootstrap completed in 8m 32s
1220
+
1221
+ — Gage, environment configured with confidence 🚀
1222
+ ```
1223
+
1224
+ ---
1225
+
1226
+ ## Validation Checklist
1227
+
1228
+ - [ ] Operating system detected correctly
1229
+ - [ ] All essential CLIs installed (git, gh, node, npm)
1230
+ - [ ] GitHub CLI authenticated
1231
+ - [ ] Git repository initialized
1232
+ - [ ] GitHub remote repository created
1233
+ - [ ] .gitignore configured
1234
+ - [ ] Project structure created
1235
+ - [ ] .aios/config.yaml created
1236
+ - [ ] Environment report generated
1237
+ - [ ] Initial commit pushed to GitHub
1238
+
1239
+ ---
1240
+
1241
+ ## Troubleshooting
1242
+
1243
+ ### Issue 1: winget not recognized
1244
+
1245
+ **Error:** `winget: The term 'winget' is not recognized`
1246
+
1247
+ **Fix:**
1248
+ 1. Update Windows to latest version (winget requires Windows 10 1809+)
1249
+ 2. Or install App Installer from Microsoft Store
1250
+ 3. Or use alternative: `choco install gh` or `scoop install gh`
1251
+
1252
+ ### Issue 2: gh auth login fails
1253
+
1254
+ **Error:** `error connecting to api.github.com`
1255
+
1256
+ **Fix:**
1257
+ 1. Check internet connection
1258
+ 2. Check if behind corporate proxy: `gh config set http_proxy http://proxy:port`
1259
+ 3. Try token-based auth: `gh auth login --with-token`
1260
+
1261
+ ### Issue 3: Permission denied creating repository
1262
+
1263
+ **Error:** `Resource not accessible by personal access token`
1264
+
1265
+ **Fix:**
1266
+ 1. Re-authenticate with correct scopes: `gh auth login --scopes repo,workflow`
1267
+ 2. Check if organization requires SSO: `gh auth login --hostname github.com`
1268
+
1269
+ ### Issue 4: Docker not starting
1270
+
1271
+ **Error:** `Cannot connect to Docker daemon`
1272
+
1273
+ **Fix:**
1274
+ 1. Windows: Ensure Docker Desktop is running
1275
+ 2. macOS: Open Docker.app
1276
+ 3. Linux: `sudo systemctl start docker`
1277
+
1278
+ ---
1279
+
1280
+ ## Rollback
1281
+
1282
+ To undo environment bootstrap:
1283
+
1284
+ ```bash
1285
+ # Remove local git
1286
+ rm -rf .git
1287
+
1288
+ # Remove AIOS files
1289
+ rm -rf .aios
1290
+ rm -f .gitignore
1291
+ rm -f README.md
1292
+
1293
+ # Delete GitHub repository (CAUTION!)
1294
+ gh repo delete REPO_NAME --yes
1295
+ ```
1296
+
1297
+ ---
1298
+
1299
+ ## References
1300
+
1301
+ - [GitHub CLI Documentation](https://cli.github.com/manual/)
1302
+ - [Supabase CLI Documentation](https://supabase.com/docs/guides/cli)
1303
+ - [Railway CLI Documentation](https://docs.railway.app/reference/cli-api)
1304
+ - [AIOS Greenfield Workflow](.aios-core/development/workflows/greenfield-fullstack.yaml)
1305
+ - [CodeRabbit Setup Guide](docs/guides/coderabbit/README.md)
1306
+
1307
+ ---
1308
+
1309
+ **Status:** ✅ Production Ready
1310
+ **Tested On:** Windows 11, macOS Sonoma, Ubuntu 22.04
1311
+ **Minimum Requirements:** Windows 10 1809+, macOS 12+, Ubuntu 20.04+