@girardelli/architect-core 8.1.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 (217) hide show
  1. package/dist/src/core/analyzer.d.ts +42 -0
  2. package/dist/src/core/analyzer.js +431 -0
  3. package/dist/src/core/analyzer.js.map +1 -0
  4. package/dist/src/core/analyzers/forecast.d.ts +84 -0
  5. package/dist/src/core/analyzers/forecast.js +338 -0
  6. package/dist/src/core/analyzers/forecast.js.map +1 -0
  7. package/dist/src/core/analyzers/index.d.ts +9 -0
  8. package/dist/src/core/analyzers/index.js +7 -0
  9. package/dist/src/core/analyzers/index.js.map +1 -0
  10. package/dist/src/core/analyzers/temporal-scorer.d.ts +71 -0
  11. package/dist/src/core/analyzers/temporal-scorer.js +141 -0
  12. package/dist/src/core/analyzers/temporal-scorer.js.map +1 -0
  13. package/dist/src/core/anti-patterns.d.ts +28 -0
  14. package/dist/src/core/anti-patterns.js +264 -0
  15. package/dist/src/core/anti-patterns.js.map +1 -0
  16. package/dist/src/core/ast/ast-parser.interface.d.ts +20 -0
  17. package/dist/src/core/ast/ast-parser.interface.js +2 -0
  18. package/dist/src/core/ast/ast-parser.interface.js.map +1 -0
  19. package/dist/src/core/ast/path-resolver.d.ts +13 -0
  20. package/dist/src/core/ast/path-resolver.js +54 -0
  21. package/dist/src/core/ast/path-resolver.js.map +1 -0
  22. package/dist/src/core/ast/tree-sitter-parser.d.ts +10 -0
  23. package/dist/src/core/ast/tree-sitter-parser.js +142 -0
  24. package/dist/src/core/ast/tree-sitter-parser.js.map +1 -0
  25. package/dist/src/core/config.d.ts +11 -0
  26. package/dist/src/core/config.js +112 -0
  27. package/dist/src/core/config.js.map +1 -0
  28. package/dist/src/core/diagram.d.ts +9 -0
  29. package/dist/src/core/diagram.js +101 -0
  30. package/dist/src/core/diagram.js.map +1 -0
  31. package/dist/src/core/i18n.d.ts +14 -0
  32. package/dist/src/core/i18n.js +54 -0
  33. package/dist/src/core/i18n.js.map +1 -0
  34. package/dist/src/core/locales/en.d.ts +2 -0
  35. package/dist/src/core/locales/en.js +337 -0
  36. package/dist/src/core/locales/en.js.map +1 -0
  37. package/dist/src/core/locales/pt-BR.d.ts +172 -0
  38. package/dist/src/core/locales/pt-BR.js +337 -0
  39. package/dist/src/core/locales/pt-BR.js.map +1 -0
  40. package/dist/src/core/locales/types.d.ts +86 -0
  41. package/dist/src/core/locales/types.js +2 -0
  42. package/dist/src/core/locales/types.js.map +1 -0
  43. package/dist/src/core/plugin-loader.d.ts +11 -0
  44. package/dist/src/core/plugin-loader.js +67 -0
  45. package/dist/src/core/plugin-loader.js.map +1 -0
  46. package/dist/src/core/project-summarizer.d.ts +16 -0
  47. package/dist/src/core/project-summarizer.js +37 -0
  48. package/dist/src/core/project-summarizer.js.map +1 -0
  49. package/dist/src/core/refactor-engine.d.ts +18 -0
  50. package/dist/src/core/refactor-engine.js +87 -0
  51. package/dist/src/core/refactor-engine.js.map +1 -0
  52. package/dist/src/core/rules/barrel-optimizer.d.ts +13 -0
  53. package/dist/src/core/rules/barrel-optimizer.js +76 -0
  54. package/dist/src/core/rules/barrel-optimizer.js.map +1 -0
  55. package/dist/src/core/rules/dead-code-detector.d.ts +21 -0
  56. package/dist/src/core/rules/dead-code-detector.js +116 -0
  57. package/dist/src/core/rules/dead-code-detector.js.map +1 -0
  58. package/dist/src/core/rules/hub-splitter.d.ts +13 -0
  59. package/dist/src/core/rules/hub-splitter.js +117 -0
  60. package/dist/src/core/rules/hub-splitter.js.map +1 -0
  61. package/dist/src/core/rules/import-organizer.d.ts +13 -0
  62. package/dist/src/core/rules/import-organizer.js +84 -0
  63. package/dist/src/core/rules/import-organizer.js.map +1 -0
  64. package/dist/src/core/rules/module-grouper.d.ts +13 -0
  65. package/dist/src/core/rules/module-grouper.js +116 -0
  66. package/dist/src/core/rules/module-grouper.js.map +1 -0
  67. package/dist/src/core/rules-engine.d.ts +7 -0
  68. package/dist/src/core/rules-engine.js +89 -0
  69. package/dist/src/core/rules-engine.js.map +1 -0
  70. package/dist/src/core/scorer.d.ts +15 -0
  71. package/dist/src/core/scorer.js +165 -0
  72. package/dist/src/core/scorer.js.map +1 -0
  73. package/dist/src/core/summarizer/keyword-extractor.d.ts +6 -0
  74. package/dist/src/core/summarizer/keyword-extractor.js +38 -0
  75. package/dist/src/core/summarizer/keyword-extractor.js.map +1 -0
  76. package/dist/src/core/summarizer/module-inferrer.d.ts +11 -0
  77. package/dist/src/core/summarizer/module-inferrer.js +171 -0
  78. package/dist/src/core/summarizer/module-inferrer.js.map +1 -0
  79. package/dist/src/core/summarizer/package-reader.d.ts +3 -0
  80. package/dist/src/core/summarizer/package-reader.js +33 -0
  81. package/dist/src/core/summarizer/package-reader.js.map +1 -0
  82. package/dist/src/core/summarizer/purpose-inferrer.d.ts +8 -0
  83. package/dist/src/core/summarizer/purpose-inferrer.js +179 -0
  84. package/dist/src/core/summarizer/purpose-inferrer.js.map +1 -0
  85. package/dist/src/core/summarizer/readme-reader.d.ts +3 -0
  86. package/dist/src/core/summarizer/readme-reader.js +24 -0
  87. package/dist/src/core/summarizer/readme-reader.js.map +1 -0
  88. package/dist/src/core/types/architect-rules.d.ts +27 -0
  89. package/dist/src/core/types/architect-rules.js +2 -0
  90. package/dist/src/core/types/architect-rules.js.map +1 -0
  91. package/dist/src/core/types/core.d.ts +87 -0
  92. package/dist/src/core/types/core.js +2 -0
  93. package/dist/src/core/types/core.js.map +1 -0
  94. package/dist/src/core/types/infrastructure.d.ts +38 -0
  95. package/dist/src/core/types/infrastructure.js +2 -0
  96. package/dist/src/core/types/infrastructure.js.map +1 -0
  97. package/dist/src/core/types/plugin.d.ts +12 -0
  98. package/dist/src/core/types/plugin.js +2 -0
  99. package/dist/src/core/types/plugin.js.map +1 -0
  100. package/dist/src/core/types/rules.d.ts +53 -0
  101. package/dist/src/core/types/rules.js +2 -0
  102. package/dist/src/core/types/rules.js.map +1 -0
  103. package/dist/src/core/types/summarizer.d.ts +12 -0
  104. package/dist/src/core/types/summarizer.js +2 -0
  105. package/dist/src/core/types/summarizer.js.map +1 -0
  106. package/dist/src/infrastructure/git-cache.d.ts +6 -0
  107. package/dist/src/infrastructure/git-cache.js +41 -0
  108. package/dist/src/infrastructure/git-cache.js.map +1 -0
  109. package/dist/src/infrastructure/git-history.d.ts +112 -0
  110. package/dist/src/infrastructure/git-history.js +340 -0
  111. package/dist/src/infrastructure/git-history.js.map +1 -0
  112. package/dist/src/infrastructure/logger.d.ts +20 -0
  113. package/dist/src/infrastructure/logger.js +57 -0
  114. package/dist/src/infrastructure/logger.js.map +1 -0
  115. package/dist/src/infrastructure/scanner.d.ts +31 -0
  116. package/dist/src/infrastructure/scanner.js +334 -0
  117. package/dist/src/infrastructure/scanner.js.map +1 -0
  118. package/dist/tests/analyzers-integration.test.d.ts +7 -0
  119. package/dist/tests/analyzers-integration.test.js +140 -0
  120. package/dist/tests/analyzers-integration.test.js.map +1 -0
  121. package/dist/tests/anti-patterns.test.d.ts +1 -0
  122. package/dist/tests/anti-patterns.test.js +81 -0
  123. package/dist/tests/anti-patterns.test.js.map +1 -0
  124. package/dist/tests/ast-parser.test.d.ts +1 -0
  125. package/dist/tests/ast-parser.test.js +94 -0
  126. package/dist/tests/ast-parser.test.js.map +1 -0
  127. package/dist/tests/fixtures/monorepo/packages/app/src/index.d.ts +1 -0
  128. package/dist/tests/fixtures/monorepo/packages/app/src/index.js +9 -0
  129. package/dist/tests/fixtures/monorepo/packages/app/src/index.js.map +1 -0
  130. package/dist/tests/fixtures/monorepo/packages/core/src/index.d.ts +2 -0
  131. package/dist/tests/fixtures/monorepo/packages/core/src/index.js +11 -0
  132. package/dist/tests/fixtures/monorepo/packages/core/src/index.js.map +1 -0
  133. package/dist/tests/forecast.test.d.ts +7 -0
  134. package/dist/tests/forecast.test.js +380 -0
  135. package/dist/tests/forecast.test.js.map +1 -0
  136. package/dist/tests/git-history.test.d.ts +7 -0
  137. package/dist/tests/git-history.test.js +193 -0
  138. package/dist/tests/git-history.test.js.map +1 -0
  139. package/dist/tests/i18n.test.d.ts +1 -0
  140. package/dist/tests/i18n.test.js +39 -0
  141. package/dist/tests/i18n.test.js.map +1 -0
  142. package/dist/tests/monorepo-scan.test.d.ts +11 -0
  143. package/dist/tests/monorepo-scan.test.js +143 -0
  144. package/dist/tests/monorepo-scan.test.js.map +1 -0
  145. package/dist/tests/plugin-loader.test.d.ts +1 -0
  146. package/dist/tests/plugin-loader.test.js +31 -0
  147. package/dist/tests/plugin-loader.test.js.map +1 -0
  148. package/dist/tests/rules-engine.test.d.ts +1 -0
  149. package/dist/tests/rules-engine.test.js +112 -0
  150. package/dist/tests/rules-engine.test.js.map +1 -0
  151. package/dist/tests/scanner.test.d.ts +1 -0
  152. package/dist/tests/scanner.test.js +44 -0
  153. package/dist/tests/scanner.test.js.map +1 -0
  154. package/dist/tests/scorer.test.d.ts +1 -0
  155. package/dist/tests/scorer.test.js +610 -0
  156. package/dist/tests/scorer.test.js.map +1 -0
  157. package/dist/tests/temporal-scorer.test.d.ts +7 -0
  158. package/dist/tests/temporal-scorer.test.js +239 -0
  159. package/dist/tests/temporal-scorer.test.js.map +1 -0
  160. package/package.json +29 -0
  161. package/src/core/analyzer.ts +499 -0
  162. package/src/core/analyzers/forecast.ts +497 -0
  163. package/src/core/analyzers/index.ts +33 -0
  164. package/src/core/analyzers/temporal-scorer.ts +227 -0
  165. package/src/core/anti-patterns.ts +324 -0
  166. package/src/core/ast/ast-parser.interface.ts +21 -0
  167. package/src/core/ast/path-resolver.ts +61 -0
  168. package/src/core/ast/tree-sitter-parser.ts +158 -0
  169. package/src/core/config.ts +125 -0
  170. package/src/core/diagram.ts +129 -0
  171. package/src/core/i18n.ts +64 -0
  172. package/src/core/locales/en.ts +340 -0
  173. package/src/core/locales/pt-BR.ts +341 -0
  174. package/src/core/locales/types.ts +95 -0
  175. package/src/core/plugin-loader.ts +80 -0
  176. package/src/core/project-summarizer.ts +42 -0
  177. package/src/core/refactor-engine.ts +112 -0
  178. package/src/core/rules/barrel-optimizer.ts +99 -0
  179. package/src/core/rules/dead-code-detector.ts +134 -0
  180. package/src/core/rules/hub-splitter.ts +135 -0
  181. package/src/core/rules/import-organizer.ts +100 -0
  182. package/src/core/rules/module-grouper.ts +133 -0
  183. package/src/core/rules-engine.ts +100 -0
  184. package/src/core/scorer.ts +181 -0
  185. package/src/core/summarizer/keyword-extractor.ts +53 -0
  186. package/src/core/summarizer/module-inferrer.ts +194 -0
  187. package/src/core/summarizer/package-reader.ts +34 -0
  188. package/src/core/summarizer/purpose-inferrer.ts +197 -0
  189. package/src/core/summarizer/readme-reader.ts +24 -0
  190. package/src/core/types/architect-rules.ts +29 -0
  191. package/src/core/types/core.ts +94 -0
  192. package/src/core/types/infrastructure.ts +41 -0
  193. package/src/core/types/plugin.ts +19 -0
  194. package/src/core/types/rules.ts +51 -0
  195. package/src/core/types/summarizer.ts +8 -0
  196. package/src/infrastructure/git-cache.ts +52 -0
  197. package/src/infrastructure/git-history.ts +496 -0
  198. package/src/infrastructure/logger.ts +68 -0
  199. package/src/infrastructure/scanner.ts +349 -0
  200. package/tests/analyzers-integration.test.ts +174 -0
  201. package/tests/anti-patterns.test.ts +95 -0
  202. package/tests/ast-parser.test.ts +102 -0
  203. package/tests/fixtures/monorepo/package.json +6 -0
  204. package/tests/fixtures/monorepo/packages/app/package.json +12 -0
  205. package/tests/fixtures/monorepo/packages/app/src/index.ts +6 -0
  206. package/tests/fixtures/monorepo/packages/core/package.json +7 -0
  207. package/tests/fixtures/monorepo/packages/core/src/index.ts +7 -0
  208. package/tests/forecast.test.ts +504 -0
  209. package/tests/git-history.test.ts +254 -0
  210. package/tests/i18n.test.ts +47 -0
  211. package/tests/monorepo-scan.test.ts +170 -0
  212. package/tests/plugin-loader.test.ts +40 -0
  213. package/tests/rules-engine.test.ts +131 -0
  214. package/tests/scanner.test.ts +54 -0
  215. package/tests/scorer.test.ts +675 -0
  216. package/tests/temporal-scorer.test.ts +306 -0
  217. package/tsconfig.json +9 -0
@@ -0,0 +1,340 @@
1
+ import { AppTranslation } from './pt-BR.js';
2
+
3
+ export const en: AppTranslation = {
4
+ // === CLI ===
5
+ cli: {
6
+ phases: {
7
+ scan: { label: 'FILE SCANNER', verb: 'Scanning filesystem' },
8
+ dependencies: { label: 'DEPENDENCY MAPPER', verb: 'Mapping import graph' },
9
+ layers: { label: 'LAYER DETECTOR', verb: 'Classifying architecture' },
10
+ antipatterns: { label: 'PATTERN ANALYZER', verb: 'Detecting anti-patterns' },
11
+ scoring: { label: 'QUALITY ENGINE', verb: 'Computing quality metrics' },
12
+ normalize: { label: 'PATH NORMALIZER', verb: 'Normalizing paths' },
13
+ summarize: { label: 'AI SUMMARIZER', verb: 'Generating project summary' }
14
+ },
15
+ results: {
16
+ score: 'ARCHITECTURE SCORE',
17
+ completedIn: 'Completed in',
18
+ files: 'files',
19
+ lines: 'lines',
20
+ anitpatterns: 'anti-patterns',
21
+ steps: 'steps',
22
+ agents: 'agents'
23
+ }
24
+ },
25
+
26
+ // === AGONTS OUTPUTS ===
27
+ agents: {
28
+ generatedBy: 'Generated by Architect v8.1',
29
+ backend: {
30
+ description: '{lang} Backend Developer — APIs, services, business logic',
31
+ title: '🔧 {lang} BACKEND DEVELOPER',
32
+ specialistIn: 'Backend specialist in {fw} for {projectName}',
33
+ stack: 'Stack',
34
+ language: 'Language',
35
+ framework: 'Framework',
36
+ architecture: 'Architecture',
37
+ test: 'Test Framework',
38
+ packageManager: 'Package Manager',
39
+ currentScore: 'Current Score',
40
+ domainContext: 'Domain & Business Context',
41
+ principles: 'Principles (SOLID + Clean Architecture)',
42
+ modules: 'Project Modules',
43
+ projectStructure: 'Project Structure (Detected)',
44
+ implementationRules: 'Implementation Rules',
45
+ implementationRulesBody: `□ Controller MUST NEVER contain business logic (routing only)
46
+ □ Service MUST NEVER access Request/Response directly
47
+ □ Entity MUST NEVER be exposed directly in API (use DTO)
48
+ □ Input validation in DTO / Guard / Pipe
49
+ □ Errors thrown with clear messages and correct HTTP status
50
+ □ Structured logging (never console.log)
51
+ □ Unit tests for every service method
52
+ □ Integration tests for every endpoint
53
+ □ Coverage ≥ {coverage}%`,
54
+ afterImplementation: 'After Backend Implementation',
55
+ afterImplementationBody: `> **MANDATORY: Generate Integration Document before proceeding to frontend/app.**
56
+
57
+ Document must contain:
58
+ - All created/modified endpoints
59
+ - Request and response payloads (with examples)
60
+ - Error codes and messages
61
+ - Business rules applied
62
+ - Required headers (auth, pagination, etc.)`
63
+ },
64
+ frontend: {
65
+ description: '{fw} Frontend Developer — Components, UX, state management',
66
+ title: '🎨 {fw} FRONTEND DEVELOPER',
67
+ specialistIn: 'Frontend specialist in {fw} for {projectName}',
68
+ prerequisites: 'Prerequisites for Implementation',
69
+ prerequisitesBody: `╔══════════════════════════════════════════════╗
70
+ ║ BEFORE writing any UI component: ║
71
+ ║ ║
72
+ ║ □ MOCKUP approved by human ║
73
+ ║ □ Integration Document available ║
74
+ ║ □ User stories with acceptance criteria ║
75
+ ║ □ BDD scenarios written ║
76
+ ╚══════════════════════════════════════════════╝`,
77
+ implementationRules: 'Implementation Rules',
78
+ implementationRulesBody: `□ Component follows approved MOCKUP (do not invent UI)
79
+ □ ALL UI states implemented:
80
+ - ✅ Data present (normal state)
81
+ - 📭 Empty state
82
+ - ⏳ Loading state (skeleton)
83
+ - ❌ Error state (with clear message)
84
+ □ Business logic in services (NEVER in the component)
85
+ □ Proper state management (no prop drilling)
86
+ □ Forms with client-side validation
87
+ □ Responsive layout (mobile + desktop)
88
+ □ Basic accessibility (labels, aria, contrast)
89
+ □ Lazy loading where applicable
90
+ □ Coverage ≥ {coverage}%`
91
+ },
92
+ security: {
93
+ description: 'Security Auditor — Threat analysis, compliance, vulnerability scanning',
94
+ title: '🛡️ SECURITY AUDITOR',
95
+ analysisFor: 'Security Analysis for {projectName}',
96
+ checklist: 'OWASP Top 10 Checklist',
97
+ checklistBody: `□ A01: Broken Access Control — RBAC implemented?
98
+ □ A02: Cryptographic Failures — Sensitive data encrypted?
99
+ □ A03: Injection — Inputs sanitized? Parameterized queries?
100
+ □ A04: Insecure Design — Threat modeling performed?
101
+ □ A05: Security Misconfiguration — Secure headers, CORS?
102
+ □ A06: Vulnerable Components — Dependencies updated?
103
+ □ A07: Auth Failures — Brute-force protected? Session managed?
104
+ □ A08: Software Integrity — Supply chain verified?
105
+ □ A09: Logging Failures — Audit logs for sensitive actions?
106
+ □ A10: SSRF — Server-side requests validated?`,
107
+ whenToActivate: 'When To Activate',
108
+ whenToActivateBody: `- Any feature handling: auth, personal data, payments
109
+ - New public APIs
110
+ - External system integrations
111
+ - Infrastructure/Ops changes`,
112
+ expectedOutput: 'Expected Output',
113
+ expectedOutputBody: `1. Findings list with severity levels (CRITICAL/HIGH/MEDIUM/LOW)
114
+ 2. Mitigation recommendations
115
+ 3. Threat model (if applicable)`
116
+ },
117
+ qa: {
118
+ description: 'QA Test Engineer — Test planning, BDD/TDD, coverage analysis',
119
+ title: '🧪 QA TEST ENGINEER',
120
+ qualityFor: 'Test Quality mapping for {projectName}',
121
+ nonNegotiable: 'Non-Negotiable Targets',
122
+ nonNegotiableBody: `╔══════════════════════════════════════════╗
123
+ ║ Minimum Coverage: {coverage}% ║
124
+ ║ No tests = no delivery, no completion ║
125
+ ║ NON-NEGOTIABLE. ║
126
+ ╚══════════════════════════════════════════╝`,
127
+ pyramid: 'Testing Pyramid',
128
+ pyramidBody: ` ╱╲
129
+ ╱ E2E╲ → Few, slow, high value
130
+ ╱──────╲
131
+ ╱Integration╲ → Medium, validate integration
132
+ ╱──────────────╲
133
+ ╱ Unit Tests ╲ → Many, fast, cheap
134
+ ╱════════════════════╲`,
135
+ process: 'Testing Process',
136
+ processBody: `1. **BDD first** — Gherkin scenarios before code
137
+ 2. **TDD** — RED → GREEN → REFACTOR
138
+ 3. **Coverage** — verify after each implementation
139
+ 4. **Regression** — ALL previous tests must pass
140
+ 5. **Review** — tests are reviewed alongside the code`,
141
+ refactoringRoadmap: 'Refactoring Roadmap'
142
+ },
143
+ techDebt: {
144
+ description: 'Tech Debt Controller — Technical debt backlog and score enforcement',
145
+ title: '📊 TECH DEBT CONTROLLER',
146
+ controlFor: 'Tech debt tracking for {projectName}',
147
+ currentState: 'Current State',
148
+ stateTable: `| Metric | Value |
149
+ |---------|-------|
150
+ | Score | {score}/100 |
151
+ | Target | {target}/100 |
152
+ | Anti-patterns | {antiPatterns} |
153
+ | Pending Refactors | {refactoringSteps} |
154
+ | Estimated Gain | +{improvement} points |`,
155
+ refactoringRoadmap: 'Refactoring Roadmap',
156
+ scoreTargets: 'Score Targets',
157
+ scoreTargetsBody: `Current Score: {score}/100
158
+ Short-Term Target: {targetShort}/100
159
+ Mid-Term Target: {targetMedium}/100
160
+ Minimum Acceptable: {threshold}/100`,
161
+ rules: 'Enforcement Rules',
162
+ rulesBody: `□ Score MUST NEVER regress after a PR
163
+ □ Minimum allowed: {threshold}/100
164
+ □ Critical: resolve within 1 sprint
165
+ □ High: resolve within 2 sprints
166
+ □ Medium: add to technical backlog
167
+ □ Verify using: architect score ./src`
168
+ },
169
+ codeReview: {
170
+ description: 'Code Review Checklist — Mandatory review points',
171
+ title: '🔍 CODE REVIEW CHECKLIST — {projectName}',
172
+ mandatoryRule: '**Every PR must be verified against this checklist.**',
173
+ mandatory: 'Mandatory',
174
+ mandatoryBody: `□ Code compiles without errors
175
+ □ All tests pass
176
+ □ Coverage ≥ {coverage}%
177
+ □ Lint passes without errors
178
+ □ No hardcoded secrets
179
+ □ Score has not regressed`,
180
+ functional: 'Functional',
181
+ functionalBody: `□ Meets acceptance criteria
182
+ □ Edge cases handled
183
+ □ Errors handled appropriately
184
+ □ Exisiting features not broken`,
185
+ quality: 'Quality',
186
+ qualityBody: `□ Code readable without explanatory comments
187
+ □ Naming is descriptive and consistent
188
+ □ Functions are small and focused
189
+ □ No code duplication (DRY)
190
+ □ Complex logic is isolated and tested
191
+ □ No large commented out code blocks`,
192
+ domainReviewItems: 'Domain-Specific Review Items: {domain}',
193
+ domainRules: {
194
+ fintech: `□ Are transactions idempotent?
195
+ □ Complete audit of all operations?
196
+ □ No sensitive data exposed in logs?
197
+ □ Monetary values use Decimal (no floats)?
198
+ □ PCI-DSS compliance verified?`,
199
+ healthtech: `□ GDPR/LGPD compliance verified?
200
+ □ Sensitive data encrypted at rest?
201
+ □ Access audited and logged?
202
+ □ Anonymization implemented correctly?
203
+ □ 2FA for sensitive operations?`,
204
+ ecommerce: `□ Cart is idempotent?
205
+ □ Inventory updated correctly (race conditions)?
206
+ □ Prices validated (no client-side manipulation)?
207
+ □ Coupons/discounts applied correctly?
208
+ □ Fraud detection implemented?`,
209
+ default: `□ Critical business workflow intact?
210
+ □ Rollback is safe?
211
+ □ Concurrency handled?
212
+ □ Final state is consistent?`
213
+ },
214
+ stackReviewItems: 'Language-Specific Checklist: {stack}',
215
+ stackRules: {
216
+ ts: `□ \`strict: true\` in tsconfig (no unjustified 'any')?
217
+ □ Circular imports?
218
+ □ Async/await handled (no unhandled promises)?
219
+ □ Memory leaks (EventListeners unsubscribed)?
220
+ □ Console.log/debugger removed?`,
221
+ python: `□ Type hints on all public functions?
222
+ □ Docstrings formatted (Google or NumPy style)?
223
+ □ No mutable default arguments?
224
+ □ Context managers used for resources?
225
+ □ F-strings instead of % or .format()?
226
+ □ No \`eval()\` or \`exec()\`?`,
227
+ go: `□ Errors handled (not ignored with _)?
228
+ □ Defer for cleanup?
229
+ □ Goroutines with context?
230
+ □ Race conditions tested?
231
+ □ Timeouts implemented?`,
232
+ dart: `□ Null-safety (! avoided)?
233
+ □ Widgets have keys in lists?
234
+ □ BuildContext accessed only in build?
235
+ □ Listeners unsubscribed?
236
+ □ Images/assets load lazily?`,
237
+ default: `□ Code follows project standards?
238
+ □ Dependencies updated?
239
+ □ No compiler/linter warnings?`
240
+ },
241
+ integrationReviewItems: 'Integration Review Items',
242
+ integrationRulesBody: `□ Endpoint handles all expected status codes?
243
+ □ Input payload validation?
244
+ {auth}
245
+ {validation}
246
+ □ Response follows the documented contract?
247
+ □ Errors return clear messages?
248
+ □ Rate limiting applied?
249
+ □ Structured logging?`
250
+ }
251
+ },
252
+
253
+ // === DYNAMIC BLOCKS ===
254
+ dynamic: {
255
+ compliance: {
256
+ title: 'Detected Compliance Requirements',
257
+ reason: 'Reason',
258
+ mandatoryChecks: 'Mandatory Checks'
259
+ },
260
+ integrations: {
261
+ title: 'Integration Security',
262
+ threats: 'Threats',
263
+ types: {
264
+ payment: 'PCI-DSS, sensitive data encryption, tokenization',
265
+ auth: 'MFA, session hijacking, credential stuffing',
266
+ api: 'Rate limiting, API key rotation, required HTTPS',
267
+ database: 'SQL Injection, Encryption at rest, Backups',
268
+ government: 'Regulatory compliance, audit trails, data retention',
269
+ default: 'Input/output validation, rate limiting'
270
+ }
271
+ },
272
+ domainThreats: {
273
+ title: 'Domain-Specific Threats: {domain}',
274
+ fintech: `- **Data Manipulation:** Transaction audits, checksums, encryption
275
+ - **Unauthorized Access:** MFA on privileged accounts, IP whitelist
276
+ - **Compliance:** PCI-DSS, LGPD/GDPR, SOX
277
+ - **Fraud:** Anomaly detection, rate limiting`,
278
+ healthtech: `- **Data Leakage:** End-to-end encryption, anonymization
279
+ - **HIPAA/GDPR:** Audit trails, explicit consent
280
+ - **Integrity:** Digital signatures, blockchain if applicable
281
+ - **Access:** Granular RBAC, 2FA for sensitive data`,
282
+ ecommerce: `- **Payment Fraud:** CVV validation, 3D Secure
283
+ - **Data Theft:** SSL/TLS, PCI-DSS, encryption at rest
284
+ - **DoS:** Rate limiting, CAPTCHA, WAF
285
+ - **Auth:** MFA, session timeout`,
286
+ default: `- **Confidentiality:** Data encrypted in transit and at rest
287
+ - **Integrity:** Input validation, checksums
288
+ - **Availability:** Backup, disaster recovery, monitoring
289
+ - **Auditing:** Logging sensitive actions, retention policy`
290
+ },
291
+ qaDomain: {
292
+ title: 'Domain-Specific Test Scenarios: {domain}',
293
+ fintech: `### Business Tests
294
+ - Create transaction with valid amounts
295
+ - Reject transaction above limit
296
+ - Process refund correctly
297
+ - Audit logging of all transactions
298
+ - Validate balance after multiple operations
299
+
300
+ ### Security Tests
301
+ - Do not expose card data in logs
302
+ - Validate PCI-DSS compliance
303
+ - Test fraud detection`,
304
+ healthtech: `### Business Tests
305
+ - Create patient record with GDPR compliance
306
+ - Validate consent before sharing data
307
+ - Anonymize data correctly
308
+ - Respect right to be forgotten
309
+ - Audit access to sensitive data
310
+
311
+ ### Security Tests
312
+ - E2E encryption at rest
313
+ - Validate 2FA for critical data
314
+ - Test data retention`,
315
+ ecommerce: `### Business Tests
316
+ - Create cart with multiple products
317
+ - Apply discount/coupon correctly
318
+ - Process payment with 3DS validation
319
+ - Update inventory after sale
320
+ - Generate order with correct status
321
+
322
+ ### Security Tests
323
+ - Do not expose card data
324
+ - Validate rate limiting on checkout
325
+ - Test fraud protection`,
326
+ default: `### Business Tests
327
+ - Main flow (happy path)
328
+ - Edge cases and boundaries
329
+ - Concurrency (race conditions)
330
+ - Rollback after error
331
+ - Idempotency
332
+
333
+ ### Security Tests
334
+ - Invalid/malicious inputs
335
+ - Unauthorized access
336
+ - Rate limiting
337
+ - Proper logging`
338
+ }
339
+ }
340
+ };
@@ -0,0 +1,341 @@
1
+ export const ptBR = {
2
+ // === CLI ===
3
+ cli: {
4
+ phases: {
5
+ scan: { label: 'FILE SCANNER', verb: 'Escaneando sistema de arquivos' },
6
+ dependencies: { label: 'DEPENDENCY MAPPER', verb: 'Mapeando grafo de importações' },
7
+ layers: { label: 'LAYER DETECTOR', verb: 'Classificando arquitetura' },
8
+ antipatterns: { label: 'PATTERN ANALYZER', verb: 'Detectando anti-patterns' },
9
+ scoring: { label: 'QUALITY ENGINE', verb: 'Computando métricas de qualidade' },
10
+ normalize: { label: 'PATH NORMALIZER', verb: 'Normalizando paths' },
11
+ summarize: { label: 'AI SUMMARIZER', verb: 'Gerando sumário do projeto' }
12
+ },
13
+ results: {
14
+ score: 'ARCHITECTURE SCORE',
15
+ completedIn: 'Completado em',
16
+ files: 'arquivos',
17
+ lines: 'linhas',
18
+ anitpatterns: 'anti-patterns',
19
+ steps: 'passos',
20
+ agents: 'agentes'
21
+ }
22
+ },
23
+
24
+ // === AGONTS OUTPUTS ===
25
+ agents: {
26
+ generatedBy: 'Gerado por Architect v8.1',
27
+ backend: {
28
+ description: '{lang} Backend Developer — APIs, serviços, lógica de negócio',
29
+ title: '🔧 {lang} BACKEND DEVELOPER',
30
+ specialistIn: 'Especialista em backend {fw} para {projectName}',
31
+ stack: 'Stack',
32
+ language: 'Linguagem',
33
+ framework: 'Framework',
34
+ architecture: 'Arquitetura',
35
+ test: 'Teste',
36
+ packageManager: 'Package Manager',
37
+ currentScore: 'Score Atual',
38
+ domainContext: 'Domínio & Contexto de Negócio',
39
+ principles: 'Princípios (SOLID + Clean Architecture)',
40
+ modules: 'Módulos do Projeto',
41
+ projectStructure: 'Estrutura do Projeto (Detectada)',
42
+ implementationRules: 'Regras de Implementação',
43
+ implementationRulesBody: `□ Controller NUNCA contém lógica de negócio (apenas routing)
44
+ □ Service NUNCA acessa Request/Response diretamente
45
+ □ Entity NUNCA é exposta diretamente na API (usar DTO)
46
+ □ Validação de input no DTO / Guard / Pipe
47
+ □ Erros com mensagens claras e códigos HTTP corretos
48
+ □ Logging estruturado (não console.log)
49
+ □ Testes unitários para cada service method
50
+ □ Testes de integração para cada endpoint
51
+ □ Cobertura ≥ {coverage}%`,
52
+ afterImplementation: 'Após Implementação Backend',
53
+ afterImplementationBody: `> **OBRIGATÓRIO: Gerar Documento de Integração antes de qualquer frontend/app.**
54
+
55
+ O documento deve conter:
56
+ - Todos os endpoints criados/modificados
57
+ - Payloads de request e response (com exemplos)
58
+ - Códigos de erro e mensagens
59
+ - Regras de negócio aplicadas
60
+ - Headers necessários (auth, pagination, etc.)`
61
+ },
62
+ frontend: {
63
+ description: '{fw} Frontend Developer — Componentes, UX, state management',
64
+ title: '🎨 {fw} FRONTEND DEVELOPER',
65
+ specialistIn: 'Especialista em frontend {fw} para {projectName}',
66
+ prerequisites: 'Pré-Requisitos para Implementar',
67
+ prerequisitesBody: `╔══════════════════════════════════════════════╗
68
+ ║ ANTES de escrever qualquer componente: ║
69
+ ║ ║
70
+ ║ □ MOCKUP aprovado pelo humano ║
71
+ ║ □ Documento de Integração disponível ║
72
+ ║ □ User stories com critérios de aceite ║
73
+ ║ □ BDD scenarios escritos ║
74
+ ╚══════════════════════════════════════════════╝`,
75
+ implementationRules: 'Regras de Implementação',
76
+ implementationRulesBody: `□ Componente segue MOCKUP aprovado (não inventar UI)
77
+ □ TODOS os estados implementados:
78
+ - ✅ Com dados (estado normal)
79
+ - 📭 Vazio (empty state)
80
+ - ⏳ Carregando (loading state / skeleton)
81
+ - ❌ Erro (error state com mensagem clara)
82
+ □ Lógica de negócio em services (NUNCA no componente)
83
+ □ State management adequado (sem prop drilling)
84
+ □ Formulários com validação client-side
85
+ □ Responsivo (testar mobile + desktop)
86
+ □ Acessibilidade básica (labels, aria, contraste)
87
+ □ Lazy loading onde aplicável
88
+ □ Cobertura ≥ {coverage}%`
89
+ },
90
+ security: {
91
+ description: 'Security Auditor — Análise de ameaças, compliance, vulnerabilidades',
92
+ title: '🛡️ SECURITY AUDITOR',
93
+ analysisFor: 'Análise de segurança para {projectName}',
94
+ checklist: 'Checklist OWASP Top 10',
95
+ checklistBody: `□ A01: Broken Access Control — RBAC implementado?
96
+ □ A02: Cryptographic Failures — Dados sensíveis criptografados?
97
+ □ A03: Injection — Inputs sanitizados? Queries parametrizadas?
98
+ □ A04: Insecure Design — Threat model feito?
99
+ □ A05: Security Misconfiguration — Headers, CORS, defaults?
100
+ □ A06: Vulnerable Components — Deps atualizadas?
101
+ □ A07: Auth Failures — Brute force protegido? Session management?
102
+ □ A08: Software Integrity — Supply chain verificado?
103
+ □ A09: Logging Failures — Audit log para ações sensíveis?
104
+ □ A10: SSRF — Server-side requests validados?`,
105
+ whenToActivate: 'Quando Ativar',
106
+ whenToActivateBody: `- Qualquer feature que lida com: autenticação, autorização, dados pessoais, pagamentos
107
+ - Novas APIs públicas
108
+ - Integrações com sistemas externos
109
+ - Mudanças em infra/deploy`,
110
+ expectedOutput: 'Output Esperado',
111
+ expectedOutputBody: `1. Lista de findings com severidade (CRITICAL/HIGH/MEDIUM/LOW)
112
+ 2. Recomendações de mitigação
113
+ 3. Threat model (se aplicável)`
114
+ },
115
+ qa: {
116
+ description: 'QA Test Engineer — Planos de teste, BDD/TDD, cobertura',
117
+ title: '🧪 QA TEST ENGINEER',
118
+ qualityFor: 'Qualidade de testes para {projectName}',
119
+ nonNegotiable: 'Metas Inegociáveis',
120
+ nonNegotiableBody: `╔══════════════════════════════════════════╗
121
+ ║ Cobertura mínima: {coverage}% ║
122
+ ║ Sem testes, sem entrega, sem finalizar ║
123
+ ║ INEGOCIÁVEL. ║
124
+ ╚══════════════════════════════════════════╝`,
125
+ pyramid: 'Pirâmide de Testes',
126
+ pyramidBody: ` ╱╲
127
+ ╱ E2E╲ → Poucos, lentos, alto valor
128
+ ╱──────╲
129
+ ╱Integration╲ → Médio, validam integração
130
+ ╱──────────────╲
131
+ ╱ Unit Tests ╲ → Muitos, rápidos, baratos
132
+ ╱════════════════════╲`,
133
+ process: 'Processo',
134
+ processBody: `1. **BDD primeiro** — cenários Gherkin antes de código
135
+ 2. **TDD** — RED → GREEN → REFACTOR
136
+ 3. **Coverage** — verificar após cada implementação
137
+ 4. **Regressão** — TODOS os testes antigos devem continuar passando
138
+ 5. **Review** — testes são revisados junto com código`,
139
+ refactoringRoadmap: 'Refactoring Roadmap'
140
+ },
141
+ techDebt: {
142
+ description: 'Tech Debt Controller — Controle de débito técnico e metas de score',
143
+ title: '📊 TECH DEBT CONTROLLER',
144
+ controlFor: 'Controle de débito técnico para {projectName}',
145
+ currentState: 'Estado Atual',
146
+ stateTable: `| Métrica | Valor |
147
+ |---------|-------|
148
+ | Score | {score}/100 |
149
+ | Meta | {target}/100 |
150
+ | Anti-patterns | {antiPatterns} |
151
+ | Refatorações pendentes | {refactoringSteps} |
152
+ | Estimativa de Melhora | +{improvement} pontos |`,
153
+ refactoringRoadmap: 'Roadmap de Refatoração',
154
+ scoreTargets: 'Metas de Score',
155
+ scoreTargetsBody: `Score Atual: {score}/100
156
+ Meta Curto Prazo: {targetShort}/100
157
+ Meta Médio Prazo: {targetMedium}/100
158
+ Mínimo Aceitável: {threshold}/100`,
159
+ rules: 'Regras',
160
+ rulesBody: `□ Score NUNCA pode regredir após um PR
161
+ □ Mínimo: {threshold}/100
162
+ □ Críticos: resolver dentro de 1 sprint
163
+ □ Altos: resolver dentro de 2 sprints
164
+ □ Médios: adicionar ao backlog técnico
165
+ □ Verificar com: architect score ./src`
166
+ },
167
+ codeReview: {
168
+ description: 'Code Review Checklist — Pontos obrigatórios de revisão',
169
+ title: '🔍 CODE REVIEW CHECKLIST — {projectName}',
170
+ mandatoryRule: '**Todo PR deve ser verificado contra este checklist.**',
171
+ mandatory: 'Obrigatório',
172
+ mandatoryBody: `□ Código compila sem erros
173
+ □ Todos os testes passam
174
+ □ Cobertura ≥ {coverage}%
175
+ □ Lint sem errors
176
+ □ Nenhum secret hardcoded
177
+ □ Score não regrediu`,
178
+ functional: 'Funcional',
179
+ functionalBody: `□ Atende aos critérios de aceite
180
+ □ Edge cases tratados
181
+ □ Erros tratados adequadamente
182
+ □ Não quebra features existentes`,
183
+ quality: 'Qualidade',
184
+ qualityBody: `□ Código legível sem comentários explicativos
185
+ □ Naming descritivo e consistente
186
+ □ Funções pequenas e com responsabilidade única
187
+ □ Sem código duplicado (DRY)
188
+ □ Lógica complexa está isolada em funções testáveis
189
+ □ Sem grandes blocos de código comentado`,
190
+ domainReviewItems: 'Itens de Revisão Específicos do Domínio: {domain}',
191
+ domainRules: {
192
+ fintech: `□ Transações são idempotentes?
193
+ □ Auditoria completa de todas as operações?
194
+ □ Sem exposição de dados sensíveis em logs?
195
+ □ Valores monetários não usam float (usar Decimal)?
196
+ □ PCI-DSS compliance verificado?`,
197
+ healthtech: `□ LGPD compliance verificado (consentimento, retenção)?
198
+ □ Dados sensíveis criptografados em repouso?
199
+ □ Acesso auditado e logado?
200
+ □ Anonimização implementada corretamente?
201
+ □ 2FA em operações sensíveis?`,
202
+ ecommerce: `□ Carrinho é idempotente?
203
+ □ Inventário é atualizado corretamente (race conditions)?
204
+ □ Preços são validados (sem manipulação client-side)?
205
+ □ Cupons/descontos aplicados corretamente?
206
+ □ Fraude detection implementado?`,
207
+ default: `□ Fluxo crítico de negócio não quebrou?
208
+ □ Rollback é seguro?
209
+ □ Concorrência tratada?
210
+ □ State final é consistente?`
211
+ },
212
+ stackReviewItems: 'Checklist Específico para {stack}',
213
+ stackRules: {
214
+ ts: `□ \`strict: true\` em tsconfig (sem any sem justificativa)?
215
+ □ Imports circulares?
216
+ □ Async/await tratado (sem unhandled promises)?
217
+ □ Memory leaks (EventListeners desinscritos)?
218
+ □ Console.log/debugger removidos?`,
219
+ python: `□ Type hints em todas as funções públicas?
220
+ □ Docstrings formatadas (Google ou NumPy style)?
221
+ □ Sem mutable default arguments?
222
+ □ Context managers usados para resources?
223
+ □ F-strings em vez de % ou .format()?
224
+ □ Sem \`eval()\` ou \`exec()\`?`,
225
+ go: `□ Erros tratados (não ignorados com _)?
226
+ □ Defer para cleanup?
227
+ □ Goroutines com contexto?
228
+ □ Race conditions testadas?
229
+ □ Timeouts implementados?`,
230
+ dart: `□ Null-safety (! evitado)?
231
+ □ Widgets têm keys quando em listas?
232
+ □ BuildContext acessado apenas em build?
233
+ □ Listeners desinscritos?
234
+ □ Imagens/assets fazem lazy-load?`,
235
+ default: `□ Código segue padrões do projeto?
236
+ □ Dependencies atualizadas?
237
+ □ Sem warnings do compilador/linter?`
238
+ },
239
+ integrationReviewItems: 'Itens de Revisão de Integração',
240
+ integrationRulesBody: `□ Endpoint trata todos os status codes esperados?
241
+ □ Validação do payload de entrada?
242
+ {auth}
243
+ {validation}
244
+ □ Resposta segue o contrato documentado?
245
+ □ Erros retornam mensagens claras?
246
+ □ Rate limiting aplicado?
247
+ □ Logging estruturado?`
248
+ }
249
+ },
250
+
251
+ // === DYNAMIC BLOCKS ===
252
+ dynamic: {
253
+ compliance: {
254
+ title: 'Requisitos de Compliance Detectados',
255
+ reason: 'Motivo',
256
+ mandatoryChecks: 'Verificações Obrigatórias'
257
+ },
258
+ integrations: {
259
+ title: 'Segurança em Integrações',
260
+ threats: 'Ameaças',
261
+ types: {
262
+ payment: 'PCI-DSS, criptografia de dados sensíveis, tokenização',
263
+ auth: 'MFA, session hijacking, credential stuffing',
264
+ api: 'Rate limiting, API key rotation, HTTPS obrigatório',
265
+ database: 'SQL Injection, Encryption at rest, Backups',
266
+ government: 'Compliance regulatório, audit trails, data retention',
267
+ default: 'Validação de entrada/saída, rate limiting'
268
+ }
269
+ },
270
+ domainThreats: {
271
+ title: 'Ameaças Específicas do Domínio: {domain}',
272
+ fintech: `- **Manipulação de dados:** Auditoria de transações, checksums, criptografia
273
+ - **Acesso não autorizado:** MFA em contas privilégiadas, IP whitelist
274
+ - **Conformidade:** PCI-DSS, LGPD, SOX
275
+ - **Fraude:** Detecção de anomalias, rate limiting`,
276
+ healthtech: `- **Vazamento de dados:** Criptografia end-to-end, anonimização
277
+ - **HIPAA/LGPD:** Audit trails, consentimento explícito
278
+ - **Integridade:** Assinatura digital, blockchain se aplicável
279
+ - **Acesso:** RBAC granular, 2FA para dados sensíveis`,
280
+ ecommerce: `- **Fraude de pagamento:** CVV validation, 3D Secure
281
+ - **Roubo de dados:** SSL/TLS, PCI-DSS, criptografia em repouso
282
+ - **DoS:** Rate limiting, CAPTCHA, WAF
283
+ - **Autenticação:** MFA, session timeout`,
284
+ default: `- **Confidencialidade:** Dados em trânsito e repouso criptografados
285
+ - **Integridade:** Validação de entrada, checksums
286
+ - **Disponibilidade:** Backup, disaster recovery, monitoring
287
+ - **Auditoria:** Logging de ações sensíveis, retention policy`
288
+ },
289
+ qaDomain: {
290
+ title: 'Cenários de Teste Específicos do Domínio: {domain}',
291
+ fintech: `### Testes de Negócio
292
+ - Criar transação com valores válidos
293
+ - Rejeitar transação acima do limite
294
+ - Processar reembolso corretamente
295
+ - Auditoria de todas as transações
296
+ - Validar saldo após múltiplas operações
297
+
298
+ ### Testes de Segurança
299
+ - Não expor dados de cartão em logs
300
+ - Validar PCI-DSS compliance
301
+ - Testar detecção de fraude`,
302
+ healthtech: `### Testes de Negócio
303
+ - Criar registro de paciente com LGPD compliance
304
+ - Validar consentimento antes de compartilhar dados
305
+ - Anonimizar dados corretamente
306
+ - Respeitar direito ao esquecimento
307
+ - Auditoria de acesso a dados sensíveis
308
+
309
+ ### Testes de Segurança
310
+ - Criptografia end-to-end em repouso
311
+ - Validar 2FA para dados críticos
312
+ - Testar retenção de dados`,
313
+ ecommerce: `### Testes de Negócio
314
+ - Criar carrinho com múltiplos produtos
315
+ - Aplicar desconto/cupom corretamente
316
+ - Processar pagamento com validação 3DS
317
+ - Atualizar inventário após venda
318
+ - Gerar pedido com status correto
319
+
320
+ ### Testes de Segurança
321
+ - Não expor dados de cartão
322
+ - Validar rate limiting em checkout
323
+ - Testar proteção contra fraud`,
324
+ default: `### Testes de Negócio
325
+ - Fluxo principal (happy path)
326
+ - Edge cases e limites
327
+ - Concorrência (race conditions)
328
+ - Rollback após erro
329
+ - Idempotência
330
+
331
+ ### Testes de Segurança
332
+ - Inputs inválidos/maliciosos
333
+ - Acesso não autorizado
334
+ - Rate limiting
335
+ - Logging correto`
336
+ }
337
+ }
338
+ };
339
+
340
+ // Types mapped from ptBR structure
341
+ export type AppTranslation = typeof ptBR;