jarvis-ai-framework 2.1.1 → 3.2.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 (266) hide show
  1. package/AGENTS.md +14 -115
  2. package/agents/AGENTS.md +11 -23
  3. package/agents/README.md +27 -129
  4. package/agents/engineering/data/eng.data-engineer.agent.md +11 -34
  5. package/agents/engineering/eng.advisor.agent.md +56 -0
  6. package/agents/engineering/eng.agent.md +14 -24
  7. package/agents/engineering/eng.bug-hunter.md +7 -15
  8. package/agents/engineering/eng.dev-code-reviewer.md +1 -1
  9. package/agents/engineering/eng.frontend.agent.md +3 -7
  10. package/agents/engineering/eng.rpa.agent.md +2 -8
  11. package/agents/engineering/qa/eng.qa.quality-strategist.md +6 -11
  12. package/agents/engineering/qa/eng.qa.test-architect.md +8 -18
  13. package/agents/engineering/qa/eng.qa.test-planner.md +10 -14
  14. package/agents/engineering/qa/eng.qa.testing-engineer.md +91 -24
  15. package/agents/product/prod.discovery-interviewer.md +3 -3
  16. package/bin/README.md +142 -0
  17. package/bin/commands/docs-publish.js +105 -141
  18. package/bin/commands/docs-sync.js +66 -104
  19. package/bin/commands/info.js +7 -27
  20. package/bin/commands/init.js +23 -51
  21. package/bin/commands/install-rtk.js +9 -3
  22. package/bin/commands/list.js +5 -18
  23. package/bin/commands/map.js +20 -5
  24. package/bin/commands/qa-signoff.js +58 -55
  25. package/bin/commands/tokens.js +14 -17
  26. package/bin/commands/whoami.js +30 -26
  27. package/bin/jarvis.js +9 -163
  28. package/bin/lib/auth/session.js +20 -20
  29. package/bin/lib/cli/program.js +219 -0
  30. package/bin/lib/cli/shared-options.js +29 -0
  31. package/bin/lib/config/constants.js +59 -2
  32. package/bin/lib/config/ide-config.js +4 -8
  33. package/bin/lib/core/profile-filter.js +4 -1
  34. package/bin/lib/core/scanner.js +3 -29
  35. package/bin/lib/core/sync-engine.js +21 -14
  36. package/bin/lib/core/token-report.js +12 -2
  37. package/bin/lib/docs/fetch-file.js +39 -0
  38. package/bin/lib/docs/publish-file.js +194 -0
  39. package/bin/lib/docs/redis-cache.js +49 -0
  40. package/bin/lib/docs/validate-frontmatter.js +9 -39
  41. package/bin/lib/env-loader.js +11 -34
  42. package/bin/lib/flow-map/parse.js +11 -5
  43. package/bin/lib/flow-map/render.js +5 -2
  44. package/bin/lib/flow-map/tree.js +59 -10
  45. package/bin/lib/tasks/comment.js +40 -35
  46. package/bin/lib/utils/frontmatter.js +57 -0
  47. package/bin/lib/utils/git-parser.js +4 -6
  48. package/bin/lib/utils/npmrc-parser.js +6 -13
  49. package/bin/lib/utils/paths.js +2 -4
  50. package/bin/lib/utils/ui.js +3 -9
  51. package/bin/lib/vcs/api.js +25 -41
  52. package/bin/lib/vcs/create-issue.js +49 -33
  53. package/bin/lib/vcs/create-merge.js +47 -31
  54. package/bin/lib/vcs/fetch-raw.js +35 -23
  55. package/package.json +14 -5
  56. package/rules/engineering/eng-rules.md +1 -1
  57. package/rules/engineering/eng-security-rules.md +18 -16
  58. package/rules/engineering/eng.bump-rules.md +3 -2
  59. package/rules/engineering/eng.docs-scraping-rules.md +4 -4
  60. package/rules/engineering/eng.integrations-rules.md +6 -4
  61. package/rules/engineering/eng.skills-rules.md +1 -1
  62. package/rules/engineering/eng.specializations-rules.md +18 -4
  63. package/rules/engineering/frontend/eng.frontend-rules.md +1 -4
  64. package/rules/engineering/qa/eng.qa.cypress-standards-rules.md +1 -1
  65. package/rules/engineering/rpa/eng.rpa-rules.md +4 -9
  66. package/rules-on-demand/engineering/eng.pre-pr-rules.md +1 -1
  67. package/rules-on-demand/engineering/eng.start-rules.md +2 -0
  68. package/skills/AGENTS.md +52 -87
  69. package/skills/SKILLS-ROADMAP.md +47 -128
  70. package/skills/eng-ai/SKILL.md +270 -0
  71. package/skills/eng-ai/references/1-fundamentos-ml.md +24 -0
  72. package/skills/eng-ai/references/10-arquitetura-solucoes-ia.md +24 -0
  73. package/skills/eng-ai/references/11-governanca-ia.md +24 -0
  74. package/skills/eng-ai/references/12-seguranca-ia-responsavel.md +25 -0
  75. package/skills/eng-ai/references/2-matematica-estatistica.md +24 -0
  76. package/skills/eng-ai/references/3-dados-para-ia.md +24 -0
  77. package/skills/eng-ai/references/4-deep-learning-fundacionais.md +24 -0
  78. package/skills/eng-ai/references/5-llms-chatbots-agentes-rag.md +25 -0
  79. package/skills/eng-ai/references/6-avaliacao-experimentacao.md +24 -0
  80. package/skills/eng-ai/references/7-engenharia-sistemas-ia.md +24 -0
  81. package/skills/eng-ai/references/8-mlops-plataforma.md +24 -0
  82. package/skills/eng-ai/references/9-produto-ia.md +24 -0
  83. package/skills/eng-ai/references/especializacoes.md +17 -0
  84. package/skills/eng-automation/SKILL.md +290 -0
  85. package/skills/eng-automation/references/1-fundamentos-automacao.md +25 -0
  86. package/skills/eng-automation/references/10-ingestao-dados.md +25 -0
  87. package/skills/eng-automation/references/11-captcha-antibot.md +25 -0
  88. package/skills/eng-automation/references/12-limites-taxa-sessoes.md +25 -0
  89. package/skills/eng-automation/references/13-agendamento-orquestracao.md +24 -0
  90. package/skills/eng-automation/references/14-retentativa-erros.md +25 -0
  91. package/skills/eng-automation/references/15-autenticacao-credenciais.md +24 -0
  92. package/skills/eng-automation/references/16-observabilidade-confiabilidade.md +24 -0
  93. package/skills/eng-automation/references/2-aquisicao-dados.md +25 -0
  94. package/skills/eng-automation/references/3-automacao-navegador.md +24 -0
  95. package/skills/eng-automation/references/4-scraping-crawling.md +25 -0
  96. package/skills/eng-automation/references/5-apis-rest-graphql-soap.md +26 -0
  97. package/skills/eng-automation/references/6-webhooks-integracao.md +25 -0
  98. package/skills/eng-automation/references/7-rpa.md +25 -0
  99. package/skills/eng-automation/references/8-extracao-estruturada.md +25 -0
  100. package/skills/eng-automation/references/9-extracao-documentos.md +25 -0
  101. package/skills/eng-automation/references/especializacoes.md +18 -0
  102. package/skills/eng-backend-nestjs/SKILL.md +1 -1
  103. package/skills/eng-data/SKILL.md +271 -0
  104. package/skills/eng-data/references/1-fundamentos-dados.md +24 -0
  105. package/skills/eng-data/references/10-ciencia-dados.md +24 -0
  106. package/skills/eng-data/references/11-dataops-plataforma.md +24 -0
  107. package/skills/eng-data/references/12-seguranca-privacidade.md +24 -0
  108. package/skills/eng-data/references/2-modelagem-dados.md +24 -0
  109. package/skills/eng-data/references/3-bancos-dados.md +24 -0
  110. package/skills/eng-data/references/4-arquitetura-dados.md +24 -0
  111. package/skills/eng-data/references/5-pipelines-integracao.md +24 -0
  112. package/skills/eng-data/references/6-qualidade-dados.md +24 -0
  113. package/skills/eng-data/references/7-governanca-metadados.md +24 -0
  114. package/skills/eng-data/references/8-estatistica-analise.md +24 -0
  115. package/skills/eng-data/references/9-analytics-bi.md +24 -0
  116. package/skills/eng-data/references/especializacoes.md +20 -0
  117. package/skills/eng-frontend/SKILL.md +12 -5
  118. package/skills/eng-frontend/references/13-design-system.md +48 -0
  119. package/skills/eng-frontend/references/14-microfrontend.md +46 -0
  120. package/skills/eng-global-task-comment/SKILL.md +3 -3
  121. package/skills/eng-platform/SKILL.md +331 -0
  122. package/skills/eng-platform/references/1-fundamentos-sistemas.md +23 -0
  123. package/skills/eng-platform/references/10-resiliencia-arquitetura.md +24 -0
  124. package/skills/eng-platform/references/11-plataforma-devex.md +24 -0
  125. package/skills/eng-platform/references/12-finops-custos.md +24 -0
  126. package/skills/eng-platform/references/13-seguranca-fundamentos.md +26 -0
  127. package/skills/eng-platform/references/14-profiling-performance.md +23 -0
  128. package/skills/eng-platform/references/15-testes-carga-chaos.md +23 -0
  129. package/skills/eng-platform/references/16-cache-multicamada.md +22 -0
  130. package/skills/eng-platform/references/2-redes.md +23 -0
  131. package/skills/eng-platform/references/3-cloud.md +24 -0
  132. package/skills/eng-platform/references/4-iac-automacao.md +24 -0
  133. package/skills/eng-platform/references/5-containers-orquestracao.md +25 -0
  134. package/skills/eng-platform/references/6-cicd-entrega.md +24 -0
  135. package/skills/eng-platform/references/7-observabilidade.md +24 -0
  136. package/skills/eng-platform/references/8-confiabilidade-sre.md +24 -0
  137. package/skills/eng-platform/references/9-seguranca-infra.md +26 -0
  138. package/skills/eng-platform/references/especializacoes.md +34 -0
  139. package/skills/eng-qa/SKILL.md +283 -0
  140. package/skills/eng-qa/references/1-fundamentos-qualidade.md +25 -0
  141. package/skills/eng-qa/references/10-confiabilidade.md +25 -0
  142. package/skills/eng-qa/references/11-seguranca.md +24 -0
  143. package/skills/eng-qa/references/12-acessibilidade.md +24 -0
  144. package/skills/eng-qa/references/13-dados-testes.md +24 -0
  145. package/skills/eng-qa/references/14-gestao-testes-defeitos.md +25 -0
  146. package/skills/eng-qa/references/15-arquitetura-qa.md +25 -0
  147. package/skills/eng-qa/references/2-estrategia-planejamento.md +25 -0
  148. package/skills/eng-qa/references/3-design-testes.md +25 -0
  149. package/skills/eng-qa/references/4-manual-exploratorio.md +24 -0
  150. package/skills/eng-qa/references/5-automacao-testes.md +25 -0
  151. package/skills/eng-qa/references/6-api-integracao.md +25 -0
  152. package/skills/eng-qa/references/7-contrato.md +24 -0
  153. package/skills/eng-qa/references/8-interface-compat-mobile.md +24 -0
  154. package/skills/eng-qa/references/9-performance.md +24 -0
  155. package/skills/eng-qa/references/especializacoes.md +29 -0
  156. package/skills/eng-qa-planner/SKILL.md +264 -0
  157. package/skills/jarvis-context-detect/SKILL.md +1 -1
  158. package/skills/jarvis-context-detect/assets/context-profile-template.md +1 -1
  159. package/skills/jarvis-create-specialization/SKILL.md +8 -0
  160. package/skills/jarvis-docs-central/README.md +31 -28
  161. package/skills/jarvis-docs-central/SKILL.md +5 -5
  162. package/skills/jarvis-init/SKILL.md +9 -8
  163. package/skills/jarvis-init/assets/passo-adicionar-stacks.md +47 -18
  164. package/skills/jarvis-list-specializations/SKILL.md +30 -17
  165. package/skills/jarvis-report-issue/SKILL.md +1 -1
  166. package/taxonomy.md +4 -16
  167. package/templates/AGENTS.md +2 -0
  168. package/templates/ENV-template.md +20 -2
  169. package/templates/engineering/advisor-template.md +65 -0
  170. package/templates/engineering/architecture-template.md +52 -4
  171. package/templates/engineering/qa/qa.sprint-plan-template.md +1 -1
  172. package/workflows/AGENTS.md +3 -1
  173. package/workflows/README.md +0 -10
  174. package/workflows/engineering/data/data.new-pipeline.md +6 -5
  175. package/workflows/engineering/eng.bug-audit.md +4 -14
  176. package/workflows/engineering/eng.debug.md +4 -20
  177. package/workflows/engineering/eng.plan.md +4 -26
  178. package/workflows/engineering/eng.pr.md +13 -63
  179. package/workflows/engineering/eng.pre-pr.md +14 -51
  180. package/workflows/engineering/eng.review.md +7 -13
  181. package/workflows/engineering/eng.rpa.robot.md +3 -9
  182. package/workflows/engineering/eng.start.md +37 -32
  183. package/workflows/engineering/eng.work.md +17 -40
  184. package/workflows/engineering/qa/eng.qa-sprint-planning.md +1 -1
  185. package/workflows/product/prod.spec.discovery.md +2 -2
  186. package/workflows/warm-up.md +35 -63
  187. package/agents/engineering/eng.cybersecurity.agent.md +0 -486
  188. package/agents/engineering/qa/eng.qa.cypress-specialist.md +0 -112
  189. package/bin/lib/docs/fetch-file.sh +0 -41
  190. package/bin/lib/docs/publish-file.sh +0 -284
  191. package/rules/engineering/qa/eng.qa.exploratory-session-rules.md +0 -137
  192. package/rules/engineering/qa/eng.qa.quality-gate-scoring-rules.md +0 -181
  193. package/rules/engineering/qa/eng.qa.tech-spec-validation-criteria-rules.md +0 -120
  194. package/skills/eng-ai-engineer/SKILL.md +0 -303
  195. package/skills/eng-data-bi/SKILL.md +0 -206
  196. package/skills/eng-data-debug/SKILL.md +0 -314
  197. package/skills/eng-data-engineer/SKILL.md +0 -266
  198. package/skills/eng-data-onboard/SKILL.md +0 -317
  199. package/skills/eng-data-orchestrator/SKILL.md +0 -433
  200. package/skills/eng-devops-performance-engineer/SKILL.md +0 -319
  201. package/skills/eng-frontend-design-system/SKILL.md +0 -155
  202. package/skills/eng-frontend-design-system/references/1-estrutura-pacote.md +0 -57
  203. package/skills/eng-frontend-design-system/references/2-tokens.md +0 -116
  204. package/skills/eng-frontend-design-system/references/3-componentes.md +0 -165
  205. package/skills/eng-frontend-design-system/references/4-storybook.md +0 -85
  206. package/skills/eng-frontend-design-system/references/5-auditoria-versionamento.md +0 -76
  207. package/skills/eng-frontend-microfrontend/SKILL.md +0 -164
  208. package/skills/eng-frontend-microfrontend/references/1-criando-remote.md +0 -109
  209. package/skills/eng-frontend-microfrontend/references/2-configurando-shell.md +0 -70
  210. package/skills/eng-frontend-microfrontend/references/3-contratos-interface.md +0 -73
  211. package/skills/eng-frontend-microfrontend/references/4-shared-dependencies.md +0 -48
  212. package/skills/eng-frontend-microfrontend/references/5-event-bus.md +0 -59
  213. package/skills/eng-frontend-microfrontend/references/6-monorepo-deploy.md +0 -77
  214. package/skills/eng-frontend-microfrontend/references/7-troubleshooting.md +0 -45
  215. package/skills/eng-global-browser-extension-builder/SKILL.md +0 -392
  216. package/skills/eng-global-jira-comment/SKILL.md +0 -27
  217. package/skills/eng-qa-a11y-audit/SKILL.md +0 -276
  218. package/skills/eng-qa-bug-report/SKILL.md +0 -877
  219. package/skills/eng-qa-bug-report/TASK_MANAGERS.md +0 -138
  220. package/skills/eng-qa-bug-report/references/1-integracao-task-managers.md +0 -148
  221. package/skills/eng-qa-bug-report/references/2-exemplos-de-uso.md +0 -46
  222. package/skills/eng-qa-bug-report/references/3-bug-to-test.md +0 -45
  223. package/skills/eng-qa-cypress-e2e/SKILL.md +0 -184
  224. package/skills/eng-qa-dev-guide/SKILL.md +0 -173
  225. package/skills/eng-qa-e2e/SKILL.md +0 -407
  226. package/skills/eng-qa-e2e-spec-writer/SKILL.md +0 -329
  227. package/skills/eng-qa-exploratory/SKILL.md +0 -196
  228. package/skills/eng-qa-gate/SKILL.md +0 -377
  229. package/skills/eng-qa-gate/assets/checklist-validacao.md +0 -291
  230. package/skills/eng-qa-graphql-contract/SKILL.md +0 -263
  231. package/skills/eng-qa-quality-report/SKILL.md +0 -419
  232. package/skills/eng-qa-test-plan/SKILL.md +0 -473
  233. package/skills/eng-qa-testsprite/SKILL.md +0 -332
  234. package/skills/eng-qa-testsprite/references/testsprite-mcp.md +0 -224
  235. package/skills/eng-qa-unit-test/SKILL.md +0 -478
  236. package/skills/eng-scraper/SKILL.md +0 -260
  237. package/skills/eng-scraper/references/1-puppeteer.md +0 -140
  238. package/skills/eng-scraper/references/2-playwright-cheerio-pdf.md +0 -82
  239. package/skills/eng-scraper/references/3-anti-bot.md +0 -94
  240. package/skills/eng-scraper/references/4-resiliencia-etl-monitoramento.md +0 -137
  241. package/skills/eng-scraper-robot-builder/SKILL.md +0 -377
  242. package/skills/eng-security-cybersecurity/SKILL.md +0 -250
  243. package/skills/eng-security-cybersecurity/references/1-owasp-top-10.md +0 -331
  244. package/skills/eng-security-cybersecurity/references/2-secrets-management.md +0 -31
  245. package/skills/eng-security-cybersecurity/references/3-input-validation.md +0 -43
  246. package/skills/eng-security-cybersecurity/references/4-compliance.md +0 -20
  247. package/skills/eng-security-patch/SKILL.md +0 -388
  248. package/skills/eng-security-threat-model/SKILL.md +0 -171
  249. package/skills/eng-security-triage/SKILL.md +0 -276
  250. package/templates/engineering/qa/eng.qa.quality-gate-examples-template.md +0 -311
  251. package/templates/engineering/qa/eng.qa.quality-gate-report-template.md +0 -249
  252. package/templates/engineering/qa/qa.cypress-test-template.md +0 -172
  253. package/templates/engineering/qa/qa.exploratory-session-template.md +0 -148
  254. package/templates/engineering/qa/qa.quality-report-template.md +0 -130
  255. package/workflows/engineering/eng.security-audit.md +0 -319
  256. package/workflows/engineering/eng.security-incident.md +0 -281
  257. package/workflows/engineering/eng.security-pipeline.md +0 -219
  258. package/workflows/engineering/eng.security-review.md +0 -241
  259. package/workflows/engineering/qa/eng.qa-dev-quality-guide.md +0 -57
  260. package/workflows/engineering/qa/eng.qa-e2e-test-generation.md +0 -57
  261. package/workflows/engineering/qa/eng.qa-exploratory-session.md +0 -68
  262. package/workflows/engineering/qa/eng.qa-quality-gate-validation.md +0 -209
  263. package/workflows/engineering/qa/eng.qa-quality-report.md +0 -85
  264. /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-coverage-template.md +0 -0
  265. /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-patterns.md +0 -0
  266. /package/templates/{CDD aplicado a Prompts.md → cdd-aplicado-a-prompts.md} +0 -0
@@ -1,319 +0,0 @@
1
- ---
2
- description: Workflow de Engenharia para Auditoria de Seguranca (OWASP, secrets, supply chain)
3
- globs:
4
- alwaysApply: false
5
- recommended_model: claude-opus-4-6-20250529
6
- model_tier: very_high
7
- model_justification: Auditoria de seguranca requer analise profunda de codigo, identificacao de padroes de vulnerabilidade, classificacao CVSS e geracao de relatorios estruturados
8
- ---
9
-
10
- # Workflow de Engenharia – Security Audit
11
-
12
- ## Objetivo
13
-
14
- Guiar o SENTINEL (ENG) na auditoria proativa de seguranca de projetos — analisando codigo, configs, dependencias e arquitetura contra OWASP Top 10, supply chain e boas praticas de seguranca. Gera relatorio com severidade CVSS e cards no `$TASK_MANAGER`.
15
-
16
- ---
17
-
18
- ## Quando Usar Este Workflow
19
-
20
- - Auditoria periodica de seguranca (por sprint ou release)
21
- - Onboarding em projeto sem historico de seguranca
22
- - Pre-lancamento de feature com superficie de ataque significativa
23
- - Pos-incidente para verificar outros vetores
24
- - Avaliacao de compliance (LGPD, GDPR, PCI-DSS)
25
-
26
- ---
27
-
28
- ## Pre-requisitos
29
-
30
- ### Validar ENV.md
31
-
32
- ```bash
33
- if [ ! -f "$IDE/ENV.md" ]; then
34
- echo "ENV.md nao encontrado. Execute /jarvis-init primeiro."
35
- exit 1
36
- fi
37
-
38
- required_vars=("WORKSPACE" "IDE" "SQUAD" "HUB" "AREA" "POSITION")
39
- for var in "${required_vars[@]}"; do
40
- if ! grep -q "^$var=.\+" "$IDE/ENV.md"; then
41
- echo "Variavel $var nao definida no ENV.md"
42
- fi
43
- done
44
- ```
45
-
46
- ### Definir Escopo (Argumento)
47
-
48
- ```
49
- /eng.security-audit [escopo]
50
-
51
- Onde [escopo] pode ser:
52
- - Caminho de pasta/arquivo: ./src/auth/
53
- - Modulo especifico: payment-service
54
- - Projeto completo: --all
55
- - Foco especifico: --focus=owasp|secrets|supply-chain|headers|compliance
56
- ```
57
-
58
- ### Skills invocados durante o workflow
59
-
60
- | Passo | Skill | Condição |
61
- |-------|-------|----------|
62
- | Fase 0 – Analise de Contexto (CDD) | `/jarvis-context-detect` | Se existir uma sessão ativa (e `ENABLE_CDD=true` no ENV.md) |
63
- | Fase 3 – Analysis (OWASP Top 10) | `/eng-security-cybersecurity` | Sempre — como referência de padrões para cada vetor relevante |
64
-
65
- ---
66
-
67
- ## Fase 0 – Analise de Contexto (CDD)
68
-
69
- > Skill: Use `/jarvis-context-detect` se existir uma sessao ativa
70
- > Configuravel: Controlada pela variavel `ENABLE_CDD` no ENV.md
71
-
72
- ```bash
73
- grep "^ENABLE_CDD=" $IDE/ENV.md
74
- ```
75
-
76
- - Se `ENABLE_CDD=false` ou nao definida: pular esta fase
77
- - Se `ENABLE_CDD=true`: herdar contexto
78
-
79
- ---
80
-
81
- ## Fase 0.5 — Threat Model Scoping
82
-
83
- Se `THREAT_MODEL.md` existe no projeto (gerado por `/eng-security-threat-model`):
84
-
85
- 1. Ler secao 3 "Entry points & trust boundaries" → usar como lista base de focus areas para fan-out
86
- 2. Ler secao 4 "Threats" → filtrar por `status != mitigated` → priorizar areas com ameacas `almost_certain` ou `likely`
87
- 3. Registrar `threat_model_ref` para incluir no `security-findings.json` de output
88
-
89
- Se nao existe: prosseguir para Fase 1 (recon manual de areas).
90
-
91
- > Threat model transforma o scan de "busca geral" em "busca guiada" — reduz ruido e aumenta recall nas areas criticas.
92
-
93
- ---
94
-
95
- ## Fase 1 – Scoping
96
-
97
- ### 1.1 Mapear superficie de ataque
98
-
99
- ```bash
100
- # Endpoints publicos (controllers, rotas)
101
- grep -rn --include="*.ts" --include="*.js" --include="*.py" \
102
- -E "@(Get|Post|Put|Patch|Delete|Controller|app\.(get|post|put|delete)|router\.(get|post))" \
103
- src/ 2>/dev/null | head -50
104
-
105
- # Arquivos de auth
106
- grep -rl --include="*.ts" --include="*.js" \
107
- -E "(auth|guard|middleware|session|jwt|passport|oauth)" \
108
- src/ 2>/dev/null
109
-
110
- # Configs de seguranca existentes
111
- find . -maxdepth 3 \( -name "helmet*" -o -name "cors*" -o -name "csp*" -o -name "*.security.*" \) 2>/dev/null
112
- ```
113
-
114
- ### 1.2 Priorizar areas
115
-
116
- | Prioridade | Area | Motivo |
117
- |------------|------|--------|
118
- | P0 | Auth, sessions, tokens | Bypass = acesso total |
119
- | P1 | Inputs (forms, APIs, uploads) | Injection, XSS |
120
- | P2 | Dados sensiveis (PII, financeiro) | Exposicao, compliance |
121
- | P3 | Dependencias e configs | Supply chain, misconfiguration |
122
- | P4 | Logs e monitoramento | Deteccao de ataques |
123
-
124
- ---
125
-
126
- ## Fase 2 – Reconnaissance
127
-
128
- ### 2.1 Mapear tecnologias e frameworks
129
-
130
- ```bash
131
- # Stack detection
132
- cat package.json 2>/dev/null | grep -E '"(nest|express|fastify|next|react|vue|prisma|typeorm|mongoose)"'
133
- cat requirements.txt 2>/dev/null | head -20
134
- cat go.mod 2>/dev/null | head -20
135
-
136
- # Verificar se ha ferramentas de seguranca ja instaladas
137
- cat package.json 2>/dev/null | grep -E '"(helmet|cors|csurf|express-rate-limit|bcrypt|argon2|zod|joi)"'
138
- ```
139
-
140
- ### 2.2 Mapear dados sensiveis
141
-
142
- ```bash
143
- # Modelos com campos sensiveis
144
- grep -rn --include="*.ts" --include="*.js" --include="*.py" \
145
- -E "(password|cpf|cnpj|credit_card|card_number|ssn|phone|birth_date|salary)" \
146
- src/ 2>/dev/null | head -30
147
-
148
- # Verificar .gitignore para .env
149
- grep -E "\.env" .gitignore 2>/dev/null
150
- ```
151
-
152
- ---
153
-
154
- ## Fase 3 – Analysis (OWASP Top 10)
155
-
156
- ### Fan-out por focus-area
157
-
158
- Quando o projeto tem >15 arquivos de codigo-fonte, spawnar **1 subagente Task por focus-area** (max 10 concorrentes).
159
- Em projetos pequenos (<15 arquivos): analise sequencial sem fan-out.
160
-
161
- Cada subagente recebe:
162
- - Focus area derivada da Fase 0.5 (threat model) ou Fase 1 (recon manual)
163
- - Trust boundary do `THREAT_MODEL.md` secao 3, ou `"untrusted input → processo"` como fallback
164
- - O brief OWASP abaixo como instrucao de analise
165
-
166
- **Subagentes rodam sem MCP** — apenas Read/Grep para o codigo-alvo. Veredicto mais deterministico e barato.
167
-
168
- Para cada vetor, verificar no codigo e classificar achados:
169
-
170
- ### A01 - Broken Access Control
171
- ```bash
172
- # Endpoints sem guard/middleware de auth
173
- grep -rn --include="*.ts" "@(Get|Post|Put|Delete)" src/ | grep -v -E "(Guard|Auth|Roles|Public)" | head -20
174
-
175
- # IDOR patterns
176
- grep -rn --include="*.ts" "req.params\.\(id\|userId\|orderId\)" src/ | head -20
177
- ```
178
-
179
- ### A03 - Injection
180
- ```bash
181
- # SQL injection patterns
182
- grep -rn --include="*.ts" --include="*.js" -E "(\$queryRaw[^U]|query\(.*\+|query\(.*\$\{|exec\(.*\+)" src/ 2>/dev/null
183
-
184
- # Command injection
185
- grep -rn --include="*.ts" --include="*.js" -E "(exec\(|execSync\(|spawn\()" src/ 2>/dev/null | head -20
186
- ```
187
-
188
- ### A05 - Security Misconfiguration
189
- ```bash
190
- # CORS config
191
- grep -rn --include="*.ts" --include="*.js" -E "(enableCors|cors\()" src/ 2>/dev/null
192
-
193
- # Debug/dev configs em producao
194
- grep -rn --include="*.ts" --include="*.js" -E "(debug:\s*true|DEBUG=true|stack.*trace)" src/ 2>/dev/null
195
- ```
196
-
197
- ### A06 - Vulnerable Components
198
- ```bash
199
- # Verificar vulnerabilidades
200
- npm audit --audit-level=moderate 2>/dev/null || echo "npm audit nao disponivel"
201
- ```
202
-
203
- > Repetir para cada vetor relevante usando o skill `eng-security-cybersecurity` como referencia.
204
-
205
- ---
206
-
207
- ## Fase 4 – Supply Chain
208
-
209
- ```bash
210
- # Verificar lockfile commitado
211
- git ls-files | grep -E "(package-lock|yarn.lock|pnpm-lock)" | head -5
212
-
213
- # Verificar se .npmrc esta seguro (sem tokens hardcoded)
214
- cat .npmrc 2>/dev/null | grep -v "^#" | grep -i "token\|auth" | head -5
215
-
216
- # Licencas problematicas
217
- npx license-checker --summary 2>/dev/null | head -20
218
- ```
219
-
220
- ---
221
-
222
- ## Fase 5 – Classification
223
-
224
- Classificar cada achado no formato:
225
-
226
- ```markdown
227
- ### [SEV] Titulo da vulnerabilidade
228
-
229
- - **Severidade**: CRITICAL | HIGH | MEDIUM | LOW | INFO
230
- - **CVSS estimado**: X.X
231
- - **Vetor OWASP**: A01-A10
232
- - **Arquivo(s)**: `path/to/file.ts:line`
233
- - **Evidencia**: {codigo ou config vulneravel}
234
- - **Vetor de ataque**: {como um atacante exploraria}
235
- - **Impacto**: {o que acontece se explorado}
236
- - **Correcao**: {codigo ou config corrigido}
237
- - **Status**: aberto | corrigido | mitigado
238
- ```
239
-
240
- ---
241
-
242
- ## Fase 6 – Reporting
243
-
244
- ### 6.1 Gerar relatorio
245
-
246
- Criar arquivo `security-audit-report.md` na sessao:
247
-
248
- ```markdown
249
- # Security Audit Report
250
-
251
- **Workspace**: $WORKSPACE
252
- **Squad**: $SQUAD
253
- **Data**: {data ISO-8601}
254
- **Auditor**: SENTINEL (AI-assisted)
255
- **Escopo**: {escopo auditado}
256
-
257
- ## Resumo Executivo
258
-
259
- | Severidade | Quantidade |
260
- |------------|-----------|
261
- | CRITICAL | {n} |
262
- | HIGH | {n} |
263
- | MEDIUM | {n} |
264
- | LOW | {n} |
265
- | INFO | {n} |
266
-
267
- ## Achados
268
-
269
- {lista de achados classificados, do mais critico ao menos}
270
-
271
- ## Recomendacoes Prioritarias
272
-
273
- 1. {correcao mais urgente}
274
- 2. {segunda mais urgente}
275
- ...
276
-
277
- ## Proximos Passos
278
-
279
- - [ ] Corrigir achados CRITICAL/HIGH
280
- - [ ] Agendar correcao de MEDIUM para proxima sprint
281
- - [ ] Documentar LOW/INFO como debt de seguranca
282
- ```
283
-
284
- ### 6.2 Criar cards no $TASK_MANAGER
285
-
286
- Para achados CRITICAL e HIGH, criar cards com:
287
- - Titulo: `[SECURITY] {titulo da vulnerabilidade}`
288
- - Label: `security`, `{severidade}`
289
- - Descricao: evidencia + correcao sugerida
290
- - Prioridade: maxima para CRITICAL, alta para HIGH
291
-
292
- ---
293
-
294
- ## Fase 6.3 — Output JSON (security-findings.json)
295
-
296
- Alem do relatorio markdown, escrever `.security/outputs/security-findings.json` conforme `docs/SECURITY-ARTIFACTS-SCHEMA.md` secao 2. Criar `.security/outputs/` se nao existir.
297
-
298
- Um arquivo por focus-area durante o fan-out (prefixar IDs: `AUTH-F001`, `DEPS-F002`).
299
- Consolidar em arquivo unico ao final em `.security/outputs/security-findings.json`, reordenando por (impact, likelihood) decrescente.
300
-
301
- Este arquivo e o input direto do skill `eng-security-triage`.
302
-
303
- ---
304
-
305
- ## Regras
306
-
307
- ### Nunca
308
- - Ignorar um achado porque "provavelmente nao sera explorado"
309
- - Executar exploits reais contra o sistema em producao
310
- - Expor secrets encontrados no relatorio (mascarar com `***`)
311
- - Minimizar severidade sem justificativa tecnica
312
- - Pular a classificacao CVSS
313
-
314
- ### Sempre
315
- - Usar o skill `eng-security-cybersecurity` como referencia de padroes
316
- - Classificar TODOS os achados por severidade
317
- - Incluir evidencia (codigo) e correcao para cada achado
318
- - Mascarar secrets encontrados antes de reportar
319
- - Comunicar achados CRITICAL imediatamente ao usuario (nao esperar o relatorio final)
@@ -1,281 +0,0 @@
1
- ---
2
- description: Workflow de Engenharia para Resposta a Incidentes de Seguranca (CVEs, vulnerabilidades, breaches)
3
- globs:
4
- alwaysApply: false
5
- recommended_model: claude-opus-4-6-20250529
6
- model_tier: very_high
7
- model_justification: Incident response requer analise rapida e precisa de vulnerabilidades, avaliacao de impacto e decisoes de contencao que afetam producao
8
- ---
9
-
10
- # Workflow de Engenharia – Security Incident Response
11
-
12
- ## Objetivo
13
-
14
- Guiar o SENTINEL (ENG) na resposta estruturada a incidentes de seguranca — desde CVEs criticas ate vulnerabilidades reportadas e breaches. Prioriza contencao rapida seguida de correcao definitiva e documentacao preventiva.
15
-
16
- ---
17
-
18
- ## Quando Usar Este Workflow
19
-
20
- - CVE critica publicada que pode afetar dependencias do projeto
21
- - Vulnerabilidade reportada por ferramenta de scan (SAST/DAST)
22
- - Secret vazado no repositorio ou em producao
23
- - Incidente de seguranca reportado (acesso indevido, dados expostos)
24
- - Alerta de dependencia comprometida (supply chain attack)
25
-
26
- ---
27
-
28
- ## Pre-requisitos
29
-
30
- ### Validar ENV.md
31
-
32
- ```bash
33
- if [ ! -f "$IDE/ENV.md" ]; then
34
- echo "ENV.md nao encontrado. Execute /jarvis-init primeiro."
35
- exit 1
36
- fi
37
- ```
38
-
39
- ### Entrada do Incidente
40
-
41
- ```
42
- /eng.security-incident [referencia]
43
-
44
- Onde [referencia] pode ser:
45
- - CVE ID: CVE-2024-XXXXX
46
- - URL do advisory: https://github.com/advisories/GHSA-xxxx
47
- - Descricao: "SQL injection no endpoint /api/users"
48
- - Card do $TASK_MANAGER: TASK-1234
49
- ```
50
-
51
- ### Skills invocados durante o workflow
52
-
53
- | Passo | Skill | Condição |
54
- |-------|-------|----------|
55
- | Fase 4 – Remediation › 4.1 Implementar correcao | `/eng-security-cybersecurity` | Sempre — como referência de padrões seguros ao implementar a correção |
56
-
57
- ---
58
-
59
- ## Fase 1 – Triage
60
-
61
- **Objetivo**: classificar rapidamente a severidade e impacto.
62
-
63
- ### 1.1 Coletar informacoes
64
-
65
- ```markdown
66
- ## Triage
67
-
68
- **Referencia**: {CVE, advisory URL ou descricao}
69
- **Reportado por**: {ferramenta, pesquisador, equipe interna}
70
- **Data do report**: {ISO-8601}
71
- **Tipo**: {CVE em dependencia | vulnerabilidade no codigo | secret leak | breach | outro}
72
- ```
73
-
74
- ### 1.2 Classificar severidade
75
-
76
- | Criterio | CRITICAL | HIGH | MEDIUM | LOW |
77
- |----------|----------|------|--------|-----|
78
- | Explorabilidade | Remota, sem auth | Remota, com auth | Local ou com privilegio | Teorica |
79
- | Impacto | RCE, data breach, auth bypass | Escalacao de privilegio, data leak parcial | DoS, info disclosure limitada | Baixo impacto |
80
- | Dados afetados | PII, financeiro, credenciais | Dados internos sensiveis | Dados nao-sensiveis | Nenhum |
81
- | Superficie | Endpoint publico | Endpoint autenticado | Funcao interna | Codigo morto |
82
-
83
- ### 1.3 Decisao de urgencia
84
-
85
- | Severidade | SLA de resposta | Acao imediata |
86
- |------------|-----------------|---------------|
87
- | **CRITICAL** | Conter em 1h, corrigir em 24h | Notificar TL/CTO, iniciar contencao |
88
- | **HIGH** | Corrigir em 48h | Notificar TL, planejar correcao |
89
- | **MEDIUM** | Corrigir na proxima sprint | Criar card, documentar |
90
- | **LOW** | Backlog | Documentar, corrigir quando conveniente |
91
-
92
- ---
93
-
94
- ## Fase 2 – Assessment
95
-
96
- **Objetivo**: determinar se e como o projeto e afetado.
97
-
98
- ### 2.1 Para CVEs em dependencias
99
-
100
- ```bash
101
- # Verificar se a dependencia vulneravel esta instalada
102
- grep "{pacote}" package.json package-lock.json 2>/dev/null
103
- # ou
104
- pip show {pacote} 2>/dev/null
105
-
106
- # Verificar versao instalada vs. versao afetada
107
- npm ls {pacote} 2>/dev/null
108
-
109
- # Verificar se o codigo usa a funcao/modulo vulneravel
110
- grep -rn --include="*.ts" --include="*.js" "{funcao_ou_import_afetado}" src/ 2>/dev/null
111
- ```
112
-
113
- ### 2.2 Para vulnerabilidades no codigo
114
-
115
- ```bash
116
- # Localizar o codigo vulneravel
117
- grep -rn --include="*.ts" --include="*.js" --include="*.py" "{pattern}" src/ 2>/dev/null
118
-
119
- # Verificar se o endpoint e acessivel publicamente
120
- # Verificar se ha guards/middleware protegendo
121
- # Verificar se inputs sao validados antes de chegar ao ponto vulneravel
122
- ```
123
-
124
- ### 2.3 Para secrets vazados
125
-
126
- ```bash
127
- # Verificar se o secret ainda esta ativo
128
- # Verificar onde o secret e usado
129
- grep -rn "{secret_parcial}" . --include="*.ts" --include="*.js" --include="*.env" --include="*.yml" 2>/dev/null
130
-
131
- # Verificar historico git
132
- git log --all --oneline -S "{secret_parcial}" 2>/dev/null | head -10
133
- ```
134
-
135
- ### 2.4 Documentar assessment
136
-
137
- ```markdown
138
- ## Assessment
139
-
140
- **Projeto afetado**: sim | nao | parcialmente
141
- **Versao afetada**: {versao da dependencia ou do codigo}
142
- **Superficie de ataque**: {endpoints, funcoes, configs afetadas}
143
- **Dados em risco**: {tipo de dados que podem ser comprometidos}
144
- **Exploracao confirmada**: sim | nao | nao verificavel
145
- ```
146
-
147
- ---
148
-
149
- ## Fase 3 – Containment
150
-
151
- **Objetivo**: limitar o impacto imediato enquanto a correcao definitiva e preparada.
152
-
153
- ### Acoes de contencao por tipo
154
-
155
- | Tipo | Acao de contencao |
156
- |------|-------------------|
157
- | Endpoint vulneravel | Desabilitar endpoint ou adicionar guard temporario |
158
- | Secret vazado | Revogar/rotacionar o secret IMEDIATAMENTE |
159
- | Dependencia com CVE | Avaliar se patch esta disponivel, aplicar se possivel |
160
- | Auth bypass | Adicionar validacao extra, revogar sessions ativas se necessario |
161
- | Data exposure | Verificar logs de acesso, avaliar notificacao (LGPD 72h) |
162
-
163
- ### Documentar contencao
164
-
165
- ```markdown
166
- ## Containment
167
-
168
- **Acao tomada**: {descricao da contencao}
169
- **Timestamp**: {ISO-8601}
170
- **Reversivel**: sim | nao
171
- **Impacto da contencao**: {funcionalidades temporariamente afetadas}
172
- ```
173
-
174
- > **IMPORTANTE**: Contencao e temporaria. Sempre seguir com correcao definitiva.
175
-
176
- ---
177
-
178
- ## Fase 4 – Remediation
179
-
180
- **Objetivo**: implementar correcao definitiva e validar.
181
-
182
- ### 4.1 Implementar correcao
183
-
184
- - Usar o skill `eng-security-cybersecurity` como referencia de padroes seguros
185
- - Corrigir a causa raiz (nao apenas o sintoma)
186
- - Adicionar validacao/sanitizacao onde necessario
187
- - Atualizar dependencias afetadas
188
-
189
- ### 4.2 Validar correcao
190
-
191
- ```bash
192
- # Rodar testes existentes
193
- npm test 2>/dev/null
194
-
195
- # Verificar que a vulnerabilidade foi corrigida
196
- # (reproduzir o vetor de ataque e confirmar que falha)
197
-
198
- # Rodar npm audit novamente (se CVE em dep)
199
- npm audit 2>/dev/null
200
- ```
201
-
202
- ### 4.3 Documentar correcao
203
-
204
- ```markdown
205
- ## Remediation
206
-
207
- **Correcao aplicada**: {descricao tecnica}
208
- **Arquivos alterados**: {lista}
209
- **Testes adicionados**: {sim/nao — quais}
210
- **Dependencias atualizadas**: {pacote@versao_antiga → pacote@versao_nova}
211
- ```
212
-
213
- ---
214
-
215
- ## Fase 5 – Post-mortem
216
-
217
- **Objetivo**: documentar o incidente para aprendizado e prevencao.
218
-
219
- ### Template de post-mortem
220
-
221
- ```markdown
222
- # Security Post-mortem
223
-
224
- **Incidente**: {titulo}
225
- **Severidade**: {CRITICAL|HIGH|MEDIUM|LOW}
226
- **Data de deteccao**: {ISO-8601}
227
- **Data de resolucao**: {ISO-8601}
228
- **Tempo de resolucao**: {duracao}
229
-
230
- ## Timeline
231
-
232
- | Timestamp | Evento |
233
- |-----------|--------|
234
- | {t0} | Vulnerabilidade reportada/detectada |
235
- | {t1} | Triage concluida — severidade {X} |
236
- | {t2} | Contencao aplicada |
237
- | {t3} | Correcao implementada e testada |
238
- | {t4} | Deploy da correcao |
239
-
240
- ## Causa Raiz
241
-
242
- {O que causou a vulnerabilidade? Quando foi introduzida?}
243
-
244
- ## Impacto
245
-
246
- {Dados afetados, usuarios impactados, janela de exposicao}
247
-
248
- ## Correcao
249
-
250
- {O que foi feito para resolver}
251
-
252
- ## Prevencao
253
-
254
- {O que sera feito para evitar recorrencia}
255
-
256
- - [ ] {acao preventiva 1}
257
- - [ ] {acao preventiva 2}
258
- - [ ] {acao preventiva 3}
259
-
260
- ## Licoes Aprendidas
261
-
262
- {O que o time aprendeu com este incidente}
263
- ```
264
-
265
- ---
266
-
267
- ## Regras
268
-
269
- ### Nunca
270
- - Minimizar um incidente de seguranca ("provavelmente ninguem explorou")
271
- - Deixar um secret vazado ativo enquanto investiga — revogar PRIMEIRO
272
- - Aplicar correcao sem testes de validacao
273
- - Pular o post-mortem ("ja foi resolvido, vamos seguir")
274
- - Expor detalhes do incidente em canais publicos antes da correcao
275
-
276
- ### Sempre
277
- - Comunicar achados CRITICAL ao TL/responsavel imediatamente
278
- - Revogar secrets vazados antes de qualquer outra acao
279
- - Documentar timeline completa do incidente
280
- - Verificar se a vulnerabilidade afeta outros servicos do projeto
281
- - Propor melhorias preventivas no post-mortem