jarvis-ai-framework 2.1.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +14 -115
- package/agents/AGENTS.md +11 -23
- package/agents/README.md +25 -129
- package/agents/engineering/data/eng.data-engineer.agent.md +11 -34
- package/agents/engineering/eng.agent.md +14 -24
- package/agents/engineering/eng.bug-hunter.md +7 -15
- package/agents/engineering/eng.dev-code-reviewer.md +1 -1
- package/agents/engineering/eng.frontend.agent.md +3 -7
- package/agents/engineering/eng.rpa.agent.md +2 -8
- package/agents/engineering/qa/eng.qa.quality-strategist.md +6 -11
- package/agents/engineering/qa/eng.qa.test-architect.md +8 -18
- package/agents/engineering/qa/eng.qa.test-planner.md +10 -14
- package/agents/engineering/qa/eng.qa.testing-engineer.md +91 -24
- package/agents/product/prod.discovery-interviewer.md +3 -3
- 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 +20 -5
- package/bin/commands/qa-signoff.js +58 -55
- package/bin/commands/tokens.js +14 -17
- package/bin/commands/whoami.js +30 -26
- package/bin/jarvis.js +9 -163
- 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 +59 -2
- package/bin/lib/config/ide-config.js +4 -8
- package/bin/lib/core/profile-filter.js +4 -1
- package/bin/lib/core/scanner.js +3 -29
- package/bin/lib/core/sync-engine.js +21 -14
- package/bin/lib/core/token-report.js +12 -2
- 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/parse.js +11 -5
- package/bin/lib/flow-map/render.js +5 -2
- package/bin/lib/flow-map/tree.js +59 -10
- 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/package.json +14 -5
- package/rules/engineering/eng-rules.md +1 -1
- package/rules/engineering/eng-security-rules.md +18 -16
- 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 -3
- package/rules/engineering/eng.skills-rules.md +1 -1
- package/rules/engineering/eng.specializations-rules.md +18 -4
- 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/skills/AGENTS.md +52 -87
- package/skills/SKILLS-ROADMAP.md +47 -128
- 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-nestjs/SKILL.md +1 -1
- 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 +12 -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-task-comment/SKILL.md +2 -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 +1 -1
- package/skills/jarvis-context-detect/assets/context-profile-template.md +1 -1
- package/skills/jarvis-create-specialization/SKILL.md +8 -0
- package/skills/jarvis-docs-central/README.md +31 -28
- package/skills/jarvis-docs-central/SKILL.md +5 -5
- package/skills/jarvis-init/SKILL.md +8 -8
- package/skills/jarvis-init/assets/passo-adicionar-stacks.md +47 -18
- package/skills/jarvis-list-specializations/SKILL.md +30 -17
- package/skills/jarvis-report-issue/SKILL.md +1 -1
- package/taxonomy.md +4 -16
- package/templates/ENV-template.md +10 -2
- package/templates/engineering/qa/qa.sprint-plan-template.md +1 -1
- package/workflows/AGENTS.md +3 -1
- package/workflows/README.md +0 -10
- package/workflows/engineering/data/data.new-pipeline.md +6 -5
- package/workflows/engineering/eng.bug-audit.md +4 -14
- package/workflows/engineering/eng.debug.md +4 -20
- package/workflows/engineering/eng.pr.md +10 -28
- package/workflows/engineering/eng.pre-pr.md +11 -19
- package/workflows/engineering/eng.review.md +7 -13
- package/workflows/engineering/eng.rpa.robot.md +3 -9
- package/workflows/engineering/eng.start.md +16 -11
- package/workflows/engineering/eng.work.md +10 -18
- package/workflows/engineering/qa/eng.qa-sprint-planning.md +1 -1
- package/workflows/product/prod.spec.discovery.md +2 -2
- package/workflows/warm-up.md +35 -63
- package/agents/engineering/eng.cybersecurity.agent.md +0 -486
- package/agents/engineering/qa/eng.qa.cypress-specialist.md +0 -112
- package/bin/lib/docs/fetch-file.sh +0 -41
- package/bin/lib/docs/publish-file.sh +0 -284
- 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 -303
- package/skills/eng-data-bi/SKILL.md +0 -206
- package/skills/eng-data-debug/SKILL.md +0 -314
- package/skills/eng-data-engineer/SKILL.md +0 -266
- package/skills/eng-data-onboard/SKILL.md +0 -317
- package/skills/eng-data-orchestrator/SKILL.md +0 -433
- package/skills/eng-devops-performance-engineer/SKILL.md +0 -319
- package/skills/eng-frontend-design-system/SKILL.md +0 -155
- package/skills/eng-frontend-design-system/references/1-estrutura-pacote.md +0 -57
- package/skills/eng-frontend-design-system/references/2-tokens.md +0 -116
- package/skills/eng-frontend-design-system/references/3-componentes.md +0 -165
- package/skills/eng-frontend-design-system/references/4-storybook.md +0 -85
- package/skills/eng-frontend-design-system/references/5-auditoria-versionamento.md +0 -76
- package/skills/eng-frontend-microfrontend/SKILL.md +0 -164
- package/skills/eng-frontend-microfrontend/references/1-criando-remote.md +0 -109
- package/skills/eng-frontend-microfrontend/references/2-configurando-shell.md +0 -70
- package/skills/eng-frontend-microfrontend/references/3-contratos-interface.md +0 -73
- package/skills/eng-frontend-microfrontend/references/4-shared-dependencies.md +0 -48
- package/skills/eng-frontend-microfrontend/references/5-event-bus.md +0 -59
- package/skills/eng-frontend-microfrontend/references/6-monorepo-deploy.md +0 -77
- package/skills/eng-frontend-microfrontend/references/7-troubleshooting.md +0 -45
- package/skills/eng-global-browser-extension-builder/SKILL.md +0 -392
- package/skills/eng-global-jira-comment/SKILL.md +0 -27
- package/skills/eng-qa-a11y-audit/SKILL.md +0 -276
- package/skills/eng-qa-bug-report/SKILL.md +0 -877
- package/skills/eng-qa-bug-report/TASK_MANAGERS.md +0 -138
- package/skills/eng-qa-bug-report/references/1-integracao-task-managers.md +0 -148
- package/skills/eng-qa-bug-report/references/2-exemplos-de-uso.md +0 -46
- package/skills/eng-qa-bug-report/references/3-bug-to-test.md +0 -45
- package/skills/eng-qa-cypress-e2e/SKILL.md +0 -184
- package/skills/eng-qa-dev-guide/SKILL.md +0 -173
- package/skills/eng-qa-e2e/SKILL.md +0 -407
- package/skills/eng-qa-e2e-spec-writer/SKILL.md +0 -329
- package/skills/eng-qa-exploratory/SKILL.md +0 -196
- package/skills/eng-qa-gate/SKILL.md +0 -377
- package/skills/eng-qa-gate/assets/checklist-validacao.md +0 -291
- package/skills/eng-qa-graphql-contract/SKILL.md +0 -263
- package/skills/eng-qa-quality-report/SKILL.md +0 -419
- package/skills/eng-qa-test-plan/SKILL.md +0 -473
- package/skills/eng-qa-testsprite/SKILL.md +0 -332
- package/skills/eng-qa-testsprite/references/testsprite-mcp.md +0 -224
- package/skills/eng-qa-unit-test/SKILL.md +0 -478
- package/skills/eng-scraper/SKILL.md +0 -260
- package/skills/eng-scraper/references/1-puppeteer.md +0 -140
- package/skills/eng-scraper/references/2-playwright-cheerio-pdf.md +0 -82
- package/skills/eng-scraper/references/3-anti-bot.md +0 -94
- package/skills/eng-scraper/references/4-resiliencia-etl-monitoramento.md +0 -137
- package/skills/eng-scraper-robot-builder/SKILL.md +0 -377
- package/skills/eng-security-cybersecurity/SKILL.md +0 -250
- package/skills/eng-security-cybersecurity/references/1-owasp-top-10.md +0 -331
- package/skills/eng-security-cybersecurity/references/2-secrets-management.md +0 -31
- package/skills/eng-security-cybersecurity/references/3-input-validation.md +0 -43
- package/skills/eng-security-cybersecurity/references/4-compliance.md +0 -20
- package/skills/eng-security-patch/SKILL.md +0 -388
- package/skills/eng-security-threat-model/SKILL.md +0 -171
- package/skills/eng-security-triage/SKILL.md +0 -276
- 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 -319
- package/workflows/engineering/eng.security-incident.md +0 -281
- package/workflows/engineering/eng.security-pipeline.md +0 -219
- package/workflows/engineering/eng.security-review.md +0 -241
- package/workflows/engineering/qa/eng.qa-dev-quality-guide.md +0 -57
- package/workflows/engineering/qa/eng.qa-e2e-test-generation.md +0 -57
- package/workflows/engineering/qa/eng.qa-exploratory-session.md +0 -68
- package/workflows/engineering/qa/eng.qa-quality-gate-validation.md +0 -209
- package/workflows/engineering/qa/eng.qa-quality-report.md +0 -85
- /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,18 +1,11 @@
|
|
|
1
|
-
import { loadEnv, resolveEnvPath } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { existsSync } from 'node:fs'
|
|
6
|
-
import { join, dirname } from 'node:path'
|
|
7
|
-
import { fileURLToPath } from 'node:url'
|
|
8
|
-
|
|
9
|
-
const execAsync = promisify(exec)
|
|
10
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
11
|
-
const __dirname = dirname(__filename)
|
|
1
|
+
import { loadEnv, resolveEnvPath } from "../lib/env-loader.js";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { publishFile } from "../lib/docs/publish-file.js";
|
|
4
|
+
import { logger, configureFromFlags } from "../lib/utils/logger.js";
|
|
12
5
|
|
|
13
6
|
/**
|
|
14
7
|
* Publica documento no central-docs via GitLab API (branch + MR)
|
|
15
|
-
*
|
|
8
|
+
*
|
|
16
9
|
* @param {Object} flags - Flags do comando
|
|
17
10
|
* @param {string} flags.file - Caminho do arquivo local
|
|
18
11
|
* @param {string} flags.tipo - Tipo do documento (prd|frd|ard|rfc)
|
|
@@ -22,163 +15,134 @@ const __dirname = dirname(__filename)
|
|
|
22
15
|
* @param {string} flags.envFile - Path customizado do ENV.md
|
|
23
16
|
*/
|
|
24
17
|
export async function docsPublish(flags = {}) {
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
configureFromFlags(flags);
|
|
19
|
+
|
|
20
|
+
const { file, tipo, feature, squad: squadOverride, workspace: workspaceOverride } = flags;
|
|
21
|
+
|
|
27
22
|
// Validar parâmetros obrigatórios
|
|
28
23
|
if (!file || !tipo || !feature) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
24
|
+
logger.error("❌ Parâmetros obrigatórios faltando\n");
|
|
25
|
+
logger.error(
|
|
26
|
+
"Uso: jarvis docs publish --file <path> --tipo <prd|frd|ard|rfc|swagger|qa-report> --feature <slug> [--squad <squad>] [--workspace <workspace>]\n"
|
|
27
|
+
);
|
|
28
|
+
logger.error("Exemplo:");
|
|
29
|
+
logger.error(" jarvis docs publish \\");
|
|
30
|
+
logger.error(" --file ./docs/engineering/ard-api-wallet.md \\");
|
|
31
|
+
logger.error(" --tipo ard \\");
|
|
32
|
+
logger.error(" --feature api-wallet-auth-jwt");
|
|
33
|
+
logger.error("");
|
|
34
|
+
logger.error(" # Publicar Swagger/OpenAPI:");
|
|
35
|
+
logger.error(" jarvis docs publish \\");
|
|
36
|
+
logger.error(" --file ./docs/engineering/swagger/api-wallet.yaml \\");
|
|
37
|
+
logger.error(" --tipo swagger \\");
|
|
38
|
+
logger.error(" --feature api-wallet");
|
|
39
|
+
logger.error("");
|
|
40
|
+
logger.error(" # Com override de squad/workspace:");
|
|
41
|
+
logger.error(" jarvis docs publish \\");
|
|
42
|
+
logger.error(" --file ./docs/engineering/ard-api-wallet.md \\");
|
|
43
|
+
logger.error(" --tipo ard \\");
|
|
44
|
+
logger.error(" --feature api-wallet-auth-jwt \\");
|
|
45
|
+
logger.error(" --squad core \\");
|
|
46
|
+
logger.error(" --workspace meu-workspace");
|
|
47
|
+
process.exit(1);
|
|
51
48
|
}
|
|
52
|
-
|
|
49
|
+
|
|
53
50
|
// Validar tipo
|
|
54
|
-
const validTypes = [
|
|
51
|
+
const validTypes = ["prd", "frd", "ard", "rfc", "swagger", "qa-report"];
|
|
55
52
|
if (!validTypes.includes(tipo)) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
process.exit(1)
|
|
53
|
+
logger.error(`❌ Tipo inválido: ${tipo}`);
|
|
54
|
+
logger.error(`Tipos válidos: ${validTypes.join(", ")}`);
|
|
55
|
+
process.exit(1);
|
|
59
56
|
}
|
|
60
|
-
|
|
57
|
+
|
|
61
58
|
// Validar se arquivo existe
|
|
62
59
|
if (!existsSync(file)) {
|
|
63
|
-
|
|
64
|
-
process.exit(1)
|
|
60
|
+
logger.error(`❌ Arquivo não encontrado: ${file}`);
|
|
61
|
+
process.exit(1);
|
|
65
62
|
}
|
|
66
|
-
|
|
67
|
-
const cwd = process.cwd()
|
|
68
|
-
|
|
63
|
+
|
|
64
|
+
const cwd = process.cwd();
|
|
65
|
+
|
|
69
66
|
// Resolver path do ENV.md (suporta --ide e --env-file)
|
|
70
|
-
let envPath
|
|
67
|
+
let envPath;
|
|
71
68
|
try {
|
|
72
|
-
const resolved = resolveEnvPath(cwd, flags)
|
|
73
|
-
envPath = resolved.path
|
|
69
|
+
const resolved = resolveEnvPath(cwd, flags);
|
|
70
|
+
envPath = resolved.path;
|
|
74
71
|
} catch (error) {
|
|
75
|
-
|
|
76
|
-
process.exit(1)
|
|
72
|
+
logger.error("❌ Erro ao resolver ENV.md:", error.message);
|
|
73
|
+
process.exit(1);
|
|
77
74
|
}
|
|
78
|
-
|
|
75
|
+
|
|
79
76
|
// Carregar ENV.md
|
|
80
|
-
let env
|
|
77
|
+
let env;
|
|
81
78
|
try {
|
|
82
|
-
env = loadEnv(cwd, envPath)
|
|
79
|
+
env = loadEnv(cwd, envPath);
|
|
83
80
|
} catch (error) {
|
|
84
|
-
|
|
85
|
-
process.exit(1)
|
|
81
|
+
logger.error("❌ Erro ao carregar ENV.md:", error.message);
|
|
82
|
+
process.exit(1);
|
|
86
83
|
}
|
|
87
|
-
|
|
84
|
+
|
|
88
85
|
// Verificar se central-docs está configurado
|
|
89
86
|
if (!env.CENTRAL_DOCS_REPO) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
process.exit(1)
|
|
87
|
+
logger.error("❌ CENTRAL_DOCS_REPO não configurado no ENV.md");
|
|
88
|
+
logger.error("\nConfigure a URL do repositório central:");
|
|
89
|
+
logger.error(" CENTRAL_DOCS_REPO=https://gitlab.com/org/central-docs.git");
|
|
90
|
+
process.exit(1);
|
|
94
91
|
}
|
|
95
|
-
|
|
92
|
+
|
|
96
93
|
// Usar override de squad/workspace se fornecido, senão usar do ENV.md
|
|
97
|
-
const squad = squadOverride || env.SQUAD
|
|
98
|
-
const workspace = workspaceOverride || env.WORKSPACE
|
|
99
|
-
|
|
94
|
+
const squad = squadOverride || env.SQUAD;
|
|
95
|
+
const workspace = workspaceOverride || env.WORKSPACE;
|
|
96
|
+
|
|
100
97
|
if (!squad || !workspace) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
process.exit(1)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Verificar se script publish-file.sh existe
|
|
113
|
-
// Usar path relativo ao módulo, não ao cwd do usuário
|
|
114
|
-
const publishScript = join(__dirname, '../lib/docs/publish-file.sh')
|
|
115
|
-
if (!existsSync(publishScript)) {
|
|
116
|
-
console.error('❌ Script não encontrado:', publishScript)
|
|
117
|
-
process.exit(1)
|
|
98
|
+
logger.error("❌ SQUAD ou WORKSPACE não definidos");
|
|
99
|
+
logger.error("\nOpções:");
|
|
100
|
+
logger.error(" 1. Definir no ENV.md:");
|
|
101
|
+
logger.error(" SQUAD=core");
|
|
102
|
+
logger.error(" WORKSPACE=meu-workspace");
|
|
103
|
+
logger.error("");
|
|
104
|
+
logger.error(" 2. Passar via flags:");
|
|
105
|
+
logger.error(" --squad core --workspace meu-workspace");
|
|
106
|
+
process.exit(1);
|
|
118
107
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
108
|
+
|
|
109
|
+
logger.info(`📤 Publicando ${tipo.toUpperCase()} ${feature}...\n`);
|
|
110
|
+
|
|
122
111
|
try {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const { stdout, stderr } = await execAsync(
|
|
134
|
-
`bash "${publishScript}" "${file}" "${tipo}" "${feature}"`,
|
|
135
|
-
{
|
|
136
|
-
env: envVars,
|
|
137
|
-
maxBuffer: 10 * 1024 * 1024 // 10MB buffer para output grande
|
|
138
|
-
}
|
|
139
|
-
)
|
|
140
|
-
|
|
141
|
-
// Exibir output do script
|
|
142
|
-
if (stdout) {
|
|
143
|
-
console.log(stdout)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (stderr) {
|
|
147
|
-
console.warn('⚠️ Avisos:', stderr)
|
|
148
|
-
}
|
|
149
|
-
|
|
112
|
+
await publishFile({
|
|
113
|
+
localFile: file,
|
|
114
|
+
tipo,
|
|
115
|
+
feature,
|
|
116
|
+
squad,
|
|
117
|
+
workspace,
|
|
118
|
+
repo: env.CENTRAL_DOCS_REPO,
|
|
119
|
+
targetBranch: env.CENTRAL_DOCS_TARGET_BRANCH || "dev",
|
|
120
|
+
cacheTtl: env.CENTRAL_DOCS_CACHE_TTL || "3600",
|
|
121
|
+
});
|
|
150
122
|
} catch (error) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (error.stdout) {
|
|
155
|
-
console.log(error.stdout)
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
if (error.stderr) {
|
|
159
|
-
console.error(error.stderr)
|
|
160
|
-
}
|
|
161
|
-
|
|
123
|
+
logger.error("\n❌ Erro ao publicar documento\n");
|
|
124
|
+
logger.error(error.message);
|
|
125
|
+
|
|
162
126
|
// Dicas de troubleshooting
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (error.message.includes(
|
|
166
|
-
|
|
167
|
-
|
|
127
|
+
logger.error("\n💡 Troubleshooting:\n");
|
|
128
|
+
|
|
129
|
+
if (error.message.includes("Token GitLab")) {
|
|
130
|
+
logger.error("1. Configure o token GitLab no .npmrc:");
|
|
131
|
+
logger.error(" //gitlab.com/api/v4/packages/npm/:_authToken=seu-token\n");
|
|
168
132
|
}
|
|
169
|
-
|
|
170
|
-
if (error.message.includes(
|
|
171
|
-
|
|
172
|
-
|
|
133
|
+
|
|
134
|
+
if (error.message.includes("Campos obrigatórios")) {
|
|
135
|
+
logger.error("2. Verifique o frontmatter do documento:");
|
|
136
|
+
logger.error(` Tipo ${tipo} requer campos específicos no YAML\n`);
|
|
173
137
|
}
|
|
174
|
-
|
|
175
|
-
if (error.message.includes(
|
|
176
|
-
|
|
177
|
-
|
|
138
|
+
|
|
139
|
+
if (error.message.includes("401") || error.message.includes("403")) {
|
|
140
|
+
logger.error("4. Verifique permissões no GitLab:");
|
|
141
|
+
logger.error(" Token precisa de scopes: api, read_api, write_repository\n");
|
|
178
142
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
process.exit(1)
|
|
143
|
+
|
|
144
|
+
logger.error("Para mais detalhes, execute com --verbose");
|
|
145
|
+
|
|
146
|
+
process.exit(1);
|
|
183
147
|
}
|
|
184
148
|
}
|
|
@@ -1,139 +1,101 @@
|
|
|
1
|
-
import { loadEnv, resolveEnvPath } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { existsSync } from 'node:fs'
|
|
5
|
-
import { join, dirname } from 'node:path'
|
|
6
|
-
import { fileURLToPath } from 'node:url'
|
|
7
|
-
|
|
8
|
-
const execAsync = promisify(exec)
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
10
|
-
const __dirname = dirname(__filename)
|
|
1
|
+
import { loadEnv, resolveEnvPath } from "../lib/env-loader.js";
|
|
2
|
+
import { fetchFile } from "../lib/docs/fetch-file.js";
|
|
3
|
+
import { logger, configureFromFlags } from "../lib/utils/logger.js";
|
|
11
4
|
|
|
12
5
|
/**
|
|
13
6
|
* Sincroniza documentação do central-docs
|
|
14
7
|
* Executado automaticamente em /warm-up
|
|
15
|
-
*
|
|
8
|
+
*
|
|
16
9
|
* @param {Object} flags - Flags do comando
|
|
17
|
-
* @param {boolean} flags.silent - Modo silencioso (
|
|
18
|
-
* @param {boolean} flags.
|
|
10
|
+
* @param {boolean} flags.silent - Modo silencioso (nem erros aparecem)
|
|
11
|
+
* @param {boolean} flags.quiet - Só erros aparecem
|
|
12
|
+
* @param {boolean} flags.verbose - Mostra o conteúdo completo retornado
|
|
19
13
|
* @param {string} flags.envFile - Path customizado do ENV.md
|
|
20
14
|
*/
|
|
21
15
|
export async function docsSync(flags = {}) {
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
configureFromFlags(flags);
|
|
17
|
+
|
|
18
|
+
const cwd = process.cwd();
|
|
19
|
+
|
|
24
20
|
// Resolver path do ENV.md (suporta --ide e --env-file)
|
|
25
|
-
let envPath
|
|
21
|
+
let envPath;
|
|
26
22
|
try {
|
|
27
|
-
const resolved = resolveEnvPath(cwd, flags)
|
|
28
|
-
envPath = resolved.path
|
|
23
|
+
const resolved = resolveEnvPath(cwd, flags);
|
|
24
|
+
envPath = resolved.path;
|
|
29
25
|
} catch (error) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
process.exit(1)
|
|
26
|
+
logger.error("❌ Erro ao resolver ENV.md:", error.message);
|
|
27
|
+
process.exit(1);
|
|
34
28
|
}
|
|
35
|
-
|
|
29
|
+
|
|
36
30
|
// Carregar ENV.md
|
|
37
|
-
let env
|
|
31
|
+
let env;
|
|
38
32
|
try {
|
|
39
|
-
env = loadEnv(cwd, envPath)
|
|
33
|
+
env = loadEnv(cwd, envPath);
|
|
40
34
|
} catch (error) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
process.exit(1)
|
|
35
|
+
logger.error("❌ Erro ao carregar ENV.md:", error.message);
|
|
36
|
+
process.exit(1);
|
|
45
37
|
}
|
|
46
|
-
|
|
38
|
+
|
|
47
39
|
// Verificar se central-docs está configurado
|
|
48
40
|
if (!env.CENTRAL_DOCS_REPO) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
return
|
|
41
|
+
logger.info("ℹ️ Central docs não configurado (CENTRAL_DOCS_REPO vazio)");
|
|
42
|
+
return;
|
|
53
43
|
}
|
|
54
|
-
|
|
55
|
-
const { SQUAD, WORKSPACE, CENTRAL_DOCS_REF =
|
|
56
|
-
|
|
44
|
+
|
|
45
|
+
const { SQUAD, WORKSPACE, CENTRAL_DOCS_REF = "main" } = env;
|
|
46
|
+
|
|
57
47
|
if (!SQUAD || !WORKSPACE) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
process.exit(1)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (!flags.silent) {
|
|
65
|
-
console.log(`🔄 Sincronizando docs do squad ${SQUAD}...`)
|
|
48
|
+
logger.error("❌ SQUAD ou WORKSPACE não definidos no ENV.md");
|
|
49
|
+
process.exit(1);
|
|
66
50
|
}
|
|
67
51
|
|
|
68
|
-
|
|
69
|
-
// Usar path relativo ao módulo, não ao cwd do usuário
|
|
70
|
-
const fetchScript = join(__dirname, '../lib/docs/fetch-file.sh')
|
|
71
|
-
if (!existsSync(fetchScript)) {
|
|
72
|
-
console.error('❌ Script não encontrado:', fetchScript)
|
|
73
|
-
process.exit(1)
|
|
74
|
-
}
|
|
52
|
+
logger.info(`🔄 Sincronizando docs do squad ${SQUAD}...`);
|
|
75
53
|
|
|
76
54
|
// Buscar index.md do squad
|
|
77
|
-
const indexPath = `${SQUAD}/index.md
|
|
78
|
-
|
|
55
|
+
const indexPath = `${SQUAD}/index.md`;
|
|
56
|
+
|
|
79
57
|
try {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
if (!flags.silent) {
|
|
93
|
-
console.log('✅ Docs sincronizados')
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (flags.verbose && stdout) {
|
|
97
|
-
console.log('\n📄 Conteúdo do index.md:\n')
|
|
98
|
-
console.log(stdout)
|
|
58
|
+
const content = await fetchFile(indexPath, CENTRAL_DOCS_REF, {
|
|
59
|
+
repo: env.CENTRAL_DOCS_REPO,
|
|
60
|
+
cacheTtl: env.CENTRAL_DOCS_CACHE_TTL || "3600",
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
logger.info("✅ Docs sincronizados");
|
|
64
|
+
|
|
65
|
+
if (content) {
|
|
66
|
+
logger.debug("\n📄 Conteúdo do index.md:\n");
|
|
67
|
+
logger.debug(content);
|
|
99
68
|
}
|
|
100
|
-
|
|
69
|
+
|
|
101
70
|
// Parsear index.md para contar documentos
|
|
102
|
-
if (
|
|
103
|
-
const prdCount = (
|
|
104
|
-
const frdCount = (
|
|
105
|
-
const ardCount = (
|
|
106
|
-
const rfcCount = (
|
|
107
|
-
|
|
108
|
-
const total = prdCount + frdCount + ardCount + rfcCount
|
|
109
|
-
|
|
71
|
+
if (content) {
|
|
72
|
+
const prdCount = (content.match(/\[prd-.*\.md\]/g) || []).length;
|
|
73
|
+
const frdCount = (content.match(/\[frd-.*\.md\]/g) || []).length;
|
|
74
|
+
const ardCount = (content.match(/\[ard-.*\.md\]/g) || []).length;
|
|
75
|
+
const rfcCount = (content.match(/\[rfc-.*\.md\]/g) || []).length;
|
|
76
|
+
|
|
77
|
+
const total = prdCount + frdCount + ardCount + rfcCount;
|
|
78
|
+
|
|
110
79
|
if (total > 0) {
|
|
111
|
-
|
|
112
|
-
if (prdCount > 0)
|
|
113
|
-
if (frdCount > 0)
|
|
114
|
-
if (ardCount > 0)
|
|
115
|
-
if (rfcCount > 0)
|
|
80
|
+
logger.info(`📊 ${total} documentos disponíveis:`);
|
|
81
|
+
if (prdCount > 0) logger.info(` - ${prdCount} PRD(s)`);
|
|
82
|
+
if (frdCount > 0) logger.info(` - ${frdCount} FRD(s)`);
|
|
83
|
+
if (ardCount > 0) logger.info(` - ${ardCount} ARD(s)`);
|
|
84
|
+
if (rfcCount > 0) logger.info(` - ${rfcCount} RFC(s)`);
|
|
116
85
|
}
|
|
117
86
|
}
|
|
118
|
-
|
|
119
|
-
if (stderr && !flags.silent) {
|
|
120
|
-
console.warn('⚠️ Avisos:', stderr)
|
|
121
|
-
}
|
|
122
|
-
|
|
123
87
|
} catch (error) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
console.error(` ${SQUAD}/index.md`)
|
|
134
|
-
}
|
|
88
|
+
logger.error("❌ Erro ao sincronizar docs:", error.message);
|
|
89
|
+
|
|
90
|
+
// Dicas de troubleshooting
|
|
91
|
+
if (error.message.includes("Token GitLab")) {
|
|
92
|
+
logger.error("\n💡 Configure o token GitLab no .npmrc:");
|
|
93
|
+
logger.error(" //gitlab.com/api/v4/packages/npm/:_authToken=seu-token");
|
|
94
|
+
} else if (error.message.includes("não encontrado")) {
|
|
95
|
+
logger.error("\n💡 Verifique se o squad existe no central-docs:");
|
|
96
|
+
logger.error(` ${SQUAD}/index.md`);
|
|
135
97
|
}
|
|
136
98
|
|
|
137
|
-
process.exit(1)
|
|
99
|
+
process.exit(1);
|
|
138
100
|
}
|
|
139
101
|
}
|
package/bin/commands/info.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { findPrompt, discoverAll } from "../lib/core/scanner.js";
|
|
2
|
-
import {
|
|
3
|
-
showBanner,
|
|
4
|
-
RED,
|
|
5
|
-
GREEN,
|
|
6
|
-
BLUE,
|
|
7
|
-
YELLOW,
|
|
8
|
-
CYAN,
|
|
9
|
-
DIM,
|
|
10
|
-
NC,
|
|
11
|
-
} from "../lib/utils/ui.js";
|
|
2
|
+
import { showBanner, RED, GREEN, BLUE, YELLOW, CYAN, DIM, NC } from "../lib/utils/ui.js";
|
|
12
3
|
import { logger } from "../lib/utils/logger.js";
|
|
13
4
|
|
|
14
5
|
export async function info(target) {
|
|
@@ -40,15 +31,12 @@ export async function info(target) {
|
|
|
40
31
|
|
|
41
32
|
if (!prompt) {
|
|
42
33
|
logger.error(`${RED}❌ Não encontrado: ${YELLOW}${target}${NC}`);
|
|
43
|
-
logger.info(
|
|
44
|
-
`${DIM}Execute: ${YELLOW}jarvis list${DIM} para ver prompts disponíveis${NC}\n`,
|
|
45
|
-
);
|
|
34
|
+
logger.info(`${DIM}Execute: ${YELLOW}jarvis list${DIM} para ver prompts disponíveis${NC}\n`);
|
|
46
35
|
process.exit(1);
|
|
47
36
|
}
|
|
48
37
|
|
|
49
38
|
// Icon based on type
|
|
50
|
-
const icon =
|
|
51
|
-
prompt.type === "agent" ? "🤖" : prompt.type === "skill" ? "⚡" : "🔄";
|
|
39
|
+
const icon = prompt.type === "agent" ? "🤖" : prompt.type === "skill" ? "⚡" : "🔄";
|
|
52
40
|
|
|
53
41
|
logger.info(`${CYAN}${icon} ${prompt.type.toUpperCase()}/${prompt.id}${NC}`);
|
|
54
42
|
logger.info("");
|
|
@@ -67,21 +55,13 @@ export async function info(target) {
|
|
|
67
55
|
if (hasDeps) {
|
|
68
56
|
logger.info(` ${YELLOW}📦 Dependências:${NC}`);
|
|
69
57
|
if (deps.rules.length)
|
|
70
|
-
logger.info(
|
|
71
|
-
` ${BLUE}Rules:${NC} ${DIM}${deps.rules.join(", ")}${NC}`,
|
|
72
|
-
);
|
|
58
|
+
logger.info(` ${BLUE}Rules:${NC} ${DIM}${deps.rules.join(", ")}${NC}`);
|
|
73
59
|
if (deps.templates.length)
|
|
74
|
-
logger.info(
|
|
75
|
-
` ${BLUE}Templates:${NC} ${DIM}${deps.templates.join(", ")}${NC}`,
|
|
76
|
-
);
|
|
60
|
+
logger.info(` ${BLUE}Templates:${NC} ${DIM}${deps.templates.join(", ")}${NC}`);
|
|
77
61
|
if (deps.agents.length)
|
|
78
|
-
logger.info(
|
|
79
|
-
` ${BLUE}Agents:${NC} ${DIM}${deps.agents.join(", ")}${NC}`,
|
|
80
|
-
);
|
|
62
|
+
logger.info(` ${BLUE}Agents:${NC} ${DIM}${deps.agents.join(", ")}${NC}`);
|
|
81
63
|
if (deps.skills.length)
|
|
82
|
-
logger.info(
|
|
83
|
-
` ${BLUE}Skills:${NC} ${DIM}${deps.skills.join(", ")}${NC}`,
|
|
84
|
-
);
|
|
64
|
+
logger.info(` ${BLUE}Skills:${NC} ${DIM}${deps.skills.join(", ")}${NC}`);
|
|
85
65
|
logger.info("");
|
|
86
66
|
}
|
|
87
67
|
}
|