@polymorphism-tech/morph-spec 4.10.0 → 4.10.2
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 +2 -2
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +5 -69
- package/framework/agents/backend/api-designer.md +3 -0
- package/framework/agents/backend/dotnet-senior.md +3 -0
- package/framework/agents/backend/ef-modeler.md +2 -0
- package/framework/agents/backend/hangfire-orchestrator.md +2 -0
- package/framework/agents/backend/ms-agent-expert.md +2 -0
- package/framework/agents/frontend/blazor-builder.md +2 -0
- package/framework/agents/frontend/nextjs-expert.md +2 -0
- package/framework/agents/infrastructure/azure-architect.md +2 -0
- package/framework/agents/infrastructure/azure-deploy-specialist.md +2 -0
- package/framework/agents/infrastructure/bicep-architect.md +2 -0
- package/framework/agents/infrastructure/container-specialist.md +2 -0
- package/framework/agents/infrastructure/devops-engineer.md +3 -0
- package/framework/agents/infrastructure/infra-architect.md +3 -0
- package/framework/agents/integrations/asaas-financial.md +2 -0
- package/framework/agents/integrations/azure-identity.md +2 -0
- package/framework/agents/integrations/clerk-auth.md +3 -0
- package/framework/agents/integrations/hangfire-integration.md +2 -0
- package/framework/agents/integrations/resend-email.md +2 -0
- package/framework/commands/morph-apply.md +151 -161
- package/framework/commands/morph-archive.md +28 -28
- package/framework/commands/morph-infra.md +79 -79
- package/framework/commands/morph-preflight.md +92 -56
- package/framework/commands/morph-proposal.md +94 -70
- package/framework/commands/morph-status.md +31 -31
- package/framework/commands/morph-troubleshoot.md +63 -60
- package/framework/rules/csharp-standards.md +3 -0
- package/framework/rules/frontend-standards.md +2 -0
- package/framework/rules/infrastructure-standards.md +3 -0
- package/framework/rules/morph-workflow.md +57 -2
- package/framework/rules/nextjs-standards.md +2 -0
- package/framework/rules/testing-standards.md +3 -0
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +54 -49
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +42 -19
- package/framework/skills/level-0-meta/morph-code-review/SKILL.md +8 -5
- package/framework/skills/level-0-meta/morph-code-review-nextjs/SKILL.md +7 -5
- package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +139 -136
- package/framework/skills/level-0-meta/morph-init/SKILL.md +42 -13
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +130 -130
- package/framework/skills/level-0-meta/morph-replicate/SKILL.md +95 -87
- package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +24 -0
- package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +42 -41
- package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +22 -11
- package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +123 -114
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +120 -102
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +206 -214
- package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +38 -0
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +241 -360
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +107 -115
- package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +135 -135
- package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +14 -0
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +143 -139
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +168 -165
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +57 -8
- package/package.json +3 -3
- package/src/commands/project/doctor.js +7 -2
- package/src/commands/project/update.js +4 -4
- package/src/lib/stack-filter.js +58 -0
- package/src/scripts/setup-infra.js +53 -18
- package/src/utils/agents-installer.js +19 -5
- package/src/utils/claude-md-injector.js +90 -0
- package/src/utils/hooks-installer.js +1 -4
- package/src/utils/skills-installer.js +67 -7
- package/CLAUDE.md +0 -98
- package/framework/memory/patterns-learned.md +0 -766
- package/framework/skills/level-0-meta/morph-terminal-title/SKILL.md +0 -61
- package/framework/skills/level-0-meta/morph-terminal-title/scripts/set_title.sh +0 -65
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Manage Azure infrastructure with Bicep templates — provision, update, and monitor cloud resources
|
|
3
3
|
argument-hint: [up|down|plan|status]
|
|
4
|
-
allowed-tools: Read, Write, Edit, Bash, Glob
|
|
4
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, AskUserQuestion
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# /morph-infra - Infrastructure Management
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Manage Azure infrastructure using Bicep templates.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Usage
|
|
12
12
|
|
|
13
13
|
```
|
|
14
14
|
/morph-infra [action] [options]
|
|
@@ -16,23 +16,23 @@ Gerencia infraestrutura Azure usando Bicep templates.
|
|
|
16
16
|
|
|
17
17
|
### Actions
|
|
18
18
|
|
|
19
|
-
| Action |
|
|
20
|
-
|
|
21
|
-
| `init` |
|
|
22
|
-
| `validate` |
|
|
23
|
-
| `plan` |
|
|
24
|
-
| `deploy` |
|
|
25
|
-
| `destroy` | Remove
|
|
19
|
+
| Action | Description |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| `init` | Initialize IaC structure in the project |
|
|
22
|
+
| `validate` | Validate Bicep templates |
|
|
23
|
+
| `plan` | Show what-if of changes |
|
|
24
|
+
| `deploy` | Execute resource deployment |
|
|
25
|
+
| `destroy` | Remove all resources |
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
29
|
## Workflow
|
|
30
30
|
|
|
31
|
-
### 1. INIT -
|
|
31
|
+
### 1. INIT - Initialize IaC
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
When the user requests `/morph-infra init`:
|
|
34
34
|
|
|
35
|
-
1.
|
|
35
|
+
1. Create the `infra/` structure in the project:
|
|
36
36
|
```
|
|
37
37
|
infra/
|
|
38
38
|
├── main.bicep
|
|
@@ -47,42 +47,42 @@ Quando o usuário solicitar `/morph-infra init`:
|
|
|
47
47
|
└── app-insights.bicep
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
2.
|
|
50
|
+
2. Copy templates from `.morph/framework/templates/infrastructure/...`
|
|
51
51
|
|
|
52
|
-
3.
|
|
53
|
-
- `{{APP_NAME}}` →
|
|
54
|
-
- `{{SUBSCRIPTION_ID}}` →
|
|
55
|
-
- `{{RESOURCE_GROUP}}` →
|
|
52
|
+
3. Replace placeholders:
|
|
53
|
+
- `{{APP_NAME}}` → project name
|
|
54
|
+
- `{{SUBSCRIPTION_ID}}` → request from user
|
|
55
|
+
- `{{RESOURCE_GROUP}}` → suggest default `rg-{app}-{env}`
|
|
56
56
|
|
|
57
|
-
4.
|
|
57
|
+
4. Document the created structure in `decisions.md`
|
|
58
58
|
|
|
59
59
|
---
|
|
60
60
|
|
|
61
|
-
### 2. VALIDATE -
|
|
61
|
+
### 2. VALIDATE - Validate Templates
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
When the user requests `/morph-infra validate`:
|
|
64
64
|
|
|
65
|
-
1.
|
|
65
|
+
1. Run Bicep validation:
|
|
66
66
|
```bash
|
|
67
67
|
az bicep build --file infra/main.bicep
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
2.
|
|
70
|
+
2. Check required parameters
|
|
71
71
|
|
|
72
|
-
3.
|
|
72
|
+
3. Report errors or success
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
76
|
-
### 3. PLAN - Preview
|
|
76
|
+
### 3. PLAN - Preview Changes
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
When the user requests `/morph-infra plan [env]`:
|
|
79
79
|
|
|
80
|
-
1.
|
|
80
|
+
1. Check if Azure CLI is authenticated:
|
|
81
81
|
```bash
|
|
82
82
|
az account show
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
2.
|
|
85
|
+
2. Run what-if:
|
|
86
86
|
```bash
|
|
87
87
|
az deployment group what-if \
|
|
88
88
|
--resource-group rg-{app}-{env} \
|
|
@@ -90,28 +90,28 @@ Quando o usuário solicitar `/morph-infra plan [env]`:
|
|
|
90
90
|
--parameters @infra/parameters.{env}.json
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
3.
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
93
|
+
3. Present change summary:
|
|
94
|
+
- Resources to create
|
|
95
|
+
- Resources to modify
|
|
96
|
+
- Resources to delete
|
|
97
|
+
- Estimated costs
|
|
98
98
|
|
|
99
|
-
4.
|
|
99
|
+
4. **STOP and wait for approval** before deploy
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
-
### 4. DEPLOY -
|
|
103
|
+
### 4. DEPLOY - Execute Deploy
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
When the user requests `/morph-infra deploy [env]`:
|
|
106
106
|
|
|
107
|
-
1.
|
|
107
|
+
1. Verify plan was approved
|
|
108
108
|
|
|
109
|
-
2.
|
|
109
|
+
2. Create resource group if it doesn't exist:
|
|
110
110
|
```bash
|
|
111
111
|
az group create --name rg-{app}-{env} --location brazilsouth
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
3.
|
|
114
|
+
3. Execute deploy:
|
|
115
115
|
```bash
|
|
116
116
|
az deployment group create \
|
|
117
117
|
--resource-group rg-{app}-{env} \
|
|
@@ -119,75 +119,75 @@ Quando o usuário solicitar `/morph-infra deploy [env]`:
|
|
|
119
119
|
--parameters @infra/parameters.{env}.json
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
4.
|
|
122
|
+
4. Capture outputs:
|
|
123
123
|
- Container App URL
|
|
124
124
|
- SQL Connection String
|
|
125
125
|
- Key Vault URI
|
|
126
126
|
|
|
127
|
-
5.
|
|
127
|
+
5. Update documentation with deploy information
|
|
128
128
|
|
|
129
129
|
---
|
|
130
130
|
|
|
131
|
-
### 5. DESTROY -
|
|
131
|
+
### 5. DESTROY - Remove Resources
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
When the user requests `/morph-infra destroy [env]`:
|
|
134
134
|
|
|
135
|
-
1.
|
|
135
|
+
1. **WARN** that this action is irreversible
|
|
136
136
|
|
|
137
|
-
2.
|
|
137
|
+
2. List resources that will be deleted
|
|
138
138
|
|
|
139
|
-
3.
|
|
139
|
+
3. **STOP and wait for explicit confirmation** ("yes, delete")
|
|
140
140
|
|
|
141
|
-
4.
|
|
141
|
+
4. Execute:
|
|
142
142
|
```bash
|
|
143
143
|
az group delete --name rg-{app}-{env} --yes --no-wait
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
---
|
|
147
147
|
|
|
148
|
-
##
|
|
148
|
+
## Security Rules
|
|
149
149
|
|
|
150
|
-
###
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
150
|
+
### NEVER:
|
|
151
|
+
- Expose secrets in logs
|
|
152
|
+
- Commit files with secrets
|
|
153
|
+
- Delete production resources without explicit confirmation
|
|
154
|
+
- Create resources outside Bicep (zero portal)
|
|
155
155
|
|
|
156
|
-
###
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
156
|
+
### ALWAYS:
|
|
157
|
+
- Use Key Vault for secrets
|
|
158
|
+
- Validate Bicep before deploy
|
|
159
|
+
- Run what-if before deploy
|
|
160
|
+
- Document estimated costs
|
|
161
|
+
- Keep parameters.json separated by environment
|
|
162
162
|
|
|
163
163
|
---
|
|
164
164
|
|
|
165
165
|
## Cost Guardian Integration
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
Before any deploy, check with Cost Guardian:
|
|
168
168
|
|
|
169
|
-
1.
|
|
170
|
-
2.
|
|
171
|
-
- Free tier:
|
|
172
|
-
-
|
|
173
|
-
-
|
|
169
|
+
1. Estimate monthly resource costs
|
|
170
|
+
2. Verify it's within approved limits:
|
|
171
|
+
- Free tier: no approval needed
|
|
172
|
+
- Up to $10/month: requires confirmation
|
|
173
|
+
- Above $10: requires ADR
|
|
174
174
|
|
|
175
175
|
---
|
|
176
176
|
|
|
177
|
-
##
|
|
177
|
+
## Usage Example
|
|
178
178
|
|
|
179
179
|
```
|
|
180
|
-
|
|
181
|
-
Claude:
|
|
180
|
+
User: /morph-infra init
|
|
181
|
+
Claude: Creating IaC structure...
|
|
182
182
|
- infra/main.bicep
|
|
183
183
|
- infra/parameters.dev.json
|
|
184
184
|
- infra/modules/*.bicep
|
|
185
|
-
|
|
185
|
+
Done! Run /morph-infra validate to verify.
|
|
186
186
|
|
|
187
|
-
|
|
188
|
-
Claude:
|
|
187
|
+
User: /morph-infra plan dev
|
|
188
|
+
Claude: Analyzing changes for dev environment...
|
|
189
189
|
|
|
190
|
-
|
|
190
|
+
CREATE:
|
|
191
191
|
+ Container App Environment
|
|
192
192
|
+ Container App
|
|
193
193
|
+ SQL Server (Free)
|
|
@@ -195,14 +195,14 @@ Claude: Analisando mudanças para ambiente dev...
|
|
|
195
195
|
+ Key Vault
|
|
196
196
|
+ Application Insights
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
ESTIMATED COST: ~$0/month (Free tier)
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
Approve deploy? (yes/no)
|
|
201
201
|
|
|
202
|
-
|
|
203
|
-
Claude:
|
|
204
|
-
✓ Resource Group
|
|
205
|
-
✓ Deploy
|
|
202
|
+
User: yes
|
|
203
|
+
Claude: Executing deploy...
|
|
204
|
+
✓ Resource Group created
|
|
205
|
+
✓ Deploy completed in 3m 45s
|
|
206
206
|
|
|
207
207
|
OUTPUTS:
|
|
208
208
|
- URL: https://myapp-dev.azurecontainerapps.io
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Validate project readiness before Azure deploy — checks specs, contracts, tests, and infrastructure
|
|
3
3
|
argument-hint: [feature-name]
|
|
4
4
|
allowed-tools: Read, Bash, Glob, Grep
|
|
5
5
|
---
|
|
@@ -8,33 +8,69 @@ allowed-tools: Read, Bash, Glob, Grep
|
|
|
8
8
|
|
|
9
9
|
Validates project readiness before deploying to Azure.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Usage
|
|
12
12
|
|
|
13
13
|
```
|
|
14
14
|
/morph-preflight azure
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Purpose
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Detect problems **before** deploy that would cause production failures. Saves time and avoids debugging in Azure environment.
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## MORPH-SPEC Validation (run before all other checks)
|
|
24
|
+
|
|
25
|
+
These checks verify that the morph-spec workflow is complete for the feature being deployed. Skip only if deploying a non-morph-spec project.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Verify implementation is complete
|
|
29
|
+
npx morph-spec state get {feature}
|
|
30
|
+
npx morph-spec approval-status {feature}
|
|
31
|
+
npx morph-spec validate-feature {feature}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
| Check | Command | Pass Criteria |
|
|
35
|
+
|-------|---------|---------------|
|
|
36
|
+
| Phase is implement or later | `state get` | phase derived as `implement` |
|
|
37
|
+
| All gates approved | `approval-status` | design, plan, tasks gates all approved |
|
|
38
|
+
| Feature validation passes | `validate-feature` | 100% pass rate |
|
|
39
|
+
| All tasks complete | `state get` → tasks array | 0 tasks in `pending` or `in_progress` |
|
|
40
|
+
| Recap generated | Read `5-implement/recap.md` | File exists and is non-empty |
|
|
41
|
+
|
|
42
|
+
**If any MORPH check fails:** Show which check failed and recommend: `Run /morph-apply {feature} to complete implementation before deploying.`
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Test Suite (run before infrastructure checks)
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
dotnet test --verbosity normal
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Pass criteria:** 100% test pass rate. Zero tolerance — any failing test blocks deployment. If tests fail, categorize each failure:
|
|
53
|
+
- **Genuine bug** → fix implementation
|
|
54
|
+
- **Flaky/environment test** → isolate and fix
|
|
55
|
+
- **Outdated assertion** → update test to match correct new behavior
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Validations Performed
|
|
24
60
|
|
|
25
61
|
### 1. Package Version Conflicts
|
|
26
62
|
|
|
27
|
-
**
|
|
28
|
-
- `Azure.Identity`
|
|
29
|
-
-
|
|
30
|
-
-
|
|
63
|
+
**What it checks:**
|
|
64
|
+
- `Azure.Identity` explicitly specified
|
|
65
|
+
- No version conflicts (NU1605, NU1608)
|
|
66
|
+
- Critical packages with compatible versions
|
|
31
67
|
|
|
32
|
-
**
|
|
68
|
+
**How to check:**
|
|
33
69
|
```bash
|
|
34
70
|
dotnet restore --verbosity normal 2>&1 | grep -E "(NU1605|NU1608|warning)"
|
|
35
71
|
```
|
|
36
72
|
|
|
37
|
-
**
|
|
73
|
+
**Common fix:**
|
|
38
74
|
```xml
|
|
39
75
|
<PackageReference Include="Azure.Identity" Version="1.14.2" />
|
|
40
76
|
```
|
|
@@ -43,19 +79,19 @@ dotnet restore --verbosity normal 2>&1 | grep -E "(NU1605|NU1608|warning)"
|
|
|
43
79
|
|
|
44
80
|
### 2. EF Core Migrations
|
|
45
81
|
|
|
46
|
-
**
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- Migration scripts
|
|
82
|
+
**What it checks:**
|
|
83
|
+
- No pending model changes
|
|
84
|
+
- Applicable migrations exist
|
|
85
|
+
- Migration scripts are valid
|
|
50
86
|
|
|
51
|
-
**
|
|
87
|
+
**How to check:**
|
|
52
88
|
```bash
|
|
53
89
|
dotnet ef migrations has-pending-model-changes \
|
|
54
90
|
--project src/Infrastructure \
|
|
55
91
|
--startup-project src/Web
|
|
56
92
|
```
|
|
57
93
|
|
|
58
|
-
**
|
|
94
|
+
**Common fix:**
|
|
59
95
|
```bash
|
|
60
96
|
dotnet ef migrations add <MigrationName> \
|
|
61
97
|
--project src/Infrastructure \
|
|
@@ -64,30 +100,30 @@ dotnet ef migrations add <MigrationName> \
|
|
|
64
100
|
|
|
65
101
|
---
|
|
66
102
|
|
|
67
|
-
### 3. Dockerfile Validation (
|
|
103
|
+
### 3. Dockerfile Validation (if Container Apps)
|
|
68
104
|
|
|
69
|
-
**
|
|
70
|
-
- Dockerfile
|
|
71
|
-
- Base image
|
|
72
|
-
- Multi-stage build
|
|
73
|
-
- EXPOSE ports
|
|
74
|
-
- ENTRYPOINT
|
|
105
|
+
**What it checks:**
|
|
106
|
+
- Dockerfile exists
|
|
107
|
+
- Base image is valid
|
|
108
|
+
- Multi-stage build configured
|
|
109
|
+
- EXPOSE ports correct
|
|
110
|
+
- ENTRYPOINT defined
|
|
75
111
|
|
|
76
|
-
**
|
|
112
|
+
**How to check:**
|
|
77
113
|
```bash
|
|
78
114
|
docker build --check .
|
|
79
|
-
#
|
|
115
|
+
# Or manual Dockerfile validation
|
|
80
116
|
```
|
|
81
117
|
|
|
82
118
|
---
|
|
83
119
|
|
|
84
120
|
### 4. Blazor .NET 10 Assets
|
|
85
121
|
|
|
86
|
-
**
|
|
87
|
-
- `RequiresAspNetWebAssets`
|
|
88
|
-
- Static web assets
|
|
122
|
+
**What it checks:**
|
|
123
|
+
- `RequiresAspNetWebAssets` is `true` (if Blazor + .NET 10)
|
|
124
|
+
- Static web assets configured correctly
|
|
89
125
|
|
|
90
|
-
**
|
|
126
|
+
**How to check:**
|
|
91
127
|
```bash
|
|
92
128
|
grep -r "RequiresAspNetWebAssets" *.csproj
|
|
93
129
|
```
|
|
@@ -103,12 +139,12 @@ grep -r "RequiresAspNetWebAssets" *.csproj
|
|
|
103
139
|
|
|
104
140
|
### 5. Bicep Syntax Validation
|
|
105
141
|
|
|
106
|
-
**
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
- Resources
|
|
142
|
+
**What it checks:**
|
|
143
|
+
- `.bicep` files without syntax errors
|
|
144
|
+
- Required parameters defined
|
|
145
|
+
- Resources with valid names
|
|
110
146
|
|
|
111
|
-
**
|
|
147
|
+
**How to check:**
|
|
112
148
|
```bash
|
|
113
149
|
az bicep build --file infra/main.bicep --stdout > /dev/null
|
|
114
150
|
```
|
|
@@ -117,20 +153,20 @@ az bicep build --file infra/main.bicep --stdout > /dev/null
|
|
|
117
153
|
|
|
118
154
|
### 6. Key Vault Configuration
|
|
119
155
|
|
|
120
|
-
**
|
|
121
|
-
- Key Vault URI
|
|
122
|
-
-
|
|
123
|
-
- Managed Identity
|
|
156
|
+
**What it checks:**
|
|
157
|
+
- Key Vault URI configured in `appsettings.json` or environment
|
|
158
|
+
- Key Vault not conditioned on environment (common bug)
|
|
159
|
+
- Managed Identity enabled
|
|
124
160
|
|
|
125
|
-
**
|
|
161
|
+
**How to check:**
|
|
126
162
|
```bash
|
|
127
163
|
grep -r "KeyVaultUri\|AzureKeyVault" appsettings*.json
|
|
128
164
|
grep -r "IsDevelopment()" Program.cs | grep -i keyvault
|
|
129
165
|
```
|
|
130
166
|
|
|
131
|
-
**Anti-pattern
|
|
167
|
+
**Anti-pattern to detect:**
|
|
132
168
|
```csharp
|
|
133
|
-
// ❌
|
|
169
|
+
// ❌ WRONG - Doesn't load Key Vault in dev!
|
|
134
170
|
if (!builder.Environment.IsDevelopment())
|
|
135
171
|
{
|
|
136
172
|
builder.Configuration.AddAzureKeyVault(...);
|
|
@@ -141,20 +177,20 @@ if (!builder.Environment.IsDevelopment())
|
|
|
141
177
|
|
|
142
178
|
### 7. Connection Strings Security
|
|
143
179
|
|
|
144
|
-
**
|
|
145
|
-
- Connection strings
|
|
146
|
-
- Secrets
|
|
147
|
-
-
|
|
180
|
+
**What it checks:**
|
|
181
|
+
- Connection strings not hardcoded in code
|
|
182
|
+
- Secrets in Key Vault or User Secrets
|
|
183
|
+
- No credentials in `appsettings.json` (except Development)
|
|
148
184
|
|
|
149
|
-
**
|
|
185
|
+
**How to check:**
|
|
150
186
|
```bash
|
|
151
|
-
#
|
|
187
|
+
# Detect passwords in appsettings
|
|
152
188
|
grep -rE "(Password=|Pwd=|Secret=)" appsettings*.json | grep -v Development
|
|
153
189
|
```
|
|
154
190
|
|
|
155
191
|
---
|
|
156
192
|
|
|
157
|
-
## Output
|
|
193
|
+
## Example Output
|
|
158
194
|
|
|
159
195
|
```
|
|
160
196
|
🔍 MORPH Pre-Flight Check: Azure Deployment
|
|
@@ -181,15 +217,15 @@ Recommended fixes:
|
|
|
181
217
|
|
|
182
218
|
---
|
|
183
219
|
|
|
184
|
-
## Workflow
|
|
220
|
+
## Usage Workflow
|
|
185
221
|
|
|
186
|
-
###
|
|
222
|
+
### Before creating PR for production
|
|
187
223
|
|
|
188
224
|
```bash
|
|
189
225
|
/morph-preflight azure
|
|
190
226
|
```
|
|
191
227
|
|
|
192
|
-
###
|
|
228
|
+
### In CI/CD pipeline
|
|
193
229
|
|
|
194
230
|
```yaml
|
|
195
231
|
- script: |
|
|
@@ -212,9 +248,9 @@ Recommended fixes:
|
|
|
212
248
|
|
|
213
249
|
---
|
|
214
250
|
|
|
215
|
-
##
|
|
251
|
+
## Future Validations (Roadmap)
|
|
216
252
|
|
|
217
|
-
- [ ] Cost estimation validation (
|
|
253
|
+
- [ ] Cost estimation validation (within budget)
|
|
218
254
|
- [ ] RBAC permissions check
|
|
219
255
|
- [ ] Network security rules validation
|
|
220
256
|
- [ ] Health probe endpoint exists
|
|
@@ -222,9 +258,9 @@ Recommended fixes:
|
|
|
222
258
|
|
|
223
259
|
---
|
|
224
260
|
|
|
225
|
-
##
|
|
261
|
+
## References
|
|
226
262
|
|
|
227
|
-
- [azure.md](../../standards/azure.md) -
|
|
263
|
+
- [azure.md](../../standards/azure.md) - Azure Standards
|
|
228
264
|
- [dotnet10-migration.md](../../standards/dotnet10-migration.md) - Breaking changes .NET 10
|
|
229
265
|
- [blazor-efcore.md](../../../../framework/standards/blazor-efcore.md) - EF Core patterns
|
|
230
266
|
|