jarvis-ai-framework 1.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 (240) hide show
  1. package/AGENTS.md +416 -0
  2. package/LICENSE +21 -0
  3. package/README.md +190 -0
  4. package/agents/AGENTS.md +234 -0
  5. package/agents/README.md +309 -0
  6. package/agents/engineering/data/eng.data-engineer.agent.md +309 -0
  7. package/agents/engineering/eng.agent.md +303 -0
  8. package/agents/engineering/eng.bug-hunter.md +386 -0
  9. package/agents/engineering/eng.cybersecurity.agent.md +503 -0
  10. package/agents/engineering/eng.dev-code-reviewer.md +148 -0
  11. package/agents/engineering/eng.docs-writer.md +152 -0
  12. package/agents/engineering/eng.frontend.agent.md +117 -0
  13. package/agents/engineering/eng.rpa.agent.md +215 -0
  14. package/agents/engineering/eng.tech-analyst.agent.md +102 -0
  15. package/agents/engineering/eng.ux-designer.agent.md +193 -0
  16. package/agents/engineering/qa/eng.qa.cypress-specialist.md +109 -0
  17. package/agents/engineering/qa/eng.qa.quality-champion-task-agent.md +85 -0
  18. package/agents/engineering/qa/eng.qa.quality-strategist.md +111 -0
  19. package/agents/engineering/qa/eng.qa.test-architect.md +400 -0
  20. package/agents/engineering/qa/eng.qa.test-planner.md +477 -0
  21. package/agents/engineering/qa/eng.qa.testing-engineer.md +339 -0
  22. package/agents/product/prod.pm-checker.md +52 -0
  23. package/bin/commands/docs-publish.js +184 -0
  24. package/bin/commands/docs-sync.js +139 -0
  25. package/bin/commands/info.js +87 -0
  26. package/bin/commands/init.js +237 -0
  27. package/bin/commands/install-rtk.js +90 -0
  28. package/bin/commands/list.js +48 -0
  29. package/bin/commands/qa-signoff.js +112 -0
  30. package/bin/commands/whoami.js +43 -0
  31. package/bin/jarvis.js +159 -0
  32. package/bin/lib/auth/session.js +56 -0
  33. package/bin/lib/config/constants.js +123 -0
  34. package/bin/lib/config/ide-config.js +233 -0
  35. package/bin/lib/core/scanner.js +124 -0
  36. package/bin/lib/core/sync-engine.js +551 -0
  37. package/bin/lib/docs/fetch-file.sh +41 -0
  38. package/bin/lib/docs/publish-file.sh +284 -0
  39. package/bin/lib/docs/validate-frontmatter.js +157 -0
  40. package/bin/lib/env-loader.js +198 -0
  41. package/bin/lib/tasks/comment.js +131 -0
  42. package/bin/lib/utils/git-parser.js +145 -0
  43. package/bin/lib/utils/logger.js +104 -0
  44. package/bin/lib/utils/npmrc-parser.js +106 -0
  45. package/bin/lib/utils/paths.js +55 -0
  46. package/bin/lib/utils/ui.js +59 -0
  47. package/bin/lib/vcs/api.js +312 -0
  48. package/bin/lib/vcs/create-issue.js +43 -0
  49. package/bin/lib/vcs/create-merge.js +43 -0
  50. package/bin/lib/vcs/fetch-raw.js +30 -0
  51. package/bin/postinstall.js +41 -0
  52. package/members.md +25 -0
  53. package/package.json +55 -0
  54. package/rules/AGENTS.md +205 -0
  55. package/rules/engineering/data/data-rules.md +200 -0
  56. package/rules/engineering/eng-rules.md +243 -0
  57. package/rules/engineering/eng-security-rules.md +186 -0
  58. package/rules/engineering/eng.breakdown-subtasks-rules.md +585 -0
  59. package/rules/engineering/eng.bump-rules.md +27 -0
  60. package/rules/engineering/eng.docs-scraping-rules.md +64 -0
  61. package/rules/engineering/eng.downstream-flow-rules.md +297 -0
  62. package/rules/engineering/eng.integrations-rules.md +73 -0
  63. package/rules/engineering/eng.plan-rules.md +333 -0
  64. package/rules/engineering/eng.pr-rules.md +359 -0
  65. package/rules/engineering/eng.pre-pr-rules.md +103 -0
  66. package/rules/engineering/eng.start-rules.md +246 -0
  67. package/rules/engineering/eng.tech-spec-rules.md +968 -0
  68. package/rules/engineering/eng.work-rules.md +312 -0
  69. package/rules/engineering/frontend/eng.frontend-rules.md +147 -0
  70. package/rules/engineering/qa/eng.qa.cypress-standards-rules.md +259 -0
  71. package/rules/engineering/qa/eng.qa.exploratory-session-rules.md +137 -0
  72. package/rules/engineering/qa/eng.qa.quality-gate-scoring-rules.md +181 -0
  73. package/rules/engineering/qa/eng.qa.tech-spec-validation-criteria-rules.md +120 -0
  74. package/rules/engineering/rpa/eng.rpa-rules.md +230 -0
  75. package/rules/product/README.md +24 -0
  76. package/rules/product/prod-rules.md +151 -0
  77. package/rules/rtk-rules.md +68 -0
  78. package/skills/AGENTS.md +290 -0
  79. package/skills/SKILLS-ROADMAP.md +333 -0
  80. package/skills/churn-audit/SKILL.md +385 -0
  81. package/skills/context-detect/SKILL.md +399 -0
  82. package/skills/context-detect/assets/context-profile-template.md +127 -0
  83. package/skills/docs-central/README.md +310 -0
  84. package/skills/docs-central/SKILL.md +423 -0
  85. package/skills/docs-index/SKILL.md +377 -0
  86. package/skills/eng-ai-engineer/SKILL.md +296 -0
  87. package/skills/eng-arch-c4/SKILL.md +358 -0
  88. package/skills/eng-arch-c4/assets/example-code.md +189 -0
  89. package/skills/eng-arch-c4/assets/example-component.md +105 -0
  90. package/skills/eng-arch-c4/assets/example-container.md +104 -0
  91. package/skills/eng-arch-c4/assets/example-context.md +81 -0
  92. package/skills/eng-backend/SKILL.md +776 -0
  93. package/skills/eng-browser-extension-builder/SKILL.md +385 -0
  94. package/skills/eng-cybersecurity/SKILL.md +645 -0
  95. package/skills/eng-data-bi/SKILL.md +199 -0
  96. package/skills/eng-data-debug/SKILL.md +307 -0
  97. package/skills/eng-data-engineer/SKILL.md +256 -0
  98. package/skills/eng-data-onboard/SKILL.md +310 -0
  99. package/skills/eng-data-orchestrator/SKILL.md +426 -0
  100. package/skills/eng-design-system/SKILL.md +619 -0
  101. package/skills/eng-docs-write/SKILL.md +312 -0
  102. package/skills/eng-frontend/SKILL.md +913 -0
  103. package/skills/eng-jira-comment/SKILL.md +17 -0
  104. package/skills/eng-microfrontend/SKILL.md +602 -0
  105. package/skills/eng-ms-trace/SKILL.md +469 -0
  106. package/skills/eng-nestjs/SKILL.md +791 -0
  107. package/skills/eng-performance-engineer/SKILL.md +312 -0
  108. package/skills/eng-pr/SKILL.md +339 -0
  109. package/skills/eng-qa-a11y-audit/SKILL.md +269 -0
  110. package/skills/eng-qa-bug-report/SKILL.md +1088 -0
  111. package/skills/eng-qa-bug-report/TASK_MANAGERS.md +138 -0
  112. package/skills/eng-qa-cypress-e2e/SKILL.md +177 -0
  113. package/skills/eng-qa-dev-guide/SKILL.md +164 -0
  114. package/skills/eng-qa-e2e/SKILL.md +400 -0
  115. package/skills/eng-qa-e2e-spec-writer/SKILL.md +322 -0
  116. package/skills/eng-qa-exploratory/SKILL.md +188 -0
  117. package/skills/eng-qa-gate/SKILL.md +370 -0
  118. package/skills/eng-qa-gate/assets/checklist-validacao.md +291 -0
  119. package/skills/eng-qa-graphql-contract/SKILL.md +256 -0
  120. package/skills/eng-qa-quality-report/SKILL.md +412 -0
  121. package/skills/eng-qa-test-plan/SKILL.md +466 -0
  122. package/skills/eng-qa-test-plan/assets/test-coverage-template.md +92 -0
  123. package/skills/eng-qa-test-plan/assets/test-patterns.md +178 -0
  124. package/skills/eng-qa-testsprite/SKILL.md +325 -0
  125. package/skills/eng-qa-testsprite/references/testsprite-mcp.md +224 -0
  126. package/skills/eng-qa-unit-test/SKILL.md +471 -0
  127. package/skills/eng-rabbitmq/SKILL.md +661 -0
  128. package/skills/eng-scraper/SKILL.md +683 -0
  129. package/skills/eng-scraper-robot-builder/SKILL.md +370 -0
  130. package/skills/eng-security-patch/SKILL.md +378 -0
  131. package/skills/eng-security-triage/SKILL.md +266 -0
  132. package/skills/eng-task-comment/SKILL.md +60 -0
  133. package/skills/eng-tech-analyst/SKILL.md +529 -0
  134. package/skills/eng-threat-model/SKILL.md +161 -0
  135. package/skills/init-jarvis/SKILL.md +1304 -0
  136. package/skills/init-jarvis/assets/mcp-configs.md +389 -0
  137. package/skills/init-jarvis/assets/onboarding-checklist.md +104 -0
  138. package/skills/init-jarvis/assets/setup-guide.md +360 -0
  139. package/skills/lovable-prompt-generator/SKILL.md +304 -0
  140. package/skills/prod-roadmap-report/README.md +303 -0
  141. package/skills/prod-roadmap-report/SKILL.md +198 -0
  142. package/skills/prod-roadmap-report/commands/status.compiled.single.team.md +23 -0
  143. package/skills/prod-roadmap-report/commands/status.list.projects.md +17 -0
  144. package/skills/prod-roadmap-report/commands/status.memory.md +192 -0
  145. package/skills/prod-roadmap-report/commands/status.roadmap.preview.md +94 -0
  146. package/skills/prod-roadmap-report/references/detailed-guide.md +236 -0
  147. package/skills/prod-roadmap-report/rules/detailed-guide.md +237 -0
  148. package/skills/prod-roadmap-report/rules/status-report-rules.md +44 -0
  149. package/skills/prod-roadmap-report/templates/template-multiple-teams-compiled-status.md +53 -0
  150. package/skills/prod-roadmap-report/templates/template-projects-list.md +23 -0
  151. package/skills/prod-roadmap-report/templates/template-single-team-compiled-status.md +60 -0
  152. package/skills/prod-roadmap-report/templates/template-single-team-status.md +49 -0
  153. package/skills/prod-specs/SKILL.md +108 -0
  154. package/skills/prod-specs/references/prod.spec.clarify.md +176 -0
  155. package/skills/prod-specs/references/prod.spec.epic.md +107 -0
  156. package/skills/prod-specs/references/prod.spec.frd.md +135 -0
  157. package/skills/prod-specs/references/prod.spec.issue.md +145 -0
  158. package/skills/prod-specs/references/prod.spec.prd.md +118 -0
  159. package/skills/prod-specs/rules/prod-spec-rules.md +186 -0
  160. package/skills/prod-specs/templates/prod-breakdown-template.md +136 -0
  161. package/skills/prod-specs/templates/prod-epic-template.md +76 -0
  162. package/skills/prod-specs/templates/prod-frd-template.md +172 -0
  163. package/skills/prod-specs/templates/prod-issue-template.md +68 -0
  164. package/skills/prod-specs/templates/prod-prd-full-template.md +159 -0
  165. package/skills/prod-specs/templates/prod-prd-template.md +173 -0
  166. package/skills/prod-specs-update/SKILL.md +272 -0
  167. package/skills/report-issue/SKILL.md +156 -0
  168. package/taxonomy.md +270 -0
  169. package/templates/AGENTS.md +189 -0
  170. package/templates/CDD aplicado a Prompts.md +182 -0
  171. package/templates/ENV-template.md +187 -0
  172. package/templates/engineering/AGENTS-template.md +71 -0
  173. package/templates/engineering/ARD-template.md +193 -0
  174. package/templates/engineering/CONTACTS-template.md +135 -0
  175. package/templates/engineering/PR-template.md +40 -0
  176. package/templates/engineering/RFC-Playbook.md +325 -0
  177. package/templates/engineering/RFC-template.md +199 -0
  178. package/templates/engineering/architecture-template.md +277 -0
  179. package/templates/engineering/breakdown-subtasks-template.md +582 -0
  180. package/templates/engineering/c4-model-template.md +516 -0
  181. package/templates/engineering/data-contract-template.md +135 -0
  182. package/templates/engineering/data-pipeline-template.md +163 -0
  183. package/templates/engineering/plan-template.md +255 -0
  184. package/templates/engineering/qa/eng.qa.quality-gate-examples-template.md +311 -0
  185. package/templates/engineering/qa/eng.qa.quality-gate-report-template.md +249 -0
  186. package/templates/engineering/qa/qa.cypress-test-template.md +172 -0
  187. package/templates/engineering/qa/qa.exploratory-session-template.md +148 -0
  188. package/templates/engineering/qa/qa.quality-report-template.md +130 -0
  189. package/templates/engineering/qa/qa.release-signoff-template.md +54 -0
  190. package/templates/engineering/qa/qa.sprint-plan-template.md +49 -0
  191. package/templates/engineering/swagger-template.md +145 -0
  192. package/templates/engineering/tech-spec-template.md +497 -0
  193. package/templates/engineering/work-progress-template.md +155 -0
  194. package/workflows/AGENTS.md +240 -0
  195. package/workflows/README.md +160 -0
  196. package/workflows/all-tools.md +11 -0
  197. package/workflows/engineering/data/data.contract.md +202 -0
  198. package/workflows/engineering/data/data.new-pipeline.md +234 -0
  199. package/workflows/engineering/eng.breakdown-subtasks.md +420 -0
  200. package/workflows/engineering/eng.bug-audit.md +591 -0
  201. package/workflows/engineering/eng.build-tech-spec.md +1116 -0
  202. package/workflows/engineering/eng.create-ard-from-code.md +259 -0
  203. package/workflows/engineering/eng.create-ard.md +382 -0
  204. package/workflows/engineering/eng.create-rfc.md +245 -0
  205. package/workflows/engineering/eng.debug.md +479 -0
  206. package/workflows/engineering/eng.docs.md +40 -0
  207. package/workflows/engineering/eng.light-arch.md +84 -0
  208. package/workflows/engineering/eng.plan.md +213 -0
  209. package/workflows/engineering/eng.pr.md +466 -0
  210. package/workflows/engineering/eng.pre-pr.md +167 -0
  211. package/workflows/engineering/eng.review.md +185 -0
  212. package/workflows/engineering/eng.rpa.robot.md +342 -0
  213. package/workflows/engineering/eng.security-audit.md +312 -0
  214. package/workflows/engineering/eng.security-incident.md +275 -0
  215. package/workflows/engineering/eng.security-pipeline.md +210 -0
  216. package/workflows/engineering/eng.security-review.md +235 -0
  217. package/workflows/engineering/eng.start.md +494 -0
  218. package/workflows/engineering/eng.work.md +558 -0
  219. package/workflows/engineering/frontend/eng.frontend-component.md +190 -0
  220. package/workflows/engineering/frontend/eng.frontend-perf-audit.md +375 -0
  221. package/workflows/engineering/frontend/eng.frontend-review.md +185 -0
  222. package/workflows/engineering/qa/eng.qa-dev-quality-guide.md +51 -0
  223. package/workflows/engineering/qa/eng.qa-e2e-test-generation.md +51 -0
  224. package/workflows/engineering/qa/eng.qa-exploratory-session.md +60 -0
  225. package/workflows/engineering/qa/eng.qa-quality-gate-validation.md +202 -0
  226. package/workflows/engineering/qa/eng.qa-quality-report.md +83 -0
  227. package/workflows/engineering/qa/eng.qa-refinement-entry.md +83 -0
  228. package/workflows/engineering/qa/eng.qa-release-signoff.md +170 -0
  229. package/workflows/engineering/qa/eng.qa-sprint-planning.md +100 -0
  230. package/workflows/engineering/ta/eng.ta.atendimento.md +93 -0
  231. package/workflows/product/prod.roadmap.preview.md +110 -0
  232. package/workflows/product/prod.spec.breakdown.md +163 -0
  233. package/workflows/product/prod.spec.clarify.md +178 -0
  234. package/workflows/product/prod.spec.epic.md +154 -0
  235. package/workflows/product/prod.spec.frd.md +96 -0
  236. package/workflows/product/prod.spec.issue.md +145 -0
  237. package/workflows/product/prod.spec.md +60 -0
  238. package/workflows/product/prod.spec.prd.md +100 -0
  239. package/workflows/taxonomy.md +92 -0
  240. package/workflows/warm-up.md +574 -0
@@ -0,0 +1,213 @@
1
+ ---
2
+ description: Planejamento de execução faseada para a feature
3
+ auto_execution_mode: 3
4
+ agent: "$IDE/agents/engineering/eng.agent.md"
5
+ rules_file: "$IDE/rules/engineering/eng.plan-rules.md"
6
+ template_file: "$IDE/templates/engineering/plan-template.md"
7
+ recommended_model: claude-sonnet-4-20250514
8
+ model_tier: high
9
+ model_justification: Planejamento detalhado requer decomposição de tarefas complexas, análise de dependências e estimativas precisas
10
+ ---
11
+
12
+ # Engineer Plan
13
+
14
+ Este workflow cria um **plano de execução detalhado e faseado** para implementar a feature de forma incremental.
15
+
16
+ ---
17
+
18
+ ## Argumentos
19
+
20
+ <arguments>
21
+ #$ARGUMENTS
22
+ </arguments>
23
+
24
+ Ler `TASK_MANAGER` do `$IDE/ENV.md`. Se o `TASK_MANAGER_KEY` não vier nos argumentos: **perguntar e aguardar** (`eng.integrations-rules.md`). Freelance → número de controle próprio.
25
+
26
+ ---
27
+
28
+ ## Pré-requisitos
29
+
30
+ Antes de executar este workflow:
31
+
32
+ 1. O arquivo `architecture.md` **DEVE existir** em `$SESSIONS_DIR/eng/{TASK_MANAGER_KEY}/`
33
+ 2. Se não existir, peça ao usuário para executar o workflow `start` primeiro
34
+
35
+ > 📁 **Padrão de pasta**: `{TASK_MANAGER_KEY}` é o ID do card em **lowercase** (ex: `TASK-123` → `task-123`)
36
+
37
+ ---
38
+
39
+ ## Fase 0.5: Comentário no card — Início
40
+
41
+ Pular se `TASK_MANAGER` estiver vazio (freelance).
42
+
43
+ Após confirmar que o `architecture.md` existe, registrar início do planejamento:
44
+
45
+ ```
46
+ /eng-task-comment {TASK_MANAGER_KEY} 📋 [Jarvis] Iniciando criação do plano de execução
47
+ ```
48
+
49
+ > Usa o skill `/eng-task-comment`. Não bloquear se falhar.
50
+
51
+ ---
52
+
53
+ ## Fluxo de Execução
54
+
55
+ ### Fase 0: Análise de Contexto (CDD)
56
+
57
+ > 🎯 **Objetivo**: Adaptar a granularidade e rigor do plano com base no contexto.
58
+ > ⚙️ **Configurável**: Esta fase é opcional e controlada pela variável `ENABLE_CDD` no ENV.md
59
+
60
+ **Verificação de Ativação:**
61
+
62
+ Antes de herdar o contexto, verifique se o CDD está habilitado:
63
+
64
+ ```bash
65
+ grep "^ENABLE_CDD=" $IDE/ENV.md
66
+ ```
67
+
68
+ - Se `ENABLE_CDD=false` ou não definida → **Pular esta fase** e usar comportamento padrão (Fase 1)
69
+ - Se `ENABLE_CDD=true` → Herdar contexto normalmente
70
+
71
+ Antes de criar o plano, herde o contexto da sessão (se CDD estiver habilitado):
72
+
73
+ #### 0.1 Herdar Contexto da Sessão
74
+
75
+ Leia o `CONTEXT_PROFILE` do arquivo `context.md` (gerado pelo `/context-detect`):
76
+
77
+ ```bash
78
+ # Localização: $SESSIONS_DIR/eng/{TASK_MANAGER_KEY}/context.md
79
+ ```
80
+
81
+ ```
82
+ CONTEXT_PROFILE:
83
+ tipo: [hotfix|bugfix|feature|refactor]
84
+ urgencia: [normal|alta|baixa]
85
+ rigor: [mínimo|padrão|alto]
86
+ comunicacao: [didático|direto|estratégico]
87
+ autonomia: [baixa|média|alta]
88
+ ```
89
+
90
+ > Se `context.md` não existir, verifique o `architecture.md` ou execute `/context-detect {TASK_MANAGER_KEY}`
91
+
92
+ #### 0.2 Calibração do Plano por Tipo
93
+
94
+ | Tipo | Ajuste no Plano |
95
+ |------|-----------------|
96
+ | `hotfix` | 1-2 fases máximo, foco cirúrgico, skip de testes extensivos |
97
+ | `bugfix` | 2-3 fases, incluir fase de teste que reproduz o bug |
98
+ | `feature` | Fases completas (~1h cada), todas as validações |
99
+ | `refactor` | Fase 0 obrigatória de testes antes de qualquer mudança |
100
+
101
+ #### 0.3 Granularidade por POSITION
102
+
103
+ | POSITION | Granularidade do Plano |
104
+ |----------|------------------------|
105
+ | `junior`, `pleno` | Mais detalhado, passos menores, mais checkpoints |
106
+ | `senior`, `staff` | Fases maiores, menos micro-gerenciamento |
107
+ | `tech-lead` | Visão estratégica, delegar detalhes |
108
+
109
+ #### 0.4 Autonomia por MAX_AI_EXECUTION_PERCENTAGE
110
+
111
+ | Valor | Comportamento no Planejamento |
112
+ |-------|-------------------------------|
113
+ | `>= 80%` | Criar plano completo, validar apenas no final |
114
+ | `70-79%` | Apresentar outline, detalhar após aprovação |
115
+ | `60-69%` | Apresentar cada fase para aprovação antes de detalhar |
116
+
117
+ ---
118
+
119
+ ### Fase 1: Leitura do Architecture
120
+
121
+ 1. **Ler** o arquivo `architecture.md` da sessão
122
+ 2. **Extrair** informações essenciais:
123
+ - Objetivo da feature
124
+ - Requisitos funcionais e não-funcionais
125
+ - Decisões arquiteturais
126
+ - Restrições técnicas
127
+
128
+ ### Fase 2: Pesquisa no Codebase
129
+
130
+ 1. **Buscar** arquivos relevantes usando:
131
+ - `repoprompt:search` para encontrar arquivos específicos
132
+ - `repoprompt:read_selected_files` para ler código em batch
133
+ 2. **Analisar**:
134
+ - Padrões existentes no projeto
135
+ - Arquivos que serão modificados
136
+ - Dependências técnicas
137
+
138
+ 3. **Pesquisar** (se necessário):
139
+ - WebSearch para melhores práticas
140
+ - context7 para documentação de bibliotecas
141
+
142
+ ### Fase 3: Criação do Plano
143
+
144
+ 1. **Dividir** o trabalho em **fases incrementais**:
145
+ - Cada fase deve levar ~1 hora (máximo)
146
+ - Cada fase deve ser testável independentemente
147
+ - Fases devem ser ordenadas por dependências
148
+
149
+ 2. **Detalhar** cada tarefa com:
150
+ - **O que fazer**: Descrição clara
151
+ - **Onde fazer**: Arquivo(s) envolvido(s)
152
+ - **Como fazer**: Abordagem técnica
153
+ - **Como verificar**: Critério de conclusão
154
+
155
+ 3. **Incluir tarefa de testes em CADA fase** (obrigatório):
156
+ - Cada fase DEVE ter uma tarefa `X.T Testes da Fase X`
157
+ - Basear nos requisitos definidos em `architecture.md` seção 6.5
158
+ - Especificar tipos de teste: unitário, integração, e2e
159
+ - Definir cobertura mínima esperada
160
+ - Listar o que será testado (funcionalidades da fase)
161
+
162
+ 4. **Usar** o template em `$IDE/templates/engineering/plan-template.md`
163
+
164
+ ### Fase 4: Validação
165
+
166
+ 1. **Apresentar** o plano ao humano
167
+ 2. **Discutir** ajustes necessários
168
+ 3. **Atualizar** `architecture.md` se houver mudanças arquiteturais
169
+ 4. **Confirmar** antes de prosseguir
170
+
171
+ ---
172
+
173
+ ## Saída Esperada
174
+
175
+ Arquivo criado:
176
+
177
+ ```
178
+ $SESSIONS_DIR/eng/{TASK_MANAGER_KEY}/plan.md
179
+ ```
180
+
181
+ Com:
182
+
183
+ - Fases numeradas e detalhadas
184
+ - Tarefas específicas com critérios de conclusão
185
+ - Dependências claras (sequencial/paralelo)
186
+ - Status iniciais definidos (⏳)
187
+
188
+ ---
189
+
190
+ ## Comentário no card — Conclusão
191
+
192
+ Pular se `TASK_MANAGER` estiver vazio (freelance).
193
+
194
+ Após validação do plano com o usuário, registrar conclusão:
195
+
196
+ ```
197
+ /eng-task-comment {TASK_MANAGER_KEY} ✅ [Jarvis] Plano de execução criado e validado - {N} fases definidas. Pronto para implementação.
198
+ ```
199
+
200
+ ## Próximo Passo
201
+
202
+ Após a validação do plano com o humano, informar:
203
+
204
+ > ✅ Plano criado e validado! Pronto para executar o workflow `work` e iniciar a implementação.
205
+
206
+ ---
207
+
208
+ ## Regras Importantes
209
+
210
+ - ⚠️ **Consulte** as regras completas em `$IDE/rules/engineering/eng.plan-rules.md`
211
+ - ⏱️ **Fases de ~1 hora** - Não criar fases maiores
212
+ - 🔄 **Incremental** - Cada fase deve entregar valor testável
213
+ - 🗣️ **Validar** - Sempre confirmar o plano com o humano antes de prosseguir
@@ -0,0 +1,466 @@
1
+ ---
2
+ description: Criação de branch, commit e merge request (MR)
3
+ auto_execution_mode: 3
4
+ agent: "$IDE/agents/engineering/eng.agent.md"
5
+ rules_file: "$IDE/rules/engineering/eng.pr-rules.md"
6
+ template_file: "$IDE/templates/engineering/PR-template.md"
7
+ recommended_model: claude-sonnet-4-20250514
8
+ model_tier: medium
9
+ model_justification: Operações Git e preenchimento de templates são tarefas estruturadas que não requerem raciocínio extremamente complexo
10
+ ---
11
+
12
+ # Pull Request / Merge Request
13
+
14
+ Este comando cria a **branch, commita as alterações e abre um Merge Request**.
15
+
16
+ > 📋 **Rules**: `$IDE/rules/engineering/eng.pr-rules.md`
17
+ > 📤 **Template**: `$IDE/templates/engineering/PR-template.md`
18
+
19
+ ## Skills recomendados
20
+
21
+ - **pr**: siga o playbook do skill para padronizar branch, commits e MR.
22
+ - Arquivo: `$IDE/skills/eng-pr/SKILL.md`
23
+ - **eng-qa-test-plan**: se precisar validar lacunas de testes antes de abrir o MR.
24
+ - Arquivo: `$IDE/skills/eng-qa-test-plan/SKILL.md`
25
+ - **eng-qa-testsprite**: para executar testes automatizados E2E/API antes de abrir o MR.
26
+ - Arquivo: `$IDE/skills/eng-qa-testsprite/SKILL.md`
27
+ - **eng-qa-e2e**: para validar fluxos de usuário críticos com testes E2E em linguagem natural antes de abrir o MR.
28
+ - Arquivo: `$IDE/skills/eng-qa-e2e/SKILL.md`
29
+ - **eng-docs-write**: se houver necessidade de atualizar documentação junto do PR.
30
+ - Arquivo: `$IDE/skills/eng-docs-write/SKILL.md`
31
+ - **eng-cybersecurity**: se o PR toca em auth, inputs, APIs públicas ou permissões — adicionar label `security` ao MR.
32
+ - Arquivo: `$IDE/skills/eng-cybersecurity/SKILL.md`
33
+
34
+ ## Agentes recomendados (opcional)
35
+
36
+ - **eng.qa.test-planner**: para análise detalhada de cobertura antes do MR.
37
+ - Arquivo: `$IDE/agents/engineering/qa/eng.qa.test-planner.md`
38
+ - Quando usar: Se houver dúvidas sobre cobertura de testes ou mudanças significativas.
39
+
40
+ ---
41
+
42
+ ## Entrada
43
+
44
+ <task_manager_key>
45
+ #$ARGUMENTS
46
+ </task_manager_key>
47
+
48
+ Ler `TASK_MANAGER` do `$IDE/ENV.md`. Seguir `$IDE/rules/engineering/eng.integrations-rules.md`.
49
+
50
+ **Se não receber argumentos**, perguntar e **aguardar**:
51
+
52
+ - `TASK_MANAGER` vazio → *Qual o seu número de controle para esta tarefa? (ex: F-042)*
53
+ - `TASK_MANAGER` preenchido → *Qual o id do card no {TASK_MANAGER}?*
54
+
55
+ > A branch de destino **padrão é `dev`** (GitFlow). Só perguntar se o usuário indicar outra branch (ex: hotfix direto para `main`).
56
+ > 💡 A branch de feature já foi criada no `eng.start`. Este workflow apenas faz push e abre o MR.
57
+
58
+ ---
59
+
60
+ ## Fase 0.5: Comentário no card — Início
61
+
62
+ Pular se `TASK_MANAGER` estiver vazio (freelance).
63
+
64
+ Registrar início da criação do MR:
65
+
66
+ ```
67
+ /eng-task-comment {TASK_MANAGER_KEY} 🔀 [Jarvis] Iniciando criação do Merge Request para {TARGET_BRANCH}
68
+ ```
69
+
70
+ > Usa o skill `/eng-task-comment`. Não bloquear se falhar.
71
+
72
+ ---
73
+
74
+ ## Fase 1: Validação Pré-PR
75
+
76
+ ### 1.1 Executar Testes Unitários
77
+
78
+ ```bash
79
+ npm test # ou comando do projeto
80
+ ```
81
+
82
+ ### 1.2 Verificar Lint
83
+
84
+ ```bash
85
+ npm run lint # ou comando do projeto
86
+ ```
87
+
88
+ ### 1.3 Verificar Build
89
+
90
+ ```bash
91
+ npm run build # ou comando do projeto
92
+ ```
93
+
94
+ ### 1.4 Executar Testes Automatizados (Opcional)
95
+
96
+ Se o projeto estiver rodando localmente, execute o skill **eng-qa-testsprite** para validação completa:
97
+
98
+ ```
99
+ /eng-qa-testsprite diff
100
+ ```
101
+
102
+ Isso irá:
103
+
104
+ - Gerar plano de testes para as mudanças recentes (diff)
105
+ - Executar testes E2E (frontend) ou API (backend)
106
+ - Gerar relatório em `testsprite_tests/`
107
+
108
+ > **Observação**: o comportamento exato de "diff" pode variar (staged vs uncommitted). Se necessário, valide com o usuário qual estado do Git deve ser considerado antes de executar.
109
+
110
+ > **Nota**: Este passo é opcional mas recomendado para mudanças significativas.
111
+
112
+ **Se qualquer validação falhar:**
113
+ → Corrigir os problemas antes de prosseguir
114
+ → Informar o usuário sobre os erros
115
+
116
+ ---
117
+
118
+ ## Fase 2: Verificar Branch
119
+
120
+ > 🌿 **GitFlow**: a branch foi criada no `eng.start` e os commits foram feitos pelo `eng.work`.
121
+ > Esta fase apenas verifica que estamos na branch correta antes do push.
122
+
123
+ ### 2.1 Verificar Branch Ativa
124
+
125
+ A branch de feature foi criada no `eng.start`. Verificar:
126
+
127
+ ```bash
128
+ git branch --show-current
129
+ ```
130
+
131
+ A branch deve seguir o padrão `{TASK_MANAGER_KEY}-{titulo-em-kebab-case}`.
132
+
133
+ **Cenários:**
134
+
135
+ | Situação | Ação |
136
+ |----------|------|
137
+ | Branch com `{TASK_MANAGER_KEY}` | ✅ Prosseguir |
138
+ | Branch errada / `main` / `develop` | Fazer checkout na branch correta: `git checkout {TASK_MANAGER_KEY}-{titulo-kebab}` |
139
+
140
+ ### 2.2 Confirmar Branch de Destino
141
+
142
+ Branch de destino padrão: **`dev`** (GitFlow).
143
+
144
+ > ⚠️ **Nunca fazer push direto para `main` ou `master`** sem confirmação explícita do usuário.
145
+
146
+ ---
147
+
148
+ **Se não estiver na branch correta:**
149
+
150
+ ```bash
151
+ git checkout {TASK_MANAGER_KEY}-{titulo-em-kebab-case}
152
+ ```
153
+
154
+ ### 2.2 Verificar Commits da Branch
155
+
156
+ ```bash
157
+ git log dev..HEAD --oneline
158
+ ```
159
+
160
+ Deve listar os commits das fases implementadas no `eng.work`.
161
+
162
+ **Se houver mudanças não commitadas** (ex: ajuste manual fora do `eng.work`):
163
+
164
+ ```bash
165
+ # Adicionar arquivos individualmente (NUNCA git add .)
166
+ git add {arquivo1} {arquivo2}
167
+ git commit -m "{TASK_MANAGER_KEY} chore: ajustes pré-PR
168
+
169
+ Refs: {TASK_MANAGER_KEY}"
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Fase 3: Push
175
+
176
+ ### 3.1 Enviar para Remote
177
+
178
+ ```bash
179
+ git push -u origin {NOME_DA_BRANCH}
180
+ ```
181
+
182
+ **Verificar push:**
183
+
184
+ ```bash
185
+ git log --oneline -3
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Fase 4: Criar Merge Request / Pull Request
191
+
192
+ Ler `VERSION_CONTROL` do `$IDE/ENV.md` (`gitlab` | `github` | `bitbucket`).
193
+ Use **MR** se GitLab, **PR** se GitHub/Bitbucket.
194
+
195
+ ### 4.1 Preparar descrição
196
+
197
+ Template, nesta ordem (o primeiro que existir):
198
+
199
+ ```bash
200
+ cat $IDE/.gitlab/merge_request_templates/default.md 2>/dev/null \
201
+ || cat .github/PULL_REQUEST_TEMPLATE.md 2>/dev/null \
202
+ || cat pull_request_template.md 2>/dev/null \
203
+ || cat $IDE/templates/engineering/PR-template.md
204
+ ```
205
+
206
+ Preencher com a tarefa. Link do card:
207
+
208
+ | TASK_MANAGER | URL |
209
+ |--------------|-----|
210
+ | jira | `{TASK_MANAGER_URL_BASE}/browse/{TASK_MANAGER_KEY}` |
211
+ | linear | `{TASK_MANAGER_URL_BASE}/issue/{TASK_MANAGER_KEY}` |
212
+ | github | `{TASK_MANAGER_URL_BASE}/issues/{TASK_MANAGER_KEY}` |
213
+ | asana | `{TASK_MANAGER_URL_BASE}/0/0/{TASK_MANAGER_KEY}` |
214
+
215
+ `{TASK_MANAGER_KEY}` = `{TASK_MANAGER_KEY}`.
216
+
217
+ > ⚠️ Não mencione AI, Claude ou assistentes no MR/PR.
218
+
219
+ ### 4.2 Criar MR/PR via adapter
220
+
221
+ - **Título**: `{TASK_MANAGER_KEY}: {Título da tarefa}`
222
+ - **Branch origem**: `{NOME_DA_BRANCH}`
223
+ - **Branch destino**: a informada pelo usuário (`dev` / `main` / hotfix)
224
+ - **Descrição**: template preenchido, gravado em arquivo temporário
225
+
226
+ ```bash
227
+ BODY_FILE=$(mktemp)
228
+ # gravar a descrição preenchida em $BODY_FILE
229
+
230
+ node bin/lib/vcs/create-merge.js \
231
+ --source "${NOME_DA_BRANCH}" \
232
+ --target "${TARGET_BRANCH}" \
233
+ --title "${TASK_MANAGER_KEY}: ${TITULO_DA_TAREFA}" \
234
+ --body-file "$BODY_FILE"
235
+
236
+ rm -f "$BODY_FILE"
237
+ ```
238
+
239
+ O adapter lê `git remote get-url origin` e `VERSION_CONTROL` / hostname (GitLab, GitHub, Bitbucket). Token: `.npmrc` (GitLab), `gh auth` / `GITHUB_TOKEN` (GitHub), `BITBUCKET_TOKEN` (Bitbucket).
240
+
241
+ Se o script não estiver no repo alvo, usar o path do clone do framework Jarvis.
242
+
243
+ **Erros comuns:**
244
+
245
+ | Código | Causa | Solução |
246
+ |--------|-------|---------|
247
+ | `401 Unauthorized` | PAT ausente ou sem scope `api` | Gerar novo PAT com scope `api` em `~/.npmrc` |
248
+ | `404 Not Found` | Namespace desatualizado no remote | `git remote set-url origin <nova-url>` |
249
+ | `422` | Branch origem não existe no remote | Verificar se o push (Fase 3) foi executado |
250
+
251
+ ---
252
+
253
+ ## Fase 5: Comentário no card — Conclusão
254
+
255
+ Pular se `TASK_MANAGER` estiver vazio (freelance).
256
+
257
+ Após MR criado com sucesso, registrar:
258
+
259
+ ```
260
+ /eng-task-comment {TASK_MANAGER_KEY} ✅ [Jarvis] MR criado: {TITULO_DO_MR} → {TARGET_BRANCH} | Link: {LINK_DO_MR}
261
+ ```
262
+
263
+ ---
264
+
265
+ ## Fase 6: Atualizar Board
266
+
267
+ Pular se `TASK_MANAGER` estiver vazio (freelance).
268
+
269
+ > Consultar `$IDE/rules/engineering/eng.downstream-flow-rules.md` para regras completas de transição.
270
+
271
+ ### 6.1 Mover Card
272
+
273
+ De acordo com o fluxo downstream, após abertura do MR o **DEV** (`JUNIOR` / `PLENO` / `SENIOR` / `SPECIALIST`) move o card para **"Review de código"**.
274
+
275
+ > O próximo passo (**Pronto para QA**) é responsabilidade do **TECH LEAD**, após merge ou revisão do MR.
276
+
277
+ ### 6.2 Adicionar Comentário
278
+
279
+ Adicione um comentário no card com o link do MR:
280
+
281
+ ```
282
+ MR aberto: {LINK_DO_MR}
283
+ Branch: {NOME_DA_BRANCH}
284
+ ```
285
+
286
+ ---
287
+
288
+ ## Fase 6: Processar Code Review
289
+
290
+ ### 7.1 Aguardar Comentários
291
+
292
+ Aguarde 3-5 minutos para a ferramenta de code review processar.
293
+
294
+ ### 7.2 Analisar Comentários
295
+
296
+ Para cada comentário:
297
+
298
+ 1. Avaliar se requer correção
299
+ 2. Avaliar se pode ser explicado/ignorado
300
+ 3. Apresentar ao usuário
301
+
302
+ ### 7.3 Aplicar Correções
303
+
304
+ Se necessário:
305
+
306
+ ```bash
307
+ # Fazer mudanças
308
+ git add {arquivos_alterados}
309
+ git commit -m "fix: corrigir {problema} conforme code review"
310
+ git push
311
+ ```
312
+
313
+ ---
314
+
315
+ ## Fase 7: Conclusão
316
+
317
+ ### 8.1 Registrar Métricas de Lead Time
318
+
319
+ Calcule e registre o lead time (tempo desde eng.start até PR criado):
320
+
321
+ ```bash
322
+ # Calcular lead time se .timestamp_start existir
323
+ if [ -f $SESSIONS_DIR/eng/{TASK_MANAGER_KEY}/.timestamp_start ]; then
324
+ START_TIME=$(cat $SESSIONS_DIR/eng/{TASK_MANAGER_KEY}/.timestamp_start)
325
+ END_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
326
+
327
+ # Calcular diferença em minutos (macOS/Linux compatível)
328
+ if [[ "$OSTYPE" == "darwin"* ]]; then
329
+ # macOS
330
+ START_EPOCH=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$START_TIME" +%s 2>/dev/null || echo 0)
331
+ END_EPOCH=$(date +%s)
332
+ else
333
+ # Linux
334
+ START_EPOCH=$(date -d "$START_TIME" +%s 2>/dev/null || echo 0)
335
+ END_EPOCH=$(date +%s)
336
+ fi
337
+
338
+ LEAD_TIME_MINUTOS=$(( (END_EPOCH - START_EPOCH) / 60 ))
339
+ LEAD_TIME_HORAS=$(awk "BEGIN {printf \"%.1f\", $LEAD_TIME_MINUTOS/60}")
340
+
341
+ echo "$LEAD_TIME_MINUTOS" > $SESSIONS_DIR/eng/{TASK_MANAGER_KEY}/.lead_time_minutes
342
+
343
+ LEAD_TIME_MSG="⏱️ Lead time: $LEAD_TIME_HORAS horas ($LEAD_TIME_MINUTOS minutos)"
344
+ else
345
+ LEAD_TIME_MSG="⏱️ Lead time: não calculado (timestamp inicial ausente)"
346
+ fi
347
+ ```
348
+
349
+ ### 8.2 Mensagem Final
350
+
351
+ ```
352
+ ✅ MERGE REQUEST CRIADO COM SUCESSO!
353
+
354
+ 📋 Resumo:
355
+ - Branch: {NOME_DA_BRANCH}
356
+ - MR: {LINK_DO_MR}
357
+ - Jira: {TASK_MANAGER_KEY} → "In Review"
358
+
359
+ 📊 Validações:
360
+ - Testes: ✅ Passando
361
+ - Lint: ✅ OK
362
+ - Build: ✅ OK
363
+
364
+ {LEAD_TIME_MSG}
365
+
366
+ 📌 Próximos passos:
367
+ 1. Aguardar revisão do time
368
+ 2. Processar comentários do code review
369
+ 3. Merge após aprovação
370
+
371
+ 🔗 Links:
372
+ - MR: {LINK_DO_MR}
373
+ - Jira: {TASK_MANAGER_URL_BASE}/browse/{TASK_MANAGER_KEY}
374
+ ```
375
+
376
+ ## Fase 8: Limpeza da Sessão
377
+
378
+ ### 9.1 Solicitar Confirmação
379
+
380
+ Após o MR ser criado com sucesso, **solicitar confirmação do usuário**:
381
+
382
+ ```
383
+ 🧹 Deseja limpar a sessão?
384
+
385
+ A pasta $SESSIONS_DIR/eng/{TASK_MANAGER_KEY}/ será removida.
386
+ A documentação permanece no Jira e no MR.
387
+
388
+ Confirmar? (s/n)
389
+ ```
390
+
391
+ > ⚠️ **IMPORTANTE**: Sempre pedir confirmação antes de executar comandos destrutivos.
392
+
393
+ ### 9.2 Remover Pasta da Sessão
394
+
395
+ Se confirmado:
396
+
397
+ ```bash
398
+ rm -rf $SESSIONS_DIR/eng/{TASK_MANAGER_KEY}/
399
+ ```
400
+
401
+ **Exemplo:**
402
+
403
+ ```bash
404
+ rm -rf $SESSIONS_DIR/eng/task-123/
405
+ ```
406
+
407
+ ### 9.3 Confirmar Limpeza
408
+
409
+ ```
410
+ 🧹 SESSÃO LIMPA!
411
+
412
+ 📁 Removido: $SESSIONS_DIR/eng/{TASK_MANAGER_KEY}/
413
+ - architecture.md ✅
414
+ - plan.md ✅
415
+ - context.md ✅ (se existia)
416
+
417
+ ℹ️ A documentação permanece no:
418
+ - Card do Jira: {TASK_MANAGER_KEY}
419
+ - Merge Request: {LINK_DO_MR}
420
+ ```
421
+
422
+ > ⚠️ **NOTA**: A documentação não é perdida! Ela está anexada no Jira e registrada no MR.
423
+
424
+ ---
425
+
426
+ ## Regras Importantes
427
+
428
+ ### ⛔ NÃO FAÇA
429
+
430
+ - ❌ `git add .` (adiciona arquivos indesejados)
431
+ - ❌ Push direto para `main`/`master`
432
+ - ❌ Commit sem referenciar TASK_MANAGER_KEY
433
+ - ❌ Branch sem padrão de nomenclatura
434
+ - ❌ Mencionar AI/Claude no MR
435
+
436
+ ### ✅ FAÇA SEMPRE
437
+
438
+ - ✅ Validar testes antes do commit
439
+ - ✅ Adicionar arquivos específicos
440
+ - ✅ Usar mensagem de commit padronizada
441
+ - ✅ Criar branch no padrão `{TASK_MANAGER_KEY}-{titulo}`
442
+ - ✅ Preencher template do MR completamente
443
+ - ✅ Mover card para "In Review"
444
+ - ✅ **Limpar sessão após criar MR** (`rm -rf $SESSIONS_DIR/eng/{TASK_MANAGER_KEY}/`)
445
+
446
+ ---
447
+
448
+ ## Tratamento de Erros
449
+
450
+ ### Se os testes falharem:
451
+
452
+ → Listar testes que falharam
453
+ → Sugerir correções
454
+ → NÃO prosseguir com o PR
455
+
456
+ ### Se já existir uma branch com o mesmo nome:
457
+
458
+ → Verificar se é a branch correta
459
+ → Se sim, fazer checkout nela
460
+ → Se não, perguntar ao usuário
461
+
462
+ ### Se o push falhar:
463
+
464
+ → Verificar se há conflitos
465
+ → Resolver conflitos se necessário
466
+ → Tentar push novamente