@polymorphism-tech/morph-spec 4.2.0 → 4.3.1

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 (140) hide show
  1. package/CLAUDE.md +108 -946
  2. package/bin/morph-spec.js +284 -9
  3. package/bin/task-manager.cjs +102 -14
  4. package/bin/validate.js +4 -4
  5. package/docs/{v3.0 → next-generation}/AGENTS.md +1 -1
  6. package/docs/next-generation/CONTEXT-OPTIMIZATION.md +267 -0
  7. package/docs/next-generation/EXECUTION-FLOW.md +274 -0
  8. package/docs/next-generation/META-PROMPTS.md +235 -0
  9. package/docs/next-generation/MIGRATION-GUIDE.md +253 -0
  10. package/docs/next-generation/THREAD-MANAGEMENT.md +240 -0
  11. package/package.json +5 -5
  12. package/src/commands/agents/agents-fuse.js +97 -0
  13. package/src/commands/agents/micro-agent.js +112 -0
  14. package/src/commands/agents/spawn-team.js +69 -4
  15. package/src/commands/agents/squad-template.js +146 -0
  16. package/src/commands/analytics/analytics.js +176 -0
  17. package/src/commands/context/context-prime.js +63 -0
  18. package/src/commands/context/core-four.js +54 -0
  19. package/src/commands/mcp/mcp.js +102 -0
  20. package/src/commands/project/detect-agents.js +32 -2
  21. package/src/commands/project/detect.js +11 -1
  22. package/src/commands/project/doctor.js +573 -356
  23. package/src/commands/project/init.js +9 -2
  24. package/src/commands/project/update.js +13 -3
  25. package/src/commands/state/advance-phase.js +448 -416
  26. package/src/commands/state/state.js +14 -12
  27. package/src/commands/tasks/task.js +1 -1
  28. package/src/commands/templates/template-render.js +80 -1
  29. package/src/commands/threads/thread-template.js +103 -0
  30. package/src/commands/threads/threads.js +261 -0
  31. package/src/commands/trust/trust.js +205 -0
  32. package/src/{orchestrator.js → core/orchestrator.js} +8 -8
  33. package/src/core/state/state-manager.js +37 -17
  34. package/src/core/workflows/workflow-detector.js +114 -3
  35. package/src/lib/agents/micro-agent-factory.js +161 -0
  36. package/src/lib/analytics/analytics-engine.js +345 -0
  37. package/src/lib/checkpoints/checkpoint-hooks.js +298 -258
  38. package/src/lib/context/context-bundler.js +240 -0
  39. package/src/lib/context/context-optimizer.js +212 -0
  40. package/src/lib/context/context-tracker.js +273 -0
  41. package/src/lib/context/core-four-tracker.js +201 -0
  42. package/src/lib/context/mcp-optimizer.js +200 -0
  43. package/src/lib/detectors/index.js +1 -1
  44. package/src/lib/detectors/standards-generator.js +77 -17
  45. package/src/lib/detectors/structure-detector.js +67 -39
  46. package/src/lib/execution/fusion-executor.js +304 -0
  47. package/src/lib/execution/parallel-executor.js +270 -0
  48. package/src/lib/generators/context-generator.js +3 -3
  49. package/src/lib/generators/recap-generator.js +32 -12
  50. package/src/lib/hooks/hook-executor.js +169 -0
  51. package/src/lib/hooks/stop-hook-executor.js +286 -0
  52. package/src/lib/hops/hop-composer.js +221 -0
  53. package/src/lib/threads/thread-coordinator.js +238 -0
  54. package/src/lib/threads/thread-manager.js +317 -0
  55. package/src/lib/tracking/artifact-trail.js +202 -0
  56. package/src/lib/trust/trust-manager.js +269 -0
  57. package/src/lib/validators/design-system/design-system-validator.js +2 -2
  58. package/src/lib/validators/validation-runner.js +14 -30
  59. package/src/utils/hooks-installer.js +69 -0
  60. package/stacks/blazor-azure/.morph/config/agents.json +72 -3
  61. package/stacks/nextjs-supabase/.morph/config/agents.json +3 -3
  62. package/docs/llm-interaction-config.md +0 -735
  63. package/docs/v3.0/EXECUTION-FLOW.md +0 -1304
  64. package/src/commands/utils/migrate-state.js +0 -158
  65. package/src/commands/utils/upgrade.js +0 -346
  66. package/src/lib/validators/architecture-validator.js +0 -60
  67. package/src/lib/validators/content-validator.js +0 -164
  68. package/src/lib/validators/package-validator.js +0 -61
  69. package/src/lib/validators/ui-contrast-validator.js +0 -44
  70. package/stacks/blazor-azure/.claude/commands/morph-apply.md +0 -221
  71. package/stacks/blazor-azure/.claude/commands/morph-archive.md +0 -79
  72. package/stacks/blazor-azure/.claude/commands/morph-deploy.md +0 -529
  73. package/stacks/blazor-azure/.claude/commands/morph-infra.md +0 -209
  74. package/stacks/blazor-azure/.claude/commands/morph-preflight.md +0 -227
  75. package/stacks/blazor-azure/.claude/commands/morph-proposal.md +0 -122
  76. package/stacks/blazor-azure/.claude/commands/morph-status.md +0 -86
  77. package/stacks/blazor-azure/.claude/commands/morph-troubleshoot.md +0 -122
  78. package/stacks/blazor-azure/.claude/skills/level-0-meta/README.md +0 -7
  79. package/stacks/blazor-azure/.claude/skills/level-0-meta/code-review.md +0 -226
  80. package/stacks/blazor-azure/.claude/skills/level-0-meta/morph-checklist.md +0 -117
  81. package/stacks/blazor-azure/.claude/skills/level-0-meta/simulation-checklist.md +0 -77
  82. package/stacks/blazor-azure/.claude/skills/level-1-workflows/README.md +0 -7
  83. package/stacks/blazor-azure/.claude/skills/level-1-workflows/morph-replicate.md +0 -213
  84. package/stacks/blazor-azure/.claude/skills/level-1-workflows/phase-clarify.md +0 -131
  85. package/stacks/blazor-azure/.claude/skills/level-1-workflows/phase-design.md +0 -213
  86. package/stacks/blazor-azure/.claude/skills/level-1-workflows/phase-setup.md +0 -106
  87. package/stacks/blazor-azure/.claude/skills/level-1-workflows/phase-tasks.md +0 -164
  88. package/stacks/blazor-azure/.claude/skills/level-1-workflows/phase-uiux.md +0 -169
  89. package/stacks/blazor-azure/.claude/skills/level-2-domains/README.md +0 -14
  90. package/stacks/blazor-azure/.claude/skills/level-2-domains/ai-agents/ai-system-architect.md +0 -192
  91. package/stacks/blazor-azure/.claude/skills/level-2-domains/architecture/po-pm-advisor.md +0 -197
  92. package/stacks/blazor-azure/.claude/skills/level-2-domains/architecture/prompt-engineer.md +0 -189
  93. package/stacks/blazor-azure/.claude/skills/level-2-domains/architecture/seo-growth-hacker.md +0 -320
  94. package/stacks/blazor-azure/.claude/skills/level-2-domains/architecture/standards-architect.md +0 -156
  95. package/stacks/blazor-azure/.claude/skills/level-2-domains/backend/api-designer.md +0 -59
  96. package/stacks/blazor-azure/.claude/skills/level-2-domains/backend/dotnet-senior.md +0 -77
  97. package/stacks/blazor-azure/.claude/skills/level-2-domains/backend/ef-modeler.md +0 -58
  98. package/stacks/blazor-azure/.claude/skills/level-2-domains/backend/hangfire-orchestrator.md +0 -126
  99. package/stacks/blazor-azure/.claude/skills/level-2-domains/backend/ms-agent-expert.md +0 -45
  100. package/stacks/blazor-azure/.claude/skills/level-2-domains/frontend/blazor-builder.md +0 -210
  101. package/stacks/blazor-azure/.claude/skills/level-2-domains/frontend/nextjs-expert.md +0 -154
  102. package/stacks/blazor-azure/.claude/skills/level-2-domains/frontend/ui-ux-designer.md +0 -191
  103. package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/azure-architect.md +0 -142
  104. package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/azure-deploy-specialist.md +0 -699
  105. package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/bicep-architect.md +0 -126
  106. package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/container-specialist.md +0 -131
  107. package/stacks/blazor-azure/.claude/skills/level-2-domains/infrastructure/devops-engineer.md +0 -119
  108. package/stacks/blazor-azure/.claude/skills/level-2-domains/integrations/asaas-financial.md +0 -130
  109. package/stacks/blazor-azure/.claude/skills/level-2-domains/integrations/azure-identity.md +0 -142
  110. package/stacks/blazor-azure/.claude/skills/level-2-domains/integrations/clerk-auth.md +0 -108
  111. package/stacks/blazor-azure/.claude/skills/level-2-domains/integrations/hangfire-orchestrator.md +0 -64
  112. package/stacks/blazor-azure/.claude/skills/level-2-domains/integrations/resend-email.md +0 -119
  113. package/stacks/blazor-azure/.claude/skills/level-2-domains/quality/code-analyzer.md +0 -235
  114. package/stacks/blazor-azure/.claude/skills/level-2-domains/quality/testing-specialist.md +0 -126
  115. package/stacks/blazor-azure/.claude/skills/level-3-technologies/README.md +0 -7
  116. package/stacks/blazor-azure/.claude/skills/level-4-patterns/README.md +0 -7
  117. package/stacks/blazor-azure/.morph/archive/.gitkeep +0 -25
  118. package/stacks/blazor-azure/.morph/features/.gitkeep +0 -25
  119. package/stacks/blazor-azure/.morph/schemas/agent.schema.json +0 -296
  120. package/stacks/blazor-azure/.morph/schemas/tasks.schema.json +0 -220
  121. package/stacks/blazor-azure/.morph/specs/.gitkeep +0 -20
  122. package/stacks/blazor-azure/.morph/test-infra/example.bicep +0 -59
  123. package/stacks/nextjs-supabase/.claude/commands/morph-apply.md +0 -221
  124. package/stacks/nextjs-supabase/.claude/commands/morph-archive.md +0 -79
  125. package/stacks/nextjs-supabase/.claude/commands/morph-deploy.md +0 -529
  126. package/stacks/nextjs-supabase/.claude/commands/morph-infra.md +0 -209
  127. package/stacks/nextjs-supabase/.claude/commands/morph-preflight.md +0 -227
  128. package/stacks/nextjs-supabase/.claude/commands/morph-proposal.md +0 -122
  129. package/stacks/nextjs-supabase/.claude/commands/morph-status.md +0 -86
  130. package/stacks/nextjs-supabase/.claude/commands/morph-troubleshoot.md +0 -122
  131. package/stacks/nextjs-supabase/.claude/settings.local.json +0 -6
  132. package/stacks/nextjs-supabase/.claude/skills/level-2-domains/backend/dotnet-supabase.md +0 -244
  133. package/stacks/nextjs-supabase/.claude/skills/level-2-domains/frontend/nextjs-supabase.md +0 -335
  134. package/stacks/nextjs-supabase/.claude/skills/level-2-domains/infrastructure/easypanel-deployer.md +0 -189
  135. package/stacks/nextjs-supabase/.claude/skills/level-2-domains/integrations/supabase-expert.md +0 -50
  136. /package/docs/{v3.0 → next-generation}/ANALYSIS.md +0 -0
  137. /package/docs/{v3.0 → next-generation}/ARCHITECTURE.md +0 -0
  138. /package/docs/{v3.0 → next-generation}/FEATURES.md +0 -0
  139. /package/docs/{v3.0 → next-generation}/README.md +0 -0
  140. /package/docs/{v3.0 → next-generation}/ROADMAP.md +0 -0
@@ -1,164 +0,0 @@
1
- /**
2
- * Content Validator
3
- *
4
- * Validates the content and structure of spec.md, tasks.json, and other feature outputs
5
- *
6
- * MORPH-SPEC 3.0 - Phase Validation
7
- */
8
-
9
- import { readFileSync, existsSync } from 'fs';
10
-
11
- /**
12
- * Validate spec.md content and structure
13
- *
14
- * @param {string} specPath - Path to spec.md file
15
- * @returns {Object} { valid, errors }
16
- */
17
- export function validateSpecContent(specPath) {
18
- if (!existsSync(specPath)) {
19
- return {
20
- valid: false,
21
- errors: ['Spec file does not exist']
22
- };
23
- }
24
-
25
- const content = readFileSync(specPath, 'utf8');
26
- const errors = [];
27
-
28
- // Required sections for spec.md
29
- const requiredSections = [
30
- '## Overview',
31
- '## Functional Requirements',
32
- '## Technical Architecture',
33
- '## Data Model'
34
- ];
35
-
36
- for (const section of requiredSections) {
37
- if (!content.includes(section) && !content.match(new RegExp(`##\\s+\\d+\\.\\s+${section.replace('## ', '')}`, 'i'))) {
38
- errors.push(`Missing required section: ${section}`);
39
- }
40
- }
41
-
42
- // Check minimum length
43
- if (content.length < 500) {
44
- errors.push('Spec content is too short (minimum 500 characters)');
45
- }
46
-
47
- return {
48
- valid: errors.length === 0,
49
- errors
50
- };
51
- }
52
-
53
- /**
54
- * Validate tasks.json content and structure
55
- *
56
- * @param {string} tasksPath - Path to tasks.json file
57
- * @returns {Object} { valid, errors }
58
- */
59
- export function validateTasksContent(tasksPath) {
60
- if (!existsSync(tasksPath)) {
61
- return {
62
- valid: false,
63
- errors: ['Tasks file does not exist']
64
- };
65
- }
66
-
67
- try {
68
- const content = readFileSync(tasksPath, 'utf8');
69
- const tasks = JSON.parse(content);
70
- const errors = [];
71
-
72
- // Check if it's an array
73
- if (!Array.isArray(tasks)) {
74
- errors.push('tasks.json must contain an array of tasks');
75
- return { valid: false, errors };
76
- }
77
-
78
- // Validate each task
79
- for (const task of tasks) {
80
- if (!task.id) {
81
- errors.push(`Task missing required field: id`);
82
- }
83
- if (!task.description) {
84
- errors.push(`Task ${task.id || '(unknown)'} missing required field: description`);
85
- }
86
- if (!task.status) {
87
- errors.push(`Task ${task.id || '(unknown)'} missing required field: status`);
88
- }
89
- if (task.status && !['pending', 'in_progress', 'completed'].includes(task.status)) {
90
- errors.push(`Task ${task.id} has invalid status: ${task.status}`);
91
- }
92
- }
93
-
94
- // Check for duplicate IDs
95
- const ids = tasks.map(t => t.id);
96
- const duplicates = ids.filter((id, index) => ids.indexOf(id) !== index);
97
- if (duplicates.length > 0) {
98
- errors.push(`Duplicate task IDs found: ${duplicates.join(', ')}`);
99
- }
100
-
101
- // Check for circular dependencies
102
- for (const task of tasks) {
103
- if (task.dependencies && Array.isArray(task.dependencies)) {
104
- for (const depId of task.dependencies) {
105
- if (!ids.includes(depId)) {
106
- errors.push(`Task ${task.id} depends on non-existent task: ${depId}`);
107
- }
108
- if (depId === task.id) {
109
- errors.push(`Task ${task.id} cannot depend on itself`);
110
- }
111
- }
112
- }
113
- }
114
-
115
- return {
116
- valid: errors.length === 0,
117
- errors
118
- };
119
- } catch (err) {
120
- return {
121
- valid: false,
122
- errors: [`Failed to parse tasks.json: ${err.message}`]
123
- };
124
- }
125
- }
126
-
127
- /**
128
- * Validate feature outputs (proposal, spec, tasks, etc.)
129
- *
130
- * @param {string} projectPath - Project root path
131
- * @param {string} featureName - Feature name
132
- * @param {string} phase - Current phase
133
- * @returns {Object} { valid, errors }
134
- */
135
- export function validateFeatureOutputs(projectPath, featureName, phase) {
136
- const errors = [];
137
-
138
- // Phase-specific output requirements
139
- const phaseOutputs = {
140
- proposal: ['proposal.md'],
141
- setup: [], // No specific outputs required
142
- uiux: ['ui-design-system.md'],
143
- design: ['spec.md'],
144
- clarify: [], // Updates to spec.md
145
- tasks: ['tasks.json'],
146
- implement: [], // Code files
147
- sync: ['decisions.md', 'recap.md']
148
- };
149
-
150
- const requiredOutputs = phaseOutputs[phase] || [];
151
-
152
- // Check if required outputs exist
153
- for (const output of requiredOutputs) {
154
- const outputPath = `${projectPath}/.morph/project/outputs/${featureName}/${output}`;
155
- if (!existsSync(outputPath)) {
156
- errors.push(`Missing required output for phase ${phase}: ${output}`);
157
- }
158
- }
159
-
160
- return {
161
- valid: errors.length === 0,
162
- errors
163
- };
164
- }
@@ -1,61 +0,0 @@
1
- /**
2
- * Package Validator
3
- *
4
- * Validates NuGet package dependencies for .NET projects
5
- *
6
- * MORPH-SPEC 3.0 - Continuous Validation
7
- */
8
-
9
- import { execSync } from 'child_process';
10
- import { existsSync } from 'fs';
11
- import { join } from 'path';
12
-
13
- /**
14
- * Validate package dependencies
15
- *
16
- * @param {string} projectPath - Project root path
17
- * @param {Object} options - Validation options
18
- * @returns {Object} { passed, errors, warnings, issues }
19
- */
20
- export async function validatePackages(projectPath, options = {}) {
21
- const issues = [];
22
-
23
- // Find .csproj files
24
- try {
25
- const csprojFiles = execSync('find . -name "*.csproj" -type f 2>/dev/null || true', {
26
- cwd: projectPath,
27
- encoding: 'utf8'
28
- }).trim().split('\n').filter(Boolean);
29
-
30
- if (csprojFiles.length === 0) {
31
- return {
32
- passed: true,
33
- errors: 0,
34
- warnings: 0,
35
- issues: [],
36
- message: 'No .NET projects found to validate'
37
- };
38
- }
39
-
40
- // Basic package validation (stub implementation)
41
- // TODO: Implement actual package conflict detection
42
-
43
- } catch (err) {
44
- issues.push({
45
- level: 'warning',
46
- type: 'package',
47
- message: `Failed to validate packages: ${err.message}`,
48
- solution: 'Run dotnet restore manually to check for package issues'
49
- });
50
- }
51
-
52
- const errors = issues.filter(i => i.level === 'error').length;
53
- const warnings = issues.filter(i => i.level === 'warning').length;
54
-
55
- return {
56
- passed: errors === 0,
57
- errors,
58
- warnings,
59
- issues
60
- };
61
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * UI Contrast Validator
3
- *
4
- * Validates WCAG color contrast ratios
5
- *
6
- * MORPH-SPEC 3.0 - Continuous Validation
7
- */
8
-
9
- /**
10
- * Validate color contrast ratios
11
- *
12
- * @param {string} projectPath - Project root path
13
- * @param {Object} options - Validation options
14
- * @returns {Object} { passed, errors, warnings, issues }
15
- */
16
- export async function validateContrast(projectPath, options = {}) {
17
- const issues = [];
18
-
19
- // Basic contrast validation (stub implementation)
20
- // TODO: Implement actual WCAG contrast ratio validation
21
-
22
- const errors = issues.filter(i => i.level === 'error').length;
23
- const warnings = issues.filter(i => i.level === 'warning').length;
24
-
25
- return {
26
- passed: errors === 0,
27
- errors,
28
- warnings,
29
- issues,
30
- message: 'Contrast validation not yet implemented'
31
- };
32
- }
33
-
34
- /**
35
- * Calculate contrast ratio between two colors
36
- *
37
- * @param {string} color1 - First color (hex)
38
- * @param {string} color2 - Second color (hex)
39
- * @returns {number} Contrast ratio
40
- */
41
- export function calculateContrast(color1, color2) {
42
- // Stub implementation
43
- return 4.5; // Placeholder
44
- }
@@ -1,221 +0,0 @@
1
- # Apply MORPH Feature Implementation - FASE 5
2
-
3
- Implemente a feature especificada seguindo as tasks definidas.
4
-
5
- ## Uso
6
-
7
- ```
8
- /morph-apply {feature-name}
9
- ```
10
-
11
- ## Pré-requisitos
12
-
13
- ### CRÍTICO: Validar Fases Anteriores
14
-
15
- **SEMPRE verifique que fases anteriores foram concluídas:**
16
-
17
- ```bash
18
- # Obter estado da feature
19
- npx morph-spec state get {feature-name}
20
- ```
21
-
22
- **Validações obrigatórias:**
23
-
24
- 1. **FASE 0 (Proposal):**
25
- - [ ] Output `proposal` criado
26
- - [ ] Agentes detectados e registrados
27
-
28
- 2. **FASE 1 (Setup):**
29
- - [ ] Phase passou por "setup"
30
- - [ ] Contexto carregado
31
-
32
- 3. **FASE 1.5 (UI/UX) - SE APLICÁVEL:**
33
- - [ ] Se `uiux-designer` está nos activeAgents → outputs ui-* devem existir
34
- - [ ] Se NÃO tem uiux-designer → pode pular
35
-
36
- 4. **FASE 2 (Design):**
37
- - [ ] Output `spec` criado
38
- - [ ] Output `contracts` criado
39
- - [ ] Output `decisions` criado
40
-
41
- 5. **FASE 3 (Clarify):**
42
- - [ ] Phase passou por "clarify"
43
- - [ ] Spec atualizado com clarificações
44
-
45
- 6. **FASE 4 (Tasks):**
46
- - [ ] Output `tasks` criado
47
- - [ ] `tasks.json` tem array de tasks
48
- - [ ] `tasks.total` > 0 no state
49
-
50
- **Se QUALQUER validação falhar:**
51
- ```
52
- ❌ ERRO: Fase {X} não foi concluída!
53
-
54
- Para completar as fases de planejamento, execute:
55
- /morph-proposal {feature-name}
56
- (Resume automaticamente da fase atual: {current_phase})
57
- ```
58
-
59
- **NÃO prossiga com implementação até todas as fases estarem completas!**
60
-
61
- ### Arquivos Necessários
62
-
63
- - [ ] Feature existe em `.morph/project/outputs/{feature}/`
64
- - [ ] `spec.md` está aprovado
65
- - [ ] `tasks.json` tem tasks definidas
66
- - [ ] `contracts.cs` define as interfaces
67
-
68
- ## Workflow
69
-
70
- 1. **Carregue o contexto**:
71
- - Leia `.morph/project/outputs/{feature}/spec.md`
72
- - Leia `.morph/project/outputs/{feature}/tasks.json`
73
- - Leia `.morph/project/outputs/{feature}/contracts.cs`
74
- - Leia framework/standards/ e .morph/project/standards/ para padrões
75
-
76
- 2. **Inicialize state tracking**:
77
- ```bash
78
- # Atualizar fase para implement
79
- npx morph-spec state set {feature} phase implement
80
- npx morph-spec state set {feature} status in_progress
81
-
82
- # Definir total de tasks (baseado em tasks.json)
83
- npx morph-spec state set {feature} tasks.total {N}
84
- ```
85
-
86
- 3. **Execute tasks em ordem**:
87
- - Marque task como in progress: `npx morph-spec task start {feature} {task-id}`
88
- - Implemente seguindo os padrões e contracts.cs
89
- - Complete task: `npx morph-spec task done {feature} {task-id}`
90
- - **Validators run automatically** on task-done. If validation fails:
91
- - Read the error messages and fix violations
92
- - Re-run `task done` — do NOT use `--skip-validation` unless user authorizes
93
- - Framework auto-manages checkpoints (every 3 tasks, includes validation summary)
94
-
95
- 4. **Phase advancement**:
96
- ```bash
97
- # Advance to next phase (validates → advances → shows next steps)
98
- npx morph-spec phase advance {feature}
99
- ```
100
-
101
- 5. **Marcar outputs criados**:
102
- Sempre que gerar um arquivo de output:
103
- ```bash
104
- npx morph-spec state mark-output {feature} spec
105
- npx morph-spec state mark-output {feature} contracts
106
- npx morph-spec state mark-output {feature} tasks
107
- # etc.
108
- ```
109
-
110
- 6. **Ao finalizar**:
111
- - Generate recap automatically: `npx morph-spec generate recap {feature}`
112
- - Atualize state: `npx morph-spec state set {feature} status done`
113
- - Marque recap: `npx morph-spec state mark-output {feature} recap`
114
- - Liste arquivos criados/modificados
115
- - Calcule custo real vs estimado
116
-
117
- ## Padrões Obrigatórios
118
-
119
- Siga sempre (priorize project/standards/ se houver):
120
- - `framework/standards/coding.md` - Padrões base do MORPH
121
- - `.morph/project/standards/coding.md` - Padrões específicos do projeto
122
- - `.morph/project/standards/architecture.md` - Estrutura de projeto
123
- - `.morph/project/standards/azure.md` - Recursos e custos
124
-
125
- ---
126
-
127
- ## Checklist Pré-Deploy Azure
128
-
129
- **ANTES de fazer deploy para Azure, execute `/morph-preflight azure` ou verifique manualmente:**
130
-
131
- ### Packages e Build
132
-
133
- - [ ] Packages sem conflitos de versão (`dotnet restore` sem warnings NU1605/NU1608)
134
- - [ ] `Azure.Identity` especificado explicitamente no `.csproj`
135
- - [ ] Build passa sem erros (`dotnet build`)
136
-
137
- ### EF Core Migrations
138
-
139
- - [ ] Sem pending model changes (`dotnet ef migrations has-pending-model-changes`)
140
- - [ ] Migration criada para todas as mudanças de schema
141
- - [ ] Migration script revisado (`dotnet ef migrations script --idempotent`)
142
-
143
- ### Blazor .NET 10 (se aplicável)
144
-
145
- - [ ] `.csproj` contém `<RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>`
146
- - [ ] Static assets funcionando localmente
147
-
148
- ### Container/Docker (se Container Apps)
149
-
150
- - [ ] Dockerfile válido e testado localmente
151
- - [ ] `docker build` funciona sem erros
152
- - [ ] Container roda localmente (`docker run`)
153
-
154
- ### Infraestrutura Azure
155
-
156
- - [ ] Bicep sem erros de sintaxe (`az bicep build`)
157
- - [ ] Key Vault URI configurado em `appsettings.Production.json`
158
- - [ ] Connection strings em Key Vault (não hardcoded)
159
- - [ ] Managed Identity habilitada nos recursos
160
-
161
- ### Segurança
162
-
163
- - [ ] Sem secrets em código ou `appsettings.json` (exceto Development)
164
- - [ ] HTTPS enforçado
165
- - [ ] CORS configurado corretamente
166
-
167
- ### Comandos de Verificação
168
-
169
- ```bash
170
- # 1. Package conflicts
171
- dotnet restore 2>&1 | grep -E "NU1605|NU1608"
172
-
173
- # 2. Pending migrations
174
- dotnet ef migrations has-pending-model-changes \
175
- --project src/Infrastructure \
176
- --startup-project src/Web
177
-
178
- # 3. Bicep validation
179
- az bicep build --file infra/main.bicep --stdout > /dev/null
180
-
181
- # 4. Docker build
182
- docker build -t myapp:test .
183
-
184
- # 5. Secret scan (basic)
185
- grep -rE "(Password=|Pwd=|Secret=)" appsettings*.json | grep -v Development
186
- ```
187
-
188
- ### Se QUALQUER item falhar
189
-
190
- ```
191
- ❌ BLOQUEADO: Não faça deploy até resolver!
192
-
193
- Use /morph-preflight azure para diagnóstico detalhado.
194
- ```
195
-
196
- ## Validações
197
-
198
- Antes de marcar task como completa:
199
- - [ ] Código compila
200
- - [ ] Segue padrões de nomenclatura
201
- - [ ] Testes unitários (se aplicável)
202
- - [ ] Sem hardcoded secrets
203
-
204
- ## Output
205
-
206
- Ao final de cada task, mostre:
207
- 1. Task completada
208
- 2. Arquivos criados/modificados
209
- 3. Próxima task
210
- 4. Progresso geral (X/Y tasks) - usar `npx morph-spec state get {feature}`
211
-
212
- Ao final de cada checkpoint:
213
- ```bash
214
- npx morph-spec state list
215
- ```
216
-
217
- Isso mostra o progresso atualizado automaticamente.
218
-
219
- ---
220
-
221
- **Feature:** $ARGUMENTS
@@ -1,79 +0,0 @@
1
- # Archive MORPH Feature
2
-
3
- Arquive uma feature concluída, movendo-a de `project/outputs/` para `project/archive/`.
4
-
5
- ## Pré-requisitos
6
-
7
- Verifique antes de arquivar:
8
- - [ ] Feature existe em `.morph/project/outputs/{feature}/`
9
- - [ ] Todas as tasks estão completas
10
- - [ ] `recap.md` está preenchido
11
- - [ ] Código está em produção (ou staging)
12
-
13
- ## Workflow
14
-
15
- 1. **Valide a conclusão**:
16
- - Leia `.morph/project/outputs/{feature}/tasks.json`
17
- - Verifique que todas tasks estão completadas
18
- - Confirme com o usuário se pode arquivar
19
-
20
- 2. **Complete o recap**:
21
- - Atualize `.morph/project/outputs/{feature}/recap.md`
22
- - Preencha métricas finais
23
- - Documente lições aprendidas
24
-
25
- 3. **Extraia specs**:
26
- - Se a feature define comportamento permanente
27
- - Copie spec relevante para `.morph/project/specs/`
28
- - Isso vira a "verdade atual" do sistema
29
-
30
- 4. **Mova para archive**:
31
- ```
32
- .morph/project/outputs/{feature}/ → .morph/project/archive/{feature}/
33
- ```
34
-
35
- 5. **Atualize métricas do projeto**:
36
- - Incremente contador de features
37
- - Atualize custo total
38
- - Atualize tempo total
39
-
40
- ## Output
41
-
42
- Apresente resumo do arquivamento:
43
-
44
- ```
45
- ╔════════════════════════════════════════════╗
46
- ║ FEATURE ARCHIVED ║
47
- ╠════════════════════════════════════════════╣
48
- ║ Feature: {name} ║
49
- ║ Completed: {date} ║
50
- ╠════════════════════════════════════════════╣
51
- ║ METRICS ║
52
- ╠════════════════════════════════════════════╣
53
- ║ Tasks: {X}/{X} completed ║
54
- ║ Time: {X}h (estimated: {Y}h) ║
55
- ║ Cost Impact: +${X}/month ║
56
- ╠════════════════════════════════════════════╣
57
- ║ FILES ║
58
- ╠════════════════════════════════════════════╣
59
- ║ Created: {X} files ║
60
- ║ Modified: {Y} files ║
61
- ║ Tests: {Z} files ({W}% coverage) ║
62
- ╠════════════════════════════════════════════╣
63
- ║ ARCHIVED TO ║
64
- ╠════════════════════════════════════════════╣
65
- ║ .morph/project/archive/{feature}/ ║
66
- ╚════════════════════════════════════════════╝
67
- ```
68
-
69
- ## Specs Extraídas
70
-
71
- Se houver specs extraídas:
72
- ```
73
- Specs extracted to .morph/project/specs/:
74
- - {domain}/spec.md - {description}
75
- ```
76
-
77
- ---
78
-
79
- **Feature to archive:** $ARGUMENTS