@fontdata/ai-harness 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +9 -2
  3. package/LICENSE +21 -0
  4. package/README.md +175 -140
  5. package/{src → dist}/catalog.js +5 -12
  6. package/dist/cli.js +180 -0
  7. package/dist/comentarios/command.js +74 -0
  8. package/dist/comentarios/instalar.js +33 -0
  9. package/dist/config/config.js +99 -0
  10. package/dist/contratos/artefatos.js +284 -0
  11. package/dist/contratos/eventos.js +103 -0
  12. package/dist/doctor/checks.js +424 -0
  13. package/dist/init.js +240 -0
  14. package/dist/install/atomic.js +51 -0
  15. package/dist/install/flags.js +99 -0
  16. package/dist/install/hooks.js +47 -0
  17. package/dist/install/lock.js +39 -0
  18. package/dist/install/plan.js +209 -0
  19. package/dist/install/selection.js +77 -0
  20. package/dist/install/settings.js +112 -0
  21. package/dist/memoria/indice.js +195 -0
  22. package/dist/migrar/migrar.js +426 -0
  23. package/dist/rastro/command.js +46 -0
  24. package/dist/run.js +86 -0
  25. package/dist/trabalhos/conflitos.js +115 -0
  26. package/dist/types.js +1 -0
  27. package/dist/update/legado.js +74 -0
  28. package/dist/update/update.js +284 -0
  29. package/package.json +17 -8
  30. package/templates/CLAUDE.md +59 -30
  31. package/templates/agents/auditor-plano.md +44 -0
  32. package/templates/agents/investigador.md +32 -0
  33. package/templates/agents/qa.md +44 -0
  34. package/templates/agents/revisor-testes.md +40 -0
  35. package/templates/catalog.json +24 -61
  36. package/templates/commands/atualizar-deps.md +43 -9
  37. package/templates/commands/diagrama.md +35 -10
  38. package/templates/commands/gerar-env.md +39 -10
  39. package/templates/commands/gerar-testes.md +42 -10
  40. package/templates/commands/git-commit-push.md +0 -0
  41. package/templates/commands/onboarding.md +44 -15
  42. package/templates/commands/refatorar.md +50 -10
  43. package/templates/commands/revisar-pr.md +56 -12
  44. package/templates/commands/sincronizar-claude-md.md +177 -9
  45. package/templates/commands/versao.md +0 -0
  46. package/templates/hooks/comentarios/check.mjs +210 -0
  47. package/templates/hooks/hooks.json +34 -0
  48. package/templates/hooks/lembrete.mjs +29 -0
  49. package/templates/hooks/lib/config.mjs +40 -0
  50. package/templates/hooks/lib/hook.mjs +85 -0
  51. package/templates/hooks/lib/rastro.mjs +144 -0
  52. package/templates/hooks/lib/segredos.mjs +91 -0
  53. package/templates/hooks/lib/temas.mjs +111 -0
  54. package/templates/hooks/lib/trabalho.mjs +94 -0
  55. package/templates/hooks/proteger-contratos.mjs +80 -0
  56. package/templates/hooks/segredo-no-commit.mjs +76 -0
  57. package/templates/hooks/sem-jargao.mjs +58 -0
  58. package/templates/hooks/task-so-fecha-verde.mjs +33 -0
  59. package/templates/legado/manifesto.json +1267 -0
  60. package/templates/rules/comentarios.md +166 -0
  61. package/templates/rules/harness-projeto.md +41 -0
  62. package/templates/skills/auditar-performance/SKILL.md +53 -0
  63. package/templates/skills/auditar-performance/references/pontos-quentes.md +35 -0
  64. package/templates/skills/auditar-performance/templates/relatorios/CLIENTE.md +26 -0
  65. package/templates/skills/auditar-performance/templates/relatorios/TECNICO.md +27 -0
  66. package/templates/skills/auditar-seguranca/SKILL.md +67 -0
  67. package/templates/skills/auditar-seguranca/references/seguranca-tecnica.md +23 -0
  68. package/templates/skills/auditar-seguranca/templates/relatorios/CLIENTE.md +30 -0
  69. package/templates/skills/auditar-seguranca/templates/relatorios/TECNICO.md +38 -0
  70. package/templates/skills/auditar-ui/SKILL.md +64 -0
  71. package/templates/skills/auditar-ui/references/lentes.md +33 -0
  72. package/templates/skills/auditar-ui/templates/relatorios/CLIENTE.md +26 -0
  73. package/templates/skills/auditar-ui/templates/relatorios/TECNICO.md +31 -0
  74. package/templates/skills/evoluir-harness/SKILL.md +81 -0
  75. package/templates/skills/evoluir-harness/references/agent.md +83 -0
  76. package/templates/skills/evoluir-harness/references/auditoria.md +107 -0
  77. package/templates/skills/evoluir-harness/references/code-reviewer.md +68 -0
  78. package/templates/skills/evoluir-harness/references/design-system.md +56 -0
  79. package/templates/skills/evoluir-harness/references/hook.md +95 -0
  80. package/templates/skills/evoluir-harness/references/rule.md +67 -0
  81. package/templates/skills/evoluir-harness/references/skill.md +63 -0
  82. package/templates/skills/executar-plan/SKILL.md +130 -0
  83. package/templates/skills/executar-plan/references/delegacao.md +43 -0
  84. package/templates/skills/executar-plan/references/retomada.md +33 -0
  85. package/templates/skills/executar-plan/templates/BLOQUEIOS.md +30 -0
  86. package/templates/skills/harness/SKILL.md +75 -0
  87. package/templates/skills/harness/references/auto-tag.md +118 -0
  88. package/templates/skills/harness/references/ignores.md +40 -0
  89. package/templates/skills/harness/references/scaffold.md +29 -0
  90. package/templates/skills/harness/references/validar-ideia.md +42 -0
  91. package/templates/skills/memoria/SKILL.md +52 -0
  92. package/templates/skills/nova-tarefa/SKILL.md +99 -0
  93. package/templates/skills/nova-tarefa/references/isso-ja-existe.md +24 -0
  94. package/templates/skills/nova-tarefa/references/regras-do-plano.md +35 -0
  95. package/templates/skills/nova-tarefa/templates/DECISOES.md +20 -0
  96. package/templates/skills/nova-tarefa/templates/PLAN.md +58 -0
  97. package/templates/skills/nova-tarefa/templates/SPEC.md +37 -0
  98. package/templates/skills/resolver-bug/SKILL.md +104 -0
  99. package/templates/skills/resolver-bug/references/relatorio-para-cliente.md +26 -0
  100. package/templates/skills/resolver-bug/templates/PLAN.md +62 -0
  101. package/templates/skills/resolver-bug/templates/relatorios/CLIENTE.md +29 -0
  102. package/templates/skills/resolver-bug/templates/relatorios/TECNICO.md +32 -0
  103. package/bin/cli.js +0 -122
  104. package/src/init.js +0 -317
  105. package/src/installer.js +0 -92
  106. package/src/run.js +0 -99
  107. package/templates/commands/auditar-performance.md +0 -27
  108. package/templates/commands/auditar-seguranca.md +0 -64
  109. package/templates/commands/auditar-ui.md +0 -38
  110. package/templates/commands/codigo-morto.md +0 -22
  111. package/templates/commands/configurar-auto-tag.md +0 -185
  112. package/templates/commands/configurar-comentarios.md +0 -543
  113. package/templates/commands/configurar-orquestrador.md +0 -13
  114. package/templates/commands/corrigir-review.md +0 -11
  115. package/templates/commands/criar-agents.md +0 -42
  116. package/templates/commands/criar-code-reviewer.md +0 -30
  117. package/templates/commands/criar-hooks.md +0 -32
  118. package/templates/commands/criar-rag.md +0 -25
  119. package/templates/commands/criar-rules.md +0 -31
  120. package/templates/commands/criar-skill.md +0 -22
  121. package/templates/commands/design-system.md +0 -27
  122. package/templates/commands/executar-plan.md +0 -36
  123. package/templates/commands/gerar-claude-md.md +0 -66
  124. package/templates/commands/gerar-ignore.md +0 -37
  125. package/templates/commands/gerar-spec.md +0 -33
  126. package/templates/commands/harness.md +0 -34
  127. package/templates/commands/nova-tarefa.md +0 -60
  128. package/templates/commands/resolver-bug.md +0 -25
  129. package/templates/commands/review-por-task.md +0 -16
  130. package/templates/commands/scaffold.md +0 -25
  131. package/templates/commands/validar-commands.md +0 -24
  132. package/templates/commands/validar-ideia.md +0 -36
@@ -0,0 +1,58 @@
1
+ // @ts-check
2
+ // Hook PostToolUse (Edit/Write): o relatório para o cliente é escrito na linguagem de quem usa o sistema.
3
+ import { existsSync, readFileSync } from 'node:fs';
4
+ import { join } from 'node:path';
5
+ import { runHook } from './lib/hook.mjs';
6
+ import { normalize } from './lib/temas.mjs';
7
+ import { relativeToRoot } from './lib/trabalho.mjs';
8
+
9
+ /** Termos já normalizados (minúsculas, sem acento). */
10
+ const TECHNICAL_TERMS = [
11
+ 'endpoint',
12
+ 'deploy',
13
+ 'commit',
14
+ 'merge',
15
+ 'branch',
16
+ 'pull request',
17
+ 'refactor',
18
+ 'refatoracao',
19
+ 'stack trace',
20
+ 'exception',
21
+ 'excecao',
22
+ 'null',
23
+ 'undefined',
24
+ 'query',
25
+ 'sql',
26
+ 'json',
27
+ 'api',
28
+ 'frontend',
29
+ 'backend',
30
+ 'hotfix',
31
+ 'regex',
32
+ 'cache',
33
+ 'payload',
34
+ 'schema',
35
+ 'timeout',
36
+ 'runtime',
37
+ 'script',
38
+ 'bug',
39
+ ];
40
+
41
+ await runHook('sem-jargao', (input, { root }) => {
42
+ const rel = relativeToRoot(root, String(input.tool_input?.file_path ?? ''));
43
+ if (!rel || !/^docs\/trabalhos\/[^/]+\/relatorios\/CLIENTE\.md$/.test(rel)) return null;
44
+
45
+ const file = join(root, rel);
46
+ if (!existsSync(file)) return null;
47
+
48
+ const body = readFileSync(file, 'utf8').replace(/^\s*---\r?\n[\s\S]*?\r?\n---/, '');
49
+ const words = ` ${normalize(body).replace(/[^a-z0-9]+/g, ' ')} `;
50
+ const found = TECHNICAL_TERMS.filter((term) => words.includes(` ${term} `));
51
+ if (!found.length) return null;
52
+
53
+ return {
54
+ motivo:
55
+ `o relatório para o cliente usa termos técnicos: ${found.slice(0, 8).join(', ')}. ` +
56
+ 'Reescreva na linguagem de quem usa o sistema (o que acontecia e o que muda para ele); o detalhe técnico fica no TECNICO.md.',
57
+ };
58
+ });
@@ -0,0 +1,33 @@
1
+ // @ts-check
2
+ // Hook PostToolUse (Edit/Write): avisa quando o PLAN.md tem task concluída sem suíte verde no rastro.
3
+ import { existsSync, readFileSync } from 'node:fs';
4
+ import { join } from 'node:path';
5
+ import { runHook } from './lib/hook.mjs';
6
+ import { planTasks, relativeToRoot, workEvents } from './lib/trabalho.mjs';
7
+
8
+ await runHook('task-so-fecha-verde', (input, { root }) => {
9
+ const rel = relativeToRoot(root, String(input.tool_input?.file_path ?? ''));
10
+ const match = rel ? /^docs\/trabalhos\/([^/]+)\/PLAN\.md$/.exec(rel) : null;
11
+ if (!rel || !match) return null;
12
+
13
+ const workId = match[1] ?? '';
14
+ const events = workEvents(root, workId);
15
+ if (!events || !existsSync(join(root, rel))) return null;
16
+
17
+ const green = new Set(events.filter((event) => event.evento === 'suite_verde').map((event) => event.task_id));
18
+ // Task concluída antes de o rastro existir (sem task_iniciada nem task_concluida) não é cobrada.
19
+ const tracked = new Set(
20
+ events.filter((event) => event.evento === 'task_iniciada' || event.evento === 'task_concluida').map((event) => event.task_id)
21
+ );
22
+ const missing = planTasks(readFileSync(join(root, rel), 'utf8'))
23
+ .filter((task) => task.status === 'concluida' && tracked.has(task.id) && !green.has(task.id))
24
+ .map((task) => task.id);
25
+ if (!missing.length) return null;
26
+
27
+ return {
28
+ motivo:
29
+ `${missing.join(', ')} está marcada como concluída em ${rel}, mas o rastro não registra suíte verde para ela. ` +
30
+ `Rode a suíte e registre o resultado (npx @fontdata/ai-harness evento suite_verde --trabalho ${workId} --task <id> ` +
31
+ `--dados '{"comando":"<comando>","total":<n>,"falhas":0}') ou volte a task para em-andamento.`,
32
+ };
33
+ });