ai-sprint-kit 2.1.47 → 2.1.49
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.
- package/lib/installer.js +42 -1
- package/package.json +1 -1
package/lib/installer.js
CHANGED
|
@@ -37,7 +37,7 @@ async function copyProContent(sourceDir, targetDir, force = false) {
|
|
|
37
37
|
// ai_context is NOT copied - preserve user's plans, reports, memory
|
|
38
38
|
// EXCEPT ralph-tui config which contains skills and templates for ralph-tui integration
|
|
39
39
|
{ src: 'ai_context/ralph-tui', dest: 'ai_context/ralph-tui' },
|
|
40
|
-
|
|
40
|
+
// CLAUDE.md handled specially below - append instead of replace
|
|
41
41
|
{ src: 'README.md', dest: 'AI-SPRINT-README.md' },
|
|
42
42
|
{ src: 'docs', dest: '.claude/docs' },
|
|
43
43
|
{ src: 'scripts', dest: '.claude/scripts' }
|
|
@@ -63,6 +63,47 @@ async function copyProContent(sourceDir, targetDir, force = false) {
|
|
|
63
63
|
|
|
64
64
|
await fs.cp(srcPath, destPath, { recursive: true, force: true });
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
// Handle CLAUDE.md specially - append if exists, create if not
|
|
68
|
+
await handleClaudeMd(sourceDir, targetDir);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Handle CLAUDE.md - append AI Sprint content if file exists, create if not
|
|
73
|
+
* @param {string} sourceDir - Cloned repo path
|
|
74
|
+
* @param {string} targetDir - User's project directory
|
|
75
|
+
*/
|
|
76
|
+
async function handleClaudeMd(sourceDir, targetDir) {
|
|
77
|
+
const srcPath = path.join(sourceDir, 'CLAUDE.md');
|
|
78
|
+
const destPath = path.join(targetDir, 'CLAUDE.md');
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
await fs.access(srcPath);
|
|
82
|
+
} catch {
|
|
83
|
+
return; // Source doesn't exist, skip
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const aiSprintContent = await fs.readFile(srcPath, 'utf-8');
|
|
87
|
+
const separator = '\n\n---\n\n# AI Sprint Kit Framework\n\n';
|
|
88
|
+
|
|
89
|
+
try {
|
|
90
|
+
// Check if CLAUDE.md exists
|
|
91
|
+
const existingContent = await fs.readFile(destPath, 'utf-8');
|
|
92
|
+
|
|
93
|
+
// Check if AI Sprint content already added
|
|
94
|
+
if (existingContent.includes('# AI Sprint Kit Framework') ||
|
|
95
|
+
existingContent.includes('AI Sprint - Security-first')) {
|
|
96
|
+
// Already has AI Sprint content, skip
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Append AI Sprint content to existing file
|
|
101
|
+
const mergedContent = existingContent.trimEnd() + separator + aiSprintContent;
|
|
102
|
+
await fs.writeFile(destPath, mergedContent);
|
|
103
|
+
} catch {
|
|
104
|
+
// CLAUDE.md doesn't exist, create new
|
|
105
|
+
await fs.copyFile(srcPath, destPath);
|
|
106
|
+
}
|
|
66
107
|
}
|
|
67
108
|
|
|
68
109
|
/**
|