brainforge-ai 1.1.1 → 1.2.1

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 (57) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +863 -420
  3. package/dist/cli.js +47 -2
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/defensePack.d.ts +2 -0
  6. package/dist/commands/defensePack.d.ts.map +1 -0
  7. package/dist/commands/defensePack.js +269 -0
  8. package/dist/commands/defensePack.js.map +1 -0
  9. package/dist/commands/difficulty.d.ts +2 -0
  10. package/dist/commands/difficulty.d.ts.map +1 -0
  11. package/dist/commands/difficulty.js +177 -0
  12. package/dist/commands/difficulty.js.map +1 -0
  13. package/dist/commands/doctor.d.ts.map +1 -1
  14. package/dist/commands/doctor.js +53 -1
  15. package/dist/commands/doctor.js.map +1 -1
  16. package/dist/commands/help.d.ts.map +1 -1
  17. package/dist/commands/help.js +24 -1
  18. package/dist/commands/help.js.map +1 -1
  19. package/dist/commands/init.d.ts +6 -1
  20. package/dist/commands/init.d.ts.map +1 -1
  21. package/dist/commands/init.js +64 -2
  22. package/dist/commands/init.js.map +1 -1
  23. package/dist/commands/professorCheck.d.ts +2 -0
  24. package/dist/commands/professorCheck.d.ts.map +1 -0
  25. package/dist/commands/professorCheck.js +203 -0
  26. package/dist/commands/professorCheck.js.map +1 -0
  27. package/dist/commands/serve.js +16 -16
  28. package/dist/commands/simplify.d.ts +2 -0
  29. package/dist/commands/simplify.d.ts.map +1 -0
  30. package/dist/commands/simplify.js +174 -0
  31. package/dist/commands/simplify.js.map +1 -0
  32. package/dist/commands/status.d.ts +2 -0
  33. package/dist/commands/status.d.ts.map +1 -0
  34. package/dist/commands/status.js +105 -0
  35. package/dist/commands/status.js.map +1 -0
  36. package/dist/commands/study.d.ts +2 -0
  37. package/dist/commands/study.d.ts.map +1 -0
  38. package/dist/commands/study.js +193 -0
  39. package/dist/commands/study.js.map +1 -0
  40. package/dist/commands/update.d.ts.map +1 -1
  41. package/dist/commands/update.js +11 -2
  42. package/dist/commands/update.js.map +1 -1
  43. package/dist/core/dashboard.d.ts +41 -0
  44. package/dist/core/dashboard.d.ts.map +1 -1
  45. package/dist/core/dashboard.js +121 -0
  46. package/dist/core/dashboard.js.map +1 -1
  47. package/dist/core/dashboardTemplate.d.ts.map +1 -1
  48. package/dist/core/dashboardTemplate.js +523 -92
  49. package/dist/core/dashboardTemplate.js.map +1 -1
  50. package/dist/core/fileSystem.d.ts.map +1 -1
  51. package/dist/core/fileSystem.js +491 -309
  52. package/dist/core/fileSystem.js.map +1 -1
  53. package/dist/core/templates.d.ts +1 -0
  54. package/dist/core/templates.d.ts.map +1 -1
  55. package/dist/core/templates.js +8720 -1129
  56. package/dist/core/templates.js.map +1 -1
  57. package/package.json +58 -54
@@ -19,6 +19,7 @@ async function createBrainforgeStructure(config, cwd = process.cwd()) {
19
19
  path_1.default.join(brainDir, 'agents'),
20
20
  path_1.default.join(brainDir, 'commands'),
21
21
  path_1.default.join(brainDir, 'dashboard'),
22
+ path_1.default.join(brainDir, 'reports'),
22
23
  ];
23
24
  for (const dir of dirs) {
24
25
  await fs_extra_1.default.ensureDir(dir);
@@ -33,6 +34,8 @@ async function createBrainforgeStructure(config, cwd = process.cwd()) {
33
34
  await fs_extra_1.default.writeFile(path_1.default.join(brainDir, 'decisions.md'), generateDecisionsMd());
34
35
  // Write roadmap.md placeholder
35
36
  await fs_extra_1.default.writeFile(path_1.default.join(brainDir, 'roadmap.md'), generateRoadmapMd(config));
37
+ // Write brain.md — master project context file for AI tools
38
+ await fs_extra_1.default.writeFile(path_1.default.join(brainDir, 'brain.md'), generateBrainMd(config));
36
39
  // Write memory files
37
40
  const memoryFiles = {
38
41
  'architecture.md': generateArchitectureMd(config),
@@ -40,10 +43,15 @@ async function createBrainforgeStructure(config, cwd = process.cwd()) {
40
43
  'known-bugs.md': generateKnownBugsMd(),
41
44
  'glossary.md': generateGlossaryMd(),
42
45
  'design-system.md': generateDesignSystemMd(config),
46
+ 'project-context.md': generateProjectContextMd(),
47
+ 'constraints.md': generateConstraintsMd(config),
48
+ 'learning-notes.md': generateLearningNotesMd(),
43
49
  };
44
50
  for (const [filename, content] of Object.entries(memoryFiles)) {
45
51
  await fs_extra_1.default.writeFile(path_1.default.join(brainDir, 'memory', filename), content);
46
52
  }
53
+ // Write reports/README.md
54
+ await fs_extra_1.default.writeFile(path_1.default.join(brainDir, 'reports', 'README.md'), generateReportsReadmeMd());
47
55
  // Write phase templates
48
56
  await fs_extra_1.default.writeFile(path_1.default.join(brainDir, 'phases', 'phase-01.md'), generatePhaseMd(1, 'Project Setup & Foundation', config));
49
57
  await fs_extra_1.default.writeFile(path_1.default.join(brainDir, 'phases', 'phase-02.md'), generatePhaseMd(2, 'Core Features', config));
@@ -87,159 +95,166 @@ async function createBrainforgeStructure(config, cwd = process.cwd()) {
87
95
  await fs_extra_1.default.writeFile(filePath, content);
88
96
  }
89
97
  }
98
+ // Write Claude Code skills to .claude/skills/
99
+ const claudeSkillsDir = path_1.default.join(cwd, '.claude', 'skills');
100
+ await fs_extra_1.default.ensureDir(claudeSkillsDir);
101
+ const skills = (0, templates_1.getSkillTemplates)(config);
102
+ for (const [filename, content] of Object.entries(skills)) {
103
+ await fs_extra_1.default.writeFile(path_1.default.join(claudeSkillsDir, filename), content);
104
+ }
90
105
  }
91
106
  function generateProjectMd(config) {
92
- return `# Project: ${config.projectName}
93
-
94
- **Description:** ${config.description || '_To be filled_'}
95
- **Type:** ${config.projectType}
96
- **Stack:** ${config.stack.join(', ')}
97
- **User Level:** ${config.userLevel}
98
- **Code Level:** ${config.codeLevel}
99
- **Academic:** ${config.isAcademic ? 'Yes' : 'No'}
100
- **Created:** ${config.createdAt}
101
-
102
- ## Features
103
-
104
- - Docker: ${config.useDocker ? 'Yes' : 'No'}
105
- - Database: ${config.useDatabase ? 'Yes' : 'No'}
106
- - Authentication: ${config.useAuth ? 'Yes' : 'No'}
107
- - Admin Dashboard: ${config.useAdminDashboard ? 'Yes' : 'No'}
108
- - Responsive: ${config.useResponsive ? 'Yes' : 'No'}
109
-
110
- ## Goal
111
-
112
- _Describe the main goal of the project here._
113
-
114
- ## Scope
115
-
116
- _Define what is in scope and what is out of scope._
117
-
118
- ## Success Criteria
119
-
120
- - [ ] Core features working
121
- - [ ] Tested and reviewed
122
- - [ ] Documented
107
+ return `# Project: ${config.projectName}
108
+
109
+ **Description:** ${config.description || '_To be filled_'}
110
+ **Type:** ${config.projectType}
111
+ **Stack:** ${config.stack.join(', ')}
112
+ **User Level:** ${config.userLevel}
113
+ **Code Level:** ${config.codeLevel}
114
+ **Academic:** ${config.isAcademic ? 'Yes' : 'No'}
115
+ **Created:** ${config.createdAt}
116
+
117
+ ## Features
118
+
119
+ - Docker: ${config.useDocker ? 'Yes' : 'No'}
120
+ - Database: ${config.useDatabase ? 'Yes' : 'No'}
121
+ - Authentication: ${config.useAuth ? 'Yes' : 'No'}
122
+ - Admin Dashboard: ${config.useAdminDashboard ? 'Yes' : 'No'}
123
+ - Responsive: ${config.useResponsive ? 'Yes' : 'No'}
124
+
125
+ ## Goal
126
+
127
+ _Describe the main goal of the project here._
128
+
129
+ ## Scope
130
+
131
+ _Define what is in scope and what is out of scope._
132
+
133
+ ## Success Criteria
134
+
135
+ - [ ] Core features working
136
+ - [ ] Tested and reviewed
137
+ - [ ] Documented
123
138
  `;
124
139
  }
125
140
  function generateQuestionsMd(config) {
126
- return `# Project Questions
127
-
128
- _Answered during init_
129
-
130
- | Question | Answer |
131
- |----------|--------|
132
- | Project type | ${config.projectType} |
133
- | Stack | ${config.stack.join(', ')} |
134
- | User level | ${config.userLevel} |
135
- | Code level | ${config.codeLevel} |
136
- | Docker | ${config.useDocker ? 'Yes' : 'No'} |
137
- | Database | ${config.useDatabase ? 'Yes' : 'No'} |
138
- | Authentication | ${config.useAuth ? 'Yes' : 'No'} |
139
- | Admin dashboard | ${config.useAdminDashboard ? 'Yes' : 'No'} |
140
- | Responsive | ${config.useResponsive ? 'Yes' : 'No'} |
141
- | Academic project | ${config.isAcademic ? 'Yes' : 'No'} |
142
-
143
- ## Open Questions
144
-
145
- _Add questions that need clarification here._
146
-
147
- - [ ] ?
141
+ return `# Project Questions
142
+
143
+ _Answered during init_
144
+
145
+ | Question | Answer |
146
+ |----------|--------|
147
+ | Project type | ${config.projectType} |
148
+ | Stack | ${config.stack.join(', ')} |
149
+ | User level | ${config.userLevel} |
150
+ | Code level | ${config.codeLevel} |
151
+ | Docker | ${config.useDocker ? 'Yes' : 'No'} |
152
+ | Database | ${config.useDatabase ? 'Yes' : 'No'} |
153
+ | Authentication | ${config.useAuth ? 'Yes' : 'No'} |
154
+ | Admin dashboard | ${config.useAdminDashboard ? 'Yes' : 'No'} |
155
+ | Responsive | ${config.useResponsive ? 'Yes' : 'No'} |
156
+ | Academic project | ${config.isAcademic ? 'Yes' : 'No'} |
157
+
158
+ ## Open Questions
159
+
160
+ _Add questions that need clarification here._
161
+
162
+ - [ ] ?
148
163
  `;
149
164
  }
150
165
  function generateDecisionsMd() {
151
- return `# Architecture Decisions
152
-
153
- _Decisions taken during the project_
154
-
155
- ## Format
156
-
157
- \`\`\`
158
- - [YYYY-MM-DD] Decision title
159
- Context: why this decision was needed
160
- Choice: what was decided
161
- Reason: why this option
162
- \`\`\`
163
-
164
- ## Decisions
165
-
166
- - [${new Date().toISOString().slice(0, 10)}] Project initialized with BrainForge
167
- Context: Starting a new project
168
- Choice: Using BrainForge CLI
169
- Reason: Structured, AI-assisted development workflow
166
+ return `# Architecture Decisions
167
+
168
+ _Decisions taken during the project_
169
+
170
+ ## Format
171
+
172
+ \`\`\`
173
+ - [YYYY-MM-DD] Decision title
174
+ Context: why this decision was needed
175
+ Choice: what was decided
176
+ Reason: why this option
177
+ \`\`\`
178
+
179
+ ## Decisions
180
+
181
+ - [${new Date().toISOString().slice(0, 10)}] Project initialized with BrainForge
182
+ Context: Starting a new project
183
+ Choice: Using BrainForge CLI
184
+ Reason: Structured, AI-assisted development workflow
170
185
  `;
171
186
  }
172
187
  function generateRoadmapMd(config) {
173
- return `# Project Roadmap: ${config.projectName}
174
-
175
- _Generated by BrainForge. Run /create-roadmap to generate a detailed roadmap._
176
-
177
- ## Epic 1: Foundation
178
-
179
- ### Feature 1.1: Project Setup
180
- - Task: Initialize project structure
181
- - Subtask: Create folder structure
182
- - Subtask: Configure environment
183
- - Task: Setup stack
184
- - Subtask: Install dependencies
185
- - Subtask: Configure tools
186
-
187
- ### Feature 1.2: Core Architecture
188
- - Task: Define data models
189
- - Task: Setup routing/navigation
190
-
191
- ## Epic 2: Core Features
192
-
193
- ### Feature 2.1: Main Functionality
194
- - Task: Implement primary feature
195
- - Task: Connect to data source
196
-
197
- ### Feature 2.2: UI/UX
198
- - Task: Build main screens
199
- - Task: Make responsive
200
-
201
- ## Epic 3: Quality & Delivery
202
-
203
- ### Feature 3.1: Testing
204
- - Task: Unit tests
205
- - Task: Integration tests
206
-
207
- ### Feature 3.2: Documentation
208
- - Task: Write README
209
- - Task: Prepare presentation
210
-
211
- ## Phase Summary
212
-
213
- | Phase | Epic | Status |
214
- |-------|------|--------|
215
- | Phase 01 | Foundation | pending |
216
- | Phase 02 | Core Features | pending |
188
+ return `# Project Roadmap: ${config.projectName}
189
+
190
+ _Generated by BrainForge. Run /create-roadmap to generate a detailed roadmap._
191
+
192
+ ## Epic 1: Foundation
193
+
194
+ ### Feature 1.1: Project Setup
195
+ - Task: Initialize project structure
196
+ - Subtask: Create folder structure
197
+ - Subtask: Configure environment
198
+ - Task: Setup stack
199
+ - Subtask: Install dependencies
200
+ - Subtask: Configure tools
201
+
202
+ ### Feature 1.2: Core Architecture
203
+ - Task: Define data models
204
+ - Task: Setup routing/navigation
205
+
206
+ ## Epic 2: Core Features
207
+
208
+ ### Feature 2.1: Main Functionality
209
+ - Task: Implement primary feature
210
+ - Task: Connect to data source
211
+
212
+ ### Feature 2.2: UI/UX
213
+ - Task: Build main screens
214
+ - Task: Make responsive
215
+
216
+ ## Epic 3: Quality & Delivery
217
+
218
+ ### Feature 3.1: Testing
219
+ - Task: Unit tests
220
+ - Task: Integration tests
221
+
222
+ ### Feature 3.2: Documentation
223
+ - Task: Write README
224
+ - Task: Prepare presentation
225
+
226
+ ## Phase Summary
227
+
228
+ | Phase | Epic | Status |
229
+ |-------|------|--------|
230
+ | Phase 01 | Foundation | pending |
231
+ | Phase 02 | Core Features | pending |
217
232
  `;
218
233
  }
219
234
  function generateArchitectureMd(config) {
220
- return `# Architecture Memory
221
-
222
- **Stack:** ${config.stack.join(', ')}
223
- **Pattern:** _To be defined_
224
-
225
- ## Folder Structure
226
-
227
- \`\`\`
228
- project/
229
- _Update this as you build_
230
- \`\`\`
231
-
232
- ## Key Decisions
233
-
234
- _Add architecture decisions here as the project evolves._
235
-
236
- ## Data Flow
237
-
238
- _Describe how data flows through your application._
239
-
240
- ## External Services
241
-
242
- _List any external APIs, databases, or services._
235
+ return `# Architecture Memory
236
+
237
+ **Stack:** ${config.stack.join(', ')}
238
+ **Pattern:** _To be defined_
239
+
240
+ ## Folder Structure
241
+
242
+ \`\`\`
243
+ project/
244
+ _Update this as you build_
245
+ \`\`\`
246
+
247
+ ## Key Decisions
248
+
249
+ _Add architecture decisions here as the project evolves._
250
+
251
+ ## Data Flow
252
+
253
+ _Describe how data flows through your application._
254
+
255
+ ## External Services
256
+
257
+ _List any external APIs, databases, or services._
243
258
  `;
244
259
  }
245
260
  function generateCodingStyleMd(config) {
@@ -280,189 +295,356 @@ function generateCodingStyleMd(config) {
280
295
  ],
281
296
  };
282
297
  const levelRules = rules[config.codeLevel] || rules['intermediate'];
283
- return `# Coding Style Guide
284
-
285
- **Level:** ${config.codeLevel}
286
- **User Level:** ${config.userLevel}
287
-
288
- ## Rules
289
-
290
- ${levelRules.map((r) => `- ${r}`).join('\n')}
291
-
292
- ## Stack Conventions
293
-
294
- **Stack:** ${config.stack.join(', ')}
295
-
296
- _Update this section with conventions specific to your stack._
297
-
298
- ## What to Avoid
299
-
300
- - Over-engineered abstractions
301
- - Premature optimization
302
- - Unnecessary dependencies
303
- - Magic strings/numbers without constants
304
- - Dead code
305
-
306
- ## Code Level Engine
307
-
308
- \`\`\`
309
- beginner → simple, direct, few files, FR comments
310
- intermediate → clean, modular, good practices
311
- professional → strict, tested, secure, scalable
312
- academic-realistic → clean but natural, explainable, no enterprise patterns
313
- \`\`\`
298
+ return `# Coding Style Guide
299
+
300
+ **Level:** ${config.codeLevel}
301
+ **User Level:** ${config.userLevel}
302
+
303
+ ## Rules
304
+
305
+ ${levelRules.map((r) => `- ${r}`).join('\n')}
306
+
307
+ ## Stack Conventions
308
+
309
+ **Stack:** ${config.stack.join(', ')}
310
+
311
+ _Update this section with conventions specific to your stack._
312
+
313
+ ## What to Avoid
314
+
315
+ - Over-engineered abstractions
316
+ - Premature optimization
317
+ - Unnecessary dependencies
318
+ - Magic strings/numbers without constants
319
+ - Dead code
320
+
321
+ ## Code Level Engine
322
+
323
+ \`\`\`
324
+ beginner → simple, direct, few files, FR comments
325
+ intermediate → clean, modular, good practices
326
+ professional → strict, tested, secure, scalable
327
+ academic-realistic → clean but natural, explainable, no enterprise patterns
328
+ \`\`\`
314
329
  `;
315
330
  }
316
331
  function generateKnownBugsMd() {
317
- return `# Known Bugs
318
-
319
- _Updated automatically during /debug-issue and /review-phase_
320
-
321
- ## Active
322
-
323
- _No bugs tracked yet._
324
-
325
- ## Resolved
326
-
327
- _No resolved bugs yet._
328
-
329
- ## Format
330
-
331
- \`\`\`
332
- - [YYYY-MM-DD] Bug title
333
- File: path/to/file.ts
334
- Description: what happens
335
- Status: active | resolved
336
- Fix: how it was fixed (if resolved)
337
- \`\`\`
332
+ return `# Known Bugs
333
+
334
+ _Updated automatically during /debug-issue and /review-phase_
335
+
336
+ ## Active
337
+
338
+ _No bugs tracked yet._
339
+
340
+ ## Resolved
341
+
342
+ _No resolved bugs yet._
343
+
344
+ ## Format
345
+
346
+ \`\`\`
347
+ - [YYYY-MM-DD] Bug title
348
+ File: path/to/file.ts
349
+ Description: what happens
350
+ Status: active | resolved
351
+ Fix: how it was fixed (if resolved)
352
+ \`\`\`
338
353
  `;
339
354
  }
340
355
  function generateGlossaryMd() {
341
- return `# Project Glossary
342
-
343
- _Define domain terms and technical jargon here._
344
-
345
- | Term | Definition |
346
- |------|------------|
347
- | BrainForge | The CLI tool managing this project |
348
- | Phase | A structured development step with a clear goal |
349
- | Checkpoint | A git commit marking a stable state |
350
- | Code Level | The complexity target for generated/written code |
351
-
352
- _Add more terms as your project grows._
356
+ return `# Project Glossary
357
+
358
+ _Define domain terms and technical jargon here._
359
+
360
+ | Term | Definition |
361
+ |------|------------|
362
+ | BrainForge | The CLI tool managing this project |
363
+ | Phase | A structured development step with a clear goal |
364
+ | Checkpoint | A git commit marking a stable state |
365
+ | Code Level | The complexity target for generated/written code |
366
+
367
+ _Add more terms as your project grows._
353
368
  `;
354
369
  }
355
370
  function generateDesignSystemMd(config) {
356
- return `# Design System
357
-
358
- **Project:** ${config.projectName}
359
- **Style:** Modern, clean, minimal
360
-
361
- ## Colors
362
-
363
- \`\`\`css
364
- --color-primary: #6366f1;
365
- --color-secondary: #8b5cf6;
366
- --color-success: #22c55e;
367
- --color-warning: #f59e0b;
368
- --color-error: #ef4444;
369
- --color-bg: #0f172a;
370
- --color-surface: #1e293b;
371
- --color-text: #f1f5f9;
372
- --color-muted: #94a3b8;
373
- \`\`\`
374
-
375
- ## Typography
376
-
377
- - Headings: Inter, system-ui
378
- - Body: Inter, system-ui
379
- - Code: JetBrains Mono, monospace
380
- - Base size: 16px
381
-
382
- ## Spacing
383
-
384
- Use multiples of 4px: 4, 8, 12, 16, 24, 32, 48, 64
385
-
386
- ## Components
387
-
388
- - Buttons: rounded-md, padding 8px 16px
389
- - Cards: rounded-lg, shadow-md, bg surface
390
- - Inputs: border, rounded-md, focus ring primary
391
- - Badges: small, rounded-full
392
-
393
- ## Responsive Rules
394
-
395
- - Mobile first
396
- - Breakpoints: 640px (sm), 768px (md), 1024px (lg), 1280px (xl)
397
- - Max container width: 1280px
398
-
399
- ## Dark Mode
400
-
401
- Default dark. Light mode optional via class toggle.
402
-
403
- ## Animations
404
-
405
- - Transitions: 150ms ease
406
- - Hover effects: subtle scale or color shift
407
- - No flashy animations — keep it professional
371
+ return `# Design System
372
+
373
+ **Project:** ${config.projectName}
374
+ **Style:** Modern, clean, minimal
375
+
376
+ ## Colors
377
+
378
+ \`\`\`css
379
+ --color-primary: #6366f1;
380
+ --color-secondary: #8b5cf6;
381
+ --color-success: #22c55e;
382
+ --color-warning: #f59e0b;
383
+ --color-error: #ef4444;
384
+ --color-bg: #0f172a;
385
+ --color-surface: #1e293b;
386
+ --color-text: #f1f5f9;
387
+ --color-muted: #94a3b8;
388
+ \`\`\`
389
+
390
+ ## Typography
391
+
392
+ - Headings: Inter, system-ui
393
+ - Body: Inter, system-ui
394
+ - Code: JetBrains Mono, monospace
395
+ - Base size: 16px
396
+
397
+ ## Spacing
398
+
399
+ Use multiples of 4px: 4, 8, 12, 16, 24, 32, 48, 64
400
+
401
+ ## Components
402
+
403
+ - Buttons: rounded-md, padding 8px 16px
404
+ - Cards: rounded-lg, shadow-md, bg surface
405
+ - Inputs: border, rounded-md, focus ring primary
406
+ - Badges: small, rounded-full
407
+
408
+ ## Responsive Rules
409
+
410
+ - Mobile first
411
+ - Breakpoints: 640px (sm), 768px (md), 1024px (lg), 1280px (xl)
412
+ - Max container width: 1280px
413
+
414
+ ## Dark Mode
415
+
416
+ Default dark. Light mode optional via class toggle.
417
+
418
+ ## Animations
419
+
420
+ - Transitions: 150ms ease
421
+ - Hover effects: subtle scale or color shift
422
+ - No flashy animations — keep it professional
408
423
  `;
409
424
  }
410
425
  function generatePhaseMd(phaseNum, title, config) {
411
426
  const padded = String(phaseNum).padStart(2, '0');
412
- return `# Phase ${padded}: ${title}
413
-
414
- **Status:** pending
415
- **Project:** ${config.projectName}
416
- **Stack:** ${config.stack.join(', ')}
417
- **Code Level:** ${config.codeLevel}
418
-
419
- ## Objective
420
-
421
- _Describe what this phase must accomplish._
422
-
423
- ## Context
424
-
425
- _What should be already done before this phase starts?_
426
-
427
- ## Files Likely Involved
428
-
429
- _List the files that will be created or modified._
430
-
431
- \`\`\`
432
- _To be filled during /initiate-phase_
433
- \`\`\`
434
-
435
- ## Dependencies
436
-
437
- - Depends on: Phase ${phaseNum === 1 ? 'none' : '0' + (phaseNum - 1)}
438
- - Blocking: Phase ${String(phaseNum + 1).padStart(2, '0')}
439
-
440
- ## Execution Plan
441
-
442
- _Generated by /initiate-phase_
443
-
444
- - [ ] Step 1
445
- - [ ] Step 2
446
- - [ ] Step 3
447
-
448
- ## Validation Criteria
449
-
450
- - [ ] Feature works as expected
451
- - [ ] No obvious bugs
452
- - [ ] Code matches level: ${config.codeLevel}
453
- - [ ] Committed with checkpoint
454
-
455
- ## Risks
456
-
457
- - _Add risks here_
458
-
459
- ## Difficulty
460
-
461
- **Level:** medium
462
-
463
- ## Notes
464
-
465
- _Add notes during execution_
427
+ return `# Phase ${padded}: ${title}
428
+
429
+ **Status:** pending
430
+ **Project:** ${config.projectName}
431
+ **Stack:** ${config.stack.join(', ')}
432
+ **Code Level:** ${config.codeLevel}
433
+
434
+ ## Objective
435
+
436
+ _Describe what this phase must accomplish._
437
+
438
+ ## Context
439
+
440
+ _What should be already done before this phase starts?_
441
+
442
+ ## Files Likely Involved
443
+
444
+ _List the files that will be created or modified._
445
+
446
+ \`\`\`
447
+ _To be filled during /initiate-phase_
448
+ \`\`\`
449
+
450
+ ## Dependencies
451
+
452
+ - Depends on: Phase ${phaseNum === 1 ? 'none' : '0' + (phaseNum - 1)}
453
+ - Blocking: Phase ${String(phaseNum + 1).padStart(2, '0')}
454
+
455
+ ## Execution Plan
456
+
457
+ _Generated by /initiate-phase_
458
+
459
+ - [ ] Step 1
460
+ - [ ] Step 2
461
+ - [ ] Step 3
462
+
463
+ ## Validation Criteria
464
+
465
+ - [ ] Feature works as expected
466
+ - [ ] No obvious bugs
467
+ - [ ] Code matches level: ${config.codeLevel}
468
+ - [ ] Committed with checkpoint
469
+
470
+ ## Risks
471
+
472
+ - _Add risks here_
473
+
474
+ ## Difficulty
475
+
476
+ **Level:** medium
477
+
478
+ ## Notes
479
+
480
+ _Add notes during execution_
481
+ `;
482
+ }
483
+ function generateBrainMd(config) {
484
+ const today = new Date().toISOString().slice(0, 10);
485
+ const enabledFeatures = [
486
+ config.useDocker && 'docker',
487
+ config.useDatabase && 'database',
488
+ config.useAuth && 'auth',
489
+ config.useAdminDashboard && 'admin',
490
+ config.useResponsive && 'responsive',
491
+ ].filter(Boolean).join(', ') || 'none';
492
+ const phaseFile = `phase-${String(config.currentPhase || 1).padStart(2, '0')}.md`;
493
+ return `# brain: ${config.projectName}
494
+
495
+ > **Load ONLY this file at session start.** It replaces config.json + project.md + coding-style.md.
496
+ > Load other .brainforge/ files only when you need specific detail. Generated ${today}.
497
+
498
+ project=${config.projectType} | stack=${config.stack.join(', ')} | level=${config.codeLevel} | user=${config.userLevel} | academic=${config.isAcademic ? 'yes' : 'no'}
499
+ features=${enabledFeatures} | phase=${config.currentPhase}/${config.totalPhases}
500
+
501
+ ## goal
502
+
503
+ ${config.description || '_Describe the project goal here._'}
504
+
505
+ ## rules
506
+
507
+ - Code at **${config.codeLevel}** level — not above, not below
508
+ - No features outside the current phase scope
509
+ - Commit with \`/checkpoint\` only — never \`git push\`
510
+ - Update \`.brainforge/memory/\` after any significant structural change
511
+
512
+ ## Session Start Checklist
513
+
514
+ 1. Read this file ← you are here
515
+ 2. Load active phase: \`.brainforge/phases/${phaseFile}\`
516
+ 3. That's it — load other files only when the task requires them
517
+
518
+ ## Memory Index
519
+
520
+ | File | When to load |
521
+ |------|--------------|
522
+ | \`.brainforge/memory/architecture.md\` | before changing folder structure or modules |
523
+ | \`.brainforge/memory/coding-style.md\` | before writing any code |
524
+ | \`.brainforge/memory/known-bugs.md\` | when debugging |
525
+ | \`.brainforge/memory/glossary.md\` | when domain terms are ambiguous |
526
+ | \`.brainforge/memory/design-system.md\` | before any UI/CSS work |
527
+ | \`.brainforge/memory/project-context.md\`| for long-term project context |
528
+ | \`.brainforge/memory/constraints.md\` | for technical and academic constraints |
529
+ | \`.brainforge/memory/learning-notes.md\` | for lessons learned and concepts |
530
+
531
+ ## navigation
532
+
533
+ - Phases: \`.brainforge/phases/\` | Roadmap: \`.brainforge/roadmap.md\`
534
+ - Commands: \`.brainforge/commands/\` | Decisions: \`.brainforge/decisions.md\`
535
+ - Agents: \`.brainforge/agents/\` | Reports: \`.brainforge/reports/\`
536
+
537
+ ## notes
538
+
539
+ _Add ongoing notes, decisions, and blockers here as the project evolves._
540
+ `;
541
+ }
542
+ function generateProjectContextMd() {
543
+ return `# Project Context
544
+
545
+ ## What this project is
546
+
547
+ _To be completed by the user or AI assistant._
548
+
549
+ ## Main goal
550
+
551
+ _To be completed._
552
+
553
+ ## Target users
554
+
555
+ _To be completed._
556
+
557
+ ## Important features
558
+
559
+ _To be completed._
560
+
561
+ ## Current status
562
+
563
+ Initialized with BrainForge.
564
+
565
+ ## Notes
566
+
567
+ Use this file to keep long-term context that the AI should not forget.
568
+ `;
569
+ }
570
+ function generateConstraintsMd(config) {
571
+ const academicSection = config.isAcademic
572
+ ? `\n## Academic constraints\n\n- Keep code defensible in an oral presentation\n- Avoid patterns not understood by the student\n- Write comments naturally\n- Make important logic easy to explain\n`
573
+ : '';
574
+ return `# Project Constraints
575
+
576
+ ## Technical constraints
577
+
578
+ - Follow the selected stack: ${config.stack.join(', ')}
579
+ - Keep code compatible with the configured environment.
580
+ - Do not introduce unnecessary dependencies.
581
+
582
+ ## Code level constraints
583
+
584
+ - Match the configured BrainForge code level: ${config.codeLevel}
585
+ - Keep code explainable for the user level: ${config.userLevel}
586
+ - Avoid over-engineering unless the project is professional.
587
+ ${academicSection}
588
+ ## Project-specific constraints
589
+
590
+ _To be completed._
591
+ `;
592
+ }
593
+ function generateLearningNotesMd() {
594
+ return `# Learning Notes
595
+
596
+ This file tracks what the user learned while building the project.
597
+ Updated automatically by coder, reviewer, teacher, and verifier agents.
598
+
599
+ ## Concepts learned
600
+
601
+ | Date | Concept | Simple explanation | Related files |
602
+ |------|---------|-------------------|---------------|
603
+ | _To be filled_ | | | |
604
+
605
+ ## Bugs fixed and lessons
606
+
607
+ | Date | Bug | Cause | Lesson |
608
+ |------|-----|-------|--------|
609
+ | _To be filled_ | | | |
610
+
611
+ ## Files to understand
612
+
613
+ | File | Why it matters | Difficulty | Status |
614
+ |------|---------------|------------|--------|
615
+ | _To be filled_ | | | |
616
+
617
+ ## Professor / presentation questions
618
+
619
+ | Question | User-ready answer | Related file |
620
+ |----------|-----------------|-------------|
621
+ | _To be filled_ | | |
622
+
623
+ ## Things to review before presentation
624
+
625
+ - [ ] _To be filled_
626
+
627
+ ## Commands used
628
+
629
+ | Date | Command | Result |
630
+ |------|---------|--------|
631
+ | _To be filled_ | | |
632
+ `;
633
+ }
634
+ function generateReportsReadmeMd() {
635
+ return `# BrainForge Reports
636
+
637
+ This folder contains generated project reports.
638
+
639
+ Common reports:
640
+
641
+ - professor-check.md
642
+ - simplify-plan.md
643
+ - review reports
644
+ - debugging reports
645
+ - documentation drafts
646
+
647
+ Reports should be used to understand and improve the project, not to replace manual review.
466
648
  `;
467
649
  }
468
650
  //# sourceMappingURL=fileSystem.js.map