forgecraft-mcp 1.2.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +525 -525
- package/dist/cli/help.js +44 -44
- package/dist/registry/renderer-skeletons.js +92 -92
- package/dist/shared/gs-score-logger.js +6 -6
- package/dist/tools/add-module.js +123 -123
- package/dist/tools/advice-registry.js +18 -18
- package/dist/tools/check-cascade-report.js +64 -64
- package/dist/tools/configure-mcp.d.ts +3 -0
- package/dist/tools/configure-mcp.d.ts.map +1 -1
- package/dist/tools/configure-mcp.js +10 -0
- package/dist/tools/configure-mcp.js.map +1 -1
- package/dist/tools/forgecraft-dispatch.d.ts.map +1 -1
- package/dist/tools/forgecraft-dispatch.js +3 -0
- package/dist/tools/forgecraft-dispatch.js.map +1 -1
- package/dist/tools/forgecraft-schema-params.d.ts +9 -0
- package/dist/tools/forgecraft-schema-params.d.ts.map +1 -1
- package/dist/tools/forgecraft-schema-params.js +21 -0
- package/dist/tools/forgecraft-schema-params.js.map +1 -1
- package/dist/tools/forgecraft-schema.d.ts +9 -0
- package/dist/tools/forgecraft-schema.d.ts.map +1 -1
- package/dist/tools/refresh-output.js +14 -14
- package/dist/tools/scaffold-spec-stubs.js +115 -115
- package/dist/tools/scaffold-templates.js +62 -62
- package/dist/tools/setup-artifact-writers.d.ts +30 -0
- package/dist/tools/setup-artifact-writers.d.ts.map +1 -1
- package/dist/tools/setup-artifact-writers.js +120 -8
- package/dist/tools/setup-artifact-writers.js.map +1 -1
- package/dist/tools/setup-phase1.d.ts +3 -0
- package/dist/tools/setup-phase1.d.ts.map +1 -1
- package/dist/tools/setup-phase1.js +79 -35
- package/dist/tools/setup-phase1.js.map +1 -1
- package/dist/tools/setup-phase2.d.ts +2 -0
- package/dist/tools/setup-phase2.d.ts.map +1 -1
- package/dist/tools/setup-phase2.js +10 -1
- package/dist/tools/setup-phase2.js.map +1 -1
- package/dist/tools/setup-project.d.ts +18 -0
- package/dist/tools/setup-project.d.ts.map +1 -1
- package/dist/tools/setup-project.js +77 -1
- package/dist/tools/setup-project.js.map +1 -1
- package/dist/tools/spec-parser-tags.d.ts +9 -0
- package/dist/tools/spec-parser-tags.d.ts.map +1 -1
- package/dist/tools/spec-parser-tags.js +92 -0
- package/dist/tools/spec-parser-tags.js.map +1 -1
- package/package.json +89 -86
- package/templates/analytics/instructions.yaml +37 -37
- package/templates/analytics/mcp-servers.yaml +11 -11
- package/templates/analytics/structure.yaml +25 -25
- package/templates/api/instructions.yaml +231 -231
- package/templates/api/mcp-servers.yaml +22 -13
- package/templates/api/nfr.yaml +23 -23
- package/templates/api/review.yaml +103 -103
- package/templates/api/structure.yaml +34 -34
- package/templates/api/verification.yaml +132 -132
- package/templates/cli/instructions.yaml +31 -31
- package/templates/cli/mcp-servers.yaml +11 -11
- package/templates/cli/review.yaml +53 -53
- package/templates/cli/structure.yaml +16 -16
- package/templates/data-lineage/instructions.yaml +28 -28
- package/templates/data-lineage/mcp-servers.yaml +22 -22
- package/templates/data-pipeline/instructions.yaml +84 -84
- package/templates/data-pipeline/mcp-servers.yaml +13 -13
- package/templates/data-pipeline/nfr.yaml +39 -39
- package/templates/data-pipeline/structure.yaml +23 -23
- package/templates/fintech/hooks.yaml +55 -55
- package/templates/fintech/instructions.yaml +112 -112
- package/templates/fintech/mcp-servers.yaml +13 -13
- package/templates/fintech/nfr.yaml +46 -46
- package/templates/fintech/playbook.yaml +210 -210
- package/templates/fintech/verification.yaml +239 -239
- package/templates/game/instructions.yaml +289 -289
- package/templates/game/mcp-servers.yaml +38 -38
- package/templates/game/nfr.yaml +64 -64
- package/templates/game/playbook.yaml +214 -214
- package/templates/game/review.yaml +97 -97
- package/templates/game/structure.yaml +67 -67
- package/templates/game/verification.yaml +174 -174
- package/templates/healthcare/instructions.yaml +42 -42
- package/templates/healthcare/mcp-servers.yaml +13 -13
- package/templates/healthcare/nfr.yaml +47 -47
- package/templates/hipaa/instructions.yaml +41 -41
- package/templates/hipaa/mcp-servers.yaml +13 -13
- package/templates/infra/instructions.yaml +104 -104
- package/templates/infra/mcp-servers.yaml +20 -20
- package/templates/infra/nfr.yaml +46 -46
- package/templates/infra/review.yaml +65 -65
- package/templates/infra/structure.yaml +25 -25
- package/templates/library/instructions.yaml +36 -36
- package/templates/library/mcp-servers.yaml +20 -20
- package/templates/library/review.yaml +56 -56
- package/templates/library/structure.yaml +19 -19
- package/templates/medallion-architecture/instructions.yaml +41 -41
- package/templates/medallion-architecture/mcp-servers.yaml +22 -22
- package/templates/ml/instructions.yaml +85 -85
- package/templates/ml/mcp-servers.yaml +11 -11
- package/templates/ml/nfr.yaml +39 -39
- package/templates/ml/structure.yaml +25 -25
- package/templates/ml/verification.yaml +156 -156
- package/templates/mobile/instructions.yaml +44 -44
- package/templates/mobile/mcp-servers.yaml +11 -11
- package/templates/mobile/nfr.yaml +49 -49
- package/templates/mobile/structure.yaml +27 -27
- package/templates/mobile/verification.yaml +121 -121
- package/templates/observability-xray/instructions.yaml +40 -40
- package/templates/observability-xray/mcp-servers.yaml +15 -15
- package/templates/realtime/instructions.yaml +42 -42
- package/templates/realtime/mcp-servers.yaml +13 -13
- package/templates/soc2/instructions.yaml +41 -41
- package/templates/soc2/mcp-servers.yaml +24 -24
- package/templates/social/instructions.yaml +43 -43
- package/templates/social/mcp-servers.yaml +24 -24
- package/templates/state-machine/instructions.yaml +42 -42
- package/templates/state-machine/mcp-servers.yaml +11 -11
- package/templates/tools-registry.yaml +164 -164
- package/templates/universal/hooks.yaml +531 -531
- package/templates/universal/instructions.yaml +1692 -1692
- package/templates/universal/mcp-servers.yaml +50 -50
- package/templates/universal/nfr.yaml +197 -197
- package/templates/universal/reference.yaml +326 -326
- package/templates/universal/review.yaml +204 -204
- package/templates/universal/skills.yaml +262 -262
- package/templates/universal/structure.yaml +67 -67
- package/templates/universal/verification.yaml +416 -416
- package/templates/web-react/hooks.yaml +44 -44
- package/templates/web-react/instructions.yaml +207 -207
- package/templates/web-react/mcp-servers.yaml +20 -20
- package/templates/web-react/nfr.yaml +27 -27
- package/templates/web-react/review.yaml +94 -94
- package/templates/web-react/structure.yaml +46 -46
- package/templates/web-react/verification.yaml +126 -126
- package/templates/web-static/instructions.yaml +115 -115
- package/templates/web-static/mcp-servers.yaml +20 -20
- package/templates/web3/instructions.yaml +44 -44
- package/templates/web3/mcp-servers.yaml +11 -11
- package/templates/web3/verification.yaml +159 -159
- package/templates/zero-trust/instructions.yaml +41 -41
- package/templates/zero-trust/mcp-servers.yaml +15 -15
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
tag: GAME
|
|
2
|
-
section: verification
|
|
3
|
-
title: "Balance Simulation + Generative Art Verification"
|
|
4
|
-
description: >
|
|
5
|
-
Game systems have two orthogonal uncertainty dimensions. Balance uncertainty
|
|
6
|
-
is stochastic: damage formulas, economy ratios, and progression curves produce
|
|
7
|
-
emergent outcomes that are only visible through simulation across thousands of
|
|
8
|
-
iterations. Art uncertainty is generative: output correctness requires human
|
|
9
|
-
aesthetic judgment, with MCP tools (Aseprite) producing the artifact that
|
|
10
|
-
the AI assembles. This strategy closes both dimensions.
|
|
11
|
-
uncertainty_levels:
|
|
12
|
-
- stochastic
|
|
13
|
-
- generative
|
|
14
|
-
completeness_ceiling: 0.80
|
|
15
|
-
|
|
16
|
-
phases:
|
|
17
|
-
|
|
18
|
-
- id: contract-definition
|
|
19
|
-
title: "Define Balance Invariants and Art Acceptance Criteria"
|
|
20
|
-
rationale: >
|
|
21
|
-
Balance contracts are statistical bounds, not exact values. A contract states:
|
|
22
|
-
"TTK for equal-level combatants is between 8 and 14 seconds" — not a specific number.
|
|
23
|
-
Art contracts are visual: "the idle animation has 4 frames, is 32x32px, and loops cleanly
|
|
24
|
-
with no visible seam." Both must be written before simulation or generation begins.
|
|
25
|
-
steps:
|
|
26
|
-
- id: define-balance-invariants
|
|
27
|
-
instruction: >
|
|
28
|
-
For each game system, define statistical invariants:
|
|
29
|
-
- Time-to-kill (TTK): target range in seconds for equal-level match
|
|
30
|
-
- Win rate variance: target σ for balanced competitive (typically σ < 5%)
|
|
31
|
-
- Economy sink/source ratio: target range (typically 0.9–1.1 for stable economy)
|
|
32
|
-
- Catch-up ceiling: max XP gap allowed between players at same session time
|
|
33
|
-
Store in docs/balance-contracts.md as a table: System | Metric | Target | Acceptable Range.
|
|
34
|
-
contract: >
|
|
35
|
-
docs/balance-contracts.md exists with ≥1 row per game system.
|
|
36
|
-
Every row has a numeric target and acceptable range.
|
|
37
|
-
tools: ["filesystem"]
|
|
38
|
-
expected_output: "| Combat | TTK | 11s | [8s, 14s] | per-patch measurement |"
|
|
39
|
-
pass_criterion: "File exists and passes grep for at least one numeric range"
|
|
40
|
-
|
|
41
|
-
- id: define-art-acceptance-criteria
|
|
42
|
-
instruction: >
|
|
43
|
-
For each asset type (character sprite, tile, UI element, animation), define:
|
|
44
|
-
- Dimensions (e.g., 32x32px, 192x48px sprite sheet)
|
|
45
|
-
- Frame count for animations
|
|
46
|
-
- Palette constraints (max colors, transparency requirements)
|
|
47
|
-
- Animation loop contract (first and last frame must be visually continuous)
|
|
48
|
-
Store in docs/art-contracts.md.
|
|
49
|
-
contract: "docs/art-contracts.md exists with dimensions and frame count per asset type"
|
|
50
|
-
tools: ["filesystem"]
|
|
51
|
-
expected_output: "| player-idle | 32x32 | 4 frames | 4-color palette | loop | Aseprite |"
|
|
52
|
-
pass_criterion: "File exists with ≥1 row per asset type"
|
|
53
|
-
|
|
54
|
-
- id: simulation
|
|
55
|
-
title: "Headless Balance Simulation"
|
|
56
|
-
rationale: >
|
|
57
|
-
Balance bugs are invisible to unit tests and playtesters until they manifest as
|
|
58
|
-
dominant strategies. Headless simulation runs thousands of match iterations with
|
|
59
|
-
scripted AI agents and reports whether invariants hold. It surfaces problems in
|
|
60
|
-
minutes that playtesting would take months to detect.
|
|
61
|
-
steps:
|
|
62
|
-
- id: build-simulation-harness
|
|
63
|
-
instruction: >
|
|
64
|
-
Build a headless simulation harness: a function `runSimulation(config, seed) → SimResult`
|
|
65
|
-
that is deterministic given the same seed. No DOM, no renderer, no input system.
|
|
66
|
-
For Unity/Godot: headless build + scripted test runner. For browser/Node: pure logic module.
|
|
67
|
-
For Python: standalone module with no display imports.
|
|
68
|
-
Verify determinism: assert runSimulation(config, 42) === runSimulation(config, 42).
|
|
69
|
-
contract: >
|
|
70
|
-
runSimulation function exists and is importable/callable from test scripts.
|
|
71
|
-
Determinism test: two calls with same seed produce identical SimResult objects.
|
|
72
|
-
tools: ["node", "python", "unity-headless", "godot --headless", "jest"]
|
|
73
|
-
expected_output: "Determinism test: PASS. SimResult schema: {winner, ttk, rounds, stats}"
|
|
74
|
-
pass_criterion: "Determinism test passes; runSimulation callable from test script"
|
|
75
|
-
|
|
76
|
-
- id: run-monte-carlo
|
|
77
|
-
instruction: >
|
|
78
|
-
Run 10,000 simulations per balance scenario. Scenarios:
|
|
79
|
-
1. Equal-level PvP (player A vs player B, same level)
|
|
80
|
-
2. ±5 level advantage PvP (balance stress test)
|
|
81
|
-
3. Economy sink/source over 60-minute session
|
|
82
|
-
For each scenario, record: distribution of outcomes, mean, σ, p5, p95.
|
|
83
|
-
contract: >
|
|
84
|
-
10,000 iterations complete without error for each scenario.
|
|
85
|
-
For equal-level PvP: win rate for each side is in [45%, 55%].
|
|
86
|
-
tools: ["node scripts/simulate.js --iterations 10000", "python simulate.py --n 10000"]
|
|
87
|
-
expected_output: "simulation-results.json: {scenario, n, mean_ttk, sigma, p5, p95, win_rate_a, win_rate_b}"
|
|
88
|
-
pass_criterion: "win_rate_a ∈ [0.45, 0.55] for equal-level scenarios"
|
|
89
|
-
|
|
90
|
-
- id: assert-balance-invariants
|
|
91
|
-
instruction: >
|
|
92
|
-
Compare simulation results against the balance contracts in docs/balance-contracts.md.
|
|
93
|
-
For each invariant, report: PASS or FAIL with the actual value and the contracted range.
|
|
94
|
-
Any FAIL becomes the input to the next fix iteration.
|
|
95
|
-
contract: "All balance invariants in docs/balance-contracts.md are PASS"
|
|
96
|
-
tools: ["node scripts/check-invariants.js", "python check_invariants.py"]
|
|
97
|
-
expected_output: "invariant-report.json: [{system, metric, target_range, actual, result}]"
|
|
98
|
-
pass_criterion: "All result fields = PASS in invariant-report.json"
|
|
99
|
-
|
|
100
|
-
- id: art-generation
|
|
101
|
-
title: "Generative Art via MCP + Human Approval"
|
|
102
|
-
rationale: >
|
|
103
|
-
Aseprite is available as an MCP tool. The AI assembles sprites by: generating
|
|
104
|
-
pixel art frames via prompt-to-pixel generation, importing into Aseprite via MCP,
|
|
105
|
-
applying palette constraints, and exporting as PNG sprite sheets. Human approval
|
|
106
|
-
is required before art assets are committed — this is irreducibly generative.
|
|
107
|
-
steps:
|
|
108
|
-
- id: generate-art-assets
|
|
109
|
-
instruction: >
|
|
110
|
-
For each asset defined in docs/art-contracts.md, use the Aseprite MCP tool to:
|
|
111
|
-
1. Create a new sprite of the correct dimensions
|
|
112
|
-
2. Generate pixel art for each frame (use aseprite_new_frame for multi-frame assets)
|
|
113
|
-
3. Apply the palette constraint (aseprite_set_palette)
|
|
114
|
-
4. Export as PNG sprite sheet (aseprite_export)
|
|
115
|
-
Name the output files as: assets/{type}/{name}.png and assets/{type}/{name}-sheet.png.
|
|
116
|
-
contract: >
|
|
117
|
-
PNG file exists per asset at the correct path.
|
|
118
|
-
File dimensions match the contract (use imagemagick identify or PIL).
|
|
119
|
-
Frame count matches by dividing sheet width by frame width.
|
|
120
|
-
tools: ["aseprite MCP tool", "aseprite_new_sprite", "aseprite_export", "imagemagick identify"]
|
|
121
|
-
expected_output: "assets/sprites/player-idle.png (32x128px = 32x32 × 4 frames)"
|
|
122
|
-
pass_criterion: "File exists; dimensions match contract; frame count matches"
|
|
123
|
-
|
|
124
|
-
- id: assert-art-contracts
|
|
125
|
-
instruction: >
|
|
126
|
-
For each generated asset, assert:
|
|
127
|
-
1. Dimensions: `identify -format '%wx%h' file.png` matches contract
|
|
128
|
-
2. Palette: `identify -format '%k' file.png` ≤ max colors in contract
|
|
129
|
-
3. Animation loop: first and last frame pixel hashes are compatible (no abrupt cut)
|
|
130
|
-
contract: >
|
|
131
|
-
All dimension asserts pass. Palette constraint met. Loop continuity check passes
|
|
132
|
-
(difference between last and first frame pixel arrays < 10% of total pixels).
|
|
133
|
-
tools: ["imagemagick identify", "PIL/Pillow", "python scripts/check-loop.py"]
|
|
134
|
-
expected_output: "art-validation.json: [{asset, dimensions, palette_colors, loop_continuous, result}]"
|
|
135
|
-
pass_criterion: "All result fields = PASS in art-validation.json"
|
|
136
|
-
|
|
137
|
-
- id: human-approval
|
|
138
|
-
instruction: >
|
|
139
|
-
Present each generated asset to the human for approval. For each asset: show the
|
|
140
|
-
PNG, the contract spec, and the automated assertion results. The human approves or
|
|
141
|
-
provides specific correction instructions (e.g., "darken the shadow, add 1 frame for
|
|
142
|
-
the landing pose"). Record approval decisions in art-approvals.json.
|
|
143
|
-
contract: "All assets have human_approved: true in art-approvals.json"
|
|
144
|
-
tools: ["filesystem", "claude vision (for AI pre-screening before human review)"]
|
|
145
|
-
expected_output: "art-approvals.json: [{asset, human_approved, corrections}]"
|
|
146
|
-
pass_criterion: "All human_approved = true"
|
|
147
|
-
requires_human_review: true
|
|
148
|
-
|
|
149
|
-
- id: evidence
|
|
150
|
-
title: "Persist Simulation Results and Art Approvals"
|
|
151
|
-
rationale: >
|
|
152
|
-
Simulation results and art approvals are the ground truth for this domain.
|
|
153
|
-
They must be committed alongside code so balance regressions are detectable
|
|
154
|
-
across game patches.
|
|
155
|
-
steps:
|
|
156
|
-
- id: commit-simulation-artifacts
|
|
157
|
-
instruction: >
|
|
158
|
-
Commit simulation-results.json and invariant-report.json to docs/balance/.
|
|
159
|
-
Tag the commit with the game patch version.
|
|
160
|
-
If any invariant is FAIL, fix the formula before committing.
|
|
161
|
-
contract: "docs/balance/simulation-results.json and invariant-report.json committed"
|
|
162
|
-
tools: ["git add docs/balance/", "git commit"]
|
|
163
|
-
expected_output: "Files present in repository under docs/balance/"
|
|
164
|
-
pass_criterion: "git show HEAD:docs/balance/invariant-report.json is valid JSON"
|
|
165
|
-
|
|
166
|
-
- id: commit-approved-art
|
|
167
|
-
instruction: >
|
|
168
|
-
Commit approved PNG assets to assets/sprites/ (or appropriate path).
|
|
169
|
-
Include art-approvals.json with human sign-off records.
|
|
170
|
-
Do not commit unapproved or placeholder assets as final production art.
|
|
171
|
-
contract: "All PNG files in assets/ have a corresponding approval entry in art-approvals.json"
|
|
172
|
-
tools: ["git add assets/", "git commit"]
|
|
173
|
-
expected_output: "art-approvals.json committed alongside PNG files"
|
|
174
|
-
pass_criterion: "art-approvals.json exists; all assets have human_approved: true"
|
|
1
|
+
tag: GAME
|
|
2
|
+
section: verification
|
|
3
|
+
title: "Balance Simulation + Generative Art Verification"
|
|
4
|
+
description: >
|
|
5
|
+
Game systems have two orthogonal uncertainty dimensions. Balance uncertainty
|
|
6
|
+
is stochastic: damage formulas, economy ratios, and progression curves produce
|
|
7
|
+
emergent outcomes that are only visible through simulation across thousands of
|
|
8
|
+
iterations. Art uncertainty is generative: output correctness requires human
|
|
9
|
+
aesthetic judgment, with MCP tools (Aseprite) producing the artifact that
|
|
10
|
+
the AI assembles. This strategy closes both dimensions.
|
|
11
|
+
uncertainty_levels:
|
|
12
|
+
- stochastic
|
|
13
|
+
- generative
|
|
14
|
+
completeness_ceiling: 0.80
|
|
15
|
+
|
|
16
|
+
phases:
|
|
17
|
+
|
|
18
|
+
- id: contract-definition
|
|
19
|
+
title: "Define Balance Invariants and Art Acceptance Criteria"
|
|
20
|
+
rationale: >
|
|
21
|
+
Balance contracts are statistical bounds, not exact values. A contract states:
|
|
22
|
+
"TTK for equal-level combatants is between 8 and 14 seconds" — not a specific number.
|
|
23
|
+
Art contracts are visual: "the idle animation has 4 frames, is 32x32px, and loops cleanly
|
|
24
|
+
with no visible seam." Both must be written before simulation or generation begins.
|
|
25
|
+
steps:
|
|
26
|
+
- id: define-balance-invariants
|
|
27
|
+
instruction: >
|
|
28
|
+
For each game system, define statistical invariants:
|
|
29
|
+
- Time-to-kill (TTK): target range in seconds for equal-level match
|
|
30
|
+
- Win rate variance: target σ for balanced competitive (typically σ < 5%)
|
|
31
|
+
- Economy sink/source ratio: target range (typically 0.9–1.1 for stable economy)
|
|
32
|
+
- Catch-up ceiling: max XP gap allowed between players at same session time
|
|
33
|
+
Store in docs/balance-contracts.md as a table: System | Metric | Target | Acceptable Range.
|
|
34
|
+
contract: >
|
|
35
|
+
docs/balance-contracts.md exists with ≥1 row per game system.
|
|
36
|
+
Every row has a numeric target and acceptable range.
|
|
37
|
+
tools: ["filesystem"]
|
|
38
|
+
expected_output: "| Combat | TTK | 11s | [8s, 14s] | per-patch measurement |"
|
|
39
|
+
pass_criterion: "File exists and passes grep for at least one numeric range"
|
|
40
|
+
|
|
41
|
+
- id: define-art-acceptance-criteria
|
|
42
|
+
instruction: >
|
|
43
|
+
For each asset type (character sprite, tile, UI element, animation), define:
|
|
44
|
+
- Dimensions (e.g., 32x32px, 192x48px sprite sheet)
|
|
45
|
+
- Frame count for animations
|
|
46
|
+
- Palette constraints (max colors, transparency requirements)
|
|
47
|
+
- Animation loop contract (first and last frame must be visually continuous)
|
|
48
|
+
Store in docs/art-contracts.md.
|
|
49
|
+
contract: "docs/art-contracts.md exists with dimensions and frame count per asset type"
|
|
50
|
+
tools: ["filesystem"]
|
|
51
|
+
expected_output: "| player-idle | 32x32 | 4 frames | 4-color palette | loop | Aseprite |"
|
|
52
|
+
pass_criterion: "File exists with ≥1 row per asset type"
|
|
53
|
+
|
|
54
|
+
- id: simulation
|
|
55
|
+
title: "Headless Balance Simulation"
|
|
56
|
+
rationale: >
|
|
57
|
+
Balance bugs are invisible to unit tests and playtesters until they manifest as
|
|
58
|
+
dominant strategies. Headless simulation runs thousands of match iterations with
|
|
59
|
+
scripted AI agents and reports whether invariants hold. It surfaces problems in
|
|
60
|
+
minutes that playtesting would take months to detect.
|
|
61
|
+
steps:
|
|
62
|
+
- id: build-simulation-harness
|
|
63
|
+
instruction: >
|
|
64
|
+
Build a headless simulation harness: a function `runSimulation(config, seed) → SimResult`
|
|
65
|
+
that is deterministic given the same seed. No DOM, no renderer, no input system.
|
|
66
|
+
For Unity/Godot: headless build + scripted test runner. For browser/Node: pure logic module.
|
|
67
|
+
For Python: standalone module with no display imports.
|
|
68
|
+
Verify determinism: assert runSimulation(config, 42) === runSimulation(config, 42).
|
|
69
|
+
contract: >
|
|
70
|
+
runSimulation function exists and is importable/callable from test scripts.
|
|
71
|
+
Determinism test: two calls with same seed produce identical SimResult objects.
|
|
72
|
+
tools: ["node", "python", "unity-headless", "godot --headless", "jest"]
|
|
73
|
+
expected_output: "Determinism test: PASS. SimResult schema: {winner, ttk, rounds, stats}"
|
|
74
|
+
pass_criterion: "Determinism test passes; runSimulation callable from test script"
|
|
75
|
+
|
|
76
|
+
- id: run-monte-carlo
|
|
77
|
+
instruction: >
|
|
78
|
+
Run 10,000 simulations per balance scenario. Scenarios:
|
|
79
|
+
1. Equal-level PvP (player A vs player B, same level)
|
|
80
|
+
2. ±5 level advantage PvP (balance stress test)
|
|
81
|
+
3. Economy sink/source over 60-minute session
|
|
82
|
+
For each scenario, record: distribution of outcomes, mean, σ, p5, p95.
|
|
83
|
+
contract: >
|
|
84
|
+
10,000 iterations complete without error for each scenario.
|
|
85
|
+
For equal-level PvP: win rate for each side is in [45%, 55%].
|
|
86
|
+
tools: ["node scripts/simulate.js --iterations 10000", "python simulate.py --n 10000"]
|
|
87
|
+
expected_output: "simulation-results.json: {scenario, n, mean_ttk, sigma, p5, p95, win_rate_a, win_rate_b}"
|
|
88
|
+
pass_criterion: "win_rate_a ∈ [0.45, 0.55] for equal-level scenarios"
|
|
89
|
+
|
|
90
|
+
- id: assert-balance-invariants
|
|
91
|
+
instruction: >
|
|
92
|
+
Compare simulation results against the balance contracts in docs/balance-contracts.md.
|
|
93
|
+
For each invariant, report: PASS or FAIL with the actual value and the contracted range.
|
|
94
|
+
Any FAIL becomes the input to the next fix iteration.
|
|
95
|
+
contract: "All balance invariants in docs/balance-contracts.md are PASS"
|
|
96
|
+
tools: ["node scripts/check-invariants.js", "python check_invariants.py"]
|
|
97
|
+
expected_output: "invariant-report.json: [{system, metric, target_range, actual, result}]"
|
|
98
|
+
pass_criterion: "All result fields = PASS in invariant-report.json"
|
|
99
|
+
|
|
100
|
+
- id: art-generation
|
|
101
|
+
title: "Generative Art via MCP + Human Approval"
|
|
102
|
+
rationale: >
|
|
103
|
+
Aseprite is available as an MCP tool. The AI assembles sprites by: generating
|
|
104
|
+
pixel art frames via prompt-to-pixel generation, importing into Aseprite via MCP,
|
|
105
|
+
applying palette constraints, and exporting as PNG sprite sheets. Human approval
|
|
106
|
+
is required before art assets are committed — this is irreducibly generative.
|
|
107
|
+
steps:
|
|
108
|
+
- id: generate-art-assets
|
|
109
|
+
instruction: >
|
|
110
|
+
For each asset defined in docs/art-contracts.md, use the Aseprite MCP tool to:
|
|
111
|
+
1. Create a new sprite of the correct dimensions
|
|
112
|
+
2. Generate pixel art for each frame (use aseprite_new_frame for multi-frame assets)
|
|
113
|
+
3. Apply the palette constraint (aseprite_set_palette)
|
|
114
|
+
4. Export as PNG sprite sheet (aseprite_export)
|
|
115
|
+
Name the output files as: assets/{type}/{name}.png and assets/{type}/{name}-sheet.png.
|
|
116
|
+
contract: >
|
|
117
|
+
PNG file exists per asset at the correct path.
|
|
118
|
+
File dimensions match the contract (use imagemagick identify or PIL).
|
|
119
|
+
Frame count matches by dividing sheet width by frame width.
|
|
120
|
+
tools: ["aseprite MCP tool", "aseprite_new_sprite", "aseprite_export", "imagemagick identify"]
|
|
121
|
+
expected_output: "assets/sprites/player-idle.png (32x128px = 32x32 × 4 frames)"
|
|
122
|
+
pass_criterion: "File exists; dimensions match contract; frame count matches"
|
|
123
|
+
|
|
124
|
+
- id: assert-art-contracts
|
|
125
|
+
instruction: >
|
|
126
|
+
For each generated asset, assert:
|
|
127
|
+
1. Dimensions: `identify -format '%wx%h' file.png` matches contract
|
|
128
|
+
2. Palette: `identify -format '%k' file.png` ≤ max colors in contract
|
|
129
|
+
3. Animation loop: first and last frame pixel hashes are compatible (no abrupt cut)
|
|
130
|
+
contract: >
|
|
131
|
+
All dimension asserts pass. Palette constraint met. Loop continuity check passes
|
|
132
|
+
(difference between last and first frame pixel arrays < 10% of total pixels).
|
|
133
|
+
tools: ["imagemagick identify", "PIL/Pillow", "python scripts/check-loop.py"]
|
|
134
|
+
expected_output: "art-validation.json: [{asset, dimensions, palette_colors, loop_continuous, result}]"
|
|
135
|
+
pass_criterion: "All result fields = PASS in art-validation.json"
|
|
136
|
+
|
|
137
|
+
- id: human-approval
|
|
138
|
+
instruction: >
|
|
139
|
+
Present each generated asset to the human for approval. For each asset: show the
|
|
140
|
+
PNG, the contract spec, and the automated assertion results. The human approves or
|
|
141
|
+
provides specific correction instructions (e.g., "darken the shadow, add 1 frame for
|
|
142
|
+
the landing pose"). Record approval decisions in art-approvals.json.
|
|
143
|
+
contract: "All assets have human_approved: true in art-approvals.json"
|
|
144
|
+
tools: ["filesystem", "claude vision (for AI pre-screening before human review)"]
|
|
145
|
+
expected_output: "art-approvals.json: [{asset, human_approved, corrections}]"
|
|
146
|
+
pass_criterion: "All human_approved = true"
|
|
147
|
+
requires_human_review: true
|
|
148
|
+
|
|
149
|
+
- id: evidence
|
|
150
|
+
title: "Persist Simulation Results and Art Approvals"
|
|
151
|
+
rationale: >
|
|
152
|
+
Simulation results and art approvals are the ground truth for this domain.
|
|
153
|
+
They must be committed alongside code so balance regressions are detectable
|
|
154
|
+
across game patches.
|
|
155
|
+
steps:
|
|
156
|
+
- id: commit-simulation-artifacts
|
|
157
|
+
instruction: >
|
|
158
|
+
Commit simulation-results.json and invariant-report.json to docs/balance/.
|
|
159
|
+
Tag the commit with the game patch version.
|
|
160
|
+
If any invariant is FAIL, fix the formula before committing.
|
|
161
|
+
contract: "docs/balance/simulation-results.json and invariant-report.json committed"
|
|
162
|
+
tools: ["git add docs/balance/", "git commit"]
|
|
163
|
+
expected_output: "Files present in repository under docs/balance/"
|
|
164
|
+
pass_criterion: "git show HEAD:docs/balance/invariant-report.json is valid JSON"
|
|
165
|
+
|
|
166
|
+
- id: commit-approved-art
|
|
167
|
+
instruction: >
|
|
168
|
+
Commit approved PNG assets to assets/sprites/ (or appropriate path).
|
|
169
|
+
Include art-approvals.json with human sign-off records.
|
|
170
|
+
Do not commit unapproved or placeholder assets as final production art.
|
|
171
|
+
contract: "All PNG files in assets/ have a corresponding approval entry in art-approvals.json"
|
|
172
|
+
tools: ["git add assets/", "git commit"]
|
|
173
|
+
expected_output: "art-approvals.json committed alongside PNG files"
|
|
174
|
+
pass_criterion: "art-approvals.json exists; all assets have human_approved: true"
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
tag: HEALTHCARE
|
|
2
|
-
section: instructions
|
|
3
|
-
blocks:
|
|
4
|
-
- id: hipaa-compliance
|
|
5
|
-
tier: recommended
|
|
6
|
-
title: "HIPAA Compliance & PHI Handling"
|
|
7
|
-
content: |
|
|
8
|
-
## HIPAA Compliance & Protected Health Information
|
|
9
|
-
|
|
10
|
-
- Classify all data fields at design time. Identify the 18 HIPAA identifiers and ensure any field containing PHI is tagged, encrypted, and access-controlled.
|
|
11
|
-
- Apply the minimum necessary principle: every API endpoint, database query, and UI view must expose only the PHI fields required for the specific use case.
|
|
12
|
-
- Encrypt PHI at rest (AES-256) and in transit (TLS 1.2+). Use envelope encryption with a KMS for key management; never store encryption keys alongside data.
|
|
13
|
-
- Implement role-based access control (RBAC) with the principle of least privilege. Map roles to specific PHI access levels and review permissions quarterly.
|
|
14
|
-
- Maintain a Business Associate Agreement (BAA) with every third-party service that processes, stores, or transmits PHI—including cloud providers, analytics tools, and logging services.
|
|
15
|
-
- Never log PHI in application logs, error messages, or stack traces. Use tokenized or surrogate identifiers in logs and map them back to PHI only through a secured, audited lookup service.
|
|
16
|
-
- Implement automatic session timeout (≤ 15 minutes of inactivity) for any interface displaying PHI. Require re-authentication to resume.
|
|
17
|
-
|
|
18
|
-
- id: audit-logging
|
|
19
|
-
tier: recommended
|
|
20
|
-
title: "Audit Logging & Access Tracking"
|
|
21
|
-
content: |
|
|
22
|
-
## Audit Logging & Accountability
|
|
23
|
-
|
|
24
|
-
- Log every access to PHI: who accessed it, when, what data was viewed or modified, from which IP/device, and the business justification (if applicable).
|
|
25
|
-
- Store audit logs in an append-only, tamper-evident store separate from application databases. Retain logs for a minimum of 6 years per HIPAA requirements.
|
|
26
|
-
- Generate automated audit reports for compliance reviews. Include access frequency per user, unusual access patterns, and after-hours access events.
|
|
27
|
-
- Implement real-time alerting for suspicious access patterns: bulk record access, access outside normal role scope, or access to VIP/employee records.
|
|
28
|
-
- Include a unique correlation ID in every request that touches PHI, so a single patient interaction can be traced across all microservices and data stores.
|
|
29
|
-
- Conduct periodic access reviews where data stewards verify that each user's access level is still appropriate for their current role.
|
|
30
|
-
|
|
31
|
-
- id: consent-management
|
|
32
|
-
tier: recommended
|
|
33
|
-
title: "Consent & Data Governance"
|
|
34
|
-
content: |
|
|
35
|
-
## Consent Management & Data Governance
|
|
36
|
-
|
|
37
|
-
- Model patient consent as a first-class entity with versioned consent records, effective dates, scope (which data, which purposes), and revocation timestamps.
|
|
38
|
-
- Enforce consent at the data access layer, not just the UI. Before any query returns PHI, verify that a valid, non-revoked consent exists for the requested purpose.
|
|
39
|
-
- Support granular consent: patients may consent to treatment data sharing but not to research use. The system must enforce these distinctions consistently.
|
|
40
|
-
- Implement a data retention policy engine that automatically de-identifies or purges records when the retention period expires or consent is revoked.
|
|
41
|
-
- Provide patients with a self-service portal to view who has accessed their data, download their records (in standard formats like FHIR/C-CDA), and update consent preferences.
|
|
42
|
-
- Use HL7 FHIR as the interoperability standard for data exchange. Validate all inbound and outbound FHIR resources against the relevant profiles.
|
|
1
|
+
tag: HEALTHCARE
|
|
2
|
+
section: instructions
|
|
3
|
+
blocks:
|
|
4
|
+
- id: hipaa-compliance
|
|
5
|
+
tier: recommended
|
|
6
|
+
title: "HIPAA Compliance & PHI Handling"
|
|
7
|
+
content: |
|
|
8
|
+
## HIPAA Compliance & Protected Health Information
|
|
9
|
+
|
|
10
|
+
- Classify all data fields at design time. Identify the 18 HIPAA identifiers and ensure any field containing PHI is tagged, encrypted, and access-controlled.
|
|
11
|
+
- Apply the minimum necessary principle: every API endpoint, database query, and UI view must expose only the PHI fields required for the specific use case.
|
|
12
|
+
- Encrypt PHI at rest (AES-256) and in transit (TLS 1.2+). Use envelope encryption with a KMS for key management; never store encryption keys alongside data.
|
|
13
|
+
- Implement role-based access control (RBAC) with the principle of least privilege. Map roles to specific PHI access levels and review permissions quarterly.
|
|
14
|
+
- Maintain a Business Associate Agreement (BAA) with every third-party service that processes, stores, or transmits PHI—including cloud providers, analytics tools, and logging services.
|
|
15
|
+
- Never log PHI in application logs, error messages, or stack traces. Use tokenized or surrogate identifiers in logs and map them back to PHI only through a secured, audited lookup service.
|
|
16
|
+
- Implement automatic session timeout (≤ 15 minutes of inactivity) for any interface displaying PHI. Require re-authentication to resume.
|
|
17
|
+
|
|
18
|
+
- id: audit-logging
|
|
19
|
+
tier: recommended
|
|
20
|
+
title: "Audit Logging & Access Tracking"
|
|
21
|
+
content: |
|
|
22
|
+
## Audit Logging & Accountability
|
|
23
|
+
|
|
24
|
+
- Log every access to PHI: who accessed it, when, what data was viewed or modified, from which IP/device, and the business justification (if applicable).
|
|
25
|
+
- Store audit logs in an append-only, tamper-evident store separate from application databases. Retain logs for a minimum of 6 years per HIPAA requirements.
|
|
26
|
+
- Generate automated audit reports for compliance reviews. Include access frequency per user, unusual access patterns, and after-hours access events.
|
|
27
|
+
- Implement real-time alerting for suspicious access patterns: bulk record access, access outside normal role scope, or access to VIP/employee records.
|
|
28
|
+
- Include a unique correlation ID in every request that touches PHI, so a single patient interaction can be traced across all microservices and data stores.
|
|
29
|
+
- Conduct periodic access reviews where data stewards verify that each user's access level is still appropriate for their current role.
|
|
30
|
+
|
|
31
|
+
- id: consent-management
|
|
32
|
+
tier: recommended
|
|
33
|
+
title: "Consent & Data Governance"
|
|
34
|
+
content: |
|
|
35
|
+
## Consent Management & Data Governance
|
|
36
|
+
|
|
37
|
+
- Model patient consent as a first-class entity with versioned consent records, effective dates, scope (which data, which purposes), and revocation timestamps.
|
|
38
|
+
- Enforce consent at the data access layer, not just the UI. Before any query returns PHI, verify that a valid, non-revoked consent exists for the requested purpose.
|
|
39
|
+
- Support granular consent: patients may consent to treatment data sharing but not to research use. The system must enforce these distinctions consistently.
|
|
40
|
+
- Implement a data retention policy engine that automatically de-identifies or purges records when the retention period expires or consent is revoked.
|
|
41
|
+
- Provide patients with a self-service portal to view who has accessed their data, download their records (in standard formats like FHIR/C-CDA), and update consent preferences.
|
|
42
|
+
- Use HL7 FHIR as the interoperability standard for data exchange. Validate all inbound and outbound FHIR resources against the relevant profiles.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
tag: HEALTHCARE
|
|
2
|
-
section: mcp-servers
|
|
3
|
-
servers:
|
|
4
|
-
- name: postgres
|
|
5
|
-
description: "PostgreSQL database inspection, queries, and schema management — common backend for EHR/clinical data"
|
|
6
|
-
command: npx
|
|
7
|
-
args: ["-y", "@modelcontextprotocol/server-postgres"]
|
|
8
|
-
tags: [DATA-PIPELINE, API, HEALTHCARE]
|
|
9
|
-
category: database
|
|
10
|
-
tier: recommended
|
|
11
|
-
env:
|
|
12
|
-
POSTGRES_CONNECTION_STRING: ""
|
|
13
|
-
url: "https://github.com/modelcontextprotocol/servers/tree/main/src/postgres"
|
|
1
|
+
tag: HEALTHCARE
|
|
2
|
+
section: mcp-servers
|
|
3
|
+
servers:
|
|
4
|
+
- name: postgres
|
|
5
|
+
description: "PostgreSQL database inspection, queries, and schema management — common backend for EHR/clinical data"
|
|
6
|
+
command: npx
|
|
7
|
+
args: ["-y", "@modelcontextprotocol/server-postgres"]
|
|
8
|
+
tags: [DATA-PIPELINE, API, HEALTHCARE]
|
|
9
|
+
category: database
|
|
10
|
+
tier: recommended
|
|
11
|
+
env:
|
|
12
|
+
POSTGRES_CONNECTION_STRING: ""
|
|
13
|
+
url: "https://github.com/modelcontextprotocol/servers/tree/main/src/postgres"
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
tag: HEALTHCARE
|
|
2
|
-
section: nfr
|
|
3
|
-
blocks:
|
|
4
|
-
- id: hipaa-requirements
|
|
5
|
-
tier: recommended
|
|
6
|
-
title: "HIPAA Technical Requirements"
|
|
7
|
-
content: |
|
|
8
|
-
## NFR: HIPAA Technical Requirements
|
|
9
|
-
|
|
10
|
-
### Data Protection
|
|
11
|
-
- PHI (Protected Health Information) encrypted at rest (AES-256) and in transit (TLS 1.2+).
|
|
12
|
-
- PHI access requires authentication + authorization + audit log entry.
|
|
13
|
-
- Database columns containing PHI tagged and documented in data dictionary.
|
|
14
|
-
- PHI never appears in logs, error messages, URLs, or analytics events.
|
|
15
|
-
|
|
16
|
-
### Access Control
|
|
17
|
-
- Role-based access: minimum necessary access for each role.
|
|
18
|
-
- Break-glass emergency access with mandatory post-access review.
|
|
19
|
-
- Session timeout: {{session_timeout | default: 15 minutes}} of inactivity for PHI-accessible sessions.
|
|
20
|
-
- Access audit reviewed {{access_review_frequency | default: monthly}}.
|
|
21
|
-
|
|
22
|
-
### Audit
|
|
23
|
-
- All PHI access logged: WHO accessed WHAT data, WHEN, from WHERE, for what PURPOSE.
|
|
24
|
-
- Audit logs immutable, retained for minimum {{hipaa_audit_retention | default: 6 years}}.
|
|
25
|
-
- Audit log integrity verified (checksums, append-only storage).
|
|
26
|
-
- Anomaly detection on access patterns (unusual hours, volume, or scope).
|
|
27
|
-
|
|
28
|
-
- id: hipaa-operational
|
|
29
|
-
tier: recommended
|
|
30
|
-
title: "HIPAA Operational Requirements"
|
|
31
|
-
content: |
|
|
32
|
-
## NFR: HIPAA Operational
|
|
33
|
-
|
|
34
|
-
### Business Associate Agreements
|
|
35
|
-
- BAA in place with every vendor that touches PHI (cloud provider, analytics, logging).
|
|
36
|
-
- Vendor compliance status tracked and reviewed annually.
|
|
37
|
-
|
|
38
|
-
### Incident Response
|
|
39
|
-
- Breach notification process documented. HIPAA requires notification within 60 days.
|
|
40
|
-
- Incident response team identified. Contact list current.
|
|
41
|
-
- Breach detection mechanisms: anomalous access patterns, data exfiltration monitoring.
|
|
42
|
-
|
|
43
|
-
### Backup & Recovery
|
|
44
|
-
- PHI backups encrypted, stored in HIPAA-compliant storage.
|
|
45
|
-
- RPO: < {{healthcare_rpo | default: 1 hour}}. RTO: < {{healthcare_rto | default: 4 hours}}.
|
|
46
|
-
- Backup restoration tested quarterly. Results documented.
|
|
47
|
-
- Data retention and destruction policies per HIPAA requirements.
|
|
1
|
+
tag: HEALTHCARE
|
|
2
|
+
section: nfr
|
|
3
|
+
blocks:
|
|
4
|
+
- id: hipaa-requirements
|
|
5
|
+
tier: recommended
|
|
6
|
+
title: "HIPAA Technical Requirements"
|
|
7
|
+
content: |
|
|
8
|
+
## NFR: HIPAA Technical Requirements
|
|
9
|
+
|
|
10
|
+
### Data Protection
|
|
11
|
+
- PHI (Protected Health Information) encrypted at rest (AES-256) and in transit (TLS 1.2+).
|
|
12
|
+
- PHI access requires authentication + authorization + audit log entry.
|
|
13
|
+
- Database columns containing PHI tagged and documented in data dictionary.
|
|
14
|
+
- PHI never appears in logs, error messages, URLs, or analytics events.
|
|
15
|
+
|
|
16
|
+
### Access Control
|
|
17
|
+
- Role-based access: minimum necessary access for each role.
|
|
18
|
+
- Break-glass emergency access with mandatory post-access review.
|
|
19
|
+
- Session timeout: {{session_timeout | default: 15 minutes}} of inactivity for PHI-accessible sessions.
|
|
20
|
+
- Access audit reviewed {{access_review_frequency | default: monthly}}.
|
|
21
|
+
|
|
22
|
+
### Audit
|
|
23
|
+
- All PHI access logged: WHO accessed WHAT data, WHEN, from WHERE, for what PURPOSE.
|
|
24
|
+
- Audit logs immutable, retained for minimum {{hipaa_audit_retention | default: 6 years}}.
|
|
25
|
+
- Audit log integrity verified (checksums, append-only storage).
|
|
26
|
+
- Anomaly detection on access patterns (unusual hours, volume, or scope).
|
|
27
|
+
|
|
28
|
+
- id: hipaa-operational
|
|
29
|
+
tier: recommended
|
|
30
|
+
title: "HIPAA Operational Requirements"
|
|
31
|
+
content: |
|
|
32
|
+
## NFR: HIPAA Operational
|
|
33
|
+
|
|
34
|
+
### Business Associate Agreements
|
|
35
|
+
- BAA in place with every vendor that touches PHI (cloud provider, analytics, logging).
|
|
36
|
+
- Vendor compliance status tracked and reviewed annually.
|
|
37
|
+
|
|
38
|
+
### Incident Response
|
|
39
|
+
- Breach notification process documented. HIPAA requires notification within 60 days.
|
|
40
|
+
- Incident response team identified. Contact list current.
|
|
41
|
+
- Breach detection mechanisms: anomalous access patterns, data exfiltration monitoring.
|
|
42
|
+
|
|
43
|
+
### Backup & Recovery
|
|
44
|
+
- PHI backups encrypted, stored in HIPAA-compliant storage.
|
|
45
|
+
- RPO: < {{healthcare_rpo | default: 1 hour}}. RTO: < {{healthcare_rto | default: 4 hours}}.
|
|
46
|
+
- Backup restoration tested quarterly. Results documented.
|
|
47
|
+
- Data retention and destruction policies per HIPAA requirements.
|