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,423 @@
1
+ ---
2
+ name: docs-central
3
+ description: Integração com repositório centralizado de documentação (GitLab, GitHub ou Bitbucket). Busca e publica PRDs, FRDs, ARDs e RFCs via API do vendor.
4
+ argument-hint: "[contexto da tarefa]"
5
+ allowed-tools: Bash Read Write
6
+ disable-model-invocation: false
7
+ license: AGPL-3.0
8
+ metadata:
9
+ author: jarvis-team
10
+ version: "3.0"
11
+ ---
12
+
13
+ # docs-central
14
+
15
+ ## Objetivo
16
+
17
+ Integrar o framework com o repositório `central-docs` (`CENTRAL_DOCS_REPO`), permitindo:
18
+ - Buscar docs relevantes automaticamente durante workflows
19
+ - Publicar docs aprovados via MR com git flow seguro
20
+ - Sincronização automática em /warm-up
21
+
22
+ ## Fonte de Verdade
23
+
24
+ > **Antes de qualquer operação**, leia `$CENTRAL_DOCS_REPO/AGENTS.md`.
25
+ > Ele define o contrato completo do repositório: estrutura, naming, frontmatter e regras de índice.
26
+ > Este skill implementa esse contrato — não o duplica.
27
+
28
+ ## Pré-condição
29
+
30
+ Ler do `$IDE/ENV.md`:
31
+ - `CENTRAL_DOCS_REPO` — URL do repo (GitLab, GitHub ou Bitbucket; se vazio: encerrar silenciosamente)
32
+ - `CENTRAL_DOCS_REF` — branch para leitura (padrão: `main`)
33
+ - `VERSION_CONTROL` — fallback se o hostname da URL não identificar o vendor
34
+ - `SQUAD` — squad do usuário (formato: ALL-CAPS-COM-HIFEN)
35
+ - `WORKSPACE` — nome do workspace em kebab-case
36
+ - `AREA` — define quais tipos de doc buscar
37
+ - `POSITION` — cargo do usuário; se `TECH ANALYST`, ativa busca cross-squad no Modo 1
38
+
39
+ **Token VCS** (resolvido pelo adapter `bin/lib/utils/npmrc-parser.js` → `getVcsToken`):
40
+ - GitLab: `.npmrc` `:_authToken=` ou `GITLAB_TOKEN`
41
+ - GitHub: `gh auth token`, `GITHUB_TOKEN` ou `.npmrc` npm.pkg.github.com
42
+ - Bitbucket: `BITBUCKET_TOKEN`
43
+
44
+ ❌ **NUNCA** colar o token no chat.
45
+
46
+ Se `CENTRAL_DOCS_REPO` não estiver definido, encerrar silenciosamente sem erro.
47
+
48
+ ---
49
+
50
+ ## Convenções do central-docs (resumo operacional)
51
+
52
+ ### Estrutura de pastas
53
+
54
+ ```
55
+ {SQUAD}/
56
+ ├── index.md # GERADO — não editar à mão
57
+ ├── product/
58
+ │ └── {produto-em-kebab}/
59
+ │ ├── prd-{id}-{nome}.md
60
+ │ ├── frd-{id}-{nome}.md
61
+ │ ├── feat-{id}-{nome}.md
62
+ │ ├── epic-{id}-{nome}.md
63
+ │ ├── story-{id}-{nome}.md
64
+ │ └── task-{id}-{nome}.md
65
+ ├── engineering/
66
+ │ └── {produto-em-kebab}/
67
+ │ ├── ard-{id}-{nome}.md
68
+ │ └── rfc-{id}-{nome}.md
69
+ └── context/ # opcional — só nasce com conteúdo
70
+ ├── CLAUDE.md
71
+ └── (pesquisas, dados, assets — formato livre)
72
+ ```
73
+
74
+ **Squads válidos** (pastas raiz ALL-CAPS): detectados dinamicamente pelo script.
75
+ Fonte de verdade: `taxonomy.md` na raiz do repo.
76
+
77
+ ### Naming de arquivos
78
+
79
+ ```
80
+ {tipo}-{id}-{nome-em-kebab}.md
81
+ ```
82
+
83
+ Exemplos: `prd-001-minha-feature.md`, `ard-001-minha-api.md`, `story-TASK-4-meu-exemplo.md`
84
+
85
+ - Tipo sempre **lowercase**: `prd-`, `frd-`, `feat-`, `epic-`, `story-`, `task-`, `ard-`, `rfc-` , `swagger-`
86
+ - Pasta de produto: `kebab-case`, um produto = uma pasta
87
+
88
+ ### Frontmatter obrigatório
89
+
90
+ | Campo | PRD | FRD/FEAT/STORY | EPIC | TASK | ARD/RFC |
91
+ |-------|-----|----------------|------|------|---------|
92
+ | `id` | ✓ | ✓ | ✓ | ✓ | ✓ |
93
+ | `name` | ✓ | ✓ | ✓ | ✓ | ✓ |
94
+ | `version` | ✓ | ✓ | ✓ | ✓ | ✓ |
95
+ | `status` | ✓ | ✓ | ✓ | ✓ | ✓ |
96
+ | `created` / `updated` | ✓ | ✓ | ✓ | ✓ | ✓ |
97
+ | `created_by` / `last_editor` | ✓ | ✓ | ✓ | ✓ | ✓ |
98
+ | `related_prd` | – | ✓ | ✓ | – | – |
99
+ | `related_epic` | – | – | – | ✓ | – |
100
+
101
+ **Status válidos:** `draft`, `in_review`, `planejado`, `in_progress`, `in_production`, `icebox`, `deprecated`
102
+
103
+ **Campos `related_*`:** sempre apenas o **basename** do arquivo, sem path nem `./`.
104
+ ```yaml
105
+ # ✅ Certo
106
+ related_prd: prd-001-minha-feature.md
107
+
108
+ # ❌ Errado
109
+ related_prd: ./prd-001-minha-feature.md
110
+ related_prd: ../minha-feature/prd-001-minha-feature.md
111
+ ```
112
+
113
+ ### Índices — regra crítica
114
+
115
+ O arquivo `{SQUAD}/index.md` é **gerado pelo script** `scripts/build-index.sh`. **Nunca editar à mão.**
116
+
117
+ ```bash
118
+ # Sempre rodar após qualquer add/move/remove de spec
119
+ bash scripts/build-index.sh
120
+ ```
121
+
122
+ O script detecta squads dinamicamente (pastas raiz ALL-CAPS) e gera um único `index.md` por squad lendo o frontmatter de todos os specs em `product/` e `engineering/`, e listando o conteúdo de `context/`.
123
+
124
+ O CI (`.gitlab-ci.yml`) **falha** se o `index.md` commitado divergir do que o script geraria.
125
+
126
+ ---
127
+
128
+ ## Quando Usar
129
+
130
+ - `/warm-up` — carregar contexto do produto (Modo 1; aciona Modo 3 se índice ausente)
131
+ - `/eng.start` — buscar PRD/ARD antes de iniciar feature (Modo 1)
132
+ - `/eng.create-ard` — buscar PRD relacionado (Modo 1)
133
+ - `/eng.pre-pr` — detectar docs desatualizados (Modo 1)
134
+ - Publicação de doc aprovado (Modo 2)
135
+ - Reparo de índices inconsistentes ou ausentes (Modo 3)
136
+
137
+ ---
138
+
139
+ ## Fluxo de Trabalho
140
+
141
+ ### Modo 1: Buscar Docs (usado em warm-up, eng.start)
142
+
143
+ **Passo 0 — Detectar escopo**
144
+
145
+ > Se `POSITION=TECH ANALYST`: executar fluxo multi-squad abaixo e encerrar o Modo 1.
146
+ > Caso contrário, prosseguir para o Passo 1 normalmente.
147
+
148
+ **Modo 1-TA: Busca cross-squad (somente TECH ANALYST)**
149
+
150
+ O TA é transversal e precisa dos índices de todos os squads para triagem e diagnóstico de chamados.
151
+
152
+ ```bash
153
+ # Squads: headings ### do taxonomy.md (fonte de verdade da org)
154
+ SQUADS=$(awk '/^## .*Squads/{f=1;next} /^## /{f=0} f && /^### /{print $2}' taxonomy.md)
155
+
156
+ for SQUAD_NAME in ${SQUADS}; do
157
+ bash bin/lib/docs/fetch-file.sh "${SQUAD_NAME}/index.md" "${CENTRAL_DOCS_REF}" 2>/dev/null || true
158
+ done
159
+ ```
160
+
161
+ > Buscar apenas índices — não baixar arquivos individuais de todos os squads (volume alto).
162
+ > Quando o chamado exigir deep dive em um produto específico, buscar os arquivos daquele squad normalmente via Passo 3.
163
+
164
+ **Output para TECH ANALYST:**
165
+
166
+ ```markdown
167
+ # Contexto Cross-Squad — Central Docs
168
+
169
+ ## SQUAD-A
170
+ [índice do squad A]
171
+
172
+ ## SQUAD-B
173
+ [índice do squad B]
174
+
175
+ ...
176
+ ```
177
+
178
+ ---
179
+
180
+ **Passo 1 — Buscar índice do squad**
181
+
182
+ ```bash
183
+ jarvis docs sync
184
+
185
+ # Internamente executa:
186
+ bash bin/lib/docs/fetch-file.sh "${SQUAD}/index.md" "${CENTRAL_DOCS_REF}"
187
+ ```
188
+
189
+ **Passo 1.b — Fallback: navegar árvore (quando index.md não existe)**
190
+
191
+ Se `jarvis docs sync` retornar exit code 2 (arquivo não encontrado):
192
+
193
+ ```bash
194
+ # Fallback: clonar o CENTRAL_DOCS_REPO e listar arquivos locais
195
+ # (funciona igual em GitLab, GitHub e Bitbucket)
196
+ git ls-tree -r --name-only "${CENTRAL_DOCS_REF}" -- "${SQUAD}/product/${WORKSPACE}" "${SQUAD}/engineering/${WORKSPACE}"
197
+ ```
198
+
199
+ **Identificar docs por caminho (naming padrão):**
200
+ - `engineering/{produto}/ard-*.md` → ARD
201
+ - `engineering/{produto}/rfc-*.md` → RFC
202
+ - `product/{produto}/prd-*.md` → PRD
203
+ - `product/{produto}/frd-*.md` → FRD
204
+ - `product/{produto}/feat-*.md` → FEAT
205
+ - `product/{produto}/story-*.md` → STORY
206
+ - `context/` → artefatos de contexto (pesquisas, dados, assets)
207
+
208
+ **Passo 2 — Identificar docs relevantes**
209
+
210
+ Com base no contexto da tarefa (`TASK_MANAGER_KEY`, tags, descrição):
211
+ - Buscar no `index.md` por `TASK_MANAGER_KEY` matching
212
+ - Se não encontrar, buscar por tags semânticas
213
+ - Filtrar por AREA:
214
+ - `PRODUCT` → PRDs e FRDs
215
+ - `ENGINEERING` → PRD (contexto) + ARDs + RFCs
216
+
217
+ **Passo 3 — Buscar arquivos identificados**
218
+
219
+ ```bash
220
+ bash bin/lib/docs/fetch-file.sh "${SQUAD}/product/${WORKSPACE}/prd-feature.md" "main"
221
+ bash bin/lib/docs/fetch-file.sh "${SQUAD}/engineering/${WORKSPACE}/ard-feature.md" "main"
222
+ ```
223
+
224
+ **Passo 4 — Retornar resultado**
225
+
226
+ ```markdown
227
+ # Contexto Carregado do Central Docs
228
+
229
+ ## Squad: MEU-SQUAD / Produto: meu-produto
230
+
231
+ ### PRD-001: Minha Feature (v1.2.0)
232
+ [conteúdo do PRD]
233
+
234
+ ### ARD-001: Arquitetura da Minha Feature (v1.5)
235
+ [conteúdo do ARD]
236
+ ```
237
+
238
+ ---
239
+
240
+ ### Modo 2: Publicar Doc
241
+
242
+ **Uso:**
243
+
244
+ ```bash
245
+ jarvis docs publish \
246
+ --file ./docs/engineering/ard-001-minha-feature.md \
247
+ --squad MEU-SQUAD \
248
+ --produto meu-produto \
249
+ --tipo ard
250
+ ```
251
+
252
+ **Fluxo interno:**
253
+
254
+ 1. Validar frontmatter YAML (campos obrigatórios conforme tabela acima)
255
+ 2. Validar naming do arquivo (`{tipo}-{id}-{nome-em-kebab}.md`)
256
+ 3. Validar que `related_*` usam apenas basename
257
+ 4. Determinar destino: `{SQUAD}/engineering/{produto}/` ou `{SQUAD}/product/{produto}/`
258
+ 5. Criar branch `docs/{SQUAD}/{area}/{produto}/{tipo}-{id}-{nome}`
259
+ 6. Commit via API do vendor (GitLab / GitHub / Bitbucket) com o doc
260
+ 7. Rodar `bash scripts/build-index.sh` localmente no clone e incluir o `{SQUAD}/index.md` atualizado no mesmo commit atômico
261
+ 8. Criar MR → main
262
+ 9. Retornar URL do MR
263
+
264
+ **Commit atômico (doc + index):**
265
+
266
+ ```
267
+ actions:
268
+ - { action: "create_or_update", file_path: "{SQUAD}/engineering/{produto}/ard-001-feature.md", content: "..." }
269
+ - { action: "create_or_update", file_path: "{SQUAD}/index.md", content: "..." }
270
+ ```
271
+
272
+ > Usar `POST /repository/commits` com array `actions`.
273
+ > O `index.md` é o output de `build-index.sh` — nunca construído manualmente.
274
+
275
+ **Output:**
276
+
277
+ ```
278
+ ✅ MR criado: docs/MEU-SQUAD/engineering/meu-produto/ard-001-minha-feature → main
279
+ URL: {url do MR/PR retornada pelo adapter}
280
+ ```
281
+
282
+ ---
283
+
284
+ ### Modo 3: Reparar Índices
285
+
286
+ > Detecta `{SQUAD}/index.md` ausente ou divergente e abre MR de reparo.
287
+
288
+ **Quando ativar:**
289
+
290
+ - Durante Modo 1, se o fallback de árvore encontrar docs que não aparecem no `index.md`
291
+ - Durante warm-up, se `index.md` não existir
292
+ - Quando o usuário pedir explicitamente
293
+
294
+ **Fluxo:**
295
+
296
+ ```
297
+ 1. Clonar ou usar clone local de central-docs
298
+ 2. Rodar: bash scripts/build-index.sh
299
+ 3. Comparar output com os index.md commitados (git diff)
300
+ 4. Se há divergência:
301
+ a. Criar branch: repair/index-{SQUAD}-{timestamp}
302
+ b. Commitar os index.md atualizados
303
+ c. Abrir MR → main
304
+ 5. Reportar ao usuário
305
+ ```
306
+
307
+ > O `build-index.sh` detecta squads dinamicamente — não é necessário listar squads manualmente.
308
+
309
+ **Output ao usuário:**
310
+
311
+ ```
312
+ 🔍 Verificando índices do central-docs (MEU-SQUAD)...
313
+
314
+ ⚠️ MEU-SQUAD/index.md divergente — 3 docs ausentes no índice
315
+
316
+ 📋 Abrindo MR de reparo...
317
+ Branch: repair/index-MEU-SQUAD-20260510
318
+ Arquivo: MEU-SQUAD/index.md
319
+
320
+ ✅ MR aberto:
321
+ URL: {CENTRAL_DOCS_REPO}/-/merge_requests/44
322
+ ```
323
+
324
+ ---
325
+
326
+ ## Regras
327
+
328
+ ### Nunca
329
+
330
+ - Publicar doc sem validar frontmatter
331
+ - Push direto para main (sempre via MR)
332
+ - Buscar docs se `CENTRAL_DOCS_REPO` vazio (encerrar silenciosamente)
333
+ - Inventar metadados (version, status, id)
334
+ - Editar `{SQUAD}/index.md` manualmente — sempre via `build-index.sh`
335
+ - Usar path em campos `related_*` — sempre basename apenas
336
+ - Usar formato `squad-driver` — sempre ALL-CAPS-COM-HIFEN: `MEU-SQUAD`
337
+ - Criar subpastas `engineering/index.md` ou `product/index.md` (não existem neste repo)
338
+
339
+ ### Sempre
340
+
341
+ - Ler `$CENTRAL_DOCS_REPO/AGENTS.md` antes de operar
342
+ - Usar GitLab API (não `git archive` ou `git clone` desnecessário)
343
+ - Invalidar cache local (`redis-cli`) ao publicar, se o comando existir
344
+ - Seguir git flow (branch → MR → main)
345
+ - Extrair token do `.npmrc` automaticamente
346
+ - Validar naming do arquivo antes de publicar
347
+ - Incluir `{SQUAD}/index.md` (gerado por `build-index.sh`) em todo commit de publicação
348
+
349
+ ---
350
+
351
+ ## Troubleshooting
352
+
353
+ ### Erro: Token VCS não encontrado
354
+
355
+ GitLab: `.npmrc` `:_authToken=` ou `GITLAB_TOKEN`.
356
+ GitHub: `gh auth login` ou `GITHUB_TOKEN`.
357
+ Bitbucket: `BITBUCKET_TOKEN`.
358
+
359
+ ### Erro: index.md não encontrado (Modo 1)
360
+
361
+ ```
362
+ ❌ Arquivo não encontrado: MEU-SQUAD/index.md
363
+ ```
364
+
365
+ **Causa:** Squad ainda sem docs publicados. Índice só existe após o primeiro `publish`.
366
+
367
+ **Solução:** Publicar ao menos um doc via `jarvis docs publish`. O MR já incluirá o `index.md`.
368
+
369
+ ### Erro: Frontmatter inválido
370
+
371
+ ```
372
+ ❌ Campos obrigatórios ausentes: name, version, created_by
373
+ ```
374
+
375
+ **Solução:** Adicionar campos conforme tabela de frontmatter obrigatório acima.
376
+
377
+ ### Erro: Naming inválido
378
+
379
+ ```
380
+ ❌ Nome do arquivo não segue o padrão: {tipo}-{id}-{nome-em-kebab}.md
381
+ Recebido: ARD-001-MinhaFeature.md
382
+ Esperado: ard-001-minha-feature.md
383
+ ```
384
+
385
+ **Solução:** Renomear o arquivo seguindo o padrão lowercase com hífens.
386
+
387
+ ### CI falha com "Índices stale"
388
+
389
+ ```
390
+ ❌ Índices stale. Rode 'bash scripts/build-index.sh' localmente,
391
+ commita o resultado e empurre de novo.
392
+ ```
393
+
394
+ **Solução:** O `{SQUAD}/index.md` no commit diverge do que o script geraria. Sempre incluir o output de `build-index.sh` no mesmo commit do doc.
395
+
396
+ ---
397
+
398
+ ## Integração com Workflows
399
+
400
+ ### /warm-up
401
+
402
+ ```markdown
403
+ Se CENTRAL_DOCS_REPO configurado:
404
+ 1. jarvis docs sync
405
+ 2. Exibir resumo de docs disponíveis do squad/produto
406
+ ```
407
+
408
+ ### /eng.start
409
+
410
+ ```markdown
411
+ Se CENTRAL_DOCS_REPO definido:
412
+ - Buscar docs relacionados ao `TASK_MANAGER_KEY` no index.md do squad
413
+ - Carregar PRD + ARDs relevantes antes de criar architecture.md
414
+ ```
415
+
416
+ ### /eng.pre-pr
417
+
418
+ ```markdown
419
+ 1. Detectar mudanças arquiteturais no diff
420
+ 2. Verificar se ARD local existe e está atualizado vs central-docs
421
+ 3. Se desatualizado ou novo: perguntar "Publicar no central-docs?"
422
+ 4. Se sim: jarvis docs publish
423
+ ```