@yeongjaeyou/claude-code-config 0.10.0 → 0.11.0

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
+
@@ -5,16 +5,20 @@ Break down large work items into manageable, independent issues. Follow project
5
5
  ## Workflow
6
6
 
7
7
  1. Check issue numbers: Run `gh issue list` to view current issue numbers
8
- 2. Analyze work: Understand core requirements and objectives
9
- 3. Decompose work: Split major tasks into smaller, manageable sub-tasks or issues. **Aim for optimal count over excessive issues (keep it manageable)**
10
- 4. Analyze dependencies: Identify prerequisite tasks
11
- 5. Suggest milestone name: Propose a milestone to group decomposed tasks
12
- 6. Check related PRs (optional): Run `gh pr list --state closed --limit 20` for similar work references (skip if none)
13
- 7. Output decomposed issues: Display issues with proposed milestone name
14
- 8. Ask about GitHub creation: Use AskUserQuestion to let user decide on milestone and issue creation
8
+ 2. **Discover available components**:
9
+ - Scan `.claude/agents/` for custom agents (read YAML frontmatter)
10
+ - Scan `.claude/skills/` for available skills (read SKILL.md)
11
+ - Check `.mcp.json` for configured MCP servers
12
+ 3. Analyze work: Understand core requirements and objectives
13
+ 4. Decompose work: Split major tasks into smaller, manageable sub-tasks or issues. **Aim for optimal count over excessive issues (keep it manageable)**
14
+ 5. Analyze dependencies: Identify prerequisite tasks
15
+ 6. Suggest milestone name: Propose a milestone to group decomposed tasks
16
+ 7. Check related PRs (optional): Run `gh pr list --state closed --limit 20` for similar work references (skip if none)
17
+ 8. Output decomposed issues: Display issues with proposed milestone name
18
+ 9. Ask about GitHub creation: Use AskUserQuestion to let user decide on milestone and issue creation
15
19
  - Create milestone: `gh api repos/:owner/:repo/milestones -f title="Milestone Name" -f description="Description"`
16
20
  - Assign issues with `--milestone` option
17
- 9. **Add issues to GitHub Project (optional)**
21
+ 10. **Add issues to GitHub Project (optional)**
18
22
  - Check for existing projects: `gh project list --owner <owner> --format json`
19
23
  - If no project exists: Display "No project found. You can create one with `/gh:init-project`" and skip
20
24
  - If project exists: Ask user via AskUserQuestion whether to add issues
@@ -58,9 +62,99 @@ Examples (vary by project, for reference only):
58
62
  **Dependencies**:
59
63
  - [ ] None or prerequisite issue #number
60
64
 
61
- **Recommended agent** (if applicable):
62
- - Include here if agent usage is specified in arguments
65
+ **Execution strategy**:
66
+ - **Pattern**: main-only | sequential | parallel | delegation
67
+ - **Delegate to**: (delegation only) agent name
68
+ - **Skills**: [discovered skills, or none]
69
+ - **MCP**: [discovered MCP servers, or none]
70
+
71
+ **Execution diagram**:
72
+ ```
73
+ +------+
74
+ | main |
75
+ +------+
76
+ Skills: none
77
+ MCP: none
78
+ ```
63
79
 
64
80
  **References** (optional):
65
81
  - Add related PRs if available (e.g., PR #36 - brief description)
66
82
  - Omit this section if none
83
+
84
+ ---
85
+
86
+ ## Execution Strategy Guide
87
+
88
+ ### Component Discovery
89
+
90
+ Before decomposing issues, scan for available components:
91
+ - **Agents**: `.claude/agents/*.md` (extract name, description from YAML frontmatter)
92
+ - **Skills**: `.claude/skills/*/SKILL.md` (extract name, description from YAML frontmatter)
93
+ - **MCP**: `.mcp.json` (extract server names and purposes)
94
+
95
+ ### Execution Patterns
96
+
97
+ ```
98
+ Pattern A: main-only
99
+ +------+ Skills: /code-explorer, /xlsx
100
+ | main | MCP: serena, context7
101
+ +------+
102
+
103
+ Pattern B: sequential
104
+ +---------+ +------+ Skills: ...
105
+ | explore | --> | main | MCP: ...
106
+ +---------+ +------+
107
+
108
+ Pattern C: parallel
109
+ +---------+
110
+ | explore |--+
111
+ +---------+ | +------+ Skills: ...
112
+ | explore |--+->| main | MCP: ...
113
+ +---------+ | +------+
114
+ | explore |--+
115
+ +---------+
116
+
117
+ Pattern D: delegation
118
+ +------+ +----------------+ Skills: ...
119
+ | main | --> | python-pro | MCP: serena
120
+ +------+ | web-researcher |
121
+ +----------------+
122
+
123
+ Note: main can spawn subagents at any point during execution
124
+ ```
125
+
126
+ ### Pattern Selection
127
+
128
+ | Situation | Pattern | Example |
129
+ |-----------|---------|---------|
130
+ | Simple fix/change | main-only | Bug fix, single file change |
131
+ | Analysis then implement | sequential | New feature, refactoring |
132
+ | Complex analysis needed | parallel | Large refactor, architecture change |
133
+ | Specialized work | delegation | Python optimization, technical research |
134
+
135
+ ### Diagram in Issues
136
+
137
+ Always include an ASCII diagram in the issue body to visualize the execution flow:
138
+
139
+ ```
140
+ // main-only
141
+ +------+
142
+ | main |
143
+ +------+
144
+ Skills: /code-review
145
+ MCP: serena
146
+
147
+ // delegation
148
+ +------+ +--------------------+
149
+ | main | --> | deepfake-cv-expert |
150
+ +------+ +--------------------+
151
+ Skills: none
152
+ MCP: none
153
+
154
+ // sequential
155
+ +---------+ +------+
156
+ | explore | --> | main |
157
+ +---------+ +------+
158
+ Skills: ...
159
+ MCP: ...
160
+ ```
@@ -61,6 +61,10 @@ Utilize MCP servers whenever possible:
61
61
  - `mcpdocs` - Documentation fetching
62
62
  - `firecrawl` - Web scraping and search
63
63
 
64
+ ### Agent & Skill Usage
65
+ - 작업에 적합한 agent 또는 skill이 있다면 적극 활용
66
+ - 의도가 명확하면 바로 사용, 불명확하면 제안 후 승인 받기
67
+
64
68
  ### Code Exploration Strategy
65
69
 
66
70
  #### Parallel Exploration with Multiple Tools
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeongjaeyou/claude-code-config",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Claude Code CLI custom commands, agents, and skills",
5
5
  "bin": {
6
6
  "claude-code-config": "./bin/cli.js"