brainforge-ai 1.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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +254 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +47 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/dashboard.d.ts +2 -0
  8. package/dist/commands/dashboard.d.ts.map +1 -0
  9. package/dist/commands/dashboard.js +46 -0
  10. package/dist/commands/dashboard.js.map +1 -0
  11. package/dist/commands/doctor.d.ts +2 -0
  12. package/dist/commands/doctor.d.ts.map +1 -0
  13. package/dist/commands/doctor.js +90 -0
  14. package/dist/commands/doctor.js.map +1 -0
  15. package/dist/commands/init.d.ts +2 -0
  16. package/dist/commands/init.d.ts.map +1 -0
  17. package/dist/commands/init.js +203 -0
  18. package/dist/commands/init.js.map +1 -0
  19. package/dist/commands/updateDashboard.d.ts +2 -0
  20. package/dist/commands/updateDashboard.d.ts.map +1 -0
  21. package/dist/commands/updateDashboard.js +31 -0
  22. package/dist/commands/updateDashboard.js.map +1 -0
  23. package/dist/core/config.d.ts +25 -0
  24. package/dist/core/config.d.ts.map +1 -0
  25. package/dist/core/config.js +52 -0
  26. package/dist/core/config.js.map +1 -0
  27. package/dist/core/dashboard.d.ts +25 -0
  28. package/dist/core/dashboard.d.ts.map +1 -0
  29. package/dist/core/dashboard.js +76 -0
  30. package/dist/core/dashboard.js.map +1 -0
  31. package/dist/core/dashboardTemplate.d.ts +3 -0
  32. package/dist/core/dashboardTemplate.d.ts.map +1 -0
  33. package/dist/core/dashboardTemplate.js +324 -0
  34. package/dist/core/dashboardTemplate.js.map +1 -0
  35. package/dist/core/fileSystem.d.ts +3 -0
  36. package/dist/core/fileSystem.d.ts.map +1 -0
  37. package/dist/core/fileSystem.js +468 -0
  38. package/dist/core/fileSystem.js.map +1 -0
  39. package/dist/core/git.d.ts +6 -0
  40. package/dist/core/git.d.ts.map +1 -0
  41. package/dist/core/git.js +63 -0
  42. package/dist/core/git.js.map +1 -0
  43. package/dist/core/templates.d.ts +5 -0
  44. package/dist/core/templates.d.ts.map +1 -0
  45. package/dist/core/templates.js +1065 -0
  46. package/dist/core/templates.js.map +1 -0
  47. package/dist/utils/logger.d.ts +10 -0
  48. package/dist/utils/logger.d.ts.map +1 -0
  49. package/dist/utils/logger.js +17 -0
  50. package/dist/utils/logger.js.map +1 -0
  51. package/package.json +54 -0
@@ -0,0 +1,1065 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAgentTemplates = getAgentTemplates;
4
+ exports.getCommandTemplates = getCommandTemplates;
5
+ exports.getRootFileTemplates = getRootFileTemplates;
6
+ function getAgentTemplates(config) {
7
+ return {
8
+ 'architect.md': `# Agent: Architect
9
+
10
+ **Role:** System design and architecture decisions
11
+ **Project:** ${config.projectName}
12
+ **Stack:** ${config.stack.join(', ')}
13
+
14
+ ## Mission
15
+
16
+ You are the Architect agent. Your job is to define the technical structure of the project before any code is written.
17
+
18
+ ## Responsibilities
19
+
20
+ - Design folder structure and module boundaries
21
+ - Choose patterns appropriate for **${config.codeLevel}** level
22
+ - Document decisions in \`.brainforge/decisions.md\`
23
+ - Update \`.brainforge/memory/architecture.md\`
24
+ - Ensure architecture matches the user's level: **${config.userLevel}**
25
+
26
+ ## Rules
27
+
28
+ - Never design over-engineered systems for beginner/academic projects
29
+ - Always justify architecture choices in plain language
30
+ - Prefer simple patterns (MVC, layered, modular) over complex ones
31
+ - Update decisions.md after every major architectural decision
32
+
33
+ ## Output Format
34
+
35
+ \`\`\`
36
+ ## Decision: [Title]
37
+ Context: [Why this decision was needed]
38
+ Choice: [What was decided]
39
+ Reason: [Why this approach]
40
+ Impact: [What files/folders this affects]
41
+ \`\`\`
42
+ `,
43
+ 'researcher.md': `# Agent: Researcher
44
+
45
+ **Role:** Technical research before implementation
46
+ **Project:** ${config.projectName}
47
+
48
+ ## Mission
49
+
50
+ You are the Researcher agent. Before any code is written, you research the best approach, libraries, and patterns.
51
+
52
+ ## Responsibilities
53
+
54
+ - Research technical approaches for each phase
55
+ - Compare library options with pros/cons
56
+ - Find relevant documentation
57
+ - Summarize findings for the Planner and Coder agents
58
+ - Update \`.brainforge/memory/architecture.md\` with research notes
59
+
60
+ ## Rules
61
+
62
+ - Always research BEFORE planning
63
+ - Consider the code level (${config.codeLevel}) when recommending solutions
64
+ - Prefer well-documented, actively maintained libraries
65
+ - Flag any research that contradicts the current approach in decisions.md
66
+
67
+ ## Research Template
68
+
69
+ \`\`\`
70
+ ## Research: [Topic]
71
+ Question: [What needs to be figured out]
72
+ Options considered:
73
+ 1. [Option A] — pros: ... / cons: ...
74
+ 2. [Option B] — pros: ... / cons: ...
75
+ Recommendation: [Best choice for this project]
76
+ Reason: [Why]
77
+ \`\`\`
78
+ `,
79
+ 'planner.md': `# Agent: Planner
80
+
81
+ **Role:** Phase planning and task breakdown
82
+ **Project:** ${config.projectName}
83
+
84
+ ## Mission
85
+
86
+ You are the Planner agent. After research is done, you create a detailed, executable plan for each phase.
87
+
88
+ ## Responsibilities
89
+
90
+ - Read the phase file from \`.brainforge/phases/\`
91
+ - Read research from memory
92
+ - Create a step-by-step execution plan
93
+ - Identify files to create/modify
94
+ - Estimate difficulty
95
+ - Update the phase file with the plan
96
+
97
+ ## Rules
98
+
99
+ - Plan ONLY what was defined in the phase scope
100
+ - Do not add features not requested
101
+ - Keep tasks atomic and clear
102
+ - Always verify the plan fits **${config.codeLevel}** code level
103
+ - Ask for clarification before planning ambiguous requirements
104
+
105
+ ## Plan Format
106
+
107
+ \`\`\`
108
+ ## Plan: Phase XX — [Title]
109
+ Steps:
110
+ 1. Create [file] — purpose: [...]
111
+ 2. Implement [feature] — in [file]
112
+ 3. Test [behavior]
113
+ Files to create: [list]
114
+ Files to modify: [list]
115
+ Estimated complexity: low / medium / high
116
+ \`\`\`
117
+ `,
118
+ 'coder.md': `# Agent: Coder
119
+
120
+ **Role:** Implementation following the plan
121
+ **Project:** ${config.projectName}
122
+ **Code Level:** ${config.codeLevel}
123
+
124
+ ## Mission
125
+
126
+ You are the Coder agent. You write code ONLY after a plan exists. You follow the plan exactly.
127
+
128
+ ## Rules
129
+
130
+ - Read \`.brainforge/memory/coding-style.md\` before writing any code
131
+ - Code at **${config.codeLevel}** level — not above, not below
132
+ - Do not add features outside the plan
133
+ - Do not over-abstract or over-engineer
134
+ - Modify only the files listed in the plan
135
+ - After coding: update \`.brainforge/phases/phase-XX.md\` checklist
136
+ - Propose a checkpoint commit after completing each phase
137
+
138
+ ## Code Level: ${config.codeLevel}
139
+
140
+ ${config.codeLevel === 'academic-realistic'
141
+ ? `- Code that a student would write: clean, readable, explainable
142
+ - No enterprise patterns (no DI containers, no CQRS, no event sourcing)
143
+ - Simple folder structure — max 3 levels deep
144
+ - Comments where logic is not obvious
145
+ - Prefer explicit over implicit`
146
+ : config.codeLevel === 'beginner'
147
+ ? `- Maximum simplicity
148
+ - Few files, direct logic
149
+ - Comments in French for important sections`
150
+ : config.codeLevel === 'professional'
151
+ ? `- Strict typing, error handling, validation
152
+ - Tests for critical paths
153
+ - Security at all input boundaries`
154
+ : `- Clean structure, reusable components
155
+ - Simple validation, good practices
156
+ - Avoid over-engineering`}
157
+
158
+ ## After Coding
159
+
160
+ 1. Check off completed tasks in phase file
161
+ 2. Update \`.brainforge/memory/architecture.md\` if structure changed
162
+ 3. Suggest: \`/checkpoint\` to commit progress
163
+ `,
164
+ 'reviewer.md': `# Agent: Reviewer
165
+
166
+ **Role:** Code review after each phase
167
+ **Project:** ${config.projectName}
168
+ **Code Level:** ${config.codeLevel}
169
+
170
+ ## Mission
171
+
172
+ You are the Reviewer agent. After a phase is coded, you review it for quality, correctness, and level-appropriateness.
173
+
174
+ ## Checklist
175
+
176
+ - [ ] No obvious bugs
177
+ - [ ] No dead code
178
+ - [ ] No unnecessary complexity
179
+ - [ ] Code matches **${config.codeLevel}** level
180
+ - [ ] No hardcoded secrets or credentials
181
+ - [ ] Files are under reasonable size limits
182
+ - [ ] Logic is understandable at the user's level (${config.userLevel})
183
+ - [ ] No copied code that wasn't adapted
184
+ - [ ] Security: no XSS, injection, path traversal at input boundaries
185
+
186
+ ## Academic Check (if applicable)
187
+
188
+ - [ ] Code looks like it was written by a **${config.userLevel}** student
189
+ - [ ] No patterns that are impossible to explain in a defense
190
+ - [ ] No dependencies that are suspicious for the level
191
+ - [ ] Comments are natural, not AI-generated-sounding
192
+
193
+ ## Output Format
194
+
195
+ \`\`\`
196
+ ## Review: Phase XX
197
+ Status: approved | needs-changes
198
+ Issues:
199
+ - [file:line] Issue description
200
+ Suggestions:
201
+ - [suggestion]
202
+ Level check: pass | fail
203
+ Reason: [...]
204
+ \`\`\`
205
+ `,
206
+ 'teacher.md': `# Agent: Teacher
207
+
208
+ **Role:** Explain code to students, prepare for presentations
209
+ **Project:** ${config.projectName}
210
+
211
+ ## Mission
212
+
213
+ You are the Teacher agent. Your job is to help the user understand their own code and prepare to explain it to others (professor, team, jury).
214
+
215
+ ## Responsibilities
216
+
217
+ - Explain code in simple terms
218
+ - Help prepare oral presentations
219
+ - Generate explanation documents
220
+ - Identify parts that are hard to explain
221
+ - Suggest simplifications where needed
222
+
223
+ ## Commands
224
+
225
+ - /explain-my-code
226
+ - /professor-check
227
+ - /generate-report
228
+ - /humanize-code
229
+
230
+ ## Output Format for Explanations
231
+
232
+ \`\`\`
233
+ ## Code Explanation: [Feature or File]
234
+ In simple terms: [...]
235
+ How it works:
236
+ 1. [Step]
237
+ 2. [Step]
238
+ Key files: [list]
239
+ What you should be able to say: [oral explanation guide]
240
+ Potential questions a professor might ask: [list]
241
+ \`\`\`
242
+ `,
243
+ 'git-agent.md': `# Agent: Git Agent
244
+
245
+ **Role:** Version control and checkpoints
246
+ **Project:** ${config.projectName}
247
+
248
+ ## Mission
249
+
250
+ You are the Git Agent. You manage local commits and checkpoints. You NEVER push to remote.
251
+
252
+ ## Rules
253
+
254
+ - Always check git status before committing
255
+ - Use simple, meaningful commit messages
256
+ - Follow conventional commits format
257
+ - NEVER use git push
258
+ - NEVER use --force
259
+ - Create a checkpoint after each completed phase
260
+
261
+ ## Commit Message Format
262
+
263
+ \`\`\`
264
+ feat: [what was added]
265
+ fix: [what was fixed]
266
+ docs: [documentation updated]
267
+ chore: [non-code update]
268
+ refactor: [code restructured]
269
+ \`\`\`
270
+
271
+ ## Checkpoint Command
272
+
273
+ \`\`\`bash
274
+ git add .
275
+ git commit -m "feat: complete phase XX — [brief description]"
276
+ \`\`\`
277
+ `,
278
+ 'dashboard-agent.md': `# Agent: Dashboard Agent
279
+
280
+ **Role:** Update the HTML dashboard
281
+ **Project:** ${config.projectName}
282
+
283
+ ## Mission
284
+
285
+ You are the Dashboard Agent. You keep the project dashboard up to date after each important action.
286
+
287
+ ## When to Update
288
+
289
+ - After completing a phase
290
+ - After a checkpoint commit
291
+ - After adding a known bug
292
+ - After making an architecture decision
293
+ - When explicitly asked via /update-dashboard
294
+
295
+ ## How to Update
296
+
297
+ Run: \`brainforge update-dashboard\`
298
+
299
+ This regenerates \`.brainforge/dashboard/data.json\` from the current project state.
300
+
301
+ ## Dashboard Location
302
+
303
+ \`.brainforge/dashboard/index.html\`
304
+ `,
305
+ };
306
+ }
307
+ function getCommandTemplates(config) {
308
+ return {
309
+ 'start-project.md': `# /start-project
310
+
311
+ **Objective:** Initialize a new project from an idea, PRD, or description.
312
+
313
+ ## Context to Read First
314
+
315
+ - \`.brainforge/config.json\` — project configuration
316
+ - \`.brainforge/project.md\` — project definition
317
+
318
+ ## Steps
319
+
320
+ 1. Ask the user to describe their project (idea, PRD, or paste description)
321
+ 2. Clarify the goal, scope, and context
322
+ 3. Ask all required questions (see below)
323
+ 4. Create \`.brainforge/project.md\` with gathered information
324
+ 5. Create/update \`.brainforge/questions.md\` with Q&A
325
+ 6. Create initial \`.brainforge/decisions.md\` entry
326
+ 7. Suggest next command: \`/create-roadmap\`
327
+
328
+ ## Required Questions
329
+
330
+ - What is the exact goal of the project?
331
+ - Is this for school, personal, or professional use?
332
+ - What is your actual coding level?
333
+ - What code level do you want? (beginner / intermediate / professional / academic-realistic)
334
+ - What stack do you want to use?
335
+ - Do you need Docker?
336
+ - Do you need a database? Which one?
337
+ - Do you need authentication?
338
+ - Do you need an admin dashboard?
339
+ - Do you need a mobile/responsive interface?
340
+ - Do you need to prepare a report or presentation?
341
+
342
+ ## Rules
343
+
344
+ - Do NOT start coding
345
+ - Do NOT create files outside of .brainforge/ and the root
346
+ - Do NOT skip the questions
347
+ - If the user provides a PRD, extract answers from it but still confirm
348
+
349
+ ## Output
350
+
351
+ - Updated \`.brainforge/project.md\`
352
+ - Updated \`.brainforge/questions.md\`
353
+ - First entry in \`.brainforge/decisions.md\`
354
+ - Message: "Project documented. Run /create-roadmap to break it into phases."
355
+
356
+ ## Example Usage
357
+
358
+ \`\`\`
359
+ /start-project
360
+ > I want to create a task management web app for students...
361
+ \`\`\`
362
+ `,
363
+ 'create-roadmap.md': `# /create-roadmap
364
+
365
+ **Objective:** Break the project into phases with a clear roadmap.
366
+
367
+ ## Context to Read First
368
+
369
+ - \`.brainforge/project.md\`
370
+ - \`.brainforge/questions.md\`
371
+ - \`.brainforge/config.json\`
372
+
373
+ ## Steps
374
+
375
+ 1. Read project context
376
+ 2. Identify logical development phases (3-6 phases typical)
377
+ 3. Use Epic > Feature > Task > Subtask hierarchy
378
+ 4. Create \`.brainforge/roadmap.md\`
379
+ 5. Create one file per phase in \`.brainforge/phases/\`
380
+ 6. Update \`config.json\` with totalPhases count
381
+ 7. Suggest next: \`/initiate-phase 1\`
382
+
383
+ ## Phase File Format
384
+
385
+ Each phase file must contain:
386
+ - Objective
387
+ - Context (what must be done before)
388
+ - Files likely involved
389
+ - Dependencies
390
+ - Validation criteria
391
+ - Risks
392
+ - Difficulty level
393
+ - Execution checklist
394
+
395
+ ## Rules
396
+
397
+ - Do NOT start implementation yet
398
+ - Phases must be sequential and logical
399
+ - Each phase should be completable in 1-3 coding sessions
400
+ - Adjust complexity to **${config.codeLevel}** level
401
+
402
+ ## Output
403
+
404
+ - \`.brainforge/roadmap.md\` (full roadmap)
405
+ - \`.brainforge/phases/phase-01.md\` to \`phase-0N.md\`
406
+ - Updated \`.brainforge/config.json\` (totalPhases)
407
+ `,
408
+ 'initiate-phase.md': `# /initiate-phase
409
+
410
+ **Objective:** Prepare a phase before coding begins.
411
+
412
+ ## Usage
413
+
414
+ \`\`\`
415
+ /initiate-phase [phase-number]
416
+ \`\`\`
417
+
418
+ ## Context to Read First
419
+
420
+ - \`.brainforge/phases/phase-[N].md\`
421
+ - \`.brainforge/memory/architecture.md\`
422
+ - \`.brainforge/memory/coding-style.md\`
423
+ - \`.brainforge/decisions.md\`
424
+
425
+ ## Steps
426
+
427
+ 1. Read the target phase file
428
+ 2. Read the project memory
429
+ 3. Analyze existing repo structure (if any)
430
+ 4. Research best approach for the phase objectives
431
+ 5. Propose implementation strategy
432
+ 6. Explain technical choices in simple terms
433
+ 7. Create detailed execution plan
434
+ 8. Ask for confirmation before proceeding
435
+ 9. Update phase file with the plan
436
+
437
+ ## Rules
438
+
439
+ - Do NOT write any code
440
+ - Do NOT make assumptions — ask if unclear
441
+ - Explain every choice in terms the user can understand
442
+ - Keep the plan within **${config.codeLevel}** boundaries
443
+
444
+ ## Output
445
+
446
+ - Updated \`.brainforge/phases/phase-[N].md\` with execution plan
447
+ - Optional: notes added to \`.brainforge/memory/architecture.md\`
448
+ `,
449
+ 'execute-phase.md': `# /execute-phase
450
+
451
+ **Objective:** Implement the planned phase — nothing more.
452
+
453
+ ## Usage
454
+
455
+ \`\`\`
456
+ /execute-phase [phase-number]
457
+ \`\`\`
458
+
459
+ ## Context to Read First
460
+
461
+ - \`.brainforge/phases/phase-[N].md\` (the plan)
462
+ - \`.brainforge/memory/coding-style.md\`
463
+ - \`.brainforge/config.json\`
464
+
465
+ ## Steps
466
+
467
+ 1. Verify the phase has a plan (from /initiate-phase)
468
+ 2. Read coding-style.md to calibrate code level
469
+ 3. Execute each task from the plan in order
470
+ 4. Create/modify only the listed files
471
+ 5. Check off completed tasks in the phase file
472
+ 6. Update \`.brainforge/memory/architecture.md\` if structure changed
473
+ 7. Suggest running /review-phase and /checkpoint
474
+
475
+ ## Rules
476
+
477
+ - ONLY implement what is in the plan
478
+ - Do not add features, refactors, or improvements outside scope
479
+ - Code at **${config.codeLevel}** level
480
+ - No hardcoded secrets
481
+ - No unnecessary dependencies
482
+ - Update the phase checklist as you go
483
+
484
+ ## Forbidden
485
+
486
+ - Adding features not in scope
487
+ - Changing architecture without documenting it
488
+ - Committing without permission
489
+ - Over-engineering for the target level
490
+
491
+ ## After Completion
492
+
493
+ 1. Update phase status to \`in-progress\` then \`done\`
494
+ 2. Suggest: \`/review-phase [N]\` → \`/checkpoint\`
495
+ `,
496
+ 'review-phase.md': `# /review-phase
497
+
498
+ **Objective:** Review a completed phase for quality and correctness.
499
+
500
+ ## Usage
501
+
502
+ \`\`\`
503
+ /review-phase [phase-number]
504
+ \`\`\`
505
+
506
+ ## Context to Read First
507
+
508
+ - \`.brainforge/phases/phase-[N].md\`
509
+ - \`.brainforge/memory/coding-style.md\`
510
+ - \`.brainforge/config.json\`
511
+
512
+ ## Review Checklist
513
+
514
+ ### Correctness
515
+ - [ ] No obvious runtime errors
516
+ - [ ] Logic matches the plan
517
+ - [ ] Edge cases handled (at appropriate level)
518
+
519
+ ### Code Quality
520
+ - [ ] No dead code
521
+ - [ ] No code duplication
522
+ - [ ] Naming is clear and consistent
523
+ - [ ] Files are reasonably sized
524
+
525
+ ### Level Check (${config.codeLevel})
526
+ - [ ] No patterns above the target level
527
+ - [ ] Complexity matches user level (${config.userLevel})
528
+ - [ ] Explainable without advanced knowledge
529
+
530
+ ### Security (basics)
531
+ - [ ] No hardcoded credentials
532
+ - [ ] User inputs validated at boundaries
533
+ - [ ] No obvious XSS / injection risks
534
+
535
+ ### Academic Check (if applicable)
536
+ - [ ] Code looks credible for the student level
537
+ - [ ] No suspicious AI-perfect comments
538
+ - [ ] Structure is natural, not textbook-perfect
539
+
540
+ ## Output
541
+
542
+ - Review report in the phase file
543
+ - Bugs added to \`.brainforge/memory/known-bugs.md\`
544
+ - Decision to approve or request changes
545
+ `,
546
+ 'humanize-code.md': `# /humanize-code
547
+
548
+ **Objective:** Adapt existing code to match the user's real coding level.
549
+
550
+ ## Usage
551
+
552
+ \`\`\`
553
+ /humanize-code [file or feature] [--level beginner|intermediate|academic-realistic]
554
+ \`\`\`
555
+
556
+ ## Context to Read First
557
+
558
+ - \`.brainforge/config.json\` (userLevel, codeLevel)
559
+ - \`.brainforge/memory/coding-style.md\`
560
+ - Target file(s) to humanize
561
+
562
+ ## What This Does
563
+
564
+ Transforms overly perfect or AI-generated code into code that:
565
+ - Matches the user's **actual level**: ${config.userLevel}
566
+ - Is natural and explainable
567
+ - Has the right amount of complexity
568
+ - Feels written by a human at that level
569
+
570
+ ## Levels
571
+
572
+ ### beginner
573
+ - Simple functions, few files
574
+ - Direct logic, no abstractions
575
+ - Comments in French for key functions
576
+ - No design patterns
577
+
578
+ ### intermediate
579
+ - Clean but not enterprise
580
+ - Some reuse, reasonable structure
581
+ - English naming, simple comments where useful
582
+
583
+ ### academic-realistic (default)
584
+ - Code a good student would write
585
+ - Propre but not textbook-perfect
586
+ - Easy to explain line by line
587
+ - No patterns impossible to justify to a professor
588
+ - No magical abstractions
589
+
590
+ ## Rules
591
+
592
+ - Do NOT make code incorrect or insecure
593
+ - Do NOT remove essential validation
594
+ - PRESERVE the functionality — only change style/structure
595
+ - EXPLAIN what was changed and why
596
+
597
+ ## Output
598
+
599
+ - Modified file(s)
600
+ - Summary of changes made
601
+ - Note: "This code now matches ${config.codeLevel} level"
602
+ `,
603
+ 'explain-my-code.md': `# /explain-my-code
604
+
605
+ **Objective:** Generate a clear explanation the user can give to their professor or team.
606
+
607
+ ## Usage
608
+
609
+ \`\`\`
610
+ /explain-my-code [file or feature]
611
+ \`\`\`
612
+
613
+ ## Context to Read First
614
+
615
+ - Target file(s)
616
+ - \`.brainforge/memory/architecture.md\`
617
+ - \`.brainforge/project.md\`
618
+
619
+ ## Steps
620
+
621
+ 1. Read the specified file or feature
622
+ 2. Understand the overall logic
623
+ 3. Generate a simple explanation
624
+
625
+ ## Output Format
626
+
627
+ \`\`\`
628
+ ## Explanation: [File / Feature]
629
+
630
+ ### In Simple Terms
631
+ [2-3 sentences describing what this does]
632
+
633
+ ### How It Works (step by step)
634
+ 1. [Step]
635
+ 2. [Step]
636
+ 3. [Step]
637
+
638
+ ### Key Files
639
+ - [file] — [role]
640
+
641
+ ### Why This Architecture
642
+ [Simple justification]
643
+
644
+ ### How to Run
645
+ \`\`\`bash
646
+ [commands]
647
+ \`\`\`
648
+
649
+ ### What You Should Be Able to Say
650
+ [Oral guide — 3-5 sentences for a presentation]
651
+
652
+ ### Questions a Professor Might Ask
653
+ - [Question 1]
654
+ - [Question 2]
655
+ \`\`\`
656
+ `,
657
+ 'professor-check.md': `# /professor-check
658
+
659
+ **Objective:** Verify the project doesn't look "too AI-generated" for the student's level.
660
+
661
+ ## Context to Read First
662
+
663
+ - \`.brainforge/config.json\` (userLevel, codeLevel)
664
+ - All project source files
665
+
666
+ ## What This Checks
667
+
668
+ ### Red Flags (Too Advanced)
669
+ - [ ] Enterprise patterns (CQRS, Event Sourcing, DI containers)
670
+ - [ ] Over-abstracted folder structure (5+ levels deep)
671
+ - [ ] Dependencies unusual for the level
672
+ - [ ] Comments that sound AI-generated
673
+ - [ ] Perfect error handling everywhere
674
+ - [ ] Suspiciously complete documentation
675
+ - [ ] Overly generic naming (IRepository, AbstractFactory)
676
+ - [ ] TypeScript generics where not needed
677
+
678
+ ### Level Mismatch
679
+ - [ ] Code complexity exceeds **${config.userLevel}** level
680
+ - [ ] Patterns the student couldn't justify in an oral defense
681
+ - [ ] Sections that are impossible to explain simply
682
+
683
+ ## Output
684
+
685
+ \`\`\`
686
+ ## Professor Check Report
687
+
688
+ Risk Level: low | medium | high
689
+
690
+ Flagged Items:
691
+ - [file:line] Issue — Suggestion
692
+
693
+ Recommendation:
694
+ [Run /humanize-code on: list of files]
695
+ \`\`\`
696
+ `,
697
+ 'checkpoint.md': `# /checkpoint
698
+
699
+ **Objective:** Create a local Git checkpoint commit.
700
+
701
+ ## Usage
702
+
703
+ \`\`\`
704
+ /checkpoint [optional message]
705
+ \`\`\`
706
+
707
+ ## Steps
708
+
709
+ 1. Run \`git status\` to see changes
710
+ 2. If changes exist, run \`git add .\`
711
+ 3. Run \`git commit -m "[message]"\`
712
+ 4. Report commit result
713
+ 5. Update dashboard: \`brainforge update-dashboard\`
714
+
715
+ ## Commit Message Format
716
+
717
+ \`\`\`
718
+ feat: add [feature]
719
+ fix: repair [issue]
720
+ docs: update [document]
721
+ chore: update brainforge config
722
+ refactor: simplify [module]
723
+ \`\`\`
724
+
725
+ ## Rules
726
+
727
+ - NEVER run git push
728
+ - NEVER use --force
729
+ - NEVER use --no-verify
730
+ - Keep messages simple and descriptive
731
+ - One logical change per commit
732
+
733
+ ## Example
734
+
735
+ \`\`\`bash
736
+ git add .
737
+ git commit -m "feat: complete phase 01 — project setup"
738
+ \`\`\`
739
+ `,
740
+ 'debug-issue.md': `# /debug-issue
741
+
742
+ **Objective:** Systematically debug and fix a problem.
743
+
744
+ ## Usage
745
+
746
+ \`\`\`
747
+ /debug-issue [optional: describe the error or paste it]
748
+ \`\`\`
749
+
750
+ ## Steps
751
+
752
+ 1. Ask user to paste the error message if not provided
753
+ 2. Identify the likely root cause
754
+ 3. Locate the relevant files
755
+ 4. Explain the cause in simple terms
756
+ 5. Propose a fix
757
+ 6. Apply the fix
758
+ 7. Verify the fix works
759
+ 8. Update \`.brainforge/memory/known-bugs.md\`
760
+
761
+ ## Bug Entry Format
762
+
763
+ \`\`\`
764
+ - [YYYY-MM-DD] [Bug title]
765
+ File: [path]
766
+ Description: [what happens]
767
+ Cause: [root cause]
768
+ Fix: [how it was resolved]
769
+ Status: resolved
770
+ \`\`\`
771
+
772
+ ## Rules
773
+
774
+ - Do not over-fix — fix only what's broken
775
+ - Explain the root cause so the user learns from it
776
+ - Update known-bugs.md after every fix
777
+ `,
778
+ 'design-system.md': `# /design-system
779
+
780
+ **Objective:** Create or update the project's UI/UX design system.
781
+
782
+ ## Usage
783
+
784
+ \`\`\`
785
+ /design-system
786
+ \`\`\`
787
+
788
+ ## Steps
789
+
790
+ 1. Read \`.brainforge/config.json\` for project context
791
+ 2. Ask about visual preferences if not yet defined
792
+ 3. Generate \`.brainforge/memory/design-system.md\`
793
+
794
+ ## What to Define
795
+
796
+ - Color palette (primary, secondary, success, warning, error, bg, text)
797
+ - Typography (fonts, sizes, weights)
798
+ - Spacing scale
799
+ - Component styles (buttons, inputs, cards, badges)
800
+ - Responsive breakpoints
801
+ - Dark/light mode approach
802
+ - Animation guidelines
803
+
804
+ ## Output
805
+
806
+ - Updated \`.brainforge/memory/design-system.md\`
807
+ - Optionally: a base CSS file with variables
808
+ `,
809
+ 'generate-docs.md': `# /generate-docs
810
+
811
+ **Objective:** Create or update project documentation.
812
+
813
+ ## Usage
814
+
815
+ \`\`\`
816
+ /generate-docs
817
+ \`\`\`
818
+
819
+ ## Context to Read First
820
+
821
+ - \`.brainforge/project.md\`
822
+ - \`.brainforge/memory/architecture.md\`
823
+ - \`.brainforge/roadmap.md\`
824
+
825
+ ## Output
826
+
827
+ - \`README.md\` — project overview, setup, usage
828
+ - \`docs/setup.md\` — installation and configuration
829
+ - \`docs/architecture.md\` — technical architecture
830
+ - \`docs/usage.md\` — how to use the app
831
+
832
+ ## README Sections
833
+
834
+ 1. Project name and description
835
+ 2. Features list
836
+ 3. Stack
837
+ 4. Prerequisites
838
+ 5. Installation
839
+ 6. Usage
840
+ 7. Project structure
841
+ 8. Contributing
842
+ 9. License
843
+ `,
844
+ 'generate-report.md': `# /generate-report
845
+
846
+ **Objective:** Generate a base academic report for school projects.
847
+
848
+ ## Usage
849
+
850
+ \`\`\`
851
+ /generate-report
852
+ \`\`\`
853
+
854
+ ## Context to Read First
855
+
856
+ - \`.brainforge/project.md\`
857
+ - \`.brainforge/memory/architecture.md\`
858
+ - \`.brainforge/questions.md\`
859
+
860
+ ## Output
861
+
862
+ A Markdown or DOCX-ready template with:
863
+
864
+ 1. Cover page (title, author, date, institution)
865
+ 2. Table of contents
866
+ 3. Introduction
867
+ 4. Context and motivation
868
+ 5. Problem statement
869
+ 6. Functional requirements
870
+ 7. Technical requirements
871
+ 8. Architecture (with diagram placeholder)
872
+ 9. Implementation highlights
873
+ 10. Screenshots (placeholders)
874
+ 11. Conclusion and perspectives
875
+ 12. References
876
+
877
+ ## Rules
878
+
879
+ - Write in the user's language
880
+ - Keep it at a level appropriate for an academic report
881
+ - Leave [PLACEHOLDER] markers where the user needs to add screenshots or diagrams
882
+ `,
883
+ 'update-dashboard.md': `# /update-dashboard
884
+
885
+ **Objective:** Refresh the HTML dashboard with current project state.
886
+
887
+ ## Usage
888
+
889
+ \`\`\`
890
+ /update-dashboard
891
+ \`\`\`
892
+
893
+ Or via CLI:
894
+
895
+ \`\`\`bash
896
+ brainforge update-dashboard
897
+ \`\`\`
898
+
899
+ ## What Gets Updated
900
+
901
+ - Phase status and progress
902
+ - Recent git commits
903
+ - Known bugs count
904
+ - Latest decisions
905
+ - Git status
906
+ - Last updated timestamp
907
+
908
+ ## Steps
909
+
910
+ 1. Read all phase files for status
911
+ 2. Read \`.brainforge/memory/known-bugs.md\`
912
+ 3. Read \`.brainforge/decisions.md\`
913
+ 4. Get recent git log
914
+ 5. Write updated \`.brainforge/dashboard/data.json\`
915
+
916
+ ## Output
917
+
918
+ - Updated \`.brainforge/dashboard/data.json\`
919
+ - Message: "Dashboard updated. Open .brainforge/dashboard/index.html"
920
+ `,
921
+ };
922
+ }
923
+ function getRootFileTemplates(config) {
924
+ const stackStr = config.stack.join(', ');
925
+ return {
926
+ 'AGENTS.md': `# BrainForge Agent Instructions
927
+
928
+ **Project:** ${config.projectName}
929
+ **Stack:** ${stackStr}
930
+ **Code Level:** ${config.codeLevel}
931
+ **User Level:** ${config.userLevel}
932
+
933
+ ## For All AI Agents
934
+
935
+ This project uses BrainForge — a structured, phase-based AI development system.
936
+
937
+ ### Golden Rule
938
+
939
+ > Never write code without a plan. Always follow the workflow.
940
+
941
+ ### Workflow
942
+
943
+ \`\`\`
944
+ Idea → /start-project → /create-roadmap → /initiate-phase → /execute-phase → /review-phase → /checkpoint → /update-dashboard
945
+ \`\`\`
946
+
947
+ ### Before Any Action
948
+
949
+ 1. Read \`.brainforge/config.json\`
950
+ 2. Read \`.brainforge/project.md\`
951
+ 3. Read \`.brainforge/memory/coding-style.md\`
952
+ 4. Check the current phase in \`.brainforge/phases/\`
953
+
954
+ ### Code Rules
955
+
956
+ - Code at **${config.codeLevel}** level
957
+ - Do not over-engineer
958
+ - Do not add features outside the current phase scope
959
+ - Update \`.brainforge/memory/\` after significant changes
960
+ - Commit with \`/checkpoint\` — never \`git push\`
961
+
962
+ ### After Each Phase
963
+
964
+ 1. Check off phase tasks
965
+ 2. Update \`.brainforge/memory/architecture.md\` if needed
966
+ 3. Run \`/checkpoint\`
967
+ 4. Run \`/update-dashboard\`
968
+
969
+ ### Slash Commands Available
970
+
971
+ See \`.brainforge/commands/\` for all available commands.
972
+ `,
973
+ 'CLAUDE.md': `# Claude Code Instructions — BrainForge
974
+
975
+ **Project:** ${config.projectName}
976
+ **Stack:** ${stackStr}
977
+
978
+ ## Context
979
+
980
+ This project is managed by BrainForge. Read \`AGENTS.md\` and the \`.brainforge/\` folder before doing anything.
981
+
982
+ ## Slash Commands
983
+
984
+ All slash commands are defined in \`.brainforge/commands/\`. Use them as your workflow guide.
985
+
986
+ ## Code Level
987
+
988
+ Target: **${config.codeLevel}**
989
+
990
+ Read \`.brainforge/memory/coding-style.md\` before writing code.
991
+
992
+ ## Git Rules
993
+
994
+ - ✅ git add, git commit
995
+ - ✅ git status, git log
996
+ - ❌ git push (NEVER)
997
+ - ❌ git push --force (NEVER)
998
+
999
+ ## Memory
1000
+
1001
+ Update \`.brainforge/memory/\` files after major changes.
1002
+
1003
+ ## Dashboard
1004
+
1005
+ Run \`brainforge update-dashboard\` after each phase or checkpoint.
1006
+ `,
1007
+ 'GEMINI.md': `# Gemini CLI Instructions — BrainForge
1008
+
1009
+ **Project:** ${config.projectName}
1010
+ **Stack:** ${stackStr}
1011
+
1012
+ ## Setup
1013
+
1014
+ This project uses BrainForge. Always start by reading:
1015
+ - \`AGENTS.md\`
1016
+ - \`.brainforge/project.md\`
1017
+ - \`.brainforge/memory/coding-style.md\`
1018
+
1019
+ ## Workflow
1020
+
1021
+ Follow the BrainForge workflow defined in \`AGENTS.md\`.
1022
+
1023
+ ## Code Level: ${config.codeLevel}
1024
+
1025
+ Do not write code above this level. Read the coding style guide.
1026
+
1027
+ ## Git
1028
+
1029
+ Local commits only — NO push, NO force.
1030
+
1031
+ ## Commands
1032
+
1033
+ See \`.brainforge/commands/\` for all slash commands.
1034
+ `,
1035
+ 'OPENAI.md': `# OpenAI / Codex Instructions — BrainForge
1036
+
1037
+ **Project:** ${config.projectName}
1038
+ **Stack:** ${stackStr}
1039
+
1040
+ ## Setup
1041
+
1042
+ Read before acting:
1043
+ 1. \`AGENTS.md\`
1044
+ 2. \`.brainforge/config.json\`
1045
+ 3. \`.brainforge/memory/coding-style.md\`
1046
+
1047
+ ## Code Level: ${config.codeLevel}
1048
+
1049
+ Target user level: ${config.userLevel}
1050
+
1051
+ ## Workflow
1052
+
1053
+ Strictly follow the BrainForge phase workflow. No code without a plan.
1054
+
1055
+ ## Git Policy
1056
+
1057
+ Commits: yes. Push: NEVER.
1058
+
1059
+ ## Commands Reference
1060
+
1061
+ All commands in \`.brainforge/commands/\`.
1062
+ `,
1063
+ };
1064
+ }
1065
+ //# sourceMappingURL=templates.js.map