@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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +9 -2
- package/LICENSE +21 -0
- package/README.md +175 -140
- package/{src → dist}/catalog.js +5 -12
- package/dist/cli.js +180 -0
- package/dist/comentarios/command.js +74 -0
- package/dist/comentarios/instalar.js +33 -0
- package/dist/config/config.js +99 -0
- package/dist/contratos/artefatos.js +284 -0
- package/dist/contratos/eventos.js +103 -0
- package/dist/doctor/checks.js +424 -0
- package/dist/init.js +240 -0
- package/dist/install/atomic.js +51 -0
- package/dist/install/flags.js +99 -0
- package/dist/install/hooks.js +47 -0
- package/dist/install/lock.js +39 -0
- package/dist/install/plan.js +209 -0
- package/dist/install/selection.js +77 -0
- package/dist/install/settings.js +112 -0
- package/dist/memoria/indice.js +195 -0
- package/dist/migrar/migrar.js +426 -0
- package/dist/rastro/command.js +46 -0
- package/dist/run.js +86 -0
- package/dist/trabalhos/conflitos.js +115 -0
- package/dist/types.js +1 -0
- package/dist/update/legado.js +74 -0
- package/dist/update/update.js +284 -0
- package/package.json +17 -8
- package/templates/CLAUDE.md +59 -30
- package/templates/agents/auditor-plano.md +44 -0
- package/templates/agents/investigador.md +32 -0
- package/templates/agents/qa.md +44 -0
- package/templates/agents/revisor-testes.md +40 -0
- package/templates/catalog.json +24 -61
- package/templates/commands/atualizar-deps.md +43 -9
- package/templates/commands/diagrama.md +35 -10
- package/templates/commands/gerar-env.md +39 -10
- package/templates/commands/gerar-testes.md +42 -10
- package/templates/commands/git-commit-push.md +0 -0
- package/templates/commands/onboarding.md +44 -15
- package/templates/commands/refatorar.md +50 -10
- package/templates/commands/revisar-pr.md +56 -12
- package/templates/commands/sincronizar-claude-md.md +177 -9
- package/templates/commands/versao.md +0 -0
- package/templates/hooks/comentarios/check.mjs +210 -0
- package/templates/hooks/hooks.json +34 -0
- package/templates/hooks/lembrete.mjs +29 -0
- package/templates/hooks/lib/config.mjs +40 -0
- package/templates/hooks/lib/hook.mjs +85 -0
- package/templates/hooks/lib/rastro.mjs +144 -0
- package/templates/hooks/lib/segredos.mjs +91 -0
- package/templates/hooks/lib/temas.mjs +111 -0
- package/templates/hooks/lib/trabalho.mjs +94 -0
- package/templates/hooks/proteger-contratos.mjs +80 -0
- package/templates/hooks/segredo-no-commit.mjs +76 -0
- package/templates/hooks/sem-jargao.mjs +58 -0
- package/templates/hooks/task-so-fecha-verde.mjs +33 -0
- package/templates/legado/manifesto.json +1267 -0
- package/templates/rules/comentarios.md +166 -0
- package/templates/rules/harness-projeto.md +41 -0
- package/templates/skills/auditar-performance/SKILL.md +53 -0
- package/templates/skills/auditar-performance/references/pontos-quentes.md +35 -0
- package/templates/skills/auditar-performance/templates/relatorios/CLIENTE.md +26 -0
- package/templates/skills/auditar-performance/templates/relatorios/TECNICO.md +27 -0
- package/templates/skills/auditar-seguranca/SKILL.md +67 -0
- package/templates/skills/auditar-seguranca/references/seguranca-tecnica.md +23 -0
- package/templates/skills/auditar-seguranca/templates/relatorios/CLIENTE.md +30 -0
- package/templates/skills/auditar-seguranca/templates/relatorios/TECNICO.md +38 -0
- package/templates/skills/auditar-ui/SKILL.md +64 -0
- package/templates/skills/auditar-ui/references/lentes.md +33 -0
- package/templates/skills/auditar-ui/templates/relatorios/CLIENTE.md +26 -0
- package/templates/skills/auditar-ui/templates/relatorios/TECNICO.md +31 -0
- package/templates/skills/evoluir-harness/SKILL.md +81 -0
- package/templates/skills/evoluir-harness/references/agent.md +83 -0
- package/templates/skills/evoluir-harness/references/auditoria.md +107 -0
- package/templates/skills/evoluir-harness/references/code-reviewer.md +68 -0
- package/templates/skills/evoluir-harness/references/design-system.md +56 -0
- package/templates/skills/evoluir-harness/references/hook.md +95 -0
- package/templates/skills/evoluir-harness/references/rule.md +67 -0
- package/templates/skills/evoluir-harness/references/skill.md +63 -0
- package/templates/skills/executar-plan/SKILL.md +130 -0
- package/templates/skills/executar-plan/references/delegacao.md +43 -0
- package/templates/skills/executar-plan/references/retomada.md +33 -0
- package/templates/skills/executar-plan/templates/BLOQUEIOS.md +30 -0
- package/templates/skills/harness/SKILL.md +75 -0
- package/templates/skills/harness/references/auto-tag.md +118 -0
- package/templates/skills/harness/references/ignores.md +40 -0
- package/templates/skills/harness/references/scaffold.md +29 -0
- package/templates/skills/harness/references/validar-ideia.md +42 -0
- package/templates/skills/memoria/SKILL.md +52 -0
- package/templates/skills/nova-tarefa/SKILL.md +99 -0
- package/templates/skills/nova-tarefa/references/isso-ja-existe.md +24 -0
- package/templates/skills/nova-tarefa/references/regras-do-plano.md +35 -0
- package/templates/skills/nova-tarefa/templates/DECISOES.md +20 -0
- package/templates/skills/nova-tarefa/templates/PLAN.md +58 -0
- package/templates/skills/nova-tarefa/templates/SPEC.md +37 -0
- package/templates/skills/resolver-bug/SKILL.md +104 -0
- package/templates/skills/resolver-bug/references/relatorio-para-cliente.md +26 -0
- package/templates/skills/resolver-bug/templates/PLAN.md +62 -0
- package/templates/skills/resolver-bug/templates/relatorios/CLIENTE.md +29 -0
- package/templates/skills/resolver-bug/templates/relatorios/TECNICO.md +32 -0
- package/bin/cli.js +0 -122
- package/src/init.js +0 -317
- package/src/installer.js +0 -92
- package/src/run.js +0 -99
- package/templates/commands/auditar-performance.md +0 -27
- package/templates/commands/auditar-seguranca.md +0 -64
- package/templates/commands/auditar-ui.md +0 -38
- package/templates/commands/codigo-morto.md +0 -22
- package/templates/commands/configurar-auto-tag.md +0 -185
- package/templates/commands/configurar-comentarios.md +0 -543
- package/templates/commands/configurar-orquestrador.md +0 -13
- package/templates/commands/corrigir-review.md +0 -11
- package/templates/commands/criar-agents.md +0 -42
- package/templates/commands/criar-code-reviewer.md +0 -30
- package/templates/commands/criar-hooks.md +0 -32
- package/templates/commands/criar-rag.md +0 -25
- package/templates/commands/criar-rules.md +0 -31
- package/templates/commands/criar-skill.md +0 -22
- package/templates/commands/design-system.md +0 -27
- package/templates/commands/executar-plan.md +0 -36
- package/templates/commands/gerar-claude-md.md +0 -66
- package/templates/commands/gerar-ignore.md +0 -37
- package/templates/commands/gerar-spec.md +0 -33
- package/templates/commands/harness.md +0 -34
- package/templates/commands/nova-tarefa.md +0 -60
- package/templates/commands/resolver-bug.md +0 -25
- package/templates/commands/review-por-task.md +0 -16
- package/templates/commands/scaffold.md +0 -25
- package/templates/commands/validar-commands.md +0 -24
- 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
|
+
});
|