jarvis-ai-framework 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +22 -122
- package/agents/AGENTS.md +20 -24
- package/agents/README.md +25 -129
- package/agents/engineering/data/eng.data-engineer.agent.md +12 -35
- package/agents/engineering/eng.agent.md +18 -30
- package/agents/engineering/eng.bug-hunter.md +9 -12
- package/agents/engineering/eng.dev-code-reviewer.md +5 -1
- package/agents/engineering/eng.docs-writer.md +3 -3
- package/agents/engineering/eng.frontend.agent.md +13 -8
- package/agents/engineering/eng.rpa.agent.md +5 -13
- package/agents/engineering/eng.ux-designer.agent.md +4 -0
- package/agents/engineering/qa/eng.qa.quality-champion-task-agent.md +4 -0
- package/agents/engineering/qa/eng.qa.quality-strategist.md +13 -8
- package/agents/engineering/qa/eng.qa.test-architect.md +16 -15
- package/agents/engineering/qa/eng.qa.test-planner.md +22 -17
- package/agents/engineering/qa/eng.qa.testing-engineer.md +99 -15
- package/agents/product/prod.discovery-interviewer.md +22 -3
- package/agents/product/prod.pm-checker.md +4 -0
- package/bin/README.md +142 -0
- package/bin/commands/docs-publish.js +105 -141
- package/bin/commands/docs-sync.js +66 -104
- package/bin/commands/info.js +7 -27
- package/bin/commands/init.js +23 -51
- package/bin/commands/install-rtk.js +9 -3
- package/bin/commands/list.js +5 -18
- package/bin/commands/map.js +58 -0
- package/bin/commands/qa-signoff.js +58 -55
- package/bin/commands/tokens.js +90 -0
- package/bin/commands/whoami.js +30 -26
- package/bin/jarvis.js +9 -153
- package/bin/lib/auth/session.js +20 -20
- package/bin/lib/cli/program.js +219 -0
- package/bin/lib/cli/shared-options.js +29 -0
- package/bin/lib/config/constants.js +70 -2
- package/bin/lib/config/ide-config.js +4 -8
- package/bin/lib/core/profile-filter.js +116 -0
- package/bin/lib/core/scanner.js +5 -31
- package/bin/lib/core/sync-engine.js +21 -14
- package/bin/lib/core/token-report.js +100 -0
- package/bin/lib/docs/fetch-file.js +39 -0
- package/bin/lib/docs/publish-file.js +194 -0
- package/bin/lib/docs/redis-cache.js +49 -0
- package/bin/lib/docs/validate-frontmatter.js +9 -39
- package/bin/lib/env-loader.js +11 -34
- package/bin/lib/flow-map/index.js +65 -0
- package/bin/lib/flow-map/parse.js +223 -0
- package/bin/lib/flow-map/render.js +89 -0
- package/bin/lib/flow-map/tree.js +248 -0
- package/bin/lib/tasks/comment.js +40 -35
- package/bin/lib/utils/frontmatter.js +57 -0
- package/bin/lib/utils/git-parser.js +4 -6
- package/bin/lib/utils/npmrc-parser.js +6 -13
- package/bin/lib/utils/paths.js +2 -4
- package/bin/lib/utils/ui.js +3 -9
- package/bin/lib/vcs/api.js +25 -41
- package/bin/lib/vcs/create-issue.js +49 -33
- package/bin/lib/vcs/create-merge.js +47 -31
- package/bin/lib/vcs/fetch-raw.js +35 -23
- package/members.md +1 -1
- package/package.json +15 -4
- package/rules/AGENTS.md +18 -7
- package/rules/engineering/eng-rules.md +3 -13
- package/rules/engineering/eng-security-rules.md +19 -18
- package/rules/engineering/eng.bump-rules.md +3 -2
- package/rules/engineering/eng.docs-scraping-rules.md +4 -4
- package/rules/engineering/eng.integrations-rules.md +3 -7
- package/rules/engineering/eng.skills-rules.md +1 -5
- package/rules/engineering/eng.specializations-rules.md +18 -8
- package/rules/engineering/frontend/eng.frontend-rules.md +1 -4
- package/rules/engineering/qa/eng.qa.cypress-standards-rules.md +1 -1
- package/rules/engineering/rpa/eng.rpa-rules.md +4 -9
- package/rules/product/README.md +1 -0
- package/rules/product/prod-rules.md +1 -4
- package/rules/product/prod.spec-rules.md +0 -4
- package/rules/rtk-rules.md +0 -1
- package/{rules → rules-on-demand}/engineering/eng.breakdown-subtasks-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.plan-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.pr-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.pre-pr-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.start-rules.md +0 -4
- package/{rules → rules-on-demand}/engineering/eng.tech-spec-rules.md +1 -2
- package/{rules → rules-on-demand}/engineering/eng.work-rules.md +0 -4
- package/skills/AGENTS.md +69 -106
- package/skills/SKILLS-ROADMAP.md +47 -132
- package/skills/eng-ai/SKILL.md +270 -0
- package/skills/eng-ai/references/1-fundamentos-ml.md +24 -0
- package/skills/eng-ai/references/10-arquitetura-solucoes-ia.md +24 -0
- package/skills/eng-ai/references/11-governanca-ia.md +24 -0
- package/skills/eng-ai/references/12-seguranca-ia-responsavel.md +25 -0
- package/skills/eng-ai/references/2-matematica-estatistica.md +24 -0
- package/skills/eng-ai/references/3-dados-para-ia.md +24 -0
- package/skills/eng-ai/references/4-deep-learning-fundacionais.md +24 -0
- package/skills/eng-ai/references/5-llms-chatbots-agentes-rag.md +25 -0
- package/skills/eng-ai/references/6-avaliacao-experimentacao.md +24 -0
- package/skills/eng-ai/references/7-engenharia-sistemas-ia.md +24 -0
- package/skills/eng-ai/references/8-mlops-plataforma.md +24 -0
- package/skills/eng-ai/references/9-produto-ia.md +24 -0
- package/skills/eng-ai/references/especializacoes.md +17 -0
- package/skills/eng-automation/SKILL.md +290 -0
- package/skills/eng-automation/references/1-fundamentos-automacao.md +25 -0
- package/skills/eng-automation/references/10-ingestao-dados.md +25 -0
- package/skills/eng-automation/references/11-captcha-antibot.md +25 -0
- package/skills/eng-automation/references/12-limites-taxa-sessoes.md +25 -0
- package/skills/eng-automation/references/13-agendamento-orquestracao.md +24 -0
- package/skills/eng-automation/references/14-retentativa-erros.md +25 -0
- package/skills/eng-automation/references/15-autenticacao-credenciais.md +24 -0
- package/skills/eng-automation/references/16-observabilidade-confiabilidade.md +24 -0
- package/skills/eng-automation/references/2-aquisicao-dados.md +25 -0
- package/skills/eng-automation/references/3-automacao-navegador.md +24 -0
- package/skills/eng-automation/references/4-scraping-crawling.md +25 -0
- package/skills/eng-automation/references/5-apis-rest-graphql-soap.md +26 -0
- package/skills/eng-automation/references/6-webhooks-integracao.md +25 -0
- package/skills/eng-automation/references/7-rpa.md +25 -0
- package/skills/eng-automation/references/8-extracao-estruturada.md +25 -0
- package/skills/eng-automation/references/9-extracao-documentos.md +25 -0
- package/skills/eng-automation/references/especializacoes.md +18 -0
- package/skills/eng-backend/SKILL.md +6 -0
- package/skills/eng-backend-arch-c4/SKILL.md +10 -4
- package/skills/eng-backend-microservices-trace/SKILL.md +6 -0
- package/skills/eng-backend-nestjs/SKILL.md +17 -462
- package/skills/eng-backend-nestjs/references/1-arquitetura-modulos.md +54 -0
- package/skills/eng-backend-nestjs/references/2-guards-autenticacao.md +118 -0
- package/skills/eng-backend-nestjs/references/3-interceptors-pipes-filters.md +113 -0
- package/skills/eng-backend-nestjs/references/4-config-logging.md +61 -0
- package/skills/eng-backend-nestjs/references/5-testes.md +83 -0
- package/skills/eng-backend-nestjs/references/6-problemas-comuns.md +53 -0
- package/skills/eng-backend-rabbitmq/SKILL.md +15 -298
- package/skills/eng-backend-rabbitmq/references/1-referencia-endpoints.md +28 -0
- package/skills/eng-backend-rabbitmq/references/2-codigo-consumer-producer.md +90 -0
- package/skills/eng-backend-rabbitmq/references/3-arquiteturas-comuns.md +101 -0
- package/skills/eng-backend-rabbitmq/references/4-troubleshooting.md +93 -0
- package/skills/eng-data/SKILL.md +271 -0
- package/skills/eng-data/references/1-fundamentos-dados.md +24 -0
- package/skills/eng-data/references/10-ciencia-dados.md +24 -0
- package/skills/eng-data/references/11-dataops-plataforma.md +24 -0
- package/skills/eng-data/references/12-seguranca-privacidade.md +24 -0
- package/skills/eng-data/references/2-modelagem-dados.md +24 -0
- package/skills/eng-data/references/3-bancos-dados.md +24 -0
- package/skills/eng-data/references/4-arquitetura-dados.md +24 -0
- package/skills/eng-data/references/5-pipelines-integracao.md +24 -0
- package/skills/eng-data/references/6-qualidade-dados.md +24 -0
- package/skills/eng-data/references/7-governanca-metadados.md +24 -0
- package/skills/eng-data/references/8-estatistica-analise.md +24 -0
- package/skills/eng-data/references/9-analytics-bi.md +24 -0
- package/skills/eng-data/references/especializacoes.md +20 -0
- package/skills/eng-frontend/SKILL.md +18 -5
- package/skills/eng-frontend/references/13-design-system.md +48 -0
- package/skills/eng-frontend/references/14-microfrontend.md +46 -0
- package/skills/eng-global-docs-write/SKILL.md +10 -5
- package/skills/eng-global-pr/SKILL.md +7 -1
- package/skills/eng-global-task-comment/SKILL.md +8 -2
- package/skills/eng-platform/SKILL.md +331 -0
- package/skills/eng-platform/references/1-fundamentos-sistemas.md +23 -0
- package/skills/eng-platform/references/10-resiliencia-arquitetura.md +24 -0
- package/skills/eng-platform/references/11-plataforma-devex.md +24 -0
- package/skills/eng-platform/references/12-finops-custos.md +24 -0
- package/skills/eng-platform/references/13-seguranca-fundamentos.md +26 -0
- package/skills/eng-platform/references/14-profiling-performance.md +23 -0
- package/skills/eng-platform/references/15-testes-carga-chaos.md +23 -0
- package/skills/eng-platform/references/16-cache-multicamada.md +22 -0
- package/skills/eng-platform/references/2-redes.md +23 -0
- package/skills/eng-platform/references/3-cloud.md +24 -0
- package/skills/eng-platform/references/4-iac-automacao.md +24 -0
- package/skills/eng-platform/references/5-containers-orquestracao.md +25 -0
- package/skills/eng-platform/references/6-cicd-entrega.md +24 -0
- package/skills/eng-platform/references/7-observabilidade.md +24 -0
- package/skills/eng-platform/references/8-confiabilidade-sre.md +24 -0
- package/skills/eng-platform/references/9-seguranca-infra.md +26 -0
- package/skills/eng-platform/references/especializacoes.md +34 -0
- package/skills/eng-qa/SKILL.md +283 -0
- package/skills/eng-qa/references/1-fundamentos-qualidade.md +25 -0
- package/skills/eng-qa/references/10-confiabilidade.md +25 -0
- package/skills/eng-qa/references/11-seguranca.md +24 -0
- package/skills/eng-qa/references/12-acessibilidade.md +24 -0
- package/skills/eng-qa/references/13-dados-testes.md +24 -0
- package/skills/eng-qa/references/14-gestao-testes-defeitos.md +25 -0
- package/skills/eng-qa/references/15-arquitetura-qa.md +25 -0
- package/skills/eng-qa/references/2-estrategia-planejamento.md +25 -0
- package/skills/eng-qa/references/3-design-testes.md +25 -0
- package/skills/eng-qa/references/4-manual-exploratorio.md +24 -0
- package/skills/eng-qa/references/5-automacao-testes.md +25 -0
- package/skills/eng-qa/references/6-api-integracao.md +25 -0
- package/skills/eng-qa/references/7-contrato.md +24 -0
- package/skills/eng-qa/references/8-interface-compat-mobile.md +24 -0
- package/skills/eng-qa/references/9-performance.md +24 -0
- package/skills/eng-qa/references/especializacoes.md +29 -0
- package/skills/eng-qa-planner/SKILL.md +264 -0
- package/skills/jarvis-context-detect/SKILL.md +7 -1
- package/skills/jarvis-context-detect/assets/context-profile-template.md +1 -1
- package/skills/jarvis-create-specialization/SKILL.md +14 -0
- package/skills/jarvis-docs-central/README.md +31 -28
- package/skills/jarvis-docs-central/SKILL.md +11 -5
- package/skills/jarvis-docs-index/SKILL.md +10 -2
- package/skills/jarvis-evolution-architect/SKILL.md +6 -0
- package/skills/jarvis-init/SKILL.md +22 -15
- package/skills/jarvis-init/assets/passo-adicionar-stacks.md +47 -18
- package/skills/jarvis-list-specializations/SKILL.md +36 -17
- package/skills/jarvis-report-issue/SKILL.md +7 -1
- package/skills/product-roadmap-report/SKILL.md +8 -0
- package/skills/product-specs/SKILL.md +9 -0
- package/skills/product-specs-update/SKILL.md +6 -0
- package/taxonomy.md +16 -28
- package/templates/AGENTS.md +2 -0
- package/templates/ENV-template.md +10 -2
- package/templates/engineering/qa/qa.sprint-plan-template.md +1 -1
- package/templates/engineering/tech-spec-delivery-template.md +179 -0
- package/workflows/AGENTS.md +14 -2
- package/workflows/README.md +8 -16
- package/workflows/all-tools.md +7 -1
- package/workflows/engineering/data/data.contract.md +8 -0
- package/workflows/engineering/data/data.new-pipeline.md +15 -4
- package/workflows/engineering/eng.breakdown-subtasks.md +9 -0
- package/workflows/engineering/eng.bug-audit.md +10 -13
- package/workflows/engineering/eng.build-tech-spec.md +17 -146
- package/workflows/engineering/eng.create-ard-from-code.md +8 -0
- package/workflows/engineering/eng.create-ard.md +8 -0
- package/workflows/engineering/eng.create-rfc.md +7 -0
- package/workflows/engineering/eng.debug.md +5 -21
- package/workflows/engineering/eng.docs.md +9 -0
- package/workflows/engineering/eng.light-arch.md +7 -0
- package/workflows/engineering/eng.plan.md +15 -2
- package/workflows/engineering/eng.pr.md +24 -30
- package/workflows/engineering/eng.pre-pr.md +33 -15
- package/workflows/engineering/eng.review.md +18 -11
- package/workflows/engineering/eng.rpa.robot.md +17 -7
- package/workflows/engineering/eng.start.md +33 -12
- package/workflows/engineering/eng.work.md +25 -17
- package/workflows/engineering/frontend/eng.frontend-component.md +7 -0
- package/workflows/engineering/frontend/eng.frontend-perf-audit.md +8 -0
- package/workflows/engineering/frontend/eng.frontend-review.md +8 -0
- package/workflows/engineering/qa/eng.qa-refinement-entry.md +7 -0
- package/workflows/engineering/qa/eng.qa-release-signoff.md +6 -0
- package/workflows/engineering/qa/eng.qa-sprint-planning.md +7 -1
- package/workflows/product/prod.roadmap.preview.md +9 -0
- package/workflows/product/prod.spec.ard.md +97 -0
- package/workflows/product/prod.spec.breakdown.md +10 -0
- package/workflows/product/prod.spec.clarify.md +8 -2
- package/workflows/product/prod.spec.discovery.md +11 -1
- package/workflows/product/prod.spec.epic.md +8 -0
- package/workflows/product/prod.spec.frd.md +7 -0
- package/workflows/product/prod.spec.issue.md +6 -0
- package/workflows/product/prod.spec.md +15 -1
- package/workflows/product/prod.spec.prd.md +7 -0
- package/workflows/taxonomy.md +58 -6
- package/workflows/warm-up.md +47 -60
- package/agents/engineering/eng.cybersecurity.agent.md +0 -488
- package/agents/engineering/qa/eng.qa.cypress-specialist.md +0 -109
- package/bin/lib/docs/fetch-file.sh +0 -41
- package/bin/lib/docs/publish-file.sh +0 -284
- package/rules/engineering/eng.downstream-flow-rules.md +0 -297
- package/rules/engineering/qa/eng.qa.exploratory-session-rules.md +0 -137
- package/rules/engineering/qa/eng.qa.quality-gate-scoring-rules.md +0 -181
- package/rules/engineering/qa/eng.qa.tech-spec-validation-criteria-rules.md +0 -120
- package/skills/eng-ai-engineer/SKILL.md +0 -297
- package/skills/eng-data-bi/SKILL.md +0 -200
- package/skills/eng-data-debug/SKILL.md +0 -308
- package/skills/eng-data-engineer/SKILL.md +0 -257
- package/skills/eng-data-onboard/SKILL.md +0 -311
- package/skills/eng-data-orchestrator/SKILL.md +0 -427
- package/skills/eng-devops-performance-engineer/SKILL.md +0 -313
- package/skills/eng-frontend-design-system/SKILL.md +0 -621
- package/skills/eng-frontend-microfrontend/SKILL.md +0 -604
- package/skills/eng-global-browser-extension-builder/SKILL.md +0 -386
- package/skills/eng-global-jira-comment/SKILL.md +0 -21
- package/skills/eng-qa-a11y-audit/SKILL.md +0 -270
- package/skills/eng-qa-bug-report/SKILL.md +0 -1089
- package/skills/eng-qa-bug-report/TASK_MANAGERS.md +0 -138
- package/skills/eng-qa-cypress-e2e/SKILL.md +0 -178
- package/skills/eng-qa-dev-guide/SKILL.md +0 -165
- package/skills/eng-qa-e2e/SKILL.md +0 -401
- package/skills/eng-qa-e2e-spec-writer/SKILL.md +0 -323
- package/skills/eng-qa-exploratory/SKILL.md +0 -189
- package/skills/eng-qa-gate/SKILL.md +0 -371
- package/skills/eng-qa-gate/assets/checklist-validacao.md +0 -291
- package/skills/eng-qa-graphql-contract/SKILL.md +0 -257
- package/skills/eng-qa-quality-report/SKILL.md +0 -413
- package/skills/eng-qa-test-plan/SKILL.md +0 -467
- package/skills/eng-qa-testsprite/SKILL.md +0 -326
- package/skills/eng-qa-testsprite/references/testsprite-mcp.md +0 -224
- package/skills/eng-qa-unit-test/SKILL.md +0 -472
- package/skills/eng-scraper/SKILL.md +0 -684
- package/skills/eng-scraper-robot-builder/SKILL.md +0 -371
- package/skills/eng-security-cybersecurity/SKILL.md +0 -646
- package/skills/eng-security-patch/SKILL.md +0 -382
- package/skills/eng-security-threat-model/SKILL.md +0 -165
- package/skills/eng-security-triage/SKILL.md +0 -270
- package/templates/engineering/qa/eng.qa.quality-gate-examples-template.md +0 -311
- package/templates/engineering/qa/eng.qa.quality-gate-report-template.md +0 -249
- package/templates/engineering/qa/qa.cypress-test-template.md +0 -172
- package/templates/engineering/qa/qa.exploratory-session-template.md +0 -148
- package/templates/engineering/qa/qa.quality-report-template.md +0 -130
- package/workflows/engineering/eng.security-audit.md +0 -312
- package/workflows/engineering/eng.security-incident.md +0 -275
- package/workflows/engineering/eng.security-pipeline.md +0 -210
- package/workflows/engineering/eng.security-review.md +0 -235
- package/workflows/engineering/qa/eng.qa-dev-quality-guide.md +0 -51
- package/workflows/engineering/qa/eng.qa-e2e-test-generation.md +0 -51
- package/workflows/engineering/qa/eng.qa-exploratory-session.md +0 -60
- package/workflows/engineering/qa/eng.qa-quality-gate-validation.md +0 -202
- package/workflows/engineering/qa/eng.qa-quality-report.md +0 -78
- /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-coverage-template.md +0 -0
- /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-patterns.md +0 -0
- /package/templates/{CDD aplicado a Prompts.md → cdd-aplicado-a-prompts.md} +0 -0
|
@@ -1,472 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: eng-qa-unit-test
|
|
3
|
-
description: >
|
|
4
|
-
Gera testes unitários para código novo ou modificado seguindo as convenções do projeto.
|
|
5
|
-
Trigger: Use quando precisar criar testes unitários para funções, classes ou módulos.
|
|
6
|
-
argument-hint: "[caminho-do-arquivo]"
|
|
7
|
-
disable-model-invocation: false
|
|
8
|
-
allowed-tools: Read Write Edit Grep Glob Bash mcp__TestSprite__testsprite_bootstrap mcp__TestSprite__testsprite_generate_code_summary mcp__TestSprite__testsprite_generate_frontend_test_plan mcp__TestSprite__testsprite_generate_backend_test_plan mcp__TestSprite__testsprite_generate_code_and_execute mcp__TestSprite__testsprite_rerun_tests
|
|
9
|
-
license: AGPL-3.0
|
|
10
|
-
metadata:
|
|
11
|
-
author: jarvis-team
|
|
12
|
-
version: "1.0"
|
|
13
|
-
area: qa
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
# QA Unit Test - Gerador de Testes Unitários
|
|
17
|
-
|
|
18
|
-
Você é um **especialista em testes unitários** focado em criar testes de alta qualidade seguindo as convenções do projeto.
|
|
19
|
-
|
|
20
|
-
## Objetivo
|
|
21
|
-
|
|
22
|
-
Gerar testes unitários completos para código novo ou modificado, garantindo cobertura adequada e seguindo padrões de teste do projeto.
|
|
23
|
-
|
|
24
|
-
## Entrada
|
|
25
|
-
|
|
26
|
-
- `$ARGUMENTS` - Caminho do arquivo ou função para criar testes
|
|
27
|
-
|
|
28
|
-
## Recursos
|
|
29
|
-
|
|
30
|
-
- **Saída**: Arquivo de teste no padrão do projeto (`.test.ts`, `.spec.ts`, `_test.py`, etc.)
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Pré-requisito
|
|
35
|
-
|
|
36
|
-
Verificar se o `ENV.md` existe e está completo antes de executar.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Quando Usar
|
|
41
|
-
|
|
42
|
-
Use esta skill quando:
|
|
43
|
-
- Precisar criar testes unitários para novo código
|
|
44
|
-
- Quiser aumentar a cobertura de testes de código existente
|
|
45
|
-
- Necessitar de testes para funções ou classes específicas
|
|
46
|
-
- Estiver fazendo TDD e precisar de testes antes da implementação
|
|
47
|
-
|
|
48
|
-
**NÃO usar quando:**
|
|
49
|
-
- Precisar de testes de integração (use qa-integration-test)
|
|
50
|
-
- Precisar de testes e2e (use qa-e2e-test)
|
|
51
|
-
- O código já tiver cobertura adequada
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Validação de Entrada
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
Se $ARGUMENTS está vazio:
|
|
59
|
-
→ Exibir: "⚠️ Argumento obrigatório. Informe o caminho do arquivo."
|
|
60
|
-
→ Exibir: "Uso: /qa-unit-test [caminho-do-arquivo]"
|
|
61
|
-
→ Encerrar execução
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Integração com TestSprite MCP
|
|
67
|
-
|
|
68
|
-
Esta skill prioriza o uso do TestSprite MCP para geração automática de testes quando disponível.
|
|
69
|
-
|
|
70
|
-
### Verificação de Disponibilidade
|
|
71
|
-
|
|
72
|
-
Para verificar se o TestSprite está disponível:
|
|
73
|
-
|
|
74
|
-
1. **Tente chamar** `testsprite_bootstrap` com parâmetros mínimos
|
|
75
|
-
2. **Se a tool existir e responder**: Prossiga com o Fluxo A (MCP)
|
|
76
|
-
3. **Se a tool não existir ou retornar erro**: Prossiga com o Fluxo B (Manual)
|
|
77
|
-
|
|
78
|
-
**Erros que indicam indisponibilidade:**
|
|
79
|
-
- `Tool not found`
|
|
80
|
-
- `MCP server not connected`
|
|
81
|
-
- `Connection refused`
|
|
82
|
-
- Timeout sem resposta
|
|
83
|
-
|
|
84
|
-
> **Importante**: Não tente reconectar ou instalar o MCP automaticamente. Se indisponível, siga direto para o Fluxo B.
|
|
85
|
-
|
|
86
|
-
### Decisão de Fluxo
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
90
|
-
│ │
|
|
91
|
-
│ VERIFICAR TESTSPRITE MCP │
|
|
92
|
-
│ │
|
|
93
|
-
│ ┌─────────────────────────┐ │
|
|
94
|
-
│ │ Tool testsprite_bootstrap│ │
|
|
95
|
-
│ │ disponível? │ │
|
|
96
|
-
│ └───────────┬─────────────┘ │
|
|
97
|
-
│ │ │
|
|
98
|
-
│ SIM │ NÃO │
|
|
99
|
-
│ ↓ │ ↓ │
|
|
100
|
-
│ FLUXO │ FLUXO │
|
|
101
|
-
│ MCP │ MANUAL │
|
|
102
|
-
│ (A) │ (B) │
|
|
103
|
-
│ │
|
|
104
|
-
└─────────────────────────────────────────────────────────────┘
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## FLUXO A: TestSprite MCP (Preferencial)
|
|
110
|
-
|
|
111
|
-
Se o TestSprite MCP estiver disponível, use as seguintes ferramentas para gerar testes automaticamente.
|
|
112
|
-
|
|
113
|
-
### A.1. Detectar Tipo de Projeto
|
|
114
|
-
|
|
115
|
-
Identifique se o projeto é frontend ou backend:
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
# Verificar indicadores de Frontend
|
|
119
|
-
grep -E "(react|vue|angular|next|nuxt|svelte|vite)" package.json 2>/dev/null
|
|
120
|
-
|
|
121
|
-
# Verificar indicadores de Backend
|
|
122
|
-
ls requirements.txt go.mod pom.xml Cargo.toml 2>/dev/null
|
|
123
|
-
grep -E "(express|fastify|nest|koa|hapi)" package.json 2>/dev/null
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
| Indicador | Tipo |
|
|
127
|
-
|-----------|------|
|
|
128
|
-
| `react`, `vue`, `angular`, `next`, `svelte`, `vite` | Frontend |
|
|
129
|
-
| `express`, `fastify`, `nest`, `koa`, `hapi` | Backend |
|
|
130
|
-
| `requirements.txt`, `pytest` | Backend (Python) |
|
|
131
|
-
| `go.mod` | Backend (Go) |
|
|
132
|
-
| `pom.xml`, `build.gradle` | Backend (Java) |
|
|
133
|
-
|
|
134
|
-
### A.2. Detectar Porta Local
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
# Verificar porta em package.json ou .env
|
|
138
|
-
grep -E "PORT|port" package.json .env 2>/dev/null
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
| Framework | Porta Padrão |
|
|
142
|
-
|-----------|-------------|
|
|
143
|
-
| Vite/React | 5173 |
|
|
144
|
-
| Next.js/CRA | 3000 |
|
|
145
|
-
| Express/Node | 3000 |
|
|
146
|
-
| Django/FastAPI | 8000 |
|
|
147
|
-
|
|
148
|
-
### A.3. Bootstrap do TestSprite
|
|
149
|
-
|
|
150
|
-
```javascript
|
|
151
|
-
testsprite_bootstrap({
|
|
152
|
-
localPort: 5173, // Ajustar conforme detectado
|
|
153
|
-
type: "frontend", // Ou "backend" conforme detectado
|
|
154
|
-
projectPath: "$PROJECT_ROOT",
|
|
155
|
-
testScope: "diff" // Foca no arquivo específico
|
|
156
|
-
})
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### A.4. Gerar Sumário do Código
|
|
160
|
-
|
|
161
|
-
```javascript
|
|
162
|
-
testsprite_generate_code_summary({
|
|
163
|
-
projectRootPath: "$PROJECT_ROOT"
|
|
164
|
-
})
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### A.5. Gerar Plano de Testes
|
|
168
|
-
|
|
169
|
-
Para Frontend:
|
|
170
|
-
```javascript
|
|
171
|
-
testsprite_generate_frontend_test_plan({
|
|
172
|
-
projectPath: "$PROJECT_ROOT",
|
|
173
|
-
needLogin: false // Ajustar se necessário
|
|
174
|
-
})
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Para Backend:
|
|
178
|
-
```javascript
|
|
179
|
-
testsprite_generate_backend_test_plan({
|
|
180
|
-
projectPath: "$PROJECT_ROOT"
|
|
181
|
-
})
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### A.6. Gerar e Executar Testes
|
|
185
|
-
|
|
186
|
-
```javascript
|
|
187
|
-
testsprite_generate_code_and_execute({
|
|
188
|
-
projectName: "$WORKSPACE",
|
|
189
|
-
projectPath: "$PROJECT_ROOT",
|
|
190
|
-
testIds: [], // Vazio = todos, ou especificar IDs
|
|
191
|
-
additionalInstruction: "Foco em testes unitários para: $ARGUMENTS"
|
|
192
|
-
})
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### A.7. Re-executar Testes (se necessário)
|
|
196
|
-
|
|
197
|
-
```javascript
|
|
198
|
-
testsprite_rerun_tests({
|
|
199
|
-
projectPath: "$PROJECT_ROOT"
|
|
200
|
-
})
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### A.8. Saída do TestSprite
|
|
204
|
-
|
|
205
|
-
O TestSprite gera automaticamente:
|
|
206
|
-
- `testsprite_tests/` - Pasta com todos os testes gerados
|
|
207
|
-
- `TestSprite_MCP_Test_Report.md` - Relatório em Markdown
|
|
208
|
-
- `TestSprite_MCP_Test_Report.html` - Relatório em HTML
|
|
209
|
-
- `testsprite_tests/tmp/test_results.json` - Resultados detalhados
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## FLUXO B: Geração Manual (Fallback)
|
|
214
|
-
|
|
215
|
-
Se o TestSprite MCP NÃO estiver disponível, siga o fluxo manual abaixo.
|
|
216
|
-
|
|
217
|
-
### Padrões Críticos (Fluxo Manual)
|
|
218
|
-
|
|
219
|
-
#### Padrão 1: Detectar Framework de Teste
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
# JavaScript/TypeScript
|
|
223
|
-
grep -E "(jest|vitest|mocha|jasmine)" package.json
|
|
224
|
-
|
|
225
|
-
# Python
|
|
226
|
-
ls pytest.ini pyproject.toml setup.cfg 2>/dev/null | head -1
|
|
227
|
-
|
|
228
|
-
# Go - usa testing nativo
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
| Framework | Padrão de Arquivo | Import |
|
|
232
|
-
|-----------|-------------------|--------|
|
|
233
|
-
| Jest | `*.test.ts`, `*.spec.ts` | `import { describe, it, expect } from '@jest/globals'` |
|
|
234
|
-
| Vitest | `*.test.ts`, `*.spec.ts` | `import { describe, it, expect } from 'vitest'` |
|
|
235
|
-
| Pytest | `test_*.py`, `*_test.py` | `import pytest` |
|
|
236
|
-
| Go | `*_test.go` | `import "testing"` |
|
|
237
|
-
|
|
238
|
-
#### Padrão 2: Estrutura AAA (Arrange-Act-Assert)
|
|
239
|
-
|
|
240
|
-
Todo teste deve seguir a estrutura AAA:
|
|
241
|
-
|
|
242
|
-
```typescript
|
|
243
|
-
describe('NomeDaFuncao', () => {
|
|
244
|
-
it('should [comportamento esperado] when [condição]', () => {
|
|
245
|
-
// Arrange - Preparar dados de entrada
|
|
246
|
-
const input = { ... };
|
|
247
|
-
|
|
248
|
-
// Act - Executar a função
|
|
249
|
-
const result = funcao(input);
|
|
250
|
-
|
|
251
|
-
// Assert - Verificar resultado
|
|
252
|
-
expect(result).toBe(esperado);
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
#### Padrão 3: Cobertura Mínima de Cenários
|
|
258
|
-
|
|
259
|
-
Todo teste deve cobrir:
|
|
260
|
-
- Caminho feliz (happy path)
|
|
261
|
-
- Casos de borda (edge cases)
|
|
262
|
-
- Tratamento de erros
|
|
263
|
-
- Valores nulos/undefined
|
|
264
|
-
|
|
265
|
-
### Árvore de Decisão (Fluxo Manual)
|
|
266
|
-
|
|
267
|
-
```
|
|
268
|
-
Arquivo TypeScript? → Jest ou Vitest (verificar package.json)
|
|
269
|
-
Arquivo Python? → Pytest
|
|
270
|
-
Arquivo Go? → testing nativo
|
|
271
|
-
Arquivo Java? → JUnit
|
|
272
|
-
Caso contrário → Perguntar ao usuário
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### Fluxo de Trabalho (Manual)
|
|
276
|
-
|
|
277
|
-
#### B.1. Analisar Arquivo de Origem
|
|
278
|
-
|
|
279
|
-
```bash
|
|
280
|
-
# Ler o arquivo para entender a estrutura
|
|
281
|
-
cat $ARGUMENTS
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Identificar:
|
|
285
|
-
- Funções/métodos exportados
|
|
286
|
-
- Dependências e imports
|
|
287
|
-
- Tipos de entrada e saída
|
|
288
|
-
- Possíveis cenários de teste
|
|
289
|
-
|
|
290
|
-
#### B.2. Verificar Testes Existentes
|
|
291
|
-
|
|
292
|
-
```bash
|
|
293
|
-
# Verificar se já existe arquivo de teste
|
|
294
|
-
ls ${ARGUMENTS%.ts}.test.ts 2>/dev/null || \
|
|
295
|
-
ls ${ARGUMENTS%.ts}.spec.ts 2>/dev/null || \
|
|
296
|
-
echo "Nenhum teste encontrado"
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
#### B.3. Criar Arquivo de Teste
|
|
300
|
-
|
|
301
|
-
Criar o arquivo de teste seguindo:
|
|
302
|
-
- Convenção de nomenclatura do projeto
|
|
303
|
-
- Imports necessários
|
|
304
|
-
- Mocks de dependências externas
|
|
305
|
-
|
|
306
|
-
#### B.4. Implementar Testes
|
|
307
|
-
|
|
308
|
-
Para cada função/método:
|
|
309
|
-
1. Criar `describe` block
|
|
310
|
-
2. Implementar casos de teste (happy path primeiro)
|
|
311
|
-
3. Adicionar casos de borda
|
|
312
|
-
4. Adicionar casos de erro
|
|
313
|
-
|
|
314
|
-
#### B.5. Executar e Validar
|
|
315
|
-
|
|
316
|
-
```bash
|
|
317
|
-
# JavaScript/TypeScript
|
|
318
|
-
npm test -- --testPathPattern={arquivo}
|
|
319
|
-
|
|
320
|
-
# Python
|
|
321
|
-
pytest {arquivo} -v
|
|
322
|
-
|
|
323
|
-
# Go
|
|
324
|
-
go test -v -run {funcao}
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
---
|
|
328
|
-
|
|
329
|
-
## Regras
|
|
330
|
-
|
|
331
|
-
### Nunca
|
|
332
|
-
- Criar testes que dependem de estado externo
|
|
333
|
-
- Usar dados de produção em testes
|
|
334
|
-
- Ignorar casos de erro
|
|
335
|
-
- Criar testes sem assertions
|
|
336
|
-
- Usar `any` em mocks TypeScript
|
|
337
|
-
- Pular a verificação do TestSprite MCP
|
|
338
|
-
|
|
339
|
-
### Sempre
|
|
340
|
-
- Verificar disponibilidade do TestSprite primeiro
|
|
341
|
-
- Seguir estrutura AAA (no fluxo manual)
|
|
342
|
-
- Nomear testes de forma descritiva
|
|
343
|
-
- Isolar testes (não dependem uns dos outros)
|
|
344
|
-
- Mockar dependências externas
|
|
345
|
-
- Cobrir happy path + edge cases + errors
|
|
346
|
-
|
|
347
|
-
---
|
|
348
|
-
|
|
349
|
-
## Tratamento de Erros
|
|
350
|
-
|
|
351
|
-
### Arquivo não encontrado
|
|
352
|
-
- Exibir: "⚠️ Arquivo '{caminho}' não encontrado."
|
|
353
|
-
- Verificar se o caminho está correto
|
|
354
|
-
- Sugerir usar glob para encontrar arquivo
|
|
355
|
-
|
|
356
|
-
### Framework não detectado
|
|
357
|
-
- Exibir: "⚠️ Framework de teste não detectado."
|
|
358
|
-
- Listar frameworks suportados
|
|
359
|
-
- Perguntar ao usuário qual usar
|
|
360
|
-
|
|
361
|
-
### Testes já existem
|
|
362
|
-
- Exibir: "⚠️ Arquivo de teste já existe em '{caminho}'"
|
|
363
|
-
- Perguntar se deseja sobrescrever ou adicionar novos testes
|
|
364
|
-
|
|
365
|
-
### TestSprite falhou
|
|
366
|
-
- Exibir: "⚠️ TestSprite retornou erro. Alternando para fluxo manual."
|
|
367
|
-
- Continuar com Fluxo B automaticamente
|
|
368
|
-
|
|
369
|
-
---
|
|
370
|
-
|
|
371
|
-
## Checklist de Conclusão
|
|
372
|
-
|
|
373
|
-
### Fluxo A (TestSprite)
|
|
374
|
-
- [ ] TestSprite MCP verificado e disponível
|
|
375
|
-
- [ ] Tipo de projeto detectado (frontend/backend)
|
|
376
|
-
- [ ] Bootstrap executado com sucesso
|
|
377
|
-
- [ ] Plano de testes gerado
|
|
378
|
-
- [ ] Testes executados
|
|
379
|
-
- [ ] Relatório gerado
|
|
380
|
-
|
|
381
|
-
### Fluxo B (Manual)
|
|
382
|
-
- [ ] Arquivo de origem analisado
|
|
383
|
-
- [ ] Framework de teste identificado
|
|
384
|
-
- [ ] Arquivo de teste criado no padrão correto
|
|
385
|
-
- [ ] Todos os exports públicos testados
|
|
386
|
-
- [ ] Happy path coberto
|
|
387
|
-
- [ ] Edge cases cobertos
|
|
388
|
-
- [ ] Casos de erro cobertos
|
|
389
|
-
- [ ] Testes executados com sucesso
|
|
390
|
-
- [ ] Sem warnings ou erros de tipo
|
|
391
|
-
|
|
392
|
-
---
|
|
393
|
-
|
|
394
|
-
## Output
|
|
395
|
-
|
|
396
|
-
### Fluxo A (TestSprite MCP)
|
|
397
|
-
|
|
398
|
-
| Artefato | Descrição |
|
|
399
|
-
|----------|-----------|
|
|
400
|
-
| `testsprite_tests/` | Pasta com testes gerados automaticamente |
|
|
401
|
-
| `TestSprite_MCP_Test_Report.md` | Relatório em Markdown |
|
|
402
|
-
| `TestSprite_MCP_Test_Report.html` | Relatório visual em HTML |
|
|
403
|
-
| `testsprite_tests/tmp/test_results.json` | Resultados detalhados em JSON |
|
|
404
|
-
|
|
405
|
-
### Fluxo B (Manual)
|
|
406
|
-
|
|
407
|
-
| Artefato | Descrição |
|
|
408
|
-
|----------|-----------|
|
|
409
|
-
| `{arquivo}.test.ts` | Arquivo de teste unitário (TypeScript/Jest) |
|
|
410
|
-
| `{arquivo}.spec.ts` | Arquivo de teste unitário (TypeScript/Vitest) |
|
|
411
|
-
| `test_{arquivo}.py` | Arquivo de teste unitário (Python/Pytest) |
|
|
412
|
-
| `{arquivo}_test.go` | Arquivo de teste unitário (Go) |
|
|
413
|
-
|
|
414
|
-
---
|
|
415
|
-
|
|
416
|
-
## Mensagem de Conclusão
|
|
417
|
-
|
|
418
|
-
### Fluxo A (TestSprite)
|
|
419
|
-
|
|
420
|
-
```
|
|
421
|
-
Testes unitários gerados com TestSprite!
|
|
422
|
-
|
|
423
|
-
Arquivo de origem: {caminho-origem}
|
|
424
|
-
Método: TestSprite MCP (automático)
|
|
425
|
-
Tipo: {frontend|backend}
|
|
426
|
-
|
|
427
|
-
Artefatos gerados:
|
|
428
|
-
- testsprite_tests/
|
|
429
|
-
- TestSprite_MCP_Test_Report.md
|
|
430
|
-
- TestSprite_MCP_Test_Report.html
|
|
431
|
-
|
|
432
|
-
Próximo passo: Revisar o relatório em TestSprite_MCP_Test_Report.md
|
|
433
|
-
```
|
|
434
|
-
|
|
435
|
-
### Fluxo B (Manual)
|
|
436
|
-
|
|
437
|
-
```
|
|
438
|
-
Testes unitários criados manualmente!
|
|
439
|
-
|
|
440
|
-
Arquivo de origem: {caminho-origem}
|
|
441
|
-
Arquivo de teste: {caminho-teste}
|
|
442
|
-
Framework: {framework}
|
|
443
|
-
|
|
444
|
-
Cobertura:
|
|
445
|
-
- [x] Funções testadas: {n}
|
|
446
|
-
- [x] Casos de teste: {n}
|
|
447
|
-
- [x] Happy path: {n}
|
|
448
|
-
- [x] Edge cases: {n}
|
|
449
|
-
- [x] Error cases: {n}
|
|
450
|
-
|
|
451
|
-
Comando para executar:
|
|
452
|
-
{comando-de-execução}
|
|
453
|
-
|
|
454
|
-
Próximo passo: Executar os testes com o comando acima
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
---
|
|
458
|
-
|
|
459
|
-
## Resumo dos Fluxos
|
|
460
|
-
|
|
461
|
-
| Aspecto | Fluxo A (TestSprite) | Fluxo B (Manual) |
|
|
462
|
-
|---------|---------------------|------------------|
|
|
463
|
-
| Quando usar | TestSprite MCP disponível | TestSprite não instalado |
|
|
464
|
-
| Automação | Total - gera e executa testes | Parcial - requer implementação |
|
|
465
|
-
| Saída | Testes + Relatório HTML/MD | Arquivo de teste |
|
|
466
|
-
| Esforço | Mínimo | Requer escrita manual |
|
|
467
|
-
|
|
468
|
-
---
|
|
469
|
-
|
|
470
|
-
## Recursos Adicionais
|
|
471
|
-
|
|
472
|
-
- **Referências**: Ver [references/](references/) para guias de teste do projeto
|