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,1414 +1,1414 @@
1
- # AIOS Task Format Specification V1.0
2
-
3
- **Date:** 2025-11-13
4
- **Version:** 1.0.0
5
- **Status:** Standard
6
- **Author:** Brad Frost Cognitive Clone
7
-
8
- ---
9
-
10
- ## Purpose
11
-
12
- This document defines the UNIVERSAL format for AIOS Tasks, ensuring consistency, scalability, and reusability across workflows, executors, and teams.
13
-
14
- ---
15
-
16
- ## Task Format Overview
17
-
18
- Every AIOS Task MUST follow this structure:
19
-
20
- ```yaml
21
- #### Step X: [Task Name]
22
-
23
- task: taskIdentifier()
24
- responsável: [Role or Service Name]
25
- responsavel_type: Agente | Worker | Humano | Clone
26
- atomic_layer: [Atom | Molecule | Organism | Template | Page | Config | Strategy | Content | Media | Layout | Analysis]
27
-
28
- **Entrada:**
29
- - campo: [name]
30
- tipo: [type]
31
- origem: [source step]
32
- obrigatório: [true|false]
33
- padrão: [default value] (optional)
34
-
35
- **Saída:**
36
- - campo: [name]
37
- tipo: [type]
38
- destino: [destination step(s)]
39
- persistido: [true|false]
40
-
41
- **Checklist:**
42
- pre-conditions:
43
- - [ ] [condition description]
44
- tipo: pre-condition
45
- blocker: [true|false]
46
- validação: [validation logic or test path]
47
-
48
- post-conditions:
49
- - [ ] [condition description]
50
- tipo: post-condition
51
- blocker: [true|false]
52
- validação: [validation logic or test path]
53
-
54
- acceptance-criteria:
55
- - [ ] [acceptance description]
56
- tipo: acceptance
57
- blocker: [false]
58
- story: [STORY-XXX]
59
- manual_check: [true|false]
60
-
61
- **Template:** (optional)
62
- - path: [relative path to template file]
63
- - type: [input|output|prompt|ui|script]
64
- - version: [X.Y.Z]
65
- - variables: [array of variable names]
66
-
67
- **Tools:** (optional)
68
- - [tool_name]:
69
- version: [X.Y.Z]
70
- used_for: [description]
71
- shared_with: [array of step IDs]
72
-
73
- **Scripts:** (optional)
74
- - [script_path]:
75
- description: [what it does]
76
- language: [javascript|python|bash|etc]
77
-
78
- **Performance:**
79
- - duration_expected: [X]ms
80
- - cost_estimated: $[Y] (for AI executors)
81
- - cacheable: [true|false]
82
- - cache_key: [cache identifier] (if cacheable)
83
- - parallelizable: [true|false]
84
- - parallel_with: [array of step IDs] (if parallelizable)
85
- - skippable_when: [array of conditions]
86
-
87
- **Error Handling:**
88
- - strategy: [retry|fallback|abort]
89
- - fallback: [description or default value] (if strategy=fallback)
90
- - retry:
91
- max_attempts: [N]
92
- backoff: [linear|exponential]
93
- backoff_ms: [initial backoff in milliseconds]
94
- - abort_workflow: [true|false]
95
- - notification: [log|email|slack|etc]
96
-
97
- **Metadata:**
98
- - story: [STORY-XXX]
99
- - version: [X.Y.Z]
100
- - dependencies: [array of step IDs]
101
- - breaking_changes: [array of changes from previous version]
102
- - author: [name]
103
- - created_at: [YYYY-MM-DD]
104
- - updated_at: [YYYY-MM-DD]
105
- ```
106
-
107
- ---
108
-
109
- ## Field Definitions
110
-
111
- ### Required Fields
112
-
113
- #### 1. `task`
114
-
115
- **Type:** `string` (function name)
116
- **Required:** ✅ Yes
117
- **Format:** `camelCase()` with parentheses
118
-
119
- **Purpose:** Unique identifier for the task function.
120
-
121
- **Validation:**
122
- - Must be unique across workflow
123
- - Must be valid JavaScript function name
124
- - Must end with `()`
125
-
126
- **Examples:**
127
- ```yaml
128
- task: loadFormatConfig()
129
- task: analyzeBrief()
130
- task: designCTAComponent()
131
- ```
132
-
133
- ---
134
-
135
- #### 2. `responsável`
136
-
137
- **Type:** `string`
138
- **Required:** ✅ Yes
139
- **Format:** Free text (role or service name)
140
-
141
- **Purpose:** Human-readable name of the responsible entity.
142
-
143
- **Examples:**
144
- ```yaml
145
- responsável: Creative Director
146
- responsável: format-loader.js
147
- responsável: OpenRouter Vision Model
148
- responsável: Brad Frost Clone
149
- ```
150
-
151
- ---
152
-
153
- #### 3. `responsavel_type`
154
-
155
- **Type:** `enum`
156
- **Required:** ✅ Yes
157
- **Values:** `Agente | Worker | Humano | Clone`
158
-
159
- **Purpose:** Defines the executor type for orchestration, cost tracking, and error handling.
160
-
161
- **Validation:**
162
- - Must be one of the 4 allowed values
163
- - Determines execution environment
164
-
165
- **Decision Tree:** See `EXECUTOR-DECISION-TREE.md`
166
-
167
- **Examples:**
168
- ```yaml
169
- responsavel_type: Agente # AI-powered execution
170
- responsavel_type: Worker # Script-based execution
171
- responsavel_type: Humano # Manual human execution
172
- responsavel_type: Clone # Mind emulation with heuristics
173
- ```
174
-
175
- ---
176
-
177
- #### 4. `atomic_layer`
178
-
179
- **Type:** `enum`
180
- **Required:** ✅ Yes (for design-related tasks), ⚠️ Optional (for config/strategy)
181
- **Values:**
182
- - **Atomic Design:** `Atom | Molecule | Organism | Template | Page`
183
- - **Other Layers:** `Config | Strategy | Content | Media | Layout | Analysis`
184
-
185
- **Purpose:** Maps task to Atomic Design layer for architecture validation.
186
-
187
- **Validation:**
188
- - Design tasks MUST specify Atomic Design layer
189
- - Non-design tasks SHOULD specify functional layer
190
-
191
- **Examples:**
192
- ```yaml
193
- atomic_layer: Atom # Step 7a: Design CTA (single component)
194
- atomic_layer: Molecule # Step 8a: Compose Text Group (title + body + cta)
195
- atomic_layer: Organism # Step 8c: Content Area (complete section)
196
- atomic_layer: Template # Step 13: Render HTML (structure)
197
- atomic_layer: Page # Step 14: Export PNG (final instance)
198
- atomic_layer: Config # Step 1: Load Format Config
199
- atomic_layer: Strategy # Step 3: Analyze Brief
200
- ```
201
-
202
- ---
203
-
204
- #### 5. `Entrada` (Inputs)
205
-
206
- **Type:** `array of objects`
207
- **Required:** ✅ Yes (can be empty array if no inputs)
208
-
209
- **Purpose:** Defines all inputs required by the task, with types, sources, and constraints.
210
-
211
- **Structure:**
212
-
213
- ```yaml
214
- **Entrada:**
215
- - campo: [field name]
216
- tipo: [type definition]
217
- origem: [source step or config]
218
- obrigatório: [true|false]
219
- padrão: [default value] (optional)
220
- validação: [validation rule] (optional)
221
- ```
222
-
223
- **Field Details:**
224
-
225
- | Sub-field | Type | Required | Description |
226
- |-----------|------|----------|-------------|
227
- | `campo` | string | ✅ Yes | Field name (camelCase) |
228
- | `tipo` | string | ✅ Yes | Type definition (see Type System below) |
229
- | `origem` | string | ✅ Yes | Source step ID or "config" or "user input" |
230
- | `obrigatório` | boolean | ✅ Yes | Whether field is required |
231
- | `padrão` | any | ⚠️ Optional | Default value if not provided |
232
- | `validação` | string | ⚠️ Optional | Validation rule or JSON Schema reference |
233
-
234
- **Examples:**
235
-
236
- ```yaml
237
- **Entrada:**
238
- - campo: adCopy
239
- tipo: object { title: string, body: string, cta: string }
240
- origem: Step 5 (craftCopy)
241
- obrigatório: true
242
- validação: |
243
- title.length >= 1 && title.length <= 100
244
- body.length >= 1 && body.length <= 500
245
- cta.length >= 1 && cta.length <= 30
246
-
247
- - campo: brand
248
- tipo: object (Brand schema)
249
- origem: Step 2 (loadBrand)
250
- obrigatório: true
251
-
252
- - campo: ready_copy
253
- tipo: object { title?, body?, cta? } | null
254
- origem: User Input (config)
255
- obrigatório: false
256
- padrão: null
257
- ```
258
-
259
- ---
260
-
261
- #### 6. `Saída` (Outputs)
262
-
263
- **Type:** `array of objects`
264
- **Required:** ✅ Yes (can be empty array if no outputs)
265
-
266
- **Purpose:** Defines all outputs produced by the task, with types, destinations, and persistence.
267
-
268
- **Structure:**
269
-
270
- ```yaml
271
- **Saída:**
272
- - campo: [field name]
273
- tipo: [type definition]
274
- destino: [destination step(s) or state]
275
- persistido: [true|false]
276
- cache_key: [key] (if cacheable)
277
- ```
278
-
279
- **Field Details:**
280
-
281
- | Sub-field | Type | Required | Description |
282
- |-----------|------|----------|-------------|
283
- | `campo` | string | ✅ Yes | Field name (camelCase) |
284
- | `tipo` | string | ✅ Yes | Type definition |
285
- | `destino` | string or array | ✅ Yes | Destination step(s) or "state" or "output" |
286
- | `persistido` | boolean | ✅ Yes | Whether saved to ad-spec.json or DB |
287
- | `cache_key` | string | ⚠️ Optional | Cache key if output is cacheable |
288
-
289
- **Examples:**
290
-
291
- ```yaml
292
- **Saída:**
293
- - campo: formatConfig
294
- tipo: object { formatId, canvas, safeZones, contentArea }
295
- destino: [Step 8, Step 10, Step 11, Step 12, Step 13, Step 14]
296
- persistido: false # Kept in memory only
297
-
298
- - campo: adAnalysis
299
- tipo: object { goal, targetAudience, urgencyLevel, emotionalTriggers }
300
- destino: state (ad-spec.json)
301
- persistido: true
302
-
303
- - campo: designTokens
304
- tipo: object { spacing, typography, colors, radius, shadows }
305
- destino: Step 13 (renderHTML)
306
- persistido: false
307
- cache_key: format_${formatConfig.formatId}_${formatConfig.orientation}
308
- ```
309
-
310
- ---
311
-
312
- ### Optional Fields
313
-
314
- #### 7. `Checklist`
315
-
316
- **Type:** `object with arrays`
317
- **Required:** ⚠️ Recommended
318
-
319
- **Purpose:** Defines validations (pre-conditions, post-conditions, acceptance criteria) for automated and manual testing.
320
-
321
- **Structure:**
322
-
323
- ```yaml
324
- **Checklist:**
325
- pre-conditions:
326
- - [ ] [description]
327
- tipo: pre-condition
328
- blocker: [true|false]
329
- validação: [logic or test path]
330
- error_message: [message if fails]
331
-
332
- post-conditions:
333
- - [ ] [description]
334
- tipo: post-condition
335
- blocker: [true|false]
336
- validação: [logic or test path]
337
- rollback: [true|false]
338
-
339
- acceptance-criteria:
340
- - [ ] [description]
341
- tipo: acceptance
342
- blocker: false
343
- story: [STORY-XXX]
344
- manual_check: [true|false]
345
- test: [test file path]
346
- ```
347
-
348
- **Checklist Types:**
349
-
350
- 1. **Pre-conditions** (Run BEFORE task)
351
- - Validate inputs exist and are valid
352
- - Check dependencies are met
353
- - Verify environment is ready
354
- - **Blocking:** Task aborts if pre-condition fails
355
-
356
- 2. **Post-conditions** (Run AFTER task)
357
- - Validate outputs match schema
358
- - Check business rules
359
- - Verify no side effects
360
- - **Blocking:** Task rolls back if post-condition fails
361
-
362
- 3. **Acceptance Criteria** (Run AFTER workflow)
363
- - Validate Story requirements
364
- - Can be manual (human review)
365
- - Can be automated (integration tests)
366
- - **Non-blocking:** Log failure, continue workflow
367
-
368
- **Examples:**
369
-
370
- ```yaml
371
- **Checklist:**
372
- pre-conditions:
373
- - [ ] brand.typography exists and is valid
374
- tipo: pre-condition
375
- blocker: true
376
- validação: |
377
- if (!brand.typography || !brand.typography.primaryFont) {
378
- throw new Error("Brand typography not loaded");
379
- }
380
- error_message: "Brand typography missing or invalid"
381
-
382
- - [ ] adCopy.title is not empty
383
- tipo: pre-condition
384
- blocker: true
385
- validação: "expect(adCopy.title).toBeTruthy()"
386
- error_message: "Copy title is required"
387
-
388
- post-conditions:
389
- - [ ] typography.title.htmlContent is valid HTML
390
- tipo: post-condition
391
- blocker: true
392
- validação: |
393
- const isValid = await validateHTML(typography.title.htmlContent);
394
- if (!isValid) throw new Error("Invalid HTML");
395
- rollback: false
396
-
397
- - [ ] All required transformations applied
398
- tipo: post-condition
399
- blocker: true
400
- validação: |
401
- expect(typography.title.transformations).toBeInstanceOf(Array);
402
- expect(typography.title.transformations.length).toBeGreaterThan(0);
403
- rollback: false
404
-
405
- acceptance-criteria:
406
- - [ ] Typography matches brand voice (bold, uppercase for urgent CTAs)
407
- tipo: acceptance
408
- blocker: false
409
- story: STORY-006
410
- manual_check: false
411
- test: "tests/typography-brand-voice.test.js"
412
-
413
- - [ ] Transformations are visually appealing
414
- tipo: acceptance
415
- blocker: false
416
- story: STORY-006
417
- manual_check: true
418
- ```
419
-
420
- ---
421
-
422
- #### 8. `Template`
423
-
424
- **Type:** `object`
425
- **Required:** ⚠️ Optional (but recommended for Agente executors)
426
-
427
- **Purpose:** References template files that define input/output schemas, prompts, or UI forms.
428
-
429
- **Structure:**
430
-
431
- ```yaml
432
- **Template:**
433
- - path: [relative path]
434
- type: [input|output|prompt|ui|script]
435
- version: [X.Y.Z]
436
- variables: [array of variable names used in template]
437
- schema: [JSON Schema reference] (optional)
438
- ```
439
-
440
- **Template Types:**
441
-
442
- | Type | Purpose | Example |
443
- |------|---------|---------|
444
- | `input` | Validates input schema | `templates/input-schemas/analyze-brief.json` |
445
- | `output` | Validates output schema | `templates/output-schemas/analyze-brief.json` |
446
- | `prompt` | AI agent prompt structure | `expansion-packs/.../analyze-ad-brief.md` |
447
- | `ui` | Human interface form | `templates/ui-forms/manual-approval.html` |
448
- | `script` | Worker script template | `templates/scripts/image-processor.sh` |
449
-
450
- **Examples:**
451
-
452
- ```yaml
453
- # Agente executor with prompt template
454
- **Template:**
455
- - path: expansion-packs/instagram-content-creator/tasks/ads/analyze-ad-brief.md
456
- type: prompt
457
- version: 2.1.0
458
- variables: [brief_text, brand_id, campaign_goal, ready_copy]
459
- schema: expansion-packs/instagram-content-creator/schemas/analyze-brief-output.json
460
-
461
- # Worker executor with script template
462
- **Template:**
463
- - path: scripts/utils/format-loader.js
464
- type: script
465
- version: 1.0.0
466
- variables: [format_id, orientation]
467
-
468
- # Humano executor with UI form
469
- **Template:**
470
- - path: templates/ui-forms/manual-review-ad-quality.html
471
- type: ui
472
- version: 1.0.0
473
- variables: [ad_preview_url, quality_criteria]
474
- ```
475
-
476
- ---
477
-
478
- #### 9. `Tools`
479
-
480
- **Type:** `object`
481
- **Required:** ⚠️ Recommended (to document reusability)
482
-
483
- **Purpose:** Catalogs reusable tools/functions used by the task, enabling:
484
- - **Reusability tracking** (which tasks share tools)
485
- - **Versioning** (tool updates affect which tasks)
486
- - **Cost tracking** (tool API costs)
487
-
488
- **Structure:**
489
-
490
- ```yaml
491
- **Tools:**
492
- - [tool_name]:
493
- version: [X.Y.Z]
494
- used_for: [description]
495
- shared_with: [array of step IDs or "global"]
496
- cost: $[Y] per call (optional)
497
- cacheable: [true|false] (optional)
498
- ```
499
-
500
- **Examples:**
501
-
502
- ```yaml
503
- **Tools:**
504
- - callAgent:
505
- version: 1.0.0
506
- used_for: AIOS agent caller with retry logic
507
- shared_with: [Step 3, Step 4, Step 5, Step 6, Step 7, Step 8, Step 9, Step 11]
508
- cost: varies by agent
509
-
510
- - validateHTML:
511
- version: 2.1.0
512
- used_for: HTML validation using htmlhint
513
- shared_with: [Step 6, Step 13]
514
-
515
- - detectFaces:
516
- version: 1.0.0
517
- used_for: Face detection via OpenRouter Gemini 2.5 Flash
518
- shared_with: [Step 10]
519
- cost: $0.002 per image
520
-
521
- - validateContrast:
522
- version: 1.0.0
523
- used_for: WCAG AA color contrast validation
524
- shared_with: [Step 2, Step 7]
525
- ```
526
-
527
- ---
528
-
529
- #### 10. `Scripts`
530
-
531
- **Type:** `object`
532
- **Required:** ⚠️ Optional (for Worker executors primarily)
533
-
534
- **Purpose:** References custom scripts executed by the task.
535
-
536
- **Structure:**
537
-
538
- ```yaml
539
- **Scripts:**
540
- - [script_path]:
541
- description: [what it does]
542
- language: [javascript|python|bash|etc]
543
- version: [X.Y.Z] (optional)
544
- ```
545
-
546
- **Examples:**
547
-
548
- ```yaml
549
- **Scripts:**
550
- - scripts/utils/format-loader.js:
551
- description: Loads format configuration from JSON file
552
- language: javascript
553
- version: 1.0.0
554
-
555
- - scripts/utils/face-detection.js:
556
- description: Wrapper for OpenRouter face detection API
557
- language: javascript
558
- version: 1.2.0
559
-
560
- - scripts/export/puppeteer-renderer.js:
561
- description: Renders HTML to PNG using Puppeteer
562
- language: javascript
563
- version: 2.0.0
564
- ```
565
-
566
- ---
567
-
568
- #### 11. `Performance`
569
-
570
- **Type:** `object`
571
- **Required:** ⚠️ Recommended (for optimization)
572
-
573
- **Purpose:** Documents expected performance metrics and optimization opportunities.
574
-
575
- **Structure:**
576
-
577
- ```yaml
578
- **Performance:**
579
- - duration_expected: [X]ms
580
- - cost_estimated: $[Y] (for AI)
581
- - cacheable: [true|false]
582
- - cache_key: [identifier] (if cacheable)
583
- - parallelizable: [true|false]
584
- - parallel_with: [array of step IDs]
585
- - skippable_when: [array of conditions]
586
- ```
587
-
588
- **Examples:**
589
-
590
- ```yaml
591
- # AI task (expensive, slow, not cacheable)
592
- **Performance:**
593
- - duration_expected: 3500ms
594
- - cost_estimated: $0.0015
595
- - cacheable: false
596
- - parallelizable: false
597
-
598
- # Config load (fast, cacheable)
599
- **Performance:**
600
- - duration_expected: 100ms
601
- - cost_estimated: $0
602
- - cacheable: true
603
- - cache_key: format_${format_id}_${orientation}
604
- - parallelizable: false
605
-
606
- # Image selection (can run in parallel with template selection)
607
- **Performance:**
608
- - duration_expected: 2500ms
609
- - cost_estimated: $0.001
610
- - cacheable: false
611
- - parallelizable: true
612
- - parallel_with: [Step 4]
613
-
614
- # Brief analysis (skippable in ready_copy mode)
615
- **Performance:**
616
- - duration_expected: 4000ms
617
- - cost_estimated: $0.0025
618
- - cacheable: false
619
- - parallelizable: false
620
- - skippable_when: [ready_copy=true]
621
- ```
622
-
623
- ---
624
-
625
- #### 12. `Error Handling`
626
-
627
- **Type:** `object`
628
- **Required:** ⚠️ Recommended (for robustness)
629
-
630
- **Purpose:** Defines error handling strategy for resilience.
631
-
632
- **Structure:**
633
-
634
- ```yaml
635
- **Error Handling:**
636
- - strategy: [retry|fallback|abort]
637
- - fallback: [description or value] (if strategy=fallback)
638
- - retry:
639
- max_attempts: [N]
640
- backoff: [linear|exponential]
641
- backoff_ms: [initial delay]
642
- - abort_workflow: [true|false]
643
- - notification: [log|email|slack|etc]
644
- ```
645
-
646
- **Strategies:**
647
-
648
- | Strategy | When to Use | Example |
649
- |----------|-------------|---------|
650
- | `retry` | Transient errors (API timeout, rate limit) | AI agent call failed with 429 |
651
- | `fallback` | Recoverable errors (AI failed, use default) | Template selection → fallback to default |
652
- | `abort` | Critical errors (invalid brand_id, missing template) | Brand not found → abort workflow |
653
-
654
- **Examples:**
655
-
656
- ```yaml
657
- # AI task with retry + fallback
658
- **Error Handling:**
659
- - strategy: fallback
660
- - fallback: |
661
- If AI fails, use config.ready_copy as analysis.
662
- If ready_copy not available, use default analysis:
663
- { goal: "conversion", urgencyLevel: "medium", targetAudience: "general" }
664
- - retry:
665
- max_attempts: 3
666
- backoff: exponential
667
- backoff_ms: 1000
668
- - abort_workflow: false
669
- - notification: log
670
-
671
- # Config load (critical - abort on failure)
672
- **Error Handling:**
673
- - strategy: abort
674
- - retry:
675
- max_attempts: 2
676
- backoff: linear
677
- backoff_ms: 500
678
- - abort_workflow: true
679
- - notification: email + slack
680
- ```
681
-
682
- ---
683
-
684
- #### 13. `Metadata`
685
-
686
- **Type:** `object`
687
- **Required:** ⚠️ Recommended (for traceability)
688
-
689
- **Purpose:** Links task to Stories, versions, and dependencies for project management.
690
-
691
- **Structure:**
692
-
693
- ```yaml
694
- **Metadata:**
695
- - story: [STORY-XXX]
696
- - version: [X.Y.Z]
697
- - dependencies: [array of step IDs]
698
- - breaking_changes: [array of changes]
699
- - author: [name]
700
- - created_at: [YYYY-MM-DD]
701
- - updated_at: [YYYY-MM-DD]
702
- ```
703
-
704
- **Examples:**
705
-
706
- ```yaml
707
- **Metadata:**
708
- - story: STORY-010.1
709
- - version: 2.1.0
710
- - dependencies: [Step 10]
711
- - breaking_changes:
712
- - Output format changed: added computedSpacing object
713
- - Removed nested fallback (SMELL 1 fix)
714
- - author: Brad Frost Clone
715
- - created_at: 2025-11-10
716
- - updated_at: 2025-11-13
717
- ```
718
-
719
- ---
720
-
721
- ## Type System
722
-
723
- ### Basic Types
724
-
725
- ```yaml
726
- string # Text
727
- number # Number (integer or float)
728
- boolean # true or false
729
- null # Null value
730
- any # Any type (avoid when possible)
731
- ```
732
-
733
- ### Complex Types
734
-
735
- ```yaml
736
- array # Array of items
737
- array<string> # Array of strings
738
- array<number> # Array of numbers
739
-
740
- object # Generic object
741
- object { key: type, key: type } # Object with defined keys
742
- ```
743
-
744
- ### Optional Types
745
-
746
- ```yaml
747
- string | null # String or null
748
- object { key?: type } # Object with optional key (? suffix)
749
- ```
750
-
751
- ### Custom Types (Reference Schemas)
752
-
753
- ```yaml
754
- Brand # References schemas/Brand.json
755
- FormatConfig # References schemas/FormatConfig.json
756
- AdAnalysis # References schemas/AdAnalysis.json
757
- ```
758
-
759
- **Examples:**
760
-
761
- ```yaml
762
- - campo: adCopy
763
- tipo: object { title: string, body: string, cta: string }
764
-
765
- - campo: faces
766
- tipo: array<object { top: number, left: number, bottom: number, right: number }>
767
-
768
- - campo: ready_copy
769
- tipo: object { title?: string, body?: string, cta?: string } | null
770
-
771
- - campo: brand
772
- tipo: Brand # References schemas/Brand.json
773
- ```
774
-
775
- ---
776
-
777
- ## Validation Rules
778
-
779
- ### Required Field Validation
780
-
781
- ```javascript
782
- function validateTask(task) {
783
- const required = ['task', 'responsável', 'responsavel_type', 'atomic_layer', 'Entrada', 'Saída'];
784
-
785
- for (const field of required) {
786
- if (!task[field]) {
787
- throw new Error(`Missing required field: ${field}`);
788
- }
789
- }
790
-
791
- // Validate executor type
792
- const validExecutors = ['Agente', 'Worker', 'Humano', 'Clone'];
793
- if (!validExecutors.includes(task.responsavel_type)) {
794
- throw new Error(`Invalid responsavel_type: ${task.responsavel_type}`);
795
- }
796
-
797
- // Validate atomic layer
798
- const validLayers = ['Atom', 'Molecule', 'Organism', 'Template', 'Page', 'Config', 'Strategy', 'Content', 'Media', 'Layout', 'Analysis'];
799
- if (!validLayers.includes(task.atomic_layer)) {
800
- throw new Error(`Invalid atomic_layer: ${task.atomic_layer}`);
801
- }
802
-
803
- return true;
804
- }
805
- ```
806
-
807
- ### Input/Output Validation
808
-
809
- ```javascript
810
- function validateInputOutput(io, type) {
811
- const required = ['campo', 'tipo', 'origem', 'obrigatório'];
812
-
813
- for (const item of io) {
814
- for (const field of required) {
815
- if (!item[field] && field !== 'origem') { // origem not required for output
816
- throw new Error(`${type} missing required field: ${field}`);
817
- }
818
- }
819
- }
820
-
821
- return true;
822
- }
823
- ```
824
-
825
- ---
826
-
827
- ## Examples by Executor Type
828
-
829
- ### Agente (AI-Powered)
830
-
831
- ```yaml
832
- #### Step 3: Analyze Brief
833
-
834
- task: analyzeBrief()
835
- responsável: Ad Strategist
836
- responsavel_type: Agente
837
- atomic_layer: Strategy
838
-
839
- **Entrada:**
840
- - campo: brief_text
841
- tipo: string
842
- origem: User Input (config)
843
- obrigatório: true
844
- validação: "length >= 50"
845
-
846
- - campo: brand
847
- tipo: Brand
848
- origem: Step 2 (loadBrand)
849
- obrigatório: true
850
-
851
- - campo: ready_copy
852
- tipo: object { title?, body?, cta? } | null
853
- origem: User Input (config)
854
- obrigatório: false
855
- padrão: null
856
-
857
- **Saída:**
858
- - campo: adAnalysis
859
- tipo: object { goal, targetAudience, urgencyLevel, emotionalTriggers, keyMessage }
860
- destino: state (ad-spec.json)
861
- persistido: true
862
-
863
- **Checklist:**
864
- pre-conditions:
865
- - [ ] brief_text has minimum 50 characters
866
- tipo: pre-condition
867
- blocker: true
868
- validação: "expect(brief_text.length).toBeGreaterThanOrEqual(50)"
869
-
870
- post-conditions:
871
- - [ ] adAnalysis contains all required fields
872
- tipo: post-condition
873
- blocker: true
874
- validação: |
875
- expect(adAnalysis.goal).toBeTruthy();
876
- expect(adAnalysis.urgencyLevel).toMatch(/high|medium|low/);
877
-
878
- acceptance-criteria:
879
- - [ ] Analysis aligns with brand voice
880
- tipo: acceptance
881
- blocker: false
882
- story: STORY-003
883
- manual_check: false
884
- test: "tests/brief-analysis-brand-alignment.test.js"
885
-
886
- **Template:**
887
- - path: expansion-packs/instagram-content-creator/tasks/ads/analyze-ad-brief.md
888
- type: prompt
889
- version: 2.1.0
890
- variables: [brief_text, brand_id, campaign_goal, ready_copy]
891
-
892
- **Tools:**
893
- - callAgent:
894
- version: 1.0.0
895
- used_for: Execute AI agent with retry
896
- shared_with: [Step 4, Step 5, Step 6, Step 7, Step 8, Step 9, Step 11]
897
-
898
- **Scripts:**
899
- - N/A
900
-
901
- **Performance:**
902
- - duration_expected: 4000ms
903
- - cost_estimated: $0.0025
904
- - cacheable: false
905
- - parallelizable: false
906
- - skippable_when: [ready_copy=true]
907
-
908
- **Error Handling:**
909
- - strategy: fallback
910
- - fallback: |
911
- Use config.ready_copy as analysis if available.
912
- Otherwise, use default analysis: { goal: "conversion", urgencyLevel: "medium", targetAudience: "general" }
913
- - retry:
914
- max_attempts: 3
915
- backoff: exponential
916
- backoff_ms: 1000
917
- - abort_workflow: false
918
- - notification: log
919
-
920
- **Metadata:**
921
- - story: STORY-003
922
- - version: 2.0.0
923
- - dependencies: [Step 2]
924
- - breaking_changes: []
925
- - author: Creative Team
926
- - created_at: 2025-10-01
927
- - updated_at: 2025-11-10
928
- ```
929
-
930
- ---
931
-
932
- ### Worker (Script-Based)
933
-
934
- ```yaml
935
- #### Step 1: Load Format Configuration
936
-
937
- task: loadFormatConfig()
938
- responsável: format-loader.js
939
- responsavel_type: Worker
940
- atomic_layer: Config
941
-
942
- **Entrada:**
943
- - campo: format_id
944
- tipo: string
945
- origem: User Input (config)
946
- obrigatório: true
947
- validação: "format_id in ['instagram-stories', 'instagram-reels', 'instagram-feed-square', 'instagram-feed-portrait']"
948
-
949
- - campo: orientation
950
- tipo: string
951
- origem: User Input (config)
952
- obrigatório: false
953
- padrão: "portrait"
954
- validação: "orientation in ['portrait', 'landscape']"
955
-
956
- **Saída:**
957
- - campo: formatConfig
958
- tipo: FormatConfig
959
- destino: [Step 8, Step 10, Step 11, Step 12, Step 13, Step 14]
960
- persistido: false
961
-
962
- **Checklist:**
963
- pre-conditions:
964
- - [ ] format_id is valid
965
- tipo: pre-condition
966
- blocker: true
967
- validação: |
968
- const validFormats = ['instagram-stories', 'instagram-reels', 'instagram-feed-square', 'instagram-feed-portrait'];
969
- if (!validFormats.includes(format_id)) {
970
- throw new Error(`Invalid format_id: ${format_id}`);
971
- }
972
-
973
- post-conditions:
974
- - [ ] formatConfig.safeZones are defined
975
- tipo: post-condition
976
- blocker: true
977
- validação: |
978
- expect(formatConfig.safeZones).toBeDefined();
979
- expect(formatConfig.safeZones.top).toBeGreaterThan(0);
980
-
981
- - [ ] formatConfig.contentArea.height calculated correctly
982
- tipo: post-condition
983
- blocker: true
984
- validação: |
985
- const expectedHeight = formatConfig.canvas.height - formatConfig.safeZones.top - formatConfig.safeZones.bottom;
986
- expect(formatConfig.contentArea.height).toBe(expectedHeight);
987
-
988
- **Template:**
989
- - path: config/ad-formats.json
990
- type: input
991
- version: 1.0.0
992
- variables: [format_id, orientation]
993
- schema: schemas/FormatConfig.json
994
-
995
- **Tools:**
996
- - N/A
997
-
998
- **Scripts:**
999
- - scripts/utils/format-loader.js:
1000
- description: Reads format JSON and calculates content area
1001
- language: javascript
1002
- version: 1.0.0
1003
-
1004
- **Performance:**
1005
- - duration_expected: 50ms
1006
- - cost_estimated: $0
1007
- - cacheable: true
1008
- - cache_key: format_${format_id}_${orientation}
1009
- - parallelizable: true
1010
- - parallel_with: [Step 2]
1011
- - skippable_when: []
1012
-
1013
- **Error Handling:**
1014
- - strategy: abort
1015
- - retry:
1016
- max_attempts: 2
1017
- backoff: linear
1018
- backoff_ms: 100
1019
- - abort_workflow: true
1020
- - notification: log + email
1021
-
1022
- **Metadata:**
1023
- - story: DECISION-02
1024
- - version: 1.0.0
1025
- - dependencies: []
1026
- - breaking_changes: []
1027
- - author: Brad Frost Clone
1028
- - created_at: 2025-11-10
1029
- - updated_at: 2025-11-10
1030
- ```
1031
-
1032
- ---
1033
-
1034
- ### Humano (Manual Review)
1035
-
1036
- ```yaml
1037
- #### Step 15: Quality Review (Optional)
1038
-
1039
- task: reviewAdQuality()
1040
- responsável: Quality Assurance Team
1041
- responsavel_type: Humano
1042
- atomic_layer: Page
1043
-
1044
- **Entrada:**
1045
- - campo: final_ad_png
1046
- tipo: string (file path)
1047
- origem: Step 14 (exportPNG)
1048
- obrigatório: true
1049
-
1050
- - campo: ad_spec
1051
- tipo: object (complete ad specification)
1052
- origem: state (ad-spec.json)
1053
- obrigatório: true
1054
-
1055
- - campo: quality_criteria
1056
- tipo: array<string>
1057
- origem: config
1058
- obrigatório: true
1059
- padrão: ["brand_alignment", "text_legibility", "visual_appeal", "no_face_coverage"]
1060
-
1061
- **Saída:**
1062
- - campo: quality_review
1063
- tipo: object { approved: boolean, score: number, feedback: string, reviewer: string }
1064
- destino: state (ad-spec.json)
1065
- persistido: true
1066
-
1067
- **Checklist:**
1068
- pre-conditions:
1069
- - [ ] final_ad_png file exists
1070
- tipo: pre-condition
1071
- blocker: true
1072
- validação: |
1073
- const fs = require('fs');
1074
- if (!fs.existsSync(final_ad_png)) {
1075
- throw new Error(`Ad PNG not found: ${final_ad_png}`);
1076
- }
1077
-
1078
- acceptance-criteria:
1079
- - [ ] Ad meets all quality criteria
1080
- tipo: acceptance
1081
- blocker: false
1082
- story: STORY-QA
1083
- manual_check: true
1084
-
1085
- - [ ] Reviewer provided detailed feedback
1086
- tipo: acceptance
1087
- blocker: false
1088
- story: STORY-QA
1089
- manual_check: true
1090
-
1091
- **Template:**
1092
- - path: templates/ui-forms/quality-review-form.html
1093
- type: ui
1094
- version: 1.0.0
1095
- variables: [final_ad_png, ad_spec, quality_criteria]
1096
-
1097
- **Tools:**
1098
- - N/A
1099
-
1100
- **Scripts:**
1101
- - N/A
1102
-
1103
- **Performance:**
1104
- - duration_expected: 180000ms # 3 minutes (manual review)
1105
- - cost_estimated: $5 # Human labor cost
1106
- - cacheable: false
1107
- - parallelizable: false
1108
- - skippable_when: [skip_qa=true, batch_mode=true]
1109
-
1110
- **Error Handling:**
1111
- - strategy: fallback
1112
- - fallback: Auto-approve if reviewer doesn't respond within 10 minutes
1113
- - retry:
1114
- max_attempts: 1
1115
- backoff: linear
1116
- backoff_ms: 600000 # 10 minutes
1117
- - abort_workflow: false
1118
- - notification: slack
1119
-
1120
- **Metadata:**
1121
- - story: STORY-QA
1122
- - version: 1.0.0
1123
- - dependencies: [Step 14]
1124
- - breaking_changes: []
1125
- - author: QA Team
1126
- - created_at: 2025-11-13
1127
- - updated_at: 2025-11-13
1128
- ```
1129
-
1130
- ---
1131
-
1132
- ### Clone (Mind Emulation)
1133
-
1134
- ```yaml
1135
- #### Step 7c: Validate Components (Brad Frost Clone)
1136
-
1137
- task: validateComponentsAtomicDesign()
1138
- responsável: Brad Frost Clone
1139
- responsavel_type: Clone
1140
- atomic_layer: Atom
1141
-
1142
- **Entrada:**
1143
- - campo: ctaComponent
1144
- tipo: object { text, style, colors }
1145
- origem: Step 7a (designCTAComponent)
1146
- obrigatório: true
1147
-
1148
- - campo: badgeComponent
1149
- tipo: object { text, style, colors } | null
1150
- origem: Step 7b (designBadgeComponent)
1151
- obrigatório: false
1152
-
1153
- **Saída:**
1154
- - campo: validation_result
1155
- tipo: object { valid: boolean, violations: array<object { rule, severity, message }> }
1156
- destino: state (ad-spec.json)
1157
- persistido: true
1158
-
1159
- **Checklist:**
1160
- pre-conditions:
1161
- - [ ] ctaComponent exists
1162
- tipo: pre-condition
1163
- blocker: true
1164
- validação: "expect(ctaComponent).toBeDefined()"
1165
-
1166
- post-conditions:
1167
- - [ ] No Atomic Design violations detected
1168
- tipo: post-condition
1169
- blocker: true
1170
- validação: |
1171
- if (!validation_result.valid) {
1172
- const criticalViolations = validation_result.violations.filter(v => v.severity === 'critical');
1173
- if (criticalViolations.length > 0) {
1174
- throw new Error(`Atomic Design violations: ${criticalViolations.map(v => v.message).join(', ')}`);
1175
- }
1176
- }
1177
-
1178
- - [ ] All components are context-agnostic (no positioning)
1179
- tipo: post-condition
1180
- blocker: true
1181
- validação: |
1182
- if (ctaComponent.position || ctaComponent.size) {
1183
- throw new Error("CTA component has positioning data (DECISION-03 violation)");
1184
- }
1185
- if (badgeComponent && (badgeComponent.position || badgeComponent.size)) {
1186
- throw new Error("Badge component has positioning data (DECISION-03 violation)");
1187
- }
1188
-
1189
- acceptance-criteria:
1190
- - [ ] Components follow Brad Frost's Atomic Design principles
1191
- tipo: acceptance
1192
- blocker: false
1193
- story: DECISION-03
1194
- manual_check: false
1195
-
1196
- **Clone Configuration:**
1197
- - heuristics: clones/brad_frost/heuristics.yaml
1198
- - axioms: clones/brad_frost/axioms.yaml
1199
- - ai_fallback: true
1200
-
1201
- **Tools:**
1202
- - callAgent:
1203
- version: 1.0.0
1204
- used_for: AI validation when heuristics are inconclusive
1205
- shared_with: [Step 3, Step 4, Step 5, Step 6, Step 7, Step 8, Step 9, Step 11]
1206
-
1207
- - validateHeuristics:
1208
- version: 1.0.0
1209
- used_for: Apply Brad Frost's design heuristics
1210
- shared_with: [Step 7c only]
1211
-
1212
- - validateAxioms:
1213
- version: 1.0.0
1214
- used_for: Validate against Atomic Design axioms
1215
- shared_with: [Step 7c only]
1216
-
1217
- **Scripts:**
1218
- - clones/brad_frost/validate-atomic-design.js:
1219
- description: Atomic Design validation with heuristics + axioms
1220
- language: javascript
1221
- version: 1.0.0
1222
-
1223
- **Performance:**
1224
- - duration_expected: 1500ms
1225
- - cost_estimated: $0.001 # Mostly heuristics, minimal AI
1226
- - cacheable: false
1227
- - parallelizable: false
1228
- - skippable_when: [skip_validation=true]
1229
-
1230
- **Error Handling:**
1231
- - strategy: abort
1232
- - fallback: N/A (validation must pass)
1233
- - retry:
1234
- max_attempts: 1
1235
- backoff: linear
1236
- backoff_ms: 0
1237
- - abort_workflow: true
1238
- - notification: log + slack
1239
-
1240
- **Metadata:**
1241
- - story: DECISION-03
1242
- - version: 1.0.0
1243
- - dependencies: [Step 7a, Step 7b]
1244
- - breaking_changes: []
1245
- - author: Brad Frost Clone
1246
- - created_at: 2025-11-13
1247
- - updated_at: 2025-11-13
1248
- ```
1249
-
1250
- ---
1251
-
1252
- ## Validation Checklist
1253
-
1254
- Use this checklist to validate any AIOS Task:
1255
-
1256
- ### Required Fields
1257
-
1258
- - [ ] `task` is defined and unique
1259
- - [ ] `responsável` is defined
1260
- - [ ] `responsavel_type` is one of: Agente, Worker, Humano, Clone
1261
- - [ ] `atomic_layer` is defined (or explicitly marked N/A)
1262
- - [ ] `Entrada` is defined (array, can be empty)
1263
- - [ ] `Saída` is defined (array, can be empty)
1264
-
1265
- ### Input/Output Quality
1266
-
1267
- - [ ] All inputs have: campo, tipo, origem, obrigatório
1268
- - [ ] All outputs have: campo, tipo, destino, persistido
1269
- - [ ] Types are well-defined (not just "object" or "any")
1270
- - [ ] Sources/destinations reference valid steps
1271
-
1272
- ### Checklist Quality
1273
-
1274
- - [ ] Pre-conditions validate inputs
1275
- - [ ] Post-conditions validate outputs
1276
- - [ ] Acceptance criteria link to Stories
1277
- - [ ] Blocking conditions are appropriate
1278
- - [ ] Validation logic is executable
1279
-
1280
- ### Templates & Tools
1281
-
1282
- - [ ] Template referenced (if applicable)
1283
- - [ ] Tools cataloged (if applicable)
1284
- - [ ] Scripts listed (if applicable)
1285
- - [ ] All references are valid paths
1286
-
1287
- ### Performance & Error Handling
1288
-
1289
- - [ ] Duration expected is realistic
1290
- - [ ] Cost estimated (for AI)
1291
- - [ ] Cacheability considered
1292
- - [ ] Parallelization opportunities identified
1293
- - [ ] Error handling strategy defined
1294
- - [ ] Retry logic appropriate
1295
-
1296
- ### Metadata
1297
-
1298
- - [ ] Story linked (if applicable)
1299
- - [ ] Version defined
1300
- - [ ] Dependencies listed
1301
- - [ ] Breaking changes documented
1302
-
1303
- ---
1304
-
1305
- ## Migration Guide (v2.0 → v3.0)
1306
-
1307
- ### Step 1: Add Missing Required Fields
1308
-
1309
- ```yaml
1310
- # BEFORE (v2.0 - incomplete)
1311
- #### Step 3: Analyze Brief
1312
-
1313
- task: analyzeBrief()
1314
- responsável: Ad Strategist
1315
-
1316
- **Entrada:**
1317
- **Saída:**
1318
-
1319
- # AFTER (v3.0 - complete)
1320
- #### Step 3: Analyze Brief
1321
-
1322
- task: analyzeBrief()
1323
- responsável: Ad Strategist
1324
- responsavel_type: Agente # ← ADDED
1325
- atomic_layer: Strategy # ← ADDED
1326
-
1327
- **Entrada:**
1328
- - campo: brief_text
1329
- tipo: string
1330
- origem: User Input (config)
1331
- obrigatório: true
1332
-
1333
- **Saída:**
1334
- - campo: adAnalysis
1335
- tipo: object { ... }
1336
- destino: state (ad-spec.json)
1337
- persistido: true
1338
- ```
1339
-
1340
- ### Step 2: Structure Checklists
1341
-
1342
- ```yaml
1343
- # BEFORE (v2.0 - inline validations)
1344
- **Validações:**
1345
- - ✅ brief_text has minimum 50 characters
1346
- - ✅ adAnalysis contains required fields
1347
-
1348
- # AFTER (v3.0 - structured checklist)
1349
- **Checklist:**
1350
- pre-conditions:
1351
- - [ ] brief_text has minimum 50 characters
1352
- tipo: pre-condition
1353
- blocker: true
1354
- validação: "expect(brief_text.length).toBeGreaterThanOrEqual(50)"
1355
-
1356
- post-conditions:
1357
- - [ ] adAnalysis contains all required fields
1358
- tipo: post-condition
1359
- blocker: true
1360
- validação: |
1361
- expect(adAnalysis.goal).toBeTruthy();
1362
- expect(adAnalysis.urgencyLevel).toMatch(/high|medium|low/);
1363
- ```
1364
-
1365
- ### Step 3: Add Performance Metrics
1366
-
1367
- ```yaml
1368
- # BEFORE (v2.0 - no metrics)
1369
- (no performance section)
1370
-
1371
- # AFTER (v3.0 - with metrics)
1372
- **Performance:**
1373
- - duration_expected: 4000ms
1374
- - cost_estimated: $0.0025
1375
- - cacheable: false
1376
- - parallelizable: false
1377
- - skippable_when: [ready_copy=true]
1378
- ```
1379
-
1380
- ### Step 4: Add Error Handling
1381
-
1382
- ```yaml
1383
- # BEFORE (v2.0 - implicit)
1384
- (no error handling section)
1385
-
1386
- # AFTER (v3.0 - explicit)
1387
- **Error Handling:**
1388
- - strategy: fallback
1389
- - fallback: Use default analysis
1390
- - retry:
1391
- max_attempts: 3
1392
- backoff: exponential
1393
- backoff_ms: 1000
1394
- - abort_workflow: false
1395
- - notification: log
1396
- ```
1397
-
1398
- ---
1399
-
1400
- ## Version History
1401
-
1402
- | Version | Date | Author | Changes |
1403
- |---------|------|--------|---------|
1404
- | 1.0.0 | 2025-11-13 | Brad Frost Clone | Initial specification |
1405
-
1406
- ---
1407
-
1408
- **END OF TASK FORMAT SPECIFICATION**
1409
-
1410
- **Related Documents:**
1411
- - `EXECUTOR-DECISION-TREE.md` - How to choose executor type
1412
- - `TEMPLATE-SYSTEM-GUIDE.md` - Template design patterns
1413
- - `TOOLS-AND-SCRIPTS-CATALOG.md` - Available tools reference
1414
-
1
+ # AIOS Task Format Specification V1.0
2
+
3
+ **Date:** 2025-11-13
4
+ **Version:** 1.0.0
5
+ **Status:** Standard
6
+ **Author:** Brad Frost Cognitive Clone
7
+
8
+ ---
9
+
10
+ ## Purpose
11
+
12
+ This document defines the UNIVERSAL format for AIOS Tasks, ensuring consistency, scalability, and reusability across workflows, executors, and teams.
13
+
14
+ ---
15
+
16
+ ## Task Format Overview
17
+
18
+ Every AIOS Task MUST follow this structure:
19
+
20
+ ```yaml
21
+ #### Step X: [Task Name]
22
+
23
+ task: taskIdentifier()
24
+ responsável: [Role or Service Name]
25
+ responsavel_type: Agente | Worker | Humano | Clone
26
+ atomic_layer: [Atom | Molecule | Organism | Template | Page | Config | Strategy | Content | Media | Layout | Analysis]
27
+
28
+ **Entrada:**
29
+ - campo: [name]
30
+ tipo: [type]
31
+ origem: [source step]
32
+ obrigatório: [true|false]
33
+ padrão: [default value] (optional)
34
+
35
+ **Saída:**
36
+ - campo: [name]
37
+ tipo: [type]
38
+ destino: [destination step(s)]
39
+ persistido: [true|false]
40
+
41
+ **Checklist:**
42
+ pre-conditions:
43
+ - [ ] [condition description]
44
+ tipo: pre-condition
45
+ blocker: [true|false]
46
+ validação: [validation logic or test path]
47
+
48
+ post-conditions:
49
+ - [ ] [condition description]
50
+ tipo: post-condition
51
+ blocker: [true|false]
52
+ validação: [validation logic or test path]
53
+
54
+ acceptance-criteria:
55
+ - [ ] [acceptance description]
56
+ tipo: acceptance
57
+ blocker: [false]
58
+ story: [STORY-XXX]
59
+ manual_check: [true|false]
60
+
61
+ **Template:** (optional)
62
+ - path: [relative path to template file]
63
+ - type: [input|output|prompt|ui|script]
64
+ - version: [X.Y.Z]
65
+ - variables: [array of variable names]
66
+
67
+ **Tools:** (optional)
68
+ - [tool_name]:
69
+ version: [X.Y.Z]
70
+ used_for: [description]
71
+ shared_with: [array of step IDs]
72
+
73
+ **Scripts:** (optional)
74
+ - [script_path]:
75
+ description: [what it does]
76
+ language: [javascript|python|bash|etc]
77
+
78
+ **Performance:**
79
+ - duration_expected: [X]ms
80
+ - cost_estimated: $[Y] (for AI executors)
81
+ - cacheable: [true|false]
82
+ - cache_key: [cache identifier] (if cacheable)
83
+ - parallelizable: [true|false]
84
+ - parallel_with: [array of step IDs] (if parallelizable)
85
+ - skippable_when: [array of conditions]
86
+
87
+ **Error Handling:**
88
+ - strategy: [retry|fallback|abort]
89
+ - fallback: [description or default value] (if strategy=fallback)
90
+ - retry:
91
+ max_attempts: [N]
92
+ backoff: [linear|exponential]
93
+ backoff_ms: [initial backoff in milliseconds]
94
+ - abort_workflow: [true|false]
95
+ - notification: [log|email|slack|etc]
96
+
97
+ **Metadata:**
98
+ - story: [STORY-XXX]
99
+ - version: [X.Y.Z]
100
+ - dependencies: [array of step IDs]
101
+ - breaking_changes: [array of changes from previous version]
102
+ - author: [name]
103
+ - created_at: [YYYY-MM-DD]
104
+ - updated_at: [YYYY-MM-DD]
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Field Definitions
110
+
111
+ ### Required Fields
112
+
113
+ #### 1. `task`
114
+
115
+ **Type:** `string` (function name)
116
+ **Required:** ✅ Yes
117
+ **Format:** `camelCase()` with parentheses
118
+
119
+ **Purpose:** Unique identifier for the task function.
120
+
121
+ **Validation:**
122
+ - Must be unique across workflow
123
+ - Must be valid JavaScript function name
124
+ - Must end with `()`
125
+
126
+ **Examples:**
127
+ ```yaml
128
+ task: loadFormatConfig()
129
+ task: analyzeBrief()
130
+ task: designCTAComponent()
131
+ ```
132
+
133
+ ---
134
+
135
+ #### 2. `responsável`
136
+
137
+ **Type:** `string`
138
+ **Required:** ✅ Yes
139
+ **Format:** Free text (role or service name)
140
+
141
+ **Purpose:** Human-readable name of the responsible entity.
142
+
143
+ **Examples:**
144
+ ```yaml
145
+ responsável: Creative Director
146
+ responsável: format-loader.js
147
+ responsável: OpenRouter Vision Model
148
+ responsável: Brad Frost Clone
149
+ ```
150
+
151
+ ---
152
+
153
+ #### 3. `responsavel_type`
154
+
155
+ **Type:** `enum`
156
+ **Required:** ✅ Yes
157
+ **Values:** `Agente | Worker | Humano | Clone`
158
+
159
+ **Purpose:** Defines the executor type for orchestration, cost tracking, and error handling.
160
+
161
+ **Validation:**
162
+ - Must be one of the 4 allowed values
163
+ - Determines execution environment
164
+
165
+ **Decision Tree:** See `EXECUTOR-DECISION-TREE.md`
166
+
167
+ **Examples:**
168
+ ```yaml
169
+ responsavel_type: Agente # AI-powered execution
170
+ responsavel_type: Worker # Script-based execution
171
+ responsavel_type: Humano # Manual human execution
172
+ responsavel_type: Clone # Mind emulation with heuristics
173
+ ```
174
+
175
+ ---
176
+
177
+ #### 4. `atomic_layer`
178
+
179
+ **Type:** `enum`
180
+ **Required:** ✅ Yes (for design-related tasks), ⚠️ Optional (for config/strategy)
181
+ **Values:**
182
+ - **Atomic Design:** `Atom | Molecule | Organism | Template | Page`
183
+ - **Other Layers:** `Config | Strategy | Content | Media | Layout | Analysis`
184
+
185
+ **Purpose:** Maps task to Atomic Design layer for architecture validation.
186
+
187
+ **Validation:**
188
+ - Design tasks MUST specify Atomic Design layer
189
+ - Non-design tasks SHOULD specify functional layer
190
+
191
+ **Examples:**
192
+ ```yaml
193
+ atomic_layer: Atom # Step 7a: Design CTA (single component)
194
+ atomic_layer: Molecule # Step 8a: Compose Text Group (title + body + cta)
195
+ atomic_layer: Organism # Step 8c: Content Area (complete section)
196
+ atomic_layer: Template # Step 13: Render HTML (structure)
197
+ atomic_layer: Page # Step 14: Export PNG (final instance)
198
+ atomic_layer: Config # Step 1: Load Format Config
199
+ atomic_layer: Strategy # Step 3: Analyze Brief
200
+ ```
201
+
202
+ ---
203
+
204
+ #### 5. `Entrada` (Inputs)
205
+
206
+ **Type:** `array of objects`
207
+ **Required:** ✅ Yes (can be empty array if no inputs)
208
+
209
+ **Purpose:** Defines all inputs required by the task, with types, sources, and constraints.
210
+
211
+ **Structure:**
212
+
213
+ ```yaml
214
+ **Entrada:**
215
+ - campo: [field name]
216
+ tipo: [type definition]
217
+ origem: [source step or config]
218
+ obrigatório: [true|false]
219
+ padrão: [default value] (optional)
220
+ validação: [validation rule] (optional)
221
+ ```
222
+
223
+ **Field Details:**
224
+
225
+ | Sub-field | Type | Required | Description |
226
+ |-----------|------|----------|-------------|
227
+ | `campo` | string | ✅ Yes | Field name (camelCase) |
228
+ | `tipo` | string | ✅ Yes | Type definition (see Type System below) |
229
+ | `origem` | string | ✅ Yes | Source step ID or "config" or "user input" |
230
+ | `obrigatório` | boolean | ✅ Yes | Whether field is required |
231
+ | `padrão` | any | ⚠️ Optional | Default value if not provided |
232
+ | `validação` | string | ⚠️ Optional | Validation rule or JSON Schema reference |
233
+
234
+ **Examples:**
235
+
236
+ ```yaml
237
+ **Entrada:**
238
+ - campo: adCopy
239
+ tipo: object { title: string, body: string, cta: string }
240
+ origem: Step 5 (craftCopy)
241
+ obrigatório: true
242
+ validação: |
243
+ title.length >= 1 && title.length <= 100
244
+ body.length >= 1 && body.length <= 500
245
+ cta.length >= 1 && cta.length <= 30
246
+
247
+ - campo: brand
248
+ tipo: object (Brand schema)
249
+ origem: Step 2 (loadBrand)
250
+ obrigatório: true
251
+
252
+ - campo: ready_copy
253
+ tipo: object { title?, body?, cta? } | null
254
+ origem: User Input (config)
255
+ obrigatório: false
256
+ padrão: null
257
+ ```
258
+
259
+ ---
260
+
261
+ #### 6. `Saída` (Outputs)
262
+
263
+ **Type:** `array of objects`
264
+ **Required:** ✅ Yes (can be empty array if no outputs)
265
+
266
+ **Purpose:** Defines all outputs produced by the task, with types, destinations, and persistence.
267
+
268
+ **Structure:**
269
+
270
+ ```yaml
271
+ **Saída:**
272
+ - campo: [field name]
273
+ tipo: [type definition]
274
+ destino: [destination step(s) or state]
275
+ persistido: [true|false]
276
+ cache_key: [key] (if cacheable)
277
+ ```
278
+
279
+ **Field Details:**
280
+
281
+ | Sub-field | Type | Required | Description |
282
+ |-----------|------|----------|-------------|
283
+ | `campo` | string | ✅ Yes | Field name (camelCase) |
284
+ | `tipo` | string | ✅ Yes | Type definition |
285
+ | `destino` | string or array | ✅ Yes | Destination step(s) or "state" or "output" |
286
+ | `persistido` | boolean | ✅ Yes | Whether saved to ad-spec.json or DB |
287
+ | `cache_key` | string | ⚠️ Optional | Cache key if output is cacheable |
288
+
289
+ **Examples:**
290
+
291
+ ```yaml
292
+ **Saída:**
293
+ - campo: formatConfig
294
+ tipo: object { formatId, canvas, safeZones, contentArea }
295
+ destino: [Step 8, Step 10, Step 11, Step 12, Step 13, Step 14]
296
+ persistido: false # Kept in memory only
297
+
298
+ - campo: adAnalysis
299
+ tipo: object { goal, targetAudience, urgencyLevel, emotionalTriggers }
300
+ destino: state (ad-spec.json)
301
+ persistido: true
302
+
303
+ - campo: designTokens
304
+ tipo: object { spacing, typography, colors, radius, shadows }
305
+ destino: Step 13 (renderHTML)
306
+ persistido: false
307
+ cache_key: format_${formatConfig.formatId}_${formatConfig.orientation}
308
+ ```
309
+
310
+ ---
311
+
312
+ ### Optional Fields
313
+
314
+ #### 7. `Checklist`
315
+
316
+ **Type:** `object with arrays`
317
+ **Required:** ⚠️ Recommended
318
+
319
+ **Purpose:** Defines validations (pre-conditions, post-conditions, acceptance criteria) for automated and manual testing.
320
+
321
+ **Structure:**
322
+
323
+ ```yaml
324
+ **Checklist:**
325
+ pre-conditions:
326
+ - [ ] [description]
327
+ tipo: pre-condition
328
+ blocker: [true|false]
329
+ validação: [logic or test path]
330
+ error_message: [message if fails]
331
+
332
+ post-conditions:
333
+ - [ ] [description]
334
+ tipo: post-condition
335
+ blocker: [true|false]
336
+ validação: [logic or test path]
337
+ rollback: [true|false]
338
+
339
+ acceptance-criteria:
340
+ - [ ] [description]
341
+ tipo: acceptance
342
+ blocker: false
343
+ story: [STORY-XXX]
344
+ manual_check: [true|false]
345
+ test: [test file path]
346
+ ```
347
+
348
+ **Checklist Types:**
349
+
350
+ 1. **Pre-conditions** (Run BEFORE task)
351
+ - Validate inputs exist and are valid
352
+ - Check dependencies are met
353
+ - Verify environment is ready
354
+ - **Blocking:** Task aborts if pre-condition fails
355
+
356
+ 2. **Post-conditions** (Run AFTER task)
357
+ - Validate outputs match schema
358
+ - Check business rules
359
+ - Verify no side effects
360
+ - **Blocking:** Task rolls back if post-condition fails
361
+
362
+ 3. **Acceptance Criteria** (Run AFTER workflow)
363
+ - Validate Story requirements
364
+ - Can be manual (human review)
365
+ - Can be automated (integration tests)
366
+ - **Non-blocking:** Log failure, continue workflow
367
+
368
+ **Examples:**
369
+
370
+ ```yaml
371
+ **Checklist:**
372
+ pre-conditions:
373
+ - [ ] brand.typography exists and is valid
374
+ tipo: pre-condition
375
+ blocker: true
376
+ validação: |
377
+ if (!brand.typography || !brand.typography.primaryFont) {
378
+ throw new Error("Brand typography not loaded");
379
+ }
380
+ error_message: "Brand typography missing or invalid"
381
+
382
+ - [ ] adCopy.title is not empty
383
+ tipo: pre-condition
384
+ blocker: true
385
+ validação: "expect(adCopy.title).toBeTruthy()"
386
+ error_message: "Copy title is required"
387
+
388
+ post-conditions:
389
+ - [ ] typography.title.htmlContent is valid HTML
390
+ tipo: post-condition
391
+ blocker: true
392
+ validação: |
393
+ const isValid = await validateHTML(typography.title.htmlContent);
394
+ if (!isValid) throw new Error("Invalid HTML");
395
+ rollback: false
396
+
397
+ - [ ] All required transformations applied
398
+ tipo: post-condition
399
+ blocker: true
400
+ validação: |
401
+ expect(typography.title.transformations).toBeInstanceOf(Array);
402
+ expect(typography.title.transformations.length).toBeGreaterThan(0);
403
+ rollback: false
404
+
405
+ acceptance-criteria:
406
+ - [ ] Typography matches brand voice (bold, uppercase for urgent CTAs)
407
+ tipo: acceptance
408
+ blocker: false
409
+ story: STORY-006
410
+ manual_check: false
411
+ test: "tests/typography-brand-voice.test.js"
412
+
413
+ - [ ] Transformations are visually appealing
414
+ tipo: acceptance
415
+ blocker: false
416
+ story: STORY-006
417
+ manual_check: true
418
+ ```
419
+
420
+ ---
421
+
422
+ #### 8. `Template`
423
+
424
+ **Type:** `object`
425
+ **Required:** ⚠️ Optional (but recommended for Agente executors)
426
+
427
+ **Purpose:** References template files that define input/output schemas, prompts, or UI forms.
428
+
429
+ **Structure:**
430
+
431
+ ```yaml
432
+ **Template:**
433
+ - path: [relative path]
434
+ type: [input|output|prompt|ui|script]
435
+ version: [X.Y.Z]
436
+ variables: [array of variable names used in template]
437
+ schema: [JSON Schema reference] (optional)
438
+ ```
439
+
440
+ **Template Types:**
441
+
442
+ | Type | Purpose | Example |
443
+ |------|---------|---------|
444
+ | `input` | Validates input schema | `templates/input-schemas/analyze-brief.json` |
445
+ | `output` | Validates output schema | `templates/output-schemas/analyze-brief.json` |
446
+ | `prompt` | AI agent prompt structure | `Squads/.../analyze-ad-brief.md` |
447
+ | `ui` | Human interface form | `templates/ui-forms/manual-approval.html` |
448
+ | `script` | Worker script template | `templates/scripts/image-processor.sh` |
449
+
450
+ **Examples:**
451
+
452
+ ```yaml
453
+ # Agente executor with prompt template
454
+ **Template:**
455
+ - path: Squads/instagram-content-creator/tasks/ads/analyze-ad-brief.md
456
+ type: prompt
457
+ version: 2.1.0
458
+ variables: [brief_text, brand_id, campaign_goal, ready_copy]
459
+ schema: Squads/instagram-content-creator/schemas/analyze-brief-output.json
460
+
461
+ # Worker executor with script template
462
+ **Template:**
463
+ - path: scripts/utils/format-loader.js
464
+ type: script
465
+ version: 1.0.0
466
+ variables: [format_id, orientation]
467
+
468
+ # Humano executor with UI form
469
+ **Template:**
470
+ - path: templates/ui-forms/manual-review-ad-quality.html
471
+ type: ui
472
+ version: 1.0.0
473
+ variables: [ad_preview_url, quality_criteria]
474
+ ```
475
+
476
+ ---
477
+
478
+ #### 9. `Tools`
479
+
480
+ **Type:** `object`
481
+ **Required:** ⚠️ Recommended (to document reusability)
482
+
483
+ **Purpose:** Catalogs reusable tools/functions used by the task, enabling:
484
+ - **Reusability tracking** (which tasks share tools)
485
+ - **Versioning** (tool updates affect which tasks)
486
+ - **Cost tracking** (tool API costs)
487
+
488
+ **Structure:**
489
+
490
+ ```yaml
491
+ **Tools:**
492
+ - [tool_name]:
493
+ version: [X.Y.Z]
494
+ used_for: [description]
495
+ shared_with: [array of step IDs or "global"]
496
+ cost: $[Y] per call (optional)
497
+ cacheable: [true|false] (optional)
498
+ ```
499
+
500
+ **Examples:**
501
+
502
+ ```yaml
503
+ **Tools:**
504
+ - callAgent:
505
+ version: 1.0.0
506
+ used_for: AIOS agent caller with retry logic
507
+ shared_with: [Step 3, Step 4, Step 5, Step 6, Step 7, Step 8, Step 9, Step 11]
508
+ cost: varies by agent
509
+
510
+ - validateHTML:
511
+ version: 2.1.0
512
+ used_for: HTML validation using htmlhint
513
+ shared_with: [Step 6, Step 13]
514
+
515
+ - detectFaces:
516
+ version: 1.0.0
517
+ used_for: Face detection via OpenRouter Gemini 2.5 Flash
518
+ shared_with: [Step 10]
519
+ cost: $0.002 per image
520
+
521
+ - validateContrast:
522
+ version: 1.0.0
523
+ used_for: WCAG AA color contrast validation
524
+ shared_with: [Step 2, Step 7]
525
+ ```
526
+
527
+ ---
528
+
529
+ #### 10. `Scripts`
530
+
531
+ **Type:** `object`
532
+ **Required:** ⚠️ Optional (for Worker executors primarily)
533
+
534
+ **Purpose:** References custom scripts executed by the task.
535
+
536
+ **Structure:**
537
+
538
+ ```yaml
539
+ **Scripts:**
540
+ - [script_path]:
541
+ description: [what it does]
542
+ language: [javascript|python|bash|etc]
543
+ version: [X.Y.Z] (optional)
544
+ ```
545
+
546
+ **Examples:**
547
+
548
+ ```yaml
549
+ **Scripts:**
550
+ - scripts/utils/format-loader.js:
551
+ description: Loads format configuration from JSON file
552
+ language: javascript
553
+ version: 1.0.0
554
+
555
+ - scripts/utils/face-detection.js:
556
+ description: Wrapper for OpenRouter face detection API
557
+ language: javascript
558
+ version: 1.2.0
559
+
560
+ - scripts/export/puppeteer-renderer.js:
561
+ description: Renders HTML to PNG using Puppeteer
562
+ language: javascript
563
+ version: 2.0.0
564
+ ```
565
+
566
+ ---
567
+
568
+ #### 11. `Performance`
569
+
570
+ **Type:** `object`
571
+ **Required:** ⚠️ Recommended (for optimization)
572
+
573
+ **Purpose:** Documents expected performance metrics and optimization opportunities.
574
+
575
+ **Structure:**
576
+
577
+ ```yaml
578
+ **Performance:**
579
+ - duration_expected: [X]ms
580
+ - cost_estimated: $[Y] (for AI)
581
+ - cacheable: [true|false]
582
+ - cache_key: [identifier] (if cacheable)
583
+ - parallelizable: [true|false]
584
+ - parallel_with: [array of step IDs]
585
+ - skippable_when: [array of conditions]
586
+ ```
587
+
588
+ **Examples:**
589
+
590
+ ```yaml
591
+ # AI task (expensive, slow, not cacheable)
592
+ **Performance:**
593
+ - duration_expected: 3500ms
594
+ - cost_estimated: $0.0015
595
+ - cacheable: false
596
+ - parallelizable: false
597
+
598
+ # Config load (fast, cacheable)
599
+ **Performance:**
600
+ - duration_expected: 100ms
601
+ - cost_estimated: $0
602
+ - cacheable: true
603
+ - cache_key: format_${format_id}_${orientation}
604
+ - parallelizable: false
605
+
606
+ # Image selection (can run in parallel with template selection)
607
+ **Performance:**
608
+ - duration_expected: 2500ms
609
+ - cost_estimated: $0.001
610
+ - cacheable: false
611
+ - parallelizable: true
612
+ - parallel_with: [Step 4]
613
+
614
+ # Brief analysis (skippable in ready_copy mode)
615
+ **Performance:**
616
+ - duration_expected: 4000ms
617
+ - cost_estimated: $0.0025
618
+ - cacheable: false
619
+ - parallelizable: false
620
+ - skippable_when: [ready_copy=true]
621
+ ```
622
+
623
+ ---
624
+
625
+ #### 12. `Error Handling`
626
+
627
+ **Type:** `object`
628
+ **Required:** ⚠️ Recommended (for robustness)
629
+
630
+ **Purpose:** Defines error handling strategy for resilience.
631
+
632
+ **Structure:**
633
+
634
+ ```yaml
635
+ **Error Handling:**
636
+ - strategy: [retry|fallback|abort]
637
+ - fallback: [description or value] (if strategy=fallback)
638
+ - retry:
639
+ max_attempts: [N]
640
+ backoff: [linear|exponential]
641
+ backoff_ms: [initial delay]
642
+ - abort_workflow: [true|false]
643
+ - notification: [log|email|slack|etc]
644
+ ```
645
+
646
+ **Strategies:**
647
+
648
+ | Strategy | When to Use | Example |
649
+ |----------|-------------|---------|
650
+ | `retry` | Transient errors (API timeout, rate limit) | AI agent call failed with 429 |
651
+ | `fallback` | Recoverable errors (AI failed, use default) | Template selection → fallback to default |
652
+ | `abort` | Critical errors (invalid brand_id, missing template) | Brand not found → abort workflow |
653
+
654
+ **Examples:**
655
+
656
+ ```yaml
657
+ # AI task with retry + fallback
658
+ **Error Handling:**
659
+ - strategy: fallback
660
+ - fallback: |
661
+ If AI fails, use config.ready_copy as analysis.
662
+ If ready_copy not available, use default analysis:
663
+ { goal: "conversion", urgencyLevel: "medium", targetAudience: "general" }
664
+ - retry:
665
+ max_attempts: 3
666
+ backoff: exponential
667
+ backoff_ms: 1000
668
+ - abort_workflow: false
669
+ - notification: log
670
+
671
+ # Config load (critical - abort on failure)
672
+ **Error Handling:**
673
+ - strategy: abort
674
+ - retry:
675
+ max_attempts: 2
676
+ backoff: linear
677
+ backoff_ms: 500
678
+ - abort_workflow: true
679
+ - notification: email + slack
680
+ ```
681
+
682
+ ---
683
+
684
+ #### 13. `Metadata`
685
+
686
+ **Type:** `object`
687
+ **Required:** ⚠️ Recommended (for traceability)
688
+
689
+ **Purpose:** Links task to Stories, versions, and dependencies for project management.
690
+
691
+ **Structure:**
692
+
693
+ ```yaml
694
+ **Metadata:**
695
+ - story: [STORY-XXX]
696
+ - version: [X.Y.Z]
697
+ - dependencies: [array of step IDs]
698
+ - breaking_changes: [array of changes]
699
+ - author: [name]
700
+ - created_at: [YYYY-MM-DD]
701
+ - updated_at: [YYYY-MM-DD]
702
+ ```
703
+
704
+ **Examples:**
705
+
706
+ ```yaml
707
+ **Metadata:**
708
+ - story: STORY-010.1
709
+ - version: 2.1.0
710
+ - dependencies: [Step 10]
711
+ - breaking_changes:
712
+ - Output format changed: added computedSpacing object
713
+ - Removed nested fallback (SMELL 1 fix)
714
+ - author: Brad Frost Clone
715
+ - created_at: 2025-11-10
716
+ - updated_at: 2025-11-13
717
+ ```
718
+
719
+ ---
720
+
721
+ ## Type System
722
+
723
+ ### Basic Types
724
+
725
+ ```yaml
726
+ string # Text
727
+ number # Number (integer or float)
728
+ boolean # true or false
729
+ null # Null value
730
+ any # Any type (avoid when possible)
731
+ ```
732
+
733
+ ### Complex Types
734
+
735
+ ```yaml
736
+ array # Array of items
737
+ array<string> # Array of strings
738
+ array<number> # Array of numbers
739
+
740
+ object # Generic object
741
+ object { key: type, key: type } # Object with defined keys
742
+ ```
743
+
744
+ ### Optional Types
745
+
746
+ ```yaml
747
+ string | null # String or null
748
+ object { key?: type } # Object with optional key (? suffix)
749
+ ```
750
+
751
+ ### Custom Types (Reference Schemas)
752
+
753
+ ```yaml
754
+ Brand # References schemas/Brand.json
755
+ FormatConfig # References schemas/FormatConfig.json
756
+ AdAnalysis # References schemas/AdAnalysis.json
757
+ ```
758
+
759
+ **Examples:**
760
+
761
+ ```yaml
762
+ - campo: adCopy
763
+ tipo: object { title: string, body: string, cta: string }
764
+
765
+ - campo: faces
766
+ tipo: array<object { top: number, left: number, bottom: number, right: number }>
767
+
768
+ - campo: ready_copy
769
+ tipo: object { title?: string, body?: string, cta?: string } | null
770
+
771
+ - campo: brand
772
+ tipo: Brand # References schemas/Brand.json
773
+ ```
774
+
775
+ ---
776
+
777
+ ## Validation Rules
778
+
779
+ ### Required Field Validation
780
+
781
+ ```javascript
782
+ function validateTask(task) {
783
+ const required = ['task', 'responsável', 'responsavel_type', 'atomic_layer', 'Entrada', 'Saída'];
784
+
785
+ for (const field of required) {
786
+ if (!task[field]) {
787
+ throw new Error(`Missing required field: ${field}`);
788
+ }
789
+ }
790
+
791
+ // Validate executor type
792
+ const validExecutors = ['Agente', 'Worker', 'Humano', 'Clone'];
793
+ if (!validExecutors.includes(task.responsavel_type)) {
794
+ throw new Error(`Invalid responsavel_type: ${task.responsavel_type}`);
795
+ }
796
+
797
+ // Validate atomic layer
798
+ const validLayers = ['Atom', 'Molecule', 'Organism', 'Template', 'Page', 'Config', 'Strategy', 'Content', 'Media', 'Layout', 'Analysis'];
799
+ if (!validLayers.includes(task.atomic_layer)) {
800
+ throw new Error(`Invalid atomic_layer: ${task.atomic_layer}`);
801
+ }
802
+
803
+ return true;
804
+ }
805
+ ```
806
+
807
+ ### Input/Output Validation
808
+
809
+ ```javascript
810
+ function validateInputOutput(io, type) {
811
+ const required = ['campo', 'tipo', 'origem', 'obrigatório'];
812
+
813
+ for (const item of io) {
814
+ for (const field of required) {
815
+ if (!item[field] && field !== 'origem') { // origem not required for output
816
+ throw new Error(`${type} missing required field: ${field}`);
817
+ }
818
+ }
819
+ }
820
+
821
+ return true;
822
+ }
823
+ ```
824
+
825
+ ---
826
+
827
+ ## Examples by Executor Type
828
+
829
+ ### Agente (AI-Powered)
830
+
831
+ ```yaml
832
+ #### Step 3: Analyze Brief
833
+
834
+ task: analyzeBrief()
835
+ responsável: Ad Strategist
836
+ responsavel_type: Agente
837
+ atomic_layer: Strategy
838
+
839
+ **Entrada:**
840
+ - campo: brief_text
841
+ tipo: string
842
+ origem: User Input (config)
843
+ obrigatório: true
844
+ validação: "length >= 50"
845
+
846
+ - campo: brand
847
+ tipo: Brand
848
+ origem: Step 2 (loadBrand)
849
+ obrigatório: true
850
+
851
+ - campo: ready_copy
852
+ tipo: object { title?, body?, cta? } | null
853
+ origem: User Input (config)
854
+ obrigatório: false
855
+ padrão: null
856
+
857
+ **Saída:**
858
+ - campo: adAnalysis
859
+ tipo: object { goal, targetAudience, urgencyLevel, emotionalTriggers, keyMessage }
860
+ destino: state (ad-spec.json)
861
+ persistido: true
862
+
863
+ **Checklist:**
864
+ pre-conditions:
865
+ - [ ] brief_text has minimum 50 characters
866
+ tipo: pre-condition
867
+ blocker: true
868
+ validação: "expect(brief_text.length).toBeGreaterThanOrEqual(50)"
869
+
870
+ post-conditions:
871
+ - [ ] adAnalysis contains all required fields
872
+ tipo: post-condition
873
+ blocker: true
874
+ validação: |
875
+ expect(adAnalysis.goal).toBeTruthy();
876
+ expect(adAnalysis.urgencyLevel).toMatch(/high|medium|low/);
877
+
878
+ acceptance-criteria:
879
+ - [ ] Analysis aligns with brand voice
880
+ tipo: acceptance
881
+ blocker: false
882
+ story: STORY-003
883
+ manual_check: false
884
+ test: "tests/brief-analysis-brand-alignment.test.js"
885
+
886
+ **Template:**
887
+ - path: Squads/instagram-content-creator/tasks/ads/analyze-ad-brief.md
888
+ type: prompt
889
+ version: 2.1.0
890
+ variables: [brief_text, brand_id, campaign_goal, ready_copy]
891
+
892
+ **Tools:**
893
+ - callAgent:
894
+ version: 1.0.0
895
+ used_for: Execute AI agent with retry
896
+ shared_with: [Step 4, Step 5, Step 6, Step 7, Step 8, Step 9, Step 11]
897
+
898
+ **Scripts:**
899
+ - N/A
900
+
901
+ **Performance:**
902
+ - duration_expected: 4000ms
903
+ - cost_estimated: $0.0025
904
+ - cacheable: false
905
+ - parallelizable: false
906
+ - skippable_when: [ready_copy=true]
907
+
908
+ **Error Handling:**
909
+ - strategy: fallback
910
+ - fallback: |
911
+ Use config.ready_copy as analysis if available.
912
+ Otherwise, use default analysis: { goal: "conversion", urgencyLevel: "medium", targetAudience: "general" }
913
+ - retry:
914
+ max_attempts: 3
915
+ backoff: exponential
916
+ backoff_ms: 1000
917
+ - abort_workflow: false
918
+ - notification: log
919
+
920
+ **Metadata:**
921
+ - story: STORY-003
922
+ - version: 2.0.0
923
+ - dependencies: [Step 2]
924
+ - breaking_changes: []
925
+ - author: Creative Team
926
+ - created_at: 2025-10-01
927
+ - updated_at: 2025-11-10
928
+ ```
929
+
930
+ ---
931
+
932
+ ### Worker (Script-Based)
933
+
934
+ ```yaml
935
+ #### Step 1: Load Format Configuration
936
+
937
+ task: loadFormatConfig()
938
+ responsável: format-loader.js
939
+ responsavel_type: Worker
940
+ atomic_layer: Config
941
+
942
+ **Entrada:**
943
+ - campo: format_id
944
+ tipo: string
945
+ origem: User Input (config)
946
+ obrigatório: true
947
+ validação: "format_id in ['instagram-stories', 'instagram-reels', 'instagram-feed-square', 'instagram-feed-portrait']"
948
+
949
+ - campo: orientation
950
+ tipo: string
951
+ origem: User Input (config)
952
+ obrigatório: false
953
+ padrão: "portrait"
954
+ validação: "orientation in ['portrait', 'landscape']"
955
+
956
+ **Saída:**
957
+ - campo: formatConfig
958
+ tipo: FormatConfig
959
+ destino: [Step 8, Step 10, Step 11, Step 12, Step 13, Step 14]
960
+ persistido: false
961
+
962
+ **Checklist:**
963
+ pre-conditions:
964
+ - [ ] format_id is valid
965
+ tipo: pre-condition
966
+ blocker: true
967
+ validação: |
968
+ const validFormats = ['instagram-stories', 'instagram-reels', 'instagram-feed-square', 'instagram-feed-portrait'];
969
+ if (!validFormats.includes(format_id)) {
970
+ throw new Error(`Invalid format_id: ${format_id}`);
971
+ }
972
+
973
+ post-conditions:
974
+ - [ ] formatConfig.safeZones are defined
975
+ tipo: post-condition
976
+ blocker: true
977
+ validação: |
978
+ expect(formatConfig.safeZones).toBeDefined();
979
+ expect(formatConfig.safeZones.top).toBeGreaterThan(0);
980
+
981
+ - [ ] formatConfig.contentArea.height calculated correctly
982
+ tipo: post-condition
983
+ blocker: true
984
+ validação: |
985
+ const expectedHeight = formatConfig.canvas.height - formatConfig.safeZones.top - formatConfig.safeZones.bottom;
986
+ expect(formatConfig.contentArea.height).toBe(expectedHeight);
987
+
988
+ **Template:**
989
+ - path: config/ad-formats.json
990
+ type: input
991
+ version: 1.0.0
992
+ variables: [format_id, orientation]
993
+ schema: schemas/FormatConfig.json
994
+
995
+ **Tools:**
996
+ - N/A
997
+
998
+ **Scripts:**
999
+ - scripts/utils/format-loader.js:
1000
+ description: Reads format JSON and calculates content area
1001
+ language: javascript
1002
+ version: 1.0.0
1003
+
1004
+ **Performance:**
1005
+ - duration_expected: 50ms
1006
+ - cost_estimated: $0
1007
+ - cacheable: true
1008
+ - cache_key: format_${format_id}_${orientation}
1009
+ - parallelizable: true
1010
+ - parallel_with: [Step 2]
1011
+ - skippable_when: []
1012
+
1013
+ **Error Handling:**
1014
+ - strategy: abort
1015
+ - retry:
1016
+ max_attempts: 2
1017
+ backoff: linear
1018
+ backoff_ms: 100
1019
+ - abort_workflow: true
1020
+ - notification: log + email
1021
+
1022
+ **Metadata:**
1023
+ - story: DECISION-02
1024
+ - version: 1.0.0
1025
+ - dependencies: []
1026
+ - breaking_changes: []
1027
+ - author: Brad Frost Clone
1028
+ - created_at: 2025-11-10
1029
+ - updated_at: 2025-11-10
1030
+ ```
1031
+
1032
+ ---
1033
+
1034
+ ### Humano (Manual Review)
1035
+
1036
+ ```yaml
1037
+ #### Step 15: Quality Review (Optional)
1038
+
1039
+ task: reviewAdQuality()
1040
+ responsável: Quality Assurance Team
1041
+ responsavel_type: Humano
1042
+ atomic_layer: Page
1043
+
1044
+ **Entrada:**
1045
+ - campo: final_ad_png
1046
+ tipo: string (file path)
1047
+ origem: Step 14 (exportPNG)
1048
+ obrigatório: true
1049
+
1050
+ - campo: ad_spec
1051
+ tipo: object (complete ad specification)
1052
+ origem: state (ad-spec.json)
1053
+ obrigatório: true
1054
+
1055
+ - campo: quality_criteria
1056
+ tipo: array<string>
1057
+ origem: config
1058
+ obrigatório: true
1059
+ padrão: ["brand_alignment", "text_legibility", "visual_appeal", "no_face_coverage"]
1060
+
1061
+ **Saída:**
1062
+ - campo: quality_review
1063
+ tipo: object { approved: boolean, score: number, feedback: string, reviewer: string }
1064
+ destino: state (ad-spec.json)
1065
+ persistido: true
1066
+
1067
+ **Checklist:**
1068
+ pre-conditions:
1069
+ - [ ] final_ad_png file exists
1070
+ tipo: pre-condition
1071
+ blocker: true
1072
+ validação: |
1073
+ const fs = require('fs');
1074
+ if (!fs.existsSync(final_ad_png)) {
1075
+ throw new Error(`Ad PNG not found: ${final_ad_png}`);
1076
+ }
1077
+
1078
+ acceptance-criteria:
1079
+ - [ ] Ad meets all quality criteria
1080
+ tipo: acceptance
1081
+ blocker: false
1082
+ story: STORY-QA
1083
+ manual_check: true
1084
+
1085
+ - [ ] Reviewer provided detailed feedback
1086
+ tipo: acceptance
1087
+ blocker: false
1088
+ story: STORY-QA
1089
+ manual_check: true
1090
+
1091
+ **Template:**
1092
+ - path: templates/ui-forms/quality-review-form.html
1093
+ type: ui
1094
+ version: 1.0.0
1095
+ variables: [final_ad_png, ad_spec, quality_criteria]
1096
+
1097
+ **Tools:**
1098
+ - N/A
1099
+
1100
+ **Scripts:**
1101
+ - N/A
1102
+
1103
+ **Performance:**
1104
+ - duration_expected: 180000ms # 3 minutes (manual review)
1105
+ - cost_estimated: $5 # Human labor cost
1106
+ - cacheable: false
1107
+ - parallelizable: false
1108
+ - skippable_when: [skip_qa=true, batch_mode=true]
1109
+
1110
+ **Error Handling:**
1111
+ - strategy: fallback
1112
+ - fallback: Auto-approve if reviewer doesn't respond within 10 minutes
1113
+ - retry:
1114
+ max_attempts: 1
1115
+ backoff: linear
1116
+ backoff_ms: 600000 # 10 minutes
1117
+ - abort_workflow: false
1118
+ - notification: slack
1119
+
1120
+ **Metadata:**
1121
+ - story: STORY-QA
1122
+ - version: 1.0.0
1123
+ - dependencies: [Step 14]
1124
+ - breaking_changes: []
1125
+ - author: QA Team
1126
+ - created_at: 2025-11-13
1127
+ - updated_at: 2025-11-13
1128
+ ```
1129
+
1130
+ ---
1131
+
1132
+ ### Clone (Mind Emulation)
1133
+
1134
+ ```yaml
1135
+ #### Step 7c: Validate Components (Brad Frost Clone)
1136
+
1137
+ task: validateComponentsAtomicDesign()
1138
+ responsável: Brad Frost Clone
1139
+ responsavel_type: Clone
1140
+ atomic_layer: Atom
1141
+
1142
+ **Entrada:**
1143
+ - campo: ctaComponent
1144
+ tipo: object { text, style, colors }
1145
+ origem: Step 7a (designCTAComponent)
1146
+ obrigatório: true
1147
+
1148
+ - campo: badgeComponent
1149
+ tipo: object { text, style, colors } | null
1150
+ origem: Step 7b (designBadgeComponent)
1151
+ obrigatório: false
1152
+
1153
+ **Saída:**
1154
+ - campo: validation_result
1155
+ tipo: object { valid: boolean, violations: array<object { rule, severity, message }> }
1156
+ destino: state (ad-spec.json)
1157
+ persistido: true
1158
+
1159
+ **Checklist:**
1160
+ pre-conditions:
1161
+ - [ ] ctaComponent exists
1162
+ tipo: pre-condition
1163
+ blocker: true
1164
+ validação: "expect(ctaComponent).toBeDefined()"
1165
+
1166
+ post-conditions:
1167
+ - [ ] No Atomic Design violations detected
1168
+ tipo: post-condition
1169
+ blocker: true
1170
+ validação: |
1171
+ if (!validation_result.valid) {
1172
+ const criticalViolations = validation_result.violations.filter(v => v.severity === 'critical');
1173
+ if (criticalViolations.length > 0) {
1174
+ throw new Error(`Atomic Design violations: ${criticalViolations.map(v => v.message).join(', ')}`);
1175
+ }
1176
+ }
1177
+
1178
+ - [ ] All components are context-agnostic (no positioning)
1179
+ tipo: post-condition
1180
+ blocker: true
1181
+ validação: |
1182
+ if (ctaComponent.position || ctaComponent.size) {
1183
+ throw new Error("CTA component has positioning data (DECISION-03 violation)");
1184
+ }
1185
+ if (badgeComponent && (badgeComponent.position || badgeComponent.size)) {
1186
+ throw new Error("Badge component has positioning data (DECISION-03 violation)");
1187
+ }
1188
+
1189
+ acceptance-criteria:
1190
+ - [ ] Components follow Brad Frost's Atomic Design principles
1191
+ tipo: acceptance
1192
+ blocker: false
1193
+ story: DECISION-03
1194
+ manual_check: false
1195
+
1196
+ **Clone Configuration:**
1197
+ - heuristics: clones/brad_frost/heuristics.yaml
1198
+ - axioms: clones/brad_frost/axioms.yaml
1199
+ - ai_fallback: true
1200
+
1201
+ **Tools:**
1202
+ - callAgent:
1203
+ version: 1.0.0
1204
+ used_for: AI validation when heuristics are inconclusive
1205
+ shared_with: [Step 3, Step 4, Step 5, Step 6, Step 7, Step 8, Step 9, Step 11]
1206
+
1207
+ - validateHeuristics:
1208
+ version: 1.0.0
1209
+ used_for: Apply Brad Frost's design heuristics
1210
+ shared_with: [Step 7c only]
1211
+
1212
+ - validateAxioms:
1213
+ version: 1.0.0
1214
+ used_for: Validate against Atomic Design axioms
1215
+ shared_with: [Step 7c only]
1216
+
1217
+ **Scripts:**
1218
+ - clones/brad_frost/validate-atomic-design.js:
1219
+ description: Atomic Design validation with heuristics + axioms
1220
+ language: javascript
1221
+ version: 1.0.0
1222
+
1223
+ **Performance:**
1224
+ - duration_expected: 1500ms
1225
+ - cost_estimated: $0.001 # Mostly heuristics, minimal AI
1226
+ - cacheable: false
1227
+ - parallelizable: false
1228
+ - skippable_when: [skip_validation=true]
1229
+
1230
+ **Error Handling:**
1231
+ - strategy: abort
1232
+ - fallback: N/A (validation must pass)
1233
+ - retry:
1234
+ max_attempts: 1
1235
+ backoff: linear
1236
+ backoff_ms: 0
1237
+ - abort_workflow: true
1238
+ - notification: log + slack
1239
+
1240
+ **Metadata:**
1241
+ - story: DECISION-03
1242
+ - version: 1.0.0
1243
+ - dependencies: [Step 7a, Step 7b]
1244
+ - breaking_changes: []
1245
+ - author: Brad Frost Clone
1246
+ - created_at: 2025-11-13
1247
+ - updated_at: 2025-11-13
1248
+ ```
1249
+
1250
+ ---
1251
+
1252
+ ## Validation Checklist
1253
+
1254
+ Use this checklist to validate any AIOS Task:
1255
+
1256
+ ### Required Fields
1257
+
1258
+ - [ ] `task` is defined and unique
1259
+ - [ ] `responsável` is defined
1260
+ - [ ] `responsavel_type` is one of: Agente, Worker, Humano, Clone
1261
+ - [ ] `atomic_layer` is defined (or explicitly marked N/A)
1262
+ - [ ] `Entrada` is defined (array, can be empty)
1263
+ - [ ] `Saída` is defined (array, can be empty)
1264
+
1265
+ ### Input/Output Quality
1266
+
1267
+ - [ ] All inputs have: campo, tipo, origem, obrigatório
1268
+ - [ ] All outputs have: campo, tipo, destino, persistido
1269
+ - [ ] Types are well-defined (not just "object" or "any")
1270
+ - [ ] Sources/destinations reference valid steps
1271
+
1272
+ ### Checklist Quality
1273
+
1274
+ - [ ] Pre-conditions validate inputs
1275
+ - [ ] Post-conditions validate outputs
1276
+ - [ ] Acceptance criteria link to Stories
1277
+ - [ ] Blocking conditions are appropriate
1278
+ - [ ] Validation logic is executable
1279
+
1280
+ ### Templates & Tools
1281
+
1282
+ - [ ] Template referenced (if applicable)
1283
+ - [ ] Tools cataloged (if applicable)
1284
+ - [ ] Scripts listed (if applicable)
1285
+ - [ ] All references are valid paths
1286
+
1287
+ ### Performance & Error Handling
1288
+
1289
+ - [ ] Duration expected is realistic
1290
+ - [ ] Cost estimated (for AI)
1291
+ - [ ] Cacheability considered
1292
+ - [ ] Parallelization opportunities identified
1293
+ - [ ] Error handling strategy defined
1294
+ - [ ] Retry logic appropriate
1295
+
1296
+ ### Metadata
1297
+
1298
+ - [ ] Story linked (if applicable)
1299
+ - [ ] Version defined
1300
+ - [ ] Dependencies listed
1301
+ - [ ] Breaking changes documented
1302
+
1303
+ ---
1304
+
1305
+ ## Migration Guide (v2.0 → v3.0)
1306
+
1307
+ ### Step 1: Add Missing Required Fields
1308
+
1309
+ ```yaml
1310
+ # BEFORE (v2.0 - incomplete)
1311
+ #### Step 3: Analyze Brief
1312
+
1313
+ task: analyzeBrief()
1314
+ responsável: Ad Strategist
1315
+
1316
+ **Entrada:**
1317
+ **Saída:**
1318
+
1319
+ # AFTER (v3.0 - complete)
1320
+ #### Step 3: Analyze Brief
1321
+
1322
+ task: analyzeBrief()
1323
+ responsável: Ad Strategist
1324
+ responsavel_type: Agente # ← ADDED
1325
+ atomic_layer: Strategy # ← ADDED
1326
+
1327
+ **Entrada:**
1328
+ - campo: brief_text
1329
+ tipo: string
1330
+ origem: User Input (config)
1331
+ obrigatório: true
1332
+
1333
+ **Saída:**
1334
+ - campo: adAnalysis
1335
+ tipo: object { ... }
1336
+ destino: state (ad-spec.json)
1337
+ persistido: true
1338
+ ```
1339
+
1340
+ ### Step 2: Structure Checklists
1341
+
1342
+ ```yaml
1343
+ # BEFORE (v2.0 - inline validations)
1344
+ **Validações:**
1345
+ - ✅ brief_text has minimum 50 characters
1346
+ - ✅ adAnalysis contains required fields
1347
+
1348
+ # AFTER (v3.0 - structured checklist)
1349
+ **Checklist:**
1350
+ pre-conditions:
1351
+ - [ ] brief_text has minimum 50 characters
1352
+ tipo: pre-condition
1353
+ blocker: true
1354
+ validação: "expect(brief_text.length).toBeGreaterThanOrEqual(50)"
1355
+
1356
+ post-conditions:
1357
+ - [ ] adAnalysis contains all required fields
1358
+ tipo: post-condition
1359
+ blocker: true
1360
+ validação: |
1361
+ expect(adAnalysis.goal).toBeTruthy();
1362
+ expect(adAnalysis.urgencyLevel).toMatch(/high|medium|low/);
1363
+ ```
1364
+
1365
+ ### Step 3: Add Performance Metrics
1366
+
1367
+ ```yaml
1368
+ # BEFORE (v2.0 - no metrics)
1369
+ (no performance section)
1370
+
1371
+ # AFTER (v3.0 - with metrics)
1372
+ **Performance:**
1373
+ - duration_expected: 4000ms
1374
+ - cost_estimated: $0.0025
1375
+ - cacheable: false
1376
+ - parallelizable: false
1377
+ - skippable_when: [ready_copy=true]
1378
+ ```
1379
+
1380
+ ### Step 4: Add Error Handling
1381
+
1382
+ ```yaml
1383
+ # BEFORE (v2.0 - implicit)
1384
+ (no error handling section)
1385
+
1386
+ # AFTER (v3.0 - explicit)
1387
+ **Error Handling:**
1388
+ - strategy: fallback
1389
+ - fallback: Use default analysis
1390
+ - retry:
1391
+ max_attempts: 3
1392
+ backoff: exponential
1393
+ backoff_ms: 1000
1394
+ - abort_workflow: false
1395
+ - notification: log
1396
+ ```
1397
+
1398
+ ---
1399
+
1400
+ ## Version History
1401
+
1402
+ | Version | Date | Author | Changes |
1403
+ |---------|------|--------|---------|
1404
+ | 1.0.0 | 2025-11-13 | Brad Frost Clone | Initial specification |
1405
+
1406
+ ---
1407
+
1408
+ **END OF TASK FORMAT SPECIFICATION**
1409
+
1410
+ **Related Documents:**
1411
+ - `EXECUTOR-DECISION-TREE.md` - How to choose executor type
1412
+ - `TEMPLATE-SYSTEM-GUIDE.md` - Template design patterns
1413
+ - `TOOLS-AND-SCRIPTS-CATALOG.md` - Available tools reference
1414
+