@girardelli/architect 2.2.0 → 4.0.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 (296) hide show
  1. package/README.md +105 -116
  2. package/__test_agent_output__/INDEX.md +1 -0
  3. package/__test_agent_output__/agents/AGENT-ORCHESTRATOR.md +1 -0
  4. package/__test_agent_output__/agents/DATABASE-ENGINEER.md +174 -0
  5. package/__test_agent_output__/agents/QA-TEST-ENGINEER.md +138 -0
  6. package/__test_agent_output__/agents/SECURITY-AUDITOR.md +106 -0
  7. package/__test_agent_output__/agents/TECH-DEBT-CONTROLLER.md +104 -0
  8. package/__test_agent_output__/agents/TYPESCRIPT-BACKEND-DEVELOPER.md +135 -0
  9. package/__test_agent_output__/guards/CODE-REVIEW-CHECKLIST.md +95 -0
  10. package/__test_agent_output__/guards/PREFLIGHT.md +200 -0
  11. package/__test_agent_output__/guards/QUALITY-GATES.md +1 -0
  12. package/__test_agent_output__/rules/00-general.md +229 -0
  13. package/__test_agent_output__/rules/01-architecture.md +191 -0
  14. package/__test_agent_output__/rules/02-security.md +402 -0
  15. package/__test_agent_output__/rules/03-nestjs.md +124 -0
  16. package/__test_agent_output__/templates/ADR.md +95 -0
  17. package/__test_agent_output__/templates/BDD.md +58 -0
  18. package/__test_agent_output__/templates/C4.md +68 -0
  19. package/__test_agent_output__/templates/TDD.md +86 -0
  20. package/__test_agent_output__/templates/THREAT-MODEL.md +82 -0
  21. package/__test_agent_output__/workflows/fix-bug.md +228 -0
  22. package/__test_agent_output__/workflows/new-feature.md +311 -0
  23. package/__test_agent_output__/workflows/review.md +95 -0
  24. package/__test_context_7RvUrO/src/modules/empty/empty.ts +0 -0
  25. package/__test_context_Rf5fNJ/src/modules/mixed/mixed.ts +5 -0
  26. package/__test_context_WRCnYH/src/modules/test/test.ts +10 -0
  27. package/__test_context_YsnVS3/src/modules/test/test.ts +10 -0
  28. package/__test_context_w7XZeH/src/modules/mixed/mixed.ts +5 -0
  29. package/__test_context_y5noh6/src/modules/empty/empty.ts +0 -0
  30. package/__test_framework__24OjAu/package.json +1 -0
  31. package/__test_framework__3ZDZsx/pyproject.toml +8 -0
  32. package/__test_framework__4T54Jn/package.json +1 -0
  33. package/__test_framework__4tlXu9/pyproject.toml +8 -0
  34. package/__test_framework__6boWqQ/Pipfile +6 -0
  35. package/__test_framework__6gygMU/pom.xml +10 -0
  36. package/__test_framework__6kxj0N/go.mod +8 -0
  37. package/__test_framework__7CEoXw/pom.xml +10 -0
  38. package/__test_framework__85DDz0/Pipfile +6 -0
  39. package/__test_framework__9WrRIr/pom.xml +7 -0
  40. package/__test_framework__ANqGKl/Gemfile +5 -0
  41. package/__test_framework__BCXTEM/go.mod +3 -0
  42. package/__test_framework__BHiPNq/setup.py +2 -0
  43. package/__test_framework__BqkiKv/package.json +1 -0
  44. package/__test_framework__C5yd8X/Pipfile.lock +1 -0
  45. package/__test_framework__C5yd8X/requirements.txt +1 -0
  46. package/__test_framework__C87d3a/manage.py +1 -0
  47. package/__test_framework__C87d3a/requirements.txt +2 -0
  48. package/__test_framework__DXNwc5/build.gradle +7 -0
  49. package/__test_framework__GhHSt3/build.gradle.kts +4 -0
  50. package/__test_framework__GzklJP/Cargo.toml +7 -0
  51. package/__test_framework__H4hd13/go.mod +8 -0
  52. package/__test_framework__HKjOXO/composer.json +1 -0
  53. package/__test_framework__HaDN45/Gemfile +3 -0
  54. package/__test_framework__IBO7YG/pyproject.toml +9 -0
  55. package/__test_framework__JwSOyF/pyproject.toml +6 -0
  56. package/__test_framework__K6HrCr/build.gradle +2 -0
  57. package/__test_framework__KzRPlh/pubspec.yaml +9 -0
  58. package/__test_framework__L6uIym/pyproject.toml +6 -0
  59. package/__test_framework__LOdoGK/requirements.txt +4 -0
  60. package/__test_framework__LgHzss/package.json +1 -0
  61. package/__test_framework__M76M6q/Gemfile +5 -0
  62. package/__test_framework__Mr9vWW/composer.json +1 -0
  63. package/__test_framework__N03Gnv/package.json +1 -0
  64. package/__test_framework__Num4UE/requirements +1 -0
  65. package/__test_framework__OAGw3Y/build.gradle +7 -0
  66. package/__test_framework__OQc8yG/pubspec.yaml +9 -0
  67. package/__test_framework__OwKZcd/requirements.txt +3 -0
  68. package/__test_framework__P0gFv7/requirements +1 -0
  69. package/__test_framework__PN55Rq/package.json +1 -0
  70. package/__test_framework__PQiqX8/pubspec.yaml +3 -0
  71. package/__test_framework__RBHsg7/composer.json +1 -0
  72. package/__test_framework__RHxif4/Cargo.toml +7 -0
  73. package/__test_framework__T0v0p1/Cargo.toml +4 -0
  74. package/__test_framework__Tu0clt/Pipfile.lock +1 -0
  75. package/__test_framework__Tu0clt/requirements.txt +1 -0
  76. package/__test_framework__TwDj9P/Cargo.toml +4 -0
  77. package/__test_framework__VQJNC4/pom.xml +7 -0
  78. package/__test_framework__W6sm05/package.json +1 -0
  79. package/__test_framework__W7vBLy/pyproject.toml +4 -0
  80. package/__test_framework__WNJOWT/setup.py +2 -0
  81. package/__test_framework__WSJs7U/package.json +1 -0
  82. package/__test_framework__YQ5VpA/build.gradle.kts +4 -0
  83. package/__test_framework__ZNEUEs/package.json +1 -0
  84. package/__test_framework__Znt922/pom.xml +7 -0
  85. package/__test_framework__azyg0h/pom.xml +7 -0
  86. package/__test_framework__c6otLr/package.json +1 -0
  87. package/__test_framework__cl9S9G/build.gradle +2 -0
  88. package/__test_framework__eilvV4/composer.json +1 -0
  89. package/__test_framework__gQZxXO/manage.py +1 -0
  90. package/__test_framework__gQZxXO/requirements.txt +2 -0
  91. package/__test_framework__ghvl26/poetry.lock +1 -0
  92. package/__test_framework__ghvl26/pyproject.toml +2 -0
  93. package/__test_framework__hR7b9U/Makefile +11 -0
  94. package/__test_framework__iESVsi/composer.json +1 -0
  95. package/__test_framework__jm6TJy/package.json +1 -0
  96. package/__test_framework__kBUpjs/pyproject.toml +9 -0
  97. package/__test_framework__kqoZrw/requirements.txt +4 -0
  98. package/__test_framework__lWkoyO/pyproject.toml +4 -0
  99. package/__test_framework__mTKnUO/package.json +1 -0
  100. package/__test_framework__nCeZwe/Makefile +11 -0
  101. package/__test_framework__oljsU0/package.json +1 -0
  102. package/__test_framework__osRG4q/go.mod +3 -0
  103. package/__test_framework__pCHH4F/package.json +1 -0
  104. package/__test_framework__pExx6E/Gemfile +3 -0
  105. package/__test_framework__pyBoGd/pyproject.toml +5 -0
  106. package/__test_framework__qw16VQ/package.json +1 -0
  107. package/__test_framework__rRayrG/package.json +1 -0
  108. package/__test_framework__s82zO5/package.json +1 -0
  109. package/__test_framework__tp8MFK/pyproject.toml +5 -0
  110. package/__test_framework__w44k4w/composer.json +1 -0
  111. package/__test_framework__yefPZY/poetry.lock +1 -0
  112. package/__test_framework__yefPZY/pyproject.toml +2 -0
  113. package/__test_framework__zCiyDT/requirements.txt +3 -0
  114. package/__test_framework__zGZN3j/pubspec.yaml +3 -0
  115. package/__test_framework__zXpnxL/package.json +1 -0
  116. package/architect-run.sh +431 -0
  117. package/assets/banner-v3.html +561 -0
  118. package/dist/agent-generator/context-enricher.d.ts +58 -0
  119. package/dist/agent-generator/context-enricher.d.ts.map +1 -0
  120. package/dist/agent-generator/context-enricher.js +581 -0
  121. package/dist/agent-generator/context-enricher.js.map +1 -0
  122. package/dist/agent-generator/domain-inferrer.d.ts +52 -0
  123. package/dist/agent-generator/domain-inferrer.d.ts.map +1 -0
  124. package/dist/agent-generator/domain-inferrer.js +575 -0
  125. package/dist/agent-generator/domain-inferrer.js.map +1 -0
  126. package/dist/agent-generator/framework-detector.d.ts +40 -0
  127. package/dist/agent-generator/framework-detector.d.ts.map +1 -0
  128. package/dist/agent-generator/framework-detector.js +611 -0
  129. package/dist/agent-generator/framework-detector.js.map +1 -0
  130. package/dist/agent-generator/index.d.ts +33 -0
  131. package/dist/agent-generator/index.d.ts.map +1 -0
  132. package/dist/agent-generator/index.js +477 -0
  133. package/dist/agent-generator/index.js.map +1 -0
  134. package/dist/agent-generator/stack-detector.d.ts +12 -0
  135. package/dist/agent-generator/stack-detector.d.ts.map +1 -0
  136. package/dist/agent-generator/stack-detector.js +128 -0
  137. package/dist/agent-generator/stack-detector.js.map +1 -0
  138. package/dist/agent-generator/templates/core/agents.d.ts +17 -0
  139. package/dist/agent-generator/templates/core/agents.d.ts.map +1 -0
  140. package/dist/agent-generator/templates/core/agents.js +1252 -0
  141. package/dist/agent-generator/templates/core/agents.js.map +1 -0
  142. package/dist/agent-generator/templates/core/architecture-rules.d.ts +7 -0
  143. package/dist/agent-generator/templates/core/architecture-rules.d.ts.map +1 -0
  144. package/dist/agent-generator/templates/core/architecture-rules.js +274 -0
  145. package/dist/agent-generator/templates/core/architecture-rules.js.map +1 -0
  146. package/dist/agent-generator/templates/core/general-rules.d.ts +8 -0
  147. package/dist/agent-generator/templates/core/general-rules.d.ts.map +1 -0
  148. package/dist/agent-generator/templates/core/general-rules.js +301 -0
  149. package/dist/agent-generator/templates/core/general-rules.js.map +1 -0
  150. package/dist/agent-generator/templates/core/index-md.d.ts +7 -0
  151. package/dist/agent-generator/templates/core/index-md.d.ts.map +1 -0
  152. package/dist/agent-generator/templates/core/index-md.js +246 -0
  153. package/dist/agent-generator/templates/core/index-md.js.map +1 -0
  154. package/dist/agent-generator/templates/core/orchestrator.d.ts +8 -0
  155. package/dist/agent-generator/templates/core/orchestrator.d.ts.map +1 -0
  156. package/dist/agent-generator/templates/core/orchestrator.js +422 -0
  157. package/dist/agent-generator/templates/core/orchestrator.js.map +1 -0
  158. package/dist/agent-generator/templates/core/preflight.d.ts +8 -0
  159. package/dist/agent-generator/templates/core/preflight.d.ts.map +1 -0
  160. package/dist/agent-generator/templates/core/preflight.js +213 -0
  161. package/dist/agent-generator/templates/core/preflight.js.map +1 -0
  162. package/dist/agent-generator/templates/core/quality-gates.d.ts +11 -0
  163. package/dist/agent-generator/templates/core/quality-gates.d.ts.map +1 -0
  164. package/dist/agent-generator/templates/core/quality-gates.js +254 -0
  165. package/dist/agent-generator/templates/core/quality-gates.js.map +1 -0
  166. package/dist/agent-generator/templates/core/security-rules.d.ts +7 -0
  167. package/dist/agent-generator/templates/core/security-rules.d.ts.map +1 -0
  168. package/dist/agent-generator/templates/core/security-rules.js +528 -0
  169. package/dist/agent-generator/templates/core/security-rules.js.map +1 -0
  170. package/dist/agent-generator/templates/core/skills-generator.d.ts +6 -0
  171. package/dist/agent-generator/templates/core/skills-generator.d.ts.map +1 -0
  172. package/dist/agent-generator/templates/core/skills-generator.js +207 -0
  173. package/dist/agent-generator/templates/core/skills-generator.js.map +1 -0
  174. package/dist/agent-generator/templates/core/workflow-fix-bug.d.ts +7 -0
  175. package/dist/agent-generator/templates/core/workflow-fix-bug.d.ts.map +1 -0
  176. package/dist/agent-generator/templates/core/workflow-fix-bug.js +237 -0
  177. package/dist/agent-generator/templates/core/workflow-fix-bug.js.map +1 -0
  178. package/dist/agent-generator/templates/core/workflow-new-feature.d.ts +8 -0
  179. package/dist/agent-generator/templates/core/workflow-new-feature.d.ts.map +1 -0
  180. package/dist/agent-generator/templates/core/workflow-new-feature.js +321 -0
  181. package/dist/agent-generator/templates/core/workflow-new-feature.js.map +1 -0
  182. package/dist/agent-generator/templates/core/workflow-review.d.ts +7 -0
  183. package/dist/agent-generator/templates/core/workflow-review.d.ts.map +1 -0
  184. package/dist/agent-generator/templates/core/workflow-review.js +104 -0
  185. package/dist/agent-generator/templates/core/workflow-review.js.map +1 -0
  186. package/dist/agent-generator/templates/domain/index.d.ts +22 -0
  187. package/dist/agent-generator/templates/domain/index.d.ts.map +1 -0
  188. package/dist/agent-generator/templates/domain/index.js +1176 -0
  189. package/dist/agent-generator/templates/domain/index.js.map +1 -0
  190. package/dist/agent-generator/templates/stack/index.d.ts +8 -0
  191. package/dist/agent-generator/templates/stack/index.d.ts.map +1 -0
  192. package/dist/agent-generator/templates/stack/index.js +695 -0
  193. package/dist/agent-generator/templates/stack/index.js.map +1 -0
  194. package/dist/agent-generator/templates/template-helpers.d.ts +75 -0
  195. package/dist/agent-generator/templates/template-helpers.d.ts.map +1 -0
  196. package/dist/agent-generator/templates/template-helpers.js +726 -0
  197. package/dist/agent-generator/templates/template-helpers.js.map +1 -0
  198. package/dist/agent-generator/types.d.ts +196 -0
  199. package/dist/agent-generator/types.d.ts.map +1 -0
  200. package/dist/agent-generator/types.js +27 -0
  201. package/dist/agent-generator/types.js.map +1 -0
  202. package/dist/analyzer.d.ts +5 -0
  203. package/dist/analyzer.d.ts.map +1 -1
  204. package/dist/analyzer.js +35 -4
  205. package/dist/analyzer.js.map +1 -1
  206. package/dist/analyzers/forecast.d.ts +85 -0
  207. package/dist/analyzers/forecast.d.ts.map +1 -0
  208. package/dist/analyzers/forecast.js +337 -0
  209. package/dist/analyzers/forecast.js.map +1 -0
  210. package/dist/analyzers/git-cache.d.ts +7 -0
  211. package/dist/analyzers/git-cache.d.ts.map +1 -0
  212. package/dist/analyzers/git-cache.js +41 -0
  213. package/dist/analyzers/git-cache.js.map +1 -0
  214. package/dist/analyzers/git-history.d.ts +113 -0
  215. package/dist/analyzers/git-history.d.ts.map +1 -0
  216. package/dist/analyzers/git-history.js +333 -0
  217. package/dist/analyzers/git-history.js.map +1 -0
  218. package/dist/analyzers/index.d.ts +10 -0
  219. package/dist/analyzers/index.d.ts.map +1 -0
  220. package/dist/analyzers/index.js +7 -0
  221. package/dist/analyzers/index.js.map +1 -0
  222. package/dist/analyzers/temporal-scorer.d.ts +72 -0
  223. package/dist/analyzers/temporal-scorer.d.ts.map +1 -0
  224. package/dist/analyzers/temporal-scorer.js +140 -0
  225. package/dist/analyzers/temporal-scorer.js.map +1 -0
  226. package/dist/cli.d.ts +2 -3
  227. package/dist/cli.d.ts.map +1 -1
  228. package/dist/cli.js +275 -113
  229. package/dist/cli.js.map +1 -1
  230. package/dist/html-reporter.d.ts +3 -1
  231. package/dist/html-reporter.d.ts.map +1 -1
  232. package/dist/html-reporter.js +248 -12
  233. package/dist/html-reporter.js.map +1 -1
  234. package/dist/index.d.ts +16 -3
  235. package/dist/index.d.ts.map +1 -1
  236. package/dist/index.js +63 -4
  237. package/dist/index.js.map +1 -1
  238. package/dist/project-summarizer.d.ts +18 -0
  239. package/dist/project-summarizer.d.ts.map +1 -0
  240. package/dist/project-summarizer.js +306 -0
  241. package/dist/project-summarizer.js.map +1 -0
  242. package/dist/refactor-reporter.js +1 -1
  243. package/dist/types.d.ts +13 -0
  244. package/dist/types.d.ts.map +1 -1
  245. package/package.json +12 -3
  246. package/src/agent-generator/context-enricher.ts +643 -0
  247. package/src/agent-generator/domain-inferrer.ts +625 -0
  248. package/src/agent-generator/framework-detector.ts +669 -0
  249. package/src/agent-generator/index.ts +555 -0
  250. package/src/agent-generator/stack-detector.ts +103 -0
  251. package/src/agent-generator/templates/core/agents.ts +1293 -0
  252. package/src/agent-generator/templates/core/architecture-rules.ts +287 -0
  253. package/src/agent-generator/templates/core/general-rules.ts +306 -0
  254. package/src/agent-generator/templates/core/index-md.ts +260 -0
  255. package/src/agent-generator/templates/core/orchestrator.ts +459 -0
  256. package/src/agent-generator/templates/core/preflight.ts +215 -0
  257. package/src/agent-generator/templates/core/quality-gates.ts +256 -0
  258. package/src/agent-generator/templates/core/security-rules.ts +543 -0
  259. package/src/agent-generator/templates/core/skills-generator.ts +236 -0
  260. package/src/agent-generator/templates/core/workflow-fix-bug.ts +239 -0
  261. package/src/agent-generator/templates/core/workflow-new-feature.ts +323 -0
  262. package/src/agent-generator/templates/core/workflow-review.ts +106 -0
  263. package/src/agent-generator/templates/domain/index.ts +1201 -0
  264. package/src/agent-generator/templates/stack/index.ts +705 -0
  265. package/src/agent-generator/templates/template-helpers.ts +776 -0
  266. package/src/agent-generator/types.ts +232 -0
  267. package/src/analyzer.ts +38 -4
  268. package/src/analyzers/forecast.ts +496 -0
  269. package/src/analyzers/git-cache.ts +52 -0
  270. package/src/analyzers/git-history.ts +488 -0
  271. package/src/analyzers/index.ts +33 -0
  272. package/src/analyzers/temporal-scorer.ts +227 -0
  273. package/src/cli.ts +316 -117
  274. package/src/html-reporter.ts +263 -13
  275. package/src/index.ts +92 -9
  276. package/src/project-summarizer.ts +347 -0
  277. package/src/refactor-reporter.ts +1 -1
  278. package/src/types.ts +10 -0
  279. package/tests/agent-generator.test.ts +411 -0
  280. package/tests/analyzers-integration.test.ts +174 -0
  281. package/tests/architect-adapter-enrichment.test.ts +9 -0
  282. package/tests/context-enricher.test.ts +971 -0
  283. package/tests/forecast.test.ts +509 -0
  284. package/tests/framework-detector.test.ts +1172 -0
  285. package/tests/git-history.test.ts +254 -0
  286. package/tests/scanner.test.ts +7 -8
  287. package/tests/scorer.test.ts +588 -0
  288. package/tests/stack-detector.test.ts +241 -0
  289. package/tests/template-generation.test.ts +706 -0
  290. package/tests/template-helpers.test.ts +1152 -0
  291. package/tests/temporal-scorer.test.ts +307 -0
  292. package/dist/agent-generator.d.ts +0 -106
  293. package/dist/agent-generator.d.ts.map +0 -1
  294. package/dist/agent-generator.js +0 -1398
  295. package/dist/agent-generator.js.map +0 -1
  296. package/src/agent-generator.ts +0 -1526
@@ -0,0 +1,246 @@
1
+ /**
2
+ * Generates enterprise-grade INDEX.md — master navigation guide for the agent framework.
3
+ * ~350+ lines with: mandatory reads, situational guide, agent catalog, templates, flow diagram.
4
+ */
5
+ export function generateIndexMd(ctx) {
6
+ const { report, stack, projectName, stackLabel, plan, config } = ctx;
7
+ const agents = buildAgentCatalog(ctx);
8
+ const situationalGuide = buildSituationalGuide(ctx);
9
+ const templates = buildTemplatesCatalog();
10
+ return `# ${projectName} — Agent Framework
11
+
12
+ > **Auto-generated by [Architect v3.1](https://github.com/camilooscargbaptista/architect)**
13
+ > Stack: **${stackLabel}** | Score: **${report.score.overall}/100** | Files: **${report.projectInfo.totalFiles}** | Lines: **${report.projectInfo.totalLines.toLocaleString()}**
14
+
15
+ ---
16
+
17
+ ## ⛔ PARE AQUI — LEITURA OBRIGATÓRIA
18
+
19
+ > **Antes de qualquer ação, leia estes documentos NA ORDEM.**
20
+ > Pular esta etapa é violação do protocolo.
21
+
22
+ | # | Arquivo | O que contém | Quando ler |
23
+ |---|---------|-------------|-----------|
24
+ | 1 | [00-general.md](./rules/00-general.md) | Regras de Ouro, convenções, identidade do projeto | **SEMPRE** |
25
+ | 2 | [PREFLIGHT.md](./guards/PREFLIGHT.md) | Checklist pré-ação por camada | **SEMPRE** |
26
+ | 3 | [QUALITY-GATES.md](./guards/QUALITY-GATES.md) | Métricas mínimas, blockers, processo de verificação | **SEMPRE** |
27
+ | 4 | [CODE-REVIEW-CHECKLIST.md](./guards/CODE-REVIEW-CHECKLIST.md) | Pontos obrigatórios de revisão | Antes de PR |
28
+
29
+ ---
30
+
31
+ ## 🗺️ Guia Situacional
32
+
33
+ > **"O que vou fazer?"** → Siga a coluna correspondente.
34
+
35
+ ${situationalGuide}
36
+
37
+ ---
38
+
39
+ ## 🤖 Agentes Disponíveis
40
+
41
+ ${agents}
42
+
43
+ ---
44
+
45
+ ## 📋 Templates Disponíveis
46
+
47
+ ${templates}
48
+
49
+ ---
50
+
51
+ ## 📁 Estrutura do Framework
52
+
53
+ \`\`\`
54
+ .agent/
55
+ ├── INDEX.md ← VOCÊ ESTÁ AQUI
56
+ ├── agents/ → Agentes especializados
57
+ │ ├── AGENT-ORCHESTRATOR.md
58
+ ${stack.hasBackend ? `│ ├── ${stack.primary.toUpperCase()}-BACKEND-DEVELOPER.md\n` : ''}${stack.hasFrontend ? `│ ├── FRONTEND-DEVELOPER.md\n` : ''}${stack.hasMobile ? `│ ├── FLUTTER-UI-DEVELOPER.md\n` : ''}${stack.hasDatabase ? `│ ├── DATABASE-ENGINEER.md\n` : ''}│ ├── SECURITY-AUDITOR.md
59
+ │ ├── QA-TEST-ENGINEER.md
60
+ │ └── TECH-DEBT-CONTROLLER.md
61
+ ├── rules/ → Regras de codificação
62
+ │ ├── 00-general.md
63
+ │ ├── 01-architecture.md
64
+ │ └── 02-security.md
65
+ ├── guards/ → Checklists e quality gates
66
+ │ ├── PREFLIGHT.md
67
+ │ ├── QUALITY-GATES.md
68
+ │ └── CODE-REVIEW-CHECKLIST.md
69
+ ├── workflows/ → Fluxos de trabalho
70
+ │ ├── new-feature.md
71
+ │ ├── fix-bug.md
72
+ │ └── review.md
73
+ ├── templates/ → Templates reutilizáveis
74
+ │ ├── C4.md
75
+ │ ├── BDD.md
76
+ │ ├── TDD.md
77
+ │ ├── ADR.md
78
+ │ └── THREAT-MODEL.md
79
+ └── skills/ → Padrões e referências
80
+ \`\`\`
81
+
82
+ ---
83
+
84
+ ## 🔄 Fluxo Completo de Desenvolvimento
85
+
86
+ \`\`\`
87
+ REQUISIÇÃO RECEBIDA
88
+
89
+
90
+ ┌──────────────────┐
91
+ │ PREFLIGHT.md │ ← Ler OBRIGATÓRIO
92
+ │ (diagnóstico) │
93
+ └────────┬─────────┘
94
+
95
+
96
+ ┌──────────────────┐
97
+ │ ORCHESTRATOR │ ← Decompõe a requisição
98
+ │ (classificar) │
99
+ └────────┬─────────┘
100
+
101
+
102
+ ┌──────────────────────────────────────┐
103
+ │ 6 GATES OBRIGATÓRIOS │
104
+ │ │
105
+ │ 1. MOCKUP (se tem UI) │
106
+ │ 2. User Stories │
107
+ │ 3. Arquitetura (C4) │
108
+ │ 4. Tarefas (breakdown) │
109
+ │ 5. BDD (cenários) │
110
+ │ 6. TDD (casos de teste) │
111
+ │ │
112
+ │ ⚠️ /approved após cada gate │
113
+ └────────┬─────────────────────────────┘
114
+
115
+
116
+ ┌──────────────────────────────────────┐
117
+ │ IMPLEMENTAÇÃO (ordenada) │
118
+ │ │
119
+ │ 1° Backend (se houver) │
120
+ │ 2° Documento de Integração │
121
+ │ 3° Frontend / App (se houver) │
122
+ └────────┬─────────────────────────────┘
123
+
124
+
125
+ ┌──────────────────┐
126
+ │ QUALITY-GATES │ ← Build + Coverage ≥ ${config.coverageMinimum}%
127
+ │ (verificação) │
128
+ └────────┬─────────┘
129
+
130
+
131
+ ┌──────────────────┐
132
+ │ CODE REVIEW │ ← Checklist obrigatório
133
+ │ (PR) │
134
+ └────────┬─────────┘
135
+
136
+
137
+ ✅ DONE
138
+ \`\`\`
139
+
140
+ ---
141
+
142
+ ## ⚡ Atalhos Rápidos
143
+
144
+ | Situação | Comando / Workflow |
145
+ |----------|-------------------|
146
+ | Nova feature | \`/new-feature\` → [workflow](./workflows/new-feature.md) |
147
+ | Corrigir bug | \`/fix-bug\` → [workflow](./workflows/fix-bug.md) |
148
+ | Code review | \`/review\` → [workflow](./workflows/review.md) |
149
+ | Verificar qualidade | \`architect score ./src\` |
150
+ | Analisar arquitetura | \`architect analyze ./src\` |
151
+
152
+ ---
153
+
154
+ ## 🔌 Plugin Recomendado
155
+
156
+ Para análise contínua de arquitetura e manutenção do score:
157
+
158
+ \`\`\`
159
+ ┌─────────────────────────────────────────────┐
160
+ │ 📦 @girardelli/architect │
161
+ │ Plugin para Claude Code │
162
+ │ │
163
+ │ npm install -g @girardelli/architect │
164
+ │ │
165
+ │ Comandos: │
166
+ │ • architect analyze ./src │
167
+ │ • architect score ./src │
168
+ │ • architect agents ./src │
169
+ │ • architect refactor ./src │
170
+ │ │
171
+ │ Score atual: ${String(report.score.overall).padEnd(2)}/100 │
172
+ │ Meta: ${String(Math.min(100, report.score.overall + 10)).padEnd(3)}/100 │
173
+ └─────────────────────────────────────────────┘
174
+ \`\`\`
175
+
176
+ ---
177
+
178
+ ## ⚠️ REGRA DE OURO
179
+
180
+ > **Na dúvida, PARA e PERGUNTA ao humano.**
181
+ > Nunca assuma. Nunca decida sozinho. Sempre valide.
182
+
183
+ ---
184
+
185
+ **Gerado por Architect v3.1 · Score: ${report.score.overall}/100 · ${new Date().toISOString().split('T')[0]}**
186
+ `;
187
+ }
188
+ function buildAgentCatalog(ctx) {
189
+ const { stack } = ctx;
190
+ const rows = [];
191
+ rows.push('| Agente | Role | Capabilities |');
192
+ rows.push('|--------|------|-------------|');
193
+ rows.push('| [AGENT-ORCHESTRATOR](./agents/AGENT-ORCHESTRATOR.md) | coordination | Decomposição, dispatch, consolidação, quality gate |');
194
+ if (stack.hasBackend) {
195
+ rows.push(`| [${stack.primary.toUpperCase()}-BACKEND-DEVELOPER](./agents/${stack.primary.toUpperCase()}-BACKEND-DEVELOPER.md) | development | APIs, serviços, lógica de negócio, migrations |`);
196
+ }
197
+ if (stack.hasFrontend) {
198
+ const fw = stack.frameworks.find(f => ['Angular', 'Vue', 'Next.js', 'React'].includes(f)) || 'FRONTEND';
199
+ rows.push(`| [${fw.toUpperCase().replace('.', '')}-FRONTEND-DEVELOPER](./agents/${fw.toUpperCase().replace('.', '')}-FRONTEND-DEVELOPER.md) | development | Componentes, state management, UX responsiva |`);
200
+ }
201
+ if (stack.hasMobile) {
202
+ rows.push('| [FLUTTER-UI-DEVELOPER](./agents/FLUTTER-UI-DEVELOPER.md) | development | Screens, widgets, navegação, integração API |');
203
+ }
204
+ if (stack.hasDatabase) {
205
+ rows.push('| [DATABASE-ENGINEER](./agents/DATABASE-ENGINEER.md) | development | Schema, migrations, indexação, performance |');
206
+ }
207
+ rows.push('| [SECURITY-AUDITOR](./agents/SECURITY-AUDITOR.md) | quality | Ameaças STRIDE, OWASP, LGPD, vulnerabilidades |');
208
+ rows.push('| [QA-TEST-ENGINEER](./agents/QA-TEST-ENGINEER.md) | quality | Planos de teste, BDD/TDD, cobertura, regressão |');
209
+ rows.push('| [TECH-DEBT-CONTROLLER](./agents/TECH-DEBT-CONTROLLER.md) | governance | Débito técnico, refatorações, metas de score |');
210
+ return rows.join('\n');
211
+ }
212
+ function buildSituationalGuide(ctx) {
213
+ const { stack } = ctx;
214
+ const rows = [];
215
+ rows.push('| Ação | Leia antes | Workflow | Agente principal |');
216
+ rows.push('|------|-----------|---------|-----------------|');
217
+ rows.push('| Nova feature | 00-general + PREFLIGHT | [new-feature](./workflows/new-feature.md) | ORCHESTRATOR |');
218
+ rows.push('| Corrigir bug | 00-general + PREFLIGHT | [fix-bug](./workflows/fix-bug.md) | ORCHESTRATOR |');
219
+ if (stack.hasBackend) {
220
+ rows.push(`| Mexer em backend | 00-general + 01-architecture | new-feature ou fix-bug | ${stack.primary.toUpperCase()}-BACKEND |`);
221
+ }
222
+ if (stack.hasFrontend) {
223
+ rows.push('| Mexer em frontend | 00-general + 01-architecture | new-feature ou fix-bug | FRONTEND |');
224
+ }
225
+ if (stack.hasMobile) {
226
+ rows.push('| Mexer no app | 00-general | new-feature ou fix-bug | FLUTTER-UI |');
227
+ }
228
+ if (stack.hasDatabase) {
229
+ rows.push('| Mexer em banco | 00-general + 01-architecture | new-feature | DATABASE-ENGINEER |');
230
+ }
231
+ rows.push('| Segurança | 02-security | — | SECURITY-AUDITOR |');
232
+ rows.push('| Testes | 00-general | — | QA-TEST-ENGINEER |');
233
+ rows.push('| Refatoração | QUALITY-GATES | — | TECH-DEBT-CONTROLLER |');
234
+ rows.push('| Code review | CODE-REVIEW-CHECKLIST | [review](./workflows/review.md) | QA-TEST-ENGINEER |');
235
+ return rows.join('\n');
236
+ }
237
+ function buildTemplatesCatalog() {
238
+ return `| Template | Arquivo | Quando usar |
239
+ |----------|---------|-----------|
240
+ | C4 Architecture | [C4.md](./templates/C4.md) | Documentar arquitetura de qualquer feature |
241
+ | BDD Scenarios | [BDD.md](./templates/BDD.md) | Antes de implementar — cenários de aceite |
242
+ | TDD Cases | [TDD.md](./templates/TDD.md) | Antes de implementar — casos de teste |
243
+ | ADR | [ADR.md](./templates/ADR.md) | Decisões arquiteturais significativas |
244
+ | Threat Model | [THREAT-MODEL.md](./templates/THREAT-MODEL.md) | Features que lidam com dados sensíveis |`;
245
+ }
246
+ //# sourceMappingURL=index-md.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-md.js","sourceRoot":"","sources":["../../../../src/agent-generator/templates/core/index-md.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,GAAoB;IAClD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAErE,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;I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G,CAAC;AAC5G,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { TemplateContext, EnrichedTemplateContext } from '../../types.js';
2
+ /**
3
+ * Generates enterprise-grade AGENT-ORCHESTRATOR.md
4
+ * ~800+ lines: 5-phase protocol, mandatory artifact gates, business interrogation,
5
+ * parallel dispatch, C4/BDD/TDD inline templates, risk matrix, implementation order.
6
+ */
7
+ export declare function generateOrchestrator(ctx: TemplateContext | EnrichedTemplateContext): string;
8
+ //# sourceMappingURL=orchestrator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../../src/agent-generator/templates/core/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAgB1E;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,eAAe,GAAG,uBAAuB,GAAG,MAAM,CA6U3F"}
@@ -0,0 +1,422 @@
1
+ import { isEnriched, depthAtLeast, domainBadge, complianceBadges, depthIndicator, modulesSummaryTable, integrationsSummary, frameworkBadge, toolchainCommands, projectStructureBadge, } from '../template-helpers.js';
2
+ /**
3
+ * Generates enterprise-grade AGENT-ORCHESTRATOR.md
4
+ * ~800+ lines: 5-phase protocol, mandatory artifact gates, business interrogation,
5
+ * parallel dispatch, C4/BDD/TDD inline templates, risk matrix, implementation order.
6
+ */
7
+ export function generateOrchestrator(ctx) {
8
+ const { report, stack, projectName, stackLabel, plan, config } = ctx;
9
+ const layers = report.layers.map(l => l.name).join(', ') || 'Not detected';
10
+ const antiPatterns = report.antiPatterns.map(a => `${a.name} (${a.severity})`).join(', ') || 'None';
11
+ const agentDispatch = buildAgentDispatch(ctx);
12
+ const businessQuestions = buildBusinessQuestions(ctx);
13
+ // Extract toolchain commands for Quality Gates (dynamic per-stack)
14
+ const enrichedCtx = isEnriched(ctx) ? ctx : null;
15
+ const buildCmd = enrichedCtx?.toolchain?.buildCmd || 'npm run build';
16
+ const testCmd = enrichedCtx?.toolchain?.testCmd || 'npm run test';
17
+ return `---
18
+ antigravity:
19
+ trigger: 'always_on'
20
+ globs: ['**/*']
21
+ description: 'META-AGENT ORQUESTRADOR — Centro de comando para ${projectName}'
22
+ priority: CRITICAL
23
+ agent_card:
24
+ id: 'orchestrator'
25
+ name: 'Agent Orchestrator'
26
+ role: 'coordination'
27
+ capabilities: [request-decomposition, agent-dispatch, plan-consolidation, quality-verification, artifact-gating]
28
+ inputs: [user-story, feature-request, bug-report, refactoring-request]
29
+ outputs: [consolidated-plan, implementation-blocks, effort-estimate, architecture-docs]
30
+ depends_on: []
31
+ version: 3.1.0
32
+ ---
33
+
34
+ # 🎭 AGENT-ORCHESTRATOR: ${projectName}
35
+
36
+ > **Centro de comando.** Toda requisição passa por aqui.
37
+ > **Nenhuma linha de código é escrita sem os artefatos obrigatórios.**
38
+
39
+ ---
40
+
41
+ ## ⛔ REGRA ABSOLUTA: ARTEFATOS ANTES DE CÓDIGO
42
+
43
+ \`\`\`
44
+ ╔══════════════════════════════════════════════════════════════╗
45
+ ║ ║
46
+ ║ ANTES de escrever QUALQUER linha de código, os seguintes ║
47
+ ║ artefatos DEVEM existir e ser APROVADOS pelo humano: ║
48
+ ║ ║
49
+ ║ 1. 🎨 MOCKUP (se tem UI) ║
50
+ ║ → Todas as telas, estados, erros, modais, mensagens ║
51
+ ║ → Seguir padrão visual do sistema ║
52
+ ║ ║
53
+ ║ 2. 📖 USER STORIES ║
54
+ ║ → Como [ator], quero [ação], para [benefício] ║
55
+ ║ → Critérios de aceite mensuráveis ║
56
+ ║ ║
57
+ ║ 3. 🏗️ ARQUITETURA (C4) ║
58
+ ║ → Contexto, Container, Componente, Código ║
59
+ ║ → Decisões arquiteturais (ADR) ║
60
+ ║ ║
61
+ ║ 4. 📋 TAREFAS ║
62
+ ║ → Breakdown com TASK-XXX ║
63
+ ║ → Estimativa T-shirt (XS/S/M/L/XL) ║
64
+ ║ ║
65
+ ║ 5. 🧪 BDD (cenários) ║
66
+ ║ → Given/When/Then para cada critério de aceite ║
67
+ ║ ║
68
+ ║ 6. 🔬 TDD (casos de teste) ║
69
+ ║ → RED → GREEN → REFACTOR ║
70
+ ║ → Cobertura mínima: ${config.coverageMinimum}% ║
71
+ ║ ║
72
+ ║ ⚠️ PRODUZIR APENAS UM IMPLEMENTATION PLAN SEM ESTES ║
73
+ ║ ARTEFATOS É VIOLAÇÃO DO PROTOCOLO. ║
74
+ ║ ║
75
+ ║ ORDEM DE IMPLEMENTAÇÃO: ║
76
+ ║ 1° Backend → 2° Doc. Integração → 3° Frontend/App ║
77
+ ║ ║
78
+ ╚══════════════════════════════════════════════════════════════╝
79
+ \`\`\`
80
+
81
+ ---
82
+
83
+ ## 📊 Contexto do Projeto
84
+
85
+ | Métrica | Valor |
86
+ |---------|-------|
87
+ | **Projeto** | ${projectName} |
88
+ | **Stack** | ${stackLabel} |
89
+ | **Score Atual** | ${report.score.overall}/100 |
90
+ | **Meta de Score** | ${Math.min(100, report.score.overall + 10)}/100 |
91
+ | **Camadas** | ${layers} |
92
+ | **Anti-Patterns** | ${antiPatterns} |
93
+ | **Arquivos** | ${report.projectInfo.totalFiles} |
94
+ | **Linhas** | ${report.projectInfo.totalLines.toLocaleString()} |
95
+ | **Cobertura Mínima** | ${config.coverageMinimum}% |
96
+ | **Refatorações Pendentes** | ${plan.steps.length} steps |
97
+
98
+ ${depthAtLeast(ctx, 'medium') ? `\n---\n\n## 📍 Contexto Enriquecido\n\n${depthIndicator(ctx)} · ${projectStructureBadge(ctx)}\n\n${frameworkBadge(ctx)}\n${domainBadge(ctx)}${modulesSummaryTable(ctx) ? `\n### 📦 Resumo de Módulos\n\n${modulesSummaryTable(ctx)}` : ''}${integrationsSummary(ctx)}${complianceBadges(ctx)}${toolchainCommands(ctx)}` : ''}
99
+
100
+ ---
101
+
102
+ ## 🔄 Protocolo de Orquestração (5 Fases)
103
+
104
+ ### FASE 0: Parsing da Requisição
105
+
106
+ Ao receber qualquer requisição, CLASSIFICAR imediatamente:
107
+
108
+ \`\`\`
109
+ ✓ Nome da feature/fix: _______________
110
+ ✓ Tipo: [ ] Feature [ ] Bug Fix [ ] Refactoring [ ] Documentation
111
+ ✓ Camadas tocadas: [ ] Backend [ ] Frontend [ ] Mobile [ ] Database
112
+ ✓ Tem UI: [ ] Sim [ ] Não
113
+ ✓ Complexidade: [ ] XS (<2h) [ ] S (2-4h) [ ] M (4-8h) [ ] L (1-3d) [ ] XL (3d+)
114
+ ✓ Assunções (listar): _______________
115
+ ✓ Riscos identificados: _______________
116
+ \`\`\`
117
+
118
+ Se houver QUALQUER dúvida na classificação → **PERGUNTAR ao humano**.
119
+
120
+ ### FASE 1: Interrogação de Negócio
121
+
122
+ Antes de qualquer design, RESPONDER estas perguntas:
123
+
124
+ ${businessQuestions}
125
+
126
+ > **Se não conseguir responder ≥ 70% das perguntas relevantes → PERGUNTAR ao humano.**
127
+
128
+ ### FASE 2: Disparo de Agentes (Paralelo)
129
+
130
+ \`\`\`
131
+ ORQUESTRADOR decompõe a requisição
132
+
133
+ ${agentDispatch} │
134
+ └──→ CONSOLIDAÇÃO
135
+ \`\`\`
136
+
137
+ Cada agente recebe:
138
+ - Contexto do projeto (score, stack, anti-patterns)
139
+ - Requisição decomposta (sua parte)
140
+ - Constraints (regras, patterns proibidos)
141
+ - Output esperado (formato e escopo)
142
+
143
+ ### FASE 3: Consolidação
144
+
145
+ O orquestrador consolida as respostas dos agentes em:
146
+
147
+ 1. **Plano Unificado** com:
148
+ - Diagrama de arquitetura (C4)
149
+ - Cenários BDD
150
+ - Casos de teste TDD
151
+ - Estimativa de esforço (T-shirt)
152
+ - Riscos e mitigações
153
+ - Decisões arquiteturais (ADR)
154
+
155
+ 2. **6 Gates para Aprovação** (apresentar um de cada vez):
156
+ - Gate 1: MOCKUP → \`/approved\`
157
+ - Gate 2: User Stories → \`/approved\`
158
+ - Gate 3: Arquitetura → \`/approved\`
159
+ - Gate 4: Tasks → \`/approved\`
160
+ - Gate 5: BDD → \`/approved\`
161
+ - Gate 6: TDD → \`/approved\`
162
+
163
+ ### FASE 4: Implementação (Após Todas Aprovações)
164
+
165
+ \`\`\`
166
+ ╔════════════════════════════════════════════════╗
167
+ ║ ORDEM OBRIGATÓRIA DE IMPLEMENTAÇÃO: ║
168
+ ║ ║
169
+ ║ 1° BACKEND ║
170
+ ║ └─→ Controllers, Services, Entities, DTOs ║
171
+ ║ └─→ Testes unitários + integração ║
172
+ ║ └─→ Migrations (se houver) ║
173
+ ║ ║
174
+ ║ 2° DOCUMENTO DE INTEGRAÇÃO ║
175
+ ║ └─→ Endpoints, payloads, erros ║
176
+ ║ └─→ Exemplos de request/response ║
177
+ ║ └─→ Contrato para frontend/app ║
178
+ ║ ║
179
+ ║ 3° FRONTEND / APP ║
180
+ ║ └─→ Baseado no documento de integração ║
181
+ ║ └─→ Componentes, pages, state ║
182
+ ║ └─→ Testes e2e ║
183
+ ╚════════════════════════════════════════════════╝
184
+ \`\`\`
185
+
186
+ ### FASE 5: Verificação e Entrega
187
+
188
+ \`\`\`
189
+ □ Build compila sem erros
190
+ □ Todos os testes passam
191
+ □ Cobertura ≥ ${config.coverageMinimum}%
192
+ □ Score ≥ ${config.scoreThreshold}/100
193
+ □ Zero anti-patterns CRITICAL novos
194
+ □ Sem regressão de score
195
+ □ Lint sem warnings
196
+ □ Documentação atualizada
197
+ \`\`\`
198
+
199
+ ---
200
+
201
+ ## 📐 Templates Inline
202
+
203
+ ### Template: User Story
204
+
205
+ \`\`\`markdown
206
+ ## US-XXX: [Título]
207
+
208
+ **Como** [ator],
209
+ **Quero** [ação],
210
+ **Para** [benefício].
211
+
212
+ ### Critérios de Aceite
213
+
214
+ - CA1: [critério mensurável]
215
+ - CA2: [critério mensurável]
216
+ - CA3: [critério mensurável]
217
+
218
+ ### Regras de Negócio
219
+
220
+ - RN1: [regra]
221
+ - RN2: [regra]
222
+
223
+ ### Notas Técnicas
224
+
225
+ - [observação relevante]
226
+ \`\`\`
227
+
228
+ ### Template: Task Breakdown
229
+
230
+ \`\`\`markdown
231
+ ## TASK-XXX: [Título]
232
+
233
+ **User Story:** US-XXX
234
+ **Estimativa:** [XS|S|M|L|XL]
235
+ **Camada:** [Backend|Frontend|App|Database]
236
+ **Agente:** [nome do agente]
237
+
238
+ ### Descrição
239
+ [o que precisa ser feito]
240
+
241
+ ### Critério de Done
242
+ - [ ] Implementado
243
+ - [ ] Testado (cobertura ≥ ${config.coverageMinimum}%)
244
+ - [ ] Code review
245
+ - [ ] Documentação
246
+ \`\`\`
247
+
248
+ ### Template: ADR (Architecture Decision Record)
249
+
250
+ \`\`\`markdown
251
+ ## ADR-XXX: [Título da Decisão]
252
+
253
+ **Status:** [proposed | accepted | deprecated | superseded]
254
+ **Data:** [YYYY-MM-DD]
255
+
256
+ ### Contexto
257
+ [Por que essa decisão é necessária?]
258
+
259
+ ### Decisão
260
+ [O que foi decidido?]
261
+
262
+ ### Consequências
263
+ [Positivas e negativas]
264
+
265
+ ### Alternativas Consideradas
266
+ 1. [alternativa 1] — descartada porque...
267
+ 2. [alternativa 2] — descartada porque...
268
+ \`\`\`
269
+
270
+ ---
271
+
272
+ ## ⚖️ Matriz de Risco
273
+
274
+ | Risco | Probabilidade | Impacto | Mitigação |
275
+ |-------|-------------|---------|-----------|
276
+ | Regressão de testes | Média | Alto | CI/CD com gate obrigatório |
277
+ | Degradação de score | Média | Médio | architect score antes de PR |
278
+ | Breaking changes em API | Alta | Crítico | Versionamento + integration doc |
279
+ | Security vulnerability | Baixa | Crítico | SECURITY-AUDITOR em toda feature |
280
+ | Performance degradation | Média | Alto | Benchmark antes/depois |
281
+
282
+ ---
283
+
284
+ ## 🏷️ T-Shirt Sizing
285
+
286
+ | Size | Duração | Scope | Gates |
287
+ |------|---------|-------|-------|
288
+ | **XS** | < 2h | Fix pontual, 1 arquivo | Simplificado (skip mockup se sem UI) |
289
+ | **S** | 2-4h | Fix + teste, 2-3 arquivos | Gates 2, 5, 6 obrigatórios |
290
+ | **M** | 4-8h | Feature pequena, 1 camada | Todos os 6 gates |
291
+ | **L** | 1-3 dias | Feature multi-camada | Todos + ADR |
292
+ | **XL** | 3+ dias | Feature épica | Todos + ADR + Threat Model |
293
+
294
+ ---
295
+
296
+ ## 🔀 Protocolo de Conflitos
297
+
298
+ Quando dois agentes discordam:
299
+
300
+ 1. **Identificar** o ponto de conflito
301
+ 2. **Documentar** ambas as posições com prós/contras
302
+ 3. **Escalar** ao humano com recomendação
303
+ 4. **Registrar** a decisão como ADR
304
+
305
+ > **NUNCA resolver conflitos automaticamente.** O humano decide.
306
+
307
+ ---
308
+
309
+ ## 🔧 Quality Gates (Enforcement)
310
+
311
+ \`\`\`
312
+ ╔══════════════════════════════════════════╗
313
+ ║ BUILD GATE ║
314
+ ║ $ ${buildCmd}
315
+ ║ Resultado: PASS ou BLOCK ║
316
+ ╠══════════════════════════════════════════╣
317
+ ║ TEST GATE ║
318
+ ║ $ ${testCmd}
319
+
320
+ ║ Resultado: PASS ou BLOCK ║
321
+ ╠══════════════════════════════════════════╣
322
+ ║ COVERAGE GATE ║
323
+ ║ Mínimo: ${config.coverageMinimum}% ║
324
+ ║ Resultado: PASS ou BLOCK ║
325
+ ║ ⚠️ INEGOCIÁVEL ║
326
+ ╠══════════════════════════════════════════╣
327
+ ║ SCORE GATE ║
328
+ ║ $ architect score ./src ║
329
+ ║ Mínimo: ${config.scoreThreshold}/100 ║
330
+ ║ Regressão: NÃO PERMITIDA ║
331
+ ╚══════════════════════════════════════════╝
332
+ \`\`\`
333
+
334
+ ---
335
+
336
+ **Gerado por Architect v3.1 · Score: ${report.score.overall}/100 · ${new Date().toISOString().split('T')[0]}**
337
+ `;
338
+ }
339
+ function buildAgentDispatch(ctx) {
340
+ const { stack } = ctx;
341
+ let dispatch = '';
342
+ // Add module context if enriched
343
+ const enriched = isEnriched(ctx) ? ctx : null;
344
+ const moduleContext = enriched?.modules?.length
345
+ ? ` (${enriched.modules.slice(0, 3).map((m) => m.name).join(', ')})`
346
+ : '';
347
+ if (stack.hasBackend) {
348
+ dispatch += ` ├──→ [${stack.primary.toUpperCase()}-BACKEND-DEVELOPER]${moduleContext}\n`;
349
+ dispatch += ` │ • Arquitetura de serviços e APIs\n`;
350
+ dispatch += ` │ • Lógica de negócio e validações\n`;
351
+ dispatch += ` │ • Entities, DTOs, migrations\n`;
352
+ dispatch += ` │\n`;
353
+ }
354
+ if (stack.hasFrontend) {
355
+ const fw = stack.frameworks.find(f => ['Angular', 'Vue', 'Next.js', 'React'].includes(f)) || 'FRONTEND';
356
+ dispatch += ` ├──→ [${fw.toUpperCase().replace('.', '')}-FRONTEND-DEVELOPER]\n`;
357
+ dispatch += ` │ • Componentes e páginas\n`;
358
+ dispatch += ` │ • State management e formulários\n`;
359
+ dispatch += ` │ • UX responsiva\n`;
360
+ dispatch += ` │\n`;
361
+ }
362
+ if (stack.hasMobile) {
363
+ dispatch += ` ├──→ [FLUTTER-UI-DEVELOPER]\n`;
364
+ dispatch += ` │ • Screens e widgets\n`;
365
+ dispatch += ` │ • Navegação e integração API\n`;
366
+ dispatch += ` │\n`;
367
+ }
368
+ if (stack.hasDatabase) {
369
+ dispatch += ` ├──→ [DATABASE-ENGINEER]\n`;
370
+ dispatch += ` │ • Schema design e migrations\n`;
371
+ dispatch += ` │ • Índices e performance de queries\n`;
372
+ dispatch += ` │\n`;
373
+ }
374
+ dispatch += ` ├──→ [SECURITY-AUDITOR]\n`;
375
+ dispatch += ` │ • Análise de ameaças (STRIDE)\n`;
376
+ dispatch += ` │ • Compliance check\n`;
377
+ dispatch += ` │\n`;
378
+ dispatch += ` ├──→ [QA-TEST-ENGINEER]\n`;
379
+ dispatch += ` │ • Plano de testes\n`;
380
+ dispatch += ` │ • Cobertura mínima: ${ctx.config.coverageMinimum}%\n`;
381
+ dispatch += ` │\n`;
382
+ dispatch += ` └──→ [TECH-DEBT-CONTROLLER]\n`;
383
+ dispatch += ` • Débito técnico existente\n`;
384
+ dispatch += ` • Refatorações pré-requisito\n`;
385
+ return dispatch;
386
+ }
387
+ function buildBusinessQuestions(ctx) {
388
+ const questions = [
389
+ 'Q1: Quem são os atores envolvidos? (personas)',
390
+ 'Q2: Qual o impacto em receita/negócio?',
391
+ 'Q3: Existem regras de negócio específicas?',
392
+ 'Q4: Quais métricas de sucesso?',
393
+ 'Q5: Há requisitos de compliance (LGPD, PCI, etc)?',
394
+ 'Q6: Quais módulos/serviços são afetados?',
395
+ 'Q7: Quais entidades de banco são tocadas?',
396
+ 'Q8: Existe fluxo de dados entre sistemas?',
397
+ 'Q9: Precisa de versionamento de API?',
398
+ 'Q10: Há integrações externas envolvidas?',
399
+ ];
400
+ // Add domain-specific questions if enriched context available
401
+ const enriched = isEnriched(ctx) ? ctx : null;
402
+ if (enriched?.domain) {
403
+ const { domain } = enriched;
404
+ questions.push(`Q11: Como isso se alinha com o domínio ${domain.domain}?`);
405
+ if (domain.compliance?.length) {
406
+ const complianceNames = domain.compliance.map((c) => c.name).join(', ');
407
+ questions.push(`Q12: Como garantir conformidade com ${complianceNames}?`);
408
+ }
409
+ if (domain.integrations?.length) {
410
+ const integrationNames = domain.integrations.slice(0, 3).map((i) => i.name).join(', ');
411
+ questions.push(`Q13: Como essa mudança afeta as integrações com ${integrationNames}?`);
412
+ }
413
+ }
414
+ if (ctx.stack.hasDatabase) {
415
+ const startIdx = enriched?.domain ? 14 : 11;
416
+ questions.push(`Q${startIdx}: Volume estimado de dados?`, `Q${startIdx + 1}: Há picos de uso previsíveis?`, `Q${startIdx + 2}: Processamento síncrono ou assíncrono?`);
417
+ }
418
+ let nextQ = questions.length + 1;
419
+ questions.push(`Q${nextQ++}: Quem precisa de autenticação?`, `Q${nextQ++}: Quais permissões são necessárias?`, `Q${nextQ++}: Há dados sensíveis envolvidos?`, `Q${nextQ++}: Quais ameaças são relevantes?`);
420
+ return questions.map(q => `- **${q}**`).join('\n');
421
+ }
422
+ //# sourceMappingURL=orchestrator.js.map