jarvis-ai-framework 2.1.1 → 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 (259) hide show
  1. package/AGENTS.md +14 -115
  2. package/agents/AGENTS.md +11 -23
  3. package/agents/README.md +25 -129
  4. package/agents/engineering/data/eng.data-engineer.agent.md +11 -34
  5. package/agents/engineering/eng.agent.md +14 -24
  6. package/agents/engineering/eng.bug-hunter.md +7 -15
  7. package/agents/engineering/eng.dev-code-reviewer.md +1 -1
  8. package/agents/engineering/eng.frontend.agent.md +3 -7
  9. package/agents/engineering/eng.rpa.agent.md +2 -8
  10. package/agents/engineering/qa/eng.qa.quality-strategist.md +6 -11
  11. package/agents/engineering/qa/eng.qa.test-architect.md +8 -18
  12. package/agents/engineering/qa/eng.qa.test-planner.md +10 -14
  13. package/agents/engineering/qa/eng.qa.testing-engineer.md +91 -24
  14. package/agents/product/prod.discovery-interviewer.md +3 -3
  15. package/bin/README.md +142 -0
  16. package/bin/commands/docs-publish.js +105 -141
  17. package/bin/commands/docs-sync.js +66 -104
  18. package/bin/commands/info.js +7 -27
  19. package/bin/commands/init.js +23 -51
  20. package/bin/commands/install-rtk.js +9 -3
  21. package/bin/commands/list.js +5 -18
  22. package/bin/commands/map.js +20 -5
  23. package/bin/commands/qa-signoff.js +58 -55
  24. package/bin/commands/tokens.js +14 -17
  25. package/bin/commands/whoami.js +30 -26
  26. package/bin/jarvis.js +9 -163
  27. package/bin/lib/auth/session.js +20 -20
  28. package/bin/lib/cli/program.js +219 -0
  29. package/bin/lib/cli/shared-options.js +29 -0
  30. package/bin/lib/config/constants.js +59 -2
  31. package/bin/lib/config/ide-config.js +4 -8
  32. package/bin/lib/core/profile-filter.js +4 -1
  33. package/bin/lib/core/scanner.js +3 -29
  34. package/bin/lib/core/sync-engine.js +21 -14
  35. package/bin/lib/core/token-report.js +12 -2
  36. package/bin/lib/docs/fetch-file.js +39 -0
  37. package/bin/lib/docs/publish-file.js +194 -0
  38. package/bin/lib/docs/redis-cache.js +49 -0
  39. package/bin/lib/docs/validate-frontmatter.js +9 -39
  40. package/bin/lib/env-loader.js +11 -34
  41. package/bin/lib/flow-map/parse.js +11 -5
  42. package/bin/lib/flow-map/render.js +5 -2
  43. package/bin/lib/flow-map/tree.js +59 -10
  44. package/bin/lib/tasks/comment.js +40 -35
  45. package/bin/lib/utils/frontmatter.js +57 -0
  46. package/bin/lib/utils/git-parser.js +4 -6
  47. package/bin/lib/utils/npmrc-parser.js +6 -13
  48. package/bin/lib/utils/paths.js +2 -4
  49. package/bin/lib/utils/ui.js +3 -9
  50. package/bin/lib/vcs/api.js +25 -41
  51. package/bin/lib/vcs/create-issue.js +49 -33
  52. package/bin/lib/vcs/create-merge.js +47 -31
  53. package/bin/lib/vcs/fetch-raw.js +35 -23
  54. package/package.json +14 -5
  55. package/rules/engineering/eng-rules.md +1 -1
  56. package/rules/engineering/eng-security-rules.md +18 -16
  57. package/rules/engineering/eng.bump-rules.md +3 -2
  58. package/rules/engineering/eng.docs-scraping-rules.md +4 -4
  59. package/rules/engineering/eng.integrations-rules.md +3 -3
  60. package/rules/engineering/eng.skills-rules.md +1 -1
  61. package/rules/engineering/eng.specializations-rules.md +18 -4
  62. package/rules/engineering/frontend/eng.frontend-rules.md +1 -4
  63. package/rules/engineering/qa/eng.qa.cypress-standards-rules.md +1 -1
  64. package/rules/engineering/rpa/eng.rpa-rules.md +4 -9
  65. package/skills/AGENTS.md +52 -87
  66. package/skills/SKILLS-ROADMAP.md +47 -128
  67. package/skills/eng-ai/SKILL.md +270 -0
  68. package/skills/eng-ai/references/1-fundamentos-ml.md +24 -0
  69. package/skills/eng-ai/references/10-arquitetura-solucoes-ia.md +24 -0
  70. package/skills/eng-ai/references/11-governanca-ia.md +24 -0
  71. package/skills/eng-ai/references/12-seguranca-ia-responsavel.md +25 -0
  72. package/skills/eng-ai/references/2-matematica-estatistica.md +24 -0
  73. package/skills/eng-ai/references/3-dados-para-ia.md +24 -0
  74. package/skills/eng-ai/references/4-deep-learning-fundacionais.md +24 -0
  75. package/skills/eng-ai/references/5-llms-chatbots-agentes-rag.md +25 -0
  76. package/skills/eng-ai/references/6-avaliacao-experimentacao.md +24 -0
  77. package/skills/eng-ai/references/7-engenharia-sistemas-ia.md +24 -0
  78. package/skills/eng-ai/references/8-mlops-plataforma.md +24 -0
  79. package/skills/eng-ai/references/9-produto-ia.md +24 -0
  80. package/skills/eng-ai/references/especializacoes.md +17 -0
  81. package/skills/eng-automation/SKILL.md +290 -0
  82. package/skills/eng-automation/references/1-fundamentos-automacao.md +25 -0
  83. package/skills/eng-automation/references/10-ingestao-dados.md +25 -0
  84. package/skills/eng-automation/references/11-captcha-antibot.md +25 -0
  85. package/skills/eng-automation/references/12-limites-taxa-sessoes.md +25 -0
  86. package/skills/eng-automation/references/13-agendamento-orquestracao.md +24 -0
  87. package/skills/eng-automation/references/14-retentativa-erros.md +25 -0
  88. package/skills/eng-automation/references/15-autenticacao-credenciais.md +24 -0
  89. package/skills/eng-automation/references/16-observabilidade-confiabilidade.md +24 -0
  90. package/skills/eng-automation/references/2-aquisicao-dados.md +25 -0
  91. package/skills/eng-automation/references/3-automacao-navegador.md +24 -0
  92. package/skills/eng-automation/references/4-scraping-crawling.md +25 -0
  93. package/skills/eng-automation/references/5-apis-rest-graphql-soap.md +26 -0
  94. package/skills/eng-automation/references/6-webhooks-integracao.md +25 -0
  95. package/skills/eng-automation/references/7-rpa.md +25 -0
  96. package/skills/eng-automation/references/8-extracao-estruturada.md +25 -0
  97. package/skills/eng-automation/references/9-extracao-documentos.md +25 -0
  98. package/skills/eng-automation/references/especializacoes.md +18 -0
  99. package/skills/eng-backend-nestjs/SKILL.md +1 -1
  100. package/skills/eng-data/SKILL.md +271 -0
  101. package/skills/eng-data/references/1-fundamentos-dados.md +24 -0
  102. package/skills/eng-data/references/10-ciencia-dados.md +24 -0
  103. package/skills/eng-data/references/11-dataops-plataforma.md +24 -0
  104. package/skills/eng-data/references/12-seguranca-privacidade.md +24 -0
  105. package/skills/eng-data/references/2-modelagem-dados.md +24 -0
  106. package/skills/eng-data/references/3-bancos-dados.md +24 -0
  107. package/skills/eng-data/references/4-arquitetura-dados.md +24 -0
  108. package/skills/eng-data/references/5-pipelines-integracao.md +24 -0
  109. package/skills/eng-data/references/6-qualidade-dados.md +24 -0
  110. package/skills/eng-data/references/7-governanca-metadados.md +24 -0
  111. package/skills/eng-data/references/8-estatistica-analise.md +24 -0
  112. package/skills/eng-data/references/9-analytics-bi.md +24 -0
  113. package/skills/eng-data/references/especializacoes.md +20 -0
  114. package/skills/eng-frontend/SKILL.md +12 -5
  115. package/skills/eng-frontend/references/13-design-system.md +48 -0
  116. package/skills/eng-frontend/references/14-microfrontend.md +46 -0
  117. package/skills/eng-global-task-comment/SKILL.md +2 -2
  118. package/skills/eng-platform/SKILL.md +331 -0
  119. package/skills/eng-platform/references/1-fundamentos-sistemas.md +23 -0
  120. package/skills/eng-platform/references/10-resiliencia-arquitetura.md +24 -0
  121. package/skills/eng-platform/references/11-plataforma-devex.md +24 -0
  122. package/skills/eng-platform/references/12-finops-custos.md +24 -0
  123. package/skills/eng-platform/references/13-seguranca-fundamentos.md +26 -0
  124. package/skills/eng-platform/references/14-profiling-performance.md +23 -0
  125. package/skills/eng-platform/references/15-testes-carga-chaos.md +23 -0
  126. package/skills/eng-platform/references/16-cache-multicamada.md +22 -0
  127. package/skills/eng-platform/references/2-redes.md +23 -0
  128. package/skills/eng-platform/references/3-cloud.md +24 -0
  129. package/skills/eng-platform/references/4-iac-automacao.md +24 -0
  130. package/skills/eng-platform/references/5-containers-orquestracao.md +25 -0
  131. package/skills/eng-platform/references/6-cicd-entrega.md +24 -0
  132. package/skills/eng-platform/references/7-observabilidade.md +24 -0
  133. package/skills/eng-platform/references/8-confiabilidade-sre.md +24 -0
  134. package/skills/eng-platform/references/9-seguranca-infra.md +26 -0
  135. package/skills/eng-platform/references/especializacoes.md +34 -0
  136. package/skills/eng-qa/SKILL.md +283 -0
  137. package/skills/eng-qa/references/1-fundamentos-qualidade.md +25 -0
  138. package/skills/eng-qa/references/10-confiabilidade.md +25 -0
  139. package/skills/eng-qa/references/11-seguranca.md +24 -0
  140. package/skills/eng-qa/references/12-acessibilidade.md +24 -0
  141. package/skills/eng-qa/references/13-dados-testes.md +24 -0
  142. package/skills/eng-qa/references/14-gestao-testes-defeitos.md +25 -0
  143. package/skills/eng-qa/references/15-arquitetura-qa.md +25 -0
  144. package/skills/eng-qa/references/2-estrategia-planejamento.md +25 -0
  145. package/skills/eng-qa/references/3-design-testes.md +25 -0
  146. package/skills/eng-qa/references/4-manual-exploratorio.md +24 -0
  147. package/skills/eng-qa/references/5-automacao-testes.md +25 -0
  148. package/skills/eng-qa/references/6-api-integracao.md +25 -0
  149. package/skills/eng-qa/references/7-contrato.md +24 -0
  150. package/skills/eng-qa/references/8-interface-compat-mobile.md +24 -0
  151. package/skills/eng-qa/references/9-performance.md +24 -0
  152. package/skills/eng-qa/references/especializacoes.md +29 -0
  153. package/skills/eng-qa-planner/SKILL.md +264 -0
  154. package/skills/jarvis-context-detect/SKILL.md +1 -1
  155. package/skills/jarvis-context-detect/assets/context-profile-template.md +1 -1
  156. package/skills/jarvis-create-specialization/SKILL.md +8 -0
  157. package/skills/jarvis-docs-central/README.md +31 -28
  158. package/skills/jarvis-docs-central/SKILL.md +5 -5
  159. package/skills/jarvis-init/SKILL.md +8 -8
  160. package/skills/jarvis-init/assets/passo-adicionar-stacks.md +47 -18
  161. package/skills/jarvis-list-specializations/SKILL.md +30 -17
  162. package/skills/jarvis-report-issue/SKILL.md +1 -1
  163. package/taxonomy.md +4 -16
  164. package/templates/ENV-template.md +10 -2
  165. package/templates/engineering/qa/qa.sprint-plan-template.md +1 -1
  166. package/workflows/AGENTS.md +3 -1
  167. package/workflows/README.md +0 -10
  168. package/workflows/engineering/data/data.new-pipeline.md +6 -5
  169. package/workflows/engineering/eng.bug-audit.md +4 -14
  170. package/workflows/engineering/eng.debug.md +4 -20
  171. package/workflows/engineering/eng.pr.md +10 -28
  172. package/workflows/engineering/eng.pre-pr.md +11 -19
  173. package/workflows/engineering/eng.review.md +7 -13
  174. package/workflows/engineering/eng.rpa.robot.md +3 -9
  175. package/workflows/engineering/eng.start.md +16 -11
  176. package/workflows/engineering/eng.work.md +10 -18
  177. package/workflows/engineering/qa/eng.qa-sprint-planning.md +1 -1
  178. package/workflows/product/prod.spec.discovery.md +2 -2
  179. package/workflows/warm-up.md +35 -63
  180. package/agents/engineering/eng.cybersecurity.agent.md +0 -486
  181. package/agents/engineering/qa/eng.qa.cypress-specialist.md +0 -112
  182. package/bin/lib/docs/fetch-file.sh +0 -41
  183. package/bin/lib/docs/publish-file.sh +0 -284
  184. package/rules/engineering/qa/eng.qa.exploratory-session-rules.md +0 -137
  185. package/rules/engineering/qa/eng.qa.quality-gate-scoring-rules.md +0 -181
  186. package/rules/engineering/qa/eng.qa.tech-spec-validation-criteria-rules.md +0 -120
  187. package/skills/eng-ai-engineer/SKILL.md +0 -303
  188. package/skills/eng-data-bi/SKILL.md +0 -206
  189. package/skills/eng-data-debug/SKILL.md +0 -314
  190. package/skills/eng-data-engineer/SKILL.md +0 -266
  191. package/skills/eng-data-onboard/SKILL.md +0 -317
  192. package/skills/eng-data-orchestrator/SKILL.md +0 -433
  193. package/skills/eng-devops-performance-engineer/SKILL.md +0 -319
  194. package/skills/eng-frontend-design-system/SKILL.md +0 -155
  195. package/skills/eng-frontend-design-system/references/1-estrutura-pacote.md +0 -57
  196. package/skills/eng-frontend-design-system/references/2-tokens.md +0 -116
  197. package/skills/eng-frontend-design-system/references/3-componentes.md +0 -165
  198. package/skills/eng-frontend-design-system/references/4-storybook.md +0 -85
  199. package/skills/eng-frontend-design-system/references/5-auditoria-versionamento.md +0 -76
  200. package/skills/eng-frontend-microfrontend/SKILL.md +0 -164
  201. package/skills/eng-frontend-microfrontend/references/1-criando-remote.md +0 -109
  202. package/skills/eng-frontend-microfrontend/references/2-configurando-shell.md +0 -70
  203. package/skills/eng-frontend-microfrontend/references/3-contratos-interface.md +0 -73
  204. package/skills/eng-frontend-microfrontend/references/4-shared-dependencies.md +0 -48
  205. package/skills/eng-frontend-microfrontend/references/5-event-bus.md +0 -59
  206. package/skills/eng-frontend-microfrontend/references/6-monorepo-deploy.md +0 -77
  207. package/skills/eng-frontend-microfrontend/references/7-troubleshooting.md +0 -45
  208. package/skills/eng-global-browser-extension-builder/SKILL.md +0 -392
  209. package/skills/eng-global-jira-comment/SKILL.md +0 -27
  210. package/skills/eng-qa-a11y-audit/SKILL.md +0 -276
  211. package/skills/eng-qa-bug-report/SKILL.md +0 -877
  212. package/skills/eng-qa-bug-report/TASK_MANAGERS.md +0 -138
  213. package/skills/eng-qa-bug-report/references/1-integracao-task-managers.md +0 -148
  214. package/skills/eng-qa-bug-report/references/2-exemplos-de-uso.md +0 -46
  215. package/skills/eng-qa-bug-report/references/3-bug-to-test.md +0 -45
  216. package/skills/eng-qa-cypress-e2e/SKILL.md +0 -184
  217. package/skills/eng-qa-dev-guide/SKILL.md +0 -173
  218. package/skills/eng-qa-e2e/SKILL.md +0 -407
  219. package/skills/eng-qa-e2e-spec-writer/SKILL.md +0 -329
  220. package/skills/eng-qa-exploratory/SKILL.md +0 -196
  221. package/skills/eng-qa-gate/SKILL.md +0 -377
  222. package/skills/eng-qa-gate/assets/checklist-validacao.md +0 -291
  223. package/skills/eng-qa-graphql-contract/SKILL.md +0 -263
  224. package/skills/eng-qa-quality-report/SKILL.md +0 -419
  225. package/skills/eng-qa-test-plan/SKILL.md +0 -473
  226. package/skills/eng-qa-testsprite/SKILL.md +0 -332
  227. package/skills/eng-qa-testsprite/references/testsprite-mcp.md +0 -224
  228. package/skills/eng-qa-unit-test/SKILL.md +0 -478
  229. package/skills/eng-scraper/SKILL.md +0 -260
  230. package/skills/eng-scraper/references/1-puppeteer.md +0 -140
  231. package/skills/eng-scraper/references/2-playwright-cheerio-pdf.md +0 -82
  232. package/skills/eng-scraper/references/3-anti-bot.md +0 -94
  233. package/skills/eng-scraper/references/4-resiliencia-etl-monitoramento.md +0 -137
  234. package/skills/eng-scraper-robot-builder/SKILL.md +0 -377
  235. package/skills/eng-security-cybersecurity/SKILL.md +0 -250
  236. package/skills/eng-security-cybersecurity/references/1-owasp-top-10.md +0 -331
  237. package/skills/eng-security-cybersecurity/references/2-secrets-management.md +0 -31
  238. package/skills/eng-security-cybersecurity/references/3-input-validation.md +0 -43
  239. package/skills/eng-security-cybersecurity/references/4-compliance.md +0 -20
  240. package/skills/eng-security-patch/SKILL.md +0 -388
  241. package/skills/eng-security-threat-model/SKILL.md +0 -171
  242. package/skills/eng-security-triage/SKILL.md +0 -276
  243. package/templates/engineering/qa/eng.qa.quality-gate-examples-template.md +0 -311
  244. package/templates/engineering/qa/eng.qa.quality-gate-report-template.md +0 -249
  245. package/templates/engineering/qa/qa.cypress-test-template.md +0 -172
  246. package/templates/engineering/qa/qa.exploratory-session-template.md +0 -148
  247. package/templates/engineering/qa/qa.quality-report-template.md +0 -130
  248. package/workflows/engineering/eng.security-audit.md +0 -319
  249. package/workflows/engineering/eng.security-incident.md +0 -281
  250. package/workflows/engineering/eng.security-pipeline.md +0 -219
  251. package/workflows/engineering/eng.security-review.md +0 -241
  252. package/workflows/engineering/qa/eng.qa-dev-quality-guide.md +0 -57
  253. package/workflows/engineering/qa/eng.qa-e2e-test-generation.md +0 -57
  254. package/workflows/engineering/qa/eng.qa-exploratory-session.md +0 -68
  255. package/workflows/engineering/qa/eng.qa-quality-gate-validation.md +0 -209
  256. package/workflows/engineering/qa/eng.qa-quality-report.md +0 -85
  257. /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-coverage-template.md +0 -0
  258. /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-patterns.md +0 -0
  259. /package/templates/{CDD aplicado a Prompts.md → cdd-aplicado-a-prompts.md} +0 -0
@@ -1,250 +0,0 @@
1
- ---
2
- name: eng-security-cybersecurity
3
- description: >
4
- Especialista em seguranca de aplicacoes: OWASP Top 10, secrets management, sanitizacao de inputs,
5
- headers de seguranca, SAST, supply chain, hardening e compliance.
6
- Trigger: Use para auditorias de seguranca, revisao de auth, prevencao de vulnerabilidades,
7
- resposta a CVEs, hardening de configs ou qualquer tema de cybersecurity.
8
- license: AGPL-3.0
9
- compatibility: Designed for Claude Code (or similar products)
10
- allowed-tools: Read Write Edit Glob Grep Bash
11
- metadata:
12
- author: jarvis-team
13
- version: "1.0"
14
- area: security
15
- argument-hint: "[audit|incident|review|hardening|secrets|owasp] [contexto]"
16
- disable-model-invocation: false
17
- ---
18
-
19
- # Eng Cybersecurity - Especialista em Seguranca de Aplicacoes
20
-
21
- Voce e um **especialista senior em cybersecurity ofensiva e defensiva** com dominio em seguranca de aplicacoes web, APIs, infraestrutura de codigo e supply chain. Atua na protecao proativa e reativa de software em qualquer stack.
22
-
23
- ## Objetivo
24
-
25
- Proteger aplicacoes contra vetores de ataque conhecidos e emergentes - desde vulnerabilidades no codigo ate falhas de configuracao, dependencias comprometidas e exposicao de dados sensiveis.
26
-
27
- ## Entrada
28
-
29
- - `$ARGUMENTS` - Operacao, vulnerabilidade ou contexto a analisar (ex: `audit-owasp`, `review-auth-flow`, `incident-cve-2024-xxxxx`, `hardening-headers`, `secrets-scan`)
30
-
31
- ## Recursos
32
-
33
- - **ENV**: `$IDE/ENV.md` (variaveis de ambiente, incluindo `CODE_QUALITY_TOOL`, `CODE_QUALITY_URL`)
34
- - **Saida**: relatorios de seguranca, correcoes no codigo, configs de hardening
35
-
36
- ---
37
-
38
- ## Pre-requisito
39
-
40
- Verificar se o `ENV.md` existe e se ha contexto de seguranca:
41
-
42
- ```bash
43
- # Verificar existencia do ENV.md
44
- cat $IDE/ENV.md
45
-
46
- # Verificar se ha ferramenta de code quality configurada
47
- grep "CODE_QUALITY" $IDE/ENV.md
48
- ```
49
-
50
- ---
51
-
52
- ## Quando Usar
53
-
54
- Use este skill quando:
55
- - Auditar seguranca de codigo, configs ou dependencias
56
- - Revisar fluxos de autenticacao e autorizacao
57
- - Responder a CVEs ou vulnerabilidades reportadas
58
- - Implementar hardening de headers, CORS, CSP, HSTS
59
- - Escanear secrets vazados no codigo ou historico git
60
- - Analisar supply chain (dependencias, lockfiles, licenses)
61
- - Implementar sanitizacao de inputs contra injection
62
- - Configurar SAST/DAST no pipeline de CI/CD
63
- - Avaliar compliance (LGPD, GDPR, PCI-DSS)
64
-
65
- **NAO usar quando:**
66
- - A tarefa e exclusivamente de infraestrutura de rede (firewall, IDS/IPS, VPN)
67
- - O problema e DDoS volumetrico (requer WAF/CDN)
68
- - A tarefa e de monitoramento runtime (SIEM, EDR) sem componente de codigo
69
-
70
- ---
71
-
72
- ## Validacao de Entrada
73
-
74
- Se $ARGUMENTS esta vazio, o skill funciona em modo interativo: solicitar ao usuario o contexto da tarefa de seguranca antes de prosseguir.
75
-
76
- ---
77
-
78
- ## Padroes Criticos
79
-
80
- ### Padrao 1: Ler o Projeto Antes de Auditar
81
-
82
- ```bash
83
- # Verificar framework e dependencias
84
- cat package.json 2>/dev/null || cat requirements.txt 2>/dev/null || cat go.mod 2>/dev/null
85
-
86
- # Verificar estrutura de auth
87
- grep -r "jwt\|passport\|auth\|guard\|middleware\|session\|cookie" src/ --include="*.ts" --include="*.js" --include="*.py" -l 2>/dev/null
88
-
89
- # Verificar configs de seguranca existentes
90
- find . -name ".env*" -o -name "*.env" -o -name "helmet*" -o -name "cors*" -o -name "csp*" 2>/dev/null | head -20
91
-
92
- # Verificar secrets potenciais
93
- grep -rn "password\|secret\|token\|api_key\|apikey\|private_key" --include="*.ts" --include="*.js" --include="*.py" --include="*.env" --include="*.yml" --include="*.yaml" -l 2>/dev/null | head -20
94
- ```
95
-
96
- ### Padrao 2: OWASP Top 10 como Framework Base
97
-
98
- Toda auditoria deve cobrir os 10 vetores criticos:
99
-
100
- ```
101
- A01 - Broken Access Control → RBAC, guards, permissoes, IDOR
102
- A02 - Cryptographic Failures → hashing, TLS, dados sensiveis em transito/repouso
103
- A03 - Injection → SQL, NoSQL, Command, LDAP, XSS
104
- A04 - Insecure Design → threat modeling, fluxos de negocio, abuse cases
105
- A05 - Security Misconfiguration → headers, CORS, debug mode, defaults inseguros
106
- A06 - Vulnerable Components → deps com CVEs, lockfile, lifecycle
107
- A07 - Auth Failures → brute force, session fixation, credential stuffing
108
- A08 - Data Integrity Failures → deserialization, CI/CD integrity, updates sem verificacao
109
- A09 - Logging & Monitoring → logs de seguranca, alertas, audit trail
110
- A10 - SSRF → URLs dinamicas, validacao de destinos, DNS rebinding
111
- ```
112
-
113
- ### Padrao 3: Severidade CVSS-alinhada
114
-
115
- Classificar toda vulnerabilidade encontrada:
116
-
117
- | Severidade | CVSS | Acao |
118
- |------------|------|------|
119
- | **CRITICAL** | 9.0-10.0 | Corrigir imediatamente - bloqueia deploy |
120
- | **HIGH** | 7.0-8.9 | Corrigir antes do proximo release |
121
- | **MEDIUM** | 4.0-6.9 | Planejar correcao na proxima sprint |
122
- | **LOW** | 0.1-3.9 | Documentar e corrigir quando conveniente |
123
- | **INFO** | 0.0 | Boa pratica - melhoria recomendada |
124
-
125
- ### Padrao 4: Defense in Depth
126
-
127
- Seguranca nunca depende de uma unica camada:
128
-
129
- ```
130
- 1. Input validation → primeira linha (nunca confiar em dados externos)
131
- 2. Authentication → verificar identidade
132
- 3. Authorization → verificar permissao
133
- 4. Output encoding → prevenir XSS na renderizacao
134
- 5. Transport security → TLS, HSTS
135
- 6. Logging & alerts → detectar e responder
136
- 7. Secrets management → proteger credenciais
137
- ```
138
-
139
- ---
140
-
141
- ## Arvore de Decisao
142
-
143
- ```
144
- Auditar seguranca completa? → Secao: Auditoria OWASP Top 10
145
- Revisar autenticacao/autorizacao? → Secao: Auth Security
146
- Escanear secrets? → Secao: Secrets Management
147
- Hardening de headers/configs? → Secao: Headers e Configuracao
148
- Analisar dependencias? → Secao: Supply Chain
149
- Responder a CVE/incidente? → Secao: Incident Response
150
- Sanitizar inputs? → Secao: Input Validation e Injection
151
- Avaliar compliance? → Secao: Compliance
152
- ```
153
-
154
- ---
155
-
156
- ## Fluxo de Trabalho
157
-
158
- ### Referencias (leia so o tema que a tarefa pedir)
159
-
160
- Leia **só** o arquivo do tema que a tarefa pedir; o restante fica fora do contexto.
161
-
162
- | Tema | Quando ler | Arquivo |
163
- |------|-----------|---------|
164
- | Auditoria OWASP Top 10 | A tarefa for uma auditoria de seguranca do codigo (OWASP Top 10) | `references/1-owasp-top-10.md` |
165
- | Secrets Management | A tarefa envolver segredos, tokens, chaves ou variaveis sensiveis | `references/2-secrets-management.md` |
166
- | Input Validation e Sanitizacao | A tarefa envolver validacao e sanitizacao de entradas | `references/3-input-validation.md` |
167
- | Compliance | A tarefa envolver LGPD, GDPR ou outros requisitos de conformidade | `references/4-compliance.md` |
168
-
169
- ### Skills invocados durante a execução do skill
170
-
171
- | Passo | Skill | Condição |
172
- |-------|-------|----------|
173
- | — | Nenhuma — skill autocontida | — |
174
-
175
- ---
176
-
177
- ## Regras
178
-
179
- ### Nunca
180
- - Ignorar uma vulnerabilidade encontrada (mesmo LOW deve ser documentada)
181
- - Confiar em validacao apenas no frontend (sempre validar no backend)
182
- - Usar algoritmos criptograficos obsoletos (MD5, SHA1 para senhas, DES)
183
- - Hardcodar secrets, tokens ou credenciais no codigo
184
- - Desabilitar verificacao de certificado TLS (`rejectUnauthorized: false`)
185
- - Logar dados sensiveis (senhas, tokens, PII)
186
- - Usar `eval()`, `Function()` ou `child_process.exec()` com input do usuario
187
-
188
- ### Sempre
189
- - Validar e sanitizar toda entrada externa
190
- - Usar queries parametrizadas (nunca concatenar SQL)
191
- - Implementar rate limiting em endpoints sensiveis
192
- - Manter dependencias atualizadas e monitorar CVEs
193
- - Logar eventos de seguranca (auth, access denied, config changes)
194
- - Usar HTTPS/TLS em todas as comunicacoes
195
- - Aplicar principio de least privilege em roles e permissoes
196
- - Ler o codigo existente antes de propor mudancas de seguranca
197
-
198
- ---
199
-
200
- ## Checklist de Conclusao
201
-
202
- - [ ] OWASP Top 10 avaliado (ou vetores relevantes ao escopo)
203
- - [ ] Secrets escaneados (codigo e historico git)
204
- - [ ] Dependencias verificadas (`npm audit` ou equivalente)
205
- - [ ] Headers de seguranca configurados (CSP, HSTS, X-Frame, etc.)
206
- - [ ] Inputs validados e sanitizados
207
- - [ ] Auth e authz revisados
208
- - [ ] Logs de seguranca implementados
209
- - [ ] Vulnerabilidades classificadas por severidade (CVSS)
210
- - [ ] Relatorio gerado com correcoes recomendadas
211
-
212
- ---
213
-
214
- ## Output
215
-
216
- | Artefato | Descricao |
217
- |----------|-----------|
218
- | Relatorio de seguranca | Vulnerabilidades encontradas com severidade, evidencia e correcao |
219
- | Correcoes | Patches aplicados no codigo (validacao, headers, auth) |
220
- | Cards no `$TASK_MANAGER` | Vulnerabilidades que requerem correcao planejada |
221
- | Hardening configs | Headers, CORS, CSP, session, rate limiting |
222
-
223
- ---
224
-
225
- ## Mensagem de Conclusao
226
-
227
- ```
228
- Auditoria de seguranca concluida!
229
-
230
- Escopo: {descricao do escopo analisado}
231
- Vulnerabilidades encontradas:
232
- CRITICAL: {n}
233
- HIGH: {n}
234
- MEDIUM: {n}
235
- LOW: {n}
236
- INFO: {n}
237
-
238
- Correcoes aplicadas: {n}
239
- Cards criados: {n}
240
- Proximo passo: {corrigir criticos / revisar relatorio / rodar SAST no CI}
241
- ```
242
-
243
- ---
244
-
245
- ## Recursos Adicionais
246
-
247
- - **Auth e RBAC**: Ver skill `eng-backend` para implementacao de autenticacao
248
- - **Guards e pipes NestJS**: Ver skill `eng-backend-nestjs` para middleware de seguranca
249
- - **Frontend XSS**: Ver skill `eng-frontend` para CSP e sanitizacao no client
250
- - **Supply chain**: hardening de CI/CD segue este skill e as regras do projeto (ainda não há skill específico de infraestrutura)
@@ -1,331 +0,0 @@
1
- # Auditoria OWASP Top 10
2
-
3
- > Parte do skill `eng-security-cybersecurity`. Leia este arquivo quando a tarefa for uma auditoria de seguranca do codigo (OWASP Top 10).
4
-
5
- ### Auditoria OWASP Top 10
6
-
7
- #### A01 - Broken Access Control
8
-
9
- ```typescript
10
- // ❌ IDOR - Insecure Direct Object Reference
11
- app.get('/api/users/:id', async (req, res) => {
12
- const user = await db.user.findUnique({ where: { id: req.params.id } })
13
- return res.json(user) // qualquer usuario acessa qualquer perfil
14
- })
15
-
16
- // ✅ Verificar que o usuario so acessa seus proprios dados (ou tem permissao)
17
- app.get('/api/users/:id', authenticate, async (req, res) => {
18
- if (req.user.id !== req.params.id && !req.user.roles.includes('admin')) {
19
- throw new ForbiddenError('Acesso negado')
20
- }
21
- const user = await db.user.findUnique({ where: { id: req.params.id } })
22
- return res.json(user)
23
- })
24
- ```
25
-
26
- ```typescript
27
- // ❌ Funcao admin sem guard
28
- @Controller('admin')
29
- export class AdminController {
30
- @Get('users')
31
- listUsers() { return this.userService.findAll() }
32
- }
33
-
34
- // ✅ Guard de role obrigatorio
35
- @Controller('admin')
36
- @UseGuards(AuthGuard, RolesGuard)
37
- @Roles('admin')
38
- export class AdminController {
39
- @Get('users')
40
- listUsers() { return this.userService.findAll() }
41
- }
42
- ```
43
-
44
- #### A02 - Cryptographic Failures
45
-
46
- ```typescript
47
- // ❌ Hash fraco para senhas
48
- const hash = crypto.createHash('md5').update(password).digest('hex')
49
-
50
- // ✅ bcrypt ou argon2 com salt automatico
51
- import * as bcrypt from 'bcrypt'
52
- const SALT_ROUNDS = 12
53
- const hash = await bcrypt.hash(password, SALT_ROUNDS)
54
- const isValid = await bcrypt.compare(password, hash)
55
- ```
56
-
57
- ```typescript
58
- // ❌ Dados sensiveis sem criptografia em repouso
59
- await db.user.create({ data: { cpf: '123.456.789-00' } })
60
-
61
- // ✅ Criptografar dados sensiveis (PII)
62
- import { createCipheriv, createDecipheriv, randomBytes } from 'crypto'
63
-
64
- function encrypt(text: string, key: Buffer): string {
65
- const iv = randomBytes(16)
66
- const cipher = createCipheriv('aes-256-gcm', key, iv)
67
- const encrypted = Buffer.concat([cipher.update(text, 'utf8'), cipher.final()])
68
- const tag = cipher.getAuthTag()
69
- return `${iv.toString('hex')}:${tag.toString('hex')}:${encrypted.toString('hex')}`
70
- }
71
- ```
72
-
73
- #### A03 - Injection
74
-
75
- ```typescript
76
- // ❌ SQL injection
77
- const query = `SELECT * FROM users WHERE email = '${req.body.email}'`
78
- await db.$queryRawUnsafe(query)
79
-
80
- // ✅ Queries parametrizadas (sempre)
81
- const user = await db.$queryRaw`SELECT * FROM users WHERE email = ${req.body.email}`
82
- // Ou via ORM (Prisma, TypeORM)
83
- const user = await db.user.findUnique({ where: { email: req.body.email } })
84
- ```
85
-
86
- ```typescript
87
- // ❌ Command injection
88
- const result = exec(`ping ${req.query.host}`)
89
-
90
- // ✅ Validar e sanitizar ou usar APIs seguras
91
- import { isIP } from 'net'
92
- if (!isIP(req.query.host)) throw new BadRequestError('Host invalido')
93
- const result = execFile('ping', ['-c', '1', req.query.host])
94
- ```
95
-
96
- ```typescript
97
- // ❌ NoSQL injection (MongoDB)
98
- db.collection('users').find({ email: req.body.email, password: req.body.password })
99
- // Atacante envia: { "password": { "$ne": "" } }
100
-
101
- // ✅ Validar tipos explicitamente
102
- import { z } from 'zod'
103
- const loginSchema = z.object({
104
- email: z.string().email(),
105
- password: z.string().min(8).max(128),
106
- })
107
- const { email, password } = loginSchema.parse(req.body)
108
- const user = await db.collection('users').findOne({ email })
109
- const isValid = await bcrypt.compare(password, user.passwordHash)
110
- ```
111
-
112
- #### A04 - Insecure Design
113
-
114
- ```
115
- Checklist de design seguro (antes de implementar):
116
-
117
- 1. Threat Modeling — mapear atores, entradas, dados sensiveis, limites de confianca
118
- 2. Abuse Cases — para cada feature, perguntar: "como um atacante abusaria disso?"
119
- 3. Rate Limiting — toda operacao sensivel deve ter limite
120
- 4. Least Privilege — dar apenas as permissoes necessarias
121
- 5. Fail Secure — em caso de erro, negar acesso (nao permitir)
122
- 6. Input Boundaries — definir limites maximos para todos os inputs
123
- ```
124
-
125
- #### A05 - Security Misconfiguration
126
-
127
- ```typescript
128
- // ✅ Headers de seguranca com Helmet (Express/NestJS)
129
- import helmet from 'helmet'
130
-
131
- app.use(helmet({
132
- contentSecurityPolicy: {
133
- directives: {
134
- defaultSrc: ["'self'"],
135
- scriptSrc: ["'self'"],
136
- styleSrc: ["'self'", "'unsafe-inline'"], // avaliar remover unsafe-inline
137
- imgSrc: ["'self'", 'data:', 'https:'],
138
- connectSrc: ["'self'"],
139
- fontSrc: ["'self'"],
140
- objectSrc: ["'none'"],
141
- mediaSrc: ["'self'"],
142
- frameSrc: ["'none'"],
143
- },
144
- },
145
- crossOriginEmbedderPolicy: true,
146
- crossOriginOpenerPolicy: true,
147
- crossOriginResourcePolicy: { policy: 'same-site' },
148
- dnsPrefetchControl: true,
149
- frameguard: { action: 'deny' },
150
- hsts: { maxAge: 31536000, includeSubDomains: true, preload: true },
151
- ieNoOpen: true,
152
- noSniff: true,
153
- referrerPolicy: { policy: 'strict-origin-when-cross-origin' },
154
- xssFilter: true,
155
- }))
156
- ```
157
-
158
- ```typescript
159
- // ✅ CORS restritivo
160
- app.enableCors({
161
- origin: process.env.ALLOWED_ORIGINS?.split(',') ?? [],
162
- methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
163
- allowedHeaders: ['Content-Type', 'Authorization'],
164
- credentials: true,
165
- maxAge: 86400,
166
- })
167
-
168
- // ❌ CORS aberto
169
- app.enableCors({ origin: '*' }) // nunca em producao
170
- ```
171
-
172
- ```typescript
173
- // ❌ Debug mode em producao
174
- app.listen(3000, () => {
175
- console.log('Stack traces habilitados')
176
- })
177
-
178
- // ✅ Error handler que nao vaza detalhes
179
- app.useGlobalFilters(new HttpExceptionFilter()) // retorna apenas code + message
180
- ```
181
-
182
- #### A06 - Vulnerable Components
183
-
184
- ```bash
185
- # ✅ Verificar vulnerabilidades em dependencias
186
- npm audit # Node.js
187
- npm audit --audit-level=high # Apenas high e critical
188
- pip audit # Python
189
- go vuln check ./... # Go
190
- cargo audit # Rust
191
-
192
- # ✅ Verificar lockfile integrity
193
- # lockfile deve estar commitado e nao ter sido adulterado
194
- git diff --name-only HEAD | grep -E "package-lock|yarn.lock|pnpm-lock"
195
-
196
- # ✅ Verificar licencas
197
- npx license-checker --summary # Node.js
198
- ```
199
-
200
- ```
201
- Politica de dependencias:
202
-
203
- 1. Lockfile SEMPRE commitado — previne supply chain attacks
204
- 2. npm audit em CI — bloquear deploy com vulnerabilidades HIGH/CRITICAL
205
- 3. Dependencias diretas: preferir pacotes com manutencao ativa
206
- 4. Pinning de versao: usar ranges conservadores (^major.minor)
207
- 5. Revisar changelogs antes de atualizar major versions
208
- ```
209
-
210
- #### A07 - Authentication Failures
211
-
212
- ```typescript
213
- // ✅ Rate limiting em login
214
- import rateLimit from 'express-rate-limit'
215
-
216
- const loginLimiter = rateLimit({
217
- windowMs: 15 * 60 * 1000, // 15 minutos
218
- max: 5, // 5 tentativas
219
- message: 'Muitas tentativas de login. Tente novamente em 15 minutos.',
220
- standardHeaders: true,
221
- legacyHeaders: false,
222
- keyGenerator: (req) => req.body.email ?? req.ip, // por email, nao por IP
223
- })
224
-
225
- app.post('/auth/login', loginLimiter, loginController)
226
- ```
227
-
228
- ```typescript
229
- // ✅ Session security
230
- app.use(session({
231
- secret: process.env.SESSION_SECRET,
232
- name: '__session', // nome custom (nao usar 'connect.sid')
233
- resave: false,
234
- saveUninitialized: false,
235
- cookie: {
236
- secure: true, // HTTPS only
237
- httpOnly: true, // nao acessivel via JS
238
- sameSite: 'strict', // prevenir CSRF
239
- maxAge: 30 * 60 * 1000, // 30 minutos
240
- domain: process.env.COOKIE_DOMAIN,
241
- },
242
- }))
243
- ```
244
-
245
- #### A08 - Software and Data Integrity Failures
246
-
247
- ```typescript
248
- // ✅ Verificar assinatura de webhooks
249
- function verifyWebhookSignature(payload: Buffer, signature: string, secret: string): boolean {
250
- const expected = crypto
251
- .createHmac('sha256', secret)
252
- .update(payload)
253
- .digest('hex')
254
- return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(`sha256=${expected}`))
255
- }
256
-
257
- // ✅ Deserialization segura — nunca usar eval() ou Function()
258
- // ❌ const data = eval(userInput)
259
- // ❌ const fn = new Function(userInput)
260
- // ✅ const data = JSON.parse(userInput) // com schema validation depois
261
- const parsed = safeSchema.parse(JSON.parse(userInput))
262
- ```
263
-
264
- #### A09 - Security Logging and Monitoring
265
-
266
- ```typescript
267
- // ✅ Eventos de seguranca que DEVEM ser logados
268
- const SECURITY_EVENTS = [
269
- 'auth.login.success',
270
- 'auth.login.failure',
271
- 'auth.logout',
272
- 'auth.password.change',
273
- 'auth.password.reset',
274
- 'auth.mfa.enable',
275
- 'auth.mfa.disable',
276
- 'auth.token.refresh',
277
- 'access.denied',
278
- 'access.admin.action',
279
- 'data.export',
280
- 'data.delete',
281
- 'config.change',
282
- 'user.create',
283
- 'user.role.change',
284
- ] as const
285
-
286
- // ✅ Log de seguranca estruturado
287
- function logSecurityEvent(event: string, context: {
288
- userId?: string
289
- ip: string
290
- userAgent: string
291
- resource?: string
292
- action?: string
293
- result: 'success' | 'failure'
294
- reason?: string
295
- }) {
296
- logger.info({ ...context, event, type: 'security' }, `Security: ${event}`)
297
- }
298
-
299
- // ❌ Nunca logar dados sensiveis
300
- // logSecurityEvent('auth.login', { password: '...' }) — NUNCA
301
- ```
302
-
303
- #### A10 - Server-Side Request Forgery (SSRF)
304
-
305
- ```typescript
306
- // ❌ SSRF — usuario controla URL de fetch
307
- app.get('/proxy', async (req, res) => {
308
- const response = await fetch(req.query.url) // atacante pode acessar http://169.254.169.254/
309
- return res.json(await response.json())
310
- })
311
-
312
- // ✅ Allowlist de dominios + validacao
313
- const ALLOWED_DOMAINS = new Set(process.env.ALLOWED_PROXY_DOMAINS?.split(',') ?? [])
314
-
315
- function validateUrl(urlString: string): URL {
316
- const url = new URL(urlString)
317
-
318
- // Bloquear IPs internos e metadata
319
- if (url.hostname === 'localhost' || url.hostname === '127.0.0.1' ||
320
- url.hostname.startsWith('169.254.') || url.hostname.startsWith('10.') ||
321
- url.hostname.startsWith('192.168.') || url.hostname.startsWith('172.')) {
322
- throw new BadRequestError('URL interna nao permitida')
323
- }
324
-
325
- if (!ALLOWED_DOMAINS.has(url.hostname)) {
326
- throw new BadRequestError(`Dominio ${url.hostname} nao permitido`)
327
- }
328
-
329
- return url
330
- }
331
- ```
@@ -1,31 +0,0 @@
1
- # Secrets Management
2
-
3
- > Parte do skill `eng-security-cybersecurity`. Leia este arquivo quando a tarefa envolver segredos, tokens, chaves ou variaveis sensiveis.
4
-
5
- ### Secrets Management
6
-
7
- ```bash
8
- # ✅ Escanear secrets no codigo
9
- # Ferramentas: gitleaks, trufflehog, detect-secrets
10
- # Executar antes de cada commit (pre-commit hook)
11
-
12
- # Exemplo com gitleaks (se disponivel)
13
- gitleaks detect --source . --report-format json --report-path gitleaks-report.json
14
-
15
- # Verificacao manual de patterns comuns
16
- grep -rn --include="*.ts" --include="*.js" --include="*.py" --include="*.yml" --include="*.yaml" \
17
- -E "(password|secret|token|api_key|apikey|private_key|AWS_|STRIPE_SK_)\s*[:=]\s*['\"][^'\"]+['\"]" \
18
- . 2>/dev/null
19
- ```
20
-
21
- ```
22
- Regras de secrets:
23
-
24
- 1. NUNCA commitar secrets no codigo — usar variaveis de ambiente
25
- 2. .env NUNCA no git — incluir no .gitignore
26
- 3. Rotacao periodica — secrets tem prazo de validade
27
- 4. Least privilege — cada servico tem suas proprias credenciais
28
- 5. Vault para producao — HashiCorp Vault, AWS Secrets Manager, GCP Secret Manager
29
- 6. Pre-commit hook — bloquear commits com secrets detectados
30
- 7. Historico git — se um secret vazou, rotacionar IMEDIATAMENTE (nao basta remover do codigo)
31
- ```
@@ -1,43 +0,0 @@
1
- # Input Validation e Sanitizacao
2
-
3
- > Parte do skill `eng-security-cybersecurity`. Leia este arquivo quando a tarefa envolver validacao e sanitizacao de entradas.
4
-
5
- ### Input Validation e Sanitizacao
6
-
7
- ```typescript
8
- // ✅ Schema validation com Zod (recomendado)
9
- import { z } from 'zod'
10
-
11
- const createUserSchema = z.object({
12
- name: z.string().min(2).max(100).trim(),
13
- email: z.string().email().max(255).toLowerCase(),
14
- password: z.string().min(8).max(128)
15
- .regex(/[A-Z]/, 'Deve conter pelo menos uma maiuscula')
16
- .regex(/[0-9]/, 'Deve conter pelo menos um numero')
17
- .regex(/[^A-Za-z0-9]/, 'Deve conter pelo menos um caractere especial'),
18
- age: z.number().int().min(13).max(150).optional(),
19
- role: z.enum(['user', 'editor']), // nunca aceitar 'admin' via input
20
- })
21
-
22
- // ✅ Validar no controller (antes de qualquer processamento)
23
- @Post()
24
- async createUser(@Body() body: unknown) {
25
- const data = createUserSchema.parse(body)
26
- return this.userService.create(data)
27
- }
28
- ```
29
-
30
- ```typescript
31
- // ✅ Sanitizacao de HTML (se aceitar rich text)
32
- import DOMPurify from 'isomorphic-dompurify'
33
-
34
- function sanitizeHtml(dirty: string): string {
35
- return DOMPurify.sanitize(dirty, {
36
- ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a', 'p', 'br', 'ul', 'ol', 'li'],
37
- ALLOWED_ATTR: ['href', 'target'],
38
- })
39
- }
40
-
41
- // ❌ Renderizar input do usuario sem sanitizar
42
- element.innerHTML = userInput // XSS
43
- ```
@@ -1,20 +0,0 @@
1
- # Compliance
2
-
3
- > Parte do skill `eng-security-cybersecurity`. Leia este arquivo quando a tarefa envolver LGPD, GDPR ou outros requisitos de conformidade.
4
-
5
- ### Compliance
6
-
7
- ```
8
- LGPD/GDPR — checklist minimo:
9
-
10
- 1. Consentimento explicito para coleta de dados pessoais
11
- 2. Direito de acesso — endpoint para exportar dados do usuario
12
- 3. Direito de exclusao — endpoint para deletar dados (ou anonimizar)
13
- 4. Minimizacao — coletar apenas o necessario
14
- 5. Retencao — definir e implementar politica de retencao
15
- 6. Criptografia de PII em repouso e transito
16
- 7. Log de acesso a dados sensiveis (audit trail)
17
- 8. Data Processing Agreement com fornecedores
18
- 9. Notificacao de breach em 72h (GDPR) / prazo razoavel (LGPD)
19
- 10. DPO designado (quando aplicavel)
20
- ```