@polymorphism-tech/morph-spec 1.0.2 → 2.0.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 (152) hide show
  1. package/CLAUDE.md +1381 -0
  2. package/LICENSE +72 -0
  3. package/README.md +114 -12
  4. package/bin/detect-agents.js +225 -0
  5. package/bin/morph-spec.js +120 -0
  6. package/bin/render-template.js +302 -0
  7. package/bin/semantic-detect-agents.js +246 -0
  8. package/bin/validate-agents-skills.js +239 -0
  9. package/bin/validate-agents.js +69 -0
  10. package/bin/validate-phase.js +263 -0
  11. package/content/.azure/README.md +293 -0
  12. package/content/.azure/docs/azure-devops-setup.md +454 -0
  13. package/content/.azure/docs/branch-strategy.md +398 -0
  14. package/content/.azure/docs/local-development.md +515 -0
  15. package/content/.azure/pipelines/pipeline-variables.yml +34 -0
  16. package/content/.azure/pipelines/prod-pipeline.yml +319 -0
  17. package/content/.azure/pipelines/staging-pipeline.yml +234 -0
  18. package/content/.azure/pipelines/templates/build-dotnet.yml +75 -0
  19. package/content/.azure/pipelines/templates/deploy-app-service.yml +94 -0
  20. package/content/.azure/pipelines/templates/deploy-container-app.yml +120 -0
  21. package/content/.azure/pipelines/templates/infra-deploy.yml +90 -0
  22. package/content/.claude/commands/morph-apply.md +118 -26
  23. package/content/.claude/commands/morph-archive.md +9 -9
  24. package/content/.claude/commands/morph-clarify.md +184 -0
  25. package/content/.claude/commands/morph-design.md +275 -0
  26. package/content/.claude/commands/morph-proposal.md +56 -15
  27. package/content/.claude/commands/morph-setup.md +100 -0
  28. package/content/.claude/commands/morph-status.md +47 -32
  29. package/content/.claude/commands/morph-tasks.md +319 -0
  30. package/content/.claude/commands/morph-uiux.md +211 -0
  31. package/content/.claude/skills/specialists/ai-system-architect.md +604 -0
  32. package/content/.claude/skills/specialists/ms-agent-expert.md +143 -89
  33. package/content/.claude/skills/specialists/ui-ux-designer.md +744 -9
  34. package/content/.claude/skills/stacks/dotnet-blazor.md +244 -8
  35. package/content/.claude/skills/stacks/dotnet-nextjs.md +2 -2
  36. package/content/.morph/.morphversion +5 -0
  37. package/content/.morph/config/agents.json +101 -8
  38. package/content/.morph/config/azure-pricing.json +70 -0
  39. package/content/.morph/config/azure-pricing.schema.json +50 -0
  40. package/content/.morph/config/config.template.json +15 -3
  41. package/content/.morph/docs/STORY-DRIVEN-DEVELOPMENT.md +392 -0
  42. package/content/.morph/hooks/README.md +239 -0
  43. package/content/.morph/hooks/pre-commit-agents.sh +24 -0
  44. package/content/.morph/hooks/pre-commit-all.sh +48 -0
  45. package/content/.morph/hooks/pre-commit-costs.sh +91 -0
  46. package/content/.morph/hooks/pre-commit-specs.sh +49 -0
  47. package/content/.morph/hooks/pre-commit-tests.sh +60 -0
  48. package/content/.morph/project.md +5 -4
  49. package/content/.morph/schemas/agent.schema.json +296 -0
  50. package/content/.morph/standards/agent-framework-setup.md +453 -0
  51. package/content/.morph/standards/architecture.md +142 -7
  52. package/content/.morph/standards/azure.md +218 -23
  53. package/content/.morph/standards/coding.md +47 -12
  54. package/content/.morph/standards/dotnet10-migration.md +494 -0
  55. package/content/.morph/standards/fluent-ui-setup.md +590 -0
  56. package/content/.morph/standards/migration-guide.md +514 -0
  57. package/content/.morph/standards/passkeys-auth.md +423 -0
  58. package/content/.morph/standards/vector-search-rag.md +536 -0
  59. package/content/.morph/state.json +18 -0
  60. package/content/.morph/templates/FluentDesignTheme.cs +149 -0
  61. package/content/.morph/templates/MudTheme.cs +281 -0
  62. package/content/.morph/templates/contracts.cs +55 -55
  63. package/content/.morph/templates/decisions.md +4 -4
  64. package/content/.morph/templates/design-system.css +226 -0
  65. package/content/.morph/templates/infra/.dockerignore.example +89 -0
  66. package/content/.morph/templates/infra/Dockerfile.example +82 -0
  67. package/content/.morph/templates/infra/README.md +286 -0
  68. package/content/.morph/templates/infra/app-service.bicep +164 -0
  69. package/content/.morph/templates/infra/deploy.ps1 +229 -0
  70. package/content/.morph/templates/infra/deploy.sh +208 -0
  71. package/content/.morph/templates/infra/main.bicep +41 -7
  72. package/content/.morph/templates/infra/parameters.dev.json +6 -0
  73. package/content/.morph/templates/infra/parameters.prod.json +6 -0
  74. package/content/.morph/templates/infra/parameters.staging.json +29 -0
  75. package/content/.morph/templates/proposal.md +3 -3
  76. package/content/.morph/templates/recap.md +3 -3
  77. package/content/.morph/templates/spec.md +9 -8
  78. package/content/.morph/templates/sprint-status.yaml +68 -0
  79. package/content/.morph/templates/state.template.json +222 -0
  80. package/content/.morph/templates/story.md +143 -0
  81. package/content/.morph/templates/tasks.md +1 -1
  82. package/content/.morph/templates/ui-components.md +276 -0
  83. package/content/.morph/templates/ui-design-system.md +286 -0
  84. package/content/.morph/templates/ui-flows.md +336 -0
  85. package/content/.morph/templates/ui-mockups.md +133 -0
  86. package/content/.morph/test-infra/example.bicep +59 -0
  87. package/content/CLAUDE.md +124 -0
  88. package/content/README.md +79 -0
  89. package/detectors/config-detector.js +223 -0
  90. package/detectors/conversation-analyzer.js +163 -0
  91. package/detectors/index.js +84 -0
  92. package/detectors/standards-generator.js +275 -0
  93. package/detectors/structure-detector.js +221 -0
  94. package/docs/README.md +149 -0
  95. package/docs/api/cost-calculator.js.html +513 -0
  96. package/docs/api/design-system-generator.js.html +382 -0
  97. package/docs/api/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  98. package/docs/api/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  99. package/docs/api/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  100. package/docs/api/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  101. package/docs/api/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  102. package/docs/api/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  103. package/docs/api/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  104. package/docs/api/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  105. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  106. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  107. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  108. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  109. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  110. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  111. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  112. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  113. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  114. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  115. package/docs/api/global.html +5263 -0
  116. package/docs/api/index.html +96 -0
  117. package/docs/api/scripts/collapse.js +39 -0
  118. package/docs/api/scripts/commonNav.js +28 -0
  119. package/docs/api/scripts/linenumber.js +25 -0
  120. package/docs/api/scripts/nav.js +12 -0
  121. package/docs/api/scripts/polyfill.js +4 -0
  122. package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -0
  123. package/docs/api/scripts/prettify/lang-css.js +2 -0
  124. package/docs/api/scripts/prettify/prettify.js +28 -0
  125. package/docs/api/scripts/search.js +99 -0
  126. package/docs/api/state-manager.js.html +423 -0
  127. package/docs/api/styles/jsdoc.css +776 -0
  128. package/docs/api/styles/prettify.css +80 -0
  129. package/docs/examples.md +328 -0
  130. package/docs/getting-started.md +302 -0
  131. package/docs/installation.md +361 -0
  132. package/docs/templates.md +418 -0
  133. package/docs/validation-checklist.md +266 -0
  134. package/package.json +39 -12
  135. package/src/commands/cost.js +181 -0
  136. package/src/commands/create-story.js +283 -0
  137. package/src/commands/detect.js +104 -0
  138. package/src/commands/doctor.js +67 -0
  139. package/src/commands/generate.js +149 -0
  140. package/src/commands/init.js +71 -46
  141. package/src/commands/shard-spec.js +224 -0
  142. package/src/commands/sprint-status.js +250 -0
  143. package/src/commands/state.js +333 -0
  144. package/src/commands/sync.js +167 -0
  145. package/src/commands/update-pricing.js +206 -0
  146. package/src/commands/update.js +88 -13
  147. package/src/lib/complexity-analyzer.js +292 -0
  148. package/src/lib/cost-calculator.js +429 -0
  149. package/src/lib/design-system-generator.js +298 -0
  150. package/src/lib/state-manager.js +340 -0
  151. package/src/utils/file-copier.js +63 -0
  152. package/src/utils/version-checker.js +175 -0
@@ -0,0 +1,94 @@
1
+ # ==============================================================================
2
+ # MORPH-SPEC - Deploy App Service Template
3
+ # Reusable template for deploying to Azure App Service
4
+ # ==============================================================================
5
+
6
+ parameters:
7
+ - name: azureSubscription
8
+ type: string
9
+ - name: appServiceName
10
+ type: string
11
+ - name: resourceGroupName
12
+ type: string
13
+ - name: slotName
14
+ type: string
15
+ default: ''
16
+ - name: package
17
+ type: string
18
+ default: '$(Pipeline.Workspace)/drop/**/*.zip'
19
+ - name: healthCheckUrl
20
+ type: string
21
+ default: '/health'
22
+ - name: healthCheckTimeout
23
+ type: number
24
+ default: 300
25
+
26
+ steps:
27
+ - task: AzureWebApp@1
28
+ displayName: 'Deploy to App Service'
29
+ inputs:
30
+ azureSubscription: '${{ parameters.azureSubscription }}'
31
+ appType: 'webAppLinux'
32
+ appName: '${{ parameters.appServiceName }}'
33
+ ${{ if ne(parameters.slotName, '') }}:
34
+ deployToSlotOrASE: true
35
+ resourceGroupName: '${{ parameters.resourceGroupName }}'
36
+ slotName: '${{ parameters.slotName }}'
37
+ package: '${{ parameters.package }}'
38
+ runtimeStack: 'DOTNETCORE|8.0'
39
+
40
+ - task: AzureAppServiceSettings@1
41
+ displayName: 'Configure App Settings'
42
+ inputs:
43
+ azureSubscription: '${{ parameters.azureSubscription }}'
44
+ appName: '${{ parameters.appServiceName }}'
45
+ ${{ if ne(parameters.slotName, '') }}:
46
+ resourceGroupName: '${{ parameters.resourceGroupName }}'
47
+ slotName: '${{ parameters.slotName }}'
48
+ appSettings: |
49
+ [
50
+ {
51
+ "name": "ASPNETCORE_ENVIRONMENT",
52
+ "value": "Production",
53
+ "slotSetting": false
54
+ },
55
+ {
56
+ "name": "WEBSITE_TIME_ZONE",
57
+ "value": "E. South America Standard Time",
58
+ "slotSetting": false
59
+ }
60
+ ]
61
+
62
+ - task: PowerShell@2
63
+ displayName: 'Health check'
64
+ inputs:
65
+ targetType: 'inline'
66
+ script: |
67
+ $appUrl = "https://${{ parameters.appServiceName }}.azurewebsites.net"
68
+ $healthUrl = "$appUrl${{ parameters.healthCheckUrl }}"
69
+ $timeout = ${{ parameters.healthCheckTimeout }}
70
+ $elapsed = 0
71
+ $interval = 10
72
+
73
+ Write-Host "Waiting for app to be healthy at: $healthUrl"
74
+ Write-Host "Timeout: $timeout seconds"
75
+
76
+ while ($elapsed -lt $timeout) {
77
+ try {
78
+ $response = Invoke-WebRequest -Uri $healthUrl -UseBasicParsing -TimeoutSec 5
79
+ if ($response.StatusCode -eq 200) {
80
+ Write-Host "✅ App is healthy!"
81
+ Write-Host "Response: $($response.Content)"
82
+ exit 0
83
+ }
84
+ }
85
+ catch {
86
+ Write-Host "⏳ Waiting... ($elapsed/$timeout seconds)"
87
+ }
88
+
89
+ Start-Sleep -Seconds $interval
90
+ $elapsed += $interval
91
+ }
92
+
93
+ Write-Error "❌ Health check failed after $timeout seconds"
94
+ exit 1
@@ -0,0 +1,120 @@
1
+ # ==============================================================================
2
+ # MORPH-SPEC - Deploy Container App Template
3
+ # Reusable template for deploying to Azure Container Apps
4
+ # ==============================================================================
5
+
6
+ parameters:
7
+ - name: azureSubscription
8
+ type: string
9
+ - name: containerAppName
10
+ type: string
11
+ - name: resourceGroupName
12
+ type: string
13
+ - name: containerRegistry
14
+ type: string
15
+ - name: imageName
16
+ type: string
17
+ - name: imageTag
18
+ type: string
19
+ - name: acrServiceConnection
20
+ type: string
21
+ - name: healthCheckUrl
22
+ type: string
23
+ default: '/health'
24
+ - name: healthCheckTimeout
25
+ type: number
26
+ default: 300
27
+
28
+ steps:
29
+ - task: Docker@2
30
+ displayName: 'Build and push container image'
31
+ inputs:
32
+ containerRegistry: '${{ parameters.acrServiceConnection }}'
33
+ repository: '${{ parameters.imageName }}'
34
+ command: 'buildAndPush'
35
+ Dockerfile: '$(dockerfilePath)'
36
+ tags: |
37
+ ${{ parameters.imageTag }}
38
+ latest
39
+
40
+ - task: AzureCLI@2
41
+ displayName: 'Update Container App'
42
+ inputs:
43
+ azureSubscription: '${{ parameters.azureSubscription }}'
44
+ scriptType: 'bash'
45
+ scriptLocation: 'inlineScript'
46
+ inlineScript: |
47
+ echo "Updating Container App: ${{ parameters.containerAppName }}"
48
+ echo "Image: ${{ parameters.containerRegistry }}/${{ parameters.imageName }}:${{ parameters.imageTag }}"
49
+
50
+ az containerapp update \
51
+ --name ${{ parameters.containerAppName }} \
52
+ --resource-group ${{ parameters.resourceGroupName }} \
53
+ --image ${{ parameters.containerRegistry }}/${{ parameters.imageName }}:${{ parameters.imageTag }} \
54
+ --output table
55
+
56
+ echo "✅ Container App updated successfully"
57
+
58
+ - task: AzureCLI@2
59
+ displayName: 'Get Container App FQDN'
60
+ name: getUrl
61
+ inputs:
62
+ azureSubscription: '${{ parameters.azureSubscription }}'
63
+ scriptType: 'bash'
64
+ scriptLocation: 'inlineScript'
65
+ inlineScript: |
66
+ FQDN=$(az containerapp show \
67
+ --name ${{ parameters.containerAppName }} \
68
+ --resource-group ${{ parameters.resourceGroupName }} \
69
+ --query properties.configuration.ingress.fqdn -o tsv)
70
+
71
+ echo "Container App URL: https://$FQDN"
72
+ echo "##vso[task.setvariable variable=containerAppUrl;isOutput=true]https://$FQDN"
73
+
74
+ - task: PowerShell@2
75
+ displayName: 'Health check'
76
+ inputs:
77
+ targetType: 'inline'
78
+ script: |
79
+ $appUrl = "$(getUrl.containerAppUrl)"
80
+ $healthUrl = "$appUrl${{ parameters.healthCheckUrl }}"
81
+ $timeout = ${{ parameters.healthCheckTimeout }}
82
+ $elapsed = 0
83
+ $interval = 10
84
+
85
+ Write-Host "Waiting for Container App to be healthy at: $healthUrl"
86
+ Write-Host "Timeout: $timeout seconds"
87
+
88
+ while ($elapsed -lt $timeout) {
89
+ try {
90
+ $response = Invoke-WebRequest -Uri $healthUrl -UseBasicParsing -TimeoutSec 5
91
+ if ($response.StatusCode -eq 200) {
92
+ Write-Host "✅ Container App is healthy!"
93
+ Write-Host "Response: $($response.Content)"
94
+ exit 0
95
+ }
96
+ }
97
+ catch {
98
+ Write-Host "⏳ Waiting... ($elapsed/$timeout seconds)"
99
+ }
100
+
101
+ Start-Sleep -Seconds $interval
102
+ $elapsed += $interval
103
+ }
104
+
105
+ Write-Error "❌ Health check failed after $timeout seconds"
106
+ exit 1
107
+
108
+ - task: AzureCLI@2
109
+ displayName: 'Show Container App revision'
110
+ inputs:
111
+ azureSubscription: '${{ parameters.azureSubscription }}'
112
+ scriptType: 'bash'
113
+ scriptLocation: 'inlineScript'
114
+ inlineScript: |
115
+ echo "📊 Active revisions:"
116
+ az containerapp revision list \
117
+ --name ${{ parameters.containerAppName }} \
118
+ --resource-group ${{ parameters.resourceGroupName }} \
119
+ --query "[?properties.active].{Name:name, Created:properties.createdTime, Replicas:properties.replicas, Traffic:properties.trafficWeight}" \
120
+ --output table
@@ -0,0 +1,90 @@
1
+ # ==============================================================================
2
+ # MORPH-SPEC - Infrastructure Deploy Template
3
+ # Reusable template for deploying Azure infrastructure via Bicep
4
+ # ==============================================================================
5
+
6
+ parameters:
7
+ - name: azureSubscription
8
+ type: string
9
+ - name: resourceGroupName
10
+ type: string
11
+ - name: location
12
+ type: string
13
+ - name: environment
14
+ type: string
15
+ - name: appName
16
+ type: string
17
+ - name: hostingType
18
+ type: string
19
+ - name: bicepTemplateFile
20
+ type: string
21
+ - name: parametersFile
22
+ type: string
23
+
24
+ steps:
25
+ - task: AzureCLI@2
26
+ displayName: 'Create resource group if not exists'
27
+ inputs:
28
+ azureSubscription: '${{ parameters.azureSubscription }}'
29
+ scriptType: 'bash'
30
+ scriptLocation: 'inlineScript'
31
+ inlineScript: |
32
+ az group create \
33
+ --name ${{ parameters.resourceGroupName }} \
34
+ --location ${{ parameters.location }} \
35
+ --tags \
36
+ environment=${{ parameters.environment }} \
37
+ application=${{ parameters.appName }} \
38
+ managedBy=bicep \
39
+ framework=morph-spec
40
+
41
+ - task: AzureResourceManagerTemplateDeployment@3
42
+ displayName: 'Deploy Bicep template'
43
+ name: infraDeploy
44
+ inputs:
45
+ deploymentScope: 'Resource Group'
46
+ azureResourceManagerConnection: '${{ parameters.azureSubscription }}'
47
+ subscriptionId: '$(SUBSCRIPTION_ID)'
48
+ action: 'Create Or Update Resource Group'
49
+ resourceGroupName: '${{ parameters.resourceGroupName }}'
50
+ location: '${{ parameters.location }}'
51
+ templateLocation: 'Linked artifact'
52
+ csmFile: '${{ parameters.bicepTemplateFile }}'
53
+ csmParametersFile: '${{ parameters.parametersFile }}'
54
+ overrideParameters: |
55
+ -appName ${{ parameters.appName }}
56
+ -environment ${{ parameters.environment }}
57
+ -location ${{ parameters.location }}
58
+ -hostingType ${{ parameters.hostingType }}
59
+ deploymentMode: 'Incremental'
60
+ deploymentOutputs: 'infraOutputs'
61
+
62
+ - task: PowerShell@2
63
+ displayName: 'Parse deployment outputs'
64
+ inputs:
65
+ targetType: 'inline'
66
+ script: |
67
+ $outputs = '$(infraOutputs)' | ConvertFrom-Json
68
+
69
+ Write-Host "📊 Deployment Outputs:"
70
+ $outputs.PSObject.Properties | ForEach-Object {
71
+ $name = $_.Name
72
+ $value = $_.Value.value
73
+ Write-Host " $name = $value"
74
+
75
+ # Set as pipeline variables
76
+ Write-Host "##vso[task.setvariable variable=$name;isOutput=true]$value"
77
+ }
78
+
79
+ - task: AzureCLI@2
80
+ displayName: 'Show deployed resources'
81
+ inputs:
82
+ azureSubscription: '${{ parameters.azureSubscription }}'
83
+ scriptType: 'bash'
84
+ scriptLocation: 'inlineScript'
85
+ inlineScript: |
86
+ echo "📦 Resources in ${{ parameters.resourceGroupName }}:"
87
+ az resource list \
88
+ --resource-group ${{ parameters.resourceGroupName }} \
89
+ --query "[].{Name:name, Type:type, Location:location}" \
90
+ --output table
@@ -1,49 +1,134 @@
1
- # Apply MORPH Feature Implementation
1
+ # Apply MORPH Feature Implementation - FASE 5
2
2
 
3
3
  Implemente a feature especificada seguindo as tasks definidas.
4
4
 
5
+ ## Uso
6
+
7
+ ```
8
+ /morph-apply {feature-name}
9
+ ```
10
+
5
11
  ## Pré-requisitos
6
12
 
7
- Verifique antes de implementar:
8
- - [ ] Feature existe em `.morph/features/{feature}/`
9
- - [ ] `spec.md` está aprovado (Status: Approved)
10
- - [ ] `tasks.md` tem tasks definidas
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
+ node bin/state-manager.js 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 continuar, execute primeiro:
55
+ - /morph-proposal (FASE 0)
56
+ - /morph-setup (FASE 1)
57
+ - /morph-uiux (FASE 1.5 - se necessário)
58
+ - /morph-design (FASE 2)
59
+ - /morph-clarify (FASE 3)
60
+ - /morph-tasks (FASE 4)
61
+
62
+ Fase atual: {current_phase}
63
+ ```
64
+
65
+ **NÃO prossiga com implementação até todas as fases estarem completas!**
66
+
67
+ ### Arquivos Necessários
68
+
69
+ - [ ] Feature existe em `.morph/project/outputs/{feature}/`
70
+ - [ ] `spec.md` está aprovado
71
+ - [ ] `tasks.json` tem tasks definidas
11
72
  - [ ] `contracts.cs` define as interfaces
12
73
 
13
74
  ## Workflow
14
75
 
15
76
  1. **Carregue o contexto**:
16
- - Leia `.morph/features/{feature}/spec.md`
17
- - Leia `.morph/features/{feature}/tasks.md`
18
- - Leia `.morph/features/{feature}/contracts.cs`
19
- - Leia `.morph/standards/` para padrões
20
-
21
- 2. **Execute tasks em ordem**:
77
+ - Leia `.morph/project/outputs/{feature}/spec.md`
78
+ - Leia `.morph/project/outputs/{feature}/tasks.json`
79
+ - Leia `.morph/project/outputs/{feature}/contracts.cs`
80
+ - Leia framework/standards/ e .morph/project/standards/ para padrões
81
+
82
+ 2. **Inicialize state tracking**:
83
+ ```bash
84
+ # Atualizar fase para implement
85
+ node bin/state-manager.js set {feature} phase implement
86
+ node bin/state-manager.js set {feature} status in_progress
87
+
88
+ # Definir total de tasks (baseado em tasks.json)
89
+ node bin/state-manager.js set {feature} tasks.total {N}
90
+ ```
91
+
92
+ 3. **Execute tasks em ordem**:
22
93
  - Marque task como `[~] In Progress`
94
+ - Atualize state: `node bin/state-manager.js set {feature} tasks.inProgress 1`
23
95
  - Implemente seguindo os padrões
24
96
  - Marque task como `[x] Completed`
25
-
26
- 3. **Checkpoints**:
27
- - Pause nos checkpoints definidos
28
- - Apresente o que foi feito
97
+ - Atualize state: `node bin/state-manager.js set {feature} tasks.completed {X}`
98
+ - Atualize state: `node bin/state-manager.js set {feature} tasks.inProgress 0`
99
+
100
+ 4. **Checkpoints a cada 3 tasks**:
101
+ ```bash
102
+ # Registrar checkpoint
103
+ node bin/state-manager.js checkpoint {feature} "Completadas tasks T001-T003"
104
+ ```
105
+ - Pause e apresente o que foi feito
106
+ - Mostre progresso: `node bin/state-manager.js list`
29
107
  - Aguarde aprovação para continuar
30
108
 
31
- 4. **A cada 3 tasks**:
32
- - Faça um checkpoint automático
33
- - Mostre progresso
34
- - Valide com o usuário
35
-
36
- 5. **Ao finalizar**:
109
+ 5. **Marcar outputs criados**:
110
+ Sempre que gerar um arquivo de output:
111
+ ```bash
112
+ node bin/state-manager.js mark-output {feature} spec
113
+ node bin/state-manager.js mark-output {feature} contracts
114
+ node bin/state-manager.js mark-output {feature} tasks
115
+ # etc.
116
+ ```
117
+
118
+ 6. **Ao finalizar**:
119
+ - Atualize state: `node bin/state-manager.js set {feature} status done`
120
+ - Marque recap: `node bin/state-manager.js mark-output {feature} recap`
37
121
  - Atualize `recap.md` com resultados
38
122
  - Liste arquivos criados/modificados
39
123
  - Calcule custo real vs estimado
40
124
 
41
125
  ## Padrões Obrigatórios
42
126
 
43
- Siga sempre:
44
- - `.morph/standards/coding.md` - Nomenclatura e estilo
45
- - `.morph/standards/architecture.md` - Estrutura de projeto
46
- - `.morph/standards/azure.md` - Recursos e custos
127
+ Siga sempre (priorize project/standards/ se houver):
128
+ - `framework/standards/coding.md` - Padrões base do MORPH
129
+ - `.morph/project/standards/coding.md` - Padrões específicos do projeto
130
+ - `.morph/project/standards/architecture.md` - Estrutura de projeto
131
+ - `.morph/project/standards/azure.md` - Recursos e custos
47
132
 
48
133
  ## Validações
49
134
 
@@ -59,7 +144,14 @@ Ao final de cada task, mostre:
59
144
  1. Task completada
60
145
  2. Arquivos criados/modificados
61
146
  3. Próxima task
62
- 4. Progresso geral (X/Y tasks)
147
+ 4. Progresso geral (X/Y tasks) - usar `node bin/state-manager.js get {feature}`
148
+
149
+ Ao final de cada checkpoint:
150
+ ```bash
151
+ node bin/state-manager.js list
152
+ ```
153
+
154
+ Isso mostra o progresso atualizado automaticamente.
63
155
 
64
156
  ---
65
157
 
@@ -1,11 +1,11 @@
1
1
  # Archive MORPH Feature
2
2
 
3
- Arquive uma feature concluída, movendo-a de `features/` para `archive/`.
3
+ Arquive uma feature concluída, movendo-a de `project/outputs/` para `project/archive/`.
4
4
 
5
5
  ## Pré-requisitos
6
6
 
7
7
  Verifique antes de arquivar:
8
- - [ ] Feature existe em `.morph/features/{feature}/`
8
+ - [ ] Feature existe em `.morph/project/outputs/{feature}/`
9
9
  - [ ] Todas as tasks estão completas
10
10
  - [ ] `recap.md` está preenchido
11
11
  - [ ] Código está em produção (ou staging)
@@ -13,23 +13,23 @@ Verifique antes de arquivar:
13
13
  ## Workflow
14
14
 
15
15
  1. **Valide a conclusão**:
16
- - Leia `.morph/features/{feature}/tasks.md`
17
- - Verifique que todas tasks estão `[x]`
16
+ - Leia `.morph/project/outputs/{feature}/tasks.json`
17
+ - Verifique que todas tasks estão completadas
18
18
  - Confirme com o usuário se pode arquivar
19
19
 
20
20
  2. **Complete o recap**:
21
- - Atualize `.morph/features/{feature}/recap.md`
21
+ - Atualize `.morph/project/outputs/{feature}/recap.md`
22
22
  - Preencha métricas finais
23
23
  - Documente lições aprendidas
24
24
 
25
25
  3. **Extraia specs**:
26
26
  - Se a feature define comportamento permanente
27
- - Copie spec relevante para `.morph/specs/`
27
+ - Copie spec relevante para `.morph/project/specs/`
28
28
  - Isso vira a "verdade atual" do sistema
29
29
 
30
30
  4. **Mova para archive**:
31
31
  ```
32
- .morph/features/{feature}/ → .morph/archive/{feature}/
32
+ .morph/project/outputs/{feature}/ → .morph/project/archive/{feature}/
33
33
  ```
34
34
 
35
35
  5. **Atualize métricas do projeto**:
@@ -62,7 +62,7 @@ Apresente resumo do arquivamento:
62
62
  ╠════════════════════════════════════════════╣
63
63
  ║ ARCHIVED TO ║
64
64
  ╠════════════════════════════════════════════╣
65
- ║ .morph/archive/{feature}/
65
+ ║ .morph/project/archive/{feature}/
66
66
  ╚════════════════════════════════════════════╝
67
67
  ```
68
68
 
@@ -70,7 +70,7 @@ Apresente resumo do arquivamento:
70
70
 
71
71
  Se houver specs extraídas:
72
72
  ```
73
- Specs extracted to .morph/specs/:
73
+ Specs extracted to .morph/project/specs/:
74
74
  - {domain}/spec.md - {description}
75
75
  ```
76
76