@polymorphism-tech/morph-spec 4.16.0 → 4.17.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 (98) hide show
  1. package/README.md +2 -2
  2. package/bin/morph-spec.js +3 -0
  3. package/bin/task-manager.js +999 -962
  4. package/claude-plugin.json +1 -1
  5. package/docs/CHEATSHEET.md +1 -1
  6. package/docs/QUICKSTART.md +1 -1
  7. package/framework/agents/ai-agents/vector-search-expert.md +247 -233
  8. package/framework/agents/backend/ms-agent-expert.md +1 -1
  9. package/framework/agents/backend/neon-expert.md +397 -0
  10. package/framework/agents/frontend/gsap-animator.md +131 -0
  11. package/framework/agents.json +1175 -1085
  12. package/framework/commands/morph-preflight.md +200 -192
  13. package/framework/hooks/claude-code/session-start/inject-morph-context.js +1 -1
  14. package/framework/rules/gsap-standards.md +13 -0
  15. package/framework/rules/neon-standards.md +25 -0
  16. package/framework/skills/level-0-meta/mcp-registry.json +1 -1
  17. package/framework/skills/level-0-meta/morph-agent-teams/SKILL.md +472 -472
  18. package/framework/skills/level-0-meta/morph-init/SKILL.md +11 -11
  19. package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +5 -5
  20. package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +5 -5
  21. package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +7 -7
  22. package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +24 -24
  23. package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +12 -12
  24. package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +9 -9
  25. package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +1 -1
  26. package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +1 -1
  27. package/framework/skills/level-1-workflows/morph-phase-tasks/references/task-planning-patterns.md +143 -143
  28. package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +1 -1
  29. package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +1 -1
  30. package/framework/standards/STANDARDS.json +184 -107
  31. package/framework/standards/ai-agents/production.md +1 -0
  32. package/framework/standards/ai-agents/setup.md +3 -2
  33. package/framework/standards/ai-agents/workflows.md +1 -0
  34. package/framework/standards/architecture/vertical-slice/vertical-slice.md +4 -4
  35. package/framework/standards/backend/database/postgresql/database.md +58 -78
  36. package/framework/standards/backend/dotnet/scalar-ui.md +172 -172
  37. package/framework/standards/backend/dotnet/vsa-handler-patterns.md +274 -274
  38. package/framework/standards/backend/integrations/asaas/asaas-api.md +1 -1
  39. package/framework/standards/backend/integrations/clerk/clerk-auth.md +23 -21
  40. package/framework/standards/frontend/design-system/animations.md +9 -0
  41. package/framework/standards/frontend/gsap/gsap-core.md +463 -0
  42. package/framework/standards/frontend/gsap/gsap-plugins.md +294 -0
  43. package/framework/standards/frontend/gsap/gsap-scrolltrigger.md +318 -0
  44. package/framework/standards/frontend/nextjs/motion-patterns.md +1 -0
  45. package/framework/standards/frontend/nextjs/nextjs-patterns.md +47 -37
  46. package/framework/standards/infrastructure/docker/easypanel-deploy.md +4 -8
  47. package/framework/standards/infrastructure/neon/neon-pgrag.md +239 -0
  48. package/framework/standards/infrastructure/neon/neon-pgvector.md +236 -0
  49. package/framework/standards/infrastructure/neon/neon-semantic-kernel.md +310 -0
  50. package/framework/standards/infrastructure/neon/neon-setup.md +186 -0
  51. package/framework/standards/integration/mcp/mcp-tools.md +32 -34
  52. package/framework/templates/README.md +18 -18
  53. package/framework/templates/REGISTRY.json +49 -96
  54. package/framework/templates/code/dotnet/abstractions/api-endpoint.cs +7 -7
  55. package/framework/templates/code/dotnet/backend/repository.cs +148 -148
  56. package/framework/templates/code/dotnet/contracts/contracts-vsa.cs +2 -2
  57. package/framework/templates/code/dotnet/database/vector-entity.cs +93 -0
  58. package/framework/templates/code/dotnet/feature/endpoint.cs.hbs +1 -1
  59. package/framework/templates/code/sql/{supabase-migration.sql → postgresql-migration.sql} +8 -17
  60. package/framework/templates/code/sql/{supabase-migration.template.sql → postgresql-migration.template.sql} +10 -13
  61. package/framework/templates/code/sql/{rls-policy.sql → postgresql-rls-policy.sql} +8 -8
  62. package/framework/templates/code/typescript/contracts.ts +167 -168
  63. package/framework/templates/context/CONTEXT.md +3 -3
  64. package/framework/templates/docs/proposal.md +6 -6
  65. package/framework/templates/docs/ui-components.md +1 -1
  66. package/framework/templates/feature/decisions.md +121 -121
  67. package/framework/templates/feature/recap.md +145 -145
  68. package/framework/templates/feature/tasks.md +199 -199
  69. package/framework/templates/frontend/nextjs/gsap-scroll-section.tsx.hbs +44 -0
  70. package/framework/templates/infrastructure/docker/docker-compose.template.yml +50 -67
  71. package/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -38
  72. package/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -48
  73. package/framework/templates/infrastructure/docker/easypanel.template.json +46 -54
  74. package/framework/templates/infrastructure/github/README.md +56 -56
  75. package/framework/templates/integrations/semantic-kernel-neon.cs +125 -0
  76. package/framework/workflows/README.md +1 -1
  77. package/framework/workflows/docs/full-morph.md +69 -69
  78. package/package.json +1 -1
  79. package/src/commands/agents/dispatch-agents.js +19 -15
  80. package/src/commands/state/advance-phase.js +5 -0
  81. package/src/commands/tasks/task.js +3 -0
  82. package/src/core/state/state-manager.js +45 -1
  83. package/src/core/templates/template-registry.js +1 -66
  84. package/src/lib/detectors/index.js +2 -2
  85. package/src/lib/generators/architecture-scanner.js +640 -640
  86. package/src/lib/installers/mcp-installer.js +1 -1
  87. package/src/lib/tasks/task-classifier.js +15 -1
  88. package/src/lib/tasks/test-runner.js +5 -1
  89. package/src/lib/validators/content/content-validator.js +9 -10
  90. package/src/lib/validators/validation-runner.js +7 -5
  91. package/framework/agents/backend/supabase-expert.md +0 -256
  92. package/framework/rules/supabase-standards.md +0 -29
  93. package/framework/standards/infrastructure/supabase/mcp-setup.md +0 -142
  94. package/framework/standards/infrastructure/supabase/supabase-auth.md +0 -176
  95. package/framework/standards/infrastructure/supabase/supabase-custom-jwt.md +0 -206
  96. package/framework/standards/infrastructure/supabase/supabase-pgvector.md +0 -169
  97. package/framework/standards/infrastructure/supabase/supabase-rls.md +0 -184
  98. package/framework/standards/infrastructure/supabase/supabase-storage.md +0 -153
@@ -0,0 +1,44 @@
1
+ // features/{{kebabCase featureName}}/components/{{kebabCase sectionName}}-section.tsx
2
+ 'use client';
3
+
4
+ import { useRef } from 'react';
5
+ import gsap from 'gsap';
6
+ import { ScrollTrigger } from 'gsap/ScrollTrigger';
7
+ import { useGSAP } from '@gsap/react';
8
+ import { durations } from '@/lib/design-tokens';
9
+
10
+ gsap.registerPlugin(ScrollTrigger);
11
+
12
+ export function {{pascalCase sectionName}}Section() {
13
+ const containerRef = useRef<HTMLDivElement>(null);
14
+
15
+ useGSAP(() => {
16
+ const prefersReducedMotion = window.matchMedia(
17
+ '(prefers-reduced-motion: reduce)'
18
+ ).matches;
19
+
20
+ if (prefersReducedMotion) return;
21
+
22
+ gsap.from('.{{kebabCase sectionName}}-item', {
23
+ y: 40,
24
+ opacity: 0,
25
+ stagger: 0.1,
26
+ duration: durations.base,
27
+ ease: 'power2.out',
28
+ scrollTrigger: {
29
+ trigger: containerRef.current,
30
+ start: 'top 80%',
31
+ toggleActions: 'play none none none',
32
+ },
33
+ });
34
+ }, { scope: containerRef });
35
+
36
+ return (
37
+ <section ref={containerRef} className="{{kebabCase sectionName}}-section">
38
+ {/* {{pascalCase sectionName}} content */}
39
+ <div className="{{kebabCase sectionName}}-item">
40
+ {/* Item content */}
41
+ </div>
42
+ </section>
43
+ );
44
+ }
@@ -1,67 +1,50 @@
1
- # Docker Compose for Local Development
2
- # Next.js + Supabase Stack
3
-
4
- version: '3.8'
5
-
6
- services:
7
- # Next.js Application
8
- app:
9
- build:
10
- context: .
11
- dockerfile: Dockerfile.dev
12
- container_name: {{kebabCase FEATURE_NAME}}-app
13
- ports:
14
- - "3000:3000"
15
- environment:
16
- - NODE_ENV=development
17
- - NEXT_PUBLIC_SUPABASE_URL=${NEXT_PUBLIC_SUPABASE_URL}
18
- - NEXT_PUBLIC_SUPABASE_ANON_KEY=${NEXT_PUBLIC_SUPABASE_ANON_KEY}
19
- - SUPABASE_SERVICE_ROLE_KEY=${SUPABASE_SERVICE_ROLE_KEY}
20
- volumes:
21
- - .:/app
22
- - /app/node_modules
23
- - /app/.next
24
- depends_on:
25
- - postgres
26
- networks:
27
- - app-network
28
-
29
- # PostgreSQL Database (Local Supabase alternative)
30
- postgres:
31
- image: postgres:15-alpine
32
- container_name: {{kebabCase FEATURE_NAME}}-postgres
33
- restart: unless-stopped
34
- ports:
35
- - "5432:5432"
36
- environment:
37
- POSTGRES_USER: postgres
38
- POSTGRES_PASSWORD: postgres
39
- POSTGRES_DB: {{snakeCase FEATURE_NAME}}
40
- volumes:
41
- - postgres-data:/var/lib/postgresql/data
42
- - ./supabase/migrations:/docker-entrypoint-initdb.d
43
- networks:
44
- - app-network
45
-
46
- # Supabase Studio (Database UI - optional)
47
- studio:
48
- image: supabase/studio:latest
49
- container_name: {{kebabCase FEATURE_NAME}}-studio
50
- restart: unless-stopped
51
- ports:
52
- - "3001:3000"
53
- environment:
54
- SUPABASE_URL: http://kong:8000
55
- STUDIO_PG_META_URL: http://meta:8080
56
- SUPABASE_ANON_KEY: ${SUPABASE_ANON_KEY}
57
- SUPABASE_SERVICE_KEY: ${SUPABASE_SERVICE_ROLE_KEY}
58
- networks:
59
- - app-network
60
-
61
- volumes:
62
- postgres-data:
63
- driver: local
64
-
65
- networks:
66
- app-network:
67
- driver: bridge
1
+ # Docker Compose for Local Development
2
+ # Next.js + Neon Stack
3
+
4
+ version: '3.8'
5
+
6
+ services:
7
+ # Next.js Application
8
+ app:
9
+ build:
10
+ context: .
11
+ dockerfile: Dockerfile.dev
12
+ container_name: {{kebabCase FEATURE_NAME}}-app
13
+ ports:
14
+ - "3000:3000"
15
+ environment:
16
+ - NODE_ENV=development
17
+ - DATABASE_URL=${DATABASE_URL}
18
+ volumes:
19
+ - .:/app
20
+ - /app/node_modules
21
+ - /app/.next
22
+ depends_on:
23
+ - postgres
24
+ networks:
25
+ - app-network
26
+
27
+ # PostgreSQL Database (Local development)
28
+ postgres:
29
+ image: postgres:15-alpine
30
+ container_name: {{kebabCase FEATURE_NAME}}-postgres
31
+ restart: unless-stopped
32
+ ports:
33
+ - "5432:5432"
34
+ environment:
35
+ POSTGRES_USER: postgres
36
+ POSTGRES_PASSWORD: postgres
37
+ POSTGRES_DB: {{snakeCase FEATURE_NAME}}
38
+ volumes:
39
+ - postgres-data:/var/lib/postgresql/data
40
+ - ./migrations:/docker-entrypoint-initdb.d
41
+ networks:
42
+ - app-network
43
+
44
+ volumes:
45
+ postgres-data:
46
+ driver: local
47
+
48
+ networks:
49
+ app-network:
50
+ driver: bridge
@@ -1,38 +1,38 @@
1
- # ============================================================
2
- # Dockerfile: .NET 10 API ({{titleCase FEATURE_NAME}})
3
- # Stack: Next.js + Supabase + .NET API
4
- # Generated by MORPH Framework
5
- # ============================================================
6
-
7
- # Stage 1: Build
8
- FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
9
- WORKDIR /src
10
-
11
- # Copy project file and restore dependencies
12
- COPY *.csproj .
13
- RUN dotnet restore
14
-
15
- # Copy source code and publish
16
- COPY . .
17
- RUN dotnet publish -c Release -o /app/publish --no-restore
18
-
19
- # Stage 2: Runtime
20
- FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
21
- WORKDIR /app
22
-
23
- # Copy published output
24
- COPY --from=build /app/publish .
25
-
26
- # Configuration
27
- ENV ASPNETCORE_URLS=http://+:8080
28
- ENV ASPNETCORE_ENVIRONMENT=Production
29
-
30
- # Expose port
31
- EXPOSE 8080
32
-
33
- # Health check
34
- HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
35
- CMD curl -f http://localhost:8080/health || exit 1
36
-
37
- # Entrypoint
38
- ENTRYPOINT ["dotnet", "Api.dll"]
1
+ # ============================================================
2
+ # Dockerfile: .NET 10 API ({{titleCase FEATURE_NAME}})
3
+ # Stack: Next.js + Neon + .NET API
4
+ # Generated by MORPH Framework
5
+ # ============================================================
6
+
7
+ # Stage 1: Build
8
+ FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
9
+ WORKDIR /src
10
+
11
+ # Copy project file and restore dependencies
12
+ COPY *.csproj .
13
+ RUN dotnet restore
14
+
15
+ # Copy source code and publish
16
+ COPY . .
17
+ RUN dotnet publish -c Release -o /app/publish --no-restore
18
+
19
+ # Stage 2: Runtime
20
+ FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
21
+ WORKDIR /app
22
+
23
+ # Copy published output
24
+ COPY --from=build /app/publish .
25
+
26
+ # Configuration
27
+ ENV ASPNETCORE_URLS=http://+:8080
28
+ ENV ASPNETCORE_ENVIRONMENT=Production
29
+
30
+ # Expose port
31
+ EXPOSE 8080
32
+
33
+ # Health check
34
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
35
+ CMD curl -f http://localhost:8080/health || exit 1
36
+
37
+ # Entrypoint
38
+ ENTRYPOINT ["dotnet", "Api.dll"]
@@ -1,48 +1,48 @@
1
- # ============================================================
2
- # Dockerfile: Next.js Frontend ({{titleCase FEATURE_NAME}})
3
- # Stack: Next.js + Supabase
4
- # Generated by MORPH Framework
5
- # Requires: output: "standalone" in next.config.ts
6
- # ============================================================
7
-
8
- # Stage 1: Install dependencies
9
- FROM node:22-alpine AS deps
10
- WORKDIR /app
11
- COPY package.json package-lock.json ./
12
- RUN npm ci --omit=dev
13
-
14
- # Stage 2: Build application
15
- FROM node:22-alpine AS builder
16
- WORKDIR /app
17
- COPY --from=deps /app/node_modules ./node_modules
18
- COPY . .
19
- ENV NEXT_TELEMETRY_DISABLED=1
20
- RUN npm run build
21
-
22
- # Stage 3: Production runtime
23
- FROM node:22-alpine AS runner
24
- WORKDIR /app
25
-
26
- ENV NODE_ENV=production
27
- ENV NEXT_TELEMETRY_DISABLED=1
28
-
29
- # Create non-root user
30
- RUN addgroup --system --gid 1001 nodejs && \
31
- adduser --system --uid 1001 nextjs
32
-
33
- # Copy build output
34
- COPY --from=builder /app/public ./public
35
- COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
36
- COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
37
-
38
- # Switch to non-root user
39
- USER nextjs
40
-
41
- # Expose port
42
- EXPOSE 3000
43
-
44
- ENV PORT=3000
45
- ENV HOSTNAME="0.0.0.0"
46
-
47
- # Start server
48
- CMD ["node", "server.js"]
1
+ # ============================================================
2
+ # Dockerfile: Next.js Frontend ({{titleCase FEATURE_NAME}})
3
+ # Stack: Next.js + Neon
4
+ # Generated by MORPH Framework
5
+ # Requires: output: "standalone" in next.config.ts
6
+ # ============================================================
7
+
8
+ # Stage 1: Install dependencies
9
+ FROM node:22-alpine AS deps
10
+ WORKDIR /app
11
+ COPY package.json package-lock.json ./
12
+ RUN npm ci --omit=dev
13
+
14
+ # Stage 2: Build application
15
+ FROM node:22-alpine AS builder
16
+ WORKDIR /app
17
+ COPY --from=deps /app/node_modules ./node_modules
18
+ COPY . .
19
+ ENV NEXT_TELEMETRY_DISABLED=1
20
+ RUN npm run build
21
+
22
+ # Stage 3: Production runtime
23
+ FROM node:22-alpine AS runner
24
+ WORKDIR /app
25
+
26
+ ENV NODE_ENV=production
27
+ ENV NEXT_TELEMETRY_DISABLED=1
28
+
29
+ # Create non-root user
30
+ RUN addgroup --system --gid 1001 nodejs && \
31
+ adduser --system --uid 1001 nextjs
32
+
33
+ # Copy build output
34
+ COPY --from=builder /app/public ./public
35
+ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
36
+ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
37
+
38
+ # Switch to non-root user
39
+ USER nextjs
40
+
41
+ # Expose port
42
+ EXPOSE 3000
43
+
44
+ ENV PORT=3000
45
+ ENV HOSTNAME="0.0.0.0"
46
+
47
+ # Start server
48
+ CMD ["node", "server.js"]
@@ -1,54 +1,46 @@
1
- {
2
- "name": "{{kebabCase FEATURE_NAME}}",
3
- "services": [
4
- {
5
- "type": "app",
6
- "data": {
7
- "projectName": "{{kebabCase FEATURE_NAME}}",
8
- "serviceName": "{{kebabCase FEATURE_NAME}}-app",
9
- "source": {
10
- "type": "github",
11
- "owner": "{{GITHUB_OWNER}}",
12
- "repo": "{{GITHUB_REPO}}",
13
- "ref": "main",
14
- "autoDeploy": true
15
- },
16
- "build": {
17
- "type": "dockerfile",
18
- "dockerfile": "Dockerfile"
19
- },
20
- "deploy": {
21
- "replicas": 1,
22
- "command": null,
23
- "zeroDowntime": true
24
- },
25
- "env": [
26
- {
27
- "key": "NODE_ENV",
28
- "value": "production"
29
- },
30
- {
31
- "key": "NEXT_PUBLIC_SUPABASE_URL",
32
- "value": "${NEXT_PUBLIC_SUPABASE_URL}"
33
- },
34
- {
35
- "key": "NEXT_PUBLIC_SUPABASE_ANON_KEY",
36
- "value": "${NEXT_PUBLIC_SUPABASE_ANON_KEY}"
37
- },
38
- {
39
- "key": "SUPABASE_SERVICE_ROLE_KEY",
40
- "value": "${SUPABASE_SERVICE_ROLE_KEY}"
41
- }
42
- ],
43
- "domains": [
44
- {
45
- "host": "{{kebabCase FEATURE_NAME}}.easypanel.host",
46
- "port": 3000,
47
- "https": true
48
- }
49
- ],
50
- "mounts": []
51
- }
52
- }
53
- ]
54
- }
1
+ {
2
+ "name": "{{kebabCase FEATURE_NAME}}",
3
+ "services": [
4
+ {
5
+ "type": "app",
6
+ "data": {
7
+ "projectName": "{{kebabCase FEATURE_NAME}}",
8
+ "serviceName": "{{kebabCase FEATURE_NAME}}-app",
9
+ "source": {
10
+ "type": "github",
11
+ "owner": "{{GITHUB_OWNER}}",
12
+ "repo": "{{GITHUB_REPO}}",
13
+ "ref": "main",
14
+ "autoDeploy": true
15
+ },
16
+ "build": {
17
+ "type": "dockerfile",
18
+ "dockerfile": "Dockerfile"
19
+ },
20
+ "deploy": {
21
+ "replicas": 1,
22
+ "command": null,
23
+ "zeroDowntime": true
24
+ },
25
+ "env": [
26
+ {
27
+ "key": "NODE_ENV",
28
+ "value": "production"
29
+ },
30
+ {
31
+ "key": "DATABASE_URL",
32
+ "value": "${DATABASE_URL}"
33
+ }
34
+ ],
35
+ "domains": [
36
+ {
37
+ "host": "{{kebabCase FEATURE_NAME}}.easypanel.host",
38
+ "port": 3000,
39
+ "https": true
40
+ }
41
+ ],
42
+ "mounts": []
43
+ }
44
+ }
45
+ ]
46
+ }
@@ -1,56 +1,56 @@
1
- # GitHub Actions Templates for MORPH-SPEC
2
-
3
- > **Framework-Level CI/CD Templates for EasyPanel/Docker Deployments**
4
-
5
- ## Overview
6
-
7
- Reusable GitHub Actions workflows and composite actions for the **nextjs-supabase** stack (EasyPanel/Docker deployment).
8
-
9
- **Key Features:**
10
- - Handlebars v2.0 templating with helpers
11
- - Composite actions for shared logic
12
- - Docker multi-stage builds (.NET API + Next.js Web)
13
- - EasyPanel webhook deployment
14
-
15
- ---
16
-
17
- ## Structure
18
-
19
- ```
20
- infrastructure/github/
21
- ├── workflows/
22
- │ ├── dotnet-build.yml.hbs # .NET restore, build, test, coverage
23
- │ ├── docker-build-push.yml.hbs # Docker build & push to registry
24
- │ └── deploy-easypanel.yml.hbs # EasyPanel deployment via webhook
25
- │
26
- └── actions/
27
- ├── docker-build-push/action.yml.hbs # Build & push Docker image
28
- └── health-check/action.yml.hbs # Poll health endpoint
29
- ```
30
-
31
- ## Workflows
32
-
33
- ### .NET Build (`dotnet-build.yml.hbs`)
34
- - Restore, build, test with coverage
35
- - Uploads test results and coverage artifacts
36
-
37
- ### Docker Build & Push (`docker-build-push.yml.hbs`)
38
- - Multi-stage Docker build
39
- - Push to container registry (GHCR or Docker Hub)
40
-
41
- ### Deploy EasyPanel (`deploy-easypanel.yml.hbs`)
42
- - Triggers EasyPanel webhook after Docker push
43
- - Runs health check after deployment
44
- - Supports staging + production environments
45
-
46
- ## Usage
47
-
48
- Templates are rendered during `morph-spec init` based on project stack configuration.
49
-
50
- ```bash
51
- morph-spec init --stack nextjs-supabase
52
- ```
53
-
54
- ---
55
-
56
- *MORPH-SPEC by Polymorphism Tech*
1
+ # GitHub Actions Templates for MORPH-SPEC
2
+
3
+ > **Framework-Level CI/CD Templates for EasyPanel/Docker Deployments**
4
+
5
+ ## Overview
6
+
7
+ Reusable GitHub Actions workflows and composite actions for the **nextjs-neon** stack (EasyPanel/Docker deployment).
8
+
9
+ **Key Features:**
10
+ - Handlebars v2.0 templating with helpers
11
+ - Composite actions for shared logic
12
+ - Docker multi-stage builds (.NET API + Next.js Web)
13
+ - EasyPanel webhook deployment
14
+
15
+ ---
16
+
17
+ ## Structure
18
+
19
+ ```
20
+ infrastructure/github/
21
+ ├── workflows/
22
+ │ ├── dotnet-build.yml.hbs # .NET restore, build, test, coverage
23
+ │ ├── docker-build-push.yml.hbs # Docker build & push to registry
24
+ │ └── deploy-easypanel.yml.hbs # EasyPanel deployment via webhook
25
+ │
26
+ └── actions/
27
+ ├── docker-build-push/action.yml.hbs # Build & push Docker image
28
+ └── health-check/action.yml.hbs # Poll health endpoint
29
+ ```
30
+
31
+ ## Workflows
32
+
33
+ ### .NET Build (`dotnet-build.yml.hbs`)
34
+ - Restore, build, test with coverage
35
+ - Uploads test results and coverage artifacts
36
+
37
+ ### Docker Build & Push (`docker-build-push.yml.hbs`)
38
+ - Multi-stage Docker build
39
+ - Push to container registry (GHCR or Docker Hub)
40
+
41
+ ### Deploy EasyPanel (`deploy-easypanel.yml.hbs`)
42
+ - Triggers EasyPanel webhook after Docker push
43
+ - Runs health check after deployment
44
+ - Supports staging + production environments
45
+
46
+ ## Usage
47
+
48
+ Templates are rendered during `morph-spec init` based on project stack configuration.
49
+
50
+ ```bash
51
+ morph-spec init --stack nextjs-neon
52
+ ```
53
+
54
+ ---
55
+
56
+ *MORPH-SPEC by Polymorphism Tech*
@@ -0,0 +1,125 @@
1
+ // ============================================================
2
+ // SEMANTIC KERNEL + NEON PGVECTOR SETUP TEMPLATE
3
+ // Generated by MORPH Framework
4
+ // ============================================================
5
+
6
+ using Microsoft.Extensions.DependencyInjection;
7
+ using Microsoft.Extensions.VectorData;
8
+ using Microsoft.SemanticKernel;
9
+ using Microsoft.SemanticKernel.Connectors.PgVector;
10
+ using Microsoft.SemanticKernel.Connectors.OpenAI;
11
+ using Microsoft.SemanticKernel.Embeddings;
12
+ using Npgsql;
13
+
14
+ #nullable disable
15
+
16
+ namespace {{NAMESPACE}}.Infrastructure.AI;
17
+
18
+ // ============================================================
19
+ // 1. DATA MODEL — annotated for Semantic Kernel vector store
20
+ // ============================================================
21
+
22
+ public class KnowledgeEntry
23
+ {
24
+ [VectorStoreKey(StorageName = "id")]
25
+ public Guid Id { get; set; }
26
+
27
+ [VectorStoreData(StorageName = "title")]
28
+ public string Title { get; set; } = string.Empty;
29
+
30
+ [VectorStoreData(StorageName = "content", IsFullTextSearchable = true)]
31
+ public string Content { get; set; } = string.Empty;
32
+
33
+ [VectorStoreData(StorageName = "source")]
34
+ public string? Source { get; set; }
35
+
36
+ [VectorStoreVector(Dimensions: 1536, DistanceFunction.CosineSimilarity, StorageName = "embedding")]
37
+ public ReadOnlyMemory<float> Embedding { get; set; }
38
+
39
+ [VectorStoreData(StorageName = "created_at")]
40
+ public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
41
+ }
42
+
43
+ // ============================================================
44
+ // 2. SERVICE REGISTRATION — add to Program.cs
45
+ // ============================================================
46
+
47
+ public static class SemanticKernelExtensions
48
+ {
49
+ public static IServiceCollection AddSemanticKernelWithNeon(
50
+ this IServiceCollection services,
51
+ string neonConnectionString,
52
+ string openAiApiKey,
53
+ string embeddingModel = "text-embedding-3-small")
54
+ {
55
+ // Neon PostgreSQL data source with pgvector
56
+ services.AddSingleton<NpgsqlDataSource>(sp =>
57
+ {
58
+ var builder = new NpgsqlDataSourceBuilder(neonConnectionString);
59
+ builder.UseVector();
60
+ return builder.Build();
61
+ });
62
+
63
+ // Semantic Kernel with OpenAI + Postgres vector store
64
+ services.AddKernel();
65
+
66
+ services.AddOpenAITextEmbeddingGeneration(embeddingModel, openAiApiKey);
67
+
68
+ services.AddPostgresVectorStore();
69
+
70
+ // VectorStoreTextSearch for natural language queries
71
+ services.AddSingleton<VectorStoreTextSearch<KnowledgeEntry>>(sp =>
72
+ {
73
+ var vectorStore = sp.GetRequiredService<IVectorStore>();
74
+ var collection = vectorStore.GetCollection<Guid, KnowledgeEntry>("knowledge_entries");
75
+ var embeddingGenerator = sp.GetRequiredService<ITextEmbeddingGenerationService>();
76
+
77
+ return new VectorStoreTextSearch<KnowledgeEntry>(
78
+ collection, embeddingGenerator);
79
+ });
80
+
81
+ return services;
82
+ }
83
+ }
84
+
85
+ // ============================================================
86
+ // SETUP INSTRUCTIONS
87
+ // ============================================================
88
+ //
89
+ // 1. Install NuGet packages:
90
+ //
91
+ // dotnet add package Microsoft.SemanticKernel.Connectors.PgVector --prerelease
92
+ // dotnet add package Microsoft.SemanticKernel.Connectors.OpenAI
93
+ // dotnet add package Npgsql
94
+ //
95
+ // 2. Add to Program.cs:
96
+ //
97
+ // builder.Services.AddSemanticKernelWithNeon(
98
+ // builder.Configuration.GetConnectionString("DefaultConnection")!,
99
+ // builder.Configuration["OpenAI:ApiKey"]!);
100
+ //
101
+ // 3. Create the database table (Neon SQL):
102
+ //
103
+ // CREATE EXTENSION IF NOT EXISTS vector;
104
+ // CREATE TABLE knowledge_entries (
105
+ // id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
106
+ // title TEXT NOT NULL,
107
+ // content TEXT NOT NULL,
108
+ // source TEXT,
109
+ // embedding vector(1536),
110
+ // created_at TIMESTAMPTZ DEFAULT now()
111
+ // );
112
+ // CREATE INDEX ON knowledge_entries USING hnsw (embedding vector_cosine_ops);
113
+ //
114
+ // 4. Use in a service or MAF agent:
115
+ //
116
+ // public class SearchService(VectorStoreTextSearch<KnowledgeEntry> search)
117
+ // {
118
+ // public async Task<IReadOnlyList<KnowledgeEntry>> SearchAsync(string query)
119
+ // {
120
+ // var results = await search.SearchAsync(query, new() { Top = 5 });
121
+ // return await results.Results.Select(r => r.Record).ToListAsync();
122
+ // }
123
+ // }
124
+ //
125
+ // ============================================================