appiq-solution 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1991 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Appiq Solution Smart Installer
5
+ *
6
+ * Super einfache Installation mit One-Click Workflows
7
+ * Usage: npx appiq-solution install
8
+ *
9
+ * Built with ❤️ based on the amazing Bmad-Method
10
+ * Credits: https://github.com/Viktor-Hermann/APPIQ-METHOD
11
+ */
12
+
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+ const inquirer = require('inquirer');
16
+ const chalk = require('chalk');
17
+
18
+ class AppiqSolutionInstaller {
19
+ constructor() {
20
+ this.projectRoot = process.cwd();
21
+ this.appiqPath = path.join(this.projectRoot, "appiq-solution");
22
+ this.config = {
23
+ version: "1.0.0",
24
+ projectType: null, // 'greenfield' or 'brownfield'
25
+ techStack: {},
26
+ selectedIDEs: [],
27
+ projectName: null,
28
+ projectIdea: null,
29
+ targetUsers: null,
30
+ projectPlan: null,
31
+ planApproved: false,
32
+ };
33
+ }
34
+
35
+ async install() {
36
+ console.log(chalk.bold.cyan("🚀 Appiq Solution Smart Installer v1.0.0"));
37
+ console.log(chalk.cyan("============================================"));
38
+ console.log(chalk.dim("Built with ❤️ based on Bmad-Method"));
39
+ console.log(chalk.dim("https://github.com/Viktor-Hermann/APPIQ-METHOD\n"));
40
+
41
+ try {
42
+ // Phase 1: Projekt-Typ Detection
43
+ await this.detectProjectType();
44
+
45
+ // Phase 2: Projektidee erfassen
46
+ await this.collectProjectIdea();
47
+
48
+ // Phase 3: IDE Selection (MULTISELECT)
49
+ await this.selectIDE();
50
+
51
+ // Phase 4: Projektplan erstellen
52
+ await this.createProjectPlan();
53
+
54
+ // Phase 5: Plan-Freigabe
55
+ await this.approvePlan();
56
+
57
+ // Phase 6: Installation
58
+ await this.performInstallation();
59
+
60
+ // Phase 7: BMAD Core Configuration Setup
61
+ await this.setupBMADCoreConfig();
62
+
63
+ // Phase 8: Document Templates & Dependencies
64
+ await this.setupDocumentTemplates();
65
+
66
+ // Phase 9: Agent Dependencies System
67
+ await this.setupAgentDependencies();
68
+
69
+ // Phase 10: BMAD Orchestration (Full Flow)
70
+ await this.setupBMADOrchestration();
71
+
72
+ // Phase 11: One-Click Setup
73
+ await this.setupOneClickWorkflows();
74
+
75
+ // Phase 12: Simple Instructions
76
+ await this.showSimpleInstructions();
77
+ } catch (error) {
78
+ console.error(chalk.red("❌ Installation failed:"), error.message);
79
+ process.exit(1);
80
+ }
81
+ }
82
+
83
+ async detectProjectType() {
84
+ console.log(chalk.yellow("🔍 Projekt-Analyse..."));
85
+
86
+ // Auto-Detection
87
+ const hasPackageJson = fs.existsSync(
88
+ path.join(this.projectRoot, "package.json")
89
+ );
90
+ const hasPubspec = fs.existsSync(
91
+ path.join(this.projectRoot, "pubspec.yaml")
92
+ );
93
+ const hasExistingCode = this.hasExistingSourceCode();
94
+ const hasDocumentation = this.hasExistingDocumentation();
95
+
96
+ let suggestedType = "greenfield";
97
+ let reason = "Neues Projekt erkannt";
98
+
99
+ if (hasExistingCode || hasDocumentation) {
100
+ suggestedType = "brownfield";
101
+ reason = "Existierenden Code/Dokumentation gefunden";
102
+ }
103
+
104
+ console.log(chalk.gray(`💡 Analyse: ${reason}`));
105
+ console.log(
106
+ chalk.gray(
107
+ `📊 Empfehlung: ${
108
+ suggestedType === "greenfield"
109
+ ? "Greenfield (Neues Projekt)"
110
+ : "Brownfield (Bestehendes Projekt)"
111
+ }`
112
+ )
113
+ );
114
+
115
+ // User Confirmation
116
+ const { projectType } = await inquirer.prompt([
117
+ {
118
+ type: "list",
119
+ name: "projectType",
120
+ message: "🎯 Welcher Projekt-Typ ist das?",
121
+ choices: [
122
+ {
123
+ name: `✨ Greenfield - Neues Projekt (Empfohlen: ${
124
+ suggestedType === "greenfield" ? "✅" : "❌"
125
+ })`,
126
+ value: "greenfield",
127
+ short: "Greenfield",
128
+ },
129
+ {
130
+ name: `🔧 Brownfield - Bestehendes Projekt (Empfohlen: ${
131
+ suggestedType === "brownfield" ? "✅" : "❌"
132
+ })`,
133
+ value: "brownfield",
134
+ short: "Brownfield",
135
+ },
136
+ ],
137
+ default: suggestedType,
138
+ },
139
+ ]);
140
+
141
+ this.config.projectType = projectType;
142
+ console.log(
143
+ chalk.green(
144
+ `✅ Projekt-Typ: ${
145
+ projectType === "greenfield"
146
+ ? "Greenfield (Neu)"
147
+ : "Brownfield (Bestehend)"
148
+ }\n`
149
+ )
150
+ );
151
+ }
152
+
153
+ async selectIDE() {
154
+ console.log(chalk.yellow("🛠️ IDE Auswahl"));
155
+ console.log(
156
+ chalk.bold.yellow.bgRed(
157
+ " ⚠️ MULTISELECT: Verwenden Sie SPACEBAR zum Auswählen mehrerer IDEs! "
158
+ )
159
+ );
160
+ console.log(chalk.gray("Wählen Sie ALLE IDEs aus, die Sie nutzen:\n"));
161
+
162
+ const { ides } = await inquirer.prompt([
163
+ {
164
+ type: "checkbox",
165
+ name: "ides",
166
+ message:
167
+ "🎯 Welche IDEs nutzen Sie? (SPACEBAR = auswählen, ENTER = bestätigen)",
168
+ choices: [
169
+ { name: "🔵 Cursor", value: "cursor" },
170
+ { name: "🟣 Claude Code CLI", value: "claude-code" },
171
+ { name: "🟢 Windsurf", value: "windsurf" },
172
+ { name: "🔶 VS Code + Cline", value: "cline" },
173
+ { name: "🟠 Trae", value: "trae" },
174
+ { name: "🔴 Roo Code", value: "roo" },
175
+ { name: "🟪 Gemini CLI", value: "gemini" },
176
+ { name: "⚫ GitHub Copilot", value: "github-copilot" },
177
+ ],
178
+ validate: (input) => {
179
+ if (input.length === 0) {
180
+ return "Bitte wählen Sie mindestens eine IDE aus!";
181
+ }
182
+ return true;
183
+ },
184
+ },
185
+ ]);
186
+
187
+ this.config.selectedIDEs = ides;
188
+ const ideNames = ides.map((ide) => this.getIDEName(ide)).join(", ");
189
+ console.log(chalk.green(`✅ IDEs: ${ideNames}\n`));
190
+ }
191
+
192
+ async collectProjectIdea() {
193
+ console.log(chalk.yellow("💡 Projektidee erfassen"));
194
+ console.log(chalk.gray("Beschreiben Sie Ihr Projekt-Vorhaben:\n"));
195
+
196
+ const { projectIdea, projectName, targetUsers } = await inquirer.prompt([
197
+ {
198
+ type: "input",
199
+ name: "projectName",
200
+ message: "🏷️ Wie soll Ihr Projekt heißen?",
201
+ validate: (input) =>
202
+ input.length > 0 ? true : "Bitte geben Sie einen Projektnamen ein!",
203
+ },
204
+ {
205
+ type: "editor",
206
+ name: "projectIdea",
207
+ message: "💡 Beschreiben Sie Ihre Projektidee (detailliert):",
208
+ validate: (input) =>
209
+ input.length > 10
210
+ ? true
211
+ : "Bitte beschreiben Sie Ihr Projekt ausführlicher!",
212
+ },
213
+ {
214
+ type: "input",
215
+ name: "targetUsers",
216
+ message: "👥 Wer sind Ihre Zielgruppen/User?",
217
+ validate: (input) =>
218
+ input.length > 0 ? true : "Bitte beschreiben Sie Ihre Zielgruppe!",
219
+ },
220
+ ]);
221
+
222
+ this.config.projectName = projectName;
223
+ this.config.projectIdea = projectIdea;
224
+ this.config.targetUsers = targetUsers;
225
+
226
+ console.log(chalk.green(`✅ Projektidee erfasst: "${projectName}"\n`));
227
+ }
228
+
229
+ async createProjectPlan() {
230
+ console.log(chalk.yellow("📋 Projektplan wird erstellt..."));
231
+ console.log(chalk.gray("Basierend auf Ihrer Idee und dem Projekt-Typ\n"));
232
+
233
+ // Hier würde normalerweise die team-fullstack.yaml verwendet
234
+ const plan = this.generateProjectPlan();
235
+ this.config.projectPlan = plan;
236
+
237
+ console.log(chalk.cyan("📋 Ihr Projektplan:"));
238
+ console.log(chalk.white("─".repeat(50)));
239
+ console.log(plan);
240
+ console.log(chalk.white("─".repeat(50) + "\n"));
241
+ }
242
+
243
+ async approvePlan() {
244
+ const { approved, changes } = await inquirer.prompt([
245
+ {
246
+ type: "confirm",
247
+ name: "approved",
248
+ message: "✅ Sind Sie mit diesem Plan zufrieden?",
249
+ default: true,
250
+ },
251
+ {
252
+ type: "input",
253
+ name: "changes",
254
+ message:
255
+ "📝 Welche Änderungen möchten Sie? (oder ENTER für keine Änderungen)",
256
+ when: (answers) => !answers.approved,
257
+ },
258
+ ]);
259
+
260
+ if (!approved && changes) {
261
+ console.log(chalk.yellow("📝 Plan wird angepasst..."));
262
+ this.config.planChanges = changes;
263
+ // Hier würde Plan angepasst werden
264
+ console.log(chalk.green("✅ Plan wurde angepasst!\n"));
265
+ } else {
266
+ console.log(
267
+ chalk.green("✅ Plan freigegeben - Entwicklung kann starten!\n")
268
+ );
269
+ }
270
+
271
+ this.config.planApproved = true;
272
+ }
273
+
274
+ generateProjectPlan() {
275
+ const { projectType, projectName, projectIdea, targetUsers } = this.config;
276
+
277
+ return `🎯 PROJEKTPLAN: ${projectName}
278
+
279
+ 📊 PROJEKT-TYP: ${
280
+ projectType === "greenfield"
281
+ ? "Greenfield (Neues Projekt)"
282
+ : "Brownfield (Bestehendes Projekt)"
283
+ }
284
+ 👥 ZIELGRUPPE: ${targetUsers}
285
+
286
+ 💡 PROJEKTIDEE:
287
+ ${projectIdea}
288
+
289
+ 🚀 ENTWICKLUNGS-PIPELINE:
290
+ ${
291
+ projectType === "greenfield"
292
+ ? `
293
+ 1. 📋 PO (Product Owner) → PRD erstellen
294
+ 2. 🏗️ Architect → System-Architektur designen
295
+ 3. 🎨 UX Expert → UI/UX Design
296
+ 4. 📝 Story Master → User Stories aufbrechen
297
+ 5. 💻 Developer → Features implementieren
298
+ 6. ✅ QA Expert → Testing & Validierung
299
+ 7. 📊 SM (Scrum Master) → Sprint-Koordination
300
+ `
301
+ : `
302
+ 1. 📋 PO → Bestehende Dokumentation analysieren
303
+ 2. 🏗️ Architect → Architektur-Review
304
+ 3. 📝 Story Master → Neue Features planen
305
+ 4. 💻 Developer → Features in bestehende Basis integrieren
306
+ 5. ✅ QA Expert → Regression Testing
307
+ 6. 📊 SM → Change Management
308
+ `
309
+ }
310
+
311
+ 🎮 ONE-CLICK BEFEHLE:
312
+ - /start → Gesamten Workflow starten
313
+ - /plan → Detailplanung
314
+ - /develop → Entwicklung beginnen
315
+ - /review → Code Review
316
+ - /deploy → Deployment vorbereiten`;
317
+ }
318
+
319
+ async setupBMADCoreConfig() {
320
+ console.log(chalk.yellow("⚙️ BMAD Core Configuration einrichten..."));
321
+
322
+ // Create .bmad-core directory
323
+ const bmadCoreDir = path.join(this.appiqPath, '.bmad-core');
324
+ if (!fs.existsSync(bmadCoreDir)) {
325
+ fs.mkdirSync(bmadCoreDir, { recursive: true });
326
+ }
327
+
328
+ // Create core-config.yaml
329
+ const coreConfigPath = path.join(bmadCoreDir, 'core-config.yaml');
330
+ fs.writeFileSync(coreConfigPath, this.generateCoreConfig());
331
+
332
+ // Create technical-preferences.md
333
+ const techPrefsPath = path.join(bmadCoreDir, 'data');
334
+ if (!fs.existsSync(techPrefsPath)) {
335
+ fs.mkdirSync(techPrefsPath, { recursive: true });
336
+ }
337
+ fs.writeFileSync(path.join(techPrefsPath, 'technical-preferences.md'), this.generateTechnicalPreferences());
338
+
339
+ console.log(chalk.green("✅ BMAD Core Configuration bereit!\n"));
340
+ }
341
+
342
+ async setupDocumentTemplates() {
343
+ console.log(chalk.yellow("📄 Document Templates & Struktur einrichten..."));
344
+
345
+ // Create docs directory structure
346
+ const docsDir = path.join(this.projectRoot, 'docs');
347
+ const archDir = path.join(docsDir, 'architecture');
348
+ const storiesDir = path.join(docsDir, 'stories');
349
+
350
+ [docsDir, archDir, storiesDir].forEach(dir => {
351
+ if (!fs.existsSync(dir)) {
352
+ fs.mkdirSync(dir, { recursive: true });
353
+ }
354
+ });
355
+
356
+ // Create templates
357
+ const templatesDir = path.join(this.appiqPath, 'templates');
358
+ if (!fs.existsSync(templatesDir)) {
359
+ fs.mkdirSync(templatesDir, { recursive: true });
360
+ }
361
+
362
+ // PRD Template
363
+ fs.writeFileSync(path.join(templatesDir, 'prd-template.md'), this.generatePRDTemplate());
364
+
365
+ // Architecture Template
366
+ fs.writeFileSync(path.join(templatesDir, 'architecture-template.md'), this.generateArchitectureTemplate());
367
+
368
+ // Story Template
369
+ fs.writeFileSync(path.join(templatesDir, 'story-template.md'), this.generateStoryTemplate());
370
+
371
+ // Create initial PRD if planning is complete
372
+ if (this.config.planApproved) {
373
+ fs.writeFileSync(path.join(docsDir, 'prd.md'), this.generateInitialPRD());
374
+ }
375
+
376
+ console.log(chalk.green("✅ Document Templates erstellt!\n"));
377
+ }
378
+
379
+ async setupAgentDependencies() {
380
+ console.log(chalk.yellow("🔗 Agent Dependencies System einrichten..."));
381
+
382
+ const agentsDir = path.join(this.appiqPath, "agents");
383
+ const tasksDir = path.join(this.appiqPath, 'tasks');
384
+ const dataDir = path.join(this.appiqPath, 'data');
385
+
386
+ // Create directories
387
+ [tasksDir, dataDir].forEach(dir => {
388
+ if (!fs.existsSync(dir)) {
389
+ fs.mkdirSync(dir, { recursive: true });
390
+ }
391
+ });
392
+
393
+ // Create BMAD Knowledge Base
394
+ fs.writeFileSync(path.join(dataDir, 'bmad-kb.md'), this.generateBMADKnowledgeBase());
395
+
396
+ // Create essential tasks
397
+ fs.writeFileSync(path.join(tasksDir, 'create-doc.md'), this.generateCreateDocTask());
398
+ fs.writeFileSync(path.join(tasksDir, 'shard-doc.md'), this.generateShardDocTask());
399
+ fs.writeFileSync(path.join(tasksDir, 'validate-story.md'), this.generateValidateStoryTask());
400
+
401
+ // Update agents with proper dependencies
402
+ await this.updateAgentsWithDependencies();
403
+
404
+ console.log(chalk.green("✅ Agent Dependencies System bereit!\n"));
405
+ }
406
+
407
+ async setupBMADOrchestration() {
408
+ console.log(chalk.yellow("🎭 BMAD Full Orchestration einrichten..."));
409
+
410
+ // Create orchestration config based on BMAD Flow
411
+ const orchestrationConfig = {
412
+ planningPhase: {
413
+ agents: ["analyst", "pm", "ux-expert", "architect", "po"],
414
+ workflow: this.config.projectType === "greenfield" ? "greenfield-planning" : "brownfield-planning"
415
+ },
416
+ developmentPhase: {
417
+ agents: ["sm", "po", "dev", "qa"],
418
+ workflow: "core-development-cycle"
419
+ },
420
+ transitions: {
421
+ planningToIDE: "document-sharding",
422
+ criticalCommitPoints: ["before-next-story", "after-qa-approval"]
423
+ }
424
+ };
425
+
426
+ // Generate BMAD Orchestration
427
+ const orchestrationPath = path.join(this.appiqPath, "bmad-orchestration.yaml");
428
+ fs.writeFileSync(orchestrationPath, this.generateBMADOrchestration(orchestrationConfig));
429
+
430
+ // Create workflow guides
431
+ const workflowsDir = path.join(this.appiqPath, 'workflows');
432
+ if (!fs.existsSync(workflowsDir)) {
433
+ fs.mkdirSync(workflowsDir, { recursive: true });
434
+ }
435
+
436
+ fs.writeFileSync(path.join(workflowsDir, 'planning-workflow.md'), this.generatePlanningWorkflow());
437
+ fs.writeFileSync(path.join(workflowsDir, 'development-cycle.md'), this.generateDevelopmentCycle());
438
+ fs.writeFileSync(path.join(workflowsDir, 'document-sharding.md'), this.generateDocumentSharding());
439
+
440
+ console.log(chalk.green("✅ BMAD Full Orchestration bereit!\n"));
441
+ }
442
+
443
+ generateCoreConfig() {
444
+ return `# BMAD Core Configuration
445
+ # Built with ❤️ based on Bmad-Method
446
+
447
+ project:
448
+ name: ${this.config.projectName || 'Unbenanntes Projekt'}
449
+ type: ${this.config.projectType}
450
+ created: ${new Date().toISOString()}
451
+
452
+ # Files that dev agent should ALWAYS load into context
453
+ devLoadAlwaysFiles:
454
+ - docs/architecture/coding-standards.md
455
+ - docs/architecture/tech-stack.md
456
+ - docs/architecture/project-structure.md
457
+
458
+ # Document paths configuration
459
+ documentPaths:
460
+ prd: "docs/prd.md"
461
+ architecture: "docs/architecture.md"
462
+ stories: "docs/stories/"
463
+ templates: "appiq-solution/templates/"
464
+
465
+ # Agent dependencies configuration
466
+ dependencies:
467
+ templates:
468
+ - prd-template.md
469
+ - architecture-template.md
470
+ - story-template.md
471
+ tasks:
472
+ - create-doc.md
473
+ - shard-doc.md
474
+ - validate-story.md
475
+ data:
476
+ - bmad-kb.md
477
+ - technical-preferences.md
478
+ `;
479
+ }
480
+
481
+ generateTechnicalPreferences() {
482
+ return `# Technical Preferences
483
+
484
+ *Diese Datei hilft PM und Architect dabei, Ihre bevorzugten Design-Patterns und Technologien zu berücksichtigen.*
485
+
486
+ ## Projekt: ${this.config.projectName || 'Unbenanntes Projekt'}
487
+
488
+ ### Bevorzugte Technologien
489
+ ${this.config.projectType === 'greenfield' ? `
490
+ **Frontend:**
491
+ - Framework: React/Next.js, Vue/Nuxt, Angular
492
+ - State Management: Zustand, Redux Toolkit, Pinia
493
+ - Styling: Tailwind CSS, Material-UI, Ant Design
494
+
495
+ **Backend:**
496
+ - Runtime: Node.js, Python, Go
497
+ - Framework: Express, FastAPI, Gin
498
+ - Database: PostgreSQL, MongoDB, Redis
499
+
500
+ **DevOps:**
501
+ - Deployment: Vercel, Railway, AWS
502
+ - CI/CD: GitHub Actions, GitLab CI
503
+ - Monitoring: Sentry, LogRocket
504
+ ` : `
505
+ **Bestehende Technologien erweitern:**
506
+ - Kompatibilität mit bestehender Code-Basis beachten
507
+ - Minimale neue Dependencies
508
+ - Schrittweise Migration wenn nötig
509
+ `}
510
+
511
+ ### Design Patterns
512
+ - **Architektur:** Clean Architecture, Hexagonal, MVC
513
+ - **Code Style:** DRY, SOLID Principles, KISS
514
+ - **Testing:** TDD/BDD, Unit + Integration Tests
515
+ - **Documentation:** README-driven, Inline Comments
516
+
517
+ ### Coding Standards
518
+ - **Naming:** camelCase für Variablen, PascalCase für Components
519
+ - **Files:** kebab-case für Dateien, PascalCase für Components
520
+ - **Functions:** Kleine, fokussierte Funktionen (<50 Zeilen)
521
+ - **Comments:** Erkläre WARUM, nicht WAS
522
+
523
+ ### Präferenzen
524
+ - **Performance:** Optimierung vor Abstraktion
525
+ - **Security:** Security-by-Design
526
+ - **Accessibility:** WCAG 2.1 AA Standard
527
+ - **Mobile:** Mobile-First Approach
528
+
529
+ ---
530
+ *Aktualisiert: ${new Date().toLocaleDateString('de-DE')}*
531
+ `;
532
+ }
533
+
534
+ generatePRDTemplate() {
535
+ return `# Product Requirements Document (PRD)
536
+
537
+ ## Projekt: [PROJECT_NAME]
538
+
539
+ ### 1. Problem Statement
540
+ *Welches Problem lösen wir?*
541
+
542
+ ### 2. Solution Overview
543
+ *Wie lösen wir das Problem?*
544
+
545
+ ### 3. Target Users
546
+ *Wer sind unsere Zielgruppen?*
547
+
548
+ ### 4. Functional Requirements (FRs)
549
+ *Was muss das System können?*
550
+
551
+ #### 4.1 Core Features
552
+ - [ ] Feature 1
553
+ - [ ] Feature 2
554
+
555
+ #### 4.2 Advanced Features
556
+ - [ ] Advanced Feature 1
557
+ - [ ] Advanced Feature 2
558
+
559
+ ### 5. Non-Functional Requirements (NFRs)
560
+ *Wie gut muss das System funktionieren?*
561
+
562
+ #### 5.1 Performance
563
+ - Response Time: < 200ms
564
+ - Throughput: [SPECIFY]
565
+
566
+ #### 5.2 Security
567
+ - Authentication: [METHOD]
568
+ - Authorization: [RBAC/ABAC]
569
+
570
+ #### 5.3 Scalability
571
+ - Users: [NUMBER]
572
+ - Data: [VOLUME]
573
+
574
+ ### 6. User Stories & Epics
575
+
576
+ #### Epic 1: [EPIC_NAME]
577
+ - **Story 1.1:** Als [USER] möchte ich [ACTION] um [BENEFIT]
578
+ - **Story 1.2:** Als [USER] möchte ich [ACTION] um [BENEFIT]
579
+
580
+ #### Epic 2: [EPIC_NAME]
581
+ - **Story 2.1:** Als [USER] möchte ich [ACTION] um [BENEFIT]
582
+ - **Story 2.2:** Als [USER] möchte ich [ACTION] um [BENEFIT]
583
+
584
+ ### 7. Success Metrics
585
+ *Wie messen wir Erfolg?*
586
+
587
+ - Metric 1: [DEFINITION]
588
+ - Metric 2: [DEFINITION]
589
+
590
+ ---
591
+ *Erstellt mit Appiq Solution - Built with ❤️ based on Bmad-Method*
592
+ `;
593
+ }
594
+
595
+ generateArchitectureTemplate() {
596
+ return `# System Architecture
597
+
598
+ ## Projekt: [PROJECT_NAME]
599
+
600
+ ### 1. Architecture Overview
601
+ *High-level Systemübersicht*
602
+
603
+ ### 2. Technology Stack
604
+
605
+ #### Frontend
606
+ - Framework: [FRAMEWORK]
607
+ - State Management: [STATE_MANAGEMENT]
608
+ - Styling: [STYLING_SOLUTION]
609
+
610
+ #### Backend
611
+ - Runtime: [RUNTIME]
612
+ - Framework: [FRAMEWORK]
613
+ - Database: [DATABASE]
614
+
615
+ #### Infrastructure
616
+ - Hosting: [HOSTING_PLATFORM]
617
+ - CI/CD: [CI_CD_SOLUTION]
618
+
619
+ ### 3. System Components
620
+
621
+ #### 3.1 Frontend Components
622
+ - Component Library
623
+ - State Management
624
+ - Routing
625
+ - API Layer
626
+
627
+ #### 3.2 Backend Services
628
+ - API Layer
629
+ - Business Logic
630
+ - Data Access Layer
631
+ - External Integrations
632
+
633
+ ### 4. Data Models
634
+
635
+ #### User Model
636
+ \`\`\`
637
+ {
638
+ id: string
639
+ email: string
640
+ name: string
641
+ createdAt: Date
642
+ }
643
+ \`\`\`
644
+
645
+ ### 5. API Design
646
+
647
+ #### Authentication
648
+ - POST /api/auth/login
649
+ - POST /api/auth/register
650
+ - POST /api/auth/logout
651
+
652
+ #### Core Resources
653
+ - GET /api/[resource]
654
+ - POST /api/[resource]
655
+ - PUT /api/[resource]/:id
656
+ - DELETE /api/[resource]/:id
657
+
658
+ ### 6. Security Considerations
659
+ - Authentication Strategy
660
+ - Authorization Model
661
+ - Data Validation
662
+ - Rate Limiting
663
+
664
+ ### 7. Performance Considerations
665
+ - Caching Strategy
666
+ - Database Optimization
667
+ - CDN Usage
668
+ - Lazy Loading
669
+
670
+ ### 8. Deployment Architecture
671
+ - Development Environment
672
+ - Staging Environment
673
+ - Production Environment
674
+
675
+ ---
676
+ *Erstellt mit Appiq Solution - Built with ❤️ based on Bmad-Method*
677
+ `;
678
+ }
679
+
680
+ generateStoryTemplate() {
681
+ return `# User Story: [STORY_TITLE]
682
+
683
+ ## Story Details
684
+ **Als** [USER_TYPE]
685
+ **möchte ich** [ACTION]
686
+ **um** [BENEFIT]
687
+
688
+ ## Acceptance Criteria
689
+ - [ ] Criterion 1
690
+ - [ ] Criterion 2
691
+ - [ ] Criterion 3
692
+
693
+ ## Technical Tasks
694
+ - [ ] Task 1: [DESCRIPTION]
695
+ - [ ] Task 2: [DESCRIPTION]
696
+ - [ ] Task 3: [DESCRIPTION]
697
+
698
+ ## Definition of Done
699
+ - [ ] Code implemented and tested
700
+ - [ ] Unit tests written and passing
701
+ - [ ] Integration tests passing
702
+ - [ ] Code reviewed and approved
703
+ - [ ] Documentation updated
704
+ - [ ] Deployed to staging
705
+ - [ ] User acceptance testing completed
706
+
707
+ ## Dependencies
708
+ - [ ] Dependency 1
709
+ - [ ] Dependency 2
710
+
711
+ ## Estimation
712
+ **Story Points:** [POINTS]
713
+ **Estimated Hours:** [HOURS]
714
+
715
+ ## Notes
716
+ *Zusätzliche Notizen und Überlegungen*
717
+
718
+ ---
719
+ **Sprint:** [SPRINT_NUMBER]
720
+ **Assigned to:** [DEVELOPER]
721
+ **Status:** [TODO/IN_PROGRESS/REVIEW/DONE]
722
+
723
+ ---
724
+ *Erstellt mit Appiq Solution - Built with ❤️ based on Bmad-Method*
725
+ `;
726
+ }
727
+
728
+ generateInitialPRD() {
729
+ const { projectName, projectIdea, targetUsers, projectType } = this.config;
730
+
731
+ return `# Product Requirements Document (PRD)
732
+
733
+ ## Projekt: ${projectName}
734
+
735
+ ### 1. Problem Statement
736
+ ${projectIdea}
737
+
738
+ ### 2. Target Users
739
+ ${targetUsers}
740
+
741
+ ### 3. Project Type
742
+ ${projectType === 'greenfield' ? '✨ Greenfield (Neues Projekt)' : '🔧 Brownfield (Bestehendes Projekt)'}
743
+
744
+ ### 4. Functional Requirements (FRs)
745
+ *Diese Sektion wird durch den PM Agent vervollständigt*
746
+
747
+ #### 4.1 Core Features
748
+ - [ ] Feature wird durch PM definiert
749
+
750
+ ### 5. Non-Functional Requirements (NFRs)
751
+ *Diese Sektion wird durch den Architect Agent vervollständigt*
752
+
753
+ ### 6. User Stories & Epics
754
+ *Diese Sektion wird durch den Story Master Agent vervollständigt*
755
+
756
+ ---
757
+ **Status:** 📋 Planning Phase Complete - Ready for PM Agent
758
+ **Nächster Schritt:** PM Agent für detaillierte Requirements
759
+ **Created:** ${new Date().toLocaleDateString('de-DE')}
760
+
761
+ ---
762
+ *Erstellt mit Appiq Solution - Built with ❤️ based on Bmad-Method*
763
+ `;
764
+ }
765
+
766
+ generateBMADKnowledgeBase() {
767
+ return `# BMAD Knowledge Base
768
+
769
+ ## The BMad Planning + Execution Workflow
770
+
771
+ ### Planning Workflow (Web UI or Powerful IDE Agents)
772
+ 1. **Analyst** (Optional): Market Research, Competitor Analysis, Project Brief
773
+ 2. **PM**: Create PRD from Brief with FRs, NFRs, Epics & Stories
774
+ 3. **UX Expert** (Optional): Create Front End Spec, Generate UI Prompts
775
+ 4. **Architect**: Create Architecture from PRD + UX Spec
776
+ 5. **PO**: Run Master Checklist, validate document alignment
777
+
778
+ ### Critical Transition: Web UI → IDE
779
+ - Copy documents to project (docs/prd.md, docs/architecture.md)
780
+ - Switch to IDE
781
+ - **PO**: Shard Documents (CRITICAL STEP)
782
+ - Begin Development Cycle
783
+
784
+ ### Core Development Cycle (IDE)
785
+ 1. **SM**: Review previous story dev/QA notes
786
+ 2. **SM**: Draft next story from sharded epic + architecture
787
+ 3. **PO**: Validate story draft (optional)
788
+ 4. **User Approval** of story
789
+ 5. **Dev**: Sequential task execution, implement tasks + tests
790
+ 6. **Dev**: Run all validations, mark ready for review
791
+ 7. **User Verification**: Request QA or approve
792
+ 8. **QA**: Senior dev review + active refactoring (if requested)
793
+ 9. **IMPORTANT**: Verify all regression tests and linting pass
794
+ 10. **IMPORTANT**: COMMIT CHANGES BEFORE PROCEEDING
795
+ 11. Mark story as done, loop back to SM
796
+
797
+ ### Key Principles
798
+ - **Document Sharding**: Critical step after planning phase
799
+ - **Context Management**: Keep files lean and focused
800
+ - **Commit Regularly**: Save work frequently, especially after QA
801
+ - **Agent Selection**: Use appropriate agent for each task
802
+ - **Dependencies**: Each agent loads only what it needs
803
+
804
+ ### Special Agents
805
+ - **BMad-Master**: Can do any task except story implementation
806
+ - **BMad-Orchestrator**: Heavy-weight agent for web bundles only
807
+
808
+ ### Technical Configuration
809
+ - **core-config.yaml**: devLoadAlwaysFiles configuration
810
+ - **technical-preferences.md**: Bias PM/Architect recommendations
811
+ - **Dependencies**: templates, tasks, data for each agent
812
+
813
+ ---
814
+ *Built with ❤️ based on Bmad-Method*
815
+ `;
816
+ }
817
+
818
+ generateCreateDocTask() {
819
+ return `# Create Document Task
820
+
821
+ ## Purpose
822
+ Create structured documents following BMAD templates and standards.
823
+
824
+ ## Usage
825
+ This task helps agents create consistent, well-structured documents.
826
+
827
+ ## Process
828
+ 1. **Identify Document Type**: PRD, Architecture, Story, etc.
829
+ 2. **Load Template**: Use appropriate template from templates/
830
+ 3. **Gather Requirements**: Collect all necessary information
831
+ 4. **Fill Template**: Replace placeholders with actual content
832
+ 5. **Validate Structure**: Ensure all sections are complete
833
+ 6. **Save Document**: Store in correct location (docs/)
834
+
835
+ ## Templates Available
836
+ - prd-template.md
837
+ - architecture-template.md
838
+ - story-template.md
839
+
840
+ ## Best Practices
841
+ - Follow template structure exactly
842
+ - Replace ALL placeholders
843
+ - Include creation date and status
844
+ - Link to related documents
845
+ - Use consistent formatting
846
+
847
+ ## Output Location
848
+ - PRD: docs/prd.md
849
+ - Architecture: docs/architecture.md
850
+ - Stories: docs/stories/[story-name].md
851
+
852
+ ---
853
+ *Built with ❤️ based on Bmad-Method*
854
+ `;
855
+ }
856
+
857
+ generateShardDocTask() {
858
+ return `# Document Sharding Task
859
+
860
+ ## Purpose
861
+ **CRITICAL STEP**: Break down large documents into focused, manageable pieces for agents.
862
+
863
+ ## When to Use
864
+ - After planning phase completion
865
+ - Before beginning development cycle
866
+ - When switching from Web UI to IDE
867
+
868
+ ## Process
869
+ 1. **Identify Source Document**: Usually PRD or Architecture
870
+ 2. **Analyze Structure**: Find natural breaking points
871
+ 3. **Create Focused Files**: Each file serves one purpose
872
+ 4. **Maintain References**: Link shards together
873
+ 5. **Update devLoadAlwaysFiles**: Configure core-config.yaml
874
+
875
+ ## Sharding Strategy
876
+
877
+ ### PRD Sharding
878
+ - **Core Requirements**: docs/requirements/core.md
879
+ - **User Stories**: docs/stories/ (individual files)
880
+ - **Success Metrics**: docs/metrics.md
881
+
882
+ ### Architecture Sharding
883
+ - **Tech Stack**: docs/architecture/tech-stack.md
884
+ - **Coding Standards**: docs/architecture/coding-standards.md
885
+ - **Project Structure**: docs/architecture/project-structure.md
886
+ - **API Design**: docs/architecture/api-design.md
887
+ - **Data Models**: docs/architecture/data-models.md
888
+
889
+ ## Critical Points
890
+ - **Lean Files**: Each shard should be focused and minimal
891
+ - **Dev Context**: Sharded files go into devLoadAlwaysFiles
892
+ - **Agent Performance**: Smaller context = better performance
893
+ - **Maintainability**: Easier to update specific aspects
894
+
895
+ ## Post-Sharding
896
+ 1. Update core-config.yaml devLoadAlwaysFiles
897
+ 2. Verify all shards are accessible
898
+ 3. Test agent context loading
899
+ 4. Begin development cycle
900
+
901
+ ---
902
+ *Built with ❤️ based on Bmad-Method*
903
+ `;
904
+ }
905
+
906
+ generateValidateStoryTask() {
907
+ return `# Validate Story Task
908
+
909
+ ## Purpose
910
+ Ensure user stories align with PRD, architecture, and project goals.
911
+
912
+ ## When to Use
913
+ - Before story implementation begins
914
+ - When SM drafts new stories
915
+ - When stories are modified
916
+
917
+ ## Validation Checklist
918
+
919
+ ### Story Structure
920
+ - [ ] Clear user role defined
921
+ - [ ] Specific action described
922
+ - [ ] Business value stated
923
+ - [ ] Acceptance criteria present
924
+
925
+ ### Technical Alignment
926
+ - [ ] Aligns with architecture decisions
927
+ - [ ] Fits within tech stack constraints
928
+ - [ ] Dependencies identified
929
+ - [ ] Implementation feasible
930
+
931
+ ### Business Alignment
932
+ - [ ] Supports PRD objectives
933
+ - [ ] Addresses user needs
934
+ - [ ] Measurable outcomes
935
+ - [ ] Priority justified
936
+
937
+ ### Quality Gates
938
+ - [ ] Testable acceptance criteria
939
+ - [ ] Definition of done complete
940
+ - [ ] Effort estimation reasonable
941
+ - [ ] Risk assessment done
942
+
943
+ ## Process
944
+ 1. **Load References**: PRD, Architecture, related stories
945
+ 2. **Check Structure**: Verify story template compliance
946
+ 3. **Validate Alignment**: Against PRD and architecture
947
+ 4. **Assess Dependencies**: Identify blockers or prerequisites
948
+ 5. **Review Quality**: Ensure story is ready for development
949
+ 6. **Provide Feedback**: Clear recommendations for improvements
950
+
951
+ ## Common Issues
952
+ - Vague acceptance criteria
953
+ - Missing technical dependencies
954
+ - Misalignment with architecture
955
+ - Unrealistic scope or effort
956
+
957
+ ## Output
958
+ - **Validation Status**: Pass/Fail with reasons
959
+ - **Recommendations**: Specific improvements needed
960
+ - **Dependencies**: List of prerequisites
961
+ - **Risk Assessment**: Potential implementation challenges
962
+
963
+ ---
964
+ *Built with ❤️ based on Bmad-Method*
965
+ `;
966
+ }
967
+
968
+ async updateAgentsWithDependencies() {
969
+ console.log(chalk.gray(" 🔗 Updating agents with BMAD dependencies..."));
970
+
971
+ const agentsDir = path.join(this.appiqPath, "agents");
972
+ const agents = fs.readdirSync(agentsDir);
973
+
974
+ for (const agentFile of agents) {
975
+ const agentPath = path.join(agentsDir, agentFile);
976
+ let content = fs.readFileSync(agentPath, 'utf8');
977
+
978
+ // Add BMAD dependencies section to each agent
979
+ const dependenciesSection = `
980
+
981
+ ## 🔗 BMAD Dependencies
982
+
983
+ ### Templates
984
+ - prd-template.md
985
+ - architecture-template.md
986
+ - story-template.md
987
+
988
+ ### Tasks
989
+ - create-doc.md
990
+ - shard-doc.md
991
+ - validate-story.md
992
+
993
+ ### Data
994
+ - bmad-kb.md
995
+ - technical-preferences.md
996
+
997
+ ### Configuration
998
+ - core-config.yaml (devLoadAlwaysFiles)
999
+
1000
+ ## 🎯 BMAD Workflow Integration
1001
+
1002
+ **Planning Phase:** Web UI → IDE Transition → Document Sharding
1003
+ **Development Phase:** SM → PO → Dev → QA → Loop
1004
+ **Critical Points:** Commit before proceeding, verify tests passing
1005
+
1006
+ `;
1007
+
1008
+ // Add dependencies section before the final line
1009
+ const lines = content.split('\n');
1010
+ const lastLine = lines.pop(); // Remove last line
1011
+ lines.push(dependenciesSection);
1012
+ lines.push(lastLine); // Add last line back
1013
+
1014
+ fs.writeFileSync(agentPath, lines.join('\n'));
1015
+ }
1016
+ }
1017
+
1018
+ generateBMADOrchestration(config) {
1019
+ return `# BMAD Full Orchestration
1020
+ # Built with ❤️ based on Bmad-Method
1021
+
1022
+ project:
1023
+ name: ${this.config.projectName}
1024
+ type: ${this.config.projectType}
1025
+ plan_approved: ${this.config.planApproved}
1026
+ created: ${new Date().toISOString()}
1027
+
1028
+ # BMAD Planning Phase (Web UI/Powerful IDE)
1029
+ planning_phase:
1030
+ workflow: ${config.planningPhase.workflow}
1031
+ agents:
1032
+ ${config.planningPhase.agents.map(agent => ` - ${agent}`).join('\n')}
1033
+
1034
+ flow:
1035
+ 1: "analyst → research & project brief (optional)"
1036
+ 2: "pm → create PRD from brief"
1037
+ 3: "ux-expert → create frontend spec (optional)"
1038
+ 4: "architect → create architecture from PRD + UX"
1039
+ 5: "po → run master checklist & validate alignment"
1040
+
1041
+ # Critical Transition: Web UI → IDE
1042
+ transition:
1043
+ type: ${config.transitions.planningToIDE}
1044
+ requirements:
1045
+ - "Copy docs/prd.md and docs/architecture.md to project"
1046
+ - "Switch to IDE"
1047
+ - "PO: Shard documents (CRITICAL)"
1048
+ - "Update core-config.yaml devLoadAlwaysFiles"
1049
+
1050
+ # BMAD Development Phase (IDE Only)
1051
+ development_phase:
1052
+ workflow: ${config.developmentPhase.workflow}
1053
+ agents:
1054
+ ${config.developmentPhase.agents.map(agent => ` - ${agent}`).join('\n')}
1055
+
1056
+ cycle:
1057
+ 1: "sm → review previous story dev/QA notes"
1058
+ 2: "sm → draft next story from sharded epic + architecture"
1059
+ 3: "po → validate story draft (optional)"
1060
+ 4: "user → approve story"
1061
+ 5: "dev → sequential task execution + implementation"
1062
+ 6: "dev → run all validations, mark ready for review"
1063
+ 7: "user → verify (request QA or approve)"
1064
+ 8: "qa → senior dev review + active refactoring (if requested)"
1065
+ 9: "CRITICAL → verify regression tests + linting pass"
1066
+ 10: "CRITICAL → COMMIT CHANGES BEFORE PROCEEDING"
1067
+ 11: "mark story done → loop back to sm"
1068
+
1069
+ # Critical Commit Points
1070
+ commit_points:
1071
+ ${config.transitions.criticalCommitPoints.map(point => ` - ${point}`).join('\n')}
1072
+
1073
+ # IDE Integration
1074
+ ides:
1075
+ ${this.config.selectedIDEs.map(ide => ` - name: ${this.getIDEName(ide)}
1076
+ config_path: ${this.getIDEConfig(ide).dir}
1077
+ file_format: ${this.getIDEConfig(ide).suffix}`).join('\n')}
1078
+
1079
+ # Context Management
1080
+ context:
1081
+ dev_always_files:
1082
+ - docs/architecture/coding-standards.md
1083
+ - docs/architecture/tech-stack.md
1084
+ - docs/architecture/project-structure.md
1085
+
1086
+ agent_dependencies:
1087
+ templates: ["prd-template.md", "architecture-template.md", "story-template.md"]
1088
+ tasks: ["create-doc.md", "shard-doc.md", "validate-story.md"]
1089
+ data: ["bmad-kb.md", "technical-preferences.md"]
1090
+
1091
+ ---
1092
+ *Powered by Appiq Solution - Built with ❤️ based on Bmad-Method*
1093
+ `;
1094
+ }
1095
+
1096
+ generatePlanningWorkflow() {
1097
+ return `# BMAD Planning Workflow
1098
+
1099
+ ## Übersicht
1100
+ Die Planungsphase folgt einem strukturierten Workflow, idealerweise in Web UI für Kosteneffizienz.
1101
+
1102
+ ## Planning Flow
1103
+
1104
+ ### 1. Start: Projektidee
1105
+ - Grundlegendes Konzept definiert
1106
+ - Problem identifiziert
1107
+
1108
+ ### 2. Analyst (Optional)
1109
+ **Brainstorming:**
1110
+ - Marktforschung
1111
+ - Konkurrenzanalyse
1112
+ - Projekt Brief erstellen
1113
+
1114
+ ### 3. Project Manager (PM)
1115
+ **PRD Erstellung:**
1116
+ - PRD aus Brief erstellen (Fast Track)
1117
+ - ODER interaktive PRD Erstellung (mehr Fragen)
1118
+ - Functional Requirements (FRs)
1119
+ - Non-Functional Requirements (NFRs)
1120
+ - Epics & Stories definieren
1121
+
1122
+ ### 4. UX Expert (Optional)
1123
+ **Frontend Specification:**
1124
+ - Frontend Spec erstellen
1125
+ - UI Prompts für Lovable/V0 generieren (optional)
1126
+
1127
+ ### 5. System Architect
1128
+ **Architektur Design:**
1129
+ - Architektur aus PRD erstellen
1130
+ - ODER aus PRD + UX Spec erstellen
1131
+ - Tech Stack definieren
1132
+ - System Components planen
1133
+
1134
+ ### 6. Product Owner (PO)
1135
+ **Master Checklist:**
1136
+ - Dokumenten-Alignment prüfen
1137
+ - Epics & Stories aktualisieren (falls nötig)
1138
+ - PRD/Architektur anpassen (falls nötig)
1139
+
1140
+ ## Kritischer Übergang: Web UI → IDE
1141
+
1142
+ ### ⚠️ WICHTIG: Transition Point
1143
+ Sobald PO Dokumenten-Alignment bestätigt:
1144
+
1145
+ 1. **Dokumente kopieren**: docs/prd.md und docs/architecture.md
1146
+ 2. **IDE wechseln**: Projekt in bevorzugter Agentic IDE öffnen
1147
+ 3. **Document Sharding**: PO Agent zum Shard der Dokumente verwenden
1148
+ 4. **Development beginnen**: Core Development Cycle starten
1149
+
1150
+ ## Qualitäts-Gates
1151
+
1152
+ ### Planning Complete Criteria
1153
+ - [ ] PRD vollständig und genehmigt
1154
+ - [ ] Architektur vollständig und genehmigt
1155
+ - [ ] UX Spec (falls erforderlich) genehmigt
1156
+ - [ ] Alle Dokumente sind aligned
1157
+ - [ ] Epics und Stories definiert
1158
+ - [ ] Übergang zu IDE vorbereitet
1159
+
1160
+ ## Nächste Schritte
1161
+ Nach Planning Complete → **Document Sharding** → **Development Cycle**
1162
+
1163
+ ---
1164
+ *Built with ❤️ based on Bmad-Method*
1165
+ `;
1166
+ }
1167
+
1168
+ generateDevelopmentCycle() {
1169
+ return `# BMAD Core Development Cycle
1170
+
1171
+ ## Übersicht
1172
+ Strukturierter Entwicklungsworkflow in der IDE nach abgeschlossener Planungsphase.
1173
+
1174
+ ## Voraussetzungen
1175
+ - ✅ Planning Phase abgeschlossen
1176
+ - ✅ Dokumente in Projekt kopiert (docs/prd.md, docs/architecture.md)
1177
+ - ✅ **Document Sharding** durch PO Agent durchgeführt
1178
+ - ✅ IDE-Setup komplett
1179
+
1180
+ ## Development Cycle Flow
1181
+
1182
+ ### 1. Scrum Master (SM)
1183
+ **Story Vorbereitung:**
1184
+ - Review previous story dev/QA notes
1185
+ - Draft next story from sharded epic + architecture
1186
+ - Berücksichtigt technical dependencies
1187
+ - Erstellt realistische task breakdown
1188
+
1189
+ ### 2. Product Owner (PO) - Optional
1190
+ **Story Validation:**
1191
+ - Validate story draft against artifacts
1192
+ - Überprüft alignment mit PRD
1193
+ - Bestätigt business value
1194
+ - Kann übersprungen werden bei erfahrenen Teams
1195
+
1196
+ ### 3. User Approval
1197
+ **Story Freigabe:**
1198
+ - ✅ **Approved**: Weiter zu Development
1199
+ - ❌ **Needs Changes**: Zurück zu SM für Anpassungen
1200
+
1201
+ ### 4. Developer (Dev)
1202
+ **Implementation:**
1203
+ - Sequential task execution
1204
+ - Implement tasks + tests
1205
+ - Run all validations
1206
+ - Mark ready for review + add notes
1207
+ - Dokumentiert implementation decisions
1208
+
1209
+ ### 5. User Verification
1210
+ **Review Decision:**
1211
+ - 🔍 **Request QA Review**: Weiter zu QA Agent
1212
+ - ✅ **Approve Without QA**: Direkt zu Final Checks
1213
+ - ❌ **Needs Fixes**: Zurück zu Dev
1214
+
1215
+ ### 6. QA Agent (Optional)
1216
+ **Quality Assurance:**
1217
+ - Senior dev review + active refactoring
1218
+ - Review code, refactor, add tests
1219
+ - Document notes and improvements
1220
+ - **Decision**: Needs Dev Work OR Approved
1221
+
1222
+ ### 7. Final Checks - ⚠️ CRITICAL
1223
+ **Vor dem Abschluss:**
1224
+ - ✅ Verify ALL regression tests passing
1225
+ - ✅ Verify ALL linting passing
1226
+ - ✅ Code review completed (if QA was used)
1227
+ - ✅ Documentation updated
1228
+
1229
+ ### 8. Commit - ⚠️ SUPER CRITICAL
1230
+ **WICHTIG: COMMIT YOUR CHANGES BEFORE PROCEEDING!**
1231
+ - Git add & commit all changes
1232
+ - Include meaningful commit message
1233
+ - Push to repository
1234
+
1235
+ ### 9. Story Complete
1236
+ **Mark als Done:**
1237
+ - Story status → DONE
1238
+ - Loop back to SM for next story
1239
+
1240
+ ## Critical Points
1241
+
1242
+ ### ⚠️ Commit Points
1243
+ - **After QA Approval**: Always commit before marking done
1244
+ - **Before Next Story**: Clean state for next iteration
1245
+
1246
+ ### 🎯 Quality Gates
1247
+ - All tests passing
1248
+ - Linting clean
1249
+ - Code reviewed (if QA used)
1250
+ - Documentation current
1251
+
1252
+ ### 📊 Context Management
1253
+ - Keep relevant files only in context
1254
+ - Use sharded documents
1255
+ - Maintain lean, focused files
1256
+
1257
+ ## Best Practices
1258
+ - **Small Stories**: Keep stories manageable (< 1 week)
1259
+ - **Regular Commits**: Commit frequently during development
1260
+ - **Test First**: Write tests before or with implementation
1261
+ - **Document Decisions**: Record architectural decisions
1262
+
1263
+ ---
1264
+ *Built with ❤️ based on Bmad-Method*
1265
+ `;
1266
+ }
1267
+
1268
+ generateDocumentSharding() {
1269
+ return `# Document Sharding Guide
1270
+
1271
+ ## ⚠️ CRITICAL STEP
1272
+ Document Sharding ist ein **essentieller Schritt** im BMAD Flow nach der Planungsphase.
1273
+
1274
+ ## Wann Document Sharding durchführen?
1275
+ - ✅ Nach Planning Phase Completion
1276
+ - ✅ Beim Übergang von Web UI zu IDE
1277
+ - ✅ Vor Beginn des Development Cycles
1278
+ - ✅ Wenn Dokumente zu groß für Agent-Context werden
1279
+
1280
+ ## Warum Document Sharding?
1281
+ - **Performance**: Kleinere Context = bessere Agent-Performance
1282
+ - **Focus**: Jede Datei dient einem spezifischen Zweck
1283
+ - **Maintainability**: Einfacher zu aktualisieren und zu verwalten
1284
+ - **Agent Efficiency**: Agents laden nur was sie brauchen
1285
+
1286
+ ## Sharding Process
1287
+
1288
+ ### 1. PRD Sharding
1289
+ **Source**: docs/prd.md
1290
+ **Target Structure**:
1291
+ \`\`\`
1292
+ docs/
1293
+ ├── requirements/
1294
+ │ ├── core.md # Core functional requirements
1295
+ │ ├── non-functional.md # NFRs (performance, security)
1296
+ │ └── success-metrics.md # KPIs and success criteria
1297
+ ├── stories/
1298
+ │ ├── epic-1-auth/
1299
+ │ │ ├── story-1-1-login.md
1300
+ │ │ └── story-1-2-register.md
1301
+ │ └── epic-2-dashboard/
1302
+ │ └── story-2-1-overview.md
1303
+ \`\`\`
1304
+
1305
+ ### 2. Architecture Sharding
1306
+ **Source**: docs/architecture.md
1307
+ **Target Structure**:
1308
+ \`\`\`
1309
+ docs/architecture/
1310
+ ├── tech-stack.md # Technology decisions
1311
+ ├── coding-standards.md # Code style and patterns
1312
+ ├── project-structure.md # File/folder organization
1313
+ ├── api-design.md # REST/GraphQL API specs
1314
+ ├── data-models.md # Database schema
1315
+ ├── security.md # Security considerations
1316
+ └── deployment.md # Deployment architecture
1317
+ \`\`\`
1318
+
1319
+ ## Sharding Guidelines
1320
+
1321
+ ### File Size
1322
+ - **Target**: < 50 lines per sharded file
1323
+ - **Maximum**: < 100 lines per sharded file
1324
+ - **Focus**: One concern per file
1325
+
1326
+ ### Naming Convention
1327
+ - **kebab-case**: tech-stack.md, coding-standards.md
1328
+ - **Descriptive**: Clear purpose from filename
1329
+ - **Consistent**: Follow project conventions
1330
+
1331
+ ### Content Rules
1332
+ - **Atomic**: Each file covers one topic completely
1333
+ - **Self-contained**: Can be understood independently
1334
+ - **Linked**: Reference related files when needed
1335
+ - **Lean**: Remove fluff, keep essentials
1336
+
1337
+ ## Post-Sharding Configuration
1338
+
1339
+ ### 1. Update core-config.yaml
1340
+ \`\`\`yaml
1341
+ devLoadAlwaysFiles:
1342
+ - docs/architecture/coding-standards.md
1343
+ - docs/architecture/tech-stack.md
1344
+ - docs/architecture/project-structure.md
1345
+ \`\`\`
1346
+
1347
+ ### 2. Verify Agent Access
1348
+ - Test that agents can load sharded files
1349
+ - Ensure all references are correct
1350
+ - Validate file paths in configuration
1351
+
1352
+ ### 3. Update Templates
1353
+ - Modify templates to reference sharded structure
1354
+ - Update agent prompts to use sharded files
1355
+ - Test template generation
1356
+
1357
+ ## Quality Checks
1358
+
1359
+ ### ✅ Sharding Complete Criteria
1360
+ - [ ] All large documents sharded
1361
+ - [ ] Each shard < 100 lines
1362
+ - [ ] devLoadAlwaysFiles updated
1363
+ - [ ] Agent dependencies resolved
1364
+ - [ ] File references working
1365
+ - [ ] Templates updated
1366
+
1367
+ ### 🚨 Common Mistakes
1368
+ - **Too Large**: Shards still too big (>100 lines)
1369
+ - **Too Small**: Over-sharding (many 5-line files)
1370
+ - **Broken Links**: References to old unified files
1371
+ - **Missing Config**: devLoadAlwaysFiles not updated
1372
+
1373
+ ## After Sharding
1374
+ 1. **Test Agent Loading**: Verify agents can access all needed files
1375
+ 2. **Begin Development**: Start Core Development Cycle
1376
+ 3. **Monitor Performance**: Watch for context issues
1377
+ 4. **Refine as Needed**: Adjust sharding based on usage
1378
+
1379
+ ---
1380
+ *Built with ❤️ based on Bmad-Method*
1381
+ `;
1382
+ }
1383
+
1384
+ async performInstallation() {
1385
+ console.log(chalk.yellow("📦 Installation läuft..."));
1386
+
1387
+ // Create appiq-solution directory
1388
+ if (!fs.existsSync(this.appiqPath)) {
1389
+ fs.mkdirSync(this.appiqPath, { recursive: true });
1390
+ }
1391
+
1392
+ // Install optimized agents
1393
+ await this.installOptimizedAgents();
1394
+
1395
+ // Install project-specific configs
1396
+ await this.installProjectConfig();
1397
+
1398
+ // Setup IDE integration
1399
+ await this.setupIDEIntegration();
1400
+
1401
+ console.log(chalk.green("✅ Installation abgeschlossen!\n"));
1402
+ }
1403
+
1404
+ async installOptimizedAgents() {
1405
+ console.log(chalk.gray(" 📄 Optimierte Agents installieren..."));
1406
+
1407
+ const agentsDir = path.join(this.appiqPath, "agents");
1408
+ if (!fs.existsSync(agentsDir)) {
1409
+ fs.mkdirSync(agentsDir, { recursive: true });
1410
+ }
1411
+
1412
+ // Core optimized agents
1413
+ const agents = [
1414
+ "smart-launcher",
1415
+ "project-manager",
1416
+ "architect",
1417
+ "story-master",
1418
+ "developer",
1419
+ "qa-expert",
1420
+ ];
1421
+
1422
+ for (const agent of agents) {
1423
+ await this.createOptimizedAgent(agent);
1424
+ }
1425
+ }
1426
+
1427
+ async createOptimizedAgent(agentName) {
1428
+ const agentContent = this.generateOptimizedAgentContent(agentName);
1429
+ const filePath = path.join(this.appiqPath, "agents", `${agentName}.md`);
1430
+ fs.writeFileSync(filePath, agentContent);
1431
+ }
1432
+
1433
+ generateOptimizedAgentContent(agentName) {
1434
+ const agentConfigs = {
1435
+ "smart-launcher": {
1436
+ name: "Appiq Launcher",
1437
+ role: "Intelligenter Projekt-Starter",
1438
+ commands: ["/start", "/quick-setup", "/help"],
1439
+ description:
1440
+ "Startet automatisch den optimalen Workflow basierend auf Ihrem Projekt-Typ",
1441
+ },
1442
+ "project-manager": {
1443
+ name: "Project Manager",
1444
+ role: "PRD & Projekt-Planung",
1445
+ commands: ["/prd", "/plan", "/epic"],
1446
+ description: "Erstellt PRD und Projekt-Dokumentation",
1447
+ },
1448
+ architect: {
1449
+ name: "System Architect",
1450
+ role: "Technische Architektur",
1451
+ commands: ["/architecture", "/tech-stack", "/design"],
1452
+ description: "Entwickelt System-Architektur und Tech-Stack",
1453
+ },
1454
+ "story-master": {
1455
+ name: "Story Master",
1456
+ role: "User Stories & Sprint Planning",
1457
+ commands: ["/story", "/sprint", "/tasks"],
1458
+ description: "Erstellt User Stories und Sprint-Planung",
1459
+ },
1460
+ developer: {
1461
+ name: "Senior Developer",
1462
+ role: "Code Implementation",
1463
+ commands: ["/code", "/implement", "/fix"],
1464
+ description: "Implementiert Features und behebt Bugs",
1465
+ },
1466
+ "qa-expert": {
1467
+ name: "QA Expert",
1468
+ role: "Testing & Qualität",
1469
+ commands: ["/test", "/review", "/validate"],
1470
+ description: "Führt Tests durch und validiert Code-Qualität",
1471
+ },
1472
+ };
1473
+
1474
+ const config = agentConfigs[agentName];
1475
+
1476
+ return `# ${config.name}
1477
+
1478
+ ## 🎯 Rolle
1479
+ ${config.role}
1480
+
1481
+ ## 📋 Verfügbare Kommandos
1482
+ ${config.commands
1483
+ .map((cmd) => `- **${cmd}** - ${config.description}`)
1484
+ .join("\n")}
1485
+
1486
+ ## 🚀 One-Click Workflows
1487
+
1488
+ ### Für ${
1489
+ this.config.projectType === "greenfield" ? "NEUE" : "BESTEHENDE"
1490
+ } Projekte:
1491
+
1492
+ ${
1493
+ this.config.projectType === "greenfield"
1494
+ ? this.generateGreenfieldWorkflow(config)
1495
+ : this.generateBrownfieldWorkflow(config)
1496
+ }
1497
+
1498
+ ## 🎮 Einfache Nutzung
1499
+
1500
+ 1. **Laden Sie diesen Agent in Ihre IDE**
1501
+ 2. **Sagen Sie:** "Agiere als ${config.name}"
1502
+ 3. **Verwenden Sie:** ${config.commands[0]} für Quick-Start
1503
+
1504
+ ---
1505
+ *Automatisch optimiert für ${this.config.selectedIDEs
1506
+ .map((ide) => this.getIDEName(ide))
1507
+ .join(", ")}*
1508
+ *Powered by Appiq - Based on Bmad-Method*
1509
+ `;
1510
+ }
1511
+
1512
+ generateGreenfieldWorkflow(config) {
1513
+ const workflows = {
1514
+ "Appiq Launcher": `
1515
+ **🚀 Schnell-Start für neues Projekt:**
1516
+ 1. \`/start\` - Automatische Projekt-Analyse
1517
+ 2. Erstellt automatisch: PRD-Vorlage, Architektur-Basis, erste Stories
1518
+ 3. **Wo alles hingehört:** Alle Dateien werden automatisch in \`docs/\` erstellt`,
1519
+
1520
+ "Project Manager": `
1521
+ **📋 PRD Erstellung:**
1522
+ 1. \`/prd\` - Startet PRD-Assistent
1523
+ 2. **Datei wird erstellt:** \`docs/prd.md\`
1524
+ 3. **Nächster Schritt:** Architect für Architektur`,
1525
+
1526
+ "System Architect": `
1527
+ **🏗️ Architektur erstellen:**
1528
+ 1. \`/architecture\` - Basierend auf PRD
1529
+ 2. **Datei wird erstellt:** \`docs/architecture.md\`
1530
+ 3. **Nächster Schritt:** Story Master für erste Stories`,
1531
+
1532
+ "Story Master": `
1533
+ **📝 Erste Stories:**
1534
+ 1. \`/story\` - Erstellt erste User Story
1535
+ 2. **Datei wird erstellt:** \`docs/stories/story-001.md\`
1536
+ 3. **Nächster Schritt:** Developer für Implementation`,
1537
+
1538
+ "Senior Developer": `
1539
+ **💻 Implementation:**
1540
+ 1. \`/implement\` - Implementiert aktuelle Story
1541
+ 2. **Erstellt/bearbeitet:** Entsprechende Code-Dateien
1542
+ 3. **Nächster Schritt:** QA Expert für Review`,
1543
+
1544
+ "QA Expert": `
1545
+ **✅ Testing & Review:**
1546
+ 1. \`/review\` - Reviewed aktuellen Code
1547
+ 2. **Erstellt:** Test-Dateien und Reports
1548
+ 3. **Nächster Schritt:** Zurück zu Story Master für nächste Story`,
1549
+ };
1550
+
1551
+ return workflows[config.name] || "Standard Greenfield Workflow";
1552
+ }
1553
+
1554
+ generateBrownfieldWorkflow(config) {
1555
+ const workflows = {
1556
+ "Appiq Launcher": `
1557
+ **🔧 Schnell-Start für bestehendes Projekt:**
1558
+ 1. \`/analyze\` - Analysiert bestehendes Projekt
1559
+ 2. **Findet:** Existierende Docs, Code-Struktur, Tech-Stack
1560
+ 3. **Erstellt:** Angepasste Workflows für Ihr Projekt`,
1561
+
1562
+ "Project Manager": `
1563
+ **📋 Bestehende Dokumentation:**
1564
+ 1. \`/analyze-docs\` - Scannt bestehende Dokumentation
1565
+ 2. **Legt PRD ab in:** \`docs/prd.md\` (falls nicht vorhanden)
1566
+ 3. **Nächster Schritt:** Architect für Architektur-Review`,
1567
+
1568
+ "System Architect": `
1569
+ **🏗️ Architektur-Review:**
1570
+ 1. \`/review-architecture\` - Analysiert bestehende Struktur
1571
+ 2. **Erstellt/updated:** \`docs/architecture.md\`
1572
+ 3. **Nächster Schritt:** Story Master für neue Features`,
1573
+
1574
+ "Story Master": `
1575
+ **📝 Feature Stories:**
1576
+ 1. \`/new-feature\` - Neue Story für bestehendes Projekt
1577
+ 2. **Datei wird erstellt:** \`docs/stories/feature-XXX.md\`
1578
+ 3. **Berücksichtigt:** Bestehende Code-Basis`,
1579
+
1580
+ "Senior Developer": `
1581
+ **💻 Feature Implementation:**
1582
+ 1. \`/add-feature\` - Implementiert in bestehendem Code
1583
+ 2. **Bearbeitet:** Bestehende Dateien sicher
1584
+ 3. **Erstellt:** Neue Dateien wo nötig`,
1585
+
1586
+ "QA Expert": `
1587
+ **✅ Regression Testing:**
1588
+ 1. \`/regression-test\` - Testet neue Features
1589
+ 2. **Validiert:** Keine Breaking Changes
1590
+ 3. **Erstellt:** Test-Reports für bestehende + neue Features`,
1591
+ };
1592
+
1593
+ return workflows[config.name] || "Standard Brownfield Workflow";
1594
+ }
1595
+
1596
+ async setupOneClickWorkflows() {
1597
+ console.log(chalk.yellow("⚡ One-Click Workflows einrichten..."));
1598
+
1599
+ // Create quick commands
1600
+ const commandsDir = path.join(this.appiqPath, "commands");
1601
+ if (!fs.existsSync(commandsDir)) {
1602
+ fs.mkdirSync(commandsDir, { recursive: true });
1603
+ }
1604
+
1605
+ // Project-type specific quick starts
1606
+ const quickStartContent = this.generateQuickStartScript();
1607
+ fs.writeFileSync(
1608
+ path.join(commandsDir, "quick-start.md"),
1609
+ quickStartContent
1610
+ );
1611
+
1612
+ console.log(chalk.green("✅ One-Click Workflows bereit!\n"));
1613
+ }
1614
+
1615
+ generateQuickStartScript() {
1616
+ return `# 🚀 Appiq Solution - BMAD Workflow Guide
1617
+
1618
+ ## Projekt: ${this.config.projectName || "Unbenanntes Projekt"}
1619
+ **Typ:** ${
1620
+ this.config.projectType === "greenfield" ? "✨ Greenfield (Neues Projekt)" : "🔧 Brownfield (Bestehendes Projekt)"
1621
+ }
1622
+
1623
+ ## 📋 BMAD Planning Workflow (Phase 1)
1624
+
1625
+ ### Option A: Web UI Planning (Kosteneffizient)
1626
+ 1. Claude/Gemini/GPT mit team-fullstack Bundle verwenden
1627
+ 2. **Flow:** Analyst → PM → UX Expert → Architect → PO
1628
+ 3. **Output:** docs/prd.md, docs/architecture.md
1629
+
1630
+ ### Option B: IDE Planning (Leistungsstark)
1631
+ \`\`\`
1632
+ @analyst → Market Research & Project Brief
1633
+ @pm → PRD mit FRs, NFRs, Epics & Stories erstellen
1634
+ @ux-expert → Frontend Spec (optional)
1635
+ @architect → System Architecture design
1636
+ @po → Master Checklist & Document Alignment
1637
+ \`\`\`
1638
+
1639
+ ## ⚠️ KRITISCHER ÜBERGANG: Document Sharding
1640
+
1641
+ **ESSENTIAL STEP:**
1642
+ \`\`\`
1643
+ @po bitte shard die PRD und Architecture Dokumente in fokussierte Dateien
1644
+ \`\`\`
1645
+
1646
+ **Das erstellt:**
1647
+ - docs/architecture/tech-stack.md ← Dev lädt immer
1648
+ - docs/architecture/coding-standards.md ← Dev lädt immer
1649
+ - docs/architecture/project-structure.md ← Dev lädt immer
1650
+ - docs/requirements/core.md
1651
+ - docs/stories/ (individual story files)
1652
+
1653
+ ## 🚀 BMAD Development Cycle (Phase 2)
1654
+
1655
+ ### Core Development Loop:
1656
+ \`\`\`
1657
+ 1. @sm → Review previous notes, draft next story from sharded epic
1658
+ 2. @po → Validate story draft (optional)
1659
+ 3. User → Approve story
1660
+ 4. @dev → Sequential tasks, implement + tests, mark ready
1661
+ 5. User → Verify (request QA or approve)
1662
+ 6. @qa → Senior dev review + refactoring (optional)
1663
+ 7. ⚠️ CRITICAL: Verify tests + linting pass
1664
+ 8. ⚠️ SUPER CRITICAL: COMMIT CHANGES BEFORE PROCEEDING!
1665
+ 9. Mark story done → Loop back to @sm
1666
+ \`\`\`
1667
+
1668
+ ## 🎯 One-Click Commands
1669
+
1670
+ ### Planning:
1671
+ - \`/plan\` → Start planning workflow
1672
+ - \`/prd\` → Generate PRD
1673
+ - \`/arch\` → Design architecture
1674
+
1675
+ ### Critical Transition:
1676
+ - \`/shard\` → Document sharding (ESSENTIAL!)
1677
+
1678
+ ### Development:
1679
+ - \`/story\` → Draft next story
1680
+ - \`/dev\` → Start development
1681
+ - \`/test\` → Run tests
1682
+ - \`/qa\` → Request review
1683
+ - \`/commit\` → Commit changes
1684
+
1685
+ ### ${this.config.projectType === "greenfield" ? "Greenfield" : "Brownfield"} Specific:
1686
+ ${this.config.projectType === "greenfield" ? `
1687
+ - \`/start\` → Fresh project setup
1688
+ - \`/design\` → Create from scratch
1689
+ - \`/build\` → Build step by step
1690
+ ` : `
1691
+ - \`/analyze\` → Analyze existing code
1692
+ - \`/document\` → Document current state
1693
+ - \`/improve\` → Plan improvements
1694
+ `}
1695
+
1696
+ ## 📊 File Structure
1697
+
1698
+ \`\`\`
1699
+ your-project/
1700
+ ├── docs/
1701
+ │ ├── prd.md ← Initial PRD
1702
+ │ ├── architecture.md ← Initial Architecture
1703
+ │ ├── architecture/ ← Sharded files
1704
+ │ │ ├── tech-stack.md
1705
+ │ │ ├── coding-standards.md
1706
+ │ │ └── project-structure.md
1707
+ │ ├── requirements/
1708
+ │ │ └── core.md
1709
+ │ └── stories/
1710
+ │ ├── epic-1-auth/
1711
+ │ └── epic-2-features/
1712
+ ├── appiq-solution/
1713
+ │ ├── agents/ ← AI-Agents
1714
+ │ ├── templates/ ← Document templates
1715
+ │ ├── workflows/ ← Workflow guides
1716
+ │ └── .bmad-core/ ← BMAD configuration
1717
+ └── .cursor/rules/ ← IDE integration
1718
+ \`\`\`
1719
+
1720
+ ## ⚠️ Critical Success Factors
1721
+
1722
+ ### Document Sharding (ESSENTIAL):
1723
+ - **MUST DO** after planning phase
1724
+ - Creates focused, lean files for agents
1725
+ - Improves agent performance dramatically
1726
+
1727
+ ### Commit Points:
1728
+ - After QA approval (always!)
1729
+ - Before next story (clean state)
1730
+ - Regular commits during development
1731
+
1732
+ ### Quality Gates:
1733
+ - All tests passing ✅
1734
+ - Linting clean ✅
1735
+ - Code reviewed (if QA used) ✅
1736
+ - Documentation updated ✅
1737
+
1738
+ ## 🆘 Help & Support
1739
+
1740
+ - \`/help\` → Show all commands
1741
+ - \`/workflow\` → Current workflow step
1742
+ - \`/agents\` → Available agents
1743
+ - \`/docs\` → Documentation
1744
+
1745
+ ### Workflow Files:
1746
+ - appiq-solution/workflows/planning-workflow.md
1747
+ - appiq-solution/workflows/development-cycle.md
1748
+ - appiq-solution/workflows/document-sharding.md
1749
+
1750
+ ---
1751
+ **IDEs:** ${this.config.selectedIDEs.map((ide) => this.getIDEName(ide)).join(", ")}
1752
+ **Created:** ${new Date().toLocaleDateString("de-DE")}
1753
+ **Powered by Appiq Solution - Built with ❤️ based on Bmad-Method**
1754
+ `;
1755
+ }
1756
+
1757
+ async setupIDEIntegration() {
1758
+ if (
1759
+ this.config.selectedIDEs.includes("manual") &&
1760
+ this.config.selectedIDEs.length === 1
1761
+ )
1762
+ return;
1763
+
1764
+ console.log(chalk.gray(" 🔧 Mehrere IDE-Integrationen..."));
1765
+
1766
+ for (const ide of this.config.selectedIDEs) {
1767
+ if (ide === "manual") continue;
1768
+
1769
+ console.log(
1770
+ chalk.gray(` 📝 ${this.getIDEName(ide)} wird konfiguriert...`)
1771
+ );
1772
+
1773
+ const ideConfig = this.getIDEConfig(ide);
1774
+ const ideDir = path.join(this.projectRoot, ideConfig.dir);
1775
+
1776
+ if (!fs.existsSync(ideDir)) {
1777
+ fs.mkdirSync(ideDir, { recursive: true });
1778
+ }
1779
+
1780
+ // Copy agents to IDE-specific format
1781
+ const agentsPath = path.join(this.appiqPath, "agents");
1782
+ const agents = fs.readdirSync(agentsPath);
1783
+
1784
+ for (const agent of agents) {
1785
+ const sourcePath = path.join(agentsPath, agent);
1786
+ const targetPath = path.join(
1787
+ ideDir,
1788
+ agent.replace(".md", ideConfig.suffix)
1789
+ );
1790
+ fs.copyFileSync(sourcePath, targetPath);
1791
+ }
1792
+
1793
+ console.log(chalk.green(` ✅ ${this.getIDEName(ide)} konfiguriert`));
1794
+ }
1795
+
1796
+ console.log(chalk.green(" ✅ Alle IDE-Integrationen abgeschlossen!"));
1797
+ }
1798
+
1799
+ getIDEConfig(ide) {
1800
+ const configs = {
1801
+ cursor: { dir: ".cursor/rules", suffix: ".mdc" },
1802
+ "claude-code": { dir: ".claude/commands/Appiq", suffix: ".md" },
1803
+ windsurf: { dir: ".windsurf/rules", suffix: ".md" },
1804
+ cline: { dir: ".clinerules", suffix: ".md" },
1805
+ trae: { dir: ".trae/rules", suffix: ".md" },
1806
+ roo: { dir: ".roo/agents", suffix: ".md" },
1807
+ gemini: { dir: ".gemini/commands", suffix: ".md" },
1808
+ "github-copilot": { dir: ".github/copilot", suffix: ".md" },
1809
+ };
1810
+ return configs[ide] || { dir: ".appiq-solution", suffix: ".md" };
1811
+ }
1812
+
1813
+ getIDEName(ide) {
1814
+ const names = {
1815
+ cursor: "Cursor",
1816
+ "claude-code": "Claude Code CLI",
1817
+ windsurf: "Windsurf",
1818
+ cline: "VS Code + Cline",
1819
+ trae: "Trae",
1820
+ roo: "Roo Code",
1821
+ gemini: "Gemini CLI",
1822
+ "github-copilot": "GitHub Copilot",
1823
+ manual: "Manuell",
1824
+ };
1825
+ return names[ide] || ide;
1826
+ }
1827
+
1828
+ async showSimpleInstructions() {
1829
+ console.log(chalk.bold.green("🎉 Appiq Installation Erfolgreich!\n"));
1830
+ console.log(chalk.dim("Built with ❤️ based on the amazing Bmad-Method"));
1831
+ console.log(chalk.dim("https://github.com/Viktor-Hermann/APPIQ-METHOD\n"));
1832
+
1833
+ console.log(chalk.cyan("📋 Nächste Schritte (Super einfach):"));
1834
+ console.log(chalk.white("════════════════════════════════════\n"));
1835
+
1836
+ if (
1837
+ this.config.selectedIDEs.length > 0 &&
1838
+ !this.config.selectedIDEs.includes("manual")
1839
+ ) {
1840
+ console.log(
1841
+ chalk.yellow(
1842
+ `1. Ihre IDEs öffnen: ${this.config.selectedIDEs
1843
+ .map((ide) => this.getIDEName(ide))
1844
+ .join(", ")}`
1845
+ )
1846
+ );
1847
+ console.log(
1848
+ chalk.gray(` → Agents sind bereits in allen IDEs installiert!\n`)
1849
+ );
1850
+ }
1851
+
1852
+ console.log(chalk.yellow("2. 📋 BMAD Planning Workflow:"));
1853
+ if (this.config.planApproved) {
1854
+ console.log(chalk.green(` ✅ Planning Complete - Ready for Development!`));
1855
+ console.log(chalk.cyan(` → Ihre initial PRD: docs/prd.md`));
1856
+ } else {
1857
+ console.log(chalk.cyan(` Option A: Web UI (kosteneffizient)`));
1858
+ console.log(chalk.gray(` → Claude/Gemini/GPT mit Agents verwenden`));
1859
+ console.log(chalk.cyan(` Option B: Direkt in IDE`));
1860
+ console.log(chalk.gray(` → @pm für PRD, @architect für Architecture`));
1861
+ }
1862
+ console.log('');
1863
+
1864
+ console.log(chalk.yellow("3. ⚠️ KRITISCHER ÜBERGANG: Document Sharding"));
1865
+ console.log(chalk.red(` → Sagen Sie Ihrer IDE: ${chalk.bold('"@po bitte shard die PRD und Architecture Dokumente"')}`));
1866
+ console.log(chalk.gray(` → Dokumente werden in fokussierte Teile aufgeteilt\n`));
1867
+
1868
+ console.log(chalk.yellow("4. 🚀 BMAD Development Cycle:"));
1869
+ console.log(chalk.cyan(` 1. @sm → Story Draft von Sharded Epic`));
1870
+ console.log(chalk.cyan(` 2. @po → Story Validation (optional)`));
1871
+ console.log(chalk.cyan(` 3. User → Story Approval`));
1872
+ console.log(chalk.cyan(` 4. @dev → Implementation + Tests`));
1873
+ console.log(chalk.cyan(` 5. @qa → Code Review (optional)`));
1874
+ console.log(chalk.red(` 6. ⚠️ COMMIT CHANGES BEFORE PROCEEDING!`));
1875
+ console.log(chalk.gray(` → Loop zurück zu @sm für nächste Story\n`));
1876
+
1877
+ console.log(chalk.yellow("5. 🎯 Quick Commands (in quick-start.md):"));
1878
+ console.log(chalk.cyan(` /plan → Planning starten`));
1879
+ console.log(chalk.cyan(` /shard → Document Sharding`));
1880
+ console.log(chalk.cyan(` /story → Nächste Story`));
1881
+ console.log(chalk.cyan(` /dev → Development`));
1882
+ console.log(chalk.cyan(` /qa → Quality Review`));
1883
+ console.log(chalk.gray(` → Alle Details in appiq-solution/workflows/\n`));
1884
+
1885
+ console.log(chalk.cyan("🎯 Das war's! Kein komplizierter Setup mehr."));
1886
+ console.log(chalk.green("🚀 Viel Erfolg mit Appiq!\n"));
1887
+
1888
+ // Quick reference
1889
+ console.log(chalk.dim("━".repeat(50)));
1890
+ console.log(chalk.dim("📁 Quick Reference:"));
1891
+ console.log(chalk.dim(` • Agents: appiq-solution/agents/`));
1892
+ console.log(
1893
+ chalk.dim(` • Quick Start: appiq-solution/commands/quick-start.md`)
1894
+ );
1895
+ console.log(chalk.dim(` • Projekt-Typ: ${this.config.projectType}`));
1896
+ console.log(
1897
+ chalk.dim(
1898
+ ` • IDEs: ${this.config.selectedIDEs
1899
+ .map((ide) => this.getIDEName(ide))
1900
+ .join(", ")}`
1901
+ )
1902
+ );
1903
+ }
1904
+
1905
+ // Helper methods
1906
+ hasExistingSourceCode() {
1907
+ const sourceDirs = ["src", "lib", "app", "components", "pages"];
1908
+ return sourceDirs.some(
1909
+ (dir) =>
1910
+ fs.existsSync(path.join(this.projectRoot, dir)) &&
1911
+ fs.readdirSync(path.join(this.projectRoot, dir)).length > 0
1912
+ );
1913
+ }
1914
+
1915
+ hasExistingDocumentation() {
1916
+ const docFiles = ["README.md", "docs", "documentation"];
1917
+ return docFiles.some((file) =>
1918
+ fs.existsSync(path.join(this.projectRoot, file))
1919
+ );
1920
+ }
1921
+
1922
+ async installProjectConfig() {
1923
+ const configContent = this.generateProjectConfig();
1924
+ fs.writeFileSync(
1925
+ path.join(this.appiqPath, "project-config.yaml"),
1926
+ configContent
1927
+ );
1928
+ }
1929
+
1930
+ generateProjectConfig() {
1931
+ return `# Appiq Solution Project Configuration
1932
+ # Built with ❤️ based on Bmad-Method
1933
+ version: "1.0.0"
1934
+ project:
1935
+ type: ${this.config.projectType}
1936
+ created: ${new Date().toISOString()}
1937
+ name: ${this.config.projectName || "Unbenanntes Projekt"}
1938
+ plan_approved: ${this.config.planApproved}
1939
+
1940
+ # Wo die wichtigen Dateien liegen
1941
+ paths:
1942
+ prd: "docs/prd.md"
1943
+ architecture: "docs/architecture.md"
1944
+ stories: "docs/stories/"
1945
+ agents: "appiq-solution/agents/"
1946
+ orchestration: "appiq-solution/orchestration.yaml"
1947
+
1948
+ # One-Click Workflows
1949
+ workflows:
1950
+ ${this.config.projectType === "greenfield" ? "greenfield" : "brownfield"}:
1951
+ start_command: "${
1952
+ this.config.projectType === "greenfield" ? "/start" : "/analyze"
1953
+ }"
1954
+ agents_sequence:
1955
+ - smart-launcher
1956
+ - project-manager
1957
+ - architect
1958
+ - story-master
1959
+ - developer
1960
+ - qa-expert
1961
+
1962
+ # IDE Integration (Mehrere IDEs)
1963
+ ides:
1964
+ ${this.config.selectedIDEs
1965
+ .map(
1966
+ (ide) => ` - name: ${this.getIDEName(ide)}
1967
+ config_path: ${this.getIDEConfig(ide).dir}
1968
+ file_format: ${this.getIDEConfig(ide).suffix}`
1969
+ )
1970
+ .join("\n")}
1971
+ `;
1972
+ }
1973
+ }
1974
+
1975
+ // Run installer if called directly
1976
+ if (require.main === module) {
1977
+ // Check if 'install' command is provided
1978
+ const args = process.argv.slice(2);
1979
+
1980
+ if (args.length === 0 || args[0] === "install") {
1981
+ const installer = new AppiqSolutionInstaller();
1982
+ installer.install().catch(console.error);
1983
+ } else {
1984
+ console.log(
1985
+ chalk.red("❌ Unknown command. Use: npx appiq-solution install")
1986
+ );
1987
+ process.exit(1);
1988
+ }
1989
+ }
1990
+
1991
+ module.exports = AppiqSolutionInstaller;