jarvis-ai-framework 2.1.0 → 2.1.1
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.
- package/AGENTS.md +10 -9
- package/agents/AGENTS.md +9 -1
- package/agents/README.md +2 -2
- package/agents/engineering/data/eng.data-engineer.agent.md +2 -2
- package/agents/engineering/eng.agent.md +4 -6
- package/agents/engineering/eng.bug-hunter.md +10 -5
- package/agents/engineering/eng.cybersecurity.agent.md +2 -4
- package/agents/engineering/eng.dev-code-reviewer.md +4 -0
- package/agents/engineering/eng.docs-writer.md +3 -3
- package/agents/engineering/eng.frontend.agent.md +17 -8
- package/agents/engineering/eng.rpa.agent.md +3 -5
- package/agents/engineering/eng.ux-designer.agent.md +4 -0
- package/agents/engineering/qa/eng.qa.cypress-specialist.md +8 -5
- package/agents/engineering/qa/eng.qa.quality-champion-task-agent.md +4 -0
- package/agents/engineering/qa/eng.qa.quality-strategist.md +18 -8
- package/agents/engineering/qa/eng.qa.test-architect.md +17 -6
- package/agents/engineering/qa/eng.qa.test-planner.md +17 -8
- package/agents/engineering/qa/eng.qa.testing-engineer.md +26 -9
- package/agents/product/prod.discovery-interviewer.md +22 -3
- package/agents/product/prod.pm-checker.md +4 -0
- package/bin/commands/map.js +43 -0
- package/bin/commands/tokens.js +93 -0
- package/bin/jarvis.js +10 -0
- package/bin/lib/config/constants.js +11 -0
- package/bin/lib/core/profile-filter.js +113 -0
- package/bin/lib/core/scanner.js +2 -2
- package/bin/lib/core/token-report.js +90 -0
- package/bin/lib/flow-map/index.js +65 -0
- package/bin/lib/flow-map/parse.js +217 -0
- package/bin/lib/flow-map/render.js +86 -0
- package/bin/lib/flow-map/tree.js +199 -0
- package/members.md +1 -1
- package/package.json +4 -2
- package/rules/AGENTS.md +18 -7
- package/rules/engineering/eng-rules.md +2 -12
- package/rules/engineering/eng-security-rules.md +1 -2
- package/rules/engineering/eng.integrations-rules.md +0 -4
- package/rules/engineering/eng.skills-rules.md +0 -4
- package/rules/engineering/eng.specializations-rules.md +0 -4
- package/rules/product/README.md +1 -0
- package/rules/product/prod-rules.md +1 -4
- package/rules/product/prod.spec-rules.md +0 -4
- package/rules/rtk-rules.md +0 -1
- package/{rules → rules-on-demand}/engineering/eng.breakdown-subtasks-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.plan-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.pr-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.pre-pr-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.start-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.tech-spec-rules.md +1 -2
- package/{rules → rules-on-demand}/engineering/eng.work-rules.md +0 -4
- package/skills/AGENTS.md +19 -21
- package/skills/SKILLS-ROADMAP.md +0 -4
- package/skills/eng-ai-engineer/SKILL.md +6 -0
- package/skills/eng-backend/SKILL.md +6 -0
- package/skills/eng-backend-arch-c4/SKILL.md +10 -4
- package/skills/eng-backend-microservices-trace/SKILL.md +6 -0
- package/skills/eng-backend-nestjs/SKILL.md +16 -461
- package/skills/eng-backend-nestjs/references/1-arquitetura-modulos.md +54 -0
- package/skills/eng-backend-nestjs/references/2-guards-autenticacao.md +118 -0
- package/skills/eng-backend-nestjs/references/3-interceptors-pipes-filters.md +113 -0
- package/skills/eng-backend-nestjs/references/4-config-logging.md +61 -0
- package/skills/eng-backend-nestjs/references/5-testes.md +83 -0
- package/skills/eng-backend-nestjs/references/6-problemas-comuns.md +53 -0
- package/skills/eng-backend-rabbitmq/SKILL.md +15 -298
- package/skills/eng-backend-rabbitmq/references/1-referencia-endpoints.md +28 -0
- package/skills/eng-backend-rabbitmq/references/2-codigo-consumer-producer.md +90 -0
- package/skills/eng-backend-rabbitmq/references/3-arquiteturas-comuns.md +101 -0
- package/skills/eng-backend-rabbitmq/references/4-troubleshooting.md +93 -0
- package/skills/eng-data-bi/SKILL.md +6 -0
- package/skills/eng-data-debug/SKILL.md +6 -0
- package/skills/eng-data-engineer/SKILL.md +16 -7
- package/skills/eng-data-onboard/SKILL.md +6 -0
- package/skills/eng-data-orchestrator/SKILL.md +6 -0
- package/skills/eng-devops-performance-engineer/SKILL.md +6 -0
- package/skills/eng-frontend/SKILL.md +6 -0
- package/skills/eng-frontend-design-system/SKILL.md +13 -479
- package/skills/eng-frontend-design-system/references/1-estrutura-pacote.md +57 -0
- package/skills/eng-frontend-design-system/references/2-tokens.md +116 -0
- package/skills/eng-frontend-design-system/references/3-componentes.md +165 -0
- package/skills/eng-frontend-design-system/references/4-storybook.md +85 -0
- package/skills/eng-frontend-design-system/references/5-auditoria-versionamento.md +76 -0
- package/skills/eng-frontend-microfrontend/SKILL.md +17 -457
- package/skills/eng-frontend-microfrontend/references/1-criando-remote.md +109 -0
- package/skills/eng-frontend-microfrontend/references/2-configurando-shell.md +70 -0
- package/skills/eng-frontend-microfrontend/references/3-contratos-interface.md +73 -0
- package/skills/eng-frontend-microfrontend/references/4-shared-dependencies.md +48 -0
- package/skills/eng-frontend-microfrontend/references/5-event-bus.md +59 -0
- package/skills/eng-frontend-microfrontend/references/6-monorepo-deploy.md +77 -0
- package/skills/eng-frontend-microfrontend/references/7-troubleshooting.md +45 -0
- package/skills/eng-global-browser-extension-builder/SKILL.md +6 -0
- package/skills/eng-global-docs-write/SKILL.md +10 -5
- package/skills/eng-global-jira-comment/SKILL.md +6 -0
- package/skills/eng-global-pr/SKILL.md +7 -1
- package/skills/eng-global-task-comment/SKILL.md +6 -0
- package/skills/eng-qa-a11y-audit/SKILL.md +10 -4
- package/skills/eng-qa-bug-report/SKILL.md +18 -230
- package/skills/eng-qa-bug-report/references/1-integracao-task-managers.md +148 -0
- package/skills/eng-qa-bug-report/references/2-exemplos-de-uso.md +46 -0
- package/skills/eng-qa-bug-report/references/3-bug-to-test.md +45 -0
- package/skills/eng-qa-cypress-e2e/SKILL.md +6 -0
- package/skills/eng-qa-dev-guide/SKILL.md +9 -1
- package/skills/eng-qa-e2e/SKILL.md +9 -3
- package/skills/eng-qa-e2e-spec-writer/SKILL.md +15 -9
- package/skills/eng-qa-exploratory/SKILL.md +16 -9
- package/skills/eng-qa-gate/SKILL.md +11 -5
- package/skills/eng-qa-gate/assets/checklist-validacao.md +1 -1
- package/skills/eng-qa-graphql-contract/SKILL.md +9 -3
- package/skills/eng-qa-quality-report/SKILL.md +9 -3
- package/skills/eng-qa-test-plan/SKILL.md +6 -0
- package/skills/eng-qa-testsprite/SKILL.md +10 -4
- package/skills/eng-qa-unit-test/SKILL.md +7 -1
- package/skills/eng-scraper/SKILL.md +12 -436
- package/skills/eng-scraper/references/1-puppeteer.md +140 -0
- package/skills/eng-scraper/references/2-playwright-cheerio-pdf.md +82 -0
- package/skills/eng-scraper/references/3-anti-bot.md +94 -0
- package/skills/eng-scraper/references/4-resiliencia-etl-monitoramento.md +137 -0
- package/skills/eng-scraper-robot-builder/SKILL.md +6 -0
- package/skills/eng-security-cybersecurity/SKILL.md +13 -409
- package/skills/eng-security-cybersecurity/references/1-owasp-top-10.md +331 -0
- package/skills/eng-security-cybersecurity/references/2-secrets-management.md +31 -0
- package/skills/eng-security-cybersecurity/references/3-input-validation.md +43 -0
- package/skills/eng-security-cybersecurity/references/4-compliance.md +20 -0
- package/skills/eng-security-patch/SKILL.md +6 -0
- package/skills/eng-security-threat-model/SKILL.md +6 -0
- package/skills/eng-security-triage/SKILL.md +6 -0
- package/skills/jarvis-context-detect/SKILL.md +6 -0
- package/skills/jarvis-create-specialization/SKILL.md +6 -0
- package/skills/jarvis-docs-central/SKILL.md +6 -0
- package/skills/jarvis-docs-index/SKILL.md +10 -2
- package/skills/jarvis-evolution-architect/SKILL.md +6 -0
- package/skills/jarvis-init/SKILL.md +14 -7
- package/skills/jarvis-list-specializations/SKILL.md +6 -0
- package/skills/jarvis-report-issue/SKILL.md +6 -0
- package/skills/product-roadmap-report/SKILL.md +8 -0
- package/skills/product-specs/SKILL.md +9 -0
- package/skills/product-specs-update/SKILL.md +6 -0
- package/taxonomy.md +12 -12
- package/templates/AGENTS.md +2 -0
- package/templates/engineering/tech-spec-delivery-template.md +179 -0
- package/workflows/AGENTS.md +12 -2
- package/workflows/README.md +18 -16
- package/workflows/all-tools.md +7 -1
- package/workflows/engineering/data/data.contract.md +8 -0
- package/workflows/engineering/data/data.new-pipeline.md +10 -0
- package/workflows/engineering/eng.breakdown-subtasks.md +9 -0
- package/workflows/engineering/eng.bug-audit.md +9 -2
- package/workflows/engineering/eng.build-tech-spec.md +17 -146
- package/workflows/engineering/eng.create-ard-from-code.md +8 -0
- package/workflows/engineering/eng.create-ard.md +8 -0
- package/workflows/engineering/eng.create-rfc.md +7 -0
- package/workflows/engineering/eng.debug.md +3 -3
- package/workflows/engineering/eng.docs.md +9 -0
- package/workflows/engineering/eng.light-arch.md +7 -0
- package/workflows/engineering/eng.plan.md +15 -2
- package/workflows/engineering/eng.pr.md +19 -7
- package/workflows/engineering/eng.pre-pr.md +27 -1
- package/workflows/engineering/eng.review.md +13 -0
- package/workflows/engineering/eng.rpa.robot.md +16 -0
- package/workflows/engineering/eng.security-audit.md +7 -0
- package/workflows/engineering/eng.security-incident.md +6 -0
- package/workflows/engineering/eng.security-pipeline.md +9 -0
- package/workflows/engineering/eng.security-review.md +6 -0
- package/workflows/engineering/eng.start.md +22 -6
- package/workflows/engineering/eng.work.md +18 -2
- package/workflows/engineering/frontend/eng.frontend-component.md +7 -0
- package/workflows/engineering/frontend/eng.frontend-perf-audit.md +8 -0
- package/workflows/engineering/frontend/eng.frontend-review.md +8 -0
- package/workflows/engineering/qa/eng.qa-dev-quality-guide.md +6 -0
- package/workflows/engineering/qa/eng.qa-e2e-test-generation.md +6 -0
- package/workflows/engineering/qa/eng.qa-exploratory-session.md +8 -0
- package/workflows/engineering/qa/eng.qa-quality-gate-validation.md +7 -0
- package/workflows/engineering/qa/eng.qa-quality-report.md +7 -0
- package/workflows/engineering/qa/eng.qa-refinement-entry.md +7 -0
- package/workflows/engineering/qa/eng.qa-release-signoff.md +6 -0
- package/workflows/engineering/qa/eng.qa-sprint-planning.md +6 -0
- package/workflows/product/prod.roadmap.preview.md +9 -0
- package/workflows/product/prod.spec.ard.md +97 -0
- package/workflows/product/prod.spec.breakdown.md +10 -0
- package/workflows/product/prod.spec.clarify.md +8 -2
- package/workflows/product/prod.spec.discovery.md +10 -0
- package/workflows/product/prod.spec.epic.md +8 -0
- package/workflows/product/prod.spec.frd.md +7 -0
- package/workflows/product/prod.spec.issue.md +6 -0
- package/workflows/product/prod.spec.md +15 -1
- package/workflows/product/prod.spec.prd.md +7 -0
- package/workflows/taxonomy.md +58 -6
- package/workflows/warm-up.md +24 -9
- package/rules/engineering/eng.downstream-flow-rules.md +0 -297
|
@@ -128,16 +128,25 @@ Antes de expor dados para outra squad, criar um contrato de dados documentando:
|
|
|
128
128
|
|
|
129
129
|
Dependendo do argumento recebido em `$ARGUMENTS`, este skill roteia para o playbook especializado:
|
|
130
130
|
|
|
131
|
-
| Argumento | Skill especializada | Quando usar |
|
|
132
|
-
|-----------|--------------------|----|
|
|
133
|
-
| `onboard`, `nova-fonte`, `primeira-ingestão` | `eng-data-onboard` | Integrar uma fonte de dados pela primeira vez |
|
|
134
|
-
| `debug`, `falha`, `diagnóstico`, `pipeline-quebrado` | `eng-data-debug` | Investigar falha, queda de volume ou dado incorreto |
|
|
135
|
-
| `dashboard`, `bi`, `query-analitica` | `eng-data-bi` | Criar dashboard, otimizar query ou compartilhar dados |
|
|
136
|
-
| `dag`, `orquestração`, `schedule` | `eng-data-orchestrator` | Criar ou manter DAGs, retry, alertas, troubleshooting |
|
|
137
|
-
|
|
138
131
|
> Se o argumento se encaixar em um dos casos acima, invocar a skill correspondente e seguir seu fluxo.
|
|
139
132
|
> Se não se encaixar, continuar neste skill com os fluxos abaixo.
|
|
140
133
|
|
|
134
|
+
### Skills invocados durante a execução do skill
|
|
135
|
+
|
|
136
|
+
| Passo | Skill | Condição |
|
|
137
|
+
|-------|-------|----------|
|
|
138
|
+
| Argumento: `onboard`, `nova-fonte`, `primeira-ingestão` | `/eng-data-onboard` | Se o argumento for um destes (roteamento mutuamente exclusivo: no máximo uma das 4 skills é invocada) |
|
|
139
|
+
| Argumento: `debug`, `falha`, `diagnóstico`, `pipeline-quebrado` | `/eng-data-debug` | Se o argumento for um destes (mutuamente exclusivo) |
|
|
140
|
+
| Argumento: `dashboard`, `bi`, `query-analitica`; Fluxos de Trabalho › Dashboard | `/eng-data-bi` | Se o argumento for um destes (mutuamente exclusivo) ou ao executar o fluxo de Dashboard |
|
|
141
|
+
| Argumento: `dag`, `orquestração`, `schedule` | `/eng-data-orchestrator` | Se o argumento for um destes (mutuamente exclusivo) |
|
|
142
|
+
|
|
143
|
+
Quando usar cada uma:
|
|
144
|
+
|
|
145
|
+
- `/eng-data-onboard`: integrar uma fonte de dados pela primeira vez
|
|
146
|
+
- `/eng-data-debug`: investigar falha, queda de volume ou dado incorreto
|
|
147
|
+
- `/eng-data-bi`: criar dashboard, otimizar query ou compartilhar dados
|
|
148
|
+
- `/eng-data-orchestrator`: criar ou manter DAGs, retry, alertas, troubleshooting
|
|
149
|
+
|
|
141
150
|
---
|
|
142
151
|
|
|
143
152
|
## Fluxos de Trabalho
|
|
@@ -274,6 +274,12 @@ Próximos passos recomendados:
|
|
|
274
274
|
4. Se expor para outra squad → criar contrato via data.contract.md
|
|
275
275
|
```
|
|
276
276
|
|
|
277
|
+
### Skills invocados durante a execução do skill
|
|
278
|
+
|
|
279
|
+
| Passo | Skill | Condição |
|
|
280
|
+
|-------|-------|----------|
|
|
281
|
+
| — | Nenhuma — skill autocontida | — |
|
|
282
|
+
|
|
277
283
|
---
|
|
278
284
|
|
|
279
285
|
## Tratamento de Campos Sensíveis
|
|
@@ -360,6 +360,12 @@ airflow dags backfill <dag_id> \
|
|
|
360
360
|
> ⚠️ Usar `backfill` com `catchup=False` configurado pode não ter o efeito esperado.
|
|
361
361
|
> Verificar a configuração do DAG antes de reprocessar histórico.
|
|
362
362
|
|
|
363
|
+
### Skills invocados durante a execução do skill
|
|
364
|
+
|
|
365
|
+
| Passo | Skill | Condição |
|
|
366
|
+
|-------|-------|----------|
|
|
367
|
+
| — | Nenhuma — skill autocontida | — |
|
|
368
|
+
|
|
363
369
|
---
|
|
364
370
|
|
|
365
371
|
## Boas Práticas
|
|
@@ -222,6 +222,12 @@ Focar nos maiores gargalos primeiro para maximizar ROI:
|
|
|
222
222
|
- Configurar alertas para prevenir regressão
|
|
223
223
|
- Documentar otimizações com métricas e impacto
|
|
224
224
|
|
|
225
|
+
### Skills invocados durante a execução do skill
|
|
226
|
+
|
|
227
|
+
| Passo | Skill | Condição |
|
|
228
|
+
|-------|-------|----------|
|
|
229
|
+
| — | Nenhuma — skill autocontida | — |
|
|
230
|
+
|
|
225
231
|
---
|
|
226
232
|
|
|
227
233
|
## Comportamentos Esperados
|
|
@@ -156,6 +156,12 @@ Refatorar ou revisar código? → tema 12 (qualidade de código)
|
|
|
156
156
|
4. **Testar**: cobrir o comportamento, os estados de erro e os casos limite
|
|
157
157
|
5. **Validar**: percorrer o checklist de conclusão abaixo
|
|
158
158
|
|
|
159
|
+
### Skills invocados durante a execução do skill
|
|
160
|
+
|
|
161
|
+
| Passo | Skill | Condição |
|
|
162
|
+
|-------|-------|----------|
|
|
163
|
+
| — | Nenhuma — skill autocontida | — |
|
|
164
|
+
|
|
159
165
|
---
|
|
160
166
|
|
|
161
167
|
## Base Universal
|
|
@@ -88,489 +88,23 @@ O que será feito?
|
|
|
88
88
|
|
|
89
89
|
---
|
|
90
90
|
|
|
91
|
-
##
|
|
91
|
+
## Referências (leia só o tema que a tarefa pedir)
|
|
92
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'
|
|
93
|
+
Leia **só** o arquivo do tema que a tarefa pedir; o restante fica fora do contexto.
|
|
344
94
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
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
|
-
---
|
|
95
|
+
| Tema | Quando ler | Arquivo |
|
|
96
|
+
|------|-----------|---------|
|
|
97
|
+
| Estrutura do Pacote | A tarefa criar ou reorganizar o pacote do design system | `references/1-estrutura-pacote.md` |
|
|
98
|
+
| Sistema de Tokens | A tarefa envolver tokens (primitivos, semânticos, Tailwind) | `references/2-tokens.md` |
|
|
99
|
+
| Criando um Componente e Acessibilidade | A tarefa criar ou alterar um componente (CVA, API pública, acessibilidade, Radix UI) | `references/3-componentes.md` |
|
|
100
|
+
| Storybook | A tarefa envolver stories ou a configuração do Storybook | `references/4-storybook.md` |
|
|
101
|
+
| Auditoria de Consistência e Versionamento | A tarefa auditar tokens e componentes ou tratar breaking changes e versionamento | `references/5-auditoria-versionamento.md` |
|
|
384
102
|
|
|
385
|
-
|
|
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
|
-
```
|
|
103
|
+
### Skills invocados durante a execução do skill
|
|
439
104
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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
|
-
```
|
|
105
|
+
| Passo | Skill | Condição |
|
|
106
|
+
|-------|-------|----------|
|
|
107
|
+
| — | Nenhuma — skill autocontida | — |
|
|
574
108
|
|
|
575
109
|
---
|
|
576
110
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Estrutura do Pacote
|
|
2
|
+
|
|
3
|
+
> Parte do skill `eng-frontend-design-system`. Leia este arquivo quando a tarefa criar ou reorganizar o pacote do design system.
|
|
4
|
+
|
|
5
|
+
## Estrutura do Pacote
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
packages/design-system/
|
|
9
|
+
├── src/
|
|
10
|
+
│ ├── tokens/
|
|
11
|
+
│ │ ├── colors.ts ← paleta + semântica de cor
|
|
12
|
+
│ │ ├── typography.ts ← escala tipográfica
|
|
13
|
+
│ │ ├── spacing.ts ← escala de espaçamento
|
|
14
|
+
│ │ ├── shadows.ts ← elevações
|
|
15
|
+
│ │ ├── radii.ts ← border-radius
|
|
16
|
+
│ │ └── index.ts ← re-exporta todos os tokens
|
|
17
|
+
│ ├── components/
|
|
18
|
+
│ │ ├── Button/
|
|
19
|
+
│ │ │ ├── Button.tsx
|
|
20
|
+
│ │ │ ├── Button.stories.tsx
|
|
21
|
+
│ │ │ ├── Button.test.tsx
|
|
22
|
+
│ │ │ └── index.ts
|
|
23
|
+
│ │ ├── Input/
|
|
24
|
+
│ │ └── ...
|
|
25
|
+
│ ├── hooks/ ← hooks utilitários (useMediaQuery, useTheme, etc.)
|
|
26
|
+
│ ├── utils/ ← cn(), formatters, etc.
|
|
27
|
+
│ └── index.ts ← ponto de entrada público
|
|
28
|
+
├── .storybook/
|
|
29
|
+
├── tailwind.config.ts ← ou tokens CSS via CSS custom properties
|
|
30
|
+
├── package.json
|
|
31
|
+
└── tsconfig.json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
// package.json — ponto de entrada correto
|
|
36
|
+
{
|
|
37
|
+
"name": "@{org}/design-system",
|
|
38
|
+
"version": "1.0.0",
|
|
39
|
+
"main": "./dist/index.js",
|
|
40
|
+
"module": "./dist/index.mjs",
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"exports": {
|
|
43
|
+
".": {
|
|
44
|
+
"import": "./dist/index.mjs",
|
|
45
|
+
"require": "./dist/index.js",
|
|
46
|
+
"types": "./dist/index.d.ts"
|
|
47
|
+
},
|
|
48
|
+
"./tokens": {
|
|
49
|
+
"import": "./dist/tokens/index.mjs",
|
|
50
|
+
"types": "./dist/tokens/index.d.ts"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"sideEffects": ["*.css"]
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|