jettypod 4.4.87 → 4.4.88
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/jettypod.js +55 -12
- package/package.json +1 -1
package/jettypod.js
CHANGED
|
@@ -701,8 +701,29 @@ async function generateClaude(options = {}) {
|
|
|
701
701
|
const currentConfig = config.read();
|
|
702
702
|
|
|
703
703
|
const content = await claude.generate(currentConfig, options);
|
|
704
|
+
|
|
705
|
+
// Check if content actually changed
|
|
706
|
+
const existingContent = fs.existsSync('CLAUDE.md') ? fs.readFileSync('CLAUDE.md', 'utf-8') : '';
|
|
707
|
+
const contentChanged = content !== existingContent;
|
|
708
|
+
|
|
709
|
+
if (!contentChanged) {
|
|
710
|
+
return; // No changes needed
|
|
711
|
+
}
|
|
712
|
+
|
|
704
713
|
fs.writeFileSync('CLAUDE.md', content);
|
|
705
714
|
console.log('📝 CLAUDE.md generated');
|
|
715
|
+
|
|
716
|
+
// Auto-commit if requested (for commands that legitimately update CLAUDE.md)
|
|
717
|
+
if (options.autoCommit) {
|
|
718
|
+
try {
|
|
719
|
+
const { execSync } = require('child_process');
|
|
720
|
+
execSync('git add CLAUDE.md', { stdio: 'ignore' });
|
|
721
|
+
execSync('git commit -m "chore: update CLAUDE.md"', { stdio: 'ignore' });
|
|
722
|
+
console.log('✅ CLAUDE.md changes committed');
|
|
723
|
+
} catch (err) {
|
|
724
|
+
// Commit may fail if nothing staged or not in a git repo - that's ok
|
|
725
|
+
}
|
|
726
|
+
}
|
|
706
727
|
}
|
|
707
728
|
|
|
708
729
|
// Ensure Claude Code hooks are up to date (called on every jettypod launch)
|
|
@@ -767,9 +788,9 @@ function ensureClaudeHooks() {
|
|
|
767
788
|
}
|
|
768
789
|
}
|
|
769
790
|
|
|
770
|
-
//
|
|
771
|
-
fs.writeFileSync(claudeSettingsPath, JSON.stringify(claudeSettings, null, 2));
|
|
791
|
+
// Only write settings if hooks were actually updated (avoid untracked changes in main)
|
|
772
792
|
if (hooksUpdated) {
|
|
793
|
+
fs.writeFileSync(claudeSettingsPath, JSON.stringify(claudeSettings, null, 2));
|
|
773
794
|
console.log('⚙️ Claude Code hooks updated');
|
|
774
795
|
}
|
|
775
796
|
|
|
@@ -1263,6 +1284,21 @@ switch (command) {
|
|
|
1263
1284
|
|
|
1264
1285
|
// Ensure session.md is gitignored (fixes existing projects)
|
|
1265
1286
|
ensureJettypodGitignores();
|
|
1287
|
+
|
|
1288
|
+
// Auto-commit any changes made by update (skills, hooks, gitignore, etc.)
|
|
1289
|
+
// This prevents untracked changes from breaking worktree merges
|
|
1290
|
+
try {
|
|
1291
|
+
const { execSync } = require('child_process');
|
|
1292
|
+
// Check if there are any changes to commit
|
|
1293
|
+
const status = execSync('git status --porcelain', { encoding: 'utf-8' });
|
|
1294
|
+
if (status.trim()) {
|
|
1295
|
+
execSync('git add -A', { stdio: 'ignore' });
|
|
1296
|
+
execSync('git commit -m "chore: jettypod update - refresh skills and hooks"', { stdio: 'ignore' });
|
|
1297
|
+
console.log('✅ Update changes committed');
|
|
1298
|
+
}
|
|
1299
|
+
} catch (err) {
|
|
1300
|
+
// Commit may fail if not in a git repo or nothing to commit - that's ok
|
|
1301
|
+
}
|
|
1266
1302
|
}
|
|
1267
1303
|
|
|
1268
1304
|
process.exit(success ? 0 : 1);
|
|
@@ -1282,12 +1318,12 @@ switch (command) {
|
|
|
1282
1318
|
}
|
|
1283
1319
|
config.update({ description });
|
|
1284
1320
|
console.log('✅ Project description updated');
|
|
1285
|
-
await generateClaude();
|
|
1321
|
+
await generateClaude({ autoCommit: true });
|
|
1286
1322
|
break;
|
|
1287
1323
|
|
|
1288
1324
|
case 'generate':
|
|
1289
1325
|
// Show directive only when explicitly using generate command
|
|
1290
|
-
await generateClaude({ showDirective: true });
|
|
1326
|
+
await generateClaude({ showDirective: true, autoCommit: true });
|
|
1291
1327
|
break;
|
|
1292
1328
|
|
|
1293
1329
|
case 'work':
|
|
@@ -1914,7 +1950,7 @@ switch (command) {
|
|
|
1914
1950
|
console.log('⚠️ Remember: Customer-facing features MUST use Production mode');
|
|
1915
1951
|
console.log('');
|
|
1916
1952
|
|
|
1917
|
-
await generateClaude();
|
|
1953
|
+
await generateClaude({ autoCommit: true });
|
|
1918
1954
|
} catch (err) {
|
|
1919
1955
|
console.error(`Error: ${err.message}`);
|
|
1920
1956
|
process.exit(1);
|
|
@@ -1977,7 +2013,7 @@ switch (command) {
|
|
|
1977
2013
|
console.log(' 4. Run: jettypod project discover complete --winner=<path> --rationale="<reason>"');
|
|
1978
2014
|
console.log('');
|
|
1979
2015
|
|
|
1980
|
-
await generateClaude();
|
|
2016
|
+
await generateClaude({ autoCommit: true });
|
|
1981
2017
|
console.log('📝 CLAUDE.md updated with discovery context');
|
|
1982
2018
|
|
|
1983
2019
|
} catch (err) {
|
|
@@ -2062,7 +2098,7 @@ switch (command) {
|
|
|
2062
2098
|
const checkpoint = require('./lib/discovery-checkpoint');
|
|
2063
2099
|
checkpoint.clearCheckpoint();
|
|
2064
2100
|
|
|
2065
|
-
await generateClaude();
|
|
2101
|
+
await generateClaude({ autoCommit: true });
|
|
2066
2102
|
|
|
2067
2103
|
console.log('✅ Project discovery complete!');
|
|
2068
2104
|
console.log('');
|
|
@@ -2070,7 +2106,7 @@ switch (command) {
|
|
|
2070
2106
|
console.log(`Rationale: ${rationale}`);
|
|
2071
2107
|
console.log('');
|
|
2072
2108
|
|
|
2073
|
-
|
|
2109
|
+
// Note: duplicate call removed - generateClaude already called above
|
|
2074
2110
|
console.log('📝 CLAUDE.md updated');
|
|
2075
2111
|
console.log('');
|
|
2076
2112
|
|
|
@@ -2123,11 +2159,15 @@ switch (command) {
|
|
|
2123
2159
|
// New project - auto-initialize
|
|
2124
2160
|
await initializeProject();
|
|
2125
2161
|
} else {
|
|
2126
|
-
// Project exists - launch dashboard
|
|
2162
|
+
// Project exists - launch dashboard
|
|
2127
2163
|
const currentConfig = config.read();
|
|
2128
|
-
await generateClaude();
|
|
2129
2164
|
|
|
2130
|
-
//
|
|
2165
|
+
// Only generate CLAUDE.md if it doesn't exist (avoid untracked changes in main)
|
|
2166
|
+
if (!fs.existsSync('CLAUDE.md')) {
|
|
2167
|
+
await generateClaude();
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
// Ensure Claude Code hooks are up to date on every launch (only writes if changed)
|
|
2131
2171
|
ensureClaudeHooks();
|
|
2132
2172
|
|
|
2133
2173
|
// Launch dashboard
|
|
@@ -3170,7 +3210,10 @@ Quick commands:
|
|
|
3170
3210
|
} else {
|
|
3171
3211
|
// Already initialized - show smart guidance
|
|
3172
3212
|
const currentConfig = config.read();
|
|
3173
|
-
|
|
3213
|
+
// Only generate CLAUDE.md if it doesn't exist (avoid untracked changes)
|
|
3214
|
+
if (!fs.existsSync('CLAUDE.md')) {
|
|
3215
|
+
await generateClaude();
|
|
3216
|
+
}
|
|
3174
3217
|
|
|
3175
3218
|
const discovery = currentConfig.project_discovery;
|
|
3176
3219
|
|