@polymorphism-tech/morph-spec 9.1.0 → 9.3.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 (104) hide show
  1. package/CLAUDE.md +14 -78
  2. package/README.md +2 -2
  3. package/bin/morph-spec.js +14 -1
  4. package/claude-plugin.json +1 -1
  5. package/docs/CHEATSHEET.md +1 -1
  6. package/docs/QUICKSTART.md +1 -1
  7. package/framework/CLAUDE.md +4 -3
  8. package/framework/MORPH.md +7 -10
  9. package/framework/agents.json +15 -12
  10. package/framework/commands/morph-status.md +2 -2
  11. package/framework/docs/CLI.md +24 -16
  12. package/framework/evals/review-checklist.md +15 -2
  13. package/framework/hooks/README.md +8 -44
  14. package/framework/hooks/claude-code/__pycache__/statusline.cpython-313.pyc +0 -0
  15. package/framework/hooks/claude-code/core/state-sync.js +1 -1
  16. package/framework/hooks/claude-code/core/worktree-context.js +23 -0
  17. package/framework/hooks/claude-code/statusline.py +3 -2
  18. package/framework/hooks/claude-code/statusline.sh +11 -11
  19. package/framework/hooks/shared/gate-event.js +18 -0
  20. package/framework/hooks/shared/next-step.js +107 -0
  21. package/framework/hooks/shared/slice-progress.js +18 -5
  22. package/framework/hooks/shared/state-writer.js +6 -1
  23. package/framework/mcp/registry.json +31 -1
  24. package/framework/rules/nextjs-standards.md +1 -1
  25. package/framework/schemas/feature.schema.json +1 -0
  26. package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
  27. package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
  28. package/framework/skills/core/morph-apply/SKILL.md +6 -4
  29. package/framework/skills/core/morph-hotfix/SKILL.md +3 -3
  30. package/framework/skills/core/morph-machine/SKILL.md +1 -1
  31. package/framework/skills/core/morph-media/SKILL.md +1 -1
  32. package/framework/skills/core/morph-plan/SKILL.md +8 -6
  33. package/framework/skills/core/morph-review/SKILL.md +9 -6
  34. package/framework/skills/core/morph-standards/SKILL.md +1 -1
  35. package/framework/skills/core/morph-uiux/SKILL.md +2 -1
  36. package/framework/standards/STANDARDS.json +2 -2
  37. package/framework/standards/STANDARDS.meta.json +1 -1
  38. package/framework/standards/ai-agents/setup.md +2 -0
  39. package/framework/standards/backend/dotnet/testing.md +10 -4
  40. package/framework/standards/frontend/nextjs/testing.md +10 -6
  41. package/framework/standards/integration/mcp/mcp-tools.md +3 -1
  42. package/framework/templates/.idea/morph-templates.xml +92 -0
  43. package/framework/templates/.vscode/morph-templates.code-snippets +186 -0
  44. package/framework/templates/IDE-SNIPPETS.md +262 -262
  45. package/framework/templates/code/dotnet/abstractions/api-endpoint.cs +7 -7
  46. package/framework/templates/code/dotnet/feature/request.cs.hbs +4 -4
  47. package/framework/templates/code/dotnet/feature/response.cs.hbs +4 -4
  48. package/framework/templates/code/sql/ai-agents/pgvector-embeddings-migration.sql.template +91 -91
  49. package/framework/templates/docs/plan.md +3 -1
  50. package/framework/templates/frontend/nextjs/client-component.tsx.hbs +26 -26
  51. package/framework/templates/frontend/nextjs/feature-form.tsx.hbs +56 -56
  52. package/framework/templates/frontend/nextjs/tsconfig.json.hbs +26 -26
  53. package/framework/templates/infrastructure/docker/Dockerfile.template +58 -58
  54. package/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -38
  55. package/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -48
  56. package/framework/templates/infrastructure/github/actions/docker-build-push/action.yml.hbs +45 -45
  57. package/framework/templates/infrastructure/github/actions/health-check/action.yml.hbs +27 -27
  58. package/framework/templates/infrastructure/github/workflows/docker-build-push.yml.hbs +59 -59
  59. package/framework/templates/infrastructure/github/workflows/dotnet-build.yml.hbs +39 -39
  60. package/framework/templates/meta-prompts/fusion/fusion-agent.md +76 -76
  61. package/framework/templates/meta-prompts/fusion/fusion-aggregator.md +100 -100
  62. package/framework/templates/state.template.json +17 -17
  63. package/framework/templates/ui/design-system.css +226 -226
  64. package/package.json +1 -1
  65. package/src/commands/observability/cost.js +12 -0
  66. package/src/commands/project/status.js +6 -68
  67. package/src/commands/state/advance.js +1 -1
  68. package/src/commands/state/approve.js +2 -2
  69. package/src/commands/state/gate-check.js +2 -2
  70. package/src/commands/state/gate-decision.js +4 -1
  71. package/src/commands/state/next.js +24 -0
  72. package/src/commands/state/report-check.js +3 -1
  73. package/src/commands/validation/mutate.js +9 -6
  74. package/src/commands/validation/plan-check.js +4 -2
  75. package/src/commands/validation/tests-audit.js +7 -0
  76. package/src/commands/validation/validate-feature.js +4 -2
  77. package/src/commands/validation/verify.js +21 -16
  78. package/src/core/state/state-manager.js +4 -0
  79. package/src/dashboard/app/main.jsx +13 -13
  80. package/src/dashboard/app/pages/FeatureDetail.jsx +6 -2
  81. package/src/dashboard/scanner/features-scanner.js +5 -2
  82. package/src/dashboard/vite.config.js +24 -24
  83. package/src/lib/ci/workflow-scaffold.js +12 -0
  84. package/src/lib/e2e/applicability.js +37 -0
  85. package/src/lib/generators/handoff-generator.js +11 -25
  86. package/src/lib/mutation/adapters.js +6 -17
  87. package/src/lib/mutation/runner.js +23 -75
  88. package/src/lib/mutation/trx.js +0 -1
  89. package/src/lib/next-step.js +10 -0
  90. package/src/lib/plan/checks.js +29 -2
  91. package/src/lib/plan/plan-parser.js +6 -2
  92. package/src/lib/review-reports.js +6 -3
  93. package/src/lib/risk-detector.js +20 -7
  94. package/src/lib/stack/stack-scan.js +13 -1
  95. package/src/lib/telemetry/metrics.js +46 -0
  96. package/src/lib/tests-audit/audit.js +96 -0
  97. package/src/lib/validators/code-budget/code-budget-validator.js +1 -1
  98. package/src/lib/validators/validation-runner.js +6 -38
  99. package/src/lib/validators/verify-runner.js +37 -22
  100. package/src/utils/agents-installer.js +24 -1
  101. package/framework/hooks/git/commit-msg/conventional-commits.sh +0 -33
  102. package/framework/hooks/git/pre-commit/agents.sh +0 -25
  103. package/framework/hooks/git/pre-commit/orchestrator.sh +0 -64
  104. package/framework/hooks/git/pre-push/run-tests.sh +0 -44
@@ -1,48 +1,48 @@
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
+ # ============================================================
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,45 +1,45 @@
1
- name: 'Build & Push Docker Image'
2
- description: 'Build multi-stage Docker image and push to registry'
3
- inputs:
4
- registry:
5
- description: 'Docker registry URL'
6
- required: true
7
- image-name:
8
- description: 'Docker image name'
9
- required: true
10
- dockerfile-path:
11
- description: 'Path to Dockerfile'
12
- required: false
13
- default: 'Dockerfile'
14
- build-context:
15
- description: 'Docker build context'
16
- required: false
17
- default: '.'
18
- outputs:
19
- image-tag:
20
- description: 'Full image tag with registry'
21
- value: ${{{{ steps.build.outputs.tags }}}}
22
-
23
- runs:
24
- using: 'composite'
25
- steps:
26
- - name: Set up Docker Buildx
27
- uses: docker/setup-buildx-action@v3
28
-
29
- - name: Login to Registry
30
- uses: docker/login-action@v3
31
- with:
32
- registry: ${{{{ inputs.registry }}}}
33
- username: ${{{{ secrets.REGISTRY_USERNAME }}}}
34
- password: ${{{{ secrets.REGISTRY_PASSWORD }}}}
35
-
36
- - name: Build and push
37
- id: build
38
- uses: docker/build-push-action@v5
39
- with:
40
- context: ${{{{ inputs.build-context }}}}
41
- file: ${{{{ inputs.dockerfile-path }}}}
42
- push: true
43
- tags: ${{{{ inputs.registry }}}}/${{{{ inputs.image-name }}}}:${{{{ github.sha }}}}
44
- cache-from: type=gha
45
- cache-to: type=gha,mode=max
1
+ name: 'Build & Push Docker Image'
2
+ description: 'Build multi-stage Docker image and push to registry'
3
+ inputs:
4
+ registry:
5
+ description: 'Docker registry URL'
6
+ required: true
7
+ image-name:
8
+ description: 'Docker image name'
9
+ required: true
10
+ dockerfile-path:
11
+ description: 'Path to Dockerfile'
12
+ required: false
13
+ default: 'Dockerfile'
14
+ build-context:
15
+ description: 'Docker build context'
16
+ required: false
17
+ default: '.'
18
+ outputs:
19
+ image-tag:
20
+ description: 'Full image tag with registry'
21
+ value: ${{{{ steps.build.outputs.tags }}}}
22
+
23
+ runs:
24
+ using: 'composite'
25
+ steps:
26
+ - name: Set up Docker Buildx
27
+ uses: docker/setup-buildx-action@v3
28
+
29
+ - name: Login to Registry
30
+ uses: docker/login-action@v3
31
+ with:
32
+ registry: ${{{{ inputs.registry }}}}
33
+ username: ${{{{ secrets.REGISTRY_USERNAME }}}}
34
+ password: ${{{{ secrets.REGISTRY_PASSWORD }}}}
35
+
36
+ - name: Build and push
37
+ id: build
38
+ uses: docker/build-push-action@v5
39
+ with:
40
+ context: ${{{{ inputs.build-context }}}}
41
+ file: ${{{{ inputs.dockerfile-path }}}}
42
+ push: true
43
+ tags: ${{{{ inputs.registry }}}}/${{{{ inputs.image-name }}}}:${{{{ github.sha }}}}
44
+ cache-from: type=gha
45
+ cache-to: type=gha,mode=max
@@ -1,27 +1,27 @@
1
- name: 'Health Check'
2
- description: 'Poll health endpoint until ready'
3
- inputs:
4
- url:
5
- description: 'Health check URL'
6
- required: true
7
- timeout:
8
- description: 'Timeout in seconds'
9
- required: false
10
- default: '300'
11
- interval:
12
- description: 'Polling interval in seconds'
13
- required: false
14
- default: '5'
15
-
16
- runs:
17
- using: 'composite'
18
- steps:
19
- - name: Wait for health
20
- shell: bash
21
- run: |
22
- RETRIES=$(($${{{{ inputs.timeout }}}} / ${{{{ inputs.interval }}}}))
23
- curl --retry $RETRIES \
24
- --retry-delay ${{{{ inputs.interval }}}} \
25
- --retry-connrefused \
26
- --fail \
27
- ${{{{ inputs.url }}}}
1
+ name: 'Health Check'
2
+ description: 'Poll health endpoint until ready'
3
+ inputs:
4
+ url:
5
+ description: 'Health check URL'
6
+ required: true
7
+ timeout:
8
+ description: 'Timeout in seconds'
9
+ required: false
10
+ default: '300'
11
+ interval:
12
+ description: 'Polling interval in seconds'
13
+ required: false
14
+ default: '5'
15
+
16
+ runs:
17
+ using: 'composite'
18
+ steps:
19
+ - name: Wait for health
20
+ shell: bash
21
+ run: |
22
+ RETRIES=$(($${{{{ inputs.timeout }}}} / ${{{{ inputs.interval }}}}))
23
+ curl --retry $RETRIES \
24
+ --retry-delay ${{{{ inputs.interval }}}} \
25
+ --retry-connrefused \
26
+ --fail \
27
+ ${{{{ inputs.url }}}}
@@ -1,59 +1,59 @@
1
- name: Build & Push Docker Image
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- registry:
7
- required: true
8
- type: string
9
- image-name:
10
- required: true
11
- type: string
12
- dockerfile-path:
13
- required: false
14
- type: string
15
- default: 'Dockerfile'
16
- build-context:
17
- required: false
18
- type: string
19
- default: '.'
20
- outputs:
21
- image-tag:
22
- value: ${{{{ jobs.docker.outputs.tag }}}}
23
-
24
- jobs:
25
- docker:
26
- runs-on: ubuntu-latest
27
- outputs:
28
- tag: ${{{{ steps.meta.outputs.tags }}}}
29
- steps:
30
- - uses: actions/checkout@v4
31
-
32
- - name: Set up Docker Buildx
33
- uses: docker/setup-buildx-action@v3
34
-
35
- - name: Login to Registry
36
- uses: docker/login-action@v3
37
- with:
38
- registry: ${{{{ inputs.registry }}}}
39
- username: ${{{{ secrets.REGISTRY_USERNAME }}}}
40
- password: ${{{{ secrets.REGISTRY_PASSWORD }}}}
41
-
42
- - name: Docker metadata
43
- id: meta
44
- uses: docker/metadata-action@v5
45
- with:
46
- images: ${{{{ inputs.registry }}}}/${{{{ inputs.image-name }}}}
47
- tags: |
48
- type=ref,event=branch
49
- type=sha,prefix=${{{{ inputs.image-name }}}}-
50
-
51
- - name: Build and push
52
- uses: docker/build-push-action@v5
53
- with:
54
- context: ${{{{ inputs.build-context }}}}
55
- file: ${{{{ inputs.dockerfile-path }}}}
56
- push: true
57
- tags: ${{{{ steps.meta.outputs.tags }}}}
58
- cache-from: type=gha
59
- cache-to: type=gha,mode=max
1
+ name: Build & Push Docker Image
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ registry:
7
+ required: true
8
+ type: string
9
+ image-name:
10
+ required: true
11
+ type: string
12
+ dockerfile-path:
13
+ required: false
14
+ type: string
15
+ default: 'Dockerfile'
16
+ build-context:
17
+ required: false
18
+ type: string
19
+ default: '.'
20
+ outputs:
21
+ image-tag:
22
+ value: ${{{{ jobs.docker.outputs.tag }}}}
23
+
24
+ jobs:
25
+ docker:
26
+ runs-on: ubuntu-latest
27
+ outputs:
28
+ tag: ${{{{ steps.meta.outputs.tags }}}}
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+
32
+ - name: Set up Docker Buildx
33
+ uses: docker/setup-buildx-action@v3
34
+
35
+ - name: Login to Registry
36
+ uses: docker/login-action@v3
37
+ with:
38
+ registry: ${{{{ inputs.registry }}}}
39
+ username: ${{{{ secrets.REGISTRY_USERNAME }}}}
40
+ password: ${{{{ secrets.REGISTRY_PASSWORD }}}}
41
+
42
+ - name: Docker metadata
43
+ id: meta
44
+ uses: docker/metadata-action@v5
45
+ with:
46
+ images: ${{{{ inputs.registry }}}}/${{{{ inputs.image-name }}}}
47
+ tags: |
48
+ type=ref,event=branch
49
+ type=sha,prefix=${{{{ inputs.image-name }}}}-
50
+
51
+ - name: Build and push
52
+ uses: docker/build-push-action@v5
53
+ with:
54
+ context: ${{{{ inputs.build-context }}}}
55
+ file: ${{{{ inputs.dockerfile-path }}}}
56
+ push: true
57
+ tags: ${{{{ steps.meta.outputs.tags }}}}
58
+ cache-from: type=gha
59
+ cache-to: type=gha,mode=max
@@ -1,39 +1,39 @@
1
- name: Build .NET Application
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- dotnet-version:
7
- required: false
8
- type: string
9
- default: '{{DOTNET_VERSION}}'
10
- build-configuration:
11
- required: false
12
- type: string
13
- default: 'Release'
14
- run-tests:
15
- required: false
16
- type: boolean
17
- default: true
18
-
19
- jobs:
20
- build:
21
- runs-on: ubuntu-latest
22
- steps:
23
- - uses: actions/checkout@v4
24
-
25
- - name: Setup .NET
26
- uses: actions/setup-dotnet@v4
27
- with:
28
- dotnet-version: ${{{{ inputs.dotnet-version }}}}
29
-
30
- - name: Restore dependencies
31
- run: dotnet restore
32
-
33
- - name: Build
34
- run: dotnet build --configuration ${{{{ inputs.build-configuration }}}} --no-restore
35
-
36
- {{#if run-tests}}
37
- - name: Test
38
- run: dotnet test --configuration ${{{{ inputs.build-configuration }}}} --no-build --verbosity normal
39
- {{/if}}
1
+ name: Build .NET Application
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ dotnet-version:
7
+ required: false
8
+ type: string
9
+ default: '{{DOTNET_VERSION}}'
10
+ build-configuration:
11
+ required: false
12
+ type: string
13
+ default: 'Release'
14
+ run-tests:
15
+ required: false
16
+ type: boolean
17
+ default: true
18
+
19
+ jobs:
20
+ build:
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - name: Setup .NET
26
+ uses: actions/setup-dotnet@v4
27
+ with:
28
+ dotnet-version: ${{{{ inputs.dotnet-version }}}}
29
+
30
+ - name: Restore dependencies
31
+ run: dotnet restore
32
+
33
+ - name: Build
34
+ run: dotnet build --configuration ${{{{ inputs.build-configuration }}}} --no-restore
35
+
36
+ {{#if run-tests}}
37
+ - name: Test
38
+ run: dotnet test --configuration ${{{{ inputs.build-configuration }}}} --no-build --verbosity normal
39
+ {{/if}}
@@ -1,76 +1,76 @@
1
- # Fusion Agent — {{AGENT_ID}} (F-Thread {{THREAD_INDEX}}/{{THREAD_COUNT}})
2
-
3
- You are **Fusion Agent {{THREAD_INDEX}}** in a best-of-N execution session.
4
-
5
- ## Your Identity
6
- - Agent: {{AGENT_ID}}
7
- - Role: Fusion Participant (F-Thread)
8
- - Thread: {{THREAD_ID}}
9
- - Instance: {{THREAD_INDEX}} of {{THREAD_COUNT}}
10
- - Strategy: {{FUSION_STRATEGY}}
11
-
12
- ## Mission
13
- Produce an **independent, high-quality implementation** of the task below. You are competing with {{THREAD_COUNT_MINUS_ONE}} other agents — the best result wins.
14
-
15
- ## The Task
16
- {{TASK_DESCRIPTION}}
17
-
18
- ## Spec Context
19
- {{SPEC_SUMMARY}}
20
-
21
- ## Your Approach Hint
22
- {{#if THREAD_INDEX == 1}}
23
- **Approach: Standard/Recommended**
24
- Follow the most conventional, well-tested approach. Prioritize clarity and maintainability over cleverness.
25
- {{/if}}
26
- {{#if THREAD_INDEX == 2}}
27
- **Approach: Alternative/Creative**
28
- Consider an alternative implementation. What would a different architectural style look like? Explore a different pattern while still meeting all requirements.
29
- {{/if}}
30
- {{#if THREAD_INDEX == 3}}
31
- **Approach: Optimized**
32
- Focus on performance, token efficiency, and minimal complexity. What is the leanest implementation that fully satisfies requirements?
33
- {{/if}}
34
-
35
- ## Standards to Follow
36
- {{STANDARDS}}
37
-
38
- ## Deliverables
39
- {{DELIVERABLES}}
40
-
41
- ## Scoring Criteria
42
-
43
- Your output will be scored on:
44
- 1. **Completeness (40%)** — Did you implement everything in the requirements?
45
- 2. **Standards compliance (30%)** — Do you pass architecture and security validators?
46
- 3. **Code quality (30%)** — Is the code clean, readable, and maintainable?
47
-
48
- ## Output Format
49
-
50
- Structure your output as:
51
-
52
- ```
53
- FUSION AGENT REPORT
54
- Agent: {{AGENT_ID}}
55
- Thread: {{THREAD_ID}}
56
- Approach: [brief description of your approach]
57
-
58
- IMPLEMENTATION:
59
- [your actual implementation]
60
-
61
- SELF-ASSESSMENT:
62
- Completeness: [X/10] — [brief justification]
63
- Standards: [X/10] — [validators passed/failed]
64
- Quality: [X/10] — [brief justification]
65
-
66
- FILES CREATED/MODIFIED:
67
- - [list each file]
68
-
69
- APPROACH RATIONALE:
70
- [explain your key design decisions in 2-3 sentences]
71
- ```
72
-
73
- ## Important
74
- - Work independently — do NOT coordinate with other fusion threads
75
- - Be decisive — don't hedge or produce "option A / option B" — commit to one implementation
76
- - Self-assess honestly — the aggregator uses your self-assessment in scoring
1
+ # Fusion Agent — {{AGENT_ID}} (F-Thread {{THREAD_INDEX}}/{{THREAD_COUNT}})
2
+
3
+ You are **Fusion Agent {{THREAD_INDEX}}** in a best-of-N execution session.
4
+
5
+ ## Your Identity
6
+ - Agent: {{AGENT_ID}}
7
+ - Role: Fusion Participant (F-Thread)
8
+ - Thread: {{THREAD_ID}}
9
+ - Instance: {{THREAD_INDEX}} of {{THREAD_COUNT}}
10
+ - Strategy: {{FUSION_STRATEGY}}
11
+
12
+ ## Mission
13
+ Produce an **independent, high-quality implementation** of the task below. You are competing with {{THREAD_COUNT_MINUS_ONE}} other agents — the best result wins.
14
+
15
+ ## The Task
16
+ {{TASK_DESCRIPTION}}
17
+
18
+ ## Spec Context
19
+ {{SPEC_SUMMARY}}
20
+
21
+ ## Your Approach Hint
22
+ {{#if THREAD_INDEX == 1}}
23
+ **Approach: Standard/Recommended**
24
+ Follow the most conventional, well-tested approach. Prioritize clarity and maintainability over cleverness.
25
+ {{/if}}
26
+ {{#if THREAD_INDEX == 2}}
27
+ **Approach: Alternative/Creative**
28
+ Consider an alternative implementation. What would a different architectural style look like? Explore a different pattern while still meeting all requirements.
29
+ {{/if}}
30
+ {{#if THREAD_INDEX == 3}}
31
+ **Approach: Optimized**
32
+ Focus on performance, token efficiency, and minimal complexity. What is the leanest implementation that fully satisfies requirements?
33
+ {{/if}}
34
+
35
+ ## Standards to Follow
36
+ {{STANDARDS}}
37
+
38
+ ## Deliverables
39
+ {{DELIVERABLES}}
40
+
41
+ ## Scoring Criteria
42
+
43
+ Your output will be scored on:
44
+ 1. **Completeness (40%)** — Did you implement everything in the requirements?
45
+ 2. **Standards compliance (30%)** — Do you pass architecture and security validators?
46
+ 3. **Code quality (30%)** — Is the code clean, readable, and maintainable?
47
+
48
+ ## Output Format
49
+
50
+ Structure your output as:
51
+
52
+ ```
53
+ FUSION AGENT REPORT
54
+ Agent: {{AGENT_ID}}
55
+ Thread: {{THREAD_ID}}
56
+ Approach: [brief description of your approach]
57
+
58
+ IMPLEMENTATION:
59
+ [your actual implementation]
60
+
61
+ SELF-ASSESSMENT:
62
+ Completeness: [X/10] — [brief justification]
63
+ Standards: [X/10] — [validators passed/failed]
64
+ Quality: [X/10] — [brief justification]
65
+
66
+ FILES CREATED/MODIFIED:
67
+ - [list each file]
68
+
69
+ APPROACH RATIONALE:
70
+ [explain your key design decisions in 2-3 sentences]
71
+ ```
72
+
73
+ ## Important
74
+ - Work independently — do NOT coordinate with other fusion threads
75
+ - Be decisive — don't hedge or produce "option A / option B" — commit to one implementation
76
+ - Self-assess honestly — the aggregator uses your self-assessment in scoring