@yeongjaeyou/claude-code-config 0.10.1 → 0.11.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.
|
@@ -34,6 +34,14 @@ Safely edit Jupyter Notebook files using the correct tools.
|
|
|
34
34
|
- Check for missing functions/imports/dependencies
|
|
35
35
|
- Preserve cell outputs unless explicitly instructed otherwise
|
|
36
36
|
|
|
37
|
+
5. **Key Insights verification**: Verify outputs before documenting
|
|
38
|
+
- **Required steps**:
|
|
39
|
+
1. Read notebook output cells (use Read tool)
|
|
40
|
+
2. Read generated data files (CSV, JSON, etc.)
|
|
41
|
+
3. Check visualizations/images if any
|
|
42
|
+
- **Never**: Write insights based only on code flow
|
|
43
|
+
- **Required**: Document data source (e.g., "Source: outputs/analysis.csv")
|
|
44
|
+
|
|
37
45
|
## Guidelines
|
|
38
46
|
|
|
39
47
|
- **Use dedicated tool only**: Never use editing tools other than NotebookEdit
|
|
@@ -41,3 +49,15 @@ Safely edit Jupyter Notebook files using the correct tools.
|
|
|
41
49
|
- **Verification required**: Immediately verify changes after editing
|
|
42
50
|
- **Follow CLAUDE.md**: Adhere strictly to project guidelines
|
|
43
51
|
|
|
52
|
+
## Computation Efficiency
|
|
53
|
+
|
|
54
|
+
### Avoid
|
|
55
|
+
- Repeated model loading across cells
|
|
56
|
+
- Re-running inference when results exist
|
|
57
|
+
- Computing without caching
|
|
58
|
+
|
|
59
|
+
### Required patterns
|
|
60
|
+
1. **Cache-first**: Load cached results if exist, compute only if missing
|
|
61
|
+
2. **Single instance**: Load model once in early cell, reuse throughout
|
|
62
|
+
3. **Filter over recompute**: Filter cached results instead of re-running with different parameters
|
|
63
|
+
|
|
@@ -36,7 +36,14 @@ Act as an expert developer who systematically analyzes and resolves GitHub issue
|
|
|
36
36
|
```
|
|
37
37
|
- Skip if Status field does not exist
|
|
38
38
|
|
|
39
|
-
5. **Analyze Codebase**:
|
|
39
|
+
5. **Analyze Codebase (MANDATORY)**: Before writing any code, spawn multiple Explorer agents in parallel to preserve main context:
|
|
40
|
+
- **Structure agent**: Overall architecture and file relationships
|
|
41
|
+
- **Pattern agent**: Similar implementations in codebase
|
|
42
|
+
- **Dependency agent**: Affected modules and consumers
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
Task tool with subagent_type=Explore (launch 2-3 agents simultaneously)
|
|
46
|
+
```
|
|
40
47
|
|
|
41
48
|
6. **Plan Resolution**: Based on analysis results, develop a concrete resolution plan and define work steps.
|
|
42
49
|
|
|
@@ -67,6 +67,25 @@ Utilize MCP servers whenever possible:
|
|
|
67
67
|
|
|
68
68
|
### Code Exploration Strategy
|
|
69
69
|
|
|
70
|
+
#### Pre-Implementation Exploration (MANDATORY)
|
|
71
|
+
Before writing or modifying code, spawn multiple Explorer agents in parallel:
|
|
72
|
+
|
|
73
|
+
| Agent Focus | Purpose |
|
|
74
|
+
|-------------|---------|
|
|
75
|
+
| **Structure** | Overall architecture and file relationships |
|
|
76
|
+
| **Pattern** | Similar implementations in codebase |
|
|
77
|
+
| **Dependency** | Affected modules and consumers |
|
|
78
|
+
|
|
79
|
+
**Benefits:**
|
|
80
|
+
- Preserves main context window for actual implementation
|
|
81
|
+
- Each agent explores independently without blocking
|
|
82
|
+
- Aggregated insights before touching code
|
|
83
|
+
|
|
84
|
+
**Execution:**
|
|
85
|
+
```
|
|
86
|
+
Task tool with subagent_type=Explore (launch 2-3 agents simultaneously in single message)
|
|
87
|
+
```
|
|
88
|
+
|
|
70
89
|
#### Parallel Exploration with Multiple Tools
|
|
71
90
|
Combine the following tools in parallel for efficient code exploration:
|
|
72
91
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# UserPromptSubmit Hook: Auto-inject guidelines on every prompt
|
|
3
|
+
# Location: .claude/hooks/inject-guidelines.sh
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
# Project directory (provided by Claude Code)
|
|
8
|
+
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
|
|
9
|
+
GUIDELINES_DIR="$PROJECT_DIR/.claude/guidelines"
|
|
10
|
+
|
|
11
|
+
# Primary guideline file to always inject
|
|
12
|
+
PRIMARY_GUIDELINE="$GUIDELINES_DIR/work-guidelines.md"
|
|
13
|
+
|
|
14
|
+
# Output as system-reminder for Claude to process
|
|
15
|
+
if [ -f "$PRIMARY_GUIDELINE" ]; then
|
|
16
|
+
echo "<system-reminder>"
|
|
17
|
+
echo "Called the Read tool with the following input: {\"file_path\":\"$PRIMARY_GUIDELINE\"}"
|
|
18
|
+
echo "</system-reminder>"
|
|
19
|
+
echo "<system-reminder>"
|
|
20
|
+
echo "Result of calling the Read tool:"
|
|
21
|
+
cat "$PRIMARY_GUIDELINE"
|
|
22
|
+
echo "</system-reminder>"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Uncomment below to inject ALL guidelines in the directory
|
|
26
|
+
# if [ -d "$GUIDELINES_DIR" ]; then
|
|
27
|
+
# for file in "$GUIDELINES_DIR"/*.md; do
|
|
28
|
+
# if [ -f "$file" ]; then
|
|
29
|
+
# echo "<system-reminder>"
|
|
30
|
+
# echo "### $(basename "$file")"
|
|
31
|
+
# cat "$file"
|
|
32
|
+
# echo "</system-reminder>"
|
|
33
|
+
# fi
|
|
34
|
+
# done
|
|
35
|
+
# fi
|
|
36
|
+
|
|
37
|
+
exit 0
|
package/bin/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ const pkg = require('../package.json');
|
|
|
9
9
|
const args = process.argv.slice(2);
|
|
10
10
|
|
|
11
11
|
// Installation target folders (non-user data only)
|
|
12
|
-
const INSTALL_FOLDERS = ['commands', 'agents', 'skills', 'guidelines'];
|
|
12
|
+
const INSTALL_FOLDERS = ['commands', 'agents', 'skills', 'guidelines', 'hooks'];
|
|
13
13
|
|
|
14
14
|
// Parse options
|
|
15
15
|
const isGlobal = args.includes('--global') || args.includes('-g');
|
|
@@ -44,6 +44,7 @@ Installed folders:
|
|
|
44
44
|
- agents/ : Custom agents
|
|
45
45
|
- skills/ : Skills (reusable tool collections)
|
|
46
46
|
- guidelines/ : Shared guidelines
|
|
47
|
+
- hooks/ : Hook scripts (auto-inject guidelines)
|
|
47
48
|
|
|
48
49
|
Note:
|
|
49
50
|
With --global install, existing user data (settings.json, history.jsonl, etc.) is preserved.
|
|
@@ -133,6 +134,10 @@ function copyFolder(src, dst, mode = 'merge') {
|
|
|
133
134
|
// Custom files (only in dest) are preserved since we don't delete them
|
|
134
135
|
try {
|
|
135
136
|
fs.copyFileSync(srcPath, dstPath);
|
|
137
|
+
// Set execute permission for shell scripts
|
|
138
|
+
if (entry.name.endsWith('.sh')) {
|
|
139
|
+
fs.chmodSync(dstPath, 0o755);
|
|
140
|
+
}
|
|
136
141
|
} catch (err) {
|
|
137
142
|
throw new Error(`Failed to copy file: ${srcPath} -> ${dstPath} - ${err.message}`);
|
|
138
143
|
}
|
|
@@ -160,6 +165,81 @@ function installFolders(mode) {
|
|
|
160
165
|
}
|
|
161
166
|
}
|
|
162
167
|
|
|
168
|
+
// Default hook configuration for inject-guidelines
|
|
169
|
+
const DEFAULT_HOOKS_CONFIG = {
|
|
170
|
+
UserPromptSubmit: [
|
|
171
|
+
{
|
|
172
|
+
matcher: '',
|
|
173
|
+
hooks: [
|
|
174
|
+
{
|
|
175
|
+
type: 'command',
|
|
176
|
+
command: 'bash .claude/hooks/inject-guidelines.sh'
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Check if a hook with the same command already exists
|
|
185
|
+
* @param {Array} hooks - Existing hooks array
|
|
186
|
+
* @param {string} command - Command to check
|
|
187
|
+
* @returns {boolean}
|
|
188
|
+
*/
|
|
189
|
+
function hookExists(hooks, command) {
|
|
190
|
+
if (!Array.isArray(hooks)) return false;
|
|
191
|
+
return hooks.some(hook => {
|
|
192
|
+
if (!hook.hooks || !Array.isArray(hook.hooks)) return false;
|
|
193
|
+
return hook.hooks.some(h => h.command === command);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Merge settings.json with default hooks configuration
|
|
199
|
+
* Preserves existing user settings and only adds new hooks
|
|
200
|
+
*/
|
|
201
|
+
function mergeSettingsJson() {
|
|
202
|
+
const settingsPath = path.join(dest, 'settings.json');
|
|
203
|
+
let settings = {};
|
|
204
|
+
|
|
205
|
+
// Load existing settings if exists
|
|
206
|
+
if (fs.existsSync(settingsPath)) {
|
|
207
|
+
try {
|
|
208
|
+
const content = fs.readFileSync(settingsPath, 'utf8');
|
|
209
|
+
settings = JSON.parse(content);
|
|
210
|
+
} catch (err) {
|
|
211
|
+
console.log('Warning: Could not parse existing settings.json, creating new one.');
|
|
212
|
+
settings = {};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Initialize hooks object if not exists
|
|
217
|
+
if (!settings.hooks) {
|
|
218
|
+
settings.hooks = {};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Initialize UserPromptSubmit array if not exists
|
|
222
|
+
if (!settings.hooks.UserPromptSubmit) {
|
|
223
|
+
settings.hooks.UserPromptSubmit = [];
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Add default hooks if not already present
|
|
227
|
+
const targetCommand = DEFAULT_HOOKS_CONFIG.UserPromptSubmit[0].hooks[0].command;
|
|
228
|
+
if (!hookExists(settings.hooks.UserPromptSubmit, targetCommand)) {
|
|
229
|
+
settings.hooks.UserPromptSubmit.push(DEFAULT_HOOKS_CONFIG.UserPromptSubmit[0]);
|
|
230
|
+
console.log('Added inject-guidelines hook to settings.json');
|
|
231
|
+
} else {
|
|
232
|
+
console.log('inject-guidelines hook already exists in settings.json');
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Write merged settings
|
|
236
|
+
try {
|
|
237
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
238
|
+
} catch (err) {
|
|
239
|
+
throw new Error(`Failed to write settings.json: ${err.message}`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
163
243
|
/**
|
|
164
244
|
* Main function
|
|
165
245
|
*/
|
|
@@ -237,6 +317,9 @@ async function main() {
|
|
|
237
317
|
// Install folders
|
|
238
318
|
installFolders(installMode);
|
|
239
319
|
|
|
320
|
+
// Merge settings.json with hooks configuration
|
|
321
|
+
mergeSettingsJson();
|
|
322
|
+
|
|
240
323
|
console.log('');
|
|
241
324
|
console.log('.claude/ folder installed successfully!');
|
|
242
325
|
console.log('');
|
|
@@ -245,6 +328,10 @@ async function main() {
|
|
|
245
328
|
console.log(' - agents/ : Custom agents');
|
|
246
329
|
console.log(' - skills/ : Skills (reusable tool collections)');
|
|
247
330
|
console.log(' - guidelines/ : Shared guidelines');
|
|
331
|
+
console.log(' - hooks/ : Hook scripts (auto-inject guidelines)');
|
|
332
|
+
console.log('');
|
|
333
|
+
console.log('Configured:');
|
|
334
|
+
console.log(' - settings.json : UserPromptSubmit hook registered');
|
|
248
335
|
console.log('');
|
|
249
336
|
|
|
250
337
|
if (isGlobal) {
|