@polymorphism-tech/morph-spec 8.44.0 → 8.46.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 (199) hide show
  1. package/CLAUDE.md +11 -9
  2. package/README.md +10 -10
  3. package/bin/morph-spec.js +11 -13
  4. package/bin/validate.js +379 -379
  5. package/claude-plugin.json +1 -1
  6. package/docs/CHEATSHEET.md +2 -4
  7. package/docs/QUICKSTART.md +6 -6
  8. package/framework/CLAUDE.md +6 -8
  9. package/framework/MORPH.md +39 -45
  10. package/framework/agents.json +8 -9
  11. package/framework/commands/morph-apply.md +1 -3
  12. package/framework/commands/morph-hotfix.md +1 -1
  13. package/framework/commands/morph-proposal.md +2 -2
  14. package/framework/docs/CLI.md +15 -14
  15. package/framework/evals/review-checklist.md +90 -0
  16. package/framework/evals/trace-schema.md +2 -12
  17. package/framework/hooks/README.md +2 -3
  18. package/framework/hooks/claude-code/core/heavy-gate.js +1 -1
  19. package/framework/hooks/claude-code/core/protect-spec-files.js +2 -2
  20. package/framework/hooks/claude-code/core/telemetry-log.js +2 -2
  21. package/framework/hooks/claude-code/core/trace-autogen.js +1 -22
  22. package/framework/hooks/claude-code/core/validate-completion.js +3 -56
  23. package/framework/hooks/claude-code/statusline.sh +11 -11
  24. package/framework/hooks/git/commit-msg/conventional-commits.sh +33 -33
  25. package/framework/hooks/git/pre-commit/agents.sh +25 -25
  26. package/framework/hooks/git/pre-commit/orchestrator.sh +64 -64
  27. package/framework/hooks/git/pre-commit/specs.sh +50 -50
  28. package/framework/hooks/git/pre-push/run-tests.sh +44 -44
  29. package/framework/hooks/shared/build-check.js +1 -1
  30. package/framework/hooks/shared/comment-scanner.js +1 -1
  31. package/framework/hooks/shared/phase-utils.js +0 -5
  32. package/framework/hooks/shared/stdin-reader.js +26 -26
  33. package/framework/phases.json +4 -6
  34. package/framework/rubrics/backend.json +1 -1
  35. package/framework/rubrics/default.json +1 -1
  36. package/framework/rubrics/frontend.json +1 -1
  37. package/framework/rules/morph-workflow.md +6 -6
  38. package/framework/schemas/config.schema.json +4 -0
  39. package/framework/schemas/feature.schema.json +5 -29
  40. package/framework/schemas/tasks.schema.json +6 -2
  41. package/framework/skills/README.md +1 -2
  42. package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
  43. package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
  44. package/framework/skills/core/morph-apply/SKILL.md +145 -246
  45. package/framework/skills/core/morph-brainstorming/SKILL.md +1 -1
  46. package/framework/skills/core/morph-hotfix/SKILL.md +5 -3
  47. package/framework/skills/core/morph-implement/SKILL.md +101 -201
  48. package/framework/skills/core/morph-machine/SKILL.md +3 -3
  49. package/framework/skills/core/morph-media/SKILL.md +1 -1
  50. package/framework/skills/core/morph-plan/SKILL.md +171 -287
  51. package/framework/skills/core/morph-proposal/SKILL.md +4 -5
  52. package/framework/skills/core/morph-review/SKILL.md +122 -430
  53. package/framework/skills/core/morph-stack-scan/SKILL.md +1 -1
  54. package/framework/skills/core/morph-standards/SKILL.md +2 -2
  55. package/framework/skills/core/morph-uiux/SKILL.md +2 -3
  56. package/framework/standards/STANDARDS.json +10 -10
  57. package/framework/standards/ai-agents/agent-archetypes.md +1 -1
  58. package/framework/standards/ai-agents/agent-session.md +1 -1
  59. package/framework/standards/ai-agents/agent-spec.md +1 -1
  60. package/framework/standards/ai-agents/batching.md +1 -1
  61. package/framework/standards/ai-agents/context-providers.md +1 -1
  62. package/framework/standards/ai-agents/conversational-agent-with-phases.md +1 -1
  63. package/framework/standards/ai-agents/cost-and-budget.md +1 -1
  64. package/framework/standards/ai-agents/durable-workflows-hitl.md +1 -1
  65. package/framework/standards/ai-agents/guardrails.md +1 -1
  66. package/framework/standards/ai-agents/llm-runtime-defaults.md +1 -1
  67. package/framework/standards/ai-agents/mcp-server.md +1 -1
  68. package/framework/standards/ai-agents/mcp-tools.md +1 -1
  69. package/framework/standards/ai-agents/media-pipeline.md +1 -1
  70. package/framework/standards/ai-agents/media-video.md +1 -1
  71. package/framework/standards/ai-agents/middleware-patterns.md +1 -1
  72. package/framework/standards/ai-agents/modalities-image-gen.md +1 -1
  73. package/framework/standards/ai-agents/modalities-speech-to-text.md +1 -1
  74. package/framework/standards/ai-agents/modalities-text-to-speech.md +1 -1
  75. package/framework/standards/ai-agents/modalities-vision.md +1 -1
  76. package/framework/standards/ai-agents/multi-agent-patterns.md +1 -1
  77. package/framework/standards/ai-agents/observability-patterns.md +3 -3
  78. package/framework/standards/ai-agents/production.md +2 -2
  79. package/framework/standards/ai-agents/prompt-sources.md +1 -1
  80. package/framework/standards/ai-agents/providers/model-registry.md +1 -1
  81. package/framework/standards/ai-agents/rag-custom-pgvector.md +1 -1
  82. package/framework/standards/ai-agents/service-tier-flex.md +1 -1
  83. package/framework/standards/ai-agents/setup.md +1 -1
  84. package/framework/standards/ai-agents/structured-output.md +1 -1
  85. package/framework/standards/ai-agents/sweet-spot.md +1 -1
  86. package/framework/standards/ai-agents/testing-ai.md +1 -1
  87. package/framework/standards/ai-agents/tool-adapters.md +1 -1
  88. package/framework/standards/ai-agents/vector-data-extensions.md +1 -1
  89. package/framework/standards/ai-agents/workflows.md +1 -1
  90. package/framework/templates/CLAUDE.md.core.template +1 -1
  91. package/framework/templates/IDE-SNIPPETS.md +262 -262
  92. package/framework/templates/README.md +1 -1
  93. package/framework/templates/REGISTRY.json +0 -81
  94. package/framework/templates/code/dotnet/abstractions/api-endpoint.cs +7 -7
  95. package/framework/templates/code/dotnet/feature/endpoint.cs.hbs +21 -21
  96. package/framework/templates/code/dotnet/feature/request.cs.hbs +4 -4
  97. package/framework/templates/code/dotnet/feature/response.cs.hbs +4 -4
  98. package/framework/templates/code/sql/ai-agents/pgvector-embeddings-migration.sql.template +91 -91
  99. package/framework/templates/docs/spec.md +19 -205
  100. package/framework/templates/docs/ui-components.md +52 -52
  101. package/framework/templates/docs/ui-design-system.md +76 -76
  102. package/framework/templates/docs/ui-flows.md +167 -167
  103. package/framework/templates/frontend/nextjs/client-component.tsx.hbs +26 -26
  104. package/framework/templates/frontend/nextjs/feature-form.tsx.hbs +56 -56
  105. package/framework/templates/frontend/nextjs/tsconfig.json.hbs +26 -26
  106. package/framework/templates/infrastructure/docker/Dockerfile.template +58 -58
  107. package/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -38
  108. package/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -48
  109. package/framework/templates/infrastructure/github/README.md +56 -56
  110. package/framework/templates/infrastructure/github/actions/docker-build-push/action.yml.hbs +45 -45
  111. package/framework/templates/infrastructure/github/actions/health-check/action.yml.hbs +27 -27
  112. package/framework/templates/infrastructure/github/workflows/docker-build-push.yml.hbs +59 -59
  113. package/framework/templates/infrastructure/github/workflows/dotnet-build.yml.hbs +39 -39
  114. package/framework/templates/meta-prompts/fusion/fusion-agent.md +76 -76
  115. package/framework/templates/meta-prompts/fusion/fusion-aggregator.md +100 -100
  116. package/framework/templates/meta-prompts/validators/pre-commit-validator.md +95 -95
  117. package/framework/templates/state.template.json +17 -17
  118. package/framework/templates/ui/design-system.css +226 -226
  119. package/package.json +2 -2
  120. package/src/commands/e2e/e2e.js +1 -1
  121. package/src/commands/project/heavy.js +1 -1
  122. package/src/commands/project/status.js +3 -3
  123. package/src/commands/state/approve.js +7 -49
  124. package/src/commands/state/gate-check.js +16 -106
  125. package/src/commands/state/gate-decision.js +1 -1
  126. package/src/commands/state/report-check.js +42 -17
  127. package/src/commands/validation/mutate.js +1 -1
  128. package/src/commands/validation/scout-check.js +28 -0
  129. package/src/commands/validation/validate-feature.js +5 -32
  130. package/src/commands/validation/verify.js +98 -48
  131. package/src/core/paths/output-schema.js +0 -2
  132. package/src/core/state/state-manager.js +1 -2
  133. package/src/core/templates/template-renderer.js +477 -477
  134. package/src/dashboard/app/lib/format.js +5 -0
  135. package/src/dashboard/app/main.jsx +13 -13
  136. package/src/dashboard/app/pages/FeatureDetail.jsx +16 -22
  137. package/src/dashboard/app/pages/Features.jsx +7 -7
  138. package/src/dashboard/app/pages/PhasePipeline.jsx +1 -1
  139. package/src/dashboard/app/pages/Rubrics.jsx +7 -11
  140. package/src/dashboard/scanner/docs-scanner.js +1 -2
  141. package/src/dashboard/scanner/features-scanner.js +3 -4
  142. package/src/dashboard/scanner/rubrics-scanner.js +12 -12
  143. package/src/dashboard/vite.config.js +24 -24
  144. package/src/lib/agents/output-collector.js +0 -1
  145. package/src/lib/ci/ci-verify.js +118 -0
  146. package/src/lib/ci/github-ci.js +192 -0
  147. package/src/lib/ci/workflow-scaffold.js +122 -0
  148. package/src/lib/detectors/design-system-detector.js +188 -188
  149. package/src/lib/evaluator-report.js +52 -334
  150. package/src/lib/generators/design-system-generator.js +508 -508
  151. package/src/lib/generators/handoff-generator.js +4 -5
  152. package/src/lib/installers/memory-installer.js +2 -2
  153. package/src/lib/mutation/manifest.js +8 -2
  154. package/src/lib/mutation/report.js +5 -3
  155. package/src/lib/mutation/runner.js +9 -7
  156. package/src/lib/risk-detector.js +60 -122
  157. package/src/lib/scout/scout-check.js +293 -0
  158. package/src/lib/tasks/task-classifier.js +30 -30
  159. package/src/lib/tasks/task-parser.js +209 -209
  160. package/src/lib/tasks/tasks-json-parser.js +7 -5
  161. package/src/lib/tasks/test-nodes.js +1 -1
  162. package/src/lib/tasks/test-runner.js +1 -1
  163. package/src/lib/telemetry/verify-event.js +3 -2
  164. package/src/lib/validators/css/css-validator.js +340 -340
  165. package/src/lib/validators/reuse/reuse-validator.js +6 -8
  166. package/src/lib/validators/verify-runner.js +1 -1
  167. package/src/scripts/setup-infra.js +1 -1
  168. package/src/utils/agent-id-mapper.js +11 -11
  169. package/src/utils/agents-installer.js +5 -9
  170. package/src/utils/claude-settings-manager.js +300 -300
  171. package/src/utils/hooks-installer.js +3 -10
  172. package/src/utils/skills-installer.js +1 -1
  173. package/framework/evals/proof-rubrics/README.md +0 -76
  174. package/framework/evals/proof-rubrics/eval-de-modelo.md +0 -80
  175. package/framework/evals/proof-rubrics/fiacao.md +0 -54
  176. package/framework/evals/proof-rubrics/guard-cego.md +0 -52
  177. package/framework/evals/proof-rubrics/media-claims.md +0 -109
  178. package/framework/evals/proof-rubrics/mutation-proof.md +0 -107
  179. package/framework/evals/proof-rubrics/observabilidade-genai.md +0 -119
  180. package/framework/evals/proof-rubrics/verde-nao-e-coberto.md +0 -48
  181. package/framework/evals/rubrics/README.md +0 -45
  182. package/framework/evals/rubrics/architecture.md +0 -103
  183. package/framework/evals/rubrics/code-quality.md +0 -98
  184. package/framework/evals/rubrics/condensed.md +0 -57
  185. package/framework/evals/rubrics/contracts.md +0 -67
  186. package/framework/evals/rubrics/test-coverage.md +0 -99
  187. package/framework/evals/scenarios/dotnet-crud.yaml +0 -42
  188. package/framework/evals/scenarios/nextjs-auth.yaml +0 -38
  189. package/framework/evals/suites/standard.yaml +0 -5
  190. package/framework/hooks/claude-code/__pycache__/statusline.cpython-313.pyc +0 -0
  191. package/framework/hooks/claude-code/core/post-edit-typecheck.js +0 -127
  192. package/framework/skills/core/morph-eval/SKILL.md +0 -64
  193. package/framework/templates/.idea/morph-templates.xml +0 -92
  194. package/framework/templates/.vscode/morph-templates.code-snippets +0 -186
  195. package/framework/templates/docs/clarifications.md +0 -253
  196. package/framework/templates/docs/onboarding.md +0 -122
  197. package/framework/templates/docs/schema-analysis.md +0 -119
  198. package/framework/templates/docs/user-stories.md +0 -34
  199. package/src/commands/state/score.js +0 -147
@@ -1,127 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * PostToolUse Hook: TypeScript typecheck with debounce + build-dirty flag
5
- *
6
- * Event: PostToolUse | Matcher: Write|Edit
7
- *
8
- * Runs `npx tsc --noEmit` only for .ts/.tsx files, with a 3-second debounce
9
- * so rapid sequential edits (e.g. multiple files in one task) don't each
10
- * trigger a full typecheck. Silent on success — only injects on error.
11
- *
12
- * Also touches `.morph/memory/build-dirty.json` on EVERY Write/Edit of a
13
- * source file (any extension build-check.js knows how to verify — dotnet .cs
14
- * included, not just TS), even when the tsc check below is skipped/debounced.
15
- * validate-completion.js (Stop hook) only runs its full build/typecheck when
16
- * this flag is present — this is the write side of that dirty-flag gate
17
- * (R1.2 of the performance plan).
18
- *
19
- * Debounce state: .morph/memory/typecheck-debounce.json
20
- *
21
- * Fail-open: exits 0 on any error.
22
- */
23
-
24
- import { execSync } from 'child_process';
25
- import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs';
26
- import { join } from 'path';
27
- import { contextResult, runStandalone } from '../../shared/hook-response.js';
28
- import { stateExists } from '../../shared/state-reader.js';
29
- import { resolveRootForFile } from '../../shared/payload-utils.js';
30
-
31
- const DEBOUNCE_MS = 3000;
32
- const TSC_TIMEOUT_MS = 30000;
33
-
34
- // Extensions build-check.js knows how to verify (dotnet .cs + the frontend
35
- // TS/JS family) — broader than the `/\.tsx?$/` gate below on purpose: editing
36
- // a .cs file never runs tsc here, but it DOES need the next Stop's
37
- // `dotnet build` to run.
38
- const SOURCE_FILE_RE = /\.(cs|ts|tsx|js|jsx|mjs|cjs|vue|razor|cshtml)$/i;
39
-
40
- /**
41
- * Mark the build dirty for validate-completion.js's Stop-hook gate.
42
- * Cheap, best-effort — never blocks, never throws.
43
- *
44
- * @param {string} morphRoot - the root whose `.morph/` the Stop hook itself
45
- * reads (resolved by the `.morph` marker, NOT the tsc/package.json root —
46
- * they can differ in a monorepo, e.g. editing `frontend/src/Foo.tsx` walks
47
- * up to `frontend/` for tsc but `.morph/` still lives at the repo root).
48
- */
49
- function markBuildDirty(morphRoot) {
50
- try {
51
- const memDir = join(morphRoot, '.morph', 'memory');
52
- mkdirSync(memDir, { recursive: true });
53
- writeFileSync(join(memDir, 'build-dirty.json'), JSON.stringify({ ts: new Date().toISOString() }), 'utf-8');
54
- } catch { /* non-blocking */ }
55
- }
56
-
57
- /**
58
- * @param {object} payload - parsed PostToolUse stdin payload (Write|Edit)
59
- * @returns {Promise<object|null>} a hookSpecificOutput context object on a
60
- * typecheck failure, or null (pass/silent). Never prints, never exits —
61
- * see runStandalone()/chain.js at the bottom.
62
- */
63
- export async function run(payload) {
64
- try {
65
- if (!stateExists()) return null;
66
-
67
- const toolName = payload?.tool_name || '';
68
- const filePath = payload?.tool_input?.file_path || payload?.tool_input?.path || '';
69
-
70
- if (!['Write', 'Edit'].includes(toolName)) return null;
71
-
72
- // Dirty-flag: resolved against the nearest ancestor that HAS a `.morph/`
73
- // dir — the same root validate-completion.js reads from `process.cwd()`.
74
- // This is deliberately independent of the tsc root below: a monorepo's
75
- // `frontend/package.json` would otherwise make the flag land under
76
- // `frontend/.morph/`, where the Stop hook (running from the repo root)
77
- // never looks — a silently-dark guardrail.
78
- const morphRoot = resolveRootForFile(filePath, process.cwd(), ['.morph']);
79
- if (SOURCE_FILE_RE.test(filePath)) markBuildDirty(morphRoot);
80
-
81
- if (!filePath.match(/\.tsx?$/)) return null;
82
-
83
- // Resolve the root that OWNS the edited file — when a subagent edits inside
84
- // its own git worktree (isolation: "worktree", §3b-w), tsc must run there,
85
- // not in the main working tree. Falls back to cwd for the normal case.
86
- const root = resolveRootForFile(filePath, process.cwd());
87
-
88
- // No node_modules under the resolved root → tsc can't run; pass silently
89
- // (a fresh worktree before `morph-spec worktree link` has no node_modules).
90
- if (!existsSync(join(root, 'node_modules'))) return null;
91
-
92
- // Debounce (keyed by root): skip if a typecheck ran within the last 3s.
93
- const memDir = join(root, '.morph', 'memory');
94
- const debouncePath = join(memDir, 'typecheck-debounce.json');
95
-
96
- try {
97
- if (existsSync(debouncePath)) {
98
- const { lastRun } = JSON.parse(readFileSync(debouncePath, 'utf-8'));
99
- if (Date.now() - new Date(lastRun).getTime() < DEBOUNCE_MS) return null;
100
- }
101
- } catch { /* corrupt file — proceed */ }
102
-
103
- try {
104
- mkdirSync(memDir, { recursive: true });
105
- writeFileSync(debouncePath, JSON.stringify({ lastRun: new Date().toISOString() }), 'utf-8');
106
- } catch { /* non-blocking */ }
107
-
108
- try {
109
- execSync('npx tsc --noEmit', { cwd: root, stdio: 'pipe', timeout: TSC_TIMEOUT_MS });
110
- return null;
111
- } catch (err) {
112
- const stderr = err.stderr?.toString() || '';
113
- const stdout = err.stdout?.toString() || '';
114
- const output = (stderr + stdout).trim();
115
- const fileName = filePath.split(/[\\/]/).pop();
116
- const relevant = output.split('\n')
117
- .filter(l => l.includes(fileName) || l.includes('error TS'))
118
- .slice(0, 10)
119
- .join('\n');
120
- return contextResult(`TypeScript errors after editing ${fileName}:\n${relevant || output.split('\n').slice(0, 10).join('\n')}`, 'PostToolUse');
121
- }
122
- } catch {
123
- return null;
124
- }
125
- }
126
-
127
- await runStandalone(run);
@@ -1,64 +0,0 @@
1
- ---
2
- name: morph-eval
3
- description: Avalia a qualidade de uma tarefa ou fase com rubricas graduadas 0-10
4
- version: core
5
- when-to-invoke: ao completar uma tarefa ou ao finalizar uma fase de implementação
6
- user-invokable: false
7
- cliVersion: "8.44.0"
8
- ---
9
-
10
- # morph-eval
11
-
12
- ## Objetivo
13
- Produzir um score 0-10 por dimensão e uma ação clara baseada no score.
14
- O objetivo não é punir — é identificar o que melhorar antes de seguir adiante.
15
-
16
- ## Quando invocar
17
- Após concluir uma tarefa ou ao finalizar a fase de implementação.
18
- Também invocado ao receber o retorno de um sub-agent com auto-score < 7.
19
-
20
- **Somente após `morph-spec verify {feature} {task}` verde** (a `morph-apply` garante isso no loop §3a). O verify é a barreira determinística (build+testes+validadores); esta skill julga o que o código não pega: arquitetura, contratos, qualidade, cobertura qualitativa.
21
-
22
- > **Escopo de fase (Gate 3):** a avaliação da feature inteira NÃO é feita por quem implementou — a `morph-review` despacha a persona `evaluator` de `agents.json` (contexto fresco, sem autoria; recebe mandate + diff + saída real dos testes) usando esta skill como guia, **sempre com as 4 rubricas completas** — nunca a condensada, que é exclusiva do eval inline por task. O eval por task pode ser inline; o score composto do Gate 3 vem sempre do avaliador independente, com a régua completa.
23
-
24
- ## O que fazer
25
-
26
- 0. Confirme que o `morph-spec verify` da task está verde (a morph-apply passa o resultado; numa invocação manual, rode `morph-spec verify {feature} {task} --json`). Se estiver vermelho, NÃO avalie — devolva o `feedback[]` do verify ao loop de correção.
27
-
28
- 1. Identifique o escopo da avaliação: tarefa única (eval inline) ou fase completa (Gate 3).
29
-
30
- 2. Leia a rubrica correspondente ao escopo:
31
- - **Tarefa única (eval inline, o caso comum):** leia SÓ `.morph/framework/evals/rubrics/condensed.md` — tabela única com as 4 dimensões e seus pesos, condensada das completas. Não abra as 4 rubricas completas para esse escopo; a condensada é fiel a elas (dimensões e pesos idênticos, enforced por `scripts/check-rubric-parity.js`).
32
- - **Fase completa (Gate 3):** o avaliador independente despachado pela `morph-review` (persona `evaluator`, contexto fresco) usa **sempre** as 4 rubricas completas — a régua do juiz de Gate 3 não muda:
33
- - `architecture.md` — peso 30% — vertical slice, separação de responsabilidades, infra
34
- - `contracts.md` — peso 25% — tipos, validação, tratamento de erros, naming
35
- - `code-quality.md` — peso 25% — naming, ausência de code smells, padrões do stack
36
- - `test-coverage.md` — peso 20% — happy path, edge cases, isolamento, naming de testes
37
-
38
- 3. Atribua um score de 1 a 10 para cada dimensão seguindo as bandas da rubrica (condensada ou completa, conforme o passo 2).
39
-
40
- 4. Calcule o score composto: (arch × 0.30) + (contracts × 0.25) + (quality × 0.25) + (tests × 0.20).
41
-
42
- 5. Aja conforme o score composto:
43
- - **9-10:** Aprovado — nenhuma saída necessária no contexto, a task avança.
44
- - **< 9:** Produza **feedback priorizado** (bloqueantes primeiro) — este feedback é a entrada do loop de correção autônomo da `morph-apply`: ela re-invoca `morph-implement` passando esse feedback para a próxima tentativa. NÃO escale ao humano aqui; a escalada só acontece quando o loop esgota 3 tentativas sem atingir 9. O feedback deve ser acionável (o que corrigir, onde), não só descritivo.
45
-
46
- 6. Registre o score no recap.md da tarefa avaliada.
47
-
48
- 7. **NÃO escreva o trace manualmente.** O arquivo `.morph/traces/YYYY-MM-DD-{feature}-implement.json` é gerado automaticamente pelo hook `trace-autogen` a cada write de `tasks.json`, lendo `eval_score`/`eval_dimensions` do registro `taskScores` do feature.json. Garanta apenas que o score foi persistido via `morph-spec score {feature} {task} {score} --dims {a},{c},{q},{t}` (a `morph-apply` faz esse registro no loop) — é dali que o trace lê.
49
-
50
- ## Output esperado
51
- - Score composto 0-10 com scores por dimensão
52
- - Ação tomada com base no score (aprovado em >=9 / feedback acionável para o loop em <9)
53
- - Entrada no recap.md com scores
54
- - Score persistido em `taskScores` via `morph-spec score` (o trace é gerado automaticamente pelo hook `trace-autogen`)
55
-
56
- ## Referências
57
- - `morph-spec verify {feature} [task] --json` — barreira determinística (build+testes+validadores) que precede esta skill
58
- - `.morph/framework/evals/rubrics/condensed.md` — rubrica condensada (4 dimensões + pesos), usada no eval INLINE por task
59
- - `.morph/framework/evals/rubrics/architecture.md` — rubrica completa de arquitetura (30%) — Gate 3, avaliador independente
60
- - `.morph/framework/evals/rubrics/contracts.md` — rubrica completa de contratos (25%) — Gate 3, avaliador independente
61
- - `.morph/framework/evals/rubrics/code-quality.md` — rubrica completa de qualidade (25%) — Gate 3, avaliador independente
62
- - `.morph/framework/evals/rubrics/test-coverage.md` — rubrica completa de cobertura (20%) — Gate 3, avaliador independente
63
- - `.morph/framework/evals/trace-schema.md` — formato canônico do trace
64
- - `.morph/framework/MORPH.md` — seção 1 (papel Evaluator)
@@ -1,92 +0,0 @@
1
- <templateSet group="MORPH Templates">
2
- <template name="morph-pascal" value="{{pascalCase $FEATURE_NAME$}}" description="Convert to PascalCase (UserAuth)" toReformat="false" toShortenFQNames="true">
3
- <variable name="FEATURE_NAME" expression="" defaultValue="&quot;FEATURE_NAME&quot;" alwaysStopAt="true" />
4
- <context>
5
- <option name="OTHER" value="true" />
6
- </context>
7
- </template>
8
-
9
- <template name="morph-camel" value="{{camelCase $FEATURE_NAME$}}" description="Convert to camelCase (userAuth)" toReformat="false" toShortenFQNames="true">
10
- <variable name="FEATURE_NAME" expression="" defaultValue="&quot;FEATURE_NAME&quot;" alwaysStopAt="true" />
11
- <context>
12
- <option name="OTHER" value="true" />
13
- </context>
14
- </template>
15
-
16
- <template name="morph-snake" value="{{snakeCase $FEATURE_NAME$}}" description="Convert to snake_case (user_auth)" toReformat="false" toShortenFQNames="true">
17
- <variable name="FEATURE_NAME" expression="" defaultValue="&quot;FEATURE_NAME&quot;" alwaysStopAt="true" />
18
- <context>
19
- <option name="OTHER" value="true" />
20
- </context>
21
- </template>
22
-
23
- <template name="morph-title" value="{{titleCase $FEATURE_NAME$}}" description="Convert to Title Case (User Auth)" toReformat="false" toShortenFQNames="true">
24
- <variable name="FEATURE_NAME" expression="" defaultValue="&quot;FEATURE_NAME&quot;" alwaysStopAt="true" />
25
- <context>
26
- <option name="OTHER" value="true" />
27
- </context>
28
- </template>
29
-
30
- <template name="morph-kebab" value="{{kebabCase $FEATURE_NAME$}}" description="Convert to kebab-case (user-auth)" toReformat="false" toShortenFQNames="true">
31
- <variable name="FEATURE_NAME" expression="" defaultValue="&quot;FEATURE_NAME&quot;" alwaysStopAt="true" />
32
- <context>
33
- <option name="OTHER" value="true" />
34
- </context>
35
- </template>
36
-
37
- <template name="morph-if" value="{{#if $CONDITION$}}&#10; $END$&#10;{{/if}}" description="Handlebars if block" toReformat="false" toShortenFQNames="true">
38
- <variable name="CONDITION" expression="" defaultValue="&quot;condition&quot;" alwaysStopAt="true" />
39
- <context>
40
- <option name="OTHER" value="true" />
41
- </context>
42
- </template>
43
-
44
- <template name="morph-if-else" value="{{#if $CONDITION$}}&#10; $TRUE_BRANCH$&#10;{{else}}&#10; $FALSE_BRANCH$&#10;{{/if}}" description="Handlebars if-else block" toReformat="false" toShortenFQNames="true">
45
- <variable name="CONDITION" expression="" defaultValue="&quot;condition&quot;" alwaysStopAt="true" />
46
- <variable name="TRUE_BRANCH" expression="" defaultValue="&quot;&quot;" alwaysStopAt="true" />
47
- <variable name="FALSE_BRANCH" expression="" defaultValue="&quot;&quot;" alwaysStopAt="true" />
48
- <context>
49
- <option name="OTHER" value="true" />
50
- </context>
51
- </template>
52
-
53
- <template name="morph-each" value="{{#each $ITEMS$}}&#10; {{this.$PROPERTY$}}&#10;{{/each}}" description="Handlebars each loop" toReformat="false" toShortenFQNames="true">
54
- <variable name="ITEMS" expression="" defaultValue="&quot;items&quot;" alwaysStopAt="true" />
55
- <variable name="PROPERTY" expression="" defaultValue="&quot;name&quot;" alwaysStopAt="true" />
56
- <context>
57
- <option name="OTHER" value="true" />
58
- </context>
59
- </template>
60
-
61
- <template name="morph-service" value="namespace {{NAMESPACE}}.Application.Features.{{pascalCase FEATURE_NAME}}.Services;&#10;&#10;public class {{pascalCase FEATURE_NAME}}Service(&#10; I{{pascalCase FEATURE_NAME}}Repository repository,&#10; ILogger&lt;{{pascalCase FEATURE_NAME}}Service&gt; logger) : I{{pascalCase FEATURE_NAME}}Service&#10;{&#10; public async Task&lt;{{pascalCase FEATURE_NAME}}Dto?&gt; GetByIdAsync(int id, CancellationToken cancellationToken = default)&#10; {&#10; $END$&#10; }&#10;}" description="MORPH .NET Service class template" toReformat="false" toShortenFQNames="true">
62
- <context>
63
- <option name="C_SHARP" value="true" />
64
- </context>
65
- </template>
66
-
67
- <template name="morph-repository" value="public class {{pascalCase FEATURE_NAME}}Repository(AppDbContext context) : I{{pascalCase FEATURE_NAME}}Repository&#10;{&#10; private readonly DbSet&lt;{{pascalCase FEATURE_NAME}}&gt; _dbSet = context.Set&lt;{{pascalCase FEATURE_NAME}}&gt;();&#10;&#10; public async Task&lt;{{pascalCase FEATURE_NAME}}?&gt; GetByIdAsync(int id, CancellationToken cancellationToken = default)&#10; {&#10; $END$&#10; }&#10;}" description="MORPH .NET Repository class template" toReformat="false" toShortenFQNames="true">
68
- <context>
69
- <option name="C_SHARP" value="true" />
70
- </context>
71
- </template>
72
-
73
- <template name="morph-component" value="@page &quot;/{{kebabCase FEATURE_NAME}}&quot;&#10;@inject I{{pascalCase FEATURE_NAME}}Service {{pascalCase FEATURE_NAME}}Service&#10;@inject ILogger&lt;{{pascalCase FEATURE_NAME}}Page&gt; Logger&#10;&#10;&lt;PageTitle&gt;{{pascalCase FEATURE_NAME}}&lt;/PageTitle&gt;&#10;&#10;&lt;div class=&quot;container-fluid&quot;&gt;&#10; $END$&#10;&lt;/div&gt;&#10;&#10;@code {&#10;&#10;}" description="MORPH Blazor component template" toReformat="false" toShortenFQNames="true">
74
- <context>
75
- <option name="HTML" value="true" />
76
- </context>
77
- </template>
78
-
79
- <template name="morph-migration" value="public partial class Add{{pascalCase FEATURE_NAME}} : Migration&#10;{&#10; protected override void Up(MigrationBuilder migrationBuilder)&#10; {&#10; migrationBuilder.CreateTable(&#10; name: &quot;{{pascalCase FEATURE_NAME}}s&quot;,&#10; columns: table =&gt; new&#10; {&#10; Id = table.Column&lt;int&gt;(type: &quot;int&quot;, nullable: false)&#10; .Annotation(&quot;SqlServer:Identity&quot;, &quot;1, 1&quot;),&#10; $END$&#10; },&#10; constraints: table =&gt;&#10; {&#10; table.PrimaryKey(&quot;PK_{{pascalCase FEATURE_NAME}}s&quot;, x =&gt; x.Id);&#10; });&#10; }&#10;&#10; protected override void Down(MigrationBuilder migrationBuilder)&#10; {&#10; migrationBuilder.DropTable(name: &quot;{{pascalCase FEATURE_NAME}}s&quot;);&#10; }&#10;}" description="MORPH EF Core migration template" toReformat="false" toShortenFQNames="true">
80
- <context>
81
- <option name="C_SHARP" value="true" />
82
- </context>
83
- </template>
84
-
85
- <template name="morph-ts-contract" value="export interface {{pascalCase FEATURE_NAME}} {&#10; id: number;&#10; $FIELD1$&#10;}&#10;&#10;export interface Create{{pascalCase FEATURE_NAME}}Request {&#10; $FIELD2$&#10;}&#10;&#10;export interface Update{{pascalCase FEATURE_NAME}}Request {&#10; $END$&#10;}" description="MORPH TypeScript contract template" toReformat="false" toShortenFQNames="true">
86
- <variable name="FIELD1" expression="" defaultValue="&quot;&quot;" alwaysStopAt="true" />
87
- <variable name="FIELD2" expression="" defaultValue="&quot;&quot;" alwaysStopAt="true" />
88
- <context>
89
- <option name="TypeScript" value="true" />
90
- </context>
91
- </template>
92
- </templateSet>
@@ -1,186 +0,0 @@
1
- {
2
- "MORPH Template - PascalCase": {
3
- "prefix": "morph-pascal",
4
- "body": ["{{pascalCase ${1:FEATURE_NAME}}}"],
5
- "description": "Convert to PascalCase (UserAuth)"
6
- },
7
- "MORPH Template - camelCase": {
8
- "prefix": "morph-camel",
9
- "body": ["{{camelCase ${1:FEATURE_NAME}}}"],
10
- "description": "Convert to camelCase (userAuth)"
11
- },
12
- "MORPH Template - snake_case": {
13
- "prefix": "morph-snake",
14
- "body": ["{{snakeCase ${1:FEATURE_NAME}}}"],
15
- "description": "Convert to snake_case (user_auth)"
16
- },
17
- "MORPH Template - Title Case": {
18
- "prefix": "morph-title",
19
- "body": ["{{titleCase ${1:FEATURE_NAME}}}"],
20
- "description": "Convert to Title Case (User Auth)"
21
- },
22
- "MORPH Template - kebab-case": {
23
- "prefix": "morph-kebab",
24
- "body": ["{{kebabCase ${1:FEATURE_NAME}}}"],
25
- "description": "Convert to kebab-case (user-auth)"
26
- },
27
- "MORPH Template - UPPER_SNAKE_CASE": {
28
- "prefix": "morph-upper-snake",
29
- "body": ["{{upperSnakeCase ${1:FEATURE_NAME}}}"],
30
- "description": "Convert to UPPER_SNAKE_CASE (USER_AUTH)"
31
- },
32
- "MORPH Template - Conditional If": {
33
- "prefix": "morph-if",
34
- "body": [
35
- "{{#if ${1:condition}}}",
36
- " $2",
37
- "{{/if}}"
38
- ],
39
- "description": "Handlebars if block"
40
- },
41
- "MORPH Template - Conditional If-Else": {
42
- "prefix": "morph-if-else",
43
- "body": [
44
- "{{#if ${1:condition}}}",
45
- " $2",
46
- "{{else}}",
47
- " $3",
48
- "{{/if}}"
49
- ],
50
- "description": "Handlebars if-else block"
51
- },
52
- "MORPH Template - Each Loop": {
53
- "prefix": "morph-each",
54
- "body": [
55
- "{{#each ${1:items}}}",
56
- " {{this.$2}}",
57
- "{{/each}}"
58
- ],
59
- "description": "Handlebars each loop"
60
- },
61
- "MORPH Template - Unless": {
62
- "prefix": "morph-unless",
63
- "body": [
64
- "{{#unless ${1:condition}}}",
65
- " $2",
66
- "{{/unless}}"
67
- ],
68
- "description": "Handlebars unless block"
69
- },
70
- "MORPH Template - .NET Service Class": {
71
- "prefix": "morph-service",
72
- "body": [
73
- "namespace {{NAMESPACE}}.Application.Features.{{pascalCase FEATURE_NAME}}.Services;",
74
- "",
75
- "public class {{pascalCase FEATURE_NAME}}Service(",
76
- " I{{pascalCase FEATURE_NAME}}Repository repository,",
77
- " ILogger<{{pascalCase FEATURE_NAME}}Service> logger) : I{{pascalCase FEATURE_NAME}}Service",
78
- "{",
79
- " public async Task<{{pascalCase FEATURE_NAME}}Dto?> GetByIdAsync(int id, CancellationToken cancellationToken = default)",
80
- " {",
81
- " $1",
82
- " }",
83
- "}"
84
- ],
85
- "description": "MORPH .NET Service class template"
86
- },
87
- "MORPH Template - .NET Repository Class": {
88
- "prefix": "morph-repository",
89
- "body": [
90
- "public class {{pascalCase FEATURE_NAME}}Repository(AppDbContext context) : I{{pascalCase FEATURE_NAME}}Repository",
91
- "{",
92
- " private readonly DbSet<{{pascalCase FEATURE_NAME}}> _dbSet = context.Set<{{pascalCase FEATURE_NAME}}>();",
93
- "",
94
- " public async Task<{{pascalCase FEATURE_NAME}}?> GetByIdAsync(int id, CancellationToken cancellationToken = default)",
95
- " {",
96
- " $1",
97
- " }",
98
- "}"
99
- ],
100
- "description": "MORPH .NET Repository class template"
101
- },
102
- "MORPH Template - Blazor Component": {
103
- "prefix": "morph-component",
104
- "body": [
105
- "@page \"/{{kebabCase FEATURE_NAME}}\"",
106
- "@inject I{{pascalCase FEATURE_NAME}}Service {{pascalCase FEATURE_NAME}}Service",
107
- "@inject ILogger<{{pascalCase FEATURE_NAME}}Page> Logger",
108
- "",
109
- "<PageTitle>{{pascalCase FEATURE_NAME}}</PageTitle>",
110
- "",
111
- "<div class=\"container-fluid\">",
112
- " $1",
113
- "</div>",
114
- "",
115
- "@code {",
116
- " $2",
117
- "}"
118
- ],
119
- "description": "MORPH Blazor component template"
120
- },
121
- "MORPH Template - EF Core Migration": {
122
- "prefix": "morph-migration",
123
- "body": [
124
- "public partial class Add{{pascalCase FEATURE_NAME}} : Migration",
125
- "{",
126
- " protected override void Up(MigrationBuilder migrationBuilder)",
127
- " {",
128
- " migrationBuilder.CreateTable(",
129
- " name: \"{{pascalCase FEATURE_NAME}}s\",",
130
- " columns: table => new",
131
- " {",
132
- " Id = table.Column<int>(type: \"int\", nullable: false)",
133
- " .Annotation(\"SqlServer:Identity\", \"1, 1\"),",
134
- " $1",
135
- " },",
136
- " constraints: table =>",
137
- " {",
138
- " table.PrimaryKey(\"PK_{{pascalCase FEATURE_NAME}}s\", x => x.Id);",
139
- " });",
140
- " }",
141
- "",
142
- " protected override void Down(MigrationBuilder migrationBuilder)",
143
- " {",
144
- " migrationBuilder.DropTable(name: \"{{pascalCase FEATURE_NAME}}s\");",
145
- " }",
146
- "}"
147
- ],
148
- "description": "MORPH EF Core migration template"
149
- },
150
- "MORPH Template - Hangfire Job": {
151
- "prefix": "morph-job",
152
- "body": [
153
- "public class {{pascalCase FEATURE_NAME}}ProcessorJob(",
154
- " I{{pascalCase FEATURE_NAME}}Service service,",
155
- " ILogger<{{pascalCase FEATURE_NAME}}ProcessorJob> logger) : I{{pascalCase FEATURE_NAME}}ProcessorJob",
156
- "{",
157
- " [AutomaticRetry(Attempts = 3, DelaysInSeconds = new[] { 60, 300, 900 })]",
158
- " [Queue(\"default\")]",
159
- " [JobDisplayName(\"{{pascalCase FEATURE_NAME}} Processing - ID: {0}\")]",
160
- " public async Task ExecuteAsync(int id, CancellationToken cancellationToken)",
161
- " {",
162
- " $1",
163
- " }",
164
- "}"
165
- ],
166
- "description": "MORPH Hangfire job template"
167
- },
168
- "MORPH Template - TypeScript Contract": {
169
- "prefix": "morph-ts-contract",
170
- "body": [
171
- "export interface {{pascalCase FEATURE_NAME}} {",
172
- " id: number;",
173
- " $1",
174
- "}",
175
- "",
176
- "export interface Create{{pascalCase FEATURE_NAME}}Request {",
177
- " $2",
178
- "}",
179
- "",
180
- "export interface Update{{pascalCase FEATURE_NAME}}Request {",
181
- " $3",
182
- "}"
183
- ],
184
- "description": "MORPH TypeScript contract template"
185
- }
186
- }