@polymorphism-tech/morph-spec 4.15.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.
- package/README.md +2 -2
- package/bin/morph-spec.js +4 -0
- package/bin/task-manager.js +999 -962
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/agents/ai-agents/vector-search-expert.md +247 -233
- package/framework/agents/backend/ms-agent-expert.md +2 -1
- package/framework/agents/backend/neon-expert.md +397 -0
- package/framework/agents/frontend/gsap-animator.md +131 -0
- package/framework/agents.json +1175 -1077
- package/framework/commands/morph-preflight.md +200 -192
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +1 -1
- package/framework/rules/gsap-standards.md +13 -0
- package/framework/rules/neon-standards.md +25 -0
- package/framework/skills/level-0-meta/mcp-registry.json +1 -1
- package/framework/skills/level-0-meta/morph-agent-teams/SKILL.md +472 -472
- package/framework/skills/level-0-meta/morph-init/SKILL.md +30 -11
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +5 -5
- package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +5 -5
- package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +7 -7
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +24 -24
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +12 -12
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +9 -9
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +1 -1
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +1 -1
- package/framework/skills/level-1-workflows/morph-phase-tasks/references/task-planning-patterns.md +143 -143
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +1 -1
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +1 -1
- package/framework/standards/STANDARDS.json +184 -107
- package/framework/standards/ai-agents/production.md +1 -0
- package/framework/standards/ai-agents/setup.md +3 -2
- package/framework/standards/ai-agents/workflows.md +1 -0
- package/framework/standards/architecture/vertical-slice/vertical-slice.md +4 -4
- package/framework/standards/backend/database/postgresql/database.md +58 -78
- package/framework/standards/backend/dotnet/scalar-ui.md +172 -172
- package/framework/standards/backend/dotnet/vsa-handler-patterns.md +274 -274
- package/framework/standards/backend/integrations/asaas/asaas-api.md +1 -1
- package/framework/standards/backend/integrations/clerk/clerk-auth.md +23 -21
- package/framework/standards/frontend/design-system/animations.md +9 -0
- package/framework/standards/frontend/gsap/gsap-core.md +463 -0
- package/framework/standards/frontend/gsap/gsap-plugins.md +294 -0
- package/framework/standards/frontend/gsap/gsap-scrolltrigger.md +318 -0
- package/framework/standards/frontend/nextjs/motion-patterns.md +1 -0
- package/framework/standards/frontend/nextjs/nextjs-patterns.md +47 -37
- package/framework/standards/infrastructure/docker/easypanel-deploy.md +4 -8
- package/framework/standards/infrastructure/neon/neon-pgrag.md +239 -0
- package/framework/standards/infrastructure/neon/neon-pgvector.md +236 -0
- package/framework/standards/infrastructure/neon/neon-semantic-kernel.md +310 -0
- package/framework/standards/infrastructure/neon/neon-setup.md +186 -0
- package/framework/standards/integration/mcp/mcp-tools.md +32 -34
- package/framework/templates/README.md +18 -18
- package/framework/templates/REGISTRY.json +49 -96
- package/framework/templates/code/dotnet/abstractions/api-endpoint.cs +7 -7
- package/framework/templates/code/dotnet/backend/repository.cs +148 -148
- package/framework/templates/code/dotnet/contracts/contracts-vsa.cs +2 -2
- package/framework/templates/code/dotnet/database/vector-entity.cs +93 -0
- package/framework/templates/code/dotnet/feature/endpoint.cs.hbs +1 -1
- package/framework/templates/code/sql/{supabase-migration.sql → postgresql-migration.sql} +8 -17
- package/framework/templates/code/sql/{supabase-migration.template.sql → postgresql-migration.template.sql} +10 -13
- package/framework/templates/code/sql/{rls-policy.sql → postgresql-rls-policy.sql} +8 -8
- package/framework/templates/code/typescript/contracts.ts +167 -168
- package/framework/templates/context/CONTEXT.md +3 -3
- package/framework/templates/docs/proposal.md +6 -6
- package/framework/templates/docs/ui-components.md +1 -1
- package/framework/templates/feature/decisions.md +121 -121
- package/framework/templates/feature/recap.md +145 -145
- package/framework/templates/feature/tasks.md +199 -199
- package/framework/templates/frontend/nextjs/gsap-scroll-section.tsx.hbs +44 -0
- package/framework/templates/infrastructure/docker/docker-compose.template.yml +50 -67
- package/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -38
- package/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -48
- package/framework/templates/infrastructure/docker/easypanel.template.json +46 -54
- package/framework/templates/infrastructure/github/README.md +56 -56
- package/framework/templates/integrations/semantic-kernel-neon.cs +125 -0
- package/framework/workflows/README.md +1 -1
- package/framework/workflows/docs/full-morph.md +69 -69
- package/package.json +1 -1
- package/src/commands/agents/dispatch-agents.js +19 -15
- package/src/commands/project/setup-infra-cmd.js +1 -1
- package/src/commands/state/advance-phase.js +5 -0
- package/src/commands/tasks/task.js +3 -0
- package/src/core/state/state-manager.js +45 -1
- package/src/core/templates/template-registry.js +1 -66
- package/src/lib/detectors/index.js +2 -2
- package/src/lib/generators/architecture-scanner.js +640 -640
- package/src/lib/installers/mcp-installer.js +1 -1
- package/src/lib/tasks/task-classifier.js +15 -1
- package/src/lib/tasks/test-runner.js +5 -1
- package/src/lib/validators/content/content-validator.js +9 -10
- package/src/lib/validators/validation-runner.js +7 -5
- package/src/scripts/setup-infra.js +60 -30
- package/framework/agents/backend/supabase-expert.md +0 -256
- package/framework/rules/supabase-standards.md +0 -29
- package/framework/standards/infrastructure/supabase/mcp-setup.md +0 -142
- package/framework/standards/infrastructure/supabase/supabase-auth.md +0 -176
- package/framework/standards/infrastructure/supabase/supabase-custom-jwt.md +0 -206
- package/framework/standards/infrastructure/supabase/supabase-pgvector.md +0 -169
- package/framework/standards/infrastructure/supabase/supabase-rls.md +0 -184
- 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 +
|
|
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
|
-
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 +
|
|
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 +
|
|
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": "
|
|
32
|
-
"value": "${
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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-
|
|
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-
|
|
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
|
+
// ============================================================
|