jarvis-ai-framework 2.1.0 → 3.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 (303) hide show
  1. package/AGENTS.md +22 -122
  2. package/agents/AGENTS.md +20 -24
  3. package/agents/README.md +25 -129
  4. package/agents/engineering/data/eng.data-engineer.agent.md +12 -35
  5. package/agents/engineering/eng.agent.md +18 -30
  6. package/agents/engineering/eng.bug-hunter.md +9 -12
  7. package/agents/engineering/eng.dev-code-reviewer.md +5 -1
  8. package/agents/engineering/eng.docs-writer.md +3 -3
  9. package/agents/engineering/eng.frontend.agent.md +13 -8
  10. package/agents/engineering/eng.rpa.agent.md +5 -13
  11. package/agents/engineering/eng.ux-designer.agent.md +4 -0
  12. package/agents/engineering/qa/eng.qa.quality-champion-task-agent.md +4 -0
  13. package/agents/engineering/qa/eng.qa.quality-strategist.md +13 -8
  14. package/agents/engineering/qa/eng.qa.test-architect.md +16 -15
  15. package/agents/engineering/qa/eng.qa.test-planner.md +22 -17
  16. package/agents/engineering/qa/eng.qa.testing-engineer.md +99 -15
  17. package/agents/product/prod.discovery-interviewer.md +22 -3
  18. package/agents/product/prod.pm-checker.md +4 -0
  19. package/bin/README.md +142 -0
  20. package/bin/commands/docs-publish.js +105 -141
  21. package/bin/commands/docs-sync.js +66 -104
  22. package/bin/commands/info.js +7 -27
  23. package/bin/commands/init.js +23 -51
  24. package/bin/commands/install-rtk.js +9 -3
  25. package/bin/commands/list.js +5 -18
  26. package/bin/commands/map.js +58 -0
  27. package/bin/commands/qa-signoff.js +58 -55
  28. package/bin/commands/tokens.js +90 -0
  29. package/bin/commands/whoami.js +30 -26
  30. package/bin/jarvis.js +9 -153
  31. package/bin/lib/auth/session.js +20 -20
  32. package/bin/lib/cli/program.js +219 -0
  33. package/bin/lib/cli/shared-options.js +29 -0
  34. package/bin/lib/config/constants.js +70 -2
  35. package/bin/lib/config/ide-config.js +4 -8
  36. package/bin/lib/core/profile-filter.js +116 -0
  37. package/bin/lib/core/scanner.js +5 -31
  38. package/bin/lib/core/sync-engine.js +21 -14
  39. package/bin/lib/core/token-report.js +100 -0
  40. package/bin/lib/docs/fetch-file.js +39 -0
  41. package/bin/lib/docs/publish-file.js +194 -0
  42. package/bin/lib/docs/redis-cache.js +49 -0
  43. package/bin/lib/docs/validate-frontmatter.js +9 -39
  44. package/bin/lib/env-loader.js +11 -34
  45. package/bin/lib/flow-map/index.js +65 -0
  46. package/bin/lib/flow-map/parse.js +223 -0
  47. package/bin/lib/flow-map/render.js +89 -0
  48. package/bin/lib/flow-map/tree.js +248 -0
  49. package/bin/lib/tasks/comment.js +40 -35
  50. package/bin/lib/utils/frontmatter.js +57 -0
  51. package/bin/lib/utils/git-parser.js +4 -6
  52. package/bin/lib/utils/npmrc-parser.js +6 -13
  53. package/bin/lib/utils/paths.js +2 -4
  54. package/bin/lib/utils/ui.js +3 -9
  55. package/bin/lib/vcs/api.js +25 -41
  56. package/bin/lib/vcs/create-issue.js +49 -33
  57. package/bin/lib/vcs/create-merge.js +47 -31
  58. package/bin/lib/vcs/fetch-raw.js +35 -23
  59. package/members.md +1 -1
  60. package/package.json +15 -4
  61. package/rules/AGENTS.md +18 -7
  62. package/rules/engineering/eng-rules.md +3 -13
  63. package/rules/engineering/eng-security-rules.md +19 -18
  64. package/rules/engineering/eng.bump-rules.md +3 -2
  65. package/rules/engineering/eng.docs-scraping-rules.md +4 -4
  66. package/rules/engineering/eng.integrations-rules.md +3 -7
  67. package/rules/engineering/eng.skills-rules.md +1 -5
  68. package/rules/engineering/eng.specializations-rules.md +18 -8
  69. package/rules/engineering/frontend/eng.frontend-rules.md +1 -4
  70. package/rules/engineering/qa/eng.qa.cypress-standards-rules.md +1 -1
  71. package/rules/engineering/rpa/eng.rpa-rules.md +4 -9
  72. package/rules/product/README.md +1 -0
  73. package/rules/product/prod-rules.md +1 -4
  74. package/rules/product/prod.spec-rules.md +0 -4
  75. package/rules/rtk-rules.md +0 -1
  76. package/{rules → rules-on-demand}/engineering/eng.breakdown-subtasks-rules.md +0 -4
  77. package/{rules → rules-on-demand}/engineering/eng.plan-rules.md +0 -4
  78. package/{rules → rules-on-demand}/engineering/eng.pr-rules.md +0 -4
  79. package/{rules → rules-on-demand}/engineering/eng.pre-pr-rules.md +0 -4
  80. package/{rules → rules-on-demand}/engineering/eng.start-rules.md +0 -4
  81. package/{rules → rules-on-demand}/engineering/eng.tech-spec-rules.md +1 -2
  82. package/{rules → rules-on-demand}/engineering/eng.work-rules.md +0 -4
  83. package/skills/AGENTS.md +69 -106
  84. package/skills/SKILLS-ROADMAP.md +47 -132
  85. package/skills/eng-ai/SKILL.md +270 -0
  86. package/skills/eng-ai/references/1-fundamentos-ml.md +24 -0
  87. package/skills/eng-ai/references/10-arquitetura-solucoes-ia.md +24 -0
  88. package/skills/eng-ai/references/11-governanca-ia.md +24 -0
  89. package/skills/eng-ai/references/12-seguranca-ia-responsavel.md +25 -0
  90. package/skills/eng-ai/references/2-matematica-estatistica.md +24 -0
  91. package/skills/eng-ai/references/3-dados-para-ia.md +24 -0
  92. package/skills/eng-ai/references/4-deep-learning-fundacionais.md +24 -0
  93. package/skills/eng-ai/references/5-llms-chatbots-agentes-rag.md +25 -0
  94. package/skills/eng-ai/references/6-avaliacao-experimentacao.md +24 -0
  95. package/skills/eng-ai/references/7-engenharia-sistemas-ia.md +24 -0
  96. package/skills/eng-ai/references/8-mlops-plataforma.md +24 -0
  97. package/skills/eng-ai/references/9-produto-ia.md +24 -0
  98. package/skills/eng-ai/references/especializacoes.md +17 -0
  99. package/skills/eng-automation/SKILL.md +290 -0
  100. package/skills/eng-automation/references/1-fundamentos-automacao.md +25 -0
  101. package/skills/eng-automation/references/10-ingestao-dados.md +25 -0
  102. package/skills/eng-automation/references/11-captcha-antibot.md +25 -0
  103. package/skills/eng-automation/references/12-limites-taxa-sessoes.md +25 -0
  104. package/skills/eng-automation/references/13-agendamento-orquestracao.md +24 -0
  105. package/skills/eng-automation/references/14-retentativa-erros.md +25 -0
  106. package/skills/eng-automation/references/15-autenticacao-credenciais.md +24 -0
  107. package/skills/eng-automation/references/16-observabilidade-confiabilidade.md +24 -0
  108. package/skills/eng-automation/references/2-aquisicao-dados.md +25 -0
  109. package/skills/eng-automation/references/3-automacao-navegador.md +24 -0
  110. package/skills/eng-automation/references/4-scraping-crawling.md +25 -0
  111. package/skills/eng-automation/references/5-apis-rest-graphql-soap.md +26 -0
  112. package/skills/eng-automation/references/6-webhooks-integracao.md +25 -0
  113. package/skills/eng-automation/references/7-rpa.md +25 -0
  114. package/skills/eng-automation/references/8-extracao-estruturada.md +25 -0
  115. package/skills/eng-automation/references/9-extracao-documentos.md +25 -0
  116. package/skills/eng-automation/references/especializacoes.md +18 -0
  117. package/skills/eng-backend/SKILL.md +6 -0
  118. package/skills/eng-backend-arch-c4/SKILL.md +10 -4
  119. package/skills/eng-backend-microservices-trace/SKILL.md +6 -0
  120. package/skills/eng-backend-nestjs/SKILL.md +17 -462
  121. package/skills/eng-backend-nestjs/references/1-arquitetura-modulos.md +54 -0
  122. package/skills/eng-backend-nestjs/references/2-guards-autenticacao.md +118 -0
  123. package/skills/eng-backend-nestjs/references/3-interceptors-pipes-filters.md +113 -0
  124. package/skills/eng-backend-nestjs/references/4-config-logging.md +61 -0
  125. package/skills/eng-backend-nestjs/references/5-testes.md +83 -0
  126. package/skills/eng-backend-nestjs/references/6-problemas-comuns.md +53 -0
  127. package/skills/eng-backend-rabbitmq/SKILL.md +15 -298
  128. package/skills/eng-backend-rabbitmq/references/1-referencia-endpoints.md +28 -0
  129. package/skills/eng-backend-rabbitmq/references/2-codigo-consumer-producer.md +90 -0
  130. package/skills/eng-backend-rabbitmq/references/3-arquiteturas-comuns.md +101 -0
  131. package/skills/eng-backend-rabbitmq/references/4-troubleshooting.md +93 -0
  132. package/skills/eng-data/SKILL.md +271 -0
  133. package/skills/eng-data/references/1-fundamentos-dados.md +24 -0
  134. package/skills/eng-data/references/10-ciencia-dados.md +24 -0
  135. package/skills/eng-data/references/11-dataops-plataforma.md +24 -0
  136. package/skills/eng-data/references/12-seguranca-privacidade.md +24 -0
  137. package/skills/eng-data/references/2-modelagem-dados.md +24 -0
  138. package/skills/eng-data/references/3-bancos-dados.md +24 -0
  139. package/skills/eng-data/references/4-arquitetura-dados.md +24 -0
  140. package/skills/eng-data/references/5-pipelines-integracao.md +24 -0
  141. package/skills/eng-data/references/6-qualidade-dados.md +24 -0
  142. package/skills/eng-data/references/7-governanca-metadados.md +24 -0
  143. package/skills/eng-data/references/8-estatistica-analise.md +24 -0
  144. package/skills/eng-data/references/9-analytics-bi.md +24 -0
  145. package/skills/eng-data/references/especializacoes.md +20 -0
  146. package/skills/eng-frontend/SKILL.md +18 -5
  147. package/skills/eng-frontend/references/13-design-system.md +48 -0
  148. package/skills/eng-frontend/references/14-microfrontend.md +46 -0
  149. package/skills/eng-global-docs-write/SKILL.md +10 -5
  150. package/skills/eng-global-pr/SKILL.md +7 -1
  151. package/skills/eng-global-task-comment/SKILL.md +8 -2
  152. package/skills/eng-platform/SKILL.md +331 -0
  153. package/skills/eng-platform/references/1-fundamentos-sistemas.md +23 -0
  154. package/skills/eng-platform/references/10-resiliencia-arquitetura.md +24 -0
  155. package/skills/eng-platform/references/11-plataforma-devex.md +24 -0
  156. package/skills/eng-platform/references/12-finops-custos.md +24 -0
  157. package/skills/eng-platform/references/13-seguranca-fundamentos.md +26 -0
  158. package/skills/eng-platform/references/14-profiling-performance.md +23 -0
  159. package/skills/eng-platform/references/15-testes-carga-chaos.md +23 -0
  160. package/skills/eng-platform/references/16-cache-multicamada.md +22 -0
  161. package/skills/eng-platform/references/2-redes.md +23 -0
  162. package/skills/eng-platform/references/3-cloud.md +24 -0
  163. package/skills/eng-platform/references/4-iac-automacao.md +24 -0
  164. package/skills/eng-platform/references/5-containers-orquestracao.md +25 -0
  165. package/skills/eng-platform/references/6-cicd-entrega.md +24 -0
  166. package/skills/eng-platform/references/7-observabilidade.md +24 -0
  167. package/skills/eng-platform/references/8-confiabilidade-sre.md +24 -0
  168. package/skills/eng-platform/references/9-seguranca-infra.md +26 -0
  169. package/skills/eng-platform/references/especializacoes.md +34 -0
  170. package/skills/eng-qa/SKILL.md +283 -0
  171. package/skills/eng-qa/references/1-fundamentos-qualidade.md +25 -0
  172. package/skills/eng-qa/references/10-confiabilidade.md +25 -0
  173. package/skills/eng-qa/references/11-seguranca.md +24 -0
  174. package/skills/eng-qa/references/12-acessibilidade.md +24 -0
  175. package/skills/eng-qa/references/13-dados-testes.md +24 -0
  176. package/skills/eng-qa/references/14-gestao-testes-defeitos.md +25 -0
  177. package/skills/eng-qa/references/15-arquitetura-qa.md +25 -0
  178. package/skills/eng-qa/references/2-estrategia-planejamento.md +25 -0
  179. package/skills/eng-qa/references/3-design-testes.md +25 -0
  180. package/skills/eng-qa/references/4-manual-exploratorio.md +24 -0
  181. package/skills/eng-qa/references/5-automacao-testes.md +25 -0
  182. package/skills/eng-qa/references/6-api-integracao.md +25 -0
  183. package/skills/eng-qa/references/7-contrato.md +24 -0
  184. package/skills/eng-qa/references/8-interface-compat-mobile.md +24 -0
  185. package/skills/eng-qa/references/9-performance.md +24 -0
  186. package/skills/eng-qa/references/especializacoes.md +29 -0
  187. package/skills/eng-qa-planner/SKILL.md +264 -0
  188. package/skills/jarvis-context-detect/SKILL.md +7 -1
  189. package/skills/jarvis-context-detect/assets/context-profile-template.md +1 -1
  190. package/skills/jarvis-create-specialization/SKILL.md +14 -0
  191. package/skills/jarvis-docs-central/README.md +31 -28
  192. package/skills/jarvis-docs-central/SKILL.md +11 -5
  193. package/skills/jarvis-docs-index/SKILL.md +10 -2
  194. package/skills/jarvis-evolution-architect/SKILL.md +6 -0
  195. package/skills/jarvis-init/SKILL.md +22 -15
  196. package/skills/jarvis-init/assets/passo-adicionar-stacks.md +47 -18
  197. package/skills/jarvis-list-specializations/SKILL.md +36 -17
  198. package/skills/jarvis-report-issue/SKILL.md +7 -1
  199. package/skills/product-roadmap-report/SKILL.md +8 -0
  200. package/skills/product-specs/SKILL.md +9 -0
  201. package/skills/product-specs-update/SKILL.md +6 -0
  202. package/taxonomy.md +16 -28
  203. package/templates/AGENTS.md +2 -0
  204. package/templates/ENV-template.md +10 -2
  205. package/templates/engineering/qa/qa.sprint-plan-template.md +1 -1
  206. package/templates/engineering/tech-spec-delivery-template.md +179 -0
  207. package/workflows/AGENTS.md +14 -2
  208. package/workflows/README.md +8 -16
  209. package/workflows/all-tools.md +7 -1
  210. package/workflows/engineering/data/data.contract.md +8 -0
  211. package/workflows/engineering/data/data.new-pipeline.md +15 -4
  212. package/workflows/engineering/eng.breakdown-subtasks.md +9 -0
  213. package/workflows/engineering/eng.bug-audit.md +10 -13
  214. package/workflows/engineering/eng.build-tech-spec.md +17 -146
  215. package/workflows/engineering/eng.create-ard-from-code.md +8 -0
  216. package/workflows/engineering/eng.create-ard.md +8 -0
  217. package/workflows/engineering/eng.create-rfc.md +7 -0
  218. package/workflows/engineering/eng.debug.md +5 -21
  219. package/workflows/engineering/eng.docs.md +9 -0
  220. package/workflows/engineering/eng.light-arch.md +7 -0
  221. package/workflows/engineering/eng.plan.md +15 -2
  222. package/workflows/engineering/eng.pr.md +24 -30
  223. package/workflows/engineering/eng.pre-pr.md +33 -15
  224. package/workflows/engineering/eng.review.md +18 -11
  225. package/workflows/engineering/eng.rpa.robot.md +17 -7
  226. package/workflows/engineering/eng.start.md +33 -12
  227. package/workflows/engineering/eng.work.md +25 -17
  228. package/workflows/engineering/frontend/eng.frontend-component.md +7 -0
  229. package/workflows/engineering/frontend/eng.frontend-perf-audit.md +8 -0
  230. package/workflows/engineering/frontend/eng.frontend-review.md +8 -0
  231. package/workflows/engineering/qa/eng.qa-refinement-entry.md +7 -0
  232. package/workflows/engineering/qa/eng.qa-release-signoff.md +6 -0
  233. package/workflows/engineering/qa/eng.qa-sprint-planning.md +7 -1
  234. package/workflows/product/prod.roadmap.preview.md +9 -0
  235. package/workflows/product/prod.spec.ard.md +97 -0
  236. package/workflows/product/prod.spec.breakdown.md +10 -0
  237. package/workflows/product/prod.spec.clarify.md +8 -2
  238. package/workflows/product/prod.spec.discovery.md +11 -1
  239. package/workflows/product/prod.spec.epic.md +8 -0
  240. package/workflows/product/prod.spec.frd.md +7 -0
  241. package/workflows/product/prod.spec.issue.md +6 -0
  242. package/workflows/product/prod.spec.md +15 -1
  243. package/workflows/product/prod.spec.prd.md +7 -0
  244. package/workflows/taxonomy.md +58 -6
  245. package/workflows/warm-up.md +47 -60
  246. package/agents/engineering/eng.cybersecurity.agent.md +0 -488
  247. package/agents/engineering/qa/eng.qa.cypress-specialist.md +0 -109
  248. package/bin/lib/docs/fetch-file.sh +0 -41
  249. package/bin/lib/docs/publish-file.sh +0 -284
  250. package/rules/engineering/eng.downstream-flow-rules.md +0 -297
  251. package/rules/engineering/qa/eng.qa.exploratory-session-rules.md +0 -137
  252. package/rules/engineering/qa/eng.qa.quality-gate-scoring-rules.md +0 -181
  253. package/rules/engineering/qa/eng.qa.tech-spec-validation-criteria-rules.md +0 -120
  254. package/skills/eng-ai-engineer/SKILL.md +0 -297
  255. package/skills/eng-data-bi/SKILL.md +0 -200
  256. package/skills/eng-data-debug/SKILL.md +0 -308
  257. package/skills/eng-data-engineer/SKILL.md +0 -257
  258. package/skills/eng-data-onboard/SKILL.md +0 -311
  259. package/skills/eng-data-orchestrator/SKILL.md +0 -427
  260. package/skills/eng-devops-performance-engineer/SKILL.md +0 -313
  261. package/skills/eng-frontend-design-system/SKILL.md +0 -621
  262. package/skills/eng-frontend-microfrontend/SKILL.md +0 -604
  263. package/skills/eng-global-browser-extension-builder/SKILL.md +0 -386
  264. package/skills/eng-global-jira-comment/SKILL.md +0 -21
  265. package/skills/eng-qa-a11y-audit/SKILL.md +0 -270
  266. package/skills/eng-qa-bug-report/SKILL.md +0 -1089
  267. package/skills/eng-qa-bug-report/TASK_MANAGERS.md +0 -138
  268. package/skills/eng-qa-cypress-e2e/SKILL.md +0 -178
  269. package/skills/eng-qa-dev-guide/SKILL.md +0 -165
  270. package/skills/eng-qa-e2e/SKILL.md +0 -401
  271. package/skills/eng-qa-e2e-spec-writer/SKILL.md +0 -323
  272. package/skills/eng-qa-exploratory/SKILL.md +0 -189
  273. package/skills/eng-qa-gate/SKILL.md +0 -371
  274. package/skills/eng-qa-gate/assets/checklist-validacao.md +0 -291
  275. package/skills/eng-qa-graphql-contract/SKILL.md +0 -257
  276. package/skills/eng-qa-quality-report/SKILL.md +0 -413
  277. package/skills/eng-qa-test-plan/SKILL.md +0 -467
  278. package/skills/eng-qa-testsprite/SKILL.md +0 -326
  279. package/skills/eng-qa-testsprite/references/testsprite-mcp.md +0 -224
  280. package/skills/eng-qa-unit-test/SKILL.md +0 -472
  281. package/skills/eng-scraper/SKILL.md +0 -684
  282. package/skills/eng-scraper-robot-builder/SKILL.md +0 -371
  283. package/skills/eng-security-cybersecurity/SKILL.md +0 -646
  284. package/skills/eng-security-patch/SKILL.md +0 -382
  285. package/skills/eng-security-threat-model/SKILL.md +0 -165
  286. package/skills/eng-security-triage/SKILL.md +0 -270
  287. package/templates/engineering/qa/eng.qa.quality-gate-examples-template.md +0 -311
  288. package/templates/engineering/qa/eng.qa.quality-gate-report-template.md +0 -249
  289. package/templates/engineering/qa/qa.cypress-test-template.md +0 -172
  290. package/templates/engineering/qa/qa.exploratory-session-template.md +0 -148
  291. package/templates/engineering/qa/qa.quality-report-template.md +0 -130
  292. package/workflows/engineering/eng.security-audit.md +0 -312
  293. package/workflows/engineering/eng.security-incident.md +0 -275
  294. package/workflows/engineering/eng.security-pipeline.md +0 -210
  295. package/workflows/engineering/eng.security-review.md +0 -235
  296. package/workflows/engineering/qa/eng.qa-dev-quality-guide.md +0 -51
  297. package/workflows/engineering/qa/eng.qa-e2e-test-generation.md +0 -51
  298. package/workflows/engineering/qa/eng.qa-exploratory-session.md +0 -60
  299. package/workflows/engineering/qa/eng.qa-quality-gate-validation.md +0 -202
  300. package/workflows/engineering/qa/eng.qa-quality-report.md +0 -78
  301. /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-coverage-template.md +0 -0
  302. /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-patterns.md +0 -0
  303. /package/templates/{CDD aplicado a Prompts.md → cdd-aplicado-a-prompts.md} +0 -0
@@ -1,621 +0,0 @@
1
- ---
2
- name: eng-frontend-design-system
3
- description: >
4
- Especialista em design system para frontends: tokens semânticos, componentes com CVA,
5
- Storybook, versionamento semver e auditoria de consistência visual.
6
- Compartilhado entre micro frontends e apps — é o pacote central de UI.
7
- Trigger: Use para criar ou expandir o design system, adicionar componentes ao catálogo,
8
- definir tokens de cor/tipografia/espaçamento, configurar Storybook, auditar uso de tokens
9
- ou planejar breaking change em componente público.
10
- license: AGPL-3.0
11
- compatibility: Designed for Claude Code (or similar products)
12
- allowed-tools: Read Write Edit Glob Grep Bash
13
- metadata:
14
- author: jarvis-team
15
- version: "1.0"
16
- area: frontend
17
- stack: design-system
18
- argument-hint: "[novo-componente|tokens|storybook|auditoria|breaking-change] [contexto]"
19
- disable-model-invocation: false
20
- ---
21
-
22
- # Eng Design System — Especialista em Biblioteca de UI Compartilhada
23
-
24
- > **Nota de stack:** Os exemplos de código neste skill usam **Tailwind CSS + CVA + Radix UI**
25
- > por ser a combinação mais comum em design systems React modernos. Os **princípios de tokens,
26
- > variantes e versionamento se aplicam a qualquer stack** — Styled Components, CSS Modules,
27
- > Emotion, Shadow DOM, etc. Adaptar a sintaxe conforme o framework do projeto.
28
-
29
- Você é um **especialista em design system** — o pacote central de componentes, tokens e padrões
30
- visuais compartilhados por todos os micro frontends e aplicações do produto.
31
-
32
- ## Objetivo
33
-
34
- Construir e evoluir um design system sólido: componentes corretos, acessíveis e versionados;
35
- tokens semânticos que traduzem decisões de design em código; Storybook como documentação viva;
36
- e processo claro para evoluir sem quebrar quem consome.
37
-
38
- ## O que é (e o que não é) um design system
39
-
40
- ```
41
- É: Não é:
42
- ✅ Componentes primitivos reutilizáveis ❌ Lógica de negócio
43
- ✅ Tokens de cor, tipo, espaçamento ❌ Chamadas de API
44
- ✅ Padrões de acessibilidade ❌ Estado global da aplicação
45
- ✅ Documentação no Storybook ❌ Componentes de feature específica
46
- ✅ Contrato público de props ❌ Implementação de tela completa
47
- ```
48
-
49
- ## Entrada
50
-
51
- - `$ARGUMENTS` — o que será feito: `novo-componente`, `tokens`, `storybook`, `auditoria`, `breaking-change`
52
-
53
- ## Recursos
54
-
55
- - **ENV**: `$IDE/ENV.md`
56
- - **Skill complementar**: `eng-frontend` (React), `eng-frontend-microfrontend` (consumo nos remotes)
57
-
58
- ---
59
-
60
- ## Pré-requisito
61
-
62
- Verificar estrutura existente antes de criar:
63
-
64
- ```bash
65
- # Localizar o pacote de design system
66
- ls packages/ | grep -i "design\|ui\|components"
67
-
68
- # Verificar dependências instaladas
69
- grep -E "cva|class-variance-authority|tailwind|radix|@headlessui" package.json
70
-
71
- # Verificar se Storybook está configurado
72
- ls .storybook/ 2>/dev/null
73
- ```
74
-
75
- ---
76
-
77
- ## Árvore de Decisão
78
-
79
- ```
80
- O que será feito?
81
- ├── Novo componente → Seção: Criando um Componente
82
- ├── Definir/atualizar tokens → Seção: Sistema de Tokens
83
- ├── Configurar/expandir Storybook → Seção: Storybook
84
- ├── Auditar consistência visual → Seção: Auditoria
85
- ├── Breaking change em componente → Seção: Versionamento e Breaking Changes
86
- └── Estrutura inicial do DS → Seção: Estrutura do Pacote
87
- ```
88
-
89
- ---
90
-
91
- ## Estrutura do Pacote
92
-
93
- ```
94
- packages/design-system/
95
- ├── src/
96
- │ ├── tokens/
97
- │ │ ├── colors.ts ← paleta + semântica de cor
98
- │ │ ├── typography.ts ← escala tipográfica
99
- │ │ ├── spacing.ts ← escala de espaçamento
100
- │ │ ├── shadows.ts ← elevações
101
- │ │ ├── radii.ts ← border-radius
102
- │ │ └── index.ts ← re-exporta todos os tokens
103
- │ ├── components/
104
- │ │ ├── Button/
105
- │ │ │ ├── Button.tsx
106
- │ │ │ ├── Button.stories.tsx
107
- │ │ │ ├── Button.test.tsx
108
- │ │ │ └── index.ts
109
- │ │ ├── Input/
110
- │ │ └── ...
111
- │ ├── hooks/ ← hooks utilitários (useMediaQuery, useTheme, etc.)
112
- │ ├── utils/ ← cn(), formatters, etc.
113
- │ └── index.ts ← ponto de entrada público
114
- ├── .storybook/
115
- ├── tailwind.config.ts ← ou tokens CSS via CSS custom properties
116
- ├── package.json
117
- └── tsconfig.json
118
- ```
119
-
120
- ```json
121
- // package.json — ponto de entrada correto
122
- {
123
- "name": "@{org}/design-system",
124
- "version": "1.0.0",
125
- "main": "./dist/index.js",
126
- "module": "./dist/index.mjs",
127
- "types": "./dist/index.d.ts",
128
- "exports": {
129
- ".": {
130
- "import": "./dist/index.mjs",
131
- "require": "./dist/index.js",
132
- "types": "./dist/index.d.ts"
133
- },
134
- "./tokens": {
135
- "import": "./dist/tokens/index.mjs",
136
- "types": "./dist/tokens/index.d.ts"
137
- }
138
- },
139
- "sideEffects": ["*.css"]
140
- }
141
- ```
142
-
143
- ---
144
-
145
- ## Sistema de Tokens
146
-
147
- ### Dois níveis: primitivos e semânticos
148
-
149
- ```typescript
150
- // src/tokens/colors.ts
151
-
152
- // Nível 1 — Primitivos (paleta completa — não usar diretamente nas aplicações)
153
- export const colorPrimitives = {
154
- blue50: '#eff6ff',
155
- blue100: '#dbeafe',
156
- blue500: '#3b82f6',
157
- blue600: '#2563eb',
158
- blue900: '#1e3a8a',
159
- gray50: '#f9fafb',
160
- gray100: '#f3f4f6',
161
- gray500: '#6b7280',
162
- gray900: '#111827',
163
- red500: '#ef4444',
164
- green500:'#22c55e',
165
- // ...
166
- } as const
167
-
168
- // Nível 2 — Semânticos (significado, não cor) — o que as aplicações usam
169
- export const colorTokens = {
170
- // Interação
171
- interactive: {
172
- primary: colorPrimitives.blue500,
173
- primaryHover: colorPrimitives.blue600,
174
- primaryFocus: colorPrimitives.blue500, // + ring
175
- destructive: colorPrimitives.red500,
176
- },
177
- // Conteúdo
178
- content: {
179
- primary: colorPrimitives.gray900,
180
- secondary: colorPrimitives.gray500,
181
- disabled: colorPrimitives.gray300,
182
- inverse: '#ffffff',
183
- },
184
- // Background
185
- background: {
186
- page: '#ffffff',
187
- subtle: colorPrimitives.gray50,
188
- overlay: 'rgba(0, 0, 0, 0.5)',
189
- },
190
- // Feedback
191
- feedback: {
192
- success: colorPrimitives.green500,
193
- error: colorPrimitives.red500,
194
- warning: '#f59e0b',
195
- info: colorPrimitives.blue500,
196
- },
197
- } as const
198
- ```
199
-
200
- ### Tokens em Tailwind (CSS custom properties)
201
-
202
- ```typescript
203
- // tailwind.config.ts
204
- import type { Config } from 'tailwindcss'
205
- import { colorPrimitives } from './src/tokens/colors'
206
-
207
- export default {
208
- content: ['./src/**/*.{ts,tsx}'],
209
- theme: {
210
- extend: {
211
- colors: {
212
- // Expor semânticos como classes Tailwind
213
- interactive: {
214
- primary: 'var(--color-interactive-primary)',
215
- 'primary-hover': 'var(--color-interactive-primary-hover)',
216
- },
217
- content: {
218
- primary: 'var(--color-content-primary)',
219
- secondary: 'var(--color-content-secondary)',
220
- },
221
- feedback: {
222
- success: 'var(--color-feedback-success)',
223
- error: 'var(--color-feedback-error)',
224
- },
225
- },
226
- spacing: {
227
- // Escala de 4px
228
- 1: '4px',
229
- 2: '8px',
230
- 3: '12px',
231
- 4: '16px',
232
- 6: '24px',
233
- 8: '32px',
234
- 10: '40px',
235
- 12: '48px',
236
- 16: '64px',
237
- },
238
- fontFamily: {
239
- sans: ['var(--font-sans)', 'system-ui', 'sans-serif'],
240
- mono: ['var(--font-mono)', 'monospace'],
241
- },
242
- fontSize: {
243
- xs: ['12px', { lineHeight: '16px' }],
244
- sm: ['14px', { lineHeight: '20px' }],
245
- base: ['16px', { lineHeight: '24px' }],
246
- lg: ['18px', { lineHeight: '28px' }],
247
- xl: ['20px', { lineHeight: '28px' }],
248
- '2xl':['24px', { lineHeight: '32px' }],
249
- '3xl':['30px', { lineHeight: '36px' }],
250
- },
251
- },
252
- },
253
- } satisfies Config
254
- ```
255
-
256
- ---
257
-
258
- ## Criando um Componente
259
-
260
- ### Checklist antes de criar
261
-
262
- - [ ] Verificar se já existe componente similar (`ls src/components/`)
263
- - [ ] Verificar se o Radix UI tem primitive para este componente
264
- - [ ] Confirmar variantes necessárias com design
265
- - [ ] Definir API de props antes de implementar
266
-
267
- ### Padrão com CVA (class-variance-authority)
268
-
269
- ```typescript
270
- // src/components/Button/Button.tsx
271
- import { cva, type VariantProps } from 'class-variance-authority'
272
- import { cn } from '../../utils/cn'
273
- import type { ButtonHTMLAttributes } from 'react'
274
-
275
- const buttonVariants = cva(
276
- // Base — aplicado a todas as variantes
277
- [
278
- 'inline-flex items-center justify-center gap-2',
279
- 'rounded font-medium transition-colors',
280
- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',
281
- 'disabled:opacity-50 disabled:pointer-events-none',
282
- ],
283
- {
284
- variants: {
285
- variant: {
286
- primary: 'bg-interactive-primary text-white hover:bg-interactive-primary-hover',
287
- secondary: 'border border-gray-300 bg-white text-content-primary hover:bg-gray-50',
288
- ghost: 'text-content-primary hover:bg-gray-100',
289
- destructive: 'bg-feedback-error text-white hover:bg-red-600',
290
- link: 'text-interactive-primary underline-offset-4 hover:underline p-0 h-auto',
291
- },
292
- size: {
293
- sm: 'h-8 px-3 text-sm',
294
- md: 'h-10 px-4 text-base',
295
- lg: 'h-12 px-6 text-lg',
296
- icon: 'h-10 w-10',
297
- },
298
- },
299
- defaultVariants: {
300
- variant: 'primary',
301
- size: 'md',
302
- },
303
- }
304
- )
305
-
306
- export interface ButtonProps
307
- extends ButtonHTMLAttributes<HTMLButtonElement>,
308
- VariantProps<typeof buttonVariants> {
309
- loading?: boolean
310
- }
311
-
312
- export function Button({
313
- className,
314
- variant,
315
- size,
316
- loading,
317
- disabled,
318
- children,
319
- ...props
320
- }: ButtonProps) {
321
- return (
322
- <button
323
- className={cn(buttonVariants({ variant, size }), className)}
324
- disabled={disabled || loading}
325
- aria-busy={loading}
326
- {...props}
327
- >
328
- {loading && <span className="sr-only">Carregando...</span>}
329
- {children}
330
- </button>
331
- )
332
- }
333
-
334
- // Exportar variantes para uso externo (ex: estender em outro componente)
335
- export { buttonVariants }
336
- ```
337
-
338
- ### Utilitário `cn` (obrigatório)
339
-
340
- ```typescript
341
- // src/utils/cn.ts
342
- import { clsx, type ClassValue } from 'clsx'
343
- import { twMerge } from 'tailwind-merge'
344
-
345
- export function cn(...inputs: ClassValue[]) {
346
- return twMerge(clsx(inputs))
347
- }
348
- ```
349
-
350
- ### Ponto de entrada do componente
351
-
352
- ```typescript
353
- // src/components/Button/index.ts
354
- export { Button, buttonVariants } from './Button'
355
- export type { ButtonProps } from './Button'
356
- ```
357
-
358
- ### Regras de API pública
359
-
360
- - Props que o consumidor pode precisar sobrescrever: exportar o tipo
361
- - Nunca expor detalhes de implementação interna nas props
362
- - `className` sempre aceito para extensibilidade
363
- - `ref` sempre passado via `forwardRef` em elementos DOM
364
-
365
- ```typescript
366
- // Padrão com forwardRef (obrigatório para componentes com elemento DOM)
367
- import { forwardRef } from 'react'
368
-
369
- export const Input = forwardRef<HTMLInputElement, InputProps>(
370
- function Input({ className, ...props }, ref) {
371
- return (
372
- <input
373
- ref={ref}
374
- className={cn(inputVariants(), className)}
375
- {...props}
376
- />
377
- )
378
- }
379
- )
380
- Input.displayName = 'Input'
381
- ```
382
-
383
- ---
384
-
385
- ## Acessibilidade em Componentes
386
-
387
- ### Componentes compostos com Radix UI
388
-
389
- ```typescript
390
- // ✅ Dialog com Radix — acessibilidade built-in
391
- import * as Dialog from '@radix-ui/react-dialog'
392
-
393
- export function Modal({ title, description, trigger, children }: ModalProps) {
394
- return (
395
- <Dialog.Root>
396
- <Dialog.Trigger asChild>{trigger}</Dialog.Trigger>
397
- <Dialog.Portal>
398
- <Dialog.Overlay className="fixed inset-0 bg-background-overlay" />
399
- <Dialog.Content
400
- className="fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 ..."
401
- aria-describedby={description ? 'modal-description' : undefined}
402
- >
403
- <Dialog.Title>{title}</Dialog.Title>
404
- {description && (
405
- <Dialog.Description id="modal-description">{description}</Dialog.Description>
406
- )}
407
- {children}
408
- <Dialog.Close asChild>
409
- <button aria-label="Fechar">✕</button>
410
- </Dialog.Close>
411
- </Dialog.Content>
412
- </Dialog.Portal>
413
- </Dialog.Root>
414
- )
415
- }
416
- ```
417
-
418
- ---
419
-
420
- ## Storybook
421
-
422
- ### Configuração base
423
-
424
- ```typescript
425
- // .storybook/main.ts
426
- import type { StorybookConfig } from '@storybook/react-vite'
427
-
428
- const config: StorybookConfig = {
429
- stories: ['../src/**/*.stories.@(ts|tsx)'],
430
- addons: [
431
- '@storybook/addon-essentials',
432
- '@storybook/addon-a11y', // auditoria de acessibilidade
433
- '@storybook/addon-interactions', // testes interativos
434
- ],
435
- framework: '@storybook/react-vite',
436
- }
437
- export default config
438
- ```
439
-
440
- ### Story padrão
441
-
442
- ```typescript
443
- // src/components/Button/Button.stories.tsx
444
- import type { Meta, StoryObj } from '@storybook/react'
445
- import { Button } from './Button'
446
-
447
- const meta: Meta<typeof Button> = {
448
- title: 'Components/Button',
449
- component: Button,
450
- tags: ['autodocs'],
451
- argTypes: {
452
- variant: {
453
- control: 'select',
454
- options: ['primary', 'secondary', 'ghost', 'destructive', 'link'],
455
- },
456
- size: {
457
- control: 'select',
458
- options: ['sm', 'md', 'lg', 'icon'],
459
- },
460
- loading: { control: 'boolean' },
461
- disabled: { control: 'boolean' },
462
- },
463
- }
464
- export default meta
465
- type Story = StoryObj<typeof Button>
466
-
467
- // Story principal — estado padrão
468
- export const Default: Story = {
469
- args: {
470
- children: 'Botão',
471
- variant: 'primary',
472
- size: 'md',
473
- },
474
- }
475
-
476
- // Todas as variantes juntas
477
- export const AllVariants: Story = {
478
- render: () => (
479
- <div className="flex flex-wrap gap-3">
480
- <Button variant="primary">Primary</Button>
481
- <Button variant="secondary">Secondary</Button>
482
- <Button variant="ghost">Ghost</Button>
483
- <Button variant="destructive">Destructive</Button>
484
- </div>
485
- ),
486
- }
487
-
488
- // Estados especiais
489
- export const Loading: Story = { args: { children: 'Salvando...', loading: true } }
490
- export const Disabled: Story = { args: { children: 'Desabilitado', disabled: true } }
491
- ```
492
-
493
- ### Checklist de story
494
- - [ ] Autodocs ativo (`tags: ['autodocs']`)
495
- - [ ] ArgTypes com `control` para cada prop variável
496
- - [ ] Story para cada estado relevante (loading, disabled, erro)
497
- - [ ] Story `AllVariants` para overview visual
498
- - [ ] Addon `a11y` habilitado (verificar violations na aba Accessibility)
499
-
500
- ---
501
-
502
- ## Auditoria de Consistência
503
-
504
- ### Detectar tokens hardcodados (proibido)
505
-
506
- ```bash
507
- # Cores hardcodadas no código (deve retornar zero resultados)
508
- grep -r "#[0-9a-fA-F]\{3,6\}\b" src/components/ --include="*.tsx" --include="*.ts"
509
- grep -r "rgb(\|rgba(\|hsl(" src/components/ --include="*.tsx"
510
-
511
- # Valores de espaçamento hardcodados
512
- grep -r "style={{" src/components/ --include="*.tsx" | grep -v "className"
513
-
514
- # Fontes hardcodadas
515
- grep -r "fontFamily\|fontSize" src/components/ --include="*.tsx" | grep -v "var(--font"
516
- ```
517
-
518
- ### Verificar componentes sem story
519
-
520
- ```bash
521
- # Componentes sem arquivo de story correspondente
522
- for f in src/components/**/*.tsx; do
523
- base="${f%.tsx}"
524
- [ ! -f "${base}.stories.tsx" ] && echo "SEM STORY: $f"
525
- done
526
- ```
527
-
528
- ### Verificar componentes sem teste
529
-
530
- ```bash
531
- for f in src/components/**/*.tsx; do
532
- base="${f%.tsx}"
533
- [ ! -f "${base}.test.tsx" ] && echo "SEM TESTE: $f"
534
- done
535
- ```
536
-
537
- ---
538
-
539
- ## Versionamento e Breaking Changes
540
-
541
- ### O que é uma breaking change?
542
-
543
- ```
544
- Breaking change (bump MAJOR):
545
- - Remover uma prop
546
- - Renomear uma prop sem alias de retrocompatibilidade
547
- - Alterar o tipo de uma prop (ex: string → enum)
548
- - Remover uma variante existente
549
- - Alterar comportamento padrão visível
550
-
551
- Non-breaking (bump MINOR ou PATCH):
552
- - Adicionar nova prop opcional
553
- - Adicionar nova variante
554
- - Corrigir bug visual
555
- - Melhorar acessibilidade
556
- - Atualizar documentação
557
- ```
558
-
559
- ### Processo para breaking change
560
-
561
- ```markdown
562
- 1. Criar deprecation notice na versão atual (adicionar `@deprecated` no JSDoc)
563
- 2. Documentar no CHANGELOG.md com seção "Migration Guide"
564
- 3. Dar prazo de 1 sprint para os consumidores migrarem (comunicar no canal do time)
565
- 4. Lançar major version com a mudança
566
- 5. Atualizar todos os remotes que consomem o componente
567
- ```
568
-
569
- ```typescript
570
- // Deprecation notice
571
- /** @deprecated Use `variant="destructive"` em vez de `danger`. Será removido em v2.0. */
572
- export type LegacyButtonVariant = 'danger'
573
- ```
574
-
575
- ---
576
-
577
- ## Regras
578
-
579
- ### Nunca
580
- - Lógica de negócio ou chamadas de API em componentes do design system
581
- - Cores, espaçamentos ou fontes hardcodados fora dos tokens
582
- - Componente público sem story no Storybook
583
- - Breaking change sem deprecation notice e communication
584
- - Importar do design system dentro do próprio design system de forma circular
585
-
586
- ### Sempre
587
- - Tokens semânticos nas aplicações (não primitivos)
588
- - `forwardRef` em componentes com elementos DOM
589
- - `cn()` para merge de classNames (nunca template literals com classes Tailwind)
590
- - Variantes com `cva` para componentes com múltiplos estados visuais
591
- - Acessibilidade testada com addon `a11y` do Storybook antes de publicar
592
-
593
- ---
594
-
595
- ## Output
596
-
597
- | Artefato | Descrição |
598
- |----------|-----------|
599
- | Componente | `.tsx` + `.test.tsx` + `.stories.tsx` + `index.ts` |
600
- | Tokens | Arquivo em `src/tokens/` com primitivos e semânticos |
601
- | Config Tailwind | `tailwind.config.ts` atualizado com novos tokens |
602
- | Story | Autodocs + variantes + estados especiais |
603
- | CHANGELOG | Entrada com tipo de mudança e guia de migração se breaking |
604
-
605
- ---
606
-
607
- ## Mensagem de Conclusão
608
-
609
- ```
610
- Design System atualizado!
611
-
612
- Componente: {nome} (variantes: {lista})
613
- Tokens: {novos ou alterados}
614
- Storybook: {stories criadas}
615
- Acessibilidade: {WCAG 2.1 AA verificado no addon a11y}
616
-
617
- Versão: {atual} → {nova} ({patch | minor | major})
618
- Breaking change: {sim — ver guia de migração | não}
619
-
620
- Próximo passo: {publicar pacote | atualizar remotes consumidores | revisar no Storybook}
621
- ```