@polymorphism-tech/morph-spec 4.16.0 → 4.18.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 (107) hide show
  1. package/CLAUDE.md +36 -0
  2. package/README.md +2 -2
  3. package/bin/morph-spec.js +3 -0
  4. package/bin/task-manager.js +999 -962
  5. package/claude-plugin.json +1 -1
  6. package/docs/CHEATSHEET.md +1 -1
  7. package/docs/QUICKSTART.md +1 -1
  8. package/framework/agents/ai-agents/vector-search-expert.md +247 -233
  9. package/framework/agents/backend/ms-agent-expert.md +1 -1
  10. package/framework/agents/backend/neon-expert.md +379 -0
  11. package/framework/agents/frontend/gsap-animator.md +131 -0
  12. package/framework/agents/integrations/neon-auth.md +151 -0
  13. package/framework/agents.json +1183 -1085
  14. package/framework/commands/morph-preflight.md +200 -192
  15. package/framework/hooks/claude-code/session-start/inject-morph-context.js +1 -1
  16. package/framework/rules/gsap-standards.md +13 -0
  17. package/framework/rules/neon-auth-standards.md +13 -0
  18. package/framework/rules/neon-standards.md +26 -0
  19. package/framework/skills/level-0-meta/mcp-registry.json +1 -1
  20. package/framework/skills/level-0-meta/morph-agent-teams/SKILL.md +472 -472
  21. package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +1 -1
  22. package/framework/skills/level-0-meta/morph-init/SKILL.md +12 -12
  23. package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +5 -5
  24. package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +5 -5
  25. package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +7 -7
  26. package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +24 -24
  27. package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +12 -12
  28. package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +9 -9
  29. package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +1 -1
  30. package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +1 -1
  31. package/framework/skills/level-1-workflows/morph-phase-tasks/references/task-planning-patterns.md +143 -143
  32. package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +1 -1
  33. package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +1 -1
  34. package/framework/standards/STANDARDS.json +197 -116
  35. package/framework/standards/ai-agents/production.md +1 -0
  36. package/framework/standards/ai-agents/setup.md +3 -2
  37. package/framework/standards/ai-agents/workflows.md +1 -0
  38. package/framework/standards/architecture/vertical-slice/vertical-slice.md +4 -4
  39. package/framework/standards/backend/database/postgresql/database.md +63 -83
  40. package/framework/standards/backend/dotnet/scalar-ui.md +172 -172
  41. package/framework/standards/backend/dotnet/vsa-handler-patterns.md +274 -274
  42. package/framework/standards/backend/integrations/asaas/asaas-api.md +2 -2
  43. package/framework/standards/backend/integrations/neon-auth/neon-auth.md +364 -0
  44. package/framework/standards/frontend/design-system/animations.md +9 -0
  45. package/framework/standards/frontend/gsap/gsap-core.md +463 -0
  46. package/framework/standards/frontend/gsap/gsap-plugins.md +294 -0
  47. package/framework/standards/frontend/gsap/gsap-scrolltrigger.md +318 -0
  48. package/framework/standards/frontend/nextjs/motion-patterns.md +1 -0
  49. package/framework/standards/frontend/nextjs/nextjs-patterns.md +47 -37
  50. package/framework/standards/infrastructure/docker/easypanel-deploy.md +4 -8
  51. package/framework/standards/infrastructure/neon/neon-pgrag.md +239 -0
  52. package/framework/standards/infrastructure/neon/neon-pgvector.md +236 -0
  53. package/framework/standards/infrastructure/neon/neon-semantic-kernel.md +310 -0
  54. package/framework/standards/infrastructure/neon/neon-setup.md +186 -0
  55. package/framework/standards/integration/mcp/mcp-tools.md +32 -34
  56. package/framework/templates/README.md +20 -20
  57. package/framework/templates/REGISTRY.json +54 -101
  58. package/framework/templates/code/dotnet/abstractions/api-endpoint.cs +7 -7
  59. package/framework/templates/code/dotnet/backend/repository.cs +148 -148
  60. package/framework/templates/code/dotnet/contracts/contracts-vsa.cs +2 -2
  61. package/framework/templates/code/dotnet/database/vector-entity.cs +93 -0
  62. package/framework/templates/code/dotnet/feature/endpoint.cs.hbs +1 -1
  63. package/framework/templates/code/sql/{supabase-migration.sql → postgresql-migration.sql} +12 -21
  64. package/framework/templates/code/sql/{supabase-migration.template.sql → postgresql-migration.template.sql} +13 -18
  65. package/framework/templates/code/sql/{rls-policy.sql → postgresql-rls-policy.sql} +6 -9
  66. package/framework/templates/code/typescript/contracts.ts +167 -168
  67. package/framework/templates/context/CONTEXT.md +3 -3
  68. package/framework/templates/docs/proposal.md +6 -6
  69. package/framework/templates/docs/ui-components.md +1 -1
  70. package/framework/templates/feature/decisions.md +122 -121
  71. package/framework/templates/feature/recap.md +145 -145
  72. package/framework/templates/feature/tasks.md +199 -199
  73. package/framework/templates/frontend/nextjs/gsap-scroll-section.tsx.hbs +44 -0
  74. package/framework/templates/infrastructure/docker/docker-compose.template.yml +50 -67
  75. package/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -38
  76. package/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -48
  77. package/framework/templates/infrastructure/docker/easypanel.template.json +46 -54
  78. package/framework/templates/infrastructure/github/README.md +56 -56
  79. package/framework/templates/integrations/neon-auth-config.cs +133 -0
  80. package/framework/templates/integrations/semantic-kernel-neon.cs +125 -0
  81. package/framework/workflows/README.md +1 -1
  82. package/framework/workflows/docs/full-morph.md +69 -69
  83. package/package.json +1 -1
  84. package/src/commands/agents/dispatch-agents.js +19 -15
  85. package/src/commands/state/advance-phase.js +5 -0
  86. package/src/commands/tasks/task.js +3 -0
  87. package/src/core/state/state-manager.js +45 -1
  88. package/src/core/templates/template-registry.js +1 -66
  89. package/src/lib/detectors/index.js +4 -4
  90. package/src/lib/generators/architecture-scanner.js +639 -640
  91. package/src/lib/installers/mcp-installer.js +1 -1
  92. package/src/lib/tasks/task-classifier.js +15 -1
  93. package/src/lib/tasks/test-runner.js +5 -1
  94. package/src/lib/validators/content/content-validator.js +9 -10
  95. package/src/lib/validators/validation-runner.js +7 -5
  96. package/framework/agents/backend/supabase-expert.md +0 -256
  97. package/framework/agents/integrations/clerk-auth.md +0 -109
  98. package/framework/rules/clerk-standards.md +0 -13
  99. package/framework/rules/supabase-standards.md +0 -29
  100. package/framework/standards/backend/integrations/clerk/clerk-auth.md +0 -290
  101. package/framework/standards/infrastructure/supabase/mcp-setup.md +0 -142
  102. package/framework/standards/infrastructure/supabase/supabase-auth.md +0 -176
  103. package/framework/standards/infrastructure/supabase/supabase-custom-jwt.md +0 -206
  104. package/framework/standards/infrastructure/supabase/supabase-pgvector.md +0 -169
  105. package/framework/standards/infrastructure/supabase/supabase-rls.md +0 -184
  106. package/framework/standards/infrastructure/supabase/supabase-storage.md +0 -153
  107. package/framework/templates/integrations/clerk-config.cs +0 -217
@@ -1,192 +1,200 @@
1
- ---
2
- description: Validate project readiness before deploy — checks specs, contracts, tests, Docker, Supabase, and EasyPanel configuration
3
- argument-hint: [feature-name]
4
- allowed-tools: Read, Bash, Glob, Grep
5
- ---
6
-
7
- # Pre-Flight Check for Deployment
8
-
9
- Validates project readiness before deploying to Docker/EasyPanel + Supabase.
10
-
11
- ## Usage
12
-
13
- ```
14
- /morph-preflight
15
- ```
16
-
17
- ## Purpose
18
-
19
- Detect problems **before** deploy that would cause production failures. Saves time and avoids debugging in production.
20
-
21
- ---
22
-
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.
26
-
27
- ```bash
28
- # Verify implementation is complete
29
- morph-spec state get {feature}
30
- morph-spec approval-status {feature}
31
- 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 | 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.
53
-
54
- ---
55
-
56
- ## Validations Performed
57
-
58
- ### 1. Package Version Conflicts
59
-
60
- **What it checks:**
61
- - No version conflicts (NU1605, NU1608)
62
- - Critical packages with compatible versions
63
-
64
- **How to check:**
65
- ```bash
66
- dotnet restore --verbosity normal 2>&1 | grep -E "(NU1605|NU1608|warning)"
67
- ```
68
-
69
- ---
70
-
71
- ### 2. Supabase Migrations
72
-
73
- **What it checks:**
74
- - No pending migrations
75
- - RLS policies defined for all public tables
76
- - Database schema matches expected state
77
-
78
- **How to check:**
79
- ```bash
80
- # Check for pending migrations
81
- npx supabase db diff --local
82
-
83
- # Verify RLS is enabled on all tables
84
- npx supabase db lint --level warning
85
- ```
86
-
87
- **Common fix:**
88
- ```bash
89
- npx supabase migration new <migration-name>
90
- ```
91
-
92
- ---
93
-
94
- ### 3. Dockerfile Validation
95
-
96
- **What it checks:**
97
- - Dockerfile exists for each service (API, Web)
98
- - Multi-stage build configured
99
- - EXPOSE ports correct
100
- - ENTRYPOINT defined
101
- - .dockerignore present
102
-
103
- **How to check:**
104
- ```bash
105
- # Validate API Dockerfile
106
- docker build --check -f Dockerfile.api .
107
-
108
- # Validate Web Dockerfile
109
- docker build --check -f Dockerfile.web .
110
- ```
111
-
112
- ---
113
-
114
- ### 4. Docker Compose
115
-
116
- **What it checks:**
117
- - `docker-compose.yml` exists and is valid
118
- - All services have health checks
119
- - Environment variables reference `.env` (not hardcoded)
120
- - Volumes mapped correctly
121
-
122
- **How to check:**
123
- ```bash
124
- docker compose config --quiet
125
- ```
126
-
127
- ---
128
-
129
- ### 5. Environment Variables & Secrets
130
-
131
- **What it checks:**
132
- - Connection strings not hardcoded in code
133
- - Secrets in environment variables (not in appsettings)
134
- - `.env.example` exists with all required vars documented
135
- - No credentials in source code
136
-
137
- **How to check:**
138
- ```bash
139
- # Detect passwords in appsettings
140
- grep -rE "(Password=|Pwd=|Secret=|sk_live|pk_live)" appsettings*.json src/ --include="*.cs" --include="*.json" | grep -v Development
141
-
142
- # Verify .env.example exists
143
- test -f .env.example && echo "OK" || echo "MISSING .env.example"
144
- ```
145
-
146
- ---
147
-
148
- ### 6. EasyPanel Configuration
149
-
150
- **What it checks:**
151
- - Services correctly defined for EasyPanel
152
- - Health check endpoints exist (`/health` or `/healthz`)
153
- - Port mappings match Dockerfile EXPOSE
154
-
155
- **How to check:**
156
- ```bash
157
- # Verify health endpoint exists in code
158
- grep -rn "MapGet.*health" src/ --include="*.cs"
159
- ```
160
-
161
- ---
162
-
163
- ## Example Output
164
-
165
- ```
166
- MORPH Pre-Flight Check: Deployment
167
-
168
- Packages: No version conflicts detected
169
- Migrations: No pending changes
170
- Dockerfile: Valid multi-stage build (API + Web)
171
- Docker Compose: Valid configuration
172
- Secrets: No hardcoded credentials found
173
- EasyPanel: Health endpoint found at /healthz
174
-
175
- Summary: 6 passed, 0 failed, 0 warnings
176
-
177
- READY TO DEPLOY
178
- ```
179
-
180
- ---
181
-
182
- ## Usage Workflow
183
-
184
- ### Before creating PR for production
185
-
186
- ```bash
187
- /morph-preflight
188
- ```
189
-
190
- ---
191
-
192
- *MORPH-SPEC by Polymorphism Tech*
1
+ ---
2
+ description: Validate project readiness before deploy — checks specs, contracts, tests, Docker, Neon/PostgreSQL, and EasyPanel configuration
3
+ argument-hint: [feature-name]
4
+ allowed-tools: Read, Bash, Glob, Grep
5
+ ---
6
+
7
+ # Pre-Flight Check for Deployment
8
+
9
+ Validates project readiness before deploying to Docker/EasyPanel + Neon/PostgreSQL.
10
+
11
+ ## Usage
12
+
13
+ ```
14
+ /morph-preflight
15
+ ```
16
+
17
+ ## Purpose
18
+
19
+ Detect problems **before** deploy that would cause production failures. Saves time and avoids debugging in production.
20
+
21
+ ---
22
+
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.
26
+
27
+ ```bash
28
+ # Verify implementation is complete
29
+ morph-spec state get {feature}
30
+ morph-spec approval-status {feature}
31
+ 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 | 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.
53
+
54
+ ---
55
+
56
+ ## Validations Performed
57
+
58
+ ### 1. Package Version Conflicts
59
+
60
+ **What it checks:**
61
+ - No version conflicts (NU1605, NU1608)
62
+ - Critical packages with compatible versions
63
+
64
+ **How to check:**
65
+ ```bash
66
+ dotnet restore --verbosity normal 2>&1 | grep -E "(NU1605|NU1608|warning)"
67
+ ```
68
+
69
+ ---
70
+
71
+ ### 2. Database Migrations (Neon/PostgreSQL)
72
+
73
+ **What it checks:**
74
+ - Database is reachable
75
+ - No pending migrations
76
+ - RLS policies defined for all public tables
77
+ - Database schema matches expected state
78
+
79
+ **How to check:**
80
+ ```bash
81
+ # Step 0: Verify database connectivity
82
+ psql "$(neonctl connection-string)" -c "SELECT 1" 2>/dev/null && \
83
+ echo "✓ Database reachable" || \
84
+ echo "✗ Database unreachable — skip remaining migration checks"
85
+
86
+ # Check for pending migrations (skip if connectivity failed)
87
+ neonctl branches diff <branch>
88
+
89
+ # Verify RLS is enabled on all tables
90
+ psql "$(neonctl connection-string)" -c "SELECT tablename FROM pg_tables WHERE schemaname='public' AND tablename NOT IN (SELECT tablename FROM pg_policies)"
91
+ ```
92
+
93
+ > **Important:** If the database connectivity check fails, skip all migration checks and warn the user. Do not block the preflight — the database may be intentionally scaled to zero.
94
+
95
+ **Common fix:**
96
+ ```bash
97
+ dotnet ef migrations add <migration-name>
98
+ ```
99
+
100
+ ---
101
+
102
+ ### 3. Dockerfile Validation
103
+
104
+ **What it checks:**
105
+ - Dockerfile exists for each service (API, Web)
106
+ - Multi-stage build configured
107
+ - EXPOSE ports correct
108
+ - ENTRYPOINT defined
109
+ - .dockerignore present
110
+
111
+ **How to check:**
112
+ ```bash
113
+ # Validate API Dockerfile
114
+ docker build --check -f Dockerfile.api .
115
+
116
+ # Validate Web Dockerfile
117
+ docker build --check -f Dockerfile.web .
118
+ ```
119
+
120
+ ---
121
+
122
+ ### 4. Docker Compose
123
+
124
+ **What it checks:**
125
+ - `docker-compose.yml` exists and is valid
126
+ - All services have health checks
127
+ - Environment variables reference `.env` (not hardcoded)
128
+ - Volumes mapped correctly
129
+
130
+ **How to check:**
131
+ ```bash
132
+ docker compose config --quiet
133
+ ```
134
+
135
+ ---
136
+
137
+ ### 5. Environment Variables & Secrets
138
+
139
+ **What it checks:**
140
+ - Connection strings not hardcoded in code
141
+ - Secrets in environment variables (not in appsettings)
142
+ - `.env.example` exists with all required vars documented
143
+ - No credentials in source code
144
+
145
+ **How to check:**
146
+ ```bash
147
+ # Detect passwords in appsettings
148
+ grep -rE "(Password=|Pwd=|Secret=|sk_live|pk_live)" appsettings*.json src/ --include="*.cs" --include="*.json" | grep -v Development
149
+
150
+ # Verify .env.example exists
151
+ test -f .env.example && echo "OK" || echo "MISSING .env.example"
152
+ ```
153
+
154
+ ---
155
+
156
+ ### 6. EasyPanel Configuration
157
+
158
+ **What it checks:**
159
+ - Services correctly defined for EasyPanel
160
+ - Health check endpoints exist (`/health` or `/healthz`)
161
+ - Port mappings match Dockerfile EXPOSE
162
+
163
+ **How to check:**
164
+ ```bash
165
+ # Verify health endpoint exists in code
166
+ grep -rn "MapGet.*health" src/ --include="*.cs"
167
+ ```
168
+
169
+ ---
170
+
171
+ ## Example Output
172
+
173
+ ```
174
+ MORPH Pre-Flight Check: Deployment
175
+
176
+ Packages: No version conflicts detected
177
+ Migrations: No pending changes
178
+ Dockerfile: Valid multi-stage build (API + Web)
179
+ Docker Compose: Valid configuration
180
+ Secrets: No hardcoded credentials found
181
+ EasyPanel: Health endpoint found at /healthz
182
+
183
+ Summary: 6 passed, 0 failed, 0 warnings
184
+
185
+ READY TO DEPLOY
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Usage Workflow
191
+
192
+ ### Before creating PR for production
193
+
194
+ ```bash
195
+ /morph-preflight
196
+ ```
197
+
198
+ ---
199
+
200
+ *MORPH-SPEC by Polymorphism Tech*
@@ -273,7 +273,7 @@ try {
273
273
  if (currentPhaseForCli) {
274
274
  const cliChecks = [
275
275
  { name: 'docker', cmd: 'docker --version', phases: ['design', 'implement'] },
276
- { name: 'supabase', cmd: 'npx supabase --version', phases: ['design', 'implement'] },
276
+ { name: 'neonctl', cmd: 'neonctl --version', phases: ['design', 'implement'] },
277
277
  { name: 'psql', cmd: 'psql --version', phases: ['design', 'implement'] },
278
278
  { name: 'az', cmd: 'az version --output none', phases: ['implement'] },
279
279
  { name: 'gh', cmd: 'gh --version', phases: ['design', 'tasks', 'implement'] },
@@ -0,0 +1,13 @@
1
+ ---
2
+ paths:
3
+ - "**/*.tsx"
4
+ - "**/*.ts"
5
+ stacks:
6
+ - nextjs
7
+ ---
8
+
9
+ # GSAP Animation Standards
10
+
11
+ @.morph/framework/standards/frontend/gsap/gsap-core.md
12
+ @.morph/framework/standards/frontend/gsap/gsap-scrolltrigger.md
13
+ @.morph/framework/standards/frontend/gsap/gsap-plugins.md
@@ -0,0 +1,13 @@
1
+ ---
2
+ paths:
3
+ - "**/Auth/**"
4
+ - "**/auth/**"
5
+ - "**/Identity/**"
6
+ - "**/neon-auth/**"
7
+ stacks:
8
+ - neon
9
+ ---
10
+
11
+ # Neon Auth Standards
12
+
13
+ @.morph/framework/standards/backend/integrations/neon-auth/neon-auth.md
@@ -0,0 +1,26 @@
1
+ ---
2
+ paths:
3
+ - "**/neon/**"
4
+ - "**/database/**"
5
+ - "**/*Migration*.sql"
6
+ - "**/*migration*.sql"
7
+ stacks:
8
+ - neon
9
+ ---
10
+
11
+ # Neon PostgreSQL Standards
12
+
13
+ @.morph/framework/standards/infrastructure/neon/neon-setup.md
14
+ @.morph/framework/standards/infrastructure/neon/neon-pgvector.md
15
+ @.morph/framework/standards/infrastructure/neon/neon-pgrag.md
16
+ @.morph/framework/standards/infrastructure/neon/neon-semantic-kernel.md
17
+ @.morph/framework/standards/backend/integrations/neon-auth/neon-auth.md
18
+
19
+ ## SQL Templates
20
+
21
+ | Template | Path | Purpose |
22
+ |----------|------|---------|
23
+ | PostgreSQL Migration | `.morph/framework/templates/code/sql/postgresql-migration.sql` | Database migration |
24
+ | PostgreSQL RLS Policy | `.morph/framework/templates/code/sql/postgresql-rls-policy.sql` | Row-level security |
25
+
26
+ Read the template and adapt to your project structure.
@@ -121,7 +121,7 @@
121
121
  },
122
122
  "credentials": [],
123
123
  "prerequisites": [],
124
- "stackRelevance": ["nextjs", "nextjs-supabase", "vercel"],
124
+ "stackRelevance": ["nextjs", "nextjs-neon", "vercel"],
125
125
  "warnings": ["Uses OAuth — you will be prompted to authenticate via browser when first connecting."],
126
126
  "setupGuide": "Run: claude mcp add --transport http vercel https://mcp.vercel.com"
127
127
  }