ma-agents 3.18.0-beta.2 → 3.18.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 (168) hide show
  1. package/README.md +2 -2
  2. package/bin/cli.js +29 -32
  3. package/docs/architecture.md +2 -2
  4. package/lib/bmad-cache/cache-manifest.json +0 -12
  5. package/lib/bmad-extension-plugin/.claude-plugin/marketplace.json +1 -1
  6. package/lib/bmad.js +33 -34
  7. package/package.json +1 -1
  8. package/scripts/build-bmad-cache.js +18 -9
  9. package/lib/bmad-cache/gds/.claude-plugin/marketplace.json +0 -56
  10. package/lib/bmad-cache/gds/.markdownlint-cli2.yaml +0 -35
  11. package/lib/bmad-cache/gds/.nvmrc +0 -1
  12. package/lib/bmad-cache/gds/.prettierignore +0 -9
  13. package/lib/bmad-cache/gds/CNAME +0 -1
  14. package/lib/bmad-cache/gds/LICENSE +0 -26
  15. package/lib/bmad-cache/gds/README.md +0 -134
  16. package/lib/bmad-cache/gds/_git_preserved/HEAD +0 -1
  17. package/lib/bmad-cache/gds/_git_preserved/config +0 -13
  18. package/lib/bmad-cache/gds/_git_preserved/description +0 -1
  19. package/lib/bmad-cache/gds/_git_preserved/hooks/applypatch-msg.sample +0 -15
  20. package/lib/bmad-cache/gds/_git_preserved/hooks/commit-msg.sample +0 -74
  21. package/lib/bmad-cache/gds/_git_preserved/hooks/fsmonitor-watchman.sample +0 -168
  22. package/lib/bmad-cache/gds/_git_preserved/hooks/post-update.sample +0 -8
  23. package/lib/bmad-cache/gds/_git_preserved/hooks/pre-applypatch.sample +0 -14
  24. package/lib/bmad-cache/gds/_git_preserved/hooks/pre-commit.sample +0 -49
  25. package/lib/bmad-cache/gds/_git_preserved/hooks/pre-merge-commit.sample +0 -13
  26. package/lib/bmad-cache/gds/_git_preserved/hooks/pre-push.sample +0 -53
  27. package/lib/bmad-cache/gds/_git_preserved/hooks/pre-rebase.sample +0 -169
  28. package/lib/bmad-cache/gds/_git_preserved/hooks/pre-receive.sample +0 -24
  29. package/lib/bmad-cache/gds/_git_preserved/hooks/prepare-commit-msg.sample +0 -42
  30. package/lib/bmad-cache/gds/_git_preserved/hooks/push-to-checkout.sample +0 -78
  31. package/lib/bmad-cache/gds/_git_preserved/hooks/sendemail-validate.sample +0 -77
  32. package/lib/bmad-cache/gds/_git_preserved/hooks/update.sample +0 -128
  33. package/lib/bmad-cache/gds/_git_preserved/index +0 -0
  34. package/lib/bmad-cache/gds/_git_preserved/info/exclude +0 -6
  35. package/lib/bmad-cache/gds/_git_preserved/objects/pack/pack-dcb7c556d9bb6b6b70d2301e094eaac6d7300552.idx +0 -0
  36. package/lib/bmad-cache/gds/_git_preserved/objects/pack/pack-dcb7c556d9bb6b6b70d2301e094eaac6d7300552.pack +0 -0
  37. package/lib/bmad-cache/gds/_git_preserved/objects/pack/pack-dcb7c556d9bb6b6b70d2301e094eaac6d7300552.rev +0 -0
  38. package/lib/bmad-cache/gds/_git_preserved/packed-refs +0 -2
  39. package/lib/bmad-cache/gds/_git_preserved/refs/heads/main +0 -1
  40. package/lib/bmad-cache/gds/_git_preserved/shallow +0 -1
  41. package/lib/bmad-cache/gds/eslint.config.mjs +0 -141
  42. package/lib/bmad-cache/gds/package.json +0 -91
  43. package/lib/bmad-cache/gds/prettier.config.mjs +0 -32
  44. package/lib/bmad-cache/gds/src/agents/gds-agent-game-architect/customize.toml +0 -57
  45. package/lib/bmad-cache/gds/src/agents/gds-agent-game-designer/customize.toml +0 -59
  46. package/lib/bmad-cache/gds/src/agents/gds-agent-game-dev/customize.toml +0 -129
  47. package/lib/bmad-cache/gds/src/agents/gds-agent-game-dev/gametest/qa-index.csv +0 -18
  48. package/lib/bmad-cache/gds/src/agents/gds-agent-game-solo-dev/customize.toml +0 -55
  49. package/lib/bmad-cache/gds/src/agents/gds-agent-tech-writer/customize.toml +0 -65
  50. package/lib/bmad-cache/gds/src/module-help.csv +0 -30
  51. package/lib/bmad-cache/gds/src/module.yaml +0 -113
  52. package/lib/bmad-cache/gds/src/workflows/1-preproduction/gds-brainstorm-game/customize.toml +0 -41
  53. package/lib/bmad-cache/gds/src/workflows/1-preproduction/gds-brainstorm-game/game-brain-methods.csv +0 -26
  54. package/lib/bmad-cache/gds/src/workflows/1-preproduction/gds-create-game-brief/customize.toml +0 -116
  55. package/lib/bmad-cache/gds/src/workflows/1-preproduction/research/gds-domain-research/customize.toml +0 -41
  56. package/lib/bmad-cache/gds/src/workflows/2-design/gds-create-narrative/customize.toml +0 -41
  57. package/lib/bmad-cache/gds/src/workflows/2-design/gds-gdd/assets/game-types.csv +0 -25
  58. package/lib/bmad-cache/gds/src/workflows/2-design/gds-gdd/assets/genre-complexity.csv +0 -26
  59. package/lib/bmad-cache/gds/src/workflows/2-design/gds-gdd/assets/validation-report-template.html +0 -190
  60. package/lib/bmad-cache/gds/src/workflows/2-design/gds-gdd/customize.toml +0 -99
  61. package/lib/bmad-cache/gds/src/workflows/2-design/gds-gdd/scripts/render-validation-html.py +0 -290
  62. package/lib/bmad-cache/gds/src/workflows/2-design/gds-prd/assets/validation-report-template.html +0 -190
  63. package/lib/bmad-cache/gds/src/workflows/2-design/gds-prd/customize.toml +0 -84
  64. package/lib/bmad-cache/gds/src/workflows/2-design/gds-ux/assets/validation-report-template.html +0 -319
  65. package/lib/bmad-cache/gds/src/workflows/2-design/gds-ux/customize.toml +0 -101
  66. package/lib/bmad-cache/gds/src/workflows/3-technical/gds-check-implementation-readiness/customize.toml +0 -41
  67. package/lib/bmad-cache/gds/src/workflows/3-technical/gds-create-epics-and-stories/customize.toml +0 -41
  68. package/lib/bmad-cache/gds/src/workflows/3-technical/gds-game-architecture/architecture-patterns.yaml +0 -508
  69. package/lib/bmad-cache/gds/src/workflows/3-technical/gds-game-architecture/customize.toml +0 -41
  70. package/lib/bmad-cache/gds/src/workflows/3-technical/gds-game-architecture/decision-catalog.yaml +0 -428
  71. package/lib/bmad-cache/gds/src/workflows/3-technical/gds-game-architecture/engine-mcps.yaml +0 -392
  72. package/lib/bmad-cache/gds/src/workflows/3-technical/gds-game-architecture/pattern-categories.csv +0 -13
  73. package/lib/bmad-cache/gds/src/workflows/3-technical/gds-generate-project-context/customize.toml +0 -41
  74. package/lib/bmad-cache/gds/src/workflows/4-production/gds-code-review/customize.toml +0 -41
  75. package/lib/bmad-cache/gds/src/workflows/4-production/gds-correct-course/customize.toml +0 -41
  76. package/lib/bmad-cache/gds/src/workflows/4-production/gds-create-story/customize.toml +0 -41
  77. package/lib/bmad-cache/gds/src/workflows/4-production/gds-dev-story/customize.toml +0 -41
  78. package/lib/bmad-cache/gds/src/workflows/4-production/gds-investigate/customize.toml +0 -62
  79. package/lib/bmad-cache/gds/src/workflows/4-production/gds-retrospective/customize.toml +0 -41
  80. package/lib/bmad-cache/gds/src/workflows/4-production/gds-sprint-planning/customize.toml +0 -41
  81. package/lib/bmad-cache/gds/src/workflows/4-production/gds-sprint-planning/sprint-status-template.yaml +0 -55
  82. package/lib/bmad-cache/gds/src/workflows/4-production/gds-sprint-status/customize.toml +0 -41
  83. package/lib/bmad-cache/gds/src/workflows/gametest/gds-e2e-scaffold/customize.toml +0 -41
  84. package/lib/bmad-cache/gds/src/workflows/gametest/gds-performance-test/customize.toml +0 -41
  85. package/lib/bmad-cache/gds/src/workflows/gametest/gds-playtest-plan/customize.toml +0 -41
  86. package/lib/bmad-cache/gds/src/workflows/gametest/gds-test-automate/customize.toml +0 -41
  87. package/lib/bmad-cache/gds/src/workflows/gametest/gds-test-design/customize.toml +0 -41
  88. package/lib/bmad-cache/gds/src/workflows/gametest/gds-test-framework/customize.toml +0 -41
  89. package/lib/bmad-cache/gds/src/workflows/gametest/gds-test-review/customize.toml +0 -41
  90. package/lib/bmad-cache/gds/src/workflows/gds-document-project/customize.toml +0 -41
  91. package/lib/bmad-cache/gds/src/workflows/gds-document-project/documentation-requirements.csv +0 -12
  92. package/lib/bmad-cache/gds/src/workflows/gds-document-project/templates/project-scan-report-schema.json +0 -160
  93. package/lib/bmad-cache/gds/src/workflows/gds-quick-flow/gds-quick-dev/customize.toml +0 -41
  94. package/lib/bmad-cache/gds/tools/build-docs.mjs +0 -450
  95. package/lib/bmad-cache/gds/website/astro.config.mjs +0 -142
  96. package/lib/bmad-cache/gds/website/public/favicon.ico +0 -0
  97. package/lib/bmad-cache/gds/website/public/img/bmad-dark.png +0 -0
  98. package/lib/bmad-cache/gds/website/public/img/bmad-light.png +0 -0
  99. package/lib/bmad-cache/gds/website/src/components/Banner.astro +0 -71
  100. package/lib/bmad-cache/gds/website/src/components/Header.astro +0 -94
  101. package/lib/bmad-cache/gds/website/src/components/MobileMenuFooter.astro +0 -33
  102. package/lib/bmad-cache/gds/website/src/content/config.ts +0 -6
  103. package/lib/bmad-cache/gds/website/src/content/docs +0 -1
  104. package/lib/bmad-cache/gds/website/src/lib/site-url.mjs +0 -25
  105. package/lib/bmad-cache/gds/website/src/rehype-base-paths.js +0 -88
  106. package/lib/bmad-cache/gds/website/src/rehype-markdown-links.js +0 -117
  107. package/lib/bmad-cache/gds/website/src/styles/custom.css +0 -503
  108. package/lib/bmad-cache/wds/.claude-plugin/marketplace.json +0 -35
  109. package/lib/bmad-cache/wds/.markdownlint-cli2.yaml +0 -38
  110. package/lib/bmad-cache/wds/.nvmrc +0 -1
  111. package/lib/bmad-cache/wds/.prettierignore +0 -9
  112. package/lib/bmad-cache/wds/LICENSE +0 -27
  113. package/lib/bmad-cache/wds/README.md +0 -139
  114. package/lib/bmad-cache/wds/_git_preserved/HEAD +0 -1
  115. package/lib/bmad-cache/wds/_git_preserved/config +0 -13
  116. package/lib/bmad-cache/wds/_git_preserved/description +0 -1
  117. package/lib/bmad-cache/wds/_git_preserved/hooks/applypatch-msg.sample +0 -15
  118. package/lib/bmad-cache/wds/_git_preserved/hooks/commit-msg.sample +0 -74
  119. package/lib/bmad-cache/wds/_git_preserved/hooks/fsmonitor-watchman.sample +0 -168
  120. package/lib/bmad-cache/wds/_git_preserved/hooks/post-update.sample +0 -8
  121. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-applypatch.sample +0 -14
  122. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-commit.sample +0 -49
  123. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-merge-commit.sample +0 -13
  124. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-push.sample +0 -53
  125. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-rebase.sample +0 -169
  126. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-receive.sample +0 -24
  127. package/lib/bmad-cache/wds/_git_preserved/hooks/prepare-commit-msg.sample +0 -42
  128. package/lib/bmad-cache/wds/_git_preserved/hooks/push-to-checkout.sample +0 -78
  129. package/lib/bmad-cache/wds/_git_preserved/hooks/sendemail-validate.sample +0 -77
  130. package/lib/bmad-cache/wds/_git_preserved/hooks/update.sample +0 -128
  131. package/lib/bmad-cache/wds/_git_preserved/index +0 -0
  132. package/lib/bmad-cache/wds/_git_preserved/info/exclude +0 -6
  133. package/lib/bmad-cache/wds/_git_preserved/objects/pack/pack-656c3d8d5426e73043b6a7f45eedaab74e3c419e.idx +0 -0
  134. package/lib/bmad-cache/wds/_git_preserved/objects/pack/pack-656c3d8d5426e73043b6a7f45eedaab74e3c419e.pack +0 -0
  135. package/lib/bmad-cache/wds/_git_preserved/objects/pack/pack-656c3d8d5426e73043b6a7f45eedaab74e3c419e.rev +0 -0
  136. package/lib/bmad-cache/wds/_git_preserved/packed-refs +0 -2
  137. package/lib/bmad-cache/wds/_git_preserved/refs/heads/main +0 -1
  138. package/lib/bmad-cache/wds/_git_preserved/refs/tags/v0.4.3 +0 -1
  139. package/lib/bmad-cache/wds/_git_preserved/shallow +0 -1
  140. package/lib/bmad-cache/wds/eslint.config.mjs +0 -152
  141. package/lib/bmad-cache/wds/package.json +0 -82
  142. package/lib/bmad-cache/wds/prettier.config.mjs +0 -32
  143. package/lib/bmad-cache/wds/src/agents/wds-agent-freya-ux/customize.toml +0 -80
  144. package/lib/bmad-cache/wds/src/agents/wds-agent-mimir-builder/customize.toml +0 -52
  145. package/lib/bmad-cache/wds/src/agents/wds-agent-saga-analyst/customize.toml +0 -70
  146. package/lib/bmad-cache/wds/src/module-help.csv +0 -19
  147. package/lib/bmad-cache/wds/src/module.yaml +0 -173
  148. package/lib/bmad-cache/wds/src/scripts/README.md +0 -155
  149. package/lib/bmad-cache/wds/src/scripts/wds-add-object.js +0 -202
  150. package/lib/bmad-cache/wds/src/scripts/wds-add-spacing.js +0 -158
  151. package/lib/bmad-cache/wds/src/scripts/wds-init-page.js +0 -229
  152. package/lib/bmad-cache/wds/src/scripts/wds-init-scenario.js +0 -120
  153. package/lib/bmad-cache/wds/src/scripts/wds-nav.js +0 -201
  154. package/lib/bmad-cache/wds/src/scripts/wds-validate.js +0 -301
  155. package/lib/bmad-cache/wds/src/workflows/wds-0-project-setup/resources/wds-1-project-brief/templates/platform-requirements.template.yaml +0 -69
  156. package/lib/bmad-cache/wds/src/workflows/wds-0-project-setup/resources/wds-7-design-system/templates/catalog.template.html +0 -363
  157. package/lib/bmad-cache/wds/src/workflows/wds-1-project-brief/templates/platform-requirements.template.yaml +0 -69
  158. package/lib/bmad-cache/wds/src/workflows/wds-3-scenarios/workflow.xml +0 -450
  159. package/lib/bmad-cache/wds/src/workflows/wds-4-ux-design/templates/design-delivery.template.yaml +0 -104
  160. package/lib/bmad-cache/wds/src/workflows/wds-4-ux-design/templates/test-scenario.template.yaml +0 -192
  161. package/lib/bmad-cache/wds/src/workflows/wds-4-ux-design/workflow-specify.xml +0 -387
  162. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/components/dev-mode.css +0 -164
  163. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/components/dev-mode.html +0 -18
  164. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/components/dev-mode.js +0 -430
  165. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/demo-data-template.json +0 -63
  166. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/page-template.html +0 -465
  167. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/work-file-template.yaml +0 -264
  168. package/lib/bmad-cache/wds/src/workflows/wds-7-design-system/templates/catalog.template.html +0 -363
@@ -1,160 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Project Scan Report Schema",
4
- "description": "State tracking file for document-project workflow resumability",
5
- "type": "object",
6
- "required": ["workflow_version", "timestamps", "mode", "scan_level", "completed_steps", "current_step"],
7
- "properties": {
8
- "workflow_version": {
9
- "type": "string",
10
- "description": "Version of document-project workflow",
11
- "example": "1.2.0"
12
- },
13
- "timestamps": {
14
- "type": "object",
15
- "required": ["started", "last_updated"],
16
- "properties": {
17
- "started": {
18
- "type": "string",
19
- "format": "date-time",
20
- "description": "ISO 8601 timestamp when workflow started"
21
- },
22
- "last_updated": {
23
- "type": "string",
24
- "format": "date-time",
25
- "description": "ISO 8601 timestamp of last state update"
26
- },
27
- "completed": {
28
- "type": "string",
29
- "format": "date-time",
30
- "description": "ISO 8601 timestamp when workflow completed (if finished)"
31
- }
32
- }
33
- },
34
- "mode": {
35
- "type": "string",
36
- "enum": ["initial_scan", "full_rescan", "deep_dive"],
37
- "description": "Workflow execution mode"
38
- },
39
- "scan_level": {
40
- "type": "string",
41
- "enum": ["quick", "deep", "exhaustive"],
42
- "description": "Scan depth level (deep_dive mode always uses exhaustive)"
43
- },
44
- "project_root": {
45
- "type": "string",
46
- "description": "Absolute path to project root directory"
47
- },
48
- "output_folder": {
49
- "type": "string",
50
- "description": "Absolute path to output folder"
51
- },
52
- "completed_steps": {
53
- "type": "array",
54
- "items": {
55
- "type": "object",
56
- "required": ["step", "status"],
57
- "properties": {
58
- "step": {
59
- "type": "string",
60
- "description": "Step identifier (e.g., 'step_1', 'step_2')"
61
- },
62
- "status": {
63
- "type": "string",
64
- "enum": ["completed", "partial", "failed"]
65
- },
66
- "timestamp": {
67
- "type": "string",
68
- "format": "date-time"
69
- },
70
- "outputs": {
71
- "type": "array",
72
- "items": { "type": "string" },
73
- "description": "Files written during this step"
74
- },
75
- "summary": {
76
- "type": "string",
77
- "description": "1-2 sentence summary of step outcome"
78
- }
79
- }
80
- }
81
- },
82
- "current_step": {
83
- "type": "string",
84
- "description": "Current step identifier for resumption"
85
- },
86
- "findings": {
87
- "type": "object",
88
- "description": "High-level summaries only (detailed findings purged after writing)",
89
- "properties": {
90
- "project_classification": {
91
- "type": "object",
92
- "properties": {
93
- "repository_type": { "type": "string" },
94
- "parts_count": { "type": "integer" },
95
- "primary_language": { "type": "string" },
96
- "architecture_type": { "type": "string" }
97
- }
98
- },
99
- "technology_stack": {
100
- "type": "array",
101
- "items": {
102
- "type": "object",
103
- "properties": {
104
- "part_id": { "type": "string" },
105
- "tech_summary": { "type": "string" }
106
- }
107
- }
108
- },
109
- "batches_completed": {
110
- "type": "array",
111
- "description": "For deep/exhaustive scans: subfolders processed",
112
- "items": {
113
- "type": "object",
114
- "properties": {
115
- "path": { "type": "string" },
116
- "files_scanned": { "type": "integer" },
117
- "summary": { "type": "string" }
118
- }
119
- }
120
- }
121
- }
122
- },
123
- "outputs_generated": {
124
- "type": "array",
125
- "items": { "type": "string" },
126
- "description": "List of all output files generated"
127
- },
128
- "resume_instructions": {
129
- "type": "string",
130
- "description": "Instructions for resuming from current_step"
131
- },
132
- "validation_status": {
133
- "type": "object",
134
- "properties": {
135
- "last_validated": {
136
- "type": "string",
137
- "format": "date-time"
138
- },
139
- "validation_errors": {
140
- "type": "array",
141
- "items": { "type": "string" }
142
- }
143
- }
144
- },
145
- "deep_dive_targets": {
146
- "type": "array",
147
- "description": "Track deep-dive areas analyzed (for deep_dive mode)",
148
- "items": {
149
- "type": "object",
150
- "properties": {
151
- "target_name": { "type": "string" },
152
- "target_path": { "type": "string" },
153
- "files_analyzed": { "type": "integer" },
154
- "output_file": { "type": "string" },
155
- "timestamp": { "type": "string", "format": "date-time" }
156
- }
157
- }
158
- }
159
- }
160
- }
@@ -1,41 +0,0 @@
1
- # DO NOT EDIT -- overwritten on every update.
2
- #
3
- # Workflow customization surface for gds-quick-dev. Mirrors the
4
- # agent customization shape under the [workflow] namespace.
5
-
6
- [workflow]
7
-
8
- # --- Configurable below. Overrides merge per BMad structural rules: ---
9
- # scalars: override wins • arrays (persistent_facts, activation_steps_*): append
10
- # arrays-of-tables with `code`/`id`: replace matching items, append new ones.
11
-
12
- # Steps to run before the standard activation (config load, greet).
13
- # Overrides append. Use for pre-flight loads, compliance checks, etc.
14
-
15
- activation_steps_prepend = []
16
-
17
- # Steps to run after greet but before the workflow begins.
18
- # Overrides append. Use for context-heavy setup that should happen
19
- # once the user has been acknowledged.
20
-
21
- activation_steps_append = []
22
-
23
- # Persistent facts the workflow keeps in mind for the whole run
24
- # (standards, compliance constraints, stylistic guardrails).
25
- # Distinct from the runtime memory sidecar — these are static context
26
- # loaded on activation. Overrides append.
27
- #
28
- # Each entry is either:
29
- # - a literal sentence, e.g. "Quick dev work must follow the project's existing architecture and conventions, not invent new ones."
30
- # - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/standards.md"
31
- # (glob patterns are supported; the file's contents are loaded and treated as facts).
32
-
33
- persistent_facts = [
34
- "file:{project-root}/**/project-context.md",
35
- ]
36
-
37
- # Scalar: executed when the workflow reaches step-05-present.md (final present/review
38
- # step), after the artifact is produced and reviewed. Override wins.
39
- # Leave empty for no custom post-completion behavior.
40
-
41
- on_complete = ""
@@ -1,450 +0,0 @@
1
- /**
2
- * BMad Game Dev Studio Documentation Build Pipeline
3
- *
4
- * Consolidates docs from multiple sources, generates LLM-friendly files,
5
- * and builds the Astro+Starlight site.
6
- *
7
- * Build outputs:
8
- * build/artifacts/ - With llms.txt, llms-full.txt
9
- * build/site/ - Final Astro output (deployable)
10
- */
11
-
12
- import { execSync } from 'node:child_process';
13
- import fs from 'node:fs';
14
- import path from 'node:path';
15
- import { fileURLToPath } from 'node:url';
16
- import { getSiteUrl } from '../website/src/lib/site-url.mjs';
17
-
18
- // =============================================================================
19
- // Configuration
20
- // =============================================================================
21
-
22
- const PROJECT_ROOT = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
23
- const BUILD_DIR = path.join(PROJECT_ROOT, 'build');
24
-
25
- const REPO_URL = 'https://github.com/bmad-code-org/bmad-module-game-dev-studio';
26
-
27
- // DO NOT CHANGE THESE VALUES!
28
- // llms-full.txt is consumed by AI agents as context. Most LLMs have ~200k token limits.
29
- // 600k chars ≈ 150k tokens (safe margin). Exceeding this breaks AI agent functionality.
30
- const LLM_MAX_CHARS = 600_000;
31
- const LLM_WARN_CHARS = 500_000;
32
-
33
- const LLM_EXCLUDE_PATTERNS = [
34
- 'changelog',
35
- 'archived',
36
- // Note: Files/dirs starting with _ (like _STYLE_GUIDE.md, _archive/) are excluded in shouldExcludeFromLlm()
37
- ];
38
-
39
- // =============================================================================
40
- // Main Entry Point
41
- /**
42
- * Orchestrates the full BMad Game Dev Studio documentation build pipeline.
43
- *
44
- * Executes the high-level build steps in sequence: prints headers and paths, validates internal
45
- * documentation links, cleans the build directory, generates artifacts from the `docs/` folder,
46
- * builds the Astro site, and prints a final build summary.
47
- */
48
-
49
- async function main() {
50
- console.log();
51
- printBanner('BMad Game Dev Studio Documentation Build Pipeline');
52
- console.log();
53
- console.log(`Project root: ${PROJECT_ROOT}`);
54
- console.log(`Build directory: ${BUILD_DIR}`);
55
- console.log();
56
-
57
- cleanBuildDirectory();
58
-
59
- const docsDir = path.join(PROJECT_ROOT, 'docs');
60
- const artifactsDir = await generateArtifacts(docsDir);
61
- const siteDir = buildAstroSite();
62
-
63
- printBuildSummary(docsDir, artifactsDir, siteDir);
64
- }
65
-
66
- main().catch((error) => {
67
- console.error(error);
68
- process.exit(1);
69
- });
70
-
71
- // =============================================================================
72
- // Pipeline Stages
73
- /**
74
- * Generate LLM files for the documentation pipeline.
75
- *
76
- * Creates the build/artifacts directory and writes `llms.txt` and `llms-full.txt` (sourced from the provided docs directory).
77
- *
78
- * @param {string} docsDir - Path to the source docs directory containing Markdown files.
79
- * @returns {string} Path to the created artifacts directory.
80
- */
81
-
82
- async function generateArtifacts(docsDir) {
83
- printHeader('Generating LLM files');
84
-
85
- const outputDir = path.join(BUILD_DIR, 'artifacts');
86
- fs.mkdirSync(outputDir, { recursive: true });
87
-
88
- // Generate LLM files reading from docs/, output to artifacts/
89
- generateLlmsTxt(outputDir);
90
- generateLlmsFullTxt(docsDir, outputDir);
91
-
92
- console.log();
93
- console.log(` \u001B[32m✓\u001B[0m Artifact generation complete`);
94
-
95
- return outputDir;
96
- }
97
-
98
- /**
99
- * Builds the Astro + Starlight site and copies generated artifacts into the site output directory.
100
- *
101
- * @returns {string} The filesystem path to the built site directory (e.g., build/site).
102
- */
103
- function buildAstroSite() {
104
- printHeader('Building Astro + Starlight site');
105
-
106
- const siteDir = path.join(BUILD_DIR, 'site');
107
- const artifactsDir = path.join(BUILD_DIR, 'artifacts');
108
-
109
- // Build Astro site (outputs to build/site via astro.config.mjs)
110
- runAstroBuild();
111
- copyArtifactsToSite(artifactsDir, siteDir);
112
-
113
- console.log();
114
- console.log(` \u001B[32m✓\u001B[0m Astro build complete`);
115
-
116
- return siteDir;
117
- }
118
-
119
- // =============================================================================
120
- // LLM File Generation
121
- /**
122
- * Create a concise llms.txt summary file containing project metadata, core links, and quick navigation entries for LLM consumption.
123
- *
124
- * Writes the file to `${outputDir}/llms.txt`.
125
- *
126
- * @param {string} outputDir - Destination directory where `llms.txt` will be written.
127
- */
128
-
129
- function generateLlmsTxt(outputDir) {
130
- console.log(' → Generating llms.txt...');
131
-
132
- const siteUrl = getSiteUrl();
133
- const content = [
134
- '# BMad Game Dev Studio Documentation',
135
- '',
136
- '> Game development (Unity, Unreal, Godot) module for the BMad Method.',
137
- '',
138
- `Documentation: ${siteUrl}`,
139
- `Repository: ${REPO_URL}`,
140
- `Full docs: ${siteUrl}/llms-full.txt`,
141
- '',
142
- '## Quick Start',
143
- '',
144
- `- **[Quick Start](${siteUrl}/tutorials/quick-start)** - Get started with BMGD`,
145
- `- **[Installation](${siteUrl}/reference/installation)** - Installation guide`,
146
- '',
147
- '## Core Concepts',
148
- '',
149
- `- **[What is BMGD?](${siteUrl}/explanation/what-is-bmgd)** - Understanding the module`,
150
- `- **[Unity Support](${siteUrl}/how-to/unity)** - Unity game development`,
151
- `- **[Unreal Support](${siteUrl}/how-to/unreal)** - Unreal game development`,
152
- `- **[Godot Support](${siteUrl}/how-to/godot)** - Godot game development`,
153
- '',
154
- '---',
155
- '',
156
- '## Quick Links',
157
- '',
158
- `- [Full Documentation (llms-full.txt)](${siteUrl}/llms-full.txt) - Complete docs for AI context`,
159
- '',
160
- ].join('\n');
161
-
162
- const outputPath = path.join(outputDir, 'llms.txt');
163
- fs.writeFileSync(outputPath, content, 'utf-8');
164
- console.log(` Generated llms.txt (${content.length.toLocaleString()} chars)`);
165
- }
166
-
167
- /**
168
- * Builds a consolidated llms-full.txt containing all Markdown files under docsDir wrapped in <document path="..."> tags for LLM consumption.
169
- *
170
- * Writes the generated file to outputDir/llms-full.txt. Files matching LLM_EXCLUDE_PATTERNS are skipped; read errors for individual files are logged. The combined content is validated against configured size thresholds (will exit on overflow and warn if near limit).
171
- * @param {string} docsDir - Root directory containing source Markdown files; paths in the output are relative to this directory.
172
- * @param {string} outputDir - Directory where llms-full.txt will be written.
173
- */
174
- function generateLlmsFullTxt(docsDir, outputDir) {
175
- console.log(' → Generating llms-full.txt...');
176
-
177
- const date = new Date().toISOString().split('T')[0];
178
- const files = getAllMarkdownFiles(docsDir).sort(compareLlmDocs);
179
-
180
- const output = [
181
- '# BMad Game Dev Studio Documentation (Full)',
182
- '',
183
- '> Complete documentation for AI consumption',
184
- `> Generated: ${date}`,
185
- `> Repository: ${REPO_URL}`,
186
- '',
187
- ];
188
-
189
- let fileCount = 0;
190
- let skippedCount = 0;
191
-
192
- for (const mdPath of files) {
193
- if (shouldExcludeFromLlm(mdPath)) {
194
- skippedCount++;
195
- continue;
196
- }
197
-
198
- const fullPath = path.join(docsDir, mdPath);
199
- try {
200
- const content = readMarkdownContent(fullPath);
201
- output.push(`<document path="${mdPath}">`, content, '</document>', '');
202
- fileCount++;
203
- } catch (error) {
204
- console.error(` Warning: Could not read ${mdPath}: ${error.message}`);
205
- }
206
- }
207
-
208
- const result = output.join('\n');
209
- validateLlmSize(result);
210
-
211
- const outputPath = path.join(outputDir, 'llms-full.txt');
212
- fs.writeFileSync(outputPath, result, 'utf-8');
213
-
214
- const tokenEstimate = Math.floor(result.length / 4).toLocaleString();
215
- console.log(
216
- ` Processed ${fileCount} files (skipped ${skippedCount}), ${result.length.toLocaleString()} chars (~${tokenEstimate} tokens)`,
217
- );
218
- }
219
-
220
- function compareLlmDocs(a, b) {
221
- const aKey = getLlmSortKey(a);
222
- const bKey = getLlmSortKey(b);
223
-
224
- if (aKey !== bKey) return aKey - bKey;
225
- return a.localeCompare(b);
226
- }
227
-
228
- function getLlmSortKey(filePath) {
229
- if (filePath === 'index.md') return 0;
230
- if (filePath.startsWith(`tutorials${path.sep}`) || filePath.startsWith('tutorials/')) return 2;
231
- if (filePath.startsWith(`how-to${path.sep}`) || filePath.startsWith('how-to/')) return 3;
232
- if (filePath.startsWith(`explanation${path.sep}`) || filePath.startsWith('explanation/')) return 4;
233
- if (filePath.startsWith(`reference${path.sep}`) || filePath.startsWith('reference/')) return 5;
234
- if (filePath.startsWith(`game-dev${path.sep}`) || filePath.startsWith('game-dev/')) return 6;
235
- return 7;
236
- }
237
-
238
- /**
239
- * Collects all Markdown (.md) files under a directory and returns their paths relative to a base directory.
240
- * @param {string} dir - Directory to search for Markdown files.
241
- * @param {string} [baseDir=dir] - Base directory used to compute returned relative paths.
242
- * @returns {string[]} An array of file paths (relative to `baseDir`) for every `.md` file found under `dir`.
243
- */
244
- function getAllMarkdownFiles(dir, baseDir = dir) {
245
- const files = [];
246
-
247
- for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
248
- const fullPath = path.join(dir, entry.name);
249
-
250
- if (entry.isDirectory()) {
251
- files.push(...getAllMarkdownFiles(fullPath, baseDir));
252
- } else if (entry.name.endsWith('.md')) {
253
- // Return relative path from baseDir
254
- const relativePath = path.relative(baseDir, fullPath);
255
- files.push(relativePath);
256
- }
257
- }
258
-
259
- return files;
260
- }
261
-
262
- /**
263
- * Determine whether a file path matches any configured LLM exclusion pattern.
264
- * Also excludes any files or directories starting with underscore.
265
- * @param {string} filePath - The file path to test.
266
- * @returns {boolean} `true` if excluded, `false` otherwise.
267
- */
268
- function shouldExcludeFromLlm(filePath) {
269
- // Exclude if ANY path component starts with underscore
270
- // (e.g., _STYLE_GUIDE.md, _archive/file.md, dir/_STYLE_GUIDE.md)
271
- const pathParts = filePath.split(path.sep);
272
- if (pathParts.some((part) => part.startsWith('_'))) return true;
273
-
274
- // Check configured patterns
275
- return LLM_EXCLUDE_PATTERNS.some((pattern) => filePath.includes(pattern));
276
- }
277
-
278
- function readMarkdownContent(filePath) {
279
- let content = fs.readFileSync(filePath, 'utf-8');
280
-
281
- if (content.startsWith('---')) {
282
- const end = content.indexOf('---', 3);
283
- if (end !== -1) {
284
- content = content.slice(end + 3).trim();
285
- }
286
- }
287
-
288
- return content;
289
- }
290
-
291
- function validateLlmSize(content) {
292
- const charCount = content.length;
293
-
294
- if (charCount > LLM_MAX_CHARS) {
295
- console.error(` ERROR: Exceeds ${LLM_MAX_CHARS.toLocaleString()} char limit`);
296
- process.exit(1);
297
- } else if (charCount > LLM_WARN_CHARS) {
298
- console.warn(` \u001B[33mWARNING: Approaching ${LLM_WARN_CHARS.toLocaleString()} char limit\u001B[0m`);
299
- }
300
- }
301
-
302
- // =============================================================================
303
- // Astro Build
304
- /**
305
- * Builds the Astro site to build/site (configured in astro.config.mjs).
306
- */
307
- function runAstroBuild() {
308
- console.log(' → Running astro build...');
309
- execSync('npx astro build --root website', {
310
- cwd: PROJECT_ROOT,
311
- stdio: 'inherit',
312
- env: {
313
- ...process.env,
314
- },
315
- });
316
- }
317
-
318
- /**
319
- * Copy generated artifact files into the built site directory.
320
- *
321
- * Copies llms.txt and llms-full.txt from the artifacts directory into the site directory.
322
- *
323
- * @param {string} artifactsDir - Path to the build artifacts directory containing generated files.
324
- * @param {string} siteDir - Path to the target site directory where artifacts should be placed.
325
- */
326
- function copyArtifactsToSite(artifactsDir, siteDir) {
327
- console.log(' → Copying artifacts to site...');
328
-
329
- fs.copyFileSync(path.join(artifactsDir, 'llms.txt'), path.join(siteDir, 'llms.txt'));
330
- fs.copyFileSync(path.join(artifactsDir, 'llms-full.txt'), path.join(siteDir, 'llms-full.txt'));
331
- }
332
-
333
- // =============================================================================
334
- // Build Summary
335
- /**
336
- * Prints a concise end-of-build summary and displays a sample listing of the final site directory.
337
- *
338
- * @param {string} docsDir - Path to the source documentation directory used for the build.
339
- * @param {string} artifactsDir - Path to the directory containing generated artifacts (e.g., llms.txt).
340
- * @param {string} siteDir - Path to the final built site directory whose contents will be listed.
341
- */
342
-
343
- function printBuildSummary(docsDir, artifactsDir, siteDir) {
344
- console.log();
345
- printBanner('Build Complete!');
346
- console.log();
347
- console.log('Build artifacts:');
348
- console.log(` Source docs: ${docsDir}`);
349
- console.log(` Generated files: ${artifactsDir}`);
350
- console.log(` Final site: ${siteDir}`);
351
- console.log();
352
- console.log(`Deployable output: ${siteDir}/`);
353
- console.log();
354
-
355
- listDirectoryContents(siteDir);
356
- }
357
-
358
- function listDirectoryContents(dir) {
359
- const entries = fs.readdirSync(dir).slice(0, 15);
360
-
361
- for (const entry of entries) {
362
- const fullPath = path.join(dir, entry);
363
- const stat = fs.statSync(fullPath);
364
-
365
- if (stat.isFile()) {
366
- const sizeStr = formatFileSize(stat.size);
367
- console.log(` ${entry.padEnd(40)} ${sizeStr.padStart(8)}`);
368
- } else {
369
- console.log(` ${entry}/`);
370
- }
371
- }
372
- }
373
-
374
- /**
375
- * Format a byte count into a compact human-readable string using B, K, or M units.
376
- * @param {number} bytes - The number of bytes to format.
377
- * @returns {string} The formatted size: bytes as `N B` (e.g. `512B`), kilobytes truncated to an integer with `K` (e.g. `2K`), or megabytes with one decimal and `M` (e.g. `1.2M`).
378
- */
379
- function formatFileSize(bytes) {
380
- if (bytes > 1024 * 1024) {
381
- return `${(bytes / 1024 / 1024).toFixed(1)}M`;
382
- } else if (bytes > 1024) {
383
- return `${Math.floor(bytes / 1024)}K`;
384
- }
385
- return `${bytes}B`;
386
- }
387
-
388
- // =============================================================================
389
- // File System Utilities
390
- /**
391
- * Remove any existing build output and recreate the build directory.
392
- *
393
- * Ensures the configured BUILD_DIR is empty by deleting it if present and then creating a fresh directory.
394
- */
395
-
396
- function cleanBuildDirectory() {
397
- console.log('Cleaning previous build...');
398
-
399
- if (fs.existsSync(BUILD_DIR)) {
400
- fs.rmSync(BUILD_DIR, { recursive: true });
401
- }
402
- fs.mkdirSync(BUILD_DIR, { recursive: true });
403
- }
404
-
405
- /**
406
- * Recursively copies all files and subdirectories from one directory to another, creating the destination if needed.
407
- *
408
- * @param {string} src - Path to the source directory to copy from.
409
- * @param {string} dest - Path to the destination directory to copy to.
410
- * @param {string[]} [exclude=[]] - List of file or directory names (not paths) to skip while copying.
411
- * @returns {boolean} `true` if the source existed and copying proceeded, `false` if the source did not exist.
412
- */
413
- function copyDirectory(src, dest, exclude = []) {
414
- if (!fs.existsSync(src)) return false;
415
- fs.mkdirSync(dest, { recursive: true });
416
-
417
- for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
418
- if (exclude.includes(entry.name)) continue;
419
-
420
- const srcPath = path.join(src, entry.name);
421
- const destPath = path.join(dest, entry.name);
422
-
423
- if (entry.isDirectory()) {
424
- copyDirectory(srcPath, destPath, exclude);
425
- } else {
426
- fs.copyFileSync(srcPath, destPath);
427
- }
428
- }
429
- return true;
430
- }
431
-
432
- // =============================================================================
433
- // Console Output Formatting
434
- // =============================================================================
435
-
436
- function printHeader(title) {
437
- console.log();
438
- console.log('┌' + '─'.repeat(62) + '┐');
439
- console.log(`│ ${title.padEnd(60)} │`);
440
- console.log('└' + '─'.repeat(62) + '┘');
441
- }
442
-
443
- /**
444
- * Prints a centered decorative ASCII banner to the console using the provided title.
445
- * @param {string} title - Text to display centered inside the banner. */
446
- function printBanner(title) {
447
- console.log('╔' + '═'.repeat(62) + '╗');
448
- console.log(`║${title.padStart(31 + title.length / 2).padEnd(62)}║`);
449
- console.log('╚' + '═'.repeat(62) + '╝');
450
- }