jettypod 4.2.2 → 4.2.4
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 +44 -0
- package/package.json +1 -1
- package/skills-templates/stable-mode/SKILL.md +11 -2
package/jettypod.js
CHANGED
|
@@ -16,6 +16,44 @@ try {
|
|
|
16
16
|
GIT_ROOT = process.cwd();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Ensure .claude/session.md is gitignored and untracked
|
|
21
|
+
* Called during init and update to fix existing projects
|
|
22
|
+
*/
|
|
23
|
+
function ensureSessionFileGitignored() {
|
|
24
|
+
const gitignorePath = path.join(process.cwd(), '.gitignore');
|
|
25
|
+
const sessionEntry = '.claude/session.md';
|
|
26
|
+
|
|
27
|
+
// Add to .gitignore if not present
|
|
28
|
+
let gitignoreContent = '';
|
|
29
|
+
if (fs.existsSync(gitignorePath)) {
|
|
30
|
+
gitignoreContent = fs.readFileSync(gitignorePath, 'utf-8');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (!gitignoreContent.includes(sessionEntry)) {
|
|
34
|
+
const newEntry = gitignoreContent.endsWith('\n') || gitignoreContent === ''
|
|
35
|
+
? `${sessionEntry}\n`
|
|
36
|
+
: `\n${sessionEntry}\n`;
|
|
37
|
+
fs.appendFileSync(gitignorePath, newEntry);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Untrack session.md if it's currently tracked
|
|
41
|
+
try {
|
|
42
|
+
const { execSync } = require('child_process');
|
|
43
|
+
// Check if file is tracked
|
|
44
|
+
execSync(`git ls-files --error-unmatch .claude/session.md 2>/dev/null`, {
|
|
45
|
+
encoding: 'utf-8',
|
|
46
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// If we get here, file is tracked - untrack it
|
|
50
|
+
execSync('git rm --cached .claude/session.md', { stdio: 'pipe' });
|
|
51
|
+
console.log('📝 Untracked .claude/session.md (now gitignored)');
|
|
52
|
+
} catch (e) {
|
|
53
|
+
// File not tracked or git error - that's fine
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
19
57
|
// CLAUDE.md generation
|
|
20
58
|
const claude = {
|
|
21
59
|
async generate(config, options = {}) {
|
|
@@ -617,6 +655,9 @@ async function initializeProject() {
|
|
|
617
655
|
fs.mkdirSync('.claude', { recursive: true });
|
|
618
656
|
}
|
|
619
657
|
|
|
658
|
+
// Ensure .claude/session.md is gitignored and untracked
|
|
659
|
+
ensureSessionFileGitignored();
|
|
660
|
+
|
|
620
661
|
const claudeSettingsPath = path.join('.claude', 'settings.json');
|
|
621
662
|
if (!fs.existsSync(claudeSettingsPath)) {
|
|
622
663
|
const claudeSettings = {
|
|
@@ -989,6 +1030,9 @@ switch (command) {
|
|
|
989
1030
|
console.error(`❌ Could not refresh skills: ${err.message}`);
|
|
990
1031
|
}
|
|
991
1032
|
}
|
|
1033
|
+
|
|
1034
|
+
// Ensure session.md is gitignored (fixes existing projects)
|
|
1035
|
+
ensureSessionFileGitignored();
|
|
992
1036
|
}
|
|
993
1037
|
|
|
994
1038
|
process.exit(success ? 0 : 1);
|
package/package.json
CHANGED
|
@@ -196,10 +196,19 @@ sqlite3 .jettypod/work.db "SELECT id, title, scenario_file, mode FROM work_items
|
|
|
196
196
|
After reading the scenario file content, parse it to find the scenario this chore addresses:
|
|
197
197
|
|
|
198
198
|
1. Split the file by `Scenario:` to get individual scenarios
|
|
199
|
-
2.
|
|
199
|
+
2. Extract scenario titles from each block
|
|
200
|
+
3. Match the chore description to a scenario by:
|
|
200
201
|
- Looking for scenario numbers in the chore description (e.g., "Scenario 2")
|
|
201
202
|
- Matching keywords from the chore description to scenario titles
|
|
202
|
-
|
|
203
|
+
4. If no match found, list available scenarios and ask which one to implement
|
|
204
|
+
|
|
205
|
+
**Handle errors gracefully:**
|
|
206
|
+
- If no current work: "❌ No current work found. Run: jettypod work start <chore-id>"
|
|
207
|
+
- If no parent feature: "❌ Current work has no parent feature."
|
|
208
|
+
- If no scenario_file: "❌ Feature has no scenario_file. Create a scenario file and update the feature."
|
|
209
|
+
- If scenario file not found: "❌ Scenario file not found at [path]"
|
|
210
|
+
- If no scenarios in file: "❌ No scenarios found in scenario file."
|
|
211
|
+
- If can't match chore to scenario: List available scenarios and ask user which one
|
|
203
212
|
|
|
204
213
|
**Display to user:**
|
|
205
214
|
|