claude-flow-novice 1.5.7 → 1.5.9

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.
@@ -64,14 +64,8 @@ import {
64
64
  createHelperScript,
65
65
  COMMAND_STRUCTURE,
66
66
  } from './templates/enhanced-templates.js';
67
- import { createOptimizedSparcClaudeMd } from './templates/claude-md.js';
68
67
  import { getIsolatedNpxEnv } from '../../../utils/npx-isolated-cache.js';
69
68
  import { updateGitignore, needsGitignoreUpdate } from './gitignore-updater.js';
70
- import {
71
- createFullClaudeMd,
72
- createSparcClaudeMd,
73
- createMinimalClaudeMd,
74
- } from './templates/claude-md.js';
75
69
  import {
76
70
  createVerificationClaudeMd,
77
71
  createVerificationSettingsJson,
@@ -271,13 +265,6 @@ export async function initCommand(subArgs, flags) {
271
265
  return handleBatchInit(subArgs, flags);
272
266
  }
273
267
 
274
- // For novice package, always use enhanced initialization with agent system
275
- const useEnhanced = true; // Always enhanced for novice users
276
-
277
- if (useEnhanced) {
278
- return enhancedInitCommand(subArgs, flags);
279
- }
280
-
281
268
  // Parse init options
282
269
  const initForce = subArgs.includes('--force') || subArgs.includes('-f') || flags.force;
283
270
  const initMinimal = subArgs.includes('--minimal') || subArgs.includes('-m') || flags.minimal;
@@ -1047,11 +1034,8 @@ async function performInitializationWithCheckpoints(
1047
1034
  // Helper functions for atomic initialization
1048
1035
  async function createInitialFiles(options, workingDir, dryRun = false) {
1049
1036
  if (!dryRun) {
1050
- const claudeMd = options.sparc
1051
- ? createSparcClaudeMd()
1052
- : options.minimal
1053
- ? createMinimalClaudeMd()
1054
- : createFullClaudeMd();
1037
+ // Use template file instead of generation
1038
+ const claudeMd = await readClaudeMdTemplate();
1055
1039
  await fs.writeFile(`${workingDir}/CLAUDE.md`, claudeMd, 'utf8');
1056
1040
 
1057
1041
  const memoryBankMd = options.minimal ? createMinimalMemoryBankMd() : createFullMemoryBankMd();
@@ -498,98 +498,35 @@ async function createMemoryReadmeFiles(targetDir, options, results) {
498
498
  }
499
499
 
500
500
  /**
501
- * Get template content as fallback (for backwards compatibility)
501
+ * Get template content from template file only (NO GENERATION)
502
502
  */
503
503
  async function getTemplateContent(templatePath) {
504
504
  const filename = templatePath.split('/').pop();
505
505
 
506
- // Map template files to their generator functions
507
- const templateGenerators = {
508
- 'CLAUDE.md': async () => {
509
- const { createFullClaudeMd } = await import('./templates/claude-md.js');
510
- return createFullClaudeMd();
511
- },
512
- 'CLAUDE.md.sparc': async () => {
513
- const { createSparcClaudeMd } = await import('./templates/claude-md.js');
514
- return createSparcClaudeMd();
515
- },
516
- 'CLAUDE.md.minimal': async () => {
517
- const { createMinimalClaudeMd } = await import('./templates/claude-md.js');
518
- return createMinimalClaudeMd();
519
- },
520
- 'CLAUDE.md.optimized': async () => {
521
- const { createOptimizedSparcClaudeMd } = await import('./templates/claude-md.js');
522
- return createOptimizedSparcClaudeMd();
523
- },
524
- 'CLAUDE.md.enhanced': async () => {
525
- const { createEnhancedClaudeMd } = await import('./templates/enhanced-templates.js');
526
- return createEnhancedClaudeMd();
527
- },
528
- 'CLAUDE.md.verification': async () => {
529
- const { createVerificationClaudeMd } = await import('./templates/verification-claude-md.js');
530
- return createVerificationClaudeMd();
531
- },
532
- 'memory-bank.md': async () => {
533
- const { createFullMemoryBankMd } = await import('./templates/memory-bank-md.js');
534
- return createFullMemoryBankMd();
535
- },
536
- 'memory-bank.md.minimal': async () => {
537
- const { createMinimalMemoryBankMd } = await import('./templates/memory-bank-md.js');
538
- return createMinimalMemoryBankMd();
539
- },
540
- 'memory-bank.md.optimized': async () => {
541
- const { createOptimizedMemoryBankMd } = await import('./templates/memory-bank-md.js');
542
- return createOptimizedMemoryBankMd();
543
- },
544
- 'coordination.md': async () => {
545
- const { createFullCoordinationMd } = await import('./templates/coordination-md.js');
546
- return createFullCoordinationMd();
547
- },
548
- 'coordination.md.minimal': async () => {
549
- const { createMinimalCoordinationMd } = await import('./templates/coordination-md.js');
550
- return createMinimalCoordinationMd();
551
- },
552
- 'coordination.md.optimized': async () => {
553
- const { createOptimizedCoordinationMd } = await import('./templates/coordination-md.js');
554
- return createOptimizedCoordinationMd();
555
- },
556
- 'settings.json': async () => {
557
- return await fs.readFile(join(__dirname, 'templates', 'settings.json'), 'utf8');
558
- },
559
- 'settings.json.enhanced': async () => {
560
- const { createEnhancedSettingsJson } = await import('./templates/enhanced-templates.js');
561
- return createEnhancedSettingsJson();
562
- },
563
- 'settings.json.verification': async () => {
564
- const { createVerificationSettingsJson } = await import(
565
- './templates/verification-claude-md.js'
566
- );
567
- return createVerificationSettingsJson();
568
- },
569
- 'claude-flow-universal': async () => {
570
- return await fs.readFile(join(__dirname, 'templates', 'claude-flow-universal'), 'utf8');
571
- },
572
- 'claude-flow.bat': async () => {
573
- return await fs.readFile(join(__dirname, 'templates', 'claude-flow.bat'), 'utf8');
574
- },
575
- 'claude-flow.ps1': async () => {
576
- return await fs.readFile(join(__dirname, 'templates', 'claude-flow.ps1'), 'utf8');
577
- },
578
- };
506
+ // Try to read from the actual template file ONLY
507
+ const __filename = fileURLToPath(import.meta.url);
508
+ const __dirname = dirname(__filename);
579
509
 
580
- const generator =
581
- templateGenerators[filename] ||
582
- templateGenerators[filename.replace(/\.(sparc|minimal|optimized|enhanced)$/, '')];
510
+ // Try multiple possible template locations
511
+ const templatePaths = [
512
+ join(__dirname, 'templates', filename), // Source location: src/cli/simple-commands/init/templates/
513
+ join(__dirname, filename), // Dist location: dist/src/cli/simple-commands/init/ (files copied directly)
514
+ ];
583
515
 
584
- if (generator) {
516
+ for (const actualTemplatePath of templatePaths) {
585
517
  try {
586
- return await generator();
518
+ const content = await fs.readFile(actualTemplatePath, 'utf8');
519
+ console.log(` ✓ Using template from ${actualTemplatePath}`);
520
+ return content;
587
521
  } catch (err) {
588
- console.log(` ⚠️ Failed to generate template content for ${filename}: ${err.message}`);
589
- return null;
522
+ // Try next path
523
+ continue;
590
524
  }
591
525
  }
592
526
 
527
+ // NO FALLBACK TO GENERATION - Template file must exist
528
+ console.log(` ⚠️ Template file not found for ${filename}`);
529
+ console.log(` 💡 Template files must be present in src/cli/simple-commands/init/templates/`);
593
530
  return null;
594
531
  }
595
532