get-shit-done-cc 1.9.0 → 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
- });
File without changes