@polymorphism-tech/morph-spec 1.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.
- package/README.md +279 -0
- package/bin/morph-spec.js +53 -0
- package/content/.claude/commands/morph-apply.md +66 -0
- package/content/.claude/commands/morph-archive.md +79 -0
- package/content/.claude/commands/morph-costs.md +206 -0
- package/content/.claude/commands/morph-infra.md +209 -0
- package/content/.claude/commands/morph-proposal.md +60 -0
- package/content/.claude/commands/morph-status.md +71 -0
- package/content/.claude/settings.local.json +15 -0
- package/content/.claude/skills/infra/bicep-architect.md +419 -0
- package/content/.claude/skills/infra/container-specialist.md +437 -0
- package/content/.claude/skills/infra/devops-engineer.md +405 -0
- package/content/.claude/skills/integrations/asaas-financial.md +333 -0
- package/content/.claude/skills/integrations/azure-identity.md +309 -0
- package/content/.claude/skills/integrations/clerk-auth.md +290 -0
- package/content/.claude/skills/specialists/azure-architect.md +142 -0
- package/content/.claude/skills/specialists/cost-guardian.md +110 -0
- package/content/.claude/skills/specialists/ef-modeler.md +200 -0
- package/content/.claude/skills/specialists/hangfire-orchestrator.md +245 -0
- package/content/.claude/skills/specialists/ms-agent-expert.md +209 -0
- package/content/.claude/skills/specialists/po-pm-advisor.md +197 -0
- package/content/.claude/skills/specialists/standards-architect.md +78 -0
- package/content/.claude/skills/specialists/ui-ux-designer.md +325 -0
- package/content/.claude/skills/stacks/dotnet-blazor.md +352 -0
- package/content/.claude/skills/stacks/dotnet-nextjs.md +402 -0
- package/content/.claude/skills/stacks/shopify.md +445 -0
- package/content/.morph/archive/.gitkeep +25 -0
- package/content/.morph/config/agents.json +149 -0
- package/content/.morph/config/config.template.json +96 -0
- package/content/.morph/examples/api-nextjs/README.md +241 -0
- package/content/.morph/examples/api-nextjs/contracts.ts +307 -0
- package/content/.morph/examples/api-nextjs/spec.md +399 -0
- package/content/.morph/examples/api-nextjs/tasks.md +168 -0
- package/content/.morph/examples/micro-saas/README.md +125 -0
- package/content/.morph/examples/micro-saas/contracts.cs +358 -0
- package/content/.morph/examples/micro-saas/decisions.md +246 -0
- package/content/.morph/examples/micro-saas/spec.md +236 -0
- package/content/.morph/examples/micro-saas/tasks.md +150 -0
- package/content/.morph/examples/multi-agent/README.md +309 -0
- package/content/.morph/examples/multi-agent/contracts.cs +433 -0
- package/content/.morph/examples/multi-agent/spec.md +479 -0
- package/content/.morph/examples/multi-agent/tasks.md +185 -0
- package/content/.morph/features/.gitkeep +25 -0
- package/content/.morph/project.md +159 -0
- package/content/.morph/specs/.gitkeep +20 -0
- package/content/.morph/standards/architecture.md +190 -0
- package/content/.morph/standards/azure.md +184 -0
- package/content/.morph/standards/coding.md +342 -0
- package/content/.morph/templates/agent.cs +172 -0
- package/content/.morph/templates/component.razor +239 -0
- package/content/.morph/templates/contracts.cs +217 -0
- package/content/.morph/templates/decisions.md +106 -0
- package/content/.morph/templates/infra/app-insights.bicep +63 -0
- package/content/.morph/templates/infra/container-app-env.bicep +49 -0
- package/content/.morph/templates/infra/container-app.bicep +156 -0
- package/content/.morph/templates/infra/key-vault.bicep +91 -0
- package/content/.morph/templates/infra/main.bicep +155 -0
- package/content/.morph/templates/infra/parameters.dev.json +23 -0
- package/content/.morph/templates/infra/parameters.prod.json +23 -0
- package/content/.morph/templates/infra/sql-database.bicep +103 -0
- package/content/.morph/templates/infra/storage.bicep +106 -0
- package/content/.morph/templates/integrations/asaas-client.cs +387 -0
- package/content/.morph/templates/integrations/asaas-webhook.cs +351 -0
- package/content/.morph/templates/integrations/azure-identity-config.cs +288 -0
- package/content/.morph/templates/integrations/clerk-config.cs +258 -0
- package/content/.morph/templates/job.cs +171 -0
- package/content/.morph/templates/migration.cs +83 -0
- package/content/.morph/templates/proposal.md +155 -0
- package/content/.morph/templates/recap.md +105 -0
- package/content/.morph/templates/repository.cs +141 -0
- package/content/.morph/templates/saas/subscription.cs +347 -0
- package/content/.morph/templates/saas/tenant.cs +338 -0
- package/content/.morph/templates/service.cs +139 -0
- package/content/.morph/templates/spec.md +147 -0
- package/content/.morph/templates/tasks.md +235 -0
- package/content/.morph/templates/test.cs +239 -0
- package/content/CLAUDE.md +318 -0
- package/package.json +50 -0
- package/src/commands/doctor.js +132 -0
- package/src/commands/init.js +121 -0
- package/src/commands/update.js +84 -0
- package/src/utils/file-copier.js +50 -0
- package/src/utils/logger.js +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<h1 align="center">MORPH-SPEC</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Desenvolvimento orientado por especificações com agentes AI</strong><br>
|
|
5
|
+
<em>by Polymorphism Tech</em>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="#instalação">Instalação</a> •
|
|
10
|
+
<a href="#começando">Começando</a> •
|
|
11
|
+
<a href="#comandos">Comandos</a> •
|
|
12
|
+
<a href="#agentes">Agentes</a> •
|
|
13
|
+
<a href="docs/">Documentação</a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## O que é MORPH-SPEC?
|
|
19
|
+
|
|
20
|
+
**M**ethodical **O**rchestration for **R**eliable **P**roduction-ready **SPEC**-driven development
|
|
21
|
+
|
|
22
|
+
MORPH-SPEC é um framework de desenvolvimento orientado por especificações com **17 agentes AI especializados**. Cada agente tem expertise em tecnologias específicas e segue workflows estruturados para entregar código production-ready.
|
|
23
|
+
|
|
24
|
+
**Stacks suportadas:** .NET/Blazor, .NET/Next.js, Shopify
|
|
25
|
+
**Infraestrutura:** Azure Bicep (IaC)
|
|
26
|
+
**Ferramenta:** Claude Code
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Instalação
|
|
31
|
+
|
|
32
|
+
### Pré-requisitos
|
|
33
|
+
|
|
34
|
+
- [Claude Code](https://claude.ai/code) instalado
|
|
35
|
+
- Git
|
|
36
|
+
|
|
37
|
+
### Instalação Rápida
|
|
38
|
+
|
|
39
|
+
**Windows (PowerShell):**
|
|
40
|
+
```powershell
|
|
41
|
+
# 1. Clone o repositório
|
|
42
|
+
git clone <url-do-repo>
|
|
43
|
+
|
|
44
|
+
# 2. Execute o setup no seu projeto
|
|
45
|
+
cd morph-framework
|
|
46
|
+
.\scripts\setup.ps1 -TargetPath "C:\caminho\do\seu\projeto"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Linux/Mac (Bash):**
|
|
50
|
+
```bash
|
|
51
|
+
# 1. Clone o repositório
|
|
52
|
+
git clone <url-do-repo>
|
|
53
|
+
|
|
54
|
+
# 2. Execute o setup no seu projeto
|
|
55
|
+
cd morph-framework
|
|
56
|
+
./scripts/setup.sh -t /caminho/do/seu/projeto
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Instalação Manual
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# 1. Clone o repositório
|
|
63
|
+
git clone <url-do-repo>
|
|
64
|
+
|
|
65
|
+
# 2. Copie os arquivos para seu projeto
|
|
66
|
+
cp -r morph-framework/content/.morph /seu/projeto/
|
|
67
|
+
cp -r morph-framework/content/.claude /seu/projeto/
|
|
68
|
+
cp morph-framework/content/CLAUDE.md /seu/projeto/
|
|
69
|
+
|
|
70
|
+
# 3. Configure
|
|
71
|
+
cd /seu/projeto/.morph/config
|
|
72
|
+
cp config.template.json config.json
|
|
73
|
+
# Edite config.json com suas configurações
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Verificar Instalação
|
|
77
|
+
|
|
78
|
+
Abra seu projeto no Claude Code e execute:
|
|
79
|
+
```
|
|
80
|
+
/morph-status
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Se configurado corretamente, você verá o status do projeto.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Começando
|
|
88
|
+
|
|
89
|
+
### 1. Criar uma Proposta
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
/morph-proposal minha-feature
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Descreva o que quer implementar. O MORPH vai gerar a especificação completa.
|
|
96
|
+
|
|
97
|
+
### 2. Revisar a Spec
|
|
98
|
+
|
|
99
|
+
Arquivos gerados em `.morph/features/minha-feature/`:
|
|
100
|
+
- `spec.md` - Especificação técnica
|
|
101
|
+
- `contracts.cs` - Interfaces e DTOs
|
|
102
|
+
- `decisions.md` - Decisões arquiteturais
|
|
103
|
+
|
|
104
|
+
### 3. Aprovar o Design
|
|
105
|
+
|
|
106
|
+
Revise os arquivos gerados e aprove (ou peça ajustes).
|
|
107
|
+
|
|
108
|
+
### 4. Implementar
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
/morph-apply minha-feature
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
O MORPH implementa task por task, com testes a cada etapa.
|
|
115
|
+
|
|
116
|
+
### 5. Arquivar
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
/morph-archive minha-feature
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Move a feature concluída para o arquivo.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Como Funciona
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
130
|
+
│ SETUP │ ─▶ │ DESIGN │ ─▶ │ CLARIFY │ ─▶ │ TASKS │ ─▶ │IMPLEMENT │
|
|
131
|
+
│ │ │ │ │ │ │ │ │ │
|
|
132
|
+
│ Contexto │ │ Spec + │ │ Q&A + │ │ Quebra │ │ Executa │
|
|
133
|
+
│ + Agents │ │Contracts │ │ Edges │ │ Tasks │ │ + Testa │
|
|
134
|
+
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
|
|
135
|
+
⛔ ⛔
|
|
136
|
+
Aprovação Aprovação
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Pontos de aprovação:** O MORPH para em 2 momentos para você revisar antes de continuar.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Comandos
|
|
144
|
+
|
|
145
|
+
| Comando | Descrição |
|
|
146
|
+
|---------|-----------|
|
|
147
|
+
| `/morph-proposal <nome>` | Cria nova feature |
|
|
148
|
+
| `/morph-apply <nome>` | Implementa feature aprovada |
|
|
149
|
+
| `/morph-status` | Mostra status do projeto |
|
|
150
|
+
| `/morph-archive <nome>` | Arquiva feature concluída |
|
|
151
|
+
| `/morph-infra <ação>` | Gerencia infraestrutura (init, validate, deploy) |
|
|
152
|
+
| `/morph-costs` | Estima custos Azure |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Agentes
|
|
157
|
+
|
|
158
|
+
### Sempre Ativos
|
|
159
|
+
|
|
160
|
+
| Agente | Função |
|
|
161
|
+
|--------|--------|
|
|
162
|
+
| 📐 **Standards Architect** | Padrões de código e consistência |
|
|
163
|
+
| ☁️ **Azure Architect** | Infraestrutura cloud e IaC |
|
|
164
|
+
| 💰 **Cost Guardian** | Controle de custos |
|
|
165
|
+
|
|
166
|
+
### Por Stack
|
|
167
|
+
|
|
168
|
+
| Agente | Keywords |
|
|
169
|
+
|--------|----------|
|
|
170
|
+
| 🔥 **Blazor Builder** | blazor, razor, component |
|
|
171
|
+
| ⚛️ **NextJS Expert** | nextjs, react, frontend |
|
|
172
|
+
| 🛒 **Shopify Expert** | shopify, hydrogen, liquid |
|
|
173
|
+
|
|
174
|
+
### Especialistas
|
|
175
|
+
|
|
176
|
+
| Agente | Keywords |
|
|
177
|
+
|--------|----------|
|
|
178
|
+
| 🗄️ **EF Modeler** | database, entity, migration |
|
|
179
|
+
| 🤖 **MS Agent Expert** | agent, ai, semantic kernel |
|
|
180
|
+
| ⏰ **Hangfire Orchestrator** | scheduled, job, background |
|
|
181
|
+
| 🎨 **UI/UX Designer** | wizard, dashboard, complex form |
|
|
182
|
+
| 📋 **PO/PM Advisor** | unclear, requirements, ROI |
|
|
183
|
+
|
|
184
|
+
### Integrações
|
|
185
|
+
|
|
186
|
+
| Agente | Keywords |
|
|
187
|
+
|--------|----------|
|
|
188
|
+
| 💳 **Asaas Financial** | asaas, pix, boleto, payment |
|
|
189
|
+
| 🔐 **Clerk Auth** | clerk, auth, login |
|
|
190
|
+
| 🆔 **Azure Identity** | identity, entra, microsoft auth |
|
|
191
|
+
|
|
192
|
+
### Infraestrutura
|
|
193
|
+
|
|
194
|
+
| Agente | Keywords |
|
|
195
|
+
|--------|----------|
|
|
196
|
+
| 🏗️ **Bicep Architect** | bicep, iac, infra |
|
|
197
|
+
| 🚀 **DevOps Engineer** | pipeline, ci/cd, deploy |
|
|
198
|
+
| 📦 **Container Specialist** | docker, container |
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Exemplos
|
|
203
|
+
|
|
204
|
+
| Exemplo | Descrição |
|
|
205
|
+
|---------|-----------|
|
|
206
|
+
| [micro-saas](.morph/examples/micro-saas/) | SaaS completo com Blazor + Asaas billing |
|
|
207
|
+
| [api-nextjs](.morph/examples/api-nextjs/) | .NET API + Next.js frontend |
|
|
208
|
+
| [multi-agent](.morph/examples/multi-agent/) | Sistema multi-agente com Semantic Kernel |
|
|
209
|
+
|
|
210
|
+
Cada exemplo inclui: `README.md`, `spec.md`, `contracts.cs`, `tasks.md`, `decisions.md`
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Estrutura do Projeto
|
|
215
|
+
|
|
216
|
+
Após a instalação, seu projeto terá:
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
seu-projeto/
|
|
220
|
+
├── CLAUDE.md # Instruções para o AI
|
|
221
|
+
├── .morph/
|
|
222
|
+
│ ├── config/ # Configurações
|
|
223
|
+
│ │ ├── config.json
|
|
224
|
+
│ │ └── agents.json
|
|
225
|
+
│ ├── standards/ # Padrões de código
|
|
226
|
+
│ │ ├── coding.md
|
|
227
|
+
│ │ ├── architecture.md
|
|
228
|
+
│ │ └── azure.md
|
|
229
|
+
│ ├── templates/ # Templates de código e IaC
|
|
230
|
+
│ │ ├── infra/
|
|
231
|
+
│ │ ├── integrations/
|
|
232
|
+
│ │ └── saas/
|
|
233
|
+
│ ├── examples/ # Exemplos completos
|
|
234
|
+
│ ├── features/ # Features em desenvolvimento
|
|
235
|
+
│ └── archive/ # Features concluídas
|
|
236
|
+
└── .claude/
|
|
237
|
+
├── commands/ # Slash commands
|
|
238
|
+
└── skills/ # Skills dos agentes
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Templates Incluídos
|
|
244
|
+
|
|
245
|
+
### IaC (Bicep)
|
|
246
|
+
- `main.bicep`, `container-app.bicep`, `sql-database.bicep`, `storage.bicep`, `key-vault.bicep`, `app-insights.bicep`
|
|
247
|
+
|
|
248
|
+
### Integrações
|
|
249
|
+
- `asaas-client.cs`, `asaas-webhook.cs`, `clerk-config.cs`, `azure-identity-config.cs`
|
|
250
|
+
|
|
251
|
+
### SaaS
|
|
252
|
+
- `subscription.cs`, `tenant.cs`
|
|
253
|
+
|
|
254
|
+
### Código
|
|
255
|
+
- `service.cs`, `repository.cs`, `component.razor`, `agent.cs`, `job.cs`, `test.cs`
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Custos
|
|
260
|
+
|
|
261
|
+
O MORPH segue a filosofia **"Free tier first"**:
|
|
262
|
+
|
|
263
|
+
| Nível | Limite | Requer |
|
|
264
|
+
|-------|--------|--------|
|
|
265
|
+
| Sem aprovação | Free tier | Nada |
|
|
266
|
+
| Com aprovação | Até $10/mês | Confirmação |
|
|
267
|
+
| Acima de $10 | Justificativa | ADR |
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Dúvidas
|
|
272
|
+
|
|
273
|
+
- 📚 Documentação completa: [`docs/`](docs/)
|
|
274
|
+
- 💡 Exemplos: [`.morph/examples/`](.morph/examples/)
|
|
275
|
+
- 🐛 Problemas: Abra uma issue ou fale no Teams
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
*MORPH-SPEC by Polymorphism Tech*
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { program } from 'commander';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import { dirname, join } from 'path';
|
|
7
|
+
import { readFileSync } from 'fs';
|
|
8
|
+
|
|
9
|
+
import { initCommand } from '../src/commands/init.js';
|
|
10
|
+
import { updateCommand } from '../src/commands/update.js';
|
|
11
|
+
import { doctorCommand } from '../src/commands/doctor.js';
|
|
12
|
+
|
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
|
|
15
|
+
|
|
16
|
+
const banner = chalk.cyan(`
|
|
17
|
+
███╗ ███╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗
|
|
18
|
+
████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██║ ██║
|
|
19
|
+
██╔████╔██║██║ ██║██████╔╝██████╔╝███████║
|
|
20
|
+
██║╚██╔╝██║██║ ██║██╔══██╗██╔═══╝ ██╔══██║
|
|
21
|
+
██║ ╚═╝ ██║╚██████╔╝██║ ██║██║ ██║ ██║
|
|
22
|
+
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
|
|
23
|
+
|
|
24
|
+
Methodical Orchestration for Reliable Production-ready SPEC-driven development
|
|
25
|
+
by Polymorphism Tech | v${pkg.version}
|
|
26
|
+
`);
|
|
27
|
+
|
|
28
|
+
program
|
|
29
|
+
.name('morph-spec')
|
|
30
|
+
.description('MORPH-SPEC Framework CLI')
|
|
31
|
+
.version(pkg.version)
|
|
32
|
+
.addHelpText('beforeAll', banner);
|
|
33
|
+
|
|
34
|
+
program
|
|
35
|
+
.command('init')
|
|
36
|
+
.description('Initialize MORPH-SPEC in current directory')
|
|
37
|
+
.option('-f, --force', 'Overwrite existing MORPH installation')
|
|
38
|
+
.option('-p, --path <path>', 'Target path (default: current directory)')
|
|
39
|
+
.action(initCommand);
|
|
40
|
+
|
|
41
|
+
program
|
|
42
|
+
.command('update')
|
|
43
|
+
.description('Update MORPH templates and standards to latest version')
|
|
44
|
+
.option('--templates', 'Update only templates')
|
|
45
|
+
.option('--standards', 'Update only standards')
|
|
46
|
+
.action(updateCommand);
|
|
47
|
+
|
|
48
|
+
program
|
|
49
|
+
.command('doctor')
|
|
50
|
+
.description('Check MORPH installation health')
|
|
51
|
+
.action(doctorCommand);
|
|
52
|
+
|
|
53
|
+
program.parse();
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Apply MORPH Feature Implementation
|
|
2
|
+
|
|
3
|
+
Implemente a feature especificada seguindo as tasks definidas.
|
|
4
|
+
|
|
5
|
+
## Pré-requisitos
|
|
6
|
+
|
|
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
|
|
11
|
+
- [ ] `contracts.cs` define as interfaces
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
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**:
|
|
22
|
+
- Marque task como `[~] In Progress`
|
|
23
|
+
- Implemente seguindo os padrões
|
|
24
|
+
- Marque task como `[x] Completed`
|
|
25
|
+
|
|
26
|
+
3. **Checkpoints**:
|
|
27
|
+
- Pause nos checkpoints definidos
|
|
28
|
+
- Apresente o que foi feito
|
|
29
|
+
- Aguarde aprovação para continuar
|
|
30
|
+
|
|
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**:
|
|
37
|
+
- Atualize `recap.md` com resultados
|
|
38
|
+
- Liste arquivos criados/modificados
|
|
39
|
+
- Calcule custo real vs estimado
|
|
40
|
+
|
|
41
|
+
## Padrões Obrigatórios
|
|
42
|
+
|
|
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
|
|
47
|
+
|
|
48
|
+
## Validações
|
|
49
|
+
|
|
50
|
+
Antes de marcar task como completa:
|
|
51
|
+
- [ ] Código compila
|
|
52
|
+
- [ ] Segue padrões de nomenclatura
|
|
53
|
+
- [ ] Testes unitários (se aplicável)
|
|
54
|
+
- [ ] Sem hardcoded secrets
|
|
55
|
+
|
|
56
|
+
## Output
|
|
57
|
+
|
|
58
|
+
Ao final de cada task, mostre:
|
|
59
|
+
1. Task completada
|
|
60
|
+
2. Arquivos criados/modificados
|
|
61
|
+
3. Próxima task
|
|
62
|
+
4. Progresso geral (X/Y tasks)
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
**Feature:** $ARGUMENTS
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Archive MORPH Feature
|
|
2
|
+
|
|
3
|
+
Arquive uma feature concluída, movendo-a de `features/` para `archive/`.
|
|
4
|
+
|
|
5
|
+
## Pré-requisitos
|
|
6
|
+
|
|
7
|
+
Verifique antes de arquivar:
|
|
8
|
+
- [ ] Feature existe em `.morph/features/{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/features/{feature}/tasks.md`
|
|
17
|
+
- Verifique que todas tasks estão `[x]`
|
|
18
|
+
- Confirme com o usuário se pode arquivar
|
|
19
|
+
|
|
20
|
+
2. **Complete o recap**:
|
|
21
|
+
- Atualize `.morph/features/{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/specs/`
|
|
28
|
+
- Isso vira a "verdade atual" do sistema
|
|
29
|
+
|
|
30
|
+
4. **Mova para archive**:
|
|
31
|
+
```
|
|
32
|
+
.morph/features/{feature}/ → .morph/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/archive/{feature}/ ║
|
|
66
|
+
╚════════════════════════════════════════════╝
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Specs Extraídas
|
|
70
|
+
|
|
71
|
+
Se houver specs extraídas:
|
|
72
|
+
```
|
|
73
|
+
Specs extracted to .morph/specs/:
|
|
74
|
+
- {domain}/spec.md - {description}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
**Feature to archive:** $ARGUMENTS
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# /morph-costs - Cost Estimation and Reporting
|
|
2
|
+
|
|
3
|
+
Estima e reporta custos de recursos Azure.
|
|
4
|
+
|
|
5
|
+
## Uso
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/morph-costs [action]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Actions
|
|
12
|
+
|
|
13
|
+
| Action | Descrição |
|
|
14
|
+
|--------|-----------|
|
|
15
|
+
| `estimate` | Estima custos da feature atual |
|
|
16
|
+
| `report` | Gera relatório de custos do projeto |
|
|
17
|
+
| `compare` | Compara custos entre ambientes |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
### 1. ESTIMATE - Estimar Custos
|
|
24
|
+
|
|
25
|
+
Quando o usuário solicitar `/morph-costs estimate`:
|
|
26
|
+
|
|
27
|
+
1. Ler spec.md da feature atual para identificar recursos
|
|
28
|
+
|
|
29
|
+
2. Para cada recurso Azure, calcular custo mensal:
|
|
30
|
+
|
|
31
|
+
| Recurso | SKU | Custo/Mês |
|
|
32
|
+
|---------|-----|-----------|
|
|
33
|
+
| Container Apps | Consumption (scale-to-zero) | ~$0 |
|
|
34
|
+
| Azure SQL | Free (32GB) | $0 |
|
|
35
|
+
| Azure SQL | Basic (5 DTU) | ~$5 |
|
|
36
|
+
| Storage | Standard LRS (1GB) | ~$0.02 |
|
|
37
|
+
| Key Vault | Standard | ~$0.03/10k ops |
|
|
38
|
+
| App Insights | Free (5GB/mês) | $0 |
|
|
39
|
+
| Service Bus | Basic | ~$0.05 |
|
|
40
|
+
|
|
41
|
+
3. Apresentar estimativa:
|
|
42
|
+
```markdown
|
|
43
|
+
## Estimativa de Custos - {Feature}
|
|
44
|
+
|
|
45
|
+
| Recurso | SKU | Custo/Mês |
|
|
46
|
+
|---------|-----|-----------|
|
|
47
|
+
| Container Apps | Consumption | ~$0 |
|
|
48
|
+
| SQL Database | Free | $0 |
|
|
49
|
+
| Storage | LRS 1GB | $0.02 |
|
|
50
|
+
| **TOTAL** | | **$0.02/mês** |
|
|
51
|
+
|
|
52
|
+
### Aprovação
|
|
53
|
+
✅ Free tier - nenhuma aprovação necessária
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
4. Verificar contra limites do Cost Guardian:
|
|
57
|
+
- Free tier apenas: ✅ Aprovado automaticamente
|
|
58
|
+
- Até $10/mês: ⚠️ Requer confirmação
|
|
59
|
+
- Acima de $10: ❌ Requer ADR
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### 2. REPORT - Relatório de Custos
|
|
64
|
+
|
|
65
|
+
Quando o usuário solicitar `/morph-costs report`:
|
|
66
|
+
|
|
67
|
+
1. Analisar todos os recursos definidos em `infra/`
|
|
68
|
+
|
|
69
|
+
2. Gerar relatório consolidado:
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
## Relatório de Custos - {Projeto}
|
|
73
|
+
|
|
74
|
+
### Por Ambiente
|
|
75
|
+
|
|
76
|
+
| Ambiente | Recursos | Custo/Mês |
|
|
77
|
+
|----------|----------|-----------|
|
|
78
|
+
| dev | 6 | ~$0 |
|
|
79
|
+
| prod | 6 | ~$15 |
|
|
80
|
+
| **Total** | | **~$15/mês** |
|
|
81
|
+
|
|
82
|
+
### Por Tipo de Recurso
|
|
83
|
+
|
|
84
|
+
| Recurso | Dev | Prod |
|
|
85
|
+
|---------|-----|------|
|
|
86
|
+
| Container Apps | $0 | $5 |
|
|
87
|
+
| SQL Database | $0 | $5 |
|
|
88
|
+
| Storage | $0.02 | $2 |
|
|
89
|
+
| Key Vault | $0 | $0.50 |
|
|
90
|
+
| App Insights | $0 | $2.50 |
|
|
91
|
+
|
|
92
|
+
### Recomendações
|
|
93
|
+
1. ✅ Dev usa free tier corretamente
|
|
94
|
+
2. ⚠️ Considerar Reserved Capacity para prod (-30%)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
3. Salvar relatório em `.morph/outputs/costs-report.md`
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### 3. COMPARE - Comparar Ambientes
|
|
102
|
+
|
|
103
|
+
Quando o usuário solicitar `/morph-costs compare`:
|
|
104
|
+
|
|
105
|
+
1. Analisar `parameters.dev.json` e `parameters.prod.json`
|
|
106
|
+
|
|
107
|
+
2. Gerar comparativo:
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
## Comparativo de Custos
|
|
111
|
+
|
|
112
|
+
| Recurso | Dev | Prod | Diferença |
|
|
113
|
+
|---------|-----|------|-----------|
|
|
114
|
+
| SQL SKU | Free | Basic | +$5 |
|
|
115
|
+
| Storage SKU | LRS | GRS | +$1 |
|
|
116
|
+
| Min Replicas | 0 | 1 | +$3 |
|
|
117
|
+
| **Total** | $0 | $15 | +$15 |
|
|
118
|
+
|
|
119
|
+
### Por que prod custa mais?
|
|
120
|
+
- SQL Basic: melhor performance, SLA 99.99%
|
|
121
|
+
- Storage GRS: redundância geográfica
|
|
122
|
+
- Min replicas 1: sem cold start
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Pricing Reference
|
|
128
|
+
|
|
129
|
+
### Free Tier Resources
|
|
130
|
+
|
|
131
|
+
| Recurso | Limite Grátis |
|
|
132
|
+
|---------|---------------|
|
|
133
|
+
| Azure SQL | 32GB, 100k vCore seconds |
|
|
134
|
+
| Container Apps | Scale-to-zero, 180k vCPU-sec |
|
|
135
|
+
| Storage | 5GB LRS |
|
|
136
|
+
| App Insights | 5GB/mês |
|
|
137
|
+
| Cosmos DB | 1000 RU/s, 25GB |
|
|
138
|
+
| Functions | 1M execuções |
|
|
139
|
+
|
|
140
|
+
### Costs by Region (Brazil South)
|
|
141
|
+
|
|
142
|
+
| Recurso | SKU | Preço |
|
|
143
|
+
|---------|-----|-------|
|
|
144
|
+
| Container Apps | Consumption | $0.000012/vCPU-sec |
|
|
145
|
+
| SQL | Basic | $4.99/mês |
|
|
146
|
+
| SQL | S0 | $14.72/mês |
|
|
147
|
+
| Storage | LRS | $0.0184/GB |
|
|
148
|
+
| Storage | GRS | $0.046/GB |
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Cost Guardian Rules
|
|
153
|
+
|
|
154
|
+
### Aprovação Automática (Free Tier)
|
|
155
|
+
- Container Apps com scale-to-zero
|
|
156
|
+
- SQL Free tier
|
|
157
|
+
- Storage Standard LRS até 5GB
|
|
158
|
+
- App Insights free tier
|
|
159
|
+
|
|
160
|
+
### Requer Confirmação (até $10/mês)
|
|
161
|
+
- SQL Basic
|
|
162
|
+
- Storage adicional
|
|
163
|
+
- Service Bus Basic
|
|
164
|
+
|
|
165
|
+
### Requer ADR (acima de $10/mês)
|
|
166
|
+
- Recursos Premium
|
|
167
|
+
- Multiple replicas
|
|
168
|
+
- Reserved capacity
|
|
169
|
+
- Qualquer recurso não essencial
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Exemplo de Uso
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
Usuário: /morph-costs estimate
|
|
177
|
+
Claude: Analisando feature "scheduled-reports"...
|
|
178
|
+
|
|
179
|
+
## Estimativa de Custos
|
|
180
|
+
|
|
181
|
+
| Recurso | SKU | Custo/Mês |
|
|
182
|
+
|---------|-----|-----------|
|
|
183
|
+
| Container Apps | Consumption | ~$0 |
|
|
184
|
+
| SQL Database | Free | $0 |
|
|
185
|
+
| Storage | LRS 1GB | $0.02 |
|
|
186
|
+
| Hangfire | In-process | $0 |
|
|
187
|
+
|
|
188
|
+
**TOTAL: ~$0.02/mês**
|
|
189
|
+
|
|
190
|
+
✅ Dentro do free tier - aprovado automaticamente!
|
|
191
|
+
|
|
192
|
+
Usuário: /morph-costs report
|
|
193
|
+
Claude: ## Relatório de Custos - MyProject
|
|
194
|
+
|
|
195
|
+
| Ambiente | Custo/Mês |
|
|
196
|
+
|----------|-----------|
|
|
197
|
+
| dev | $0.02 |
|
|
198
|
+
| prod | $12.50 |
|
|
199
|
+
|
|
200
|
+
⚠️ Prod excede $10/mês.
|
|
201
|
+
Deseja criar um ADR para justificar? (sim/não)
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
*MORPH-SPEC by Polymorphism Tech*
|