wizz-method 2.2.0 → 2.3.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.
Files changed (198) hide show
  1. package/README.md +62 -62
  2. package/SECURITY.md +15 -16
  3. package/THIRD-PARTY-NOTICES.md +49 -49
  4. package/package.json +1 -1
  5. package/src/bmm-skills/1-analysis/wizz-agent-analyst/customize.toml +1 -1
  6. package/src/bmm-skills/2-plan-workflows/wizz-agent-pm/customize.toml +1 -1
  7. package/src/bmm-skills/2-plan-workflows/wizz-agent-ux-designer/customize.toml +1 -1
  8. package/src/bmm-skills/3-solutioning/wizz-agent-architect/customize.toml +1 -1
  9. package/src/bmm-skills/4-implementation/wizz-agent-dev/customize.toml +1 -1
  10. package/src/core-skills/_shared/handoff-protocol.md +72 -71
  11. package/src/core-skills/wizz-review-adversarial-general/SKILL.md +1 -1
  12. package/src/modules/lowticket/skills/wizz-lowticket-funil/references/copy-das-paginas.md +39 -39
  13. package/src/modules/lowticket/skills/wizz-lowticket-funil/references/mapa-do-funil.md +23 -23
  14. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/CATALOGO.md +72 -72
  15. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/01-principios.md +10 -10
  16. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/02-diagnostico-funil.md +50 -50
  17. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/03-campanha-bidcap.md +68 -68
  18. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/04-criativos.md +44 -44
  19. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/04a-criativos-ia.md +77 -77
  20. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/04b-criativos-formatos.md +121 -121
  21. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/05-oferta.md +35 -35
  22. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/06-pagina-vendas.md +122 -122
  23. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/06a-instagram.md +93 -93
  24. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/06b-player-vsl.md +57 -57
  25. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/07-funil-upsell.md +83 -83
  26. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/07a-copy-humanizacao.md +61 -61
  27. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/08-pesquisa-publico.md +11 -11
  28. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/09-especialista-coproducao.md +26 -26
  29. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/10-levantar-caixa.md +29 -29
  30. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/11-checklist-roi.md +22 -22
  31. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/12-mineracao-ofertas.md +80 -80
  32. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/12a-mineracao-veredito.md +72 -72
  33. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/12b-fabrica-de-ofertas.md +63 -63
  34. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/12c-anatomia-low-ticket.md +71 -71
  35. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/13-benchmarks-vsl.md +6 -6
  36. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/14-vocabulario.md +53 -51
  37. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/15-como-estender.md +26 -26
  38. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/17-rastreamento.md +76 -76
  39. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/18-copy-desejo-oferta.md +149 -149
  40. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/INDEX.md +45 -45
  41. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/guardrails.md +45 -45
  42. package/src/modules/lowticket/skills/wizz-lowticket-metodologia/knowledge/pontos-em-aberto.md +64 -66
  43. package/src/modules/lowticket/skills/wizz-lowticket-minerador/references/rubrica.md +63 -63
  44. package/src/modules/lowticket/skills/wizz-lowticket-pagina/references/metas-e-medicao.md +23 -23
  45. package/src/modules/lowticket/skills/wizz-lowticket-pagina/references/padroes-de-codigo.md +50 -50
  46. package/src/modules/lowticket/skills/wizz-lowticket-trafego/references/formato-do-diagnostico.md +9 -9
  47. package/src/modules/lowticket/skills/wizz-lowticket-trafego/references/reguas.md +42 -42
  48. package/src/modules/wizz/README.md +27 -27
  49. package/src/modules/wizz/_shared/cerebro.md +37 -37
  50. package/src/modules/wizz/_shared/communication-rules.md +15 -15
  51. package/src/modules/wizz/_shared/despacho-barato.md +6 -6
  52. package/src/modules/wizz/_shared/encerramento.md +23 -23
  53. package/src/modules/wizz/_shared/model-ladder.md +29 -29
  54. package/src/modules/wizz/_shared/planning-gate.md +30 -30
  55. package/src/modules/wizz/_shared/token-economy.md +28 -28
  56. package/src/modules/wizz/_shared/video-pipeline.md +42 -42
  57. package/src/modules/wizz/agents/wizz-ads/SKILL.md +16 -16
  58. package/src/modules/wizz/agents/wizz-ads/customize.toml +21 -21
  59. package/src/modules/wizz/agents/wizz-copy/SKILL.md +18 -18
  60. package/src/modules/wizz/agents/wizz-copy/customize.toml +24 -24
  61. package/src/modules/wizz/agents/wizz-designer/SKILL.md +24 -24
  62. package/src/modules/wizz/agents/wizz-designer/customize.toml +29 -29
  63. package/src/modules/wizz/agents/wizz-growth/SKILL.md +20 -20
  64. package/src/modules/wizz/agents/wizz-growth/customize.toml +34 -34
  65. package/src/modules/wizz/agents/wizz-maestro/SKILL.md +63 -63
  66. package/src/modules/wizz/agents/wizz-maestro/customize.toml +38 -38
  67. package/src/modules/wizz/agents/wizz-memoria/SKILL.md +19 -19
  68. package/src/modules/wizz/agents/wizz-memoria/customize.toml +24 -24
  69. package/src/modules/wizz/agents/wizz-qa/SKILL.md +22 -22
  70. package/src/modules/wizz/agents/wizz-qa/customize.toml +29 -29
  71. package/src/modules/wizz/agents/wizz-seo/SKILL.md +19 -19
  72. package/src/modules/wizz/agents/wizz-seo/customize.toml +27 -27
  73. package/src/modules/wizz/agents/wizz-social/SKILL.md +53 -53
  74. package/src/modules/wizz/agents/wizz-social/customize.toml +37 -37
  75. package/src/modules/wizz/agents/wizz-social/knowledge/analise-imagem-referencia.md +20 -20
  76. package/src/modules/wizz/agents/wizz-social/knowledge/biblioteca-prompts-imagem.md +71 -71
  77. package/src/modules/wizz/agents/wizz-social/knowledge/blueprint-roteiro-viral.md +196 -196
  78. package/src/modules/wizz/agents/wizz-social/knowledge/legenda-instagram.md +32 -32
  79. package/src/modules/wizz/agents/wizz-social/knowledge/prompts-imagem-video.md +48 -48
  80. package/src/modules/wizz/module.yaml +28 -28
  81. package/src/modules/wizz/overrides/wizz-agent-analyst.toml +17 -17
  82. package/src/modules/wizz/overrides/wizz-agent-architect.toml +21 -21
  83. package/src/modules/wizz/overrides/wizz-agent-dev.toml +20 -20
  84. package/src/modules/wizz/overrides/wizz-agent-pm.toml +11 -11
  85. package/src/modules/wizz/overrides/wizz-agent-tech-writer.toml +14 -14
  86. package/src/modules/wizz/overrides/wizz-agent-ux-designer.toml +14 -14
  87. package/src/modules/wizz/subagents/codex/wizz-exec-haiku.toml +17 -17
  88. package/src/modules/wizz/subagents/codex/wizz-exec-opus.toml +19 -19
  89. package/src/modules/wizz/subagents/codex/wizz-exec-review.toml +18 -18
  90. package/src/modules/wizz/subagents/codex/wizz-exec-sonnet.toml +18 -18
  91. package/src/modules/wizz/subagents/gemini/wizz-exec-haiku.md +17 -17
  92. package/src/modules/wizz/subagents/gemini/wizz-exec-opus.md +19 -19
  93. package/src/modules/wizz/subagents/gemini/wizz-exec-review.md +18 -18
  94. package/src/modules/wizz/subagents/gemini/wizz-exec-sonnet.md +18 -18
  95. package/src/modules/wizz/subagents/opencode/wizz-exec-haiku.md +17 -17
  96. package/src/modules/wizz/subagents/opencode/wizz-exec-opus.md +19 -19
  97. package/src/modules/wizz/subagents/opencode/wizz-exec-review.md +18 -18
  98. package/src/modules/wizz/subagents/opencode/wizz-exec-sonnet.md +18 -18
  99. package/src/modules/wizz/subagents/spec.yaml +84 -83
  100. package/src/modules/wizz/subagents/wizz-exec-haiku.md +17 -17
  101. package/src/modules/wizz/subagents/wizz-exec-opus.md +19 -19
  102. package/src/modules/wizz/subagents/wizz-exec-review.md +18 -18
  103. package/src/modules/wizz/subagents/wizz-exec-sonnet.md +18 -18
  104. package/src/skills-lib/cerebro/SKILL.md +61 -61
  105. package/src/skills-lib/cerebro/references/comandos-pesquisa-e-memoria.md +46 -46
  106. package/src/skills-lib/cerebro/references/comandos-rotina-e-captura.md +65 -65
  107. package/src/skills-lib/cerebro/references/comandos-sessao.md +74 -74
  108. package/src/skills-lib/ctc-align/SKILL.md +37 -37
  109. package/src/skills-lib/find-skills/SKILL.md +19 -19
  110. package/src/skills-lib/pesquisa-de-publico-do-piva/README.md +33 -33
  111. package/src/skills-lib/pesquisa-de-publico-do-piva/SKILL.md +42 -42
  112. package/src/skills-lib/pesquisa-de-publico-do-piva/prompts.md +20 -20
  113. package/src/skills-lib/references/premium-agency-rules.md +63 -63
  114. package/src/skills-lib/security-audit-pentest/SKILL.md +31 -31
  115. package/src/skills-lib/security-audit-pentest/references/stage-1-validacao-entrada.md +37 -37
  116. package/src/skills-lib/security-audit-pentest/references/stage-2-autorizacao.md +61 -61
  117. package/src/skills-lib/security-audit-pentest/references/stage-3-abuso-volume.md +37 -37
  118. package/src/skills-lib/security-audit-pentest/references/stage-4-vazamento-resposta.md +52 -52
  119. package/src/skills-lib/site-launch-kit/SKILL.md +42 -42
  120. package/src/skills-lib/site-launch-kit/references/01-cta-principal.md +20 -20
  121. package/src/skills-lib/site-launch-kit/references/02-barra-fixa-mobile.md +24 -24
  122. package/src/skills-lib/site-launch-kit/references/03-tempo-de-resposta.md +21 -21
  123. package/src/skills-lib/site-launch-kit/references/04-prova-social.md +22 -22
  124. package/src/skills-lib/site-launch-kit/references/05-faq-decisao.md +28 -28
  125. package/src/skills-lib/site-launch-kit/references/06-imagens-reais.md +27 -27
  126. package/src/skills-lib/site-launch-kit/references/07-endereco-como-chegar.md +25 -25
  127. package/src/skills-lib/site-launch-kit/references/08-titles.md +30 -30
  128. package/src/skills-lib/site-launch-kit/references/09-open-graph.md +23 -23
  129. package/src/skills-lib/site-launch-kit/references/10-breadcrumbs.md +23 -23
  130. package/src/skills-lib/site-launch-kit/references/11-alt-text.md +28 -28
  131. package/src/skills-lib/site-launch-kit/references/12-schema-local.md +22 -22
  132. package/src/skills-lib/site-launch-kit/references/13-robots-sitemap.md +26 -26
  133. package/src/skills-lib/site-launch-kit/references/14-privacidade-termos.md +27 -27
  134. package/src/skills-lib/site-launch-kit/references/15-medicao.md +23 -23
  135. package/src/skills-lib/wizz-ai-product-design/SKILL.md +70 -70
  136. package/src/skills-lib/wizz-auth-and-secrets/SKILL.md +78 -78
  137. package/src/skills-lib/wizz-caching-and-queues/SKILL.md +40 -40
  138. package/src/skills-lib/wizz-cloud-and-infra/SKILL.md +22 -22
  139. package/src/skills-lib/wizz-database-and-deps/SKILL.md +52 -52
  140. package/src/skills-lib/wizz-database-scaling/SKILL.md +31 -31
  141. package/src/skills-lib/wizz-desktop-security/SKILL.md +49 -49
  142. package/src/skills-lib/wizz-implementation-planner/SKILL.md +56 -56
  143. package/src/skills-lib/wizz-implementation-planner/references/folder-structure-and-dependencies.md +14 -14
  144. package/src/skills-lib/wizz-implementation-planner/references/implementation-phases.md +15 -15
  145. package/src/skills-lib/wizz-implementation-planner/references/implementation-types.md +9 -9
  146. package/src/skills-lib/wizz-implementation-planner/references/motion-path-implementation.md +19 -19
  147. package/src/skills-lib/wizz-implementation-planner/references/performance-plan.md +27 -27
  148. package/src/skills-lib/wizz-infrastructure/SKILL.md +21 -21
  149. package/src/skills-lib/wizz-inicio-de-projeto/SKILL.md +63 -63
  150. package/src/skills-lib/wizz-inicio-de-projeto/references/implementacao-api-forms.md +27 -27
  151. package/src/skills-lib/wizz-inicio-de-projeto/references/padroes-arquiteturais-e-pastas.md +31 -31
  152. package/src/skills-lib/wizz-inicio-de-projeto/references/seguranca-e-regras-codigo.md +21 -21
  153. package/src/skills-lib/wizz-launch-readiness/SKILL.md +61 -61
  154. package/src/skills-lib/wizz-launch-readiness/references/01-tecnico-build.md +16 -16
  155. package/src/skills-lib/wizz-launch-readiness/references/02-seguranca.md +16 -16
  156. package/src/skills-lib/wizz-launch-readiness/references/03-seo-descoberta.md +16 -16
  157. package/src/skills-lib/wizz-launch-readiness/references/04-analytics-medicao.md +15 -15
  158. package/src/skills-lib/wizz-launch-readiness/references/05-conteudo-prova-social.md +15 -15
  159. package/src/skills-lib/wizz-launch-readiness/references/06-legal-lgpd.md +15 -15
  160. package/src/skills-lib/wizz-launch-readiness/references/07-infra-deploy-rollback.md +16 -16
  161. package/src/skills-lib/wizz-launch-readiness/references/08-fusao-priorizacao.md +19 -19
  162. package/src/skills-lib/wizz-launch-readiness/references/09-persistencia-project-context.md +26 -26
  163. package/src/skills-lib/wizz-motion-3d-director/SKILL.md +70 -70
  164. package/src/skills-lib/wizz-motion-3d-director/references/image-to-video-workflow.md +34 -35
  165. package/src/skills-lib/wizz-motion-3d-director/references/motion-paths.md +70 -70
  166. package/src/skills-lib/wizz-motion-3d-director/references/performance-and-handoff.md +17 -17
  167. package/src/skills-lib/wizz-offer-forge/README.md +9 -9
  168. package/src/skills-lib/wizz-offer-forge/SKILL.md +64 -64
  169. package/src/skills-lib/wizz-offer-forge/references/empilhamento-valor.md +17 -17
  170. package/src/skills-lib/wizz-offer-forge/references/garantia-reversa.md +16 -16
  171. package/src/skills-lib/wizz-offer-forge/references/mecanismo-unico.md +19 -19
  172. package/src/skills-lib/wizz-offer-forge/references/ponte-trafego.md +17 -17
  173. package/src/skills-lib/wizz-premium-landing-ui-researcher/SKILL.md +36 -36
  174. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/audit-protocol.md +81 -82
  175. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/component-sources.md +105 -105
  176. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/core-goal.md +39 -39
  177. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/dashboard-and-portfolio-modes.md +49 -50
  178. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/handoffs.md +33 -34
  179. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/landing-page-strategy.md +141 -142
  180. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/mandatory-process.md +24 -24
  181. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/output-format-and-quality.md +73 -73
  182. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/prompt-templates.md +4 -4
  183. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/site-levels.md +282 -283
  184. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/source-first-protocol.md +39 -39
  185. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/source-links.md +8 -8
  186. package/src/skills-lib/wizz-premium-landing-ui-researcher/references/stack-and-visual-direction.md +63 -64
  187. package/src/skills-lib/wizz-router/SKILL.md +38 -38
  188. package/src/skills-lib/wizz-router/references/auditoria-360.md +12 -12
  189. package/src/skills-lib/wizz-router/references/routing-table-flat.md +80 -80
  190. package/src/skills-lib/wizz-tracking-audit/SKILL.md +48 -48
  191. package/src/skills-lib/wizz-tracking-audit/references/modo-diagnostico.md +43 -43
  192. package/src/skills-lib/wizz-tracking-audit/references/modo-implantacao.md +59 -59
  193. package/src/skills-lib/wizz-tracking-audit/references/utm-e-atribuicao.md +35 -35
  194. package/src/skills-lib/wizz-web-security/SKILL.md +35 -35
  195. package/src/skills-lib/wizz-web-security/references/checklist-deploy.md +50 -50
  196. package/src/skills-lib/wizz-web-security/references/headers-rate-limit-cors.md +33 -33
  197. package/src/skills-lib/wizz-web-security/references/owasp-top5-detalhado.md +36 -36
  198. package/tools/hooks/session-rules.js +14 -11
@@ -1,35 +1,35 @@
1
- # Rodada 15 · Medição de lançamento
1
+ # Round 15 · Launch measurement
2
2
 
3
- **Garante:** cada ação que vale dinheiro registrada com nome que faz sentido daqui a três meses.
4
- **Rode quando:** na véspera ou no dia do lançamento, com os pontos de contato finais no site.
3
+ **Ensures:** every action that's worth money is tracked with a name that will still make sense three months from now.
4
+ **Run when:** the day before or on launch day, with the final touchpoints on the site.
5
5
 
6
- Você é responsável pela medição deste site. Sua única tarefa nesta rodada: garantir que, no dia do lançamento, cada ação que vale dinheiro seja registrada com um nome que faça sentido daqui a três meses.
6
+ You are responsible for this site's measurement. Your only task in this round: make sure that, on launch day, every action worth money is tracked with a name that makes sense three months from now.
7
7
 
8
- Antes de editar, detecte: framework, se já existe alguma ferramenta de medição instalada (analytics, pixel, tag manager), se há banner de consentimento e quais são os pontos de contato do site.
8
+ Before editing, detect: framework, whether any measurement tool is already installed (analytics, pixel, tag manager), whether there's a consent banner, and what the site's touchpoints are.
9
9
 
10
- NÃO instale quatro ferramentas. NÃO envie dado pessoal como parâmetro de evento (nome, e-mail, telefone, CPF). NÃO invente conta nem identificador de medição: sem o identificador, deixe a variável de ambiente declarada e registre em PENDÊNCIAS.
10
+ DO NOT install four tools. DO NOT send personal data as an event parameter (name, email, phone, national ID). DO NOT invent an account or measurement ID: without the ID, leave the environment variable declared and log it in PENDING ITEMS.
11
11
 
12
- 1. LEVANTAMENTO
13
- Liste o que já está instalado e o que cada coisa mede hoje. Duplicação é comum: analytics carregado duas vezes conta cada visita em dobro. Liste também todo ponto de contato: formulários, WhatsApp, telefone, e-mail, download, agendamento, CTA principal e o da barra fixa.
12
+ 1. SURVEY
13
+ List what's already installed and what each thing measures today. Duplication is common: analytics loaded twice counts every visit double. Also list every touchpoint: forms, WhatsApp, phone, email, download, scheduling, the main CTA, and the one on the sticky bar.
14
14
 
15
- 2. NOMENCLATURA (faça isto antes de escrever código)
16
- Defina o padrão e escreva-o em um arquivo de documentação do projeto: objeto_ação em minúsculas com sublinhado (formulario_enviado, whatsapp_clique, telefone_clique, orcamento_iniciado). Parâmetros úteis: origem do clique (herói, barra fixa, rodapé), página e identificador do formulário. Nada de dado pessoal. Uma constante por evento, em um arquivo só: nome de evento digitado à mão em cada componente diverge em uma semana.
15
+ 2. NAMING (do this before writing any code)
16
+ Define the standard and write it into a project documentation file: object_action in lowercase with underscores (formulario_enviado, whatsapp_clique, telefone_clique, orcamento_iniciado). Useful parameters: click origin (hero, sticky bar, footer), page, and form identifier. No personal data. One constant per event, in a single file: an event name typed by hand into each component drifts apart within a week.
17
17
 
18
- 3. IMPLEMENTAÇÃO
19
- - Script carregado sem travar a renderização.
20
- - Nada dispara antes do consentimento, se houver banner.
21
- - Anonimização de IP quando a ferramenta permitir.
22
- - Um disparo por ação, protegido contra clique duplo e contra recarregamento da página de obrigado.
23
- - Página de obrigado como conversão principal, ligada à rodada 03 (tempo de resposta).
24
- - Se houver pixel de anúncio, dispare o mesmo evento nele, com o mesmo nome, para os relatórios baterem.
18
+ 3. IMPLEMENTATION
19
+ - Script loaded without blocking rendering.
20
+ - Nothing fires before consent, if there's a banner.
21
+ - IP anonymization when the tool allows it.
22
+ - One fire per action, guarded against double-clicks and against reloading the thank-you page.
23
+ - Thank-you page as the main conversion, tied to round 03 (response time).
24
+ - If there's an ad pixel, fire the same event on it, with the same name, so the reports match up.
25
25
 
26
- 4. TESTE DE FUMAÇA
27
- Em ambiente local ou de teste, execute cada ação e confirme o evento no depurador da ferramenta. Um evento não testado é um evento que não existe. Liste o que você conseguiu confirmar e o que ficou pendente.
26
+ 4. SMOKE TEST
27
+ In a local or staging environment, perform each action and confirm the event in the tool's debugger. An untested event is an event that doesn't exist. List what you were able to confirm and what's left pending.
28
28
 
29
- Formato de saída: depois de aplicar, uma tabela markdown, sem texto antes:
29
+ Output format: after applying the changes, a markdown table, with no text before it:
30
30
 
31
- | Evento | Gatilho (arquivo · elemento) | Parâmetros | Testado? |
31
+ | Event | Trigger (file · element) | Parameters | Tested? |
32
32
 
33
- Em seguida, PENDÊNCIAS (identificadores de conta, acessos, eventos não testados) e o padrão de nomenclatura em bloco de código, pronto para entrar na documentação do projeto.
33
+ Then, PENDING ITEMS (account IDs, access, untested events) and the naming standard in a code block, ready to go into the project documentation.
34
34
 
35
- REGRA DE CORTE: meça poucas coisas e meça direito. Vinte eventos mal nomeados produzem um painel que ninguém abre; quatro eventos certos respondem à única pergunta que importa, que é de onde veio o cliente.
35
+ CUTOFF RULE: measure a few things and measure them right. Twenty poorly named events produce a dashboard nobody opens; four well-named events answer the one question that matters, which is where the customer came from.
@@ -1,87 +1,87 @@
1
1
  ---
2
2
  name: wizz-ai-product-design
3
3
  description: >
4
- Design de produtos e agentes de IA: como o agente se comporta, como escrever o prompt/system prompt,
5
- guardrails e trust/safety, orquestração multi-agente e avaliação. Usar quando: criar ou melhorar um
6
- agente/assistente/chatbot, escrever ou revisar system prompt, definir persona/tom/voz, montar few-shot,
7
- chain-of-thought, guardrails, recusas, escalonamento pra humano, handoff entre agentes, detecção de
8
- frustração, generative UI, ou medir qualidade de saída de IA. Base: Owl-Listener/ai-design-skills (MIT).
9
- 44 padrões em 6 categorias, cada um detalhado em references/. Use quando o pedido mencionar system
10
- prompt, persona de agente, guardrails, orquestração multi-agente, handoff entre agentes ou avaliação
11
- de qualidade de IA.
4
+ AI product and agent design: how the agent behaves, how to write the prompt/system prompt,
5
+ guardrails and trust/safety, multi-agent orchestration, and evaluation. Use when: creating or improving an
6
+ agent/assistant/chatbot, writing or reviewing a system prompt, defining persona/tone/voice, building few-shot
7
+ examples, chain-of-thought, guardrails, refusals, escalation to a human, agent handoff, frustration
8
+ detection, generative UI, or measuring AI output quality. Base: Owl-Listener/ai-design-skills (MIT).
9
+ 44 patterns in 6 categories, each detailed in references/. Use when the request mentions system
10
+ prompt, agent persona, guardrails, multi-agent orchestration, agent handoff, or AI quality
11
+ evaluation.
12
12
  ---
13
13
 
14
- # AI Product Design — 44 padrões
14
+ # AI Product Design — 44 patterns
15
15
 
16
- Biblioteca de padrões pra desenhar **como uma IA/agente se comporta** e **como o prompt dele é escrito**.
17
- Cada item abaixo tem o texto completo em `references/<categoria>/<nome>/SKILL.md`. Este arquivo é o índice:
18
- ache o padrão pela intenção, depois abra a reference pro detalhe.
16
+ A pattern library for designing **how an AI/agent behaves** and **how its prompt is written**.
17
+ Each item below has the full text in `references/<category>/<name>/SKILL.md`. This file is the index:
18
+ find the pattern by intent, then open the reference for detail.
19
19
 
20
- > Uso no método: é a base pra construir e revisar os próprios agentes do Wizz Method (os 15 `customize.toml`,
21
- > system prompts, guardrails, handoffs). Consulte antes de criar/ajustar qualquer agente ou prompt.
20
+ > Use in the method: this is the base for building and reviewing the Wizz Method's own agents (the 15 `customize.toml`,
21
+ > system prompts, guardrails, handoffs). Consult it before creating/adjusting any agent or prompt.
22
22
 
23
- ## 1. Comportamento do agente (`references/system-behavior-shaping/`)
24
- Como o agente soa e reage.
25
- - **persona-architecture** — define personagem, voz e traços uma vez, pra não derivar entre sessões
26
- - **tone-calibration** — botões de tom por contexto (formalidade, calor, confiança)
27
- - **emotional-design** — resposta a frustração, confusão, alegria, angústia (valida sem amplificar)
28
- - **error-personality** — como comunicar erro, incerteza e limite com elegância
29
- - **behavioral-consistency** — comportar-se previsível entre sessões, edge cases e modalidades
30
- - **domain-voice** — ajustar o comportamento pra um domínio profissional específico
31
- - **cultural-adaptation** — adaptar a contexto cultural, idioma e normas
23
+ ## 1. Agent behavior (`references/system-behavior-shaping/`)
24
+ How the agent sounds and reacts.
25
+ - **persona-architecture** — define character, voice, and traits once, so they don't drift across sessions
26
+ - **tone-calibration** — tone dials per context (formality, warmth, confidence)
27
+ - **emotional-design** — response to frustration, confusion, joy, distress (validates without amplifying)
28
+ - **error-personality** — how to communicate error, uncertainty, and limits gracefully
29
+ - **behavioral-consistency** — behaving predictably across sessions, edge cases, and modalities
30
+ - **domain-voice** — adjusting behavior for a specific professional domain
31
+ - **cultural-adaptation** — adapting to cultural context, language, and norms
32
32
 
33
- ## 2. Interação humano-IA (`references/model-interaction-design/`)
34
- Como a conversa flui.
35
- - **conversation-patterns** — turnos, sequências de reparo, checkpoints de alinhamento
36
- - **frustration-detection** — ler frustração por caps, pontuação, repetição, latência e adaptar
37
- - **mixed-initiative-flow** — quando o agente lidera vs. quando o usuário lidera, com handoff limpo
38
- - **progressive-disclosure** — revelar o poder da ferramenta aos poucos, sem afogar no turno 1
39
- - **generative-ui** — quando renderizar um componente (date picker, card, gráfico) vs. texto puro
40
- - **multimodal-orchestration** — sequenciar texto, imagem, voz e uso de tool num fluxo só
41
- - **feedback-loops** — correção do usuário, thumbs, edição inline como sinal que muda o comportamento
42
- - **context-window-design** — orçamento de tokens, memória, resumir vs. buscar, degradação suave
33
+ ## 2. Human-AI interaction (`references/model-interaction-design/`)
34
+ How the conversation flows.
35
+ - **conversation-patterns** — turns, repair sequences, alignment checkpoints
36
+ - **frustration-detection** — reading frustration via caps, punctuation, repetition, latency, and adapting
37
+ - **mixed-initiative-flow** — when the agent leads vs. when the user leads, with a clean handoff
38
+ - **progressive-disclosure** — revealing the tool's power gradually, without overwhelming turn 1
39
+ - **generative-ui** — when to render a component (date picker, card, chart) vs. plain text
40
+ - **multimodal-orchestration** — sequencing text, image, voice, and tool use in a single flow
41
+ - **feedback-loops** — user correction, thumbs, inline editing as a signal that changes behavior
42
+ - **context-window-design** — token budget, memory, summarizing vs. retrieving, graceful degradation
43
43
 
44
- ## 3. Arquitetura de prompt (`references/prompt-architecture/`)
45
- Como o prompt é escrito. **A camada mais direta pra melhorar agentes.**
46
- - **system-prompt-structure** — anatomia: identidade, contexto, regras, formato, exemplos (o que importa no começo/fim)
47
- - **constraint-specification** — limites testáveis: formato, tamanho, tom, conteúdo proibido
48
- - **few-shot-patterns** — exemplos que miram os erros que o modelo insiste em cometer
49
- - **chain-of-thought-design** — cadeias de raciocínio deliberadas pra tarefa de vários passos
50
- - **template-design** — templates parametrizados com variáveis nomeadas e seções condicionais
51
- - **context-engineering** — o que entra no contexto e em que ordem
52
- - **prompt-versioning** — versionar prompts, testar mudanças, rastrear o que funciona
44
+ ## 3. Prompt architecture (`references/prompt-architecture/`)
45
+ How the prompt is written. **The most direct layer for improving agents.**
46
+ - **system-prompt-structure** — anatomy: identity, context, rules, format, examples (what matters at the start/end)
47
+ - **constraint-specification** — testable limits: format, length, tone, prohibited content
48
+ - **few-shot-patterns** — examples that target the errors the model keeps making
49
+ - **chain-of-thought-design** — deliberate reasoning chains for multi-step tasks
50
+ - **template-design** — parameterized templates with named variables and conditional sections
51
+ - **context-engineering** — what goes into context and in what order
52
+ - **prompt-versioning** — versioning prompts, testing changes, tracking what works
53
53
 
54
54
  ## 4. Trust & Safety (`references/ai-alignment-reasoning/`)
55
- O que o agente pode e não pode; como não enganar o usuário.
56
- - **guardrail-design** — limites de comportamento e padrões de recusa explícitos (o "pode/não pode")
57
- - **transparency-patterns** — mostrar o que o modelo sabe, não sabe e o quão certo está
58
- - **trust-calibration** — nem overtrust nem undertrust; sinalizar incerteza em vez de blefar
59
- - **escalation-design** — quando escalar pra humano, recusar, ou pedir esclarecimento
60
- - **harm-anticipation** — mapear failure modes, mau uso e consequências não intencionais
61
- - **value-specification** — traduzir valores da organização em constraints do sistema
62
- - **consent-and-agency** — consentimento informado, opt-out e override humano
63
- - **bias-detection-design** — workflows de review pra achar e mitigar viés
55
+ What the agent can and can't do; how not to mislead the user.
56
+ - **guardrail-design** — explicit behavior limits and refusal patterns (the "can/can't")
57
+ - **transparency-patterns** — showing what the model knows, doesn't know, and how confident it is
58
+ - **trust-calibration** — neither overtrust nor undertrust; signal uncertainty instead of bluffing
59
+ - **escalation-design** — when to escalate to a human, refuse, or ask for clarification
60
+ - **harm-anticipation** — mapping failure modes, misuse, and unintended consequences
61
+ - **value-specification** — translating organizational values into system constraints
62
+ - **consent-and-agency** — informed consent, opt-out, and human override
63
+ - **bias-detection-design** — review workflows to find and mitigate bias
64
64
 
65
- ## 5. Orquestração multi-agente (`references/design-agent-orchestration/`)
66
- Pra sistemas com vários agentes (o caso do próprio método: Diretor → maestro → agentes).
67
- - **agent-role-design** — o que cada agente faz, sabe e é dono num sistema multi-agente
68
- - **task-decomposition** — quebrar objetivo complexo em subtarefas que os agentes resolvem
69
- - **handoff-protocols** — transições suaves entre agentes e entre IA e humano
70
- - **state-management** — contexto, memória e estado compartilhados entre agentes
71
- - **human-in-the-loop** — pontos de intervenção onde o humano revisa, aprova ou redireciona
72
- - **failure-recovery** — quando um agente falha: retry, fallback, escalar, degradação suave
73
- - **observability-design** — tornar o workflow multi-agente visível e debugável
65
+ ## 5. Multi-agent orchestration (`references/design-agent-orchestration/`)
66
+ For systems with multiple agents (the method's own case: Diretor → maestro → agents).
67
+ - **agent-role-design** — what each agent does, knows, and owns in a multi-agent system
68
+ - **task-decomposition** — breaking a complex goal into subtasks the agents solve
69
+ - **handoff-protocols** — smooth transitions between agents and between AI and human
70
+ - **state-management** — context, memory, and state shared across agents
71
+ - **human-in-the-loop** — intervention points where the human reviews, approves, or redirects
72
+ - **failure-recovery** — when an agent fails: retry, fallback, escalate, graceful degradation
73
+ - **observability-design** — making the multi-agent workflow visible and debuggable
74
74
 
75
- ## 6. Avaliação (`references/evaluation/`)
76
- Como saber se a IA está boa.
77
- - **output-quality-rubrics** — definir o que é "bom": acurácia, relevância, utilidade
78
- - **task-success-metrics** — medir se a IA de fato ajudou o usuário a concluir a meta
79
- - **user-satisfaction-signals** — ler sinais implícitos/explícitos: edições, regenerações, abandono
80
- - **failure-taxonomy** — classificar falhas: alucinação, recusa, irrelevância, tom errado, latência
81
- - **comparative-evaluation** — A/B, comparação lado a lado, ranking de preferência
82
- - **heuristic-evaluation-ai** — heurísticas de Nielsen adaptadas + heurísticas próprias de IA
83
- - **longitudinal-measurement** — qualidade ao longo do tempo: drift, degradação, melhoria
75
+ ## 6. Evaluation (`references/evaluation/`)
76
+ How to know if the AI is good.
77
+ - **output-quality-rubrics** — defining what "good" means: accuracy, relevance, usefulness
78
+ - **task-success-metrics** — measuring whether the AI actually helped the user reach the goal
79
+ - **user-satisfaction-signals** — reading implicit/explicit signals: edits, regenerations, abandonment
80
+ - **failure-taxonomy** — classifying failures: hallucination, refusal, irrelevance, wrong tone, latency
81
+ - **comparative-evaluation** — A/B, side-by-side comparison, preference ranking
82
+ - **heuristic-evaluation-ai** — adapted Nielsen heuristics + AI-specific heuristics
83
+ - **longitudinal-measurement** — quality over time: drift, degradation, improvement
84
84
 
85
85
  ---
86
86
 
87
- **Créditos:** Owl-Listener/ai-design-skills (licença MIT, ver `references/LICENSE`). Índice traduzido/curado para o Wizz Method.
87
+ **Credits:** Owl-Listener/ai-design-skills (MIT license, see `references/LICENSE`). Index translated/curated for the Wizz Method.
@@ -1,100 +1,100 @@
1
1
  ---
2
2
  name: wizz-auth-and-secrets
3
3
  description: >
4
- Segurança de autenticação e gestão de secrets. Usar quando: implementar auth, lidar com JWT/OAuth/SSO,
5
- token no header vs URL, revogação de token no logout, enumeração de usuário/mensagem genérica,
6
- guardar API keys ou credenciais, configurar Clerk/Supabase auth, revisar onde secrets estão armazenados,
7
- rotação de credenciais, checar se .env está seguro. Use quando o usuário mencionar login, cadastro,
8
- senha, JWT, OAuth, SSO, 2FA, sessão, logout, API key ou variável de ambiente/.env.
4
+ Authentication security and secrets management. Use when: implementing auth, handling JWT/OAuth/SSO,
5
+ token in header vs URL, token revocation on logout, user enumeration/generic messages,
6
+ storing API keys or credentials, configuring Clerk/Supabase auth, reviewing where secrets are stored,
7
+ credential rotation, checking whether .env is secure. Use when the user mentions login, signup,
8
+ password, JWT, OAuth, SSO, 2FA, session, logout, API key, or environment variable/.env.
9
9
  ---
10
10
 
11
11
  # Auth and Secrets
12
12
 
13
- ## Autenticação
13
+ ## Authentication
14
14
 
15
- ### Senhas
16
- - Hash com bcrypt (custo >= 12), Argon2id ou scrypt. Nunca MD5/SHA1 para senhas
17
- - Mínimo de 8 caracteres, sem restrição de caracteres especiais
18
- - Implemente bloqueio após N tentativas (lockout ou CAPTCHA)
19
- - Ofereça 2FA: TOTP (Google Authenticator) é o padrão mínimo
15
+ ### Passwords
16
+ - Hash with bcrypt (cost >= 12), Argon2id, or scrypt. Never MD5/SHA1 for passwords
17
+ - Minimum 8 characters, no restriction on special characters
18
+ - Implement lockout after N attempts (lockout or CAPTCHA)
19
+ - Offer 2FA: TOTP (Google Authenticator) is the minimum standard
20
20
 
21
21
  ### JWT
22
- - Na verificação, aceite só o algoritmo esperado: rejeite `alg: none` e não deixe o token escolher o algoritmo (ataque de confusão de algoritmo)
23
- - Prefira RS256 (assimétrico) quando mais de um serviço verifica o token. HS256 só com secret forte: 32+ bytes aleatórios, nunca uma palavra
24
- - exp curto para access token (15 min a 1h)
25
- - Refresh token com rotação: ao usar, invalide o anterior e emita novo
26
- - Nunca coloque dados sensíveis no payload (é base64, não criptografia)
27
- - **Token no header `Authorization: Bearer`, NUNCA na URL/query string** (a URL vaza em logs de servidor, histórico do browser, header `Referer` e analytics)
28
- - **Logout de verdade revoga o token**: coloque na blacklist (Redis, TTL = exp do token) e invalide o refresh token. Sem isso o access token continua válido depois do logout até expirar sozinho
29
-
30
- ### Enumeração de usuário
31
- Evita que um atacante descubra quais e-mails existem na base (login, signup, reset de senha).
32
- - Resposta idêntica para e-mail existente e inexistente: "Se o e-mail existir, enviamos um link"
33
- - No login use mensagem genérica ("credenciais inválidas"), nunca "e-mail não cadastrado" vs "senha incorreta"
34
- - Responda em **tempo constante**: rode o hash da senha mesmo quando o usuário não existe (senão o tempo de resposta denuncia quem existe)
35
- - Reforce com rate limit por IP **e** por conta (ver wizz-web-security) para barrar varredura de e-mails
22
+ - On verification, accept only the expected algorithm: reject `alg: none` and don't let the token choose the algorithm (algorithm confusion attack)
23
+ - Prefer RS256 (asymmetric) when more than one service verifies the token. HS256 only with a strong secret: 32+ random bytes, never a word
24
+ - Short exp for access tokens (15 min to 1h)
25
+ - Refresh token with rotation: on use, invalidate the previous one and issue a new one
26
+ - Never put sensitive data in the payload (it's base64, not encryption)
27
+ - **Token in the `Authorization: Bearer` header, NEVER in the URL/query string** (the URL leaks into server logs, browser history, the `Referer` header, and analytics)
28
+ - **A real logout revokes the token**: blacklist it (Redis, TTL = token exp) and invalidate the refresh token. Without this, the access token stays valid after logout until it expires on its own
29
+
30
+ ### User enumeration
31
+ Prevents an attacker from discovering which emails exist in the database (login, signup, password reset).
32
+ - Identical response for existing and non-existing email: "If the email exists, we sent a link"
33
+ - On login use a generic message ("invalid credentials"), never "email not registered" vs "wrong password"
34
+ - Respond in **constant time**: run the password hash even when the user doesn't exist (otherwise the response time gives away who exists)
35
+ - Reinforce with rate limiting by IP **and** by account (see wizz-web-security) to block email scanning
36
36
 
37
37
  ### OAuth / SSO
38
- - Use biblioteca estabelecida, não implemente o flow manualmente
39
- - Valide state parameter para prevenir CSRF
40
- - PKCE obrigatório para flows em SPAs e apps mobile
41
-
42
- ### Stack Supabase + Clerk
43
- - Auth gerenciada pelo Clerk: nunca reimplementar flows de auth manualmente
44
- - Toda rota protegida, Server Action e route handler chama `auth()` do Clerk no servidor. Nunca confiar em estado de sessão vindo do cliente
45
- - Clerk webhook (`svix`) verificado por assinatura antes de processar: não confiar no body sem verificar
46
- - Webhook de pagamento/provedor externo: além de verificar a assinatura, **nunca confie em valor de status, dinheiro ou permissão que veio no corpo**. Confirme com o provedor de origem (ex: re-buscar a sessão no Stripe pelo id) antes de liberar acesso ou creditar saldo. Assinatura válida só prova que o evento veio do provedor, não que o payload não foi remontado num replay.
47
- - Supabase RLS: toda tabela de domínio deve ter RLS ativo; queries devem filtrar por `workspace_id`/`user_id`
48
- - `SUPABASE_SERVICE_ROLE_KEY` bypassa RLS: só em server-side (API routes, jobs), nunca exposta no frontend
49
- - `NEXT_PUBLIC_*` = seguro expor no cliente; tudo sem `NEXT_PUBLIC_` = server-only
50
-
51
- ## Secrets e credenciais
52
-
53
- ### O que nunca fazer
54
- - Commitar .env no git (use .gitignore + git-secrets)
55
- - Hardcodar API keys no código-fonte
56
- - Logar credenciais mesmo em debug
57
- - Usar mesmas credenciais em dev e produção
58
-
59
- ### Onde guardar secrets
60
- - Produção: variáveis de ambiente da plataforma (Vercel: `vercel env add`)
61
- - CI/CD: variáveis de ambiente criptografadas da plataforma (GitHub Actions Secrets, etc.)
62
- - Dev local: arquivo `.env.local` nunca commitado. Verificar com `git check-ignore -v .env.local`
63
-
64
- ### API keys emitidas pelo próprio app
65
- Se o app gera API keys para os usuários:
66
- - Guarde só o hash (SHA-256) da key no banco, nunca a key em texto plano
67
- - Mostre a key completa uma única vez, na criação
68
- - Use prefixo identificável (ex: `wz_live_`) para facilitar detecção em scan de repositório
69
- - Permita revogar e listar keys por usuário
70
-
71
- ### Cripto de credenciais de usuário (AES-256-GCM)
72
- Se o app armazena credenciais de terceiros do usuário (ex: SMTP, WhatsApp API):
38
+ - Use an established library, don't implement the flow manually
39
+ - Validate the state parameter to prevent CSRF
40
+ - PKCE mandatory for SPA and mobile app flows
41
+
42
+ ### Supabase + Clerk stack
43
+ - Auth managed by Clerk: never reimplement auth flows manually
44
+ - Every protected route, Server Action, and route handler calls Clerk's `auth()` on the server. Never trust session state coming from the client
45
+ - Clerk webhook (`svix`) verified by signature before processing: don't trust the body without verifying
46
+ - Payment/external provider webhook: besides verifying the signature, **never trust a status, money, or permission value that came in the body**. Confirm with the originating provider (e.g. re-fetch the session from Stripe by id) before granting access or crediting a balance. A valid signature only proves the event came from the provider, not that the payload wasn't reassembled in a replay.
47
+ - Supabase RLS: every domain table must have RLS enabled; queries must filter by `workspace_id`/`user_id`
48
+ - `SUPABASE_SERVICE_ROLE_KEY` bypasses RLS: server-side only (API routes, jobs), never exposed on the frontend
49
+ - `NEXT_PUBLIC_*` = safe to expose on the client; anything without `NEXT_PUBLIC_` = server-only
50
+
51
+ ## Secrets and credentials
52
+
53
+ ### What to never do
54
+ - Commit .env to git (use .gitignore + git-secrets)
55
+ - Hardcode API keys in the source code
56
+ - Log credentials even in debug
57
+ - Use the same credentials in dev and production
58
+
59
+ ### Where to store secrets
60
+ - Production: the platform's environment variables (Vercel: `vercel env add`)
61
+ - CI/CD: the platform's encrypted environment variables (GitHub Actions Secrets, etc.)
62
+ - Local dev: `.env.local` file, never committed. Verify with `git check-ignore -v .env.local`
63
+
64
+ ### API keys issued by the app itself
65
+ If the app generates API keys for users:
66
+ - Store only the key's hash (SHA-256) in the database, never the plaintext key
67
+ - Show the full key exactly once, at creation
68
+ - Use an identifiable prefix (e.g. `wz_live_`) to make repository scan detection easier
69
+ - Allow revoking and listing keys per user
70
+
71
+ ### Encrypting user credentials (AES-256-GCM)
72
+ If the app stores the user's third-party credentials (e.g. SMTP, WhatsApp API):
73
73
  ```ts
74
- // src/lib/crypto.ts: chave vem do env, nunca hardcodada
74
+ // src/lib/crypto.ts: key comes from env, never hardcoded
75
75
  import { createCipheriv, randomBytes } from "crypto"
76
76
 
77
77
  const key = process.env.CREDENTIAL_ENCRYPTION_KEY // base64, 32 bytes
78
- if (!key) throw new Error("CREDENTIAL_ENCRYPTION_KEY não configurada")
78
+ if (!key) throw new Error("CREDENTIAL_ENCRYPTION_KEY not configured")
79
79
 
80
80
  export function encrypt(plain: string) {
81
- const iv = randomBytes(12) // IV aleatório por registro, nunca reutilizar
81
+ const iv = randomBytes(12) // random IV per record, never reuse
82
82
  const cipher = createCipheriv("aes-256-gcm", Buffer.from(key, "base64"), iv)
83
83
  const enc = Buffer.concat([cipher.update(plain, "utf8"), cipher.final()])
84
84
  return { iv: iv.toString("base64"), data: enc.toString("base64"), tag: cipher.getAuthTag().toString("base64") }
85
85
  }
86
- // no decrypt: setAuthTag antes de final(), senão a integridade não é verificada
86
+ // on decrypt: setAuthTag before final(), otherwise integrity isn't verified
87
87
  ```
88
88
 
89
- ### Rotação de credenciais
90
- - Rotacione secrets de terceiros a cada 90 dias ou após qualquer saída de membro do time
91
- - Secret commitado por acidente: considere comprometido e rotacione na hora. Reescrever o histórico do git não basta
92
- - API keys de produção: uma por serviço/ambiente, nunca compartilhadas
93
- - Database passwords: use IAM auth quando disponível no cloud provider
89
+ ### Credential rotation
90
+ - Rotate third-party secrets every 90 days or after any team member leaves
91
+ - A secret committed by accident: treat it as compromised and rotate it immediately. Rewriting git history isn't enough
92
+ - Production API keys: one per service/environment, never shared
93
+ - Database passwords: use IAM auth when available on the cloud provider
94
94
 
95
- ### Comparação de tokens
96
- - NUNCA comparar tokens com `===` ou `!==` (timing attack)
97
- - SEMPRE usar `crypto.timingSafeEqual`:
95
+ ### Token comparison
96
+ - NEVER compare tokens with `===` or `!==` (timing attack)
97
+ - ALWAYS use `crypto.timingSafeEqual`:
98
98
  ```ts
99
99
  import { timingSafeEqual } from "crypto"
100
100
  const expected = Buffer.from(process.env.MY_SECRET_TOKEN!)
@@ -104,9 +104,9 @@ if (expected.length !== received.length || !timingSafeEqual(expected, received))
104
104
  }
105
105
  ```
106
106
 
107
- ### Checklist de secrets
108
- - [ ] `grep -r "sk_live\|sk_test\|service_role\|eyJ\|AAAA" src/` → vazio?
109
- - [ ] `.env*` no `.gitignore`?
110
- - [ ] `git log --all --diff-filter=A -- .env*` → vazio?
111
- - [ ] Secrets de produção diferentes dos de dev?
112
- - [ ] `SUPABASE_SERVICE_ROLE_KEY` nunca em variável `NEXT_PUBLIC_`?
107
+ ### Secrets checklist
108
+ - [ ] `grep -r "sk_live\|sk_test\|service_role\|eyJ\|AAAA" src/` → empty?
109
+ - [ ] `.env*` in `.gitignore`?
110
+ - [ ] `git log --all --diff-filter=A -- .env*` → empty?
111
+ - [ ] Production secrets different from dev?
112
+ - [ ] `SUPABASE_SERVICE_ROLE_KEY` never in a `NEXT_PUBLIC_` variable?
@@ -1,58 +1,58 @@
1
1
  ---
2
2
  name: wizz-caching-and-queues
3
- description: Caching e filas assíncronas — Redis cache-aside/write-through, TTL, rate limiting, BullMQ, SQS, Kafka. Use quando o pedido envolver cache, sessões, filas de job, processamento assíncrono.
3
+ description: Caching and asynchronous queues — Redis cache-aside/write-through, TTL, rate limiting, BullMQ, SQS, Kafka. Use when the request involves cache, sessions, job queues, asynchronous processing.
4
4
  ---
5
5
 
6
6
  # Caching and Queues
7
7
 
8
- ## Estratégias de cache
8
+ ## Caching strategies
9
9
 
10
10
  ### Cache-aside (Lazy Loading)
11
- 1. App busca no cache
12
- 2. Se não tem (miss), busca no banco
13
- 3. Salva no cache e retorna
14
- Vantagem: cache só tem o que foi acessado
15
- Desvantagem: primeiro acesso é lento (cold start)
11
+ 1. App looks in the cache
12
+ 2. If it's not there (miss), look in the database
13
+ 3. Save to cache and return
14
+ Advantage: the cache only holds what's been accessed
15
+ Disadvantage: the first access is slow (cold start)
16
16
 
17
17
  ### Write-through
18
- 1. App escreve no cache e no banco simultaneamente
19
- Vantagem: cache sempre atualizado
20
- Desvantagem: escreve em tudo mesmo para dados raramente lidos
18
+ 1. App writes to the cache and the database at the same time
19
+ Advantage: the cache is always up to date
20
+ Disadvantage: writes everything even for rarely-read data
21
21
 
22
22
  ### TTL (Time to Live)
23
- - Dados de sessão: 30 min a 24h
24
- - Respostas de API externa: conforme frequência de mudança
25
- - Contadores e rankings: 1 a 5 minutos
26
- - Configurações do sistema: 5 a 60 minutos
23
+ - Session data: 30 min to 24h
24
+ - External API responses: depends on how often they change
25
+ - Counters and rankings: 1 to 5 minutes
26
+ - System settings: 5 to 60 minutes
27
27
 
28
- ## Redis: padrões de uso
28
+ ## Redis: usage patterns
29
29
 
30
- ### Cache de resposta HTTP
31
- - Chave: hash da URL + query params + usuário
32
- - TTL: definido por tipo de dado
30
+ ### HTTP response cache
31
+ - Key: hash of URL + query params + user
32
+ - TTL: set per data type
33
33
 
34
34
  ### Rate limiting
35
- - Chave: user_id ou IP
36
- - Estrutura: INCR + EXPIRE
35
+ - Key: user_id or IP
36
+ - Structure: INCR + EXPIRE
37
37
 
38
38
  ### Session store
39
- - Mais rápido que banco para sessões ativas
40
-
41
- ## Filas assíncronas
42
-
43
- ### Quando usar fila
44
- - Processamento de imagem/vídeo
45
- - Envio de emails e notificações
46
- - Integração com sistemas externos lentos
47
- - Qualquer operação > 500ms que não precisa de resposta imediata
48
-
49
- ### Ferramentas
50
- - BullMQ (Node.js + Redis): simples, confiável, boa UI com Bull Board
51
- - SQS (AWS): managed, sem infraestrutura para manter
52
- - RabbitMQ: roteamento complexo de mensagens
53
- - Kafka: streaming de alto volume, retenção de mensagens
54
-
55
- ### Boas práticas de fila
56
- - Defina max retries e dead letter queue
57
- - Jobs devem ser idempotentes (reprocessamento seguro)
58
- - Monitore tamanho da fila (backlog crescendo = problema)
39
+ - Faster than the database for active sessions
40
+
41
+ ## Asynchronous queues
42
+
43
+ ### When to use a queue
44
+ - Image/video processing
45
+ - Sending emails and notifications
46
+ - Integration with slow external systems
47
+ - Any operation > 500ms that doesn't need an immediate response
48
+
49
+ ### Tools
50
+ - BullMQ (Node.js + Redis): simple, reliable, good UI with Bull Board
51
+ - SQS (AWS): managed, no infrastructure to maintain
52
+ - RabbitMQ: complex message routing
53
+ - Kafka: high-volume streaming, message retention
54
+
55
+ ### Queue best practices
56
+ - Define max retries and a dead letter queue
57
+ - Jobs must be idempotent (safe to reprocess)
58
+ - Monitor queue size (a growing backlog = a problem)