bmad-method 4.27.5 → 5.0.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 (274) hide show
  1. package/.bmad-core/agent-teams/team-all.yml +16 -0
  2. package/.bmad-core/agent-teams/team-fullstack.yml +26 -0
  3. package/.bmad-core/agent-teams/team-no-ui.yml +15 -0
  4. package/{bmad-core → .bmad-core}/agents/analyst.md +23 -30
  5. package/.bmad-core/agents/architect.md +66 -0
  6. package/.bmad-core/agents/bmad-master.md +104 -0
  7. package/.bmad-core/agents/bmad-orchestrator.md +81 -0
  8. package/.bmad-core/agents/dev.md +70 -0
  9. package/{bmad-core → .bmad-core}/agents/pm.md +24 -25
  10. package/{bmad-core → .bmad-core}/agents/po.md +24 -28
  11. package/.bmad-core/agents/qa.md +52 -0
  12. package/.bmad-core/agents/sm.md +55 -0
  13. package/.bmad-core/agents/ux-expert.md +66 -0
  14. package/{bmad-core → .bmad-core}/checklists/change-checklist.md +2 -2
  15. package/{bmad-core → .bmad-core}/checklists/story-draft-checklist.md +1 -1
  16. package/.bmad-core/data/bmad-kb.md +47 -0
  17. package/.bmad-core/schemas/agent-team-schema.yml +153 -0
  18. package/.bmad-core/tasks/advanced-elicitation.md +92 -0
  19. package/.bmad-core/tasks/brainstorming-techniques.md +238 -0
  20. package/.bmad-core/tasks/core-dump.md +74 -0
  21. package/{expansion-packs/bmad-creator-tools → .bmad-core}/tasks/create-agent.md +11 -9
  22. package/.bmad-core/tasks/create-doc.md +74 -0
  23. package/.bmad-core/tasks/create-expansion-pack.md +425 -0
  24. package/.bmad-core/tasks/create-next-story.md +206 -0
  25. package/.bmad-core/tasks/create-team.md +229 -0
  26. package/{bmad-core → .bmad-core}/tasks/doc-migration-task.md +9 -9
  27. package/{common → .bmad-core}/tasks/execute-checklist.md +6 -2
  28. package/.bmad-core/tasks/generate-ai-frontend-prompt.md +58 -0
  29. package/{bmad-core → .bmad-core}/tasks/index-docs.md +7 -3
  30. package/{bmad-core → .bmad-core}/tasks/shard-doc.md +7 -25
  31. package/.bmad-core/templates/agent-tmpl.md +58 -0
  32. package/.bmad-core/templates/architecture-tmpl.md +771 -0
  33. package/.bmad-core/templates/brownfield-architecture-tmpl.md +542 -0
  34. package/.bmad-core/templates/brownfield-prd-tmpl.md +240 -0
  35. package/.bmad-core/templates/competitor-analysis-tmpl.md +289 -0
  36. package/.bmad-core/templates/expansion-pack-plan-tmpl.md +91 -0
  37. package/.bmad-core/templates/front-end-architecture-tmpl.md +173 -0
  38. package/.bmad-core/templates/front-end-spec-tmpl.md +411 -0
  39. package/.bmad-core/templates/fullstack-architecture-tmpl.md +1016 -0
  40. package/.bmad-core/templates/market-research-tmpl.md +261 -0
  41. package/.bmad-core/templates/prd-tmpl.md +200 -0
  42. package/.bmad-core/templates/project-brief-tmpl.md +228 -0
  43. package/.bmad-core/templates/simple-project-prd-tmpl.md +461 -0
  44. package/.bmad-core/templates/story-tmpl.md +61 -0
  45. package/.bmad-core/templates/web-agent-startup-instructions-template.md +39 -0
  46. package/.bmad-core/utils/agent-switcher.ide.md +112 -0
  47. package/.bmad-core/utils/template-format.md +26 -0
  48. package/.bmad-core/utils/workflow-management.md +224 -0
  49. package/.bmad-core/web-bundles/agents/analyst.txt +1684 -0
  50. package/.bmad-core/web-bundles/agents/architect.txt +3584 -0
  51. package/.bmad-core/web-bundles/agents/bmad-master.txt +9491 -0
  52. package/.bmad-core/web-bundles/agents/bmad-orchestrator.txt +1466 -0
  53. package/{dist → .bmad-core/web-bundles}/agents/dev.txt +71 -179
  54. package/{dist → .bmad-core/web-bundles}/agents/pm.txt +1058 -624
  55. package/{dist → .bmad-core/web-bundles}/agents/po.txt +138 -337
  56. package/.bmad-core/web-bundles/agents/qa.txt +129 -0
  57. package/.bmad-core/web-bundles/agents/sm.txt +658 -0
  58. package/.bmad-core/web-bundles/agents/ux-expert.txt +1099 -0
  59. package/.bmad-core/web-bundles/teams/team-all.txt +10757 -0
  60. package/.bmad-core/web-bundles/teams/team-fullstack.txt +10109 -0
  61. package/.bmad-core/web-bundles/teams/team-no-ui.txt +8950 -0
  62. package/.bmad-core/workflows/brownfield-fullstack.yml +116 -0
  63. package/.bmad-core/workflows/brownfield-service.yml +117 -0
  64. package/.bmad-core/workflows/brownfield-ui.yml +127 -0
  65. package/{bmad-core/workflows/greenfield-fullstack.yaml → .bmad-core/workflows/greenfield-fullstack.yml} +77 -140
  66. package/.bmad-core/workflows/greenfield-service.yml +143 -0
  67. package/.bmad-core/workflows/greenfield-ui.yml +172 -0
  68. package/.claude/commands/analyst.md +63 -0
  69. package/.claude/commands/architect.md +70 -0
  70. package/.claude/commands/bmad-master.md +108 -0
  71. package/.claude/commands/bmad-orchestrator.md +85 -0
  72. package/.claude/commands/dev.md +74 -0
  73. package/.claude/commands/pm.md +63 -0
  74. package/.claude/commands/po.md +64 -0
  75. package/.claude/commands/qa.md +56 -0
  76. package/.claude/commands/sm.md +59 -0
  77. package/.claude/commands/ux-expert.md +70 -0
  78. package/.cursor/rules/analyst.mdc +77 -0
  79. package/.cursor/rules/architect.mdc +84 -0
  80. package/.cursor/rules/bmad-master.mdc +122 -0
  81. package/.cursor/rules/bmad-orchestrator.mdc +99 -0
  82. package/.cursor/rules/dev.mdc +88 -0
  83. package/.cursor/rules/pm.mdc +77 -0
  84. package/.cursor/rules/po.mdc +78 -0
  85. package/.cursor/rules/qa.mdc +70 -0
  86. package/.cursor/rules/sm.mdc +73 -0
  87. package/.cursor/rules/ux-expert.mdc +84 -0
  88. package/.roo/.roomodes +95 -0
  89. package/.roo/README.md +38 -0
  90. package/.vscode/extensions.json +6 -0
  91. package/.vscode/settings.json +75 -49
  92. package/.windsurf/rules/analyst.md +71 -0
  93. package/.windsurf/rules/architect.md +78 -0
  94. package/.windsurf/rules/bmad-master.md +116 -0
  95. package/.windsurf/rules/bmad-orchestrator.md +93 -0
  96. package/.windsurf/rules/dev.md +82 -0
  97. package/.windsurf/rules/pm.md +71 -0
  98. package/.windsurf/rules/po.md +72 -0
  99. package/.windsurf/rules/qa.md +64 -0
  100. package/.windsurf/rules/sm.md +67 -0
  101. package/.windsurf/rules/ux-expert.md +78 -0
  102. package/CHANGELOG.md +16 -452
  103. package/CONTRIBUTING.md +5 -168
  104. package/LICENSE +1 -1
  105. package/README.md +230 -77
  106. package/docs/bmad-workflow-guide.md +15 -19
  107. package/docs/claude-code-guide.md +119 -0
  108. package/docs/cursor-guide.md +127 -0
  109. package/docs/roo-code-guide.md +140 -0
  110. package/docs/sample-output/simple-fullstack-greenfield/prd.md +42 -0
  111. package/docs/versioning-and-releases.md +16 -8
  112. package/docs/versions.md +5 -4
  113. package/docs/windsurf-guide.md +127 -0
  114. package/expansion-packs/README.md +112 -2
  115. package/expansion-packs/{bmad-infrastructure-devops → infrastructure-devops}/README.md +9 -9
  116. package/expansion-packs/{bmad-infrastructure-devops → infrastructure-devops}/agents/infra-devops-platform.md +15 -15
  117. package/expansion-packs/{bmad-infrastructure-devops → infrastructure-devops}/checklists/infrastructure-checklist.md +1 -1
  118. package/expansion-packs/infrastructure-devops/manifest.yml +38 -0
  119. package/expansion-packs/{bmad-infrastructure-devops → infrastructure-devops}/tasks/review-infrastructure.md +4 -4
  120. package/expansion-packs/{bmad-infrastructure-devops → infrastructure-devops}/tasks/validate-infrastructure.md +4 -4
  121. package/expansion-packs/infrastructure-devops/templates/infrastructure-architecture-tmpl.md +415 -0
  122. package/expansion-packs/infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.md +0 -0
  123. package/package.json +11 -19
  124. package/tools/bmad-npx-wrapper.js +1 -1
  125. package/tools/builders/web-builder.js +28 -563
  126. package/tools/cli.js +22 -55
  127. package/tools/installer/README.md +53 -3
  128. package/tools/installer/bin/bmad.js +56 -294
  129. package/tools/installer/config/install.config.yml +139 -0
  130. package/tools/installer/lib/config-loader.js +34 -198
  131. package/tools/installer/lib/file-manager.js +5 -123
  132. package/tools/installer/lib/ide-setup.js +189 -545
  133. package/tools/installer/lib/installer.js +55 -1136
  134. package/tools/installer/package-lock.json +3 -3
  135. package/tools/installer/package.json +4 -4
  136. package/tools/installer/templates/claude-commands.md +7 -0
  137. package/tools/installer/templates/cursor-rules.md +22 -0
  138. package/tools/installer/templates/windsurf-rules.md +22 -0
  139. package/tools/lib/dependency-resolver.js +22 -22
  140. package/tools/upgraders/v3-to-v4-upgrader.js +43 -35
  141. package/tools/version-bump.js +1 -1
  142. package/tools/yaml-format.js +2 -2
  143. package/.github/FUNDING.yaml +0 -15
  144. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -32
  145. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -22
  146. package/.prettierignore +0 -21
  147. package/.prettierrc +0 -23
  148. package/bmad-core/agent-teams/team-all.yaml +0 -14
  149. package/bmad-core/agent-teams/team-fullstack.yaml +0 -18
  150. package/bmad-core/agent-teams/team-ide-minimal.yaml +0 -10
  151. package/bmad-core/agent-teams/team-no-ui.yaml +0 -13
  152. package/bmad-core/agents/architect.md +0 -63
  153. package/bmad-core/agents/bmad-master.md +0 -110
  154. package/bmad-core/agents/bmad-orchestrator.md +0 -140
  155. package/bmad-core/agents/dev.md +0 -57
  156. package/bmad-core/agents/qa.md +0 -55
  157. package/bmad-core/agents/sm.md +0 -46
  158. package/bmad-core/agents/ux-expert.md +0 -54
  159. package/bmad-core/core-config.yaml +0 -25
  160. package/bmad-core/data/bmad-kb.md +0 -803
  161. package/bmad-core/data/brainstorming-techniques.md +0 -36
  162. package/bmad-core/data/elicitation-methods.md +0 -134
  163. package/bmad-core/tasks/advanced-elicitation.md +0 -117
  164. package/bmad-core/tasks/create-brownfield-story.md +0 -355
  165. package/bmad-core/tasks/create-next-story.md +0 -114
  166. package/bmad-core/tasks/create-workflow-plan.md +0 -289
  167. package/bmad-core/tasks/document-project.md +0 -317
  168. package/bmad-core/tasks/facilitate-brainstorming-session.md +0 -136
  169. package/bmad-core/tasks/generate-ai-frontend-prompt.md +0 -51
  170. package/bmad-core/tasks/kb-mode-interaction.md +0 -70
  171. package/bmad-core/tasks/review-story.md +0 -145
  172. package/bmad-core/tasks/update-workflow-plan.md +0 -248
  173. package/bmad-core/tasks/validate-next-story.md +0 -134
  174. package/bmad-core/templates/architecture-tmpl.yaml +0 -650
  175. package/bmad-core/templates/brainstorming-output-tmpl.yaml +0 -156
  176. package/bmad-core/templates/brownfield-architecture-tmpl.yaml +0 -476
  177. package/bmad-core/templates/brownfield-prd-tmpl.yaml +0 -280
  178. package/bmad-core/templates/competitor-analysis-tmpl.yaml +0 -293
  179. package/bmad-core/templates/front-end-architecture-tmpl.yaml +0 -206
  180. package/bmad-core/templates/front-end-spec-tmpl.yaml +0 -349
  181. package/bmad-core/templates/fullstack-architecture-tmpl.yaml +0 -805
  182. package/bmad-core/templates/market-research-tmpl.yaml +0 -252
  183. package/bmad-core/templates/prd-tmpl.yaml +0 -202
  184. package/bmad-core/templates/project-brief-tmpl.yaml +0 -221
  185. package/bmad-core/templates/story-tmpl.yaml +0 -137
  186. package/bmad-core/utils/plan-management.md +0 -219
  187. package/bmad-core/workflows/brownfield-fullstack.yaml +0 -297
  188. package/bmad-core/workflows/brownfield-service.yaml +0 -187
  189. package/bmad-core/workflows/brownfield-ui.yaml +0 -197
  190. package/bmad-core/workflows/greenfield-service.yaml +0 -206
  191. package/bmad-core/workflows/greenfield-ui.yaml +0 -235
  192. package/common/tasks/create-doc.md +0 -79
  193. package/common/utils/bmad-doc-template.md +0 -325
  194. package/common/utils/workflow-management.md +0 -69
  195. package/dist/agents/analyst.txt +0 -2849
  196. package/dist/agents/architect.txt +0 -3505
  197. package/dist/agents/bmad-master.txt +0 -9588
  198. package/dist/agents/bmad-orchestrator.txt +0 -2232
  199. package/dist/agents/qa.txt +0 -388
  200. package/dist/agents/sm.txt +0 -673
  201. package/dist/agents/ux-expert.txt +0 -987
  202. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +0 -2401
  203. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +0 -1635
  204. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +0 -825
  205. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +0 -11730
  206. package/dist/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.txt +0 -2023
  207. package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +0 -2052
  208. package/dist/teams/team-all.txt +0 -11799
  209. package/dist/teams/team-fullstack.txt +0 -11129
  210. package/dist/teams/team-ide-minimal.txt +0 -4573
  211. package/dist/teams/team-no-ui.txt +0 -9684
  212. package/docs/GUIDING-PRINCIPLES.md +0 -91
  213. package/docs/agentic-tools/claude-code-guide.md +0 -19
  214. package/docs/agentic-tools/cline-guide.md +0 -16
  215. package/docs/agentic-tools/cursor-guide.md +0 -14
  216. package/docs/agentic-tools/gemini-cli-guide.md +0 -32
  217. package/docs/agentic-tools/github-copilot-guide.md +0 -42
  218. package/docs/agentic-tools/roo-code-guide.md +0 -15
  219. package/docs/agentic-tools/trae-guide.md +0 -14
  220. package/docs/agentic-tools/windsurf-guide.md +0 -14
  221. package/docs/core-architecture.md +0 -219
  222. package/docs/expansion-packs.md +0 -280
  223. package/docs/how-to-contribute-with-pull-requests.md +0 -158
  224. package/docs/template-markup-references.md +0 -86
  225. package/docs/user-guide.md +0 -1142
  226. package/docs/working-in-the-brownfield.md +0 -361
  227. package/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml +0 -13
  228. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +0 -60
  229. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +0 -68
  230. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +0 -53
  231. package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-design-checklist.md +0 -201
  232. package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md +0 -160
  233. package/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +0 -7
  234. package/expansion-packs/bmad-2d-phaser-game-dev/data/bmad-kb.md +0 -254
  235. package/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +0 -651
  236. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md +0 -111
  237. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/create-game-story.md +0 -216
  238. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/game-design-brainstorming.md +0 -308
  239. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +0 -613
  240. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +0 -356
  241. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +0 -343
  242. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +0 -253
  243. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +0 -484
  244. package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml +0 -183
  245. package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml +0 -175
  246. package/expansion-packs/bmad-creator-tools/README.md +0 -8
  247. package/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.md +0 -55
  248. package/expansion-packs/bmad-creator-tools/config.yaml +0 -5
  249. package/expansion-packs/bmad-creator-tools/tasks/generate-expansion-pack.md +0 -1020
  250. package/expansion-packs/bmad-creator-tools/templates/agent-teams-tmpl.yaml +0 -178
  251. package/expansion-packs/bmad-creator-tools/templates/agent-tmpl.yaml +0 -154
  252. package/expansion-packs/bmad-creator-tools/templates/expansion-pack-plan-tmpl.yaml +0 -120
  253. package/expansion-packs/bmad-infrastructure-devops/config.yaml +0 -8
  254. package/expansion-packs/bmad-infrastructure-devops/data/bmad-kb.md +0 -308
  255. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +0 -424
  256. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +0 -629
  257. package/tools/bump-all-versions.js +0 -107
  258. package/tools/bump-core-version.js +0 -57
  259. package/tools/bump-expansion-version.js +0 -78
  260. package/tools/installer/config/ide-agent-config.yaml +0 -58
  261. package/tools/installer/config/install.config.yaml +0 -91
  262. package/tools/lib/yaml-utils.js +0 -29
  263. package/tools/md-assets/web-agent-startup-instructions.md +0 -39
  264. package/tools/update-expansion-version.js +0 -54
  265. /package/{bmad-core → .bmad-core}/checklists/architect-checklist.md +0 -0
  266. /package/{bmad-core → .bmad-core}/checklists/pm-checklist.md +0 -0
  267. /package/{bmad-core → .bmad-core}/checklists/po-master-checklist.md +0 -0
  268. /package/{bmad-core → .bmad-core}/checklists/story-dod-checklist.md +0 -0
  269. /package/{bmad-core → .bmad-core}/data/technical-preferences.md +0 -0
  270. /package/{bmad-core → .bmad-core}/tasks/brownfield-create-epic.md +0 -0
  271. /package/{bmad-core → .bmad-core}/tasks/brownfield-create-story.md +0 -0
  272. /package/{bmad-core → .bmad-core}/tasks/correct-course.md +0 -0
  273. /package/{bmad-core → .bmad-core}/tasks/create-deep-research-prompt.md +0 -0
  274. /package/.github/workflows/{release.yaml → release.yml} +0 -0
@@ -1,1635 +0,0 @@
1
- # Web Agent Bundle Instructions
2
-
3
- You are now operating as a specialized AI agent from the BMad-Method framework. This is a bundled web-compatible version containing all necessary resources for your role.
4
-
5
- ## Important Instructions
6
-
7
- 1. **Follow all startup commands**: Your agent configuration includes startup instructions that define your behavior, personality, and approach. These MUST be followed exactly.
8
-
9
- 2. **Resource Navigation**: This bundle contains all resources you need. Resources are marked with tags like:
10
-
11
- - `==================== START: .bmad-2d-phaser-game-dev/folder/filename.md ====================`
12
- - `==================== END: .bmad-2d-phaser-game-dev/folder/filename.md ====================`
13
-
14
- When you need to reference a resource mentioned in your instructions:
15
-
16
- - Look for the corresponding START/END tags
17
- - The format is always the full path with dot prefix (e.g., `.bmad-2d-phaser-game-dev/personas/analyst.md`, `.bmad-2d-phaser-game-dev/tasks/create-story.md`)
18
- - If a section is specified (e.g., `{root}/tasks/create-story.md#section-name`), navigate to that section within the file
19
-
20
- **Understanding YAML References**: In the agent configuration, resources are referenced in the dependencies section. For example:
21
-
22
- ```yaml
23
- dependencies:
24
- utils:
25
- - template-format
26
- tasks:
27
- - create-story
28
- ```
29
-
30
- These references map directly to bundle sections:
31
-
32
- - `utils: template-format` → Look for `==================== START: .bmad-2d-phaser-game-dev/utils/template-format.md ====================`
33
- - `tasks: create-story` → Look for `==================== START: .bmad-2d-phaser-game-dev/tasks/create-story.md ====================`
34
-
35
- 3. **Execution Context**: You are operating in a web environment. All your capabilities and knowledge are contained within this bundle. Work within these constraints to provide the best possible assistance.
36
-
37
- 4. **Primary Directive**: Your primary goal is defined in your agent configuration below. Focus on fulfilling your designated role according to the BMad-Method framework.
38
-
39
- ---
40
-
41
-
42
- ==================== START: .bmad-2d-phaser-game-dev/agents/game-developer.md ====================
43
- # game-developer
44
-
45
- CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:
46
-
47
- ```yaml
48
- activation-instructions:
49
- - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
50
- - Only read the files/tasks listed here when user selects them for execution to minimize context usage
51
- - The customization field ALWAYS takes precedence over any conflicting instructions
52
- - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute
53
- - Greet the user with your name and role, and inform of the *help command
54
- - Load development guidelines to ensure consistent coding standards
55
- - Wait for user to specify story or ask for story selection
56
- - Only load specific story files when user requests implementation
57
- agent:
58
- name: Maya
59
- id: game-developer
60
- title: Game Developer (Phaser 3 & TypeScript)
61
- icon: 👾
62
- whenToUse: Use for Phaser 3 implementation, game story development, technical architecture, and code implementation
63
- customization: null
64
- persona:
65
- role: Expert Game Developer & Implementation Specialist
66
- style: Pragmatic, performance-focused, detail-oriented, test-driven
67
- identity: Technical expert who transforms game designs into working, optimized Phaser 3 applications
68
- focus: Story-driven development using game design documents and architecture specifications
69
- core_principles:
70
- - Story-Centric Development - Game stories contain ALL implementation details needed
71
- - Performance Excellence - Target 60 FPS on all supported platforms
72
- - TypeScript Strict - Type safety prevents runtime errors
73
- - Component Architecture - Modular, reusable, testable game systems
74
- - Cross-Platform Optimization - Works seamlessly on desktop and mobile
75
- - Test-Driven Quality - Comprehensive testing of game logic and systems
76
- - Numbered Options Protocol - Always use numbered lists for user selections
77
- commands:
78
- - '*help" - Show numbered list of available commands for selection'
79
- - '*chat-mode" - Conversational mode for technical advice'
80
- - '*create" - Show numbered list of documents I can create (from templates below)'
81
- - '*run-tests" - Execute game-specific linting and tests'
82
- - '*lint" - Run linting only'
83
- - '*status" - Show current story progress'
84
- - '*complete-story" - Finalize story implementation'
85
- - '*guidelines" - Review development guidelines and coding standards'
86
- - '*exit" - Say goodbye as the Game Developer, and then abandon inhabiting this persona'
87
- task-execution:
88
- flow: Read story → Implement game feature → Write tests → Pass tests → Update [x] → Next task
89
- updates-ONLY:
90
- - 'Checkboxes: [ ] not started | [-] in progress | [x] complete'
91
- - 'Debug Log: | Task | File | Change | Reverted? |'
92
- - 'Completion Notes: Deviations only, <50 words'
93
- - 'Change Log: Requirement changes only'
94
- blocking: Unapproved deps | Ambiguous after story check | 3 failures | Missing game config
95
- done: Game feature works + Tests pass + 60 FPS + No lint errors + Follows Phaser 3 best practices
96
- dependencies:
97
- tasks:
98
- - execute-checklist.md
99
- templates:
100
- - game-architecture-tmpl.yaml
101
- checklists:
102
- - game-story-dod-checklist.md
103
- data:
104
- - development-guidelines.md
105
- ```
106
- ==================== END: .bmad-2d-phaser-game-dev/agents/game-developer.md ====================
107
-
108
- ==================== START: .bmad-2d-phaser-game-dev/tasks/execute-checklist.md ====================
109
- # Checklist Validation Task
110
-
111
- This task provides instructions for validating documentation against checklists. The agent MUST follow these instructions to ensure thorough and systematic validation of documents.
112
-
113
- ## Available Checklists
114
-
115
- If the user asks or does not specify a specific checklist, list the checklists available to the agent persona. If the task is being run not with a specific agent, tell the user to check the .bmad-2d-phaser-game-dev/checklists folder to select the appropriate one to run.
116
-
117
- ## Instructions
118
-
119
- 1. **Initial Assessment**
120
-
121
- - If user or the task being run provides a checklist name:
122
- - Try fuzzy matching (e.g. "architecture checklist" -> "architect-checklist")
123
- - If multiple matches found, ask user to clarify
124
- - Load the appropriate checklist from .bmad-2d-phaser-game-dev/checklists/
125
- - If no checklist specified:
126
- - Ask the user which checklist they want to use
127
- - Present the available options from the files in the checklists folder
128
- - Confirm if they want to work through the checklist:
129
- - Section by section (interactive mode - very time consuming)
130
- - All at once (YOLO mode - recommended for checklists, there will be a summary of sections at the end to discuss)
131
-
132
- 2. **Document and Artifact Gathering**
133
-
134
- - Each checklist will specify its required documents/artifacts at the beginning
135
- - Follow the checklist's specific instructions for what to gather, generally a file can be resolved in the docs folder, if not or unsure, halt and ask or confirm with the user.
136
-
137
- 3. **Checklist Processing**
138
-
139
- If in interactive mode:
140
-
141
- - Work through each section of the checklist one at a time
142
- - For each section:
143
- - Review all items in the section following instructions for that section embedded in the checklist
144
- - Check each item against the relevant documentation or artifacts as appropriate
145
- - Present summary of findings for that section, highlighting warnings, errors and non applicable items (rationale for non-applicability).
146
- - Get user confirmation before proceeding to next section or if any thing major do we need to halt and take corrective action
147
-
148
- If in YOLO mode:
149
-
150
- - Process all sections at once
151
- - Create a comprehensive report of all findings
152
- - Present the complete analysis to the user
153
-
154
- 4. **Validation Approach**
155
-
156
- For each checklist item:
157
-
158
- - Read and understand the requirement
159
- - Look for evidence in the documentation that satisfies the requirement
160
- - Consider both explicit mentions and implicit coverage
161
- - Aside from this, follow all checklist llm instructions
162
- - Mark items as:
163
- - ✅ PASS: Requirement clearly met
164
- - ❌ FAIL: Requirement not met or insufficient coverage
165
- - ⚠️ PARTIAL: Some aspects covered but needs improvement
166
- - N/A: Not applicable to this case
167
-
168
- 5. **Section Analysis**
169
-
170
- For each section:
171
-
172
- - think step by step to calculate pass rate
173
- - Identify common themes in failed items
174
- - Provide specific recommendations for improvement
175
- - In interactive mode, discuss findings with user
176
- - Document any user decisions or explanations
177
-
178
- 6. **Final Report**
179
-
180
- Prepare a summary that includes:
181
-
182
- - Overall checklist completion status
183
- - Pass rates by section
184
- - List of failed items with context
185
- - Specific recommendations for improvement
186
- - Any sections or items marked as N/A with justification
187
-
188
- ## Checklist Execution Methodology
189
-
190
- Each checklist now contains embedded LLM prompts and instructions that will:
191
-
192
- 1. **Guide thorough thinking** - Prompts ensure deep analysis of each section
193
- 2. **Request specific artifacts** - Clear instructions on what documents/access is needed
194
- 3. **Provide contextual guidance** - Section-specific prompts for better validation
195
- 4. **Generate comprehensive reports** - Final summary with detailed findings
196
-
197
- The LLM will:
198
-
199
- - Execute the complete checklist validation
200
- - Present a final report with pass/fail rates and key findings
201
- - Offer to provide detailed analysis of any section, especially those with warnings or failures
202
- ==================== END: .bmad-2d-phaser-game-dev/tasks/execute-checklist.md ====================
203
-
204
- ==================== START: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml ====================
205
- template:
206
- id: game-architecture-template-v2
207
- name: Game Architecture Document
208
- version: 2.0
209
- output:
210
- format: markdown
211
- filename: "docs/{{game_name}}-game-architecture.md"
212
- title: "{{game_title}} Game Architecture Document"
213
-
214
- workflow:
215
- mode: interactive
216
-
217
- sections:
218
- - id: initial-setup
219
- instruction: |
220
- This template creates a comprehensive game architecture document specifically for Phaser 3 + TypeScript projects. This should provide the technical foundation for all game development stories and epics.
221
-
222
- If available, review any provided documents: Game Design Document (GDD), Technical Preferences. This architecture should support all game mechanics defined in the GDD.
223
-
224
- - id: introduction
225
- title: Introduction
226
- instruction: Establish the document's purpose and scope for game development
227
- content: |
228
- This document outlines the complete technical architecture for {{game_title}}, a 2D game built with Phaser 3 and TypeScript. It serves as the technical foundation for AI-driven game development, ensuring consistency and scalability across all game systems.
229
-
230
- This architecture is designed to support the gameplay mechanics defined in the Game Design Document while maintaining 60 FPS performance and cross-platform compatibility.
231
- sections:
232
- - id: change-log
233
- title: Change Log
234
- instruction: Track document versions and changes
235
- type: table
236
- template: |
237
- | Date | Version | Description | Author |
238
- | :--- | :------ | :---------- | :----- |
239
-
240
- - id: technical-overview
241
- title: Technical Overview
242
- instruction: Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section.
243
- sections:
244
- - id: architecture-summary
245
- title: Architecture Summary
246
- instruction: |
247
- Provide a comprehensive overview covering:
248
-
249
- - Game engine choice and configuration
250
- - Project structure and organization
251
- - Key systems and their interactions
252
- - Performance and optimization strategy
253
- - How this architecture achieves GDD requirements
254
- - id: platform-targets
255
- title: Platform Targets
256
- instruction: Based on GDD requirements, confirm platform support
257
- template: |
258
- **Primary Platform:** {{primary_platform}}
259
- **Secondary Platforms:** {{secondary_platforms}}
260
- **Minimum Requirements:** {{min_specs}}
261
- **Target Performance:** 60 FPS on {{target_device}}
262
- - id: technology-stack
263
- title: Technology Stack
264
- template: |
265
- **Core Engine:** Phaser 3.70+
266
- **Language:** TypeScript 5.0+ (Strict Mode)
267
- **Build Tool:** {{build_tool}} (Webpack/Vite/Parcel)
268
- **Package Manager:** {{package_manager}}
269
- **Testing:** {{test_framework}}
270
- **Deployment:** {{deployment_platform}}
271
-
272
- - id: project-structure
273
- title: Project Structure
274
- instruction: Define the complete project organization that developers will follow
275
- sections:
276
- - id: repository-organization
277
- title: Repository Organization
278
- instruction: Design a clear folder structure for game development
279
- type: code
280
- language: text
281
- template: |
282
- {{game_name}}/
283
- ├── src/
284
- │ ├── scenes/ # Game scenes
285
- │ ├── gameObjects/ # Custom game objects
286
- │ ├── systems/ # Core game systems
287
- │ ├── utils/ # Utility functions
288
- │ ├── types/ # TypeScript type definitions
289
- │ ├── config/ # Game configuration
290
- │ └── main.ts # Entry point
291
- ├── assets/
292
- │ ├── images/ # Sprite assets
293
- │ ├── audio/ # Sound files
294
- │ ├── data/ # JSON data files
295
- │ └── fonts/ # Font files
296
- ├── public/ # Static web assets
297
- ├── tests/ # Test files
298
- ├── docs/ # Documentation
299
- │ ├── stories/ # Development stories
300
- │ └── architecture/ # Technical docs
301
- └── dist/ # Built game files
302
- - id: module-organization
303
- title: Module Organization
304
- instruction: Define how TypeScript modules should be organized
305
- sections:
306
- - id: scene-structure
307
- title: Scene Structure
308
- type: bullet-list
309
- template: |
310
- - Each scene in separate file
311
- - Scene-specific logic contained
312
- - Clear data passing between scenes
313
- - id: game-object-pattern
314
- title: Game Object Pattern
315
- type: bullet-list
316
- template: |
317
- - Component-based architecture
318
- - Reusable game object classes
319
- - Type-safe property definitions
320
- - id: system-architecture
321
- title: System Architecture
322
- type: bullet-list
323
- template: |
324
- - Singleton managers for global systems
325
- - Event-driven communication
326
- - Clear separation of concerns
327
-
328
- - id: core-game-systems
329
- title: Core Game Systems
330
- instruction: Detail each major system that needs to be implemented. Each system should be specific enough for developers to create implementation stories.
331
- sections:
332
- - id: scene-management
333
- title: Scene Management System
334
- template: |
335
- **Purpose:** Handle game flow and scene transitions
336
-
337
- **Key Components:**
338
-
339
- - Scene loading and unloading
340
- - Data passing between scenes
341
- - Transition effects
342
- - Memory management
343
-
344
- **Implementation Requirements:**
345
-
346
- - Preload scene for asset loading
347
- - Menu system with navigation
348
- - Gameplay scenes with state management
349
- - Pause/resume functionality
350
-
351
- **Files to Create:**
352
-
353
- - `src/scenes/BootScene.ts`
354
- - `src/scenes/PreloadScene.ts`
355
- - `src/scenes/MenuScene.ts`
356
- - `src/scenes/GameScene.ts`
357
- - `src/systems/SceneManager.ts`
358
- - id: game-state-management
359
- title: Game State Management
360
- template: |
361
- **Purpose:** Track player progress and game status
362
-
363
- **State Categories:**
364
-
365
- - Player progress (levels, unlocks)
366
- - Game settings (audio, controls)
367
- - Session data (current level, score)
368
- - Persistent data (achievements, statistics)
369
-
370
- **Implementation Requirements:**
371
-
372
- - Save/load system with localStorage
373
- - State validation and error recovery
374
- - Cross-session data persistence
375
- - Settings management
376
-
377
- **Files to Create:**
378
-
379
- - `src/systems/GameState.ts`
380
- - `src/systems/SaveManager.ts`
381
- - `src/types/GameData.ts`
382
- - id: asset-management
383
- title: Asset Management System
384
- template: |
385
- **Purpose:** Efficient loading and management of game assets
386
-
387
- **Asset Categories:**
388
-
389
- - Sprite sheets and animations
390
- - Audio files and music
391
- - Level data and configurations
392
- - UI assets and fonts
393
-
394
- **Implementation Requirements:**
395
-
396
- - Progressive loading strategy
397
- - Asset caching and optimization
398
- - Error handling for failed loads
399
- - Memory management for large assets
400
-
401
- **Files to Create:**
402
-
403
- - `src/systems/AssetManager.ts`
404
- - `src/config/AssetConfig.ts`
405
- - `src/utils/AssetLoader.ts`
406
- - id: input-management
407
- title: Input Management System
408
- template: |
409
- **Purpose:** Handle all player input across platforms
410
-
411
- **Input Types:**
412
-
413
- - Keyboard controls
414
- - Mouse/pointer interaction
415
- - Touch gestures (mobile)
416
- - Gamepad support (optional)
417
-
418
- **Implementation Requirements:**
419
-
420
- - Input mapping and configuration
421
- - Touch-friendly mobile controls
422
- - Input buffering for responsive gameplay
423
- - Customizable control schemes
424
-
425
- **Files to Create:**
426
-
427
- - `src/systems/InputManager.ts`
428
- - `src/utils/TouchControls.ts`
429
- - `src/types/InputTypes.ts`
430
- - id: game-mechanics-systems
431
- title: Game Mechanics Systems
432
- instruction: For each major mechanic defined in the GDD, create a system specification
433
- repeatable: true
434
- sections:
435
- - id: mechanic-system
436
- title: "{{mechanic_name}} System"
437
- template: |
438
- **Purpose:** {{system_purpose}}
439
-
440
- **Core Functionality:**
441
-
442
- - {{feature_1}}
443
- - {{feature_2}}
444
- - {{feature_3}}
445
-
446
- **Dependencies:** {{required_systems}}
447
-
448
- **Performance Considerations:** {{optimization_notes}}
449
-
450
- **Files to Create:**
451
-
452
- - `src/systems/{{system_name}}.ts`
453
- - `src/gameObjects/{{related_object}}.ts`
454
- - `src/types/{{system_types}}.ts`
455
- - id: physics-collision
456
- title: Physics & Collision System
457
- template: |
458
- **Physics Engine:** {{physics_choice}} (Arcade Physics/Matter.js)
459
-
460
- **Collision Categories:**
461
-
462
- - Player collision
463
- - Enemy interactions
464
- - Environmental objects
465
- - Collectibles and items
466
-
467
- **Implementation Requirements:**
468
-
469
- - Optimized collision detection
470
- - Physics body management
471
- - Collision callbacks and events
472
- - Performance monitoring
473
-
474
- **Files to Create:**
475
-
476
- - `src/systems/PhysicsManager.ts`
477
- - `src/utils/CollisionGroups.ts`
478
- - id: audio-system
479
- title: Audio System
480
- template: |
481
- **Audio Requirements:**
482
-
483
- - Background music with looping
484
- - Sound effects for actions
485
- - Audio settings and volume control
486
- - Mobile audio optimization
487
-
488
- **Implementation Features:**
489
-
490
- - Audio sprite management
491
- - Dynamic music system
492
- - Spatial audio (if applicable)
493
- - Audio pooling for performance
494
-
495
- **Files to Create:**
496
-
497
- - `src/systems/AudioManager.ts`
498
- - `src/config/AudioConfig.ts`
499
- - id: ui-system
500
- title: UI System
501
- template: |
502
- **UI Components:**
503
-
504
- - HUD elements (score, health, etc.)
505
- - Menu navigation
506
- - Modal dialogs
507
- - Settings screens
508
-
509
- **Implementation Requirements:**
510
-
511
- - Responsive layout system
512
- - Touch-friendly interface
513
- - Keyboard navigation support
514
- - Animation and transitions
515
-
516
- **Files to Create:**
517
-
518
- - `src/systems/UIManager.ts`
519
- - `src/gameObjects/UI/`
520
- - `src/types/UITypes.ts`
521
-
522
- - id: performance-architecture
523
- title: Performance Architecture
524
- instruction: Define performance requirements and optimization strategies
525
- sections:
526
- - id: performance-targets
527
- title: Performance Targets
528
- template: |
529
- **Frame Rate:** 60 FPS sustained, 30 FPS minimum
530
- **Memory Usage:** <{{memory_limit}}MB total
531
- **Load Times:** <{{initial_load}}s initial, <{{level_load}}s per level
532
- **Battery Optimization:** Reduced updates when not visible
533
- - id: optimization-strategies
534
- title: Optimization Strategies
535
- sections:
536
- - id: object-pooling
537
- title: Object Pooling
538
- type: bullet-list
539
- template: |
540
- - Bullets and projectiles
541
- - Particle effects
542
- - Enemy objects
543
- - UI elements
544
- - id: asset-optimization
545
- title: Asset Optimization
546
- type: bullet-list
547
- template: |
548
- - Texture atlases for sprites
549
- - Audio compression
550
- - Lazy loading for large assets
551
- - Progressive enhancement
552
- - id: rendering-optimization
553
- title: Rendering Optimization
554
- type: bullet-list
555
- template: |
556
- - Sprite batching
557
- - Culling off-screen objects
558
- - Reduced particle counts on mobile
559
- - Texture resolution scaling
560
- - id: optimization-files
561
- title: Files to Create
562
- type: bullet-list
563
- template: |
564
- - `src/utils/ObjectPool.ts`
565
- - `src/utils/PerformanceMonitor.ts`
566
- - `src/config/OptimizationConfig.ts`
567
-
568
- - id: game-configuration
569
- title: Game Configuration
570
- instruction: Define all configurable aspects of the game
571
- sections:
572
- - id: phaser-configuration
573
- title: Phaser Configuration
574
- type: code
575
- language: typescript
576
- template: |
577
- // src/config/GameConfig.ts
578
- const gameConfig: Phaser.Types.Core.GameConfig = {
579
- type: Phaser.AUTO,
580
- width: {{game_width}},
581
- height: {{game_height}},
582
- scale: {
583
- mode: {{scale_mode}},
584
- autoCenter: Phaser.Scale.CENTER_BOTH
585
- },
586
- physics: {
587
- default: '{{physics_system}}',
588
- {{physics_system}}: {
589
- gravity: { y: {{gravity}} },
590
- debug: false
591
- }
592
- },
593
- // Additional configuration...
594
- };
595
- - id: game-balance-configuration
596
- title: Game Balance Configuration
597
- instruction: Based on GDD, define configurable game parameters
598
- type: code
599
- language: typescript
600
- template: |
601
- // src/config/GameBalance.ts
602
- export const GameBalance = {
603
- player: {
604
- speed: {{player_speed}},
605
- health: {{player_health}},
606
- // Additional player parameters...
607
- },
608
- difficulty: {
609
- easy: {{easy_params}},
610
- normal: {{normal_params}},
611
- hard: {{hard_params}}
612
- },
613
- // Additional balance parameters...
614
- };
615
-
616
- - id: development-guidelines
617
- title: Development Guidelines
618
- instruction: Provide coding standards specific to game development
619
- sections:
620
- - id: typescript-standards
621
- title: TypeScript Standards
622
- sections:
623
- - id: type-safety
624
- title: Type Safety
625
- type: bullet-list
626
- template: |
627
- - Use strict mode
628
- - Define interfaces for all data structures
629
- - Avoid `any` type usage
630
- - Use enums for game states
631
- - id: code-organization
632
- title: Code Organization
633
- type: bullet-list
634
- template: |
635
- - One class per file
636
- - Clear naming conventions
637
- - Proper error handling
638
- - Comprehensive documentation
639
- - id: phaser-best-practices
640
- title: Phaser 3 Best Practices
641
- sections:
642
- - id: scene-management-practices
643
- title: Scene Management
644
- type: bullet-list
645
- template: |
646
- - Clean up resources in shutdown()
647
- - Use scene data for communication
648
- - Implement proper event handling
649
- - Avoid memory leaks
650
- - id: game-object-design
651
- title: Game Object Design
652
- type: bullet-list
653
- template: |
654
- - Extend Phaser classes appropriately
655
- - Use component-based architecture
656
- - Implement object pooling where needed
657
- - Follow consistent update patterns
658
- - id: testing-strategy
659
- title: Testing Strategy
660
- sections:
661
- - id: unit-testing
662
- title: Unit Testing
663
- type: bullet-list
664
- template: |
665
- - Test game logic separately from Phaser
666
- - Mock Phaser dependencies
667
- - Test utility functions
668
- - Validate game balance calculations
669
- - id: integration-testing
670
- title: Integration Testing
671
- type: bullet-list
672
- template: |
673
- - Scene loading and transitions
674
- - Save/load functionality
675
- - Input handling
676
- - Performance benchmarks
677
- - id: test-files
678
- title: Files to Create
679
- type: bullet-list
680
- template: |
681
- - `tests/utils/GameLogic.test.ts`
682
- - `tests/systems/SaveManager.test.ts`
683
- - `tests/performance/FrameRate.test.ts`
684
-
685
- - id: deployment-architecture
686
- title: Deployment Architecture
687
- instruction: Define how the game will be built and deployed
688
- sections:
689
- - id: build-process
690
- title: Build Process
691
- sections:
692
- - id: development-build
693
- title: Development Build
694
- type: bullet-list
695
- template: |
696
- - Fast compilation
697
- - Source maps enabled
698
- - Debug logging active
699
- - Hot reload support
700
- - id: production-build
701
- title: Production Build
702
- type: bullet-list
703
- template: |
704
- - Minified and optimized
705
- - Asset compression
706
- - Performance monitoring
707
- - Error tracking
708
- - id: deployment-strategy
709
- title: Deployment Strategy
710
- sections:
711
- - id: web-deployment
712
- title: Web Deployment
713
- type: bullet-list
714
- template: |
715
- - Static hosting ({{hosting_platform}})
716
- - CDN for assets
717
- - Progressive loading
718
- - Browser compatibility
719
- - id: mobile-packaging
720
- title: Mobile Packaging
721
- type: bullet-list
722
- template: |
723
- - Cordova/Capacitor wrapper
724
- - Platform-specific optimization
725
- - App store requirements
726
- - Performance testing
727
-
728
- - id: implementation-roadmap
729
- title: Implementation Roadmap
730
- instruction: Break down the architecture implementation into phases that align with the GDD development phases
731
- sections:
732
- - id: phase-1-foundation
733
- title: "Phase 1: Foundation ({{duration}})"
734
- sections:
735
- - id: phase-1-core
736
- title: Core Systems
737
- type: bullet-list
738
- template: |
739
- - Project setup and configuration
740
- - Basic scene management
741
- - Asset loading pipeline
742
- - Input handling framework
743
- - id: phase-1-epics
744
- title: Story Epics
745
- type: bullet-list
746
- template: |
747
- - "Engine Setup and Configuration"
748
- - "Basic Scene Management System"
749
- - "Asset Loading Foundation"
750
- - id: phase-2-game-systems
751
- title: "Phase 2: Game Systems ({{duration}})"
752
- sections:
753
- - id: phase-2-gameplay
754
- title: Gameplay Systems
755
- type: bullet-list
756
- template: |
757
- - {{primary_mechanic}} implementation
758
- - Physics and collision system
759
- - Game state management
760
- - UI framework
761
- - id: phase-2-epics
762
- title: Story Epics
763
- type: bullet-list
764
- template: |
765
- - "{{primary_mechanic}} System Implementation"
766
- - "Physics and Collision Framework"
767
- - "Game State Management System"
768
- - id: phase-3-content-polish
769
- title: "Phase 3: Content & Polish ({{duration}})"
770
- sections:
771
- - id: phase-3-content
772
- title: Content Systems
773
- type: bullet-list
774
- template: |
775
- - Level loading and management
776
- - Audio system integration
777
- - Performance optimization
778
- - Final polish and testing
779
- - id: phase-3-epics
780
- title: Story Epics
781
- type: bullet-list
782
- template: |
783
- - "Level Management System"
784
- - "Audio Integration and Optimization"
785
- - "Performance Optimization and Testing"
786
-
787
- - id: risk-assessment
788
- title: Risk Assessment
789
- instruction: Identify potential technical risks and mitigation strategies
790
- type: table
791
- template: |
792
- | Risk | Probability | Impact | Mitigation Strategy |
793
- | ---------------------------- | ----------- | ---------- | ------------------- |
794
- | Performance issues on mobile | {{prob}} | {{impact}} | {{mitigation}} |
795
- | Asset loading bottlenecks | {{prob}} | {{impact}} | {{mitigation}} |
796
- | Cross-platform compatibility | {{prob}} | {{impact}} | {{mitigation}} |
797
-
798
- - id: success-criteria
799
- title: Success Criteria
800
- instruction: Define measurable technical success criteria
801
- sections:
802
- - id: technical-metrics
803
- title: Technical Metrics
804
- type: bullet-list
805
- template: |
806
- - All systems implemented per specification
807
- - Performance targets met consistently
808
- - Zero critical bugs in core systems
809
- - Successful deployment across target platforms
810
- - id: code-quality
811
- title: Code Quality
812
- type: bullet-list
813
- template: |
814
- - 90%+ test coverage on game logic
815
- - Zero TypeScript errors in strict mode
816
- - Consistent adherence to coding standards
817
- - Comprehensive documentation coverage
818
- ==================== END: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml ====================
819
-
820
- ==================== START: .bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md ====================
821
- # Game Development Story Definition of Done Checklist
822
-
823
- ## Story Completeness
824
-
825
- ### Basic Story Elements
826
-
827
- - [ ] **Story Title** - Clear, descriptive title that identifies the feature
828
- - [ ] **Epic Assignment** - Story is properly assigned to relevant epic
829
- - [ ] **Priority Level** - Appropriate priority assigned (High/Medium/Low)
830
- - [ ] **Story Points** - Realistic estimation for implementation complexity
831
- - [ ] **Description** - Clear, concise description of what needs to be implemented
832
-
833
- ### Game Design Alignment
834
-
835
- - [ ] **GDD Reference** - Specific Game Design Document section referenced
836
- - [ ] **Game Mechanic Context** - Clear connection to game mechanics defined in GDD
837
- - [ ] **Player Experience Goal** - Describes the intended player experience
838
- - [ ] **Balance Parameters** - Includes any relevant game balance values
839
- - [ ] **Design Intent** - Purpose and rationale for the feature is clear
840
-
841
- ## Technical Specifications
842
-
843
- ### Architecture Compliance
844
-
845
- - [ ] **File Organization** - Follows game architecture document structure
846
- - [ ] **Class Definitions** - TypeScript interfaces and classes are properly defined
847
- - [ ] **Integration Points** - Clear specification of how feature integrates with existing systems
848
- - [ ] **Event Communication** - Event emitting and listening requirements specified
849
- - [ ] **Dependencies** - All system dependencies clearly identified
850
-
851
- ### Phaser 3 Requirements
852
-
853
- - [ ] **Scene Integration** - Specifies which scenes are affected and how
854
- - [ ] **Game Object Usage** - Proper use of Phaser 3 game objects and components
855
- - [ ] **Physics Integration** - Physics requirements specified if applicable
856
- - [ ] **Asset Requirements** - All needed assets (sprites, audio, data) identified
857
- - [ ] **Performance Considerations** - 60 FPS target and optimization requirements
858
-
859
- ### Code Quality Standards
860
-
861
- - [ ] **TypeScript Strict Mode** - All code must comply with strict TypeScript
862
- - [ ] **Error Handling** - Error scenarios and handling requirements specified
863
- - [ ] **Memory Management** - Object pooling and cleanup requirements where needed
864
- - [ ] **Cross-Platform Support** - Desktop and mobile considerations addressed
865
- - [ ] **Code Organization** - Follows established game project structure
866
-
867
- ## Implementation Readiness
868
-
869
- ### Acceptance Criteria
870
-
871
- - [ ] **Functional Requirements** - All functional acceptance criteria are specific and testable
872
- - [ ] **Technical Requirements** - Technical acceptance criteria are complete and verifiable
873
- - [ ] **Game Design Requirements** - Game-specific requirements match GDD specifications
874
- - [ ] **Performance Requirements** - Frame rate and memory usage criteria specified
875
- - [ ] **Completeness** - No acceptance criteria are vague or unmeasurable
876
-
877
- ### Implementation Tasks
878
-
879
- - [ ] **Task Breakdown** - Story broken into specific, ordered implementation tasks
880
- - [ ] **Task Scope** - Each task is completable in 1-4 hours
881
- - [ ] **Task Clarity** - Each task has clear, actionable instructions
882
- - [ ] **File Specifications** - Exact file paths and purposes specified
883
- - [ ] **Development Flow** - Tasks follow logical implementation order
884
-
885
- ### Dependencies
886
-
887
- - [ ] **Story Dependencies** - All prerequisite stories identified with IDs
888
- - [ ] **Technical Dependencies** - Required systems and files identified
889
- - [ ] **Asset Dependencies** - All needed assets specified with locations
890
- - [ ] **External Dependencies** - Any third-party or external requirements noted
891
- - [ ] **Dependency Validation** - All dependencies are actually available
892
-
893
- ## Testing Requirements
894
-
895
- ### Test Coverage
896
-
897
- - [ ] **Unit Test Requirements** - Specific unit test files and scenarios defined
898
- - [ ] **Integration Test Cases** - Integration testing with other game systems specified
899
- - [ ] **Manual Test Cases** - Game-specific manual testing procedures defined
900
- - [ ] **Performance Tests** - Frame rate and memory testing requirements specified
901
- - [ ] **Edge Case Testing** - Edge cases and error conditions covered
902
-
903
- ### Test Implementation
904
-
905
- - [ ] **Test File Paths** - Exact test file locations specified
906
- - [ ] **Test Scenarios** - All test scenarios are complete and executable
907
- - [ ] **Expected Behaviors** - Clear expected outcomes for all tests defined
908
- - [ ] **Performance Metrics** - Specific performance targets for testing
909
- - [ ] **Test Data** - Any required test data or mock objects specified
910
-
911
- ## Game-Specific Quality
912
-
913
- ### Gameplay Implementation
914
-
915
- - [ ] **Mechanic Accuracy** - Implementation matches GDD mechanic specifications
916
- - [ ] **Player Controls** - Input handling requirements are complete
917
- - [ ] **Game Feel** - Requirements for juice, feedback, and responsiveness specified
918
- - [ ] **Balance Implementation** - Numeric values and parameters from GDD included
919
- - [ ] **State Management** - Game state changes and persistence requirements defined
920
-
921
- ### User Experience
922
-
923
- - [ ] **UI Requirements** - User interface elements and behaviors specified
924
- - [ ] **Audio Integration** - Sound effect and music requirements defined
925
- - [ ] **Visual Feedback** - Animation and visual effect requirements specified
926
- - [ ] **Accessibility** - Mobile touch and responsive design considerations
927
- - [ ] **Error Recovery** - User-facing error handling and recovery specified
928
-
929
- ### Performance Optimization
930
-
931
- - [ ] **Frame Rate Targets** - Specific FPS requirements for different platforms
932
- - [ ] **Memory Usage** - Memory consumption limits and monitoring requirements
933
- - [ ] **Asset Optimization** - Texture, audio, and data optimization requirements
934
- - [ ] **Mobile Considerations** - Touch controls and mobile performance requirements
935
- - [ ] **Loading Performance** - Asset loading and scene transition requirements
936
-
937
- ## Documentation and Communication
938
-
939
- ### Story Documentation
940
-
941
- - [ ] **Implementation Notes** - Additional context and implementation guidance provided
942
- - [ ] **Design Decisions** - Key design choices documented with rationale
943
- - [ ] **Future Considerations** - Potential future enhancements or modifications noted
944
- - [ ] **Change Tracking** - Process for tracking any requirement changes during development
945
- - [ ] **Reference Materials** - Links to relevant GDD sections and architecture docs
946
-
947
- ### Developer Handoff
948
-
949
- - [ ] **Immediate Actionability** - Developer can start implementation without additional questions
950
- - [ ] **Complete Context** - All necessary context provided within the story
951
- - [ ] **Clear Boundaries** - What is and isn't included in the story scope is clear
952
- - [ ] **Success Criteria** - Objective measures for story completion defined
953
- - [ ] **Communication Plan** - Process for developer questions and updates established
954
-
955
- ## Final Validation
956
-
957
- ### Story Readiness
958
-
959
- - [ ] **No Ambiguity** - No sections require interpretation or additional design decisions
960
- - [ ] **Technical Completeness** - All technical requirements are specified and actionable
961
- - [ ] **Scope Appropriateness** - Story scope matches assigned story points
962
- - [ ] **Quality Standards** - Story meets all game development quality standards
963
- - [ ] **Review Completion** - Story has been reviewed for completeness and accuracy
964
-
965
- ### Implementation Preparedness
966
-
967
- - [ ] **Environment Ready** - Development environment requirements specified
968
- - [ ] **Resources Available** - All required resources (assets, docs, dependencies) accessible
969
- - [ ] **Testing Prepared** - Testing environment and data requirements specified
970
- - [ ] **Definition of Done** - Clear, objective completion criteria established
971
- - [ ] **Handoff Complete** - Story is ready for developer assignment and implementation
972
-
973
- ## Checklist Completion
974
-
975
- **Overall Story Quality:** ⭐⭐⭐⭐⭐
976
-
977
- **Ready for Development:** [ ] Yes [ ] No
978
-
979
- **Additional Notes:**
980
- _Any specific concerns, recommendations, or clarifications needed before development begins._
981
- ==================== END: .bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md ====================
982
-
983
- ==================== START: .bmad-2d-phaser-game-dev/data/development-guidelines.md ====================
984
- # Game Development Guidelines
985
-
986
- ## Overview
987
-
988
- This document establishes coding standards, architectural patterns, and development practices for 2D game development using Phaser 3 and TypeScript. These guidelines ensure consistency, performance, and maintainability across all game development stories.
989
-
990
- ## TypeScript Standards
991
-
992
- ### Strict Mode Configuration
993
-
994
- **Required tsconfig.json settings:**
995
-
996
- ```json
997
- {
998
- "compilerOptions": {
999
- "strict": true,
1000
- "noImplicitAny": true,
1001
- "strictNullChecks": true,
1002
- "strictFunctionTypes": true,
1003
- "noImplicitReturns": true,
1004
- "noUnusedLocals": true,
1005
- "noUnusedParameters": true,
1006
- "exactOptionalPropertyTypes": true
1007
- }
1008
- }
1009
- ```
1010
-
1011
- ### Type Definitions
1012
-
1013
- **Game Object Interfaces:**
1014
-
1015
- ```typescript
1016
- // Core game entity interface
1017
- interface GameEntity {
1018
- readonly id: string;
1019
- position: Phaser.Math.Vector2;
1020
- active: boolean;
1021
- destroy(): void;
1022
- }
1023
-
1024
- // Player controller interface
1025
- interface PlayerController {
1026
- readonly inputEnabled: boolean;
1027
- handleInput(input: InputState): void;
1028
- update(delta: number): void;
1029
- }
1030
-
1031
- // Game system interface
1032
- interface GameSystem {
1033
- readonly name: string;
1034
- initialize(): void;
1035
- update(delta: number): void;
1036
- shutdown(): void;
1037
- }
1038
- ```
1039
-
1040
- **Scene Data Interfaces:**
1041
-
1042
- ```typescript
1043
- // Scene transition data
1044
- interface SceneData {
1045
- [key: string]: any;
1046
- }
1047
-
1048
- // Game state interface
1049
- interface GameState {
1050
- currentLevel: number;
1051
- score: number;
1052
- lives: number;
1053
- settings: GameSettings;
1054
- }
1055
-
1056
- interface GameSettings {
1057
- musicVolume: number;
1058
- sfxVolume: number;
1059
- difficulty: "easy" | "normal" | "hard";
1060
- controls: ControlScheme;
1061
- }
1062
- ```
1063
-
1064
- ### Naming Conventions
1065
-
1066
- **Classes and Interfaces:**
1067
-
1068
- - PascalCase for classes: `PlayerSprite`, `GameManager`, `AudioSystem`
1069
- - PascalCase with 'I' prefix for interfaces: `IGameEntity`, `IPlayerController`
1070
- - Descriptive names that indicate purpose: `CollisionManager` not `CM`
1071
-
1072
- **Methods and Variables:**
1073
-
1074
- - camelCase for methods and variables: `updatePosition()`, `playerSpeed`
1075
- - Descriptive names: `calculateDamage()` not `calcDmg()`
1076
- - Boolean variables with is/has/can prefix: `isActive`, `hasCollision`, `canMove`
1077
-
1078
- **Constants:**
1079
-
1080
- - UPPER_SNAKE_CASE for constants: `MAX_PLAYER_SPEED`, `DEFAULT_VOLUME`
1081
- - Group related constants in enums or const objects
1082
-
1083
- **Files and Directories:**
1084
-
1085
- - kebab-case for file names: `player-controller.ts`, `audio-manager.ts`
1086
- - PascalCase for scene files: `MenuScene.ts`, `GameScene.ts`
1087
-
1088
- ## Phaser 3 Architecture Patterns
1089
-
1090
- ### Scene Organization
1091
-
1092
- **Scene Lifecycle Management:**
1093
-
1094
- ```typescript
1095
- class GameScene extends Phaser.Scene {
1096
- private gameManager!: GameManager;
1097
- private inputManager!: InputManager;
1098
-
1099
- constructor() {
1100
- super({ key: "GameScene" });
1101
- }
1102
-
1103
- preload(): void {
1104
- // Load only scene-specific assets
1105
- this.load.image("player", "assets/player.png");
1106
- }
1107
-
1108
- create(data: SceneData): void {
1109
- // Initialize game systems
1110
- this.gameManager = new GameManager(this);
1111
- this.inputManager = new InputManager(this);
1112
-
1113
- // Set up scene-specific logic
1114
- this.setupGameObjects();
1115
- this.setupEventListeners();
1116
- }
1117
-
1118
- update(time: number, delta: number): void {
1119
- // Update all game systems
1120
- this.gameManager.update(delta);
1121
- this.inputManager.update(delta);
1122
- }
1123
-
1124
- shutdown(): void {
1125
- // Clean up resources
1126
- this.gameManager.destroy();
1127
- this.inputManager.destroy();
1128
-
1129
- // Remove event listeners
1130
- this.events.off("*");
1131
- }
1132
- }
1133
- ```
1134
-
1135
- **Scene Transitions:**
1136
-
1137
- ```typescript
1138
- // Proper scene transitions with data
1139
- this.scene.start("NextScene", {
1140
- playerScore: this.playerScore,
1141
- currentLevel: this.currentLevel + 1,
1142
- });
1143
-
1144
- // Scene overlays for UI
1145
- this.scene.launch("PauseMenuScene");
1146
- this.scene.pause();
1147
- ```
1148
-
1149
- ### Game Object Patterns
1150
-
1151
- **Component-Based Architecture:**
1152
-
1153
- ```typescript
1154
- // Base game entity
1155
- abstract class GameEntity extends Phaser.GameObjects.Sprite {
1156
- protected components: Map<string, GameComponent> = new Map();
1157
-
1158
- constructor(scene: Phaser.Scene, x: number, y: number, texture: string) {
1159
- super(scene, x, y, texture);
1160
- scene.add.existing(this);
1161
- }
1162
-
1163
- addComponent<T extends GameComponent>(component: T): T {
1164
- this.components.set(component.name, component);
1165
- return component;
1166
- }
1167
-
1168
- getComponent<T extends GameComponent>(name: string): T | undefined {
1169
- return this.components.get(name) as T;
1170
- }
1171
-
1172
- update(delta: number): void {
1173
- this.components.forEach((component) => component.update(delta));
1174
- }
1175
-
1176
- destroy(): void {
1177
- this.components.forEach((component) => component.destroy());
1178
- this.components.clear();
1179
- super.destroy();
1180
- }
1181
- }
1182
-
1183
- // Example player implementation
1184
- class Player extends GameEntity {
1185
- private movement!: MovementComponent;
1186
- private health!: HealthComponent;
1187
-
1188
- constructor(scene: Phaser.Scene, x: number, y: number) {
1189
- super(scene, x, y, "player");
1190
-
1191
- this.movement = this.addComponent(new MovementComponent(this));
1192
- this.health = this.addComponent(new HealthComponent(this, 100));
1193
- }
1194
- }
1195
- ```
1196
-
1197
- ### System Management
1198
-
1199
- **Singleton Managers:**
1200
-
1201
- ```typescript
1202
- class GameManager {
1203
- private static instance: GameManager;
1204
- private scene: Phaser.Scene;
1205
- private gameState: GameState;
1206
-
1207
- constructor(scene: Phaser.Scene) {
1208
- if (GameManager.instance) {
1209
- throw new Error("GameManager already exists!");
1210
- }
1211
-
1212
- this.scene = scene;
1213
- this.gameState = this.loadGameState();
1214
- GameManager.instance = this;
1215
- }
1216
-
1217
- static getInstance(): GameManager {
1218
- if (!GameManager.instance) {
1219
- throw new Error("GameManager not initialized!");
1220
- }
1221
- return GameManager.instance;
1222
- }
1223
-
1224
- update(delta: number): void {
1225
- // Update game logic
1226
- }
1227
-
1228
- destroy(): void {
1229
- GameManager.instance = null!;
1230
- }
1231
- }
1232
- ```
1233
-
1234
- ## Performance Optimization
1235
-
1236
- ### Object Pooling
1237
-
1238
- **Required for High-Frequency Objects:**
1239
-
1240
- ```typescript
1241
- class BulletPool {
1242
- private pool: Bullet[] = [];
1243
- private scene: Phaser.Scene;
1244
-
1245
- constructor(scene: Phaser.Scene, initialSize: number = 50) {
1246
- this.scene = scene;
1247
-
1248
- // Pre-create bullets
1249
- for (let i = 0; i < initialSize; i++) {
1250
- const bullet = new Bullet(scene, 0, 0);
1251
- bullet.setActive(false);
1252
- bullet.setVisible(false);
1253
- this.pool.push(bullet);
1254
- }
1255
- }
1256
-
1257
- getBullet(): Bullet | null {
1258
- const bullet = this.pool.find((b) => !b.active);
1259
- if (bullet) {
1260
- bullet.setActive(true);
1261
- bullet.setVisible(true);
1262
- return bullet;
1263
- }
1264
-
1265
- // Pool exhausted - create new bullet
1266
- console.warn("Bullet pool exhausted, creating new bullet");
1267
- return new Bullet(this.scene, 0, 0);
1268
- }
1269
-
1270
- releaseBullet(bullet: Bullet): void {
1271
- bullet.setActive(false);
1272
- bullet.setVisible(false);
1273
- bullet.setPosition(0, 0);
1274
- }
1275
- }
1276
- ```
1277
-
1278
- ### Frame Rate Optimization
1279
-
1280
- **Performance Monitoring:**
1281
-
1282
- ```typescript
1283
- class PerformanceMonitor {
1284
- private frameCount: number = 0;
1285
- private lastTime: number = 0;
1286
- private frameRate: number = 60;
1287
-
1288
- update(time: number): void {
1289
- this.frameCount++;
1290
-
1291
- if (time - this.lastTime >= 1000) {
1292
- this.frameRate = this.frameCount;
1293
- this.frameCount = 0;
1294
- this.lastTime = time;
1295
-
1296
- if (this.frameRate < 55) {
1297
- console.warn(`Low frame rate detected: ${this.frameRate} FPS`);
1298
- this.optimizePerformance();
1299
- }
1300
- }
1301
- }
1302
-
1303
- private optimizePerformance(): void {
1304
- // Reduce particle counts, disable effects, etc.
1305
- }
1306
- }
1307
- ```
1308
-
1309
- **Update Loop Optimization:**
1310
-
1311
- ```typescript
1312
- // Avoid expensive operations in update loops
1313
- class GameScene extends Phaser.Scene {
1314
- private updateTimer: number = 0;
1315
- private readonly UPDATE_INTERVAL = 100; // ms
1316
-
1317
- update(time: number, delta: number): void {
1318
- // High-frequency updates (every frame)
1319
- this.updatePlayer(delta);
1320
- this.updatePhysics(delta);
1321
-
1322
- // Low-frequency updates (10 times per second)
1323
- this.updateTimer += delta;
1324
- if (this.updateTimer >= this.UPDATE_INTERVAL) {
1325
- this.updateUI();
1326
- this.updateAI();
1327
- this.updateTimer = 0;
1328
- }
1329
- }
1330
- }
1331
- ```
1332
-
1333
- ## Input Handling
1334
-
1335
- ### Cross-Platform Input
1336
-
1337
- **Input Abstraction:**
1338
-
1339
- ```typescript
1340
- interface InputState {
1341
- moveLeft: boolean;
1342
- moveRight: boolean;
1343
- jump: boolean;
1344
- action: boolean;
1345
- pause: boolean;
1346
- }
1347
-
1348
- class InputManager {
1349
- private inputState: InputState = {
1350
- moveLeft: false,
1351
- moveRight: false,
1352
- jump: false,
1353
- action: false,
1354
- pause: false,
1355
- };
1356
-
1357
- private keys!: { [key: string]: Phaser.Input.Keyboard.Key };
1358
- private pointer!: Phaser.Input.Pointer;
1359
-
1360
- constructor(private scene: Phaser.Scene) {
1361
- this.setupKeyboard();
1362
- this.setupTouch();
1363
- }
1364
-
1365
- private setupKeyboard(): void {
1366
- this.keys = this.scene.input.keyboard.addKeys("W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT");
1367
- }
1368
-
1369
- private setupTouch(): void {
1370
- this.scene.input.on("pointerdown", this.handlePointerDown, this);
1371
- this.scene.input.on("pointerup", this.handlePointerUp, this);
1372
- }
1373
-
1374
- update(): void {
1375
- // Update input state from multiple sources
1376
- this.inputState.moveLeft = this.keys.A.isDown || this.keys.LEFT.isDown;
1377
- this.inputState.moveRight = this.keys.D.isDown || this.keys.RIGHT.isDown;
1378
- this.inputState.jump = Phaser.Input.Keyboard.JustDown(this.keys.SPACE);
1379
- // ... handle touch input
1380
- }
1381
-
1382
- getInputState(): InputState {
1383
- return { ...this.inputState };
1384
- }
1385
- }
1386
- ```
1387
-
1388
- ## Error Handling
1389
-
1390
- ### Graceful Degradation
1391
-
1392
- **Asset Loading Error Handling:**
1393
-
1394
- ```typescript
1395
- class AssetManager {
1396
- loadAssets(): Promise<void> {
1397
- return new Promise((resolve, reject) => {
1398
- this.scene.load.on("filecomplete", this.handleFileComplete, this);
1399
- this.scene.load.on("loaderror", this.handleLoadError, this);
1400
- this.scene.load.on("complete", () => resolve());
1401
-
1402
- this.scene.load.start();
1403
- });
1404
- }
1405
-
1406
- private handleLoadError(file: Phaser.Loader.File): void {
1407
- console.error(`Failed to load asset: ${file.key}`);
1408
-
1409
- // Use fallback assets
1410
- this.loadFallbackAsset(file.key);
1411
- }
1412
-
1413
- private loadFallbackAsset(key: string): void {
1414
- // Load placeholder or default assets
1415
- switch (key) {
1416
- case "player":
1417
- this.scene.load.image("player", "assets/defaults/default-player.png");
1418
- break;
1419
- default:
1420
- console.warn(`No fallback for asset: ${key}`);
1421
- }
1422
- }
1423
- }
1424
- ```
1425
-
1426
- ### Runtime Error Recovery
1427
-
1428
- **System Error Handling:**
1429
-
1430
- ```typescript
1431
- class GameSystem {
1432
- protected handleError(error: Error, context: string): void {
1433
- console.error(`Error in ${context}:`, error);
1434
-
1435
- // Report to analytics/logging service
1436
- this.reportError(error, context);
1437
-
1438
- // Attempt recovery
1439
- this.attemptRecovery(context);
1440
- }
1441
-
1442
- private attemptRecovery(context: string): void {
1443
- switch (context) {
1444
- case "update":
1445
- // Reset system state
1446
- this.reset();
1447
- break;
1448
- case "render":
1449
- // Disable visual effects
1450
- this.disableEffects();
1451
- break;
1452
- default:
1453
- // Generic recovery
1454
- this.safeShutdown();
1455
- }
1456
- }
1457
- }
1458
- ```
1459
-
1460
- ## Testing Standards
1461
-
1462
- ### Unit Testing
1463
-
1464
- **Game Logic Testing:**
1465
-
1466
- ```typescript
1467
- // Example test for game mechanics
1468
- describe("HealthComponent", () => {
1469
- let healthComponent: HealthComponent;
1470
-
1471
- beforeEach(() => {
1472
- const mockEntity = {} as GameEntity;
1473
- healthComponent = new HealthComponent(mockEntity, 100);
1474
- });
1475
-
1476
- test("should initialize with correct health", () => {
1477
- expect(healthComponent.currentHealth).toBe(100);
1478
- expect(healthComponent.maxHealth).toBe(100);
1479
- });
1480
-
1481
- test("should handle damage correctly", () => {
1482
- healthComponent.takeDamage(25);
1483
- expect(healthComponent.currentHealth).toBe(75);
1484
- expect(healthComponent.isAlive()).toBe(true);
1485
- });
1486
-
1487
- test("should handle death correctly", () => {
1488
- healthComponent.takeDamage(150);
1489
- expect(healthComponent.currentHealth).toBe(0);
1490
- expect(healthComponent.isAlive()).toBe(false);
1491
- });
1492
- });
1493
- ```
1494
-
1495
- ### Integration Testing
1496
-
1497
- **Scene Testing:**
1498
-
1499
- ```typescript
1500
- describe("GameScene Integration", () => {
1501
- let scene: GameScene;
1502
- let mockGame: Phaser.Game;
1503
-
1504
- beforeEach(() => {
1505
- // Mock Phaser game instance
1506
- mockGame = createMockGame();
1507
- scene = new GameScene();
1508
- });
1509
-
1510
- test("should initialize all systems", () => {
1511
- scene.create({});
1512
-
1513
- expect(scene.gameManager).toBeDefined();
1514
- expect(scene.inputManager).toBeDefined();
1515
- });
1516
- });
1517
- ```
1518
-
1519
- ## File Organization
1520
-
1521
- ### Project Structure
1522
-
1523
- ```
1524
- src/
1525
- ├── scenes/
1526
- │ ├── BootScene.ts # Initial loading and setup
1527
- │ ├── PreloadScene.ts # Asset loading with progress
1528
- │ ├── MenuScene.ts # Main menu and navigation
1529
- │ ├── GameScene.ts # Core gameplay
1530
- │ └── UIScene.ts # Overlay UI elements
1531
- ├── gameObjects/
1532
- │ ├── entities/
1533
- │ │ ├── Player.ts # Player game object
1534
- │ │ ├── Enemy.ts # Enemy base class
1535
- │ │ └── Collectible.ts # Collectible items
1536
- │ ├── components/
1537
- │ │ ├── MovementComponent.ts
1538
- │ │ ├── HealthComponent.ts
1539
- │ │ └── CollisionComponent.ts
1540
- │ └── ui/
1541
- │ ├── Button.ts # Interactive buttons
1542
- │ ├── HealthBar.ts # Health display
1543
- │ └── ScoreDisplay.ts # Score UI
1544
- ├── systems/
1545
- │ ├── GameManager.ts # Core game state management
1546
- │ ├── InputManager.ts # Cross-platform input handling
1547
- │ ├── AudioManager.ts # Sound and music system
1548
- │ ├── SaveManager.ts # Save/load functionality
1549
- │ └── PerformanceMonitor.ts # Performance tracking
1550
- ├── utils/
1551
- │ ├── ObjectPool.ts # Generic object pooling
1552
- │ ├── MathUtils.ts # Game math helpers
1553
- │ ├── AssetLoader.ts # Asset management utilities
1554
- │ └── EventBus.ts # Global event system
1555
- ├── types/
1556
- │ ├── GameTypes.ts # Core game type definitions
1557
- │ ├── UITypes.ts # UI-related types
1558
- │ └── SystemTypes.ts # System interface definitions
1559
- ├── config/
1560
- │ ├── GameConfig.ts # Phaser game configuration
1561
- │ ├── GameBalance.ts # Game balance parameters
1562
- │ └── AssetConfig.ts # Asset loading configuration
1563
- └── main.ts # Application entry point
1564
- ```
1565
-
1566
- ## Development Workflow
1567
-
1568
- ### Story Implementation Process
1569
-
1570
- 1. **Read Story Requirements:**
1571
-
1572
- - Understand acceptance criteria
1573
- - Identify technical requirements
1574
- - Review performance constraints
1575
-
1576
- 2. **Plan Implementation:**
1577
-
1578
- - Identify files to create/modify
1579
- - Consider component architecture
1580
- - Plan testing approach
1581
-
1582
- 3. **Implement Feature:**
1583
-
1584
- - Follow TypeScript strict mode
1585
- - Use established patterns
1586
- - Maintain 60 FPS performance
1587
-
1588
- 4. **Test Implementation:**
1589
-
1590
- - Write unit tests for game logic
1591
- - Test cross-platform functionality
1592
- - Validate performance targets
1593
-
1594
- 5. **Update Documentation:**
1595
- - Mark story checkboxes complete
1596
- - Document any deviations
1597
- - Update architecture if needed
1598
-
1599
- ### Code Review Checklist
1600
-
1601
- **Before Committing:**
1602
-
1603
- - [ ] TypeScript compiles without errors
1604
- - [ ] All tests pass
1605
- - [ ] Performance targets met (60 FPS)
1606
- - [ ] No console errors or warnings
1607
- - [ ] Cross-platform compatibility verified
1608
- - [ ] Memory usage within bounds
1609
- - [ ] Code follows naming conventions
1610
- - [ ] Error handling implemented
1611
- - [ ] Documentation updated
1612
-
1613
- ## Performance Targets
1614
-
1615
- ### Frame Rate Requirements
1616
-
1617
- - **Desktop**: Maintain 60 FPS at 1080p
1618
- - **Mobile**: Maintain 60 FPS on mid-range devices, minimum 30 FPS on low-end
1619
- - **Optimization**: Implement dynamic quality scaling when performance drops
1620
-
1621
- ### Memory Management
1622
-
1623
- - **Total Memory**: Under 100MB for full game
1624
- - **Per Scene**: Under 50MB per gameplay scene
1625
- - **Asset Loading**: Progressive loading to stay under limits
1626
- - **Garbage Collection**: Minimize object creation in update loops
1627
-
1628
- ### Loading Performance
1629
-
1630
- - **Initial Load**: Under 5 seconds for game start
1631
- - **Scene Transitions**: Under 2 seconds between scenes
1632
- - **Asset Streaming**: Background loading for upcoming content
1633
-
1634
- These guidelines ensure consistent, high-quality game development that meets performance targets and maintains code quality across all implementation stories.
1635
- ==================== END: .bmad-2d-phaser-game-dev/data/development-guidelines.md ====================