@polymorphism-tech/morph-spec 4.8.1 → 4.8.4

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 (44) hide show
  1. package/README.md +2 -2
  2. package/claude-plugin.json +1 -1
  3. package/docs/CHEATSHEET.md +1 -1
  4. package/docs/QUICKSTART.md +1 -1
  5. package/framework/hooks/dev/guard-version-numbers.js +1 -1
  6. package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +1 -1
  7. package/framework/skills/level-1-workflows/phase-codebase-analysis/SKILL.md +1 -1
  8. package/framework/skills/level-1-workflows/phase-design/SKILL.md +1 -1
  9. package/framework/skills/level-1-workflows/phase-implement/SKILL.md +1 -1
  10. package/framework/skills/level-1-workflows/phase-setup/SKILL.md +1 -1
  11. package/framework/skills/level-1-workflows/phase-tasks/SKILL.md +1 -1
  12. package/framework/skills/level-1-workflows/phase-uiux/SKILL.md +1 -1
  13. package/package.json +4 -4
  14. package/.morph/analytics/threads-log.jsonl +0 -54
  15. package/.morph/state.json +0 -198
  16. package/docs/ARCHITECTURE.md +0 -328
  17. package/docs/COMMAND-FLOWS.md +0 -398
  18. package/docs/plans/2026-02-22-claude-docs-morph-alignment-analysis.md +0 -514
  19. package/docs/plans/2026-02-22-claude-settings.md +0 -517
  20. package/docs/plans/2026-02-22-morph-cc-alignment-impl.md +0 -730
  21. package/docs/plans/2026-02-22-morph-spec-next.md +0 -480
  22. package/docs/plans/2026-02-22-native-alignment-design.md +0 -201
  23. package/docs/plans/2026-02-22-native-alignment-impl.md +0 -927
  24. package/docs/plans/2026-02-22-native-enrichment-design.md +0 -246
  25. package/docs/plans/2026-02-22-native-enrichment.md +0 -737
  26. package/docs/plans/2026-02-23-ddd-architecture-refactor.md +0 -1155
  27. package/docs/plans/2026-02-23-ddd-nextsteps.md +0 -684
  28. package/docs/plans/2026-02-23-infra-architect-refactor.md +0 -439
  29. package/docs/plans/2026-02-23-nextjs-code-review-design.md +0 -157
  30. package/docs/plans/2026-02-23-nextjs-code-review-impl.md +0 -1256
  31. package/docs/plans/2026-02-23-nextjs-standards-design.md +0 -150
  32. package/docs/plans/2026-02-23-nextjs-standards-impl.md +0 -1848
  33. package/docs/plans/2026-02-24-cli-radical-simplification.md +0 -592
  34. package/docs/plans/2026-02-24-framework-failure-points.md +0 -125
  35. package/docs/plans/2026-02-24-morph-init-design.md +0 -337
  36. package/docs/plans/2026-02-24-morph-init-impl.md +0 -1269
  37. package/docs/plans/2026-02-24-tutorial-command-design.md +0 -71
  38. package/docs/plans/2026-02-24-tutorial-command.md +0 -298
  39. package/scripts/bump-version.js +0 -248
  40. package/scripts/generate-refs.js +0 -336
  41. package/scripts/generate-standards-registry.js +0 -44
  42. package/scripts/install-dev-hooks.js +0 -138
  43. package/scripts/scan-nextjs.mjs +0 -169
  44. package/scripts/validate-real.mjs +0 -255
@@ -1,592 +0,0 @@
1
- # CLI Radical Simplification Plan
2
-
3
- **Status:** COMPLETE
4
-
5
- > **For Claude:** REQUIRED SUB-SKILL: Use `superpowers:executing-plans` to implement this plan task-by-task.
6
-
7
- **Goal:** Reduzir a superfície CLI para apenas comandos chamados internamente pelo framework (hooks/skills/outros comandos), mantendo `doctor`, `init` e `update` como únicos comandos de usuário. Remover ~25 comandos e arquivos de lib orfãos.
8
-
9
- **Architecture:** Remoção em fases: (1) integração de `markOutput` no recap-generator via TDD, (2) limpeza de bin/morph-spec.js, (3) deleção de arquivos de comando, (4) remoção de código morto em arquivos que ficam, (5) limpeza de libs e testes orfãos, (6) verificação da suite.
10
-
11
- **Tech Stack:** Node.js ESM, Commander.js, node:test
12
-
13
- ---
14
-
15
- ## Princípio de decisão
16
-
17
- | Categoria | Critério | Ação |
18
- |-----------|----------|------|
19
- | User-facing (permitido) | `doctor`, `init`, `update` | Manter |
20
- | Framework-internal | Chamado por hook, skill ou outro comando CLI | Manter |
21
- | Deveria ser chamado mas não é | Gap de integração | Integrar automaticamente |
22
- | Nunca chamado por ninguém | Dead code | Remover |
23
-
24
- ---
25
-
26
- ## Mapa final: o que fica
27
-
28
- ```
29
- bin/morph-spec.js registra apenas:
30
- init ← user
31
- update ← user
32
- doctor ← user
33
- state ← framework (init/get/set/list/mark-output/add-agent/remove-agent)
34
- validate-phase ← framework (chamado por phase advance)
35
- phase advance ← framework (skills + dispatch.js)
36
- task done/start/next ← framework (skills + dispatch.js)
37
- approve ← framework (dispatch.js + skills)
38
- approval-status ← framework (skills)
39
- validate ← framework (verification-before-completion skill)
40
- validate-feature ← framework (chamado por task done)
41
- checkpoint-save/restore/list ← framework (dispatch.js + skills)
42
- mcp setup ← framework (chamado por init)
43
- template render ← framework (skills de fase)
44
- trust set/status ← framework (futuro: skill de configuração)
45
- generate recap ← framework (phase-implement skill)
46
- ```
47
-
48
- ---
49
-
50
- ## Task 1: TDD — markOutput automático no recap-generator
51
-
52
- **Por quê primeiro:** Única mudança de comportamento do plano. Feita antes da limpeza para garantir que não quebramos nada.
53
-
54
- **Files:**
55
- - Modify: `src/lib/generators/recap-generator.js`
56
- - Test: `test/lib/recap-generator.test.js` (criar se não existir)
57
-
58
- **Step 1: Verificar se o arquivo de teste existe**
59
-
60
- ```bash
61
- node -e "require('fs').existsSync('test/lib/recap-generator.test.js') && console.log('exists')"
62
- ```
63
-
64
- Se não existir, criar o arquivo na próxima etapa.
65
-
66
- **Step 2: Escrever o teste que falha**
67
-
68
- Em `test/lib/recap-generator.test.js`, adicionar:
69
-
70
- ```javascript
71
- import { describe, it, mock, beforeEach } from 'node:test';
72
- import assert from 'node:assert/strict';
73
-
74
- describe('generateRecap - markOutput integration', () => {
75
- it('calls markOutput with "recap" after writing the file', async () => {
76
- // Arrange: mock state-manager and validation-runner
77
- const calls = [];
78
-
79
- // We'll test this via the exported function's side effects
80
- // Verify markOutput is imported and called
81
- const { generateRecap } = await import('../../src/lib/generators/recap-generator.js');
82
- assert.ok(typeof generateRecap === 'function', 'generateRecap should be exported');
83
- });
84
- });
85
- ```
86
-
87
- **Step 3: Verificar que o teste roda**
88
-
89
- ```bash
90
- node --test test/lib/recap-generator.test.js
91
- ```
92
-
93
- **Step 4: Adicionar import de markOutput em recap-generator.js**
94
-
95
- Localizar linha 13 em `src/lib/generators/recap-generator.js`:
96
- ```javascript
97
- import { loadState } from '../../core/state/state-manager.js';
98
- ```
99
-
100
- Trocar por:
101
- ```javascript
102
- import { loadState, markOutput } from '../../core/state/state-manager.js';
103
- ```
104
-
105
- **Step 5: Chamar markOutput após gravar o arquivo**
106
-
107
- Localizar onde `writeFileSync(recapPath, recapContent)` é chamado (ou onde o recap é salvo) e adicionar após:
108
-
109
- ```javascript
110
- // Auto-mark recap output as created in state
111
- try {
112
- await markOutput(featureName, 'recap');
113
- } catch {
114
- // Non-fatal: state may not exist in all contexts
115
- }
116
- ```
117
-
118
- **Step 6: Rodar suite completa**
119
-
120
- ```bash
121
- node --test
122
- ```
123
-
124
- Expected: mesma quantidade de passes que antes (sem regressões).
125
-
126
- **Step 7: Commit**
127
-
128
- ```bash
129
- git add src/lib/generators/recap-generator.js test/lib/recap-generator.test.js
130
- git commit -m "feat(recap): auto-call markOutput after generating recap.md"
131
- ```
132
-
133
- ---
134
-
135
- ## Task 2: Limpar bin/morph-spec.js — remover imports e registros
136
-
137
- **Files:**
138
- - Modify: `bin/morph-spec.js`
139
-
140
- Esta é a mudança mais longa: remover ~35 linhas de imports e ~150 linhas de registros de comando.
141
-
142
- **Step 1: Remover imports de comandos sendo deletados**
143
-
144
- Encontrar e remover os seguintes blocos de import em `bin/morph-spec.js`:
145
-
146
- ```javascript
147
- // REMOVER — update-agents
148
- import { updateAgentsCommand } from '../src/commands/project/update-agents.js';
149
-
150
- // REMOVER — sync
151
- import { syncCommand } from '../src/commands/project/sync.js';
152
-
153
- // REMOVER — changes
154
- import { changesCommand } from '../src/commands/project/changes.js';
155
-
156
- // REMOVER — story commands (feature/)
157
- import { createStoryCommand } from '../src/commands/feature/create-story.js';
158
- import { shardSpecCommand } from '../src/commands/feature/shard-spec.js';
159
- import { sprintStatusCommand } from '../src/commands/feature/sprint-status.js';
160
-
161
- // REMOVER — rollback
162
- import { rollbackPhaseCommand } from '../src/commands/state/rollback-phase.js';
163
-
164
- // REMOVER — reject (manter approve + approvalStatus)
165
- // Alterar: import { approveCommand, rejectCommand, approvalStatusCommand }
166
- // Para: import { approveCommand, approvalStatusCommand }
167
-
168
- // REMOVER — generate design-system e metadata (manter apenas recap)
169
- // Alterar: import { generateDesignSystemCommand, generateMetadataCommand }
170
- // Para: (sem import desses dois — gerarRecap vem do lib direto)
171
-
172
- // REMOVER — generate onboarding
173
- import { generateOnboardingCommand } from '../src/commands/generation/generate-onboarding.js';
174
-
175
- // REMOVER — validate-blazor, lint-fluent, analyze-blazor-concurrency, validate-blazor-state, validate-css
176
- import { validateBlazorCommand } from '../src/commands/validation/validate-blazor.js';
177
- import { lintFluentCommand } from '../src/commands/validation/lint-fluent.js';
178
- import { analyzeBlazorConcurrencyCommand } from '../src/commands/validation/analyze-blazor-concurrency.js';
179
- import { validateBlazorStateCommand } from '../src/commands/validation/validate-blazor-state.js';
180
- import { validateCssCommand } from '../src/commands/validation/validate-css.js';
181
-
182
- // REMOVER — template list/show/customize/validate (manter render)
183
- import { templateListCommand } from '../src/commands/templates/template-list.js';
184
- import { templateShowCommand } from '../src/commands/templates/template-show.js';
185
- import { templateCustomizeCommand } from '../src/commands/templates/template-customize.js';
186
- import { templateValidateCommand } from '../src/commands/templates/template-validate.js';
187
-
188
- // REMOVER — learning (capturePatternProgram, searchPatternsProgram)
189
- import capturePatternProgram from '../src/commands/learning/capture-pattern.js';
190
- import searchPatternsProgram from '../src/commands/learning/search-patterns.js';
191
-
192
- // REMOVER — troubleshoot
193
- import troubleshootCommand from '../src/commands/utils/troubleshoot.js';
194
-
195
- // REMOVER — mcp optimize/list (manter mcpSetupCommand)
196
- import { mcpOptimizeCommand, mcpListCommand } from '../src/commands/mcp/mcp.js';
197
-
198
- // REMOVER — trust history/auto-calculate/clear (manter status + set)
199
- // Alterar: import { trustStatusCommand, trustSetCommand, trustHistoryCommand, trustAutoCalculateCommand, trustClearCommand }
200
- // Para: import { trustStatusCommand, trustSetCommand }
201
-
202
- // REMOVER — LearningSystem class (era usado por learn commands)
203
- import { LearningSystem } from '../src/lib/learning/learning-system.js';
204
-
205
- // REMOVER — diff/diff-save, cost, revert, checkpoint-* para checkpoint-save/restore/list
206
- import { diffCommand, diffSaveCommand } from '../src/commands/project/diff.js';
207
- import { costCommand } from '../src/commands/project/cost.js';
208
- import { revertCommand } from '../src/commands/project/revert.js';
209
- ```
210
-
211
- **Step 2: Remover registros de comando em bin/morph-spec.js**
212
-
213
- Remover os seguintes blocos `program.command(...)` e `storyCommand/learnCommand/mcpCommand` sub-commands:
214
-
215
- - Bloco `update-agents` (~4 linhas)
216
- - Bloco `sync` (~5 linhas)
217
- - Bloco `changes` (~4 linhas)
218
- - Bloco `story` completo — incluindo `storyCommand` const + create + shard + status (~25 linhas)
219
- - Bloco `rollback` (~6 linhas)
220
- - Bloco `reject` (~4 linhas) — manter `approve` e `approval-status`
221
- - Bloco `generate design-system` (~15 linhas) — manter apenas `generate recap`
222
- - Bloco `generate metadata` (~8 linhas)
223
- - Bloco `generate onboarding` (~4 linhas)
224
- - Bloco `validate-blazor` (~5 linhas)
225
- - Bloco `lint-fluent` (~5 linhas)
226
- - Bloco `analyze-blazor-concurrency` (~5 linhas)
227
- - Bloco `validate-blazor-state` (~5 linhas)
228
- - Bloco `validate-css` (~8 linhas)
229
- - Blocos `learn` completo — incluindo `learnCommand` const + analyze + insights + suggest + reset (~60 linhas)
230
- - Bloco `standards` (~18 linhas)
231
- - Blocos `template list/show/customize/validate` (~40 linhas) — manter `template render`
232
- - Blocos `trust history/auto-calculate/clear` (~15 linhas) — manter `trust status` e `trust set`
233
- - Bloco `troubleshoot` (~8 linhas)
234
- - `mcpCommand.command('optimize')` + `mcpCommand.command('list')` (~8 linhas) — manter `mcp setup`
235
- - `program.addCommand(capturePatternProgram)` (~1 linha)
236
- - `program.addCommand(searchPatternsProgram)` (~1 linha)
237
- - Blocos `diff/diff-save` (~8 linhas)
238
- - Bloco `cost` (~5 linhas)
239
- - Bloco `revert` (~6 linhas)
240
-
241
- **Step 3: Verificar que bin ainda funciona**
242
-
243
- ```bash
244
- node bin/morph-spec.js --help
245
- ```
246
-
247
- Expected: help menu sem erros; apenas comandos mantidos listados.
248
-
249
- **Step 4: Rodar suite**
250
-
251
- ```bash
252
- node --test
253
- ```
254
-
255
- Expected: mesma quantidade de passes. Se houver falhas por imports quebrados, verificar se algum import foi esquecido.
256
-
257
- **Step 5: Commit**
258
-
259
- ```bash
260
- git add bin/morph-spec.js
261
- git commit -m "refactor(cli): remove 25+ user-facing commands from CLI surface"
262
- ```
263
-
264
- ---
265
-
266
- ## Task 3: Deletar arquivos de comando removidos
267
-
268
- **Files to DELETE (use `git rm` para cada um):**
269
-
270
- ```bash
271
- # Feature commands
272
- git rm src/commands/feature/create-story.js
273
- git rm src/commands/feature/shard-spec.js
274
- git rm src/commands/feature/sprint-status.js
275
- git rm src/commands/feature/index.js
276
-
277
- # Project commands
278
- git rm src/commands/project/update-agents.js
279
- git rm src/commands/project/sync.js
280
- git rm src/commands/project/changes.js
281
- git rm src/commands/project/diff.js
282
- git rm src/commands/project/cost.js
283
- git rm src/commands/project/revert.js
284
- git rm src/commands/project/standards.js
285
-
286
- # State commands
287
- git rm src/commands/state/rollback-phase.js
288
-
289
- # Validation commands (standalone wrappers — libs ficam)
290
- git rm src/commands/validation/validate-blazor.js
291
- git rm src/commands/validation/validate-blazor-state.js
292
- git rm src/commands/validation/validate-css.js
293
- git rm src/commands/validation/lint-fluent.js
294
- git rm src/commands/validation/analyze-blazor-concurrency.js
295
-
296
- # Template commands (manter render)
297
- git rm src/commands/templates/template-list.js
298
- git rm src/commands/templates/template-show.js
299
- git rm src/commands/templates/template-customize.js
300
- git rm src/commands/templates/template-validate.js
301
-
302
- # Utils + learning
303
- git rm src/commands/utils/troubleshoot.js
304
- git rm src/commands/learning/capture-pattern.js
305
- git rm src/commands/learning/search-patterns.js
306
- git rm src/commands/learning/index.js
307
-
308
- # MCP (apenas optimize/list)
309
- git rm src/commands/mcp/mcp.js
310
-
311
- # Generation (manter recap via lib; remover generate.js que tinha design-system/metadata)
312
- git rm src/commands/generation/generate-onboarding.js
313
- ```
314
-
315
- **Nota sobre generate.js:** Este arquivo contém `generateDesignSystemCommand` e `generateMetadataCommand`. Como `generate recap` vai diretamente para a lib (`recap-generator.js`), o arquivo `generate.js` (que tinha design-system e metadata) pode ser deletado inteiro:
316
-
317
- ```bash
318
- git rm src/commands/generation/generate.js
319
- ```
320
-
321
- E em `bin/morph-spec.js`, o subcommand `generate recap` já invoca `generateRecap` do lib diretamente (via dynamic import inline), então não precisa de import de `generate.js`.
322
-
323
- **Nota sobre generate-onboarding.js:** Deletado acima.
324
-
325
- **Nota sobre generation/index.js:** Verificar se ainda é usado após remover generate.js e generate-onboarding.js:
326
- ```bash
327
- grep -r "generation/index" bin/ src/ --include="*.js"
328
- ```
329
- Se nenhum resultado → deletar:
330
- ```bash
331
- git rm src/commands/generation/index.js
332
- ```
333
-
334
- **Step 1: Executar todos os `git rm` acima**
335
-
336
- **Step 2: Rodar suite**
337
-
338
- ```bash
339
- node --test
340
- ```
341
-
342
- Expected: sem novas falhas. Se algum arquivo deletado ainda era importado em algum test, a falha apontará o arquivo.
343
-
344
- **Step 3: Commit**
345
-
346
- ```bash
347
- git add -A
348
- git commit -m "refactor(cli): delete source files for removed commands"
349
- ```
350
-
351
- ---
352
-
353
- ## Task 4: Slim down arquivos que ficam (remover código morto interno)
354
-
355
- ### 4a: `src/commands/state/approve.js` — remover rejectCommand
356
-
357
- **File:** `src/commands/state/approve.js`
358
-
359
- Remover:
360
- 1. A função `rejectCommand` (export async function rejectCommand...)
361
- 2. O bloco que registra o comando `reject` no Commander program interno do arquivo (`program.command('reject ...')`)
362
-
363
- Manter: `approveCommand`, `approvalStatusCommand`, e as importações que eles usam.
364
-
365
- **Verificar que o arquivo ainda exporta corretamente:**
366
- ```bash
367
- node -e "import('./src/commands/state/approve.js').then(m => console.log(Object.keys(m)))"
368
- ```
369
- Expected: `['approveCommand', 'approvalStatusCommand', 'default']` (sem rejectCommand)
370
-
371
- ### 4b: `src/commands/state/state.js` — remover case 'checkpoint'
372
-
373
- **File:** `src/commands/state/state.js`
374
-
375
- Localizar o case `'checkpoint'` no switch/router (linha ~34):
376
- ```javascript
377
- case 'checkpoint':
378
- await checkpointCommand(args[0], args.slice(1).join(' '), options);
379
- break;
380
- ```
381
- E a função `checkpointCommand` (linha ~194).
382
-
383
- Remover ambos. Atualizar o help text na linha ~58 para remover "checkpoint" da lista.
384
-
385
- ### 4c: `src/commands/trust/trust.js` — remover history/auto-calculate/clear
386
-
387
- **File:** `src/commands/trust/trust.js`
388
-
389
- Remover as funções:
390
- - `trustHistoryCommand` (linha ~121)
391
- - `trustAutoCalculateCommand` (linha ~156)
392
- - `trustClearCommand` (linha ~196)
393
-
394
- Manter: `trustStatusCommand`, `trustSetCommand`.
395
-
396
- Remover imports que só eram usados por essas funções (se houver).
397
-
398
- ### 4d: `src/commands/generation/generate.js` — verificação (já foi deletado na Task 3)
399
-
400
- Se o arquivo foi deletado, pular. Se ainda existe com apenas código de design-system/metadata, confirmar a deleção.
401
-
402
- **Step: Rodar suite após todas as alterações do Task 4**
403
-
404
- ```bash
405
- node --test
406
- ```
407
-
408
- **Step: Commit**
409
-
410
- ```bash
411
- git add src/commands/state/approve.js src/commands/state/state.js src/commands/trust/trust.js
412
- git commit -m "refactor(cli): remove dead code from approve.js, state.js, trust.js"
413
- ```
414
-
415
- ---
416
-
417
- ## Task 5: Deletar lib files orfãos
418
-
419
- **Files to DELETE:**
420
-
421
- ```bash
422
- # Troubleshooting lib — só usado por troubleshoot.js (deletado)
423
- git rm src/lib/troubleshooting/troubleshoot-grep.js
424
- git rm src/lib/troubleshooting/troubleshoot-index.js
425
- ```
426
-
427
- Verificar se o diretório troubleshooting ainda tem outros arquivos:
428
- ```bash
429
- ls src/lib/troubleshooting/
430
- ```
431
- Se vazio (ou só index.js que re-exportava os dois), deletar o diretório também:
432
- ```bash
433
- git rm src/lib/troubleshooting/index.js
434
- # ou rmdir via git rm -r
435
- ```
436
-
437
- ```bash
438
- # Conversation analyzer — só usado por sync.js (deletado)
439
- git rm src/lib/detectors/conversation-analyzer.js
440
- ```
441
-
442
- Verificar se detectors/index.js ainda re-exporta conversation-analyzer:
443
- ```bash
444
- grep "conversation-analyzer" src/lib/detectors/index.js
445
- ```
446
- Se sim, remover essa linha do index.js.
447
-
448
- **Nota: NÃO deletar:**
449
- - `src/lib/generators/design-system-generator.js` — usado por `design-system-validator.js` e testes
450
- - `src/lib/generators/metadata-extractor.js` — usado por testes de integração
451
- - `src/lib/validators/blazor/` — usado por `validation-runner.js` via registry
452
- - `src/lib/learning/learning-system.js` — verificar se é usado por algo além dos learning commands
453
-
454
- **Verificar learning-system.js:**
455
- ```bash
456
- grep -r "learning-system" src/ bin/ --include="*.js" | grep -v "learning/capture\|learning/search\|learning/index"
457
- ```
458
- Se nenhum resultado além dos arquivos já deletados → deletar:
459
- ```bash
460
- git rm src/lib/learning/learning-system.js
461
- ```
462
- Verificar se há outros arquivos em `src/lib/learning/`:
463
- ```bash
464
- ls src/lib/learning/
465
- ```
466
- Deletar todos os orfãos.
467
-
468
- **Step: Rodar suite**
469
-
470
- ```bash
471
- node --test
472
- ```
473
-
474
- **Step: Commit**
475
-
476
- ```bash
477
- git add -A
478
- git commit -m "refactor(cli): delete orphaned lib files (troubleshooting, learning, conversation-analyzer)"
479
- ```
480
-
481
- ---
482
-
483
- ## Task 6: Deletar test files orfãos + corrigir imports quebrados
484
-
485
- **Files to DELETE:**
486
-
487
- ```bash
488
- git rm test/commands/standards.test.js
489
- git rm test/commands/update-agents.test.js
490
- ```
491
-
492
- **Verificar outros arquivos de teste com imports para arquivos deletados:**
493
-
494
- ```bash
495
- node --test 2>&1 | grep "ERR_MODULE_NOT_FOUND\|Cannot find"
496
- ```
497
-
498
- Para cada erro encontrado, localizar o arquivo de teste e:
499
- - Se o teste é exclusivo do comando deletado → `git rm` o arquivo
500
- - Se o teste tem outras assertions válidas → remover apenas o import/bloco referente ao comando deletado
501
-
502
- **Verificar `test/integration/v3-full-workflow.test.js`:**
503
- Este arquivo importa `searchPatternsCommand`. Remover esse import e qualquer assertion que dependa dele.
504
-
505
- ```bash
506
- grep -n "searchPatterns\|capture-pattern\|LearningSystem" test/integration/v3-full-workflow.test.js
507
- ```
508
-
509
- Remover as linhas encontradas.
510
-
511
- **Step: Rodar suite completa**
512
-
513
- ```bash
514
- node --test
515
- ```
516
-
517
- Expected: 0 falhas relacionadas a arquivos deletados. Total de testes pode cair (tests deletados), mas nenhum teste válido deve quebrar.
518
-
519
- **Step: Commit**
520
-
521
- ```bash
522
- git add -A
523
- git commit -m "test: remove test files for deleted CLI commands"
524
- ```
525
-
526
- ---
527
-
528
- ## Task 7: Verificação final e atualização de documentação
529
-
530
- **Step 1: Rodar suite completa e capturar resultado**
531
-
532
- ```bash
533
- node --test 2>&1 | tail -5
534
- ```
535
-
536
- Expected:
537
- - Todos os testes existentes passando
538
- - Contagem de testes menor (removemos arquivos de teste)
539
- - 0 falhas novas
540
-
541
- **Step 2: Verificar CLI surface**
542
-
543
- ```bash
544
- node bin/morph-spec.js --help
545
- ```
546
-
547
- Expected: apenas os comandos mantidos visíveis.
548
-
549
- **Step 3: Verificar comandos específicos ainda funcionam**
550
-
551
- ```bash
552
- node bin/morph-spec.js state --help
553
- node bin/morph-spec.js task --help
554
- node bin/morph-spec.js generate --help
555
- node bin/morph-spec.js template --help
556
- node bin/morph-spec.js trust --help
557
- node bin/morph-spec.js mcp --help
558
- ```
559
-
560
- **Step 4: Atualizar CHEATSHEET e README**
561
-
562
- Remover referências aos comandos deletados em:
563
- - `docs/CHEATSHEET.md`
564
- - `README.md`
565
-
566
- Não criar nova documentação — apenas remover entradas dos comandos deletados.
567
-
568
- **Step 5: Commit final**
569
-
570
- ```bash
571
- git add docs/CHEATSHEET.md README.md
572
- git commit -m "docs: remove documentation for deleted CLI commands"
573
- ```
574
-
575
- ---
576
-
577
- ## Resumo: o que muda
578
-
579
- ### Comandos removidos (~25)
580
- `update-agents`, `sync`, `changes`, `story create/shard/status`, `rollback`, `reject`, `generate design-system`, `generate metadata`, `generate onboarding`, `validate-blazor`, `validate-blazor-state`, `validate-css`, `lint-fluent`, `analyze-blazor-concurrency`, `template list/show/customize/validate`, `standards`, `trust history/auto-calculate/clear`, `troubleshoot`, `mcp optimize/list`, `learn *`, `capture-pattern`, `search-patterns`, `diff/diff-save`, `cost`, `revert`, `state checkpoint`
581
-
582
- ### Arquivos de comando deletados (~24 arquivos)
583
- Ver Task 3.
584
-
585
- ### Lib files deletados (~3-5 arquivos)
586
- `troubleshoot-grep.js`, `troubleshoot-index.js`, `conversation-analyzer.js`, arquivos de `src/lib/learning/`
587
-
588
- ### Integração adicionada (1)
589
- `recap-generator.js` → auto-chama `markOutput('recap')` após gravar arquivo
590
-
591
- ### Comportamento idêntico para o framework
592
- Todos os comandos chamados por hooks, skills e outros comandos continuam funcionando exatamente como antes.