ralph-prd 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/bin/install.mjs +18 -0
- package/install.sh +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ cd your-project && ../ralph-prd/install.sh
|
|
|
23
23
|
This installs:
|
|
24
24
|
- `.claude/ralph/` — the phased runner
|
|
25
25
|
- `.claude/skills/` — 6 Claude Code skills for the full PRD-to-ship workflow
|
|
26
|
+
- On first install, adds `.claude/ralph/` and `.claude/skills/` to `.gitignore` (skipped if `.claude/` already exists, so shared setups are respected)
|
|
26
27
|
|
|
27
28
|
### Updating
|
|
28
29
|
|
package/bin/install.mjs
CHANGED
|
@@ -37,6 +37,9 @@ const claudeDir = resolve(projectRoot, '.claude');
|
|
|
37
37
|
|
|
38
38
|
info(`Installing into ${claudeDir}`);
|
|
39
39
|
|
|
40
|
+
// Track whether .claude/ is a fresh install (for gitignore decision)
|
|
41
|
+
const isFirstInstall = !existsSync(claudeDir);
|
|
42
|
+
|
|
40
43
|
// Ensure .claude exists
|
|
41
44
|
mkdirSync(claudeDir, { recursive: true });
|
|
42
45
|
|
|
@@ -73,6 +76,21 @@ for (const skillName of readdirSync(skillsSrc)) {
|
|
|
73
76
|
ok(`Installed skill: ${skillName}`);
|
|
74
77
|
}
|
|
75
78
|
|
|
79
|
+
// Only add to .gitignore on first install — if .claude/ already existed,
|
|
80
|
+
// the user may be sharing it via git intentionally.
|
|
81
|
+
if (isFirstInstall) {
|
|
82
|
+
const gitignorePath = resolve(projectRoot, '.gitignore');
|
|
83
|
+
const ignoreEntries = ['.claude/ralph/', '.claude/skills/'];
|
|
84
|
+
let gitignoreContent = existsSync(gitignorePath) ? readFileSync(gitignorePath, 'utf8') : '';
|
|
85
|
+
const missing = ignoreEntries.filter(entry => !gitignoreContent.split('\n').some(line => line.trim() === entry));
|
|
86
|
+
if (missing.length > 0) {
|
|
87
|
+
const block = (gitignoreContent.length > 0 && !gitignoreContent.endsWith('\n') ? '\n' : '') +
|
|
88
|
+
'\n# ralph-prd (installed via npx ralph-prd)\n' + missing.join('\n') + '\n';
|
|
89
|
+
writeFileSync(gitignorePath, gitignoreContent + block, 'utf8');
|
|
90
|
+
ok(`Added ${missing.join(', ')} to .gitignore`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
76
94
|
// Summary
|
|
77
95
|
console.log('');
|
|
78
96
|
ok('ralph-prd installed successfully!');
|
package/install.sh
CHANGED
|
@@ -34,6 +34,10 @@ CLAUDE_DIR="$PROJECT_ROOT/.claude"
|
|
|
34
34
|
|
|
35
35
|
info "Installing into $CLAUDE_DIR"
|
|
36
36
|
|
|
37
|
+
# Track whether .claude/ is a fresh install (for gitignore decision)
|
|
38
|
+
IS_FIRST_INSTALL=false
|
|
39
|
+
[ ! -d "$CLAUDE_DIR" ] && IS_FIRST_INSTALL=true
|
|
40
|
+
|
|
37
41
|
# Determine source: local clone or download
|
|
38
42
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
39
43
|
|
|
@@ -91,6 +95,21 @@ if [ -f "$SOURCE_DIR/package.json" ]; then
|
|
|
91
95
|
info "Stamped version: $VERSION"
|
|
92
96
|
fi
|
|
93
97
|
|
|
98
|
+
# Only add to .gitignore on first install — if .claude/ already existed,
|
|
99
|
+
# the user may be sharing it via git intentionally.
|
|
100
|
+
if [ "$IS_FIRST_INSTALL" = true ]; then
|
|
101
|
+
GITIGNORE="$PROJECT_ROOT/.gitignore"
|
|
102
|
+
for entry in ".claude/ralph/" ".claude/skills/"; do
|
|
103
|
+
if [ ! -f "$GITIGNORE" ] || ! grep -qxF "$entry" "$GITIGNORE"; then
|
|
104
|
+
if [ ! -f "$GITIGNORE" ] || ! grep -qF "# ralph-prd" "$GITIGNORE"; then
|
|
105
|
+
printf '\n# ralph-prd (installed via install.sh)\n' >> "$GITIGNORE"
|
|
106
|
+
fi
|
|
107
|
+
echo "$entry" >> "$GITIGNORE"
|
|
108
|
+
ok "Added $entry to .gitignore"
|
|
109
|
+
fi
|
|
110
|
+
done
|
|
111
|
+
fi
|
|
112
|
+
|
|
94
113
|
# Summary
|
|
95
114
|
echo ""
|
|
96
115
|
ok "ralph-prd installed successfully!"
|