get-shit-done-cc 1.9.1 → 1.9.2

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.
@@ -1,78 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Intel Prune Hook (Stop event)
5
- *
6
- * Removes stale entries from index.json when files no longer exist.
7
- * Runs after each Claude response to keep intel fresh.
8
- *
9
- * Fast: Only does fs.existsSync checks, no file reading.
10
- * Silent: Never blocks or errors, always exits 0.
11
- */
12
-
13
- const fs = require('fs');
14
- const path = require('path');
15
-
16
- function pruneIndex() {
17
- const intelDir = path.join(process.cwd(), '.planning', 'intel');
18
- const indexPath = path.join(intelDir, 'index.json');
19
-
20
- // Only run if intel directory exists (opt-in check)
21
- if (!fs.existsSync(intelDir)) {
22
- return { pruned: 0, total: 0 };
23
- }
24
-
25
- // Read existing index
26
- let index;
27
- try {
28
- const content = fs.readFileSync(indexPath, 'utf8');
29
- index = JSON.parse(content);
30
- } catch (e) {
31
- // No index or invalid JSON
32
- return { pruned: 0, total: 0 };
33
- }
34
-
35
- if (!index.files || typeof index.files !== 'object') {
36
- return { pruned: 0, total: 0 };
37
- }
38
-
39
- // Check each file and collect deleted ones
40
- const filePaths = Object.keys(index.files);
41
- const deleted = filePaths.filter(filePath => !fs.existsSync(filePath));
42
-
43
- if (deleted.length === 0) {
44
- return { pruned: 0, total: filePaths.length };
45
- }
46
-
47
- // Remove deleted entries
48
- for (const filePath of deleted) {
49
- delete index.files[filePath];
50
- }
51
- index.updated = Date.now();
52
-
53
- // Write updated index
54
- fs.writeFileSync(indexPath, JSON.stringify(index, null, 2));
55
-
56
- // Regenerate conventions and summary after pruning
57
- // Import detection logic from intel-index.js would be complex,
58
- // so we just update the index. Conventions/summary stay until
59
- // next PostToolUse or /gsd:analyze-codebase refresh.
60
-
61
- return { pruned: deleted.length, total: filePaths.length };
62
- }
63
-
64
- // Read JSON from stdin (standard hook pattern)
65
- let input = '';
66
- process.stdin.setEncoding('utf8');
67
- process.stdin.on('data', chunk => input += chunk);
68
- process.stdin.on('end', () => {
69
- try {
70
- // Stop hook receives session data, but we don't need it
71
- // Just prune stale entries
72
- pruneIndex();
73
- process.exit(0);
74
- } catch (error) {
75
- // Silent failure - never block Claude
76
- process.exit(0);
77
- }
78
- });
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env node
2
- // Codebase Intelligence - SessionStart Context Injection Hook
3
- // Reads pre-generated summary.md and injects into Claude's context
4
-
5
- const fs = require('fs');
6
- const path = require('path');
7
-
8
- // Read JSON from stdin (standard hook pattern)
9
- let input = '';
10
- process.stdin.setEncoding('utf8');
11
- process.stdin.on('data', chunk => input += chunk);
12
- process.stdin.on('end', () => {
13
- try {
14
- const data = JSON.parse(input);
15
-
16
- // Only inject on startup or resume
17
- if (!['startup', 'resume'].includes(data.source)) {
18
- process.exit(0);
19
- }
20
-
21
- // Read pre-generated summary (created by gsd-intel-index.js)
22
- const summaryPath = path.join(process.cwd(), '.planning', 'intel', 'summary.md');
23
-
24
- if (!fs.existsSync(summaryPath)) {
25
- process.exit(0); // No intel, skip silently
26
- }
27
-
28
- const summary = fs.readFileSync(summaryPath, 'utf8').trim();
29
-
30
- if (summary) {
31
- process.stdout.write(`<codebase-intelligence>\n${summary}\n</codebase-intelligence>`);
32
- }
33
-
34
- process.exit(0);
35
- } catch (error) {
36
- // Silent failure - never block Claude
37
- process.exit(0);
38
- }
39
- });
@@ -1,84 +0,0 @@
1
- #!/usr/bin/env node
2
- // Claude Code Statusline - GSD Edition
3
- // Shows: model | current task | directory | context usage
4
-
5
- const fs = require('fs');
6
- const path = require('path');
7
- const os = require('os');
8
-
9
- // Read JSON from stdin
10
- let input = '';
11
- process.stdin.setEncoding('utf8');
12
- process.stdin.on('data', chunk => input += chunk);
13
- process.stdin.on('end', () => {
14
- try {
15
- const data = JSON.parse(input);
16
- const model = data.model?.display_name || 'Claude';
17
- const dir = data.workspace?.current_dir || process.cwd();
18
- const session = data.session_id || '';
19
- const remaining = data.context_window?.remaining_percentage;
20
-
21
- // Context window display (shows USED percentage)
22
- let ctx = '';
23
- if (remaining != null) {
24
- const rem = Math.round(remaining);
25
- const used = Math.max(0, Math.min(100, 100 - rem));
26
-
27
- // Build progress bar (10 segments)
28
- const filled = Math.floor(used / 10);
29
- const bar = '█'.repeat(filled) + '░'.repeat(10 - filled);
30
-
31
- // Color based on usage
32
- if (used < 50) {
33
- ctx = ` \x1b[32m${bar} ${used}%\x1b[0m`;
34
- } else if (used < 65) {
35
- ctx = ` \x1b[33m${bar} ${used}%\x1b[0m`;
36
- } else if (used < 80) {
37
- ctx = ` \x1b[38;5;208m${bar} ${used}%\x1b[0m`;
38
- } else {
39
- ctx = ` \x1b[5;31m💀 ${bar} ${used}%\x1b[0m`;
40
- }
41
- }
42
-
43
- // Current task from todos
44
- let task = '';
45
- const homeDir = os.homedir();
46
- const todosDir = path.join(homeDir, '.claude', 'todos');
47
- if (session && fs.existsSync(todosDir)) {
48
- const files = fs.readdirSync(todosDir)
49
- .filter(f => f.startsWith(session) && f.includes('-agent-') && f.endsWith('.json'))
50
- .map(f => ({ name: f, mtime: fs.statSync(path.join(todosDir, f)).mtime }))
51
- .sort((a, b) => b.mtime - a.mtime);
52
-
53
- if (files.length > 0) {
54
- try {
55
- const todos = JSON.parse(fs.readFileSync(path.join(todosDir, files[0].name), 'utf8'));
56
- const inProgress = todos.find(t => t.status === 'in_progress');
57
- if (inProgress) task = inProgress.activeForm || '';
58
- } catch (e) {}
59
- }
60
- }
61
-
62
- // GSD update available?
63
- let gsdUpdate = '';
64
- const cacheFile = path.join(homeDir, '.claude', 'cache', 'gsd-update-check.json');
65
- if (fs.existsSync(cacheFile)) {
66
- try {
67
- const cache = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));
68
- if (cache.update_available) {
69
- gsdUpdate = '\x1b[33m⬆ /gsd:update\x1b[0m │ ';
70
- }
71
- } catch (e) {}
72
- }
73
-
74
- // Output
75
- const dirname = path.basename(dir);
76
- if (task) {
77
- process.stdout.write(`${gsdUpdate}\x1b[2m${model}\x1b[0m │ \x1b[1m${task}\x1b[0m │ \x1b[2m${dirname}\x1b[0m${ctx}`);
78
- } else {
79
- process.stdout.write(`${gsdUpdate}\x1b[2m${model}\x1b[0m │ \x1b[2m${dirname}\x1b[0m${ctx}`);
80
- }
81
- } catch (e) {
82
- // Silent fail - don't break statusline on parse errors
83
- }
84
- });