@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.
- package/CLAUDE.md +1381 -0
- package/LICENSE +72 -0
- package/README.md +114 -12
- package/bin/detect-agents.js +225 -0
- package/bin/morph-spec.js +120 -0
- package/bin/render-template.js +302 -0
- package/bin/semantic-detect-agents.js +246 -0
- package/bin/validate-agents-skills.js +239 -0
- package/bin/validate-agents.js +69 -0
- package/bin/validate-phase.js +263 -0
- package/content/.azure/README.md +293 -0
- package/content/.azure/docs/azure-devops-setup.md +454 -0
- package/content/.azure/docs/branch-strategy.md +398 -0
- package/content/.azure/docs/local-development.md +515 -0
- package/content/.azure/pipelines/pipeline-variables.yml +34 -0
- package/content/.azure/pipelines/prod-pipeline.yml +319 -0
- package/content/.azure/pipelines/staging-pipeline.yml +234 -0
- package/content/.azure/pipelines/templates/build-dotnet.yml +75 -0
- package/content/.azure/pipelines/templates/deploy-app-service.yml +94 -0
- package/content/.azure/pipelines/templates/deploy-container-app.yml +120 -0
- package/content/.azure/pipelines/templates/infra-deploy.yml +90 -0
- package/content/.claude/commands/morph-apply.md +118 -26
- package/content/.claude/commands/morph-archive.md +9 -9
- package/content/.claude/commands/morph-clarify.md +184 -0
- package/content/.claude/commands/morph-design.md +275 -0
- package/content/.claude/commands/morph-proposal.md +56 -15
- package/content/.claude/commands/morph-setup.md +100 -0
- package/content/.claude/commands/morph-status.md +47 -32
- package/content/.claude/commands/morph-tasks.md +319 -0
- package/content/.claude/commands/morph-uiux.md +211 -0
- package/content/.claude/skills/specialists/ai-system-architect.md +604 -0
- package/content/.claude/skills/specialists/ms-agent-expert.md +143 -89
- package/content/.claude/skills/specialists/ui-ux-designer.md +744 -9
- package/content/.claude/skills/stacks/dotnet-blazor.md +244 -8
- package/content/.claude/skills/stacks/dotnet-nextjs.md +2 -2
- package/content/.morph/.morphversion +5 -0
- package/content/.morph/config/agents.json +101 -8
- package/content/.morph/config/azure-pricing.json +70 -0
- package/content/.morph/config/azure-pricing.schema.json +50 -0
- package/content/.morph/config/config.template.json +15 -3
- package/content/.morph/docs/STORY-DRIVEN-DEVELOPMENT.md +392 -0
- package/content/.morph/hooks/README.md +239 -0
- package/content/.morph/hooks/pre-commit-agents.sh +24 -0
- package/content/.morph/hooks/pre-commit-all.sh +48 -0
- package/content/.morph/hooks/pre-commit-costs.sh +91 -0
- package/content/.morph/hooks/pre-commit-specs.sh +49 -0
- package/content/.morph/hooks/pre-commit-tests.sh +60 -0
- package/content/.morph/project.md +5 -4
- package/content/.morph/schemas/agent.schema.json +296 -0
- package/content/.morph/standards/agent-framework-setup.md +453 -0
- package/content/.morph/standards/architecture.md +142 -7
- package/content/.morph/standards/azure.md +218 -23
- package/content/.morph/standards/coding.md +47 -12
- package/content/.morph/standards/dotnet10-migration.md +494 -0
- package/content/.morph/standards/fluent-ui-setup.md +590 -0
- package/content/.morph/standards/migration-guide.md +514 -0
- package/content/.morph/standards/passkeys-auth.md +423 -0
- package/content/.morph/standards/vector-search-rag.md +536 -0
- package/content/.morph/state.json +18 -0
- package/content/.morph/templates/FluentDesignTheme.cs +149 -0
- package/content/.morph/templates/MudTheme.cs +281 -0
- package/content/.morph/templates/contracts.cs +55 -55
- package/content/.morph/templates/decisions.md +4 -4
- package/content/.morph/templates/design-system.css +226 -0
- package/content/.morph/templates/infra/.dockerignore.example +89 -0
- package/content/.morph/templates/infra/Dockerfile.example +82 -0
- package/content/.morph/templates/infra/README.md +286 -0
- package/content/.morph/templates/infra/app-service.bicep +164 -0
- package/content/.morph/templates/infra/deploy.ps1 +229 -0
- package/content/.morph/templates/infra/deploy.sh +208 -0
- package/content/.morph/templates/infra/main.bicep +41 -7
- package/content/.morph/templates/infra/parameters.dev.json +6 -0
- package/content/.morph/templates/infra/parameters.prod.json +6 -0
- package/content/.morph/templates/infra/parameters.staging.json +29 -0
- package/content/.morph/templates/proposal.md +3 -3
- package/content/.morph/templates/recap.md +3 -3
- package/content/.morph/templates/spec.md +9 -8
- package/content/.morph/templates/sprint-status.yaml +68 -0
- package/content/.morph/templates/state.template.json +222 -0
- package/content/.morph/templates/story.md +143 -0
- package/content/.morph/templates/tasks.md +1 -1
- package/content/.morph/templates/ui-components.md +276 -0
- package/content/.morph/templates/ui-design-system.md +286 -0
- package/content/.morph/templates/ui-flows.md +336 -0
- package/content/.morph/templates/ui-mockups.md +133 -0
- package/content/.morph/test-infra/example.bicep +59 -0
- package/content/CLAUDE.md +124 -0
- package/content/README.md +79 -0
- package/detectors/config-detector.js +223 -0
- package/detectors/conversation-analyzer.js +163 -0
- package/detectors/index.js +84 -0
- package/detectors/standards-generator.js +275 -0
- package/detectors/structure-detector.js +221 -0
- package/docs/README.md +149 -0
- package/docs/api/cost-calculator.js.html +513 -0
- package/docs/api/design-system-generator.js.html +382 -0
- package/docs/api/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/api/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/api/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/api/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/api/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/api/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/api/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/api/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/api/global.html +5263 -0
- package/docs/api/index.html +96 -0
- package/docs/api/scripts/collapse.js +39 -0
- package/docs/api/scripts/commonNav.js +28 -0
- package/docs/api/scripts/linenumber.js +25 -0
- package/docs/api/scripts/nav.js +12 -0
- package/docs/api/scripts/polyfill.js +4 -0
- package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/api/scripts/prettify/lang-css.js +2 -0
- package/docs/api/scripts/prettify/prettify.js +28 -0
- package/docs/api/scripts/search.js +99 -0
- package/docs/api/state-manager.js.html +423 -0
- package/docs/api/styles/jsdoc.css +776 -0
- package/docs/api/styles/prettify.css +80 -0
- package/docs/examples.md +328 -0
- package/docs/getting-started.md +302 -0
- package/docs/installation.md +361 -0
- package/docs/templates.md +418 -0
- package/docs/validation-checklist.md +266 -0
- package/package.json +39 -12
- package/src/commands/cost.js +181 -0
- package/src/commands/create-story.js +283 -0
- package/src/commands/detect.js +104 -0
- package/src/commands/doctor.js +67 -0
- package/src/commands/generate.js +149 -0
- package/src/commands/init.js +71 -46
- package/src/commands/shard-spec.js +224 -0
- package/src/commands/sprint-status.js +250 -0
- package/src/commands/state.js +333 -0
- package/src/commands/sync.js +167 -0
- package/src/commands/update-pricing.js +206 -0
- package/src/commands/update.js +88 -13
- package/src/lib/complexity-analyzer.js +292 -0
- package/src/lib/cost-calculator.js +429 -0
- package/src/lib/design-system-generator.js +298 -0
- package/src/lib/state-manager.js +340 -0
- package/src/utils/file-copier.js +63 -0
- package/src/utils/version-checker.js +175 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
# MORPH-SPEC Templates Reference
|
|
2
|
+
|
|
3
|
+
Documentação completa de todos os templates disponíveis.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Feature Templates
|
|
8
|
+
|
|
9
|
+
Templates para documentação de features.
|
|
10
|
+
|
|
11
|
+
### spec.md
|
|
12
|
+
Template de especificação técnica.
|
|
13
|
+
|
|
14
|
+
**Localização**: `.morph/templates/spec.md`
|
|
15
|
+
|
|
16
|
+
**Seções**:
|
|
17
|
+
- Visão Geral
|
|
18
|
+
- Requisitos Funcionais
|
|
19
|
+
- Requisitos Não-Funcionais
|
|
20
|
+
- Arquitetura
|
|
21
|
+
- Modelo de Dados
|
|
22
|
+
- APIs
|
|
23
|
+
- Segurança
|
|
24
|
+
|
|
25
|
+
### tasks.md
|
|
26
|
+
Template de breakdown de tasks.
|
|
27
|
+
|
|
28
|
+
**Localização**: `.morph/templates/tasks.md`
|
|
29
|
+
|
|
30
|
+
**Estrutura**:
|
|
31
|
+
```markdown
|
|
32
|
+
| ID | Task | Dependências | Estimativa |
|
|
33
|
+
|----|------|--------------|------------|
|
|
34
|
+
| T001 | Descrição | - | S/M/L |
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### contracts.cs
|
|
38
|
+
Template de contratos (interfaces, DTOs).
|
|
39
|
+
|
|
40
|
+
**Localização**: `.morph/templates/contracts.cs`
|
|
41
|
+
|
|
42
|
+
**Inclui**:
|
|
43
|
+
- Interfaces de serviço
|
|
44
|
+
- DTOs de request/response
|
|
45
|
+
- Enums
|
|
46
|
+
- Interfaces de repositório
|
|
47
|
+
|
|
48
|
+
### decisions.md
|
|
49
|
+
Template de Architecture Decision Records.
|
|
50
|
+
|
|
51
|
+
**Localização**: `.morph/templates/decisions.md`
|
|
52
|
+
|
|
53
|
+
**Formato ADR**:
|
|
54
|
+
```markdown
|
|
55
|
+
## ADR-001: Título
|
|
56
|
+
|
|
57
|
+
**Status**: Proposed | Accepted | Deprecated
|
|
58
|
+
|
|
59
|
+
**Context**: Descrição do contexto
|
|
60
|
+
|
|
61
|
+
**Decision**: A decisão tomada
|
|
62
|
+
|
|
63
|
+
**Consequences**: Impactos positivos e negativos
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### recap.md
|
|
67
|
+
Template de resumo pós-implementação.
|
|
68
|
+
|
|
69
|
+
**Localização**: `.morph/templates/recap.md`
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Code Templates
|
|
74
|
+
|
|
75
|
+
Templates para geração de código.
|
|
76
|
+
|
|
77
|
+
### component.razor
|
|
78
|
+
Componente Blazor com parâmetros e lifecycle.
|
|
79
|
+
|
|
80
|
+
**Localização**: `.morph/templates/component.razor`
|
|
81
|
+
|
|
82
|
+
```razor
|
|
83
|
+
@namespace {{Namespace}}.Components
|
|
84
|
+
|
|
85
|
+
<div class="{{ComponentName | kebab-case}}">
|
|
86
|
+
@* Content *@
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
@code {
|
|
90
|
+
[Parameter] public string Title { get; set; }
|
|
91
|
+
|
|
92
|
+
protected override async Task OnInitializedAsync()
|
|
93
|
+
{
|
|
94
|
+
await base.OnInitializedAsync();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### service.cs
|
|
100
|
+
Serviço com injeção de dependência.
|
|
101
|
+
|
|
102
|
+
**Localização**: `.morph/templates/service.cs`
|
|
103
|
+
|
|
104
|
+
```csharp
|
|
105
|
+
public interface I{{ServiceName}}Service
|
|
106
|
+
{
|
|
107
|
+
Task<Result> ExecuteAsync(Request request, CancellationToken ct);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
public class {{ServiceName}}Service : I{{ServiceName}}Service
|
|
111
|
+
{
|
|
112
|
+
private readonly IRepository _repository;
|
|
113
|
+
private readonly ILogger<{{ServiceName}}Service> _logger;
|
|
114
|
+
|
|
115
|
+
public {{ServiceName}}Service(
|
|
116
|
+
IRepository repository,
|
|
117
|
+
ILogger<{{ServiceName}}Service> logger)
|
|
118
|
+
{
|
|
119
|
+
_repository = repository;
|
|
120
|
+
_logger = logger;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### repository.cs
|
|
126
|
+
Repositório EF Core.
|
|
127
|
+
|
|
128
|
+
**Localização**: `.morph/templates/repository.cs`
|
|
129
|
+
|
|
130
|
+
```csharp
|
|
131
|
+
public interface I{{Entity}}Repository
|
|
132
|
+
{
|
|
133
|
+
Task<{{Entity}}?> GetByIdAsync(int id, CancellationToken ct);
|
|
134
|
+
Task<IReadOnlyList<{{Entity}}>> GetAllAsync(CancellationToken ct);
|
|
135
|
+
Task AddAsync({{Entity}} entity, CancellationToken ct);
|
|
136
|
+
void Update({{Entity}} entity);
|
|
137
|
+
void Delete({{Entity}} entity);
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### test.cs
|
|
142
|
+
Teste xUnit com FluentAssertions.
|
|
143
|
+
|
|
144
|
+
**Localização**: `.morph/templates/test.cs`
|
|
145
|
+
|
|
146
|
+
```csharp
|
|
147
|
+
public class {{ServiceName}}ServiceTests
|
|
148
|
+
{
|
|
149
|
+
private readonly Mock<IRepository> _repositoryMock;
|
|
150
|
+
private readonly {{ServiceName}}Service _sut;
|
|
151
|
+
|
|
152
|
+
public {{ServiceName}}ServiceTests()
|
|
153
|
+
{
|
|
154
|
+
_repositoryMock = new Mock<IRepository>();
|
|
155
|
+
_sut = new {{ServiceName}}Service(_repositoryMock.Object);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
[Fact]
|
|
159
|
+
public async Task Method_Should_ReturnExpected_When_Condition()
|
|
160
|
+
{
|
|
161
|
+
// Arrange
|
|
162
|
+
// Act
|
|
163
|
+
// Assert
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### migration.cs
|
|
169
|
+
Migration EF Core.
|
|
170
|
+
|
|
171
|
+
**Localização**: `.morph/templates/migration.cs`
|
|
172
|
+
|
|
173
|
+
### agent.cs
|
|
174
|
+
Agente AI com Semantic Kernel.
|
|
175
|
+
|
|
176
|
+
**Localização**: `.morph/templates/agent.cs`
|
|
177
|
+
|
|
178
|
+
```csharp
|
|
179
|
+
public class {{AgentName}}Agent
|
|
180
|
+
{
|
|
181
|
+
private readonly Kernel _kernel;
|
|
182
|
+
|
|
183
|
+
[KernelFunction("function_name")]
|
|
184
|
+
[Description("Description of the function")]
|
|
185
|
+
public async Task<string> ExecuteAsync(
|
|
186
|
+
[Description("Parameter description")] string input)
|
|
187
|
+
{
|
|
188
|
+
// Implementation
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### job.cs
|
|
194
|
+
Background job Hangfire.
|
|
195
|
+
|
|
196
|
+
**Localização**: `.morph/templates/job.cs`
|
|
197
|
+
|
|
198
|
+
```csharp
|
|
199
|
+
public class {{JobName}}Job
|
|
200
|
+
{
|
|
201
|
+
private readonly IService _service;
|
|
202
|
+
private readonly ILogger<{{JobName}}Job> _logger;
|
|
203
|
+
|
|
204
|
+
[AutomaticRetry(Attempts = 3)]
|
|
205
|
+
public async Task ExecuteAsync(JobParameters parameters)
|
|
206
|
+
{
|
|
207
|
+
_logger.LogInformation("Starting job {JobName}", nameof({{JobName}}Job));
|
|
208
|
+
// Implementation
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## IaC Templates (Bicep)
|
|
216
|
+
|
|
217
|
+
Templates de Infrastructure as Code.
|
|
218
|
+
|
|
219
|
+
### main.bicep
|
|
220
|
+
Entry point que compõe todos os módulos.
|
|
221
|
+
|
|
222
|
+
**Localização**: `.morph/templates/infra/main.bicep`
|
|
223
|
+
|
|
224
|
+
**Parâmetros**:
|
|
225
|
+
- `appName` - Nome da aplicação
|
|
226
|
+
- `environment` - dev/staging/prod
|
|
227
|
+
- `location` - Região Azure
|
|
228
|
+
|
|
229
|
+
**Módulos incluídos**:
|
|
230
|
+
- Container App Environment
|
|
231
|
+
- Container App
|
|
232
|
+
- SQL Database
|
|
233
|
+
- Storage Account
|
|
234
|
+
- Key Vault
|
|
235
|
+
- Application Insights
|
|
236
|
+
|
|
237
|
+
### container-app.bicep
|
|
238
|
+
Azure Container Apps com auto-scaling.
|
|
239
|
+
|
|
240
|
+
**Localização**: `.morph/templates/infra/container-app.bicep`
|
|
241
|
+
|
|
242
|
+
**Features**:
|
|
243
|
+
- Scale-to-zero
|
|
244
|
+
- HTTP auto-scaling
|
|
245
|
+
- Health probes (liveness + readiness)
|
|
246
|
+
- Environment variables
|
|
247
|
+
- Secrets integration
|
|
248
|
+
|
|
249
|
+
### container-app-env.bicep
|
|
250
|
+
Managed Environment para Container Apps.
|
|
251
|
+
|
|
252
|
+
**Localização**: `.morph/templates/infra/container-app-env.bicep`
|
|
253
|
+
|
|
254
|
+
**Inclui**:
|
|
255
|
+
- Log Analytics workspace
|
|
256
|
+
- Internal/External ingress
|
|
257
|
+
|
|
258
|
+
### sql-database.bicep
|
|
259
|
+
Azure SQL Database.
|
|
260
|
+
|
|
261
|
+
**Localização**: `.morph/templates/infra/sql-database.bicep`
|
|
262
|
+
|
|
263
|
+
**Tiers suportados**:
|
|
264
|
+
- Free (32GB) - Desenvolvimento
|
|
265
|
+
- Basic - Produção pequena
|
|
266
|
+
- Standard - Produção
|
|
267
|
+
|
|
268
|
+
### storage.bicep
|
|
269
|
+
Storage Account com containers.
|
|
270
|
+
|
|
271
|
+
**Localização**: `.morph/templates/infra/storage.bicep`
|
|
272
|
+
|
|
273
|
+
**Containers padrão**:
|
|
274
|
+
- uploads
|
|
275
|
+
- reports
|
|
276
|
+
- backups
|
|
277
|
+
|
|
278
|
+
### key-vault.bicep
|
|
279
|
+
Azure Key Vault.
|
|
280
|
+
|
|
281
|
+
**Localização**: `.morph/templates/infra/key-vault.bicep`
|
|
282
|
+
|
|
283
|
+
**Features**:
|
|
284
|
+
- RBAC authorization
|
|
285
|
+
- Soft delete
|
|
286
|
+
- Purge protection (prod)
|
|
287
|
+
|
|
288
|
+
### app-insights.bicep
|
|
289
|
+
Application Insights para monitoring.
|
|
290
|
+
|
|
291
|
+
**Localização**: `.morph/templates/infra/app-insights.bicep`
|
|
292
|
+
|
|
293
|
+
### parameters.dev.json / parameters.prod.json
|
|
294
|
+
Parâmetros por ambiente.
|
|
295
|
+
|
|
296
|
+
**Localização**: `.morph/templates/infra/parameters.*.json`
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Integration Templates
|
|
301
|
+
|
|
302
|
+
Templates para integrações externas.
|
|
303
|
+
|
|
304
|
+
### asaas-client.cs
|
|
305
|
+
Cliente HTTP completo para Asaas.
|
|
306
|
+
|
|
307
|
+
**Localização**: `.morph/templates/integrations/asaas-client.cs`
|
|
308
|
+
|
|
309
|
+
**Endpoints**:
|
|
310
|
+
- Customers (CRUD)
|
|
311
|
+
- Payments (PIX, Boleto, Credit Card)
|
|
312
|
+
- Subscriptions
|
|
313
|
+
- Webhooks validation
|
|
314
|
+
|
|
315
|
+
**Uso**:
|
|
316
|
+
```csharp
|
|
317
|
+
services.AddAsaasClient(options =>
|
|
318
|
+
{
|
|
319
|
+
options.ApiKey = configuration["Asaas:ApiKey"];
|
|
320
|
+
options.Environment = AsaasEnvironment.Sandbox;
|
|
321
|
+
});
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### asaas-webhook.cs
|
|
325
|
+
Controller para webhooks Asaas.
|
|
326
|
+
|
|
327
|
+
**Localização**: `.morph/templates/integrations/asaas-webhook.cs`
|
|
328
|
+
|
|
329
|
+
**Eventos suportados**:
|
|
330
|
+
- PAYMENT_CREATED
|
|
331
|
+
- PAYMENT_RECEIVED
|
|
332
|
+
- PAYMENT_CONFIRMED
|
|
333
|
+
- PAYMENT_OVERDUE
|
|
334
|
+
- PAYMENT_REFUNDED
|
|
335
|
+
- SUBSCRIPTION_*
|
|
336
|
+
|
|
337
|
+
### clerk-config.cs
|
|
338
|
+
Configuração de autenticação Clerk.
|
|
339
|
+
|
|
340
|
+
**Localização**: `.morph/templates/integrations/clerk-config.cs`
|
|
341
|
+
|
|
342
|
+
**Features**:
|
|
343
|
+
- JWT validation
|
|
344
|
+
- User claims
|
|
345
|
+
- Middleware
|
|
346
|
+
- Blazor integration
|
|
347
|
+
|
|
348
|
+
### azure-identity-config.cs
|
|
349
|
+
Microsoft Identity Platform.
|
|
350
|
+
|
|
351
|
+
**Localização**: `.morph/templates/integrations/azure-identity-config.cs`
|
|
352
|
+
|
|
353
|
+
**Modos**:
|
|
354
|
+
- Web App (OpenID Connect)
|
|
355
|
+
- API (JWT Bearer)
|
|
356
|
+
- Blazor Server
|
|
357
|
+
- Downstream APIs (Graph)
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## SaaS Templates
|
|
362
|
+
|
|
363
|
+
Templates para aplicações SaaS.
|
|
364
|
+
|
|
365
|
+
### subscription.cs
|
|
366
|
+
Modelo completo de assinaturas.
|
|
367
|
+
|
|
368
|
+
**Localização**: `.morph/templates/saas/subscription.cs`
|
|
369
|
+
|
|
370
|
+
**Entidades**:
|
|
371
|
+
- `Plan` - Planos com limites e features
|
|
372
|
+
- `Subscription` - Assinatura do tenant
|
|
373
|
+
- `SubscriptionPayment` - Histórico de pagamentos
|
|
374
|
+
|
|
375
|
+
**Features**:
|
|
376
|
+
- Ciclos mensais e anuais
|
|
377
|
+
- Trial period
|
|
378
|
+
- Status machine (Trial → Active → PastDue → Canceled)
|
|
379
|
+
- Integração Asaas
|
|
380
|
+
|
|
381
|
+
### tenant.cs
|
|
382
|
+
Multi-tenancy completo.
|
|
383
|
+
|
|
384
|
+
**Localização**: `.morph/templates/saas/tenant.cs`
|
|
385
|
+
|
|
386
|
+
**Entidades**:
|
|
387
|
+
- `Tenant` - Organização
|
|
388
|
+
- `TenantUser` - Usuários do tenant
|
|
389
|
+
|
|
390
|
+
**Features**:
|
|
391
|
+
- Múltiplas estratégias de resolução:
|
|
392
|
+
- Subdomínio (`acme.app.com`)
|
|
393
|
+
- Header (`X-Tenant-ID`)
|
|
394
|
+
- Route (`/tenant/{slug}`)
|
|
395
|
+
- Claim (JWT)
|
|
396
|
+
- EF Core query filters
|
|
397
|
+
- Status management
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## Como Usar
|
|
402
|
+
|
|
403
|
+
### 1. Copiar Template
|
|
404
|
+
Os templates são automaticamente aplicados pelo MORPH durante `/morph-apply`.
|
|
405
|
+
|
|
406
|
+
### 2. Substituir Placeholders
|
|
407
|
+
Placeholders comuns:
|
|
408
|
+
- `{{Namespace}}` - Namespace do projeto
|
|
409
|
+
- `{{ServiceName}}` - Nome do serviço
|
|
410
|
+
- `{{Entity}}` - Nome da entidade
|
|
411
|
+
- `{{ComponentName}}` - Nome do componente
|
|
412
|
+
|
|
413
|
+
### 3. Customizar
|
|
414
|
+
Edite os templates em `.morph/templates/` para seu estilo.
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
*MORPH-SPEC by Polymorphism Tech*
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# MORPH-SPEC Validation Checklist
|
|
2
|
+
|
|
3
|
+
Checklist para validar o framework em um projeto real.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Setup Validation
|
|
8
|
+
|
|
9
|
+
### 1.1 Instalação
|
|
10
|
+
- [ ] Script `setup.ps1` ou `setup.sh` executa sem erros
|
|
11
|
+
- [ ] Pasta `.morph` criada corretamente
|
|
12
|
+
- [ ] Pasta `.claude` criada corretamente
|
|
13
|
+
- [ ] `CLAUDE.md` copiado para raiz do projeto
|
|
14
|
+
- [ ] Pasta `infra` criada com templates Bicep
|
|
15
|
+
|
|
16
|
+
### 1.2 Configuração
|
|
17
|
+
- [ ] `config.json` criado a partir do template
|
|
18
|
+
- [ ] Nome do projeto configurado
|
|
19
|
+
- [ ] Stack selecionada (blazor/nextjs/shopify)
|
|
20
|
+
- [ ] Azure subscription configurada (se aplicável)
|
|
21
|
+
|
|
22
|
+
### 1.3 Estrutura de Arquivos
|
|
23
|
+
- [ ] `.morph/standards/` contém 3 arquivos (coding, architecture, azure)
|
|
24
|
+
- [ ] `.morph/templates/` contém todos os templates
|
|
25
|
+
- [ ] `.morph/templates/infra/` contém 9 arquivos Bicep
|
|
26
|
+
- [ ] `.morph/templates/integrations/` contém 4 arquivos
|
|
27
|
+
- [ ] `.morph/templates/saas/` contém 2 arquivos
|
|
28
|
+
- [ ] `.morph/examples/` contém 3 exemplos
|
|
29
|
+
- [ ] `.claude/commands/` contém 6 comandos
|
|
30
|
+
- [ ] `.claude/skills/` contém 17 skills
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Slash Commands Validation
|
|
35
|
+
|
|
36
|
+
### 2.1 /morph-proposal
|
|
37
|
+
- [ ] Comando reconhecido pelo Claude Code
|
|
38
|
+
- [ ] Carrega contexto do projeto
|
|
39
|
+
- [ ] Identifica agentes por keywords
|
|
40
|
+
- [ ] Gera `spec.md` na pasta correta
|
|
41
|
+
- [ ] Gera `contracts.cs` com interfaces/DTOs
|
|
42
|
+
- [ ] Gera `decisions.md` com ADRs
|
|
43
|
+
- [ ] Para e aguarda aprovação
|
|
44
|
+
|
|
45
|
+
### 2.2 /morph-apply
|
|
46
|
+
- [ ] Comando reconhecido pelo Claude Code
|
|
47
|
+
- [ ] Carrega spec existente
|
|
48
|
+
- [ ] Quebra em tasks
|
|
49
|
+
- [ ] Implementa task por task
|
|
50
|
+
- [ ] Executa testes
|
|
51
|
+
- [ ] Faz checkpoints a cada 3 tasks
|
|
52
|
+
- [ ] Gera `recap.md` ao final
|
|
53
|
+
|
|
54
|
+
### 2.3 /morph-status
|
|
55
|
+
- [ ] Mostra features em andamento
|
|
56
|
+
- [ ] Mostra fase atual de cada feature
|
|
57
|
+
- [ ] Lista agentes ativos
|
|
58
|
+
|
|
59
|
+
### 2.4 /morph-infra
|
|
60
|
+
- [ ] `init` cria estrutura de infra
|
|
61
|
+
- [ ] `validate` valida templates Bicep
|
|
62
|
+
- [ ] `plan` mostra recursos que serão criados
|
|
63
|
+
|
|
64
|
+
### 2.5 /morph-costs
|
|
65
|
+
- [ ] Estima custos dos recursos
|
|
66
|
+
- [ ] Mostra free tier vs paid
|
|
67
|
+
- [ ] Alerta sobre custos acima do limite
|
|
68
|
+
|
|
69
|
+
### 2.6 /morph-archive
|
|
70
|
+
- [ ] Move feature para archive
|
|
71
|
+
- [ ] Atualiza status
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 3. Agent Activation Validation
|
|
76
|
+
|
|
77
|
+
### 3.1 Core Agents (Sempre Ativos)
|
|
78
|
+
- [ ] Standards Architect ativado em todas as features
|
|
79
|
+
- [ ] Azure Architect ativado quando há infra
|
|
80
|
+
- [ ] Cost Guardian monitora custos
|
|
81
|
+
|
|
82
|
+
### 3.2 Stack Agents
|
|
83
|
+
| Keyword | Agente Esperado | Status |
|
|
84
|
+
|---------|-----------------|--------|
|
|
85
|
+
| "blazor", "razor" | Blazor Builder | [ ] |
|
|
86
|
+
| "nextjs", "react" | NextJS Expert | [ ] |
|
|
87
|
+
| "shopify", "hydrogen" | Shopify Expert | [ ] |
|
|
88
|
+
|
|
89
|
+
### 3.3 Specialist Agents
|
|
90
|
+
| Keyword | Agente Esperado | Status |
|
|
91
|
+
|---------|-----------------|--------|
|
|
92
|
+
| "database", "entity" | EF Modeler | [ ] |
|
|
93
|
+
| "agent", "ai" | MS Agent Expert | [ ] |
|
|
94
|
+
| "scheduled", "job" | Hangfire Orchestrator | [ ] |
|
|
95
|
+
| "wizard", "dashboard" | UI/UX Designer | [ ] |
|
|
96
|
+
| "unclear", "requirements" | PO/PM Advisor | [ ] |
|
|
97
|
+
|
|
98
|
+
### 3.4 Integration Agents
|
|
99
|
+
| Keyword | Agente Esperado | Status |
|
|
100
|
+
|---------|-----------------|--------|
|
|
101
|
+
| "asaas", "pix", "boleto" | Asaas Financial | [ ] |
|
|
102
|
+
| "clerk", "auth" | Clerk Auth | [ ] |
|
|
103
|
+
| "identity", "entra" | Azure Identity | [ ] |
|
|
104
|
+
|
|
105
|
+
### 3.5 Infra Agents
|
|
106
|
+
| Keyword | Agente Esperado | Status |
|
|
107
|
+
|---------|-----------------|--------|
|
|
108
|
+
| "bicep", "iac" | Bicep Architect | [ ] |
|
|
109
|
+
| "pipeline", "ci/cd" | DevOps Engineer | [ ] |
|
|
110
|
+
| "container", "docker" | Container Specialist | [ ] |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 4. Templates Validation
|
|
115
|
+
|
|
116
|
+
### 4.1 Feature Templates
|
|
117
|
+
- [ ] `spec.md` template funciona
|
|
118
|
+
- [ ] `tasks.md` template funciona
|
|
119
|
+
- [ ] `contracts.cs` template funciona
|
|
120
|
+
- [ ] `decisions.md` template funciona
|
|
121
|
+
- [ ] `recap.md` template funciona
|
|
122
|
+
|
|
123
|
+
### 4.2 Code Templates
|
|
124
|
+
- [ ] `component.razor` compila
|
|
125
|
+
- [ ] `service.cs` compila
|
|
126
|
+
- [ ] `repository.cs` compila
|
|
127
|
+
- [ ] `test.cs` compila
|
|
128
|
+
- [ ] `migration.cs` compila
|
|
129
|
+
- [ ] `agent.cs` compila
|
|
130
|
+
- [ ] `job.cs` compila
|
|
131
|
+
|
|
132
|
+
### 4.3 IaC Templates
|
|
133
|
+
- [ ] `main.bicep` valida (`az bicep build`)
|
|
134
|
+
- [ ] `container-app.bicep` valida
|
|
135
|
+
- [ ] `container-app-env.bicep` valida
|
|
136
|
+
- [ ] `sql-database.bicep` valida
|
|
137
|
+
- [ ] `storage.bicep` valida
|
|
138
|
+
- [ ] `key-vault.bicep` valida
|
|
139
|
+
- [ ] `app-insights.bicep` valida
|
|
140
|
+
|
|
141
|
+
### 4.4 Integration Templates
|
|
142
|
+
- [ ] `asaas-client.cs` compila
|
|
143
|
+
- [ ] `asaas-webhook.cs` compila
|
|
144
|
+
- [ ] `clerk-config.cs` compila
|
|
145
|
+
- [ ] `azure-identity-config.cs` compila
|
|
146
|
+
|
|
147
|
+
### 4.5 SaaS Templates
|
|
148
|
+
- [ ] `subscription.cs` compila
|
|
149
|
+
- [ ] `tenant.cs` compila
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 5. Workflow Validation
|
|
154
|
+
|
|
155
|
+
### 5.1 Fase 1: SETUP
|
|
156
|
+
- [ ] Carrega `.morph/project.md`
|
|
157
|
+
- [ ] Carrega `.morph/config/config.json`
|
|
158
|
+
- [ ] Identifica stack do projeto
|
|
159
|
+
- [ ] Cria pasta em `.morph/features/<feature>`
|
|
160
|
+
|
|
161
|
+
### 5.2 Fase 2: DESIGN
|
|
162
|
+
- [ ] Gera spec baseado na descrição
|
|
163
|
+
- [ ] Consulta `.morph/standards/` para padrões
|
|
164
|
+
- [ ] Gera contracts.cs com DTOs corretos
|
|
165
|
+
- [ ] Estima custos e documenta
|
|
166
|
+
- [ ] PARA para aprovação
|
|
167
|
+
|
|
168
|
+
### 5.3 Fase 3: CLARIFY
|
|
169
|
+
- [ ] Identifica ambiguidades
|
|
170
|
+
- [ ] Faz perguntas relevantes
|
|
171
|
+
- [ ] Atualiza spec com respostas
|
|
172
|
+
|
|
173
|
+
### 5.4 Fase 4: TASKS
|
|
174
|
+
- [ ] Quebra spec em tasks numeradas
|
|
175
|
+
- [ ] Define dependências entre tasks
|
|
176
|
+
- [ ] Estabelece checkpoints
|
|
177
|
+
- [ ] PARA para aprovação
|
|
178
|
+
|
|
179
|
+
### 5.5 Fase 5: IMPLEMENT
|
|
180
|
+
- [ ] Implementa tasks na ordem
|
|
181
|
+
- [ ] Segue padrões de `coding.md`
|
|
182
|
+
- [ ] Executa testes após cada task
|
|
183
|
+
- [ ] Faz checkpoint a cada 3 tasks
|
|
184
|
+
- [ ] Gera recap ao final
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 6. Cost Validation
|
|
189
|
+
|
|
190
|
+
### 6.1 Limites
|
|
191
|
+
- [ ] Alerta quando recurso ultrapassa free tier
|
|
192
|
+
- [ ] Bloqueia recursos > $10/mês sem aprovação
|
|
193
|
+
- [ ] Requer ADR para recursos > $10/mês
|
|
194
|
+
|
|
195
|
+
### 6.2 Estimativas
|
|
196
|
+
- [ ] Container Apps: $0 (scale-to-zero)
|
|
197
|
+
- [ ] SQL Database: $0 (Free tier 32GB)
|
|
198
|
+
- [ ] Storage: < $1/mês
|
|
199
|
+
- [ ] App Insights: $0 (5GB free)
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 7. End-to-End Test
|
|
204
|
+
|
|
205
|
+
### 7.1 Cenário: Feature Simples
|
|
206
|
+
```
|
|
207
|
+
/morph-proposal user-profile
|
|
208
|
+
Descrição: "Adicionar página de perfil do usuário com edição de dados"
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Esperado**:
|
|
212
|
+
- [ ] Ativa: Standards Architect, Blazor Builder, EF Modeler
|
|
213
|
+
- [ ] Gera spec com requisitos de perfil
|
|
214
|
+
- [ ] Gera contracts com UserProfileDto
|
|
215
|
+
- [ ] Tasks incluem: criar entity, criar service, criar página
|
|
216
|
+
|
|
217
|
+
### 7.2 Cenário: Feature com Pagamento
|
|
218
|
+
```
|
|
219
|
+
/morph-proposal subscription-billing
|
|
220
|
+
Descrição: "Implementar cobrança de assinaturas com Asaas, PIX e boleto"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**Esperado**:
|
|
224
|
+
- [ ] Ativa: Asaas Financial, Cost Guardian
|
|
225
|
+
- [ ] Consulta skill `asaas-financial.md`
|
|
226
|
+
- [ ] Usa template `asaas-client.cs`
|
|
227
|
+
- [ ] Usa template `subscription.cs`
|
|
228
|
+
|
|
229
|
+
### 7.3 Cenário: Feature com Infra
|
|
230
|
+
```
|
|
231
|
+
/morph-proposal deploy-production
|
|
232
|
+
Descrição: "Configurar deploy para produção com Container Apps e SQL"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Esperado**:
|
|
236
|
+
- [ ] Ativa: Bicep Architect, Container Specialist, Azure Architect
|
|
237
|
+
- [ ] Usa templates de `infra/`
|
|
238
|
+
- [ ] Estima custos
|
|
239
|
+
- [ ] Gera `parameters.prod.json`
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## 8. Issues Found
|
|
244
|
+
|
|
245
|
+
| # | Descrição | Severidade | Status |
|
|
246
|
+
|---|-----------|------------|--------|
|
|
247
|
+
| 1 | | | |
|
|
248
|
+
| 2 | | | |
|
|
249
|
+
| 3 | | | |
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 9. Sign-off
|
|
254
|
+
|
|
255
|
+
| Item | Responsável | Data | Status |
|
|
256
|
+
|------|-------------|------|--------|
|
|
257
|
+
| Setup | | | [ ] |
|
|
258
|
+
| Commands | | | [ ] |
|
|
259
|
+
| Agents | | | [ ] |
|
|
260
|
+
| Templates | | | [ ] |
|
|
261
|
+
| Workflow | | | [ ] |
|
|
262
|
+
| E2E Tests | | | [ ] |
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
*MORPH-SPEC by Polymorphism Tech*
|