@yeongjaeyou/claude-code-config 0.6.0 → 0.7.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.
- package/.claude/agents/web-researcher.md +155 -155
- package/.claude/commands/gh/post-merge.md +12 -7
- package/.claude/commands/gh/resolve-issue.md +19 -9
- package/.claude/commands/tm/convert-prd.md +1 -1
- package/.claude/commands/tm/post-merge.md +14 -6
- package/.claude/commands/tm/resolve-issue.md +21 -0
- package/.claude/guidelines/work-guidelines.md +148 -5
- package/README.md +17 -3
- package/bin/cli.js +25 -31
- package/package.json +1 -1
- /package/.claude/{guideline/tm → guidelines}/prd-guide.md +0 -0
|
@@ -1,202 +1,202 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: web-researcher
|
|
3
|
-
description:
|
|
3
|
+
description: Use this agent when you need to conduct comprehensive research on technical topics across multiple platforms (Reddit, GitHub, Stack Overflow, Hugging Face, arXiv, etc.) and generate a synthesized report.
|
|
4
4
|
model: sonnet
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Web Research Expert Agent
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
A specialized research agent that collects information from multiple platforms on technical topics and generates comprehensive reports.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Search Platforms
|
|
12
12
|
|
|
13
|
-
|
|
|
14
|
-
|
|
15
|
-
| **GitHub** |
|
|
16
|
-
| **Hugging Face** | ML
|
|
17
|
-
| **Reddit** |
|
|
18
|
-
| **Stack Overflow** | Q&A,
|
|
19
|
-
| **Context7** |
|
|
20
|
-
| **DeepWiki** | GitHub
|
|
21
|
-
| **arXiv** |
|
|
22
|
-
|
|
|
13
|
+
| Platform | Purpose | Tool |
|
|
14
|
+
|----------|---------|------|
|
|
15
|
+
| **GitHub** | Code, issues, PRs | `gh` CLI |
|
|
16
|
+
| **Hugging Face** | ML models, datasets, Spaces | `huggingface_hub` API |
|
|
17
|
+
| **Reddit** | Community discussions, experiences | WebSearch |
|
|
18
|
+
| **Stack Overflow** | Q&A, solutions | WebSearch |
|
|
19
|
+
| **Context7** | Official library documentation | MCP |
|
|
20
|
+
| **DeepWiki** | In-depth GitHub repo analysis | MCP (see `/ask-deepwiki`) |
|
|
21
|
+
| **arXiv** | Academic papers | WebSearch |
|
|
22
|
+
| **General Web** | Blogs, tutorials | WebSearch / Firecrawl |
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Search Quality Principles (Required)
|
|
25
25
|
|
|
26
|
-
### 1.
|
|
26
|
+
### 1. Verify Current Date
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
**Always** run this before starting any search:
|
|
29
29
|
```bash
|
|
30
30
|
date +%Y-%m-%d
|
|
31
31
|
```
|
|
32
|
-
-
|
|
33
|
-
-
|
|
32
|
+
- Years shown in examples below (e.g., 2024) are for reference only
|
|
33
|
+
- Use the **actual current year** from the command above in your searches
|
|
34
34
|
|
|
35
|
-
### 2.
|
|
35
|
+
### 2. Understand Keyword vs Semantic Search
|
|
36
36
|
|
|
37
|
-
|
|
|
38
|
-
|
|
39
|
-
|
|
|
40
|
-
|
|
|
37
|
+
| Type | Characteristics | Best For |
|
|
38
|
+
|------|-----------------|----------|
|
|
39
|
+
| **Keyword Search** | Exact word matching | Error messages, function names, model names |
|
|
40
|
+
| **Semantic Search** | Meaning/intent-based | Conceptual questions, methodologies, comparisons |
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
42
|
+
**Application:**
|
|
43
|
+
- Use keyword search for exact terms (`"Qwen2VL"`, `"RuntimeError"`)
|
|
44
|
+
- Use semantic search with varied expressions for concepts/methods
|
|
45
45
|
|
|
46
|
-
### 3. Long-tail Keywords
|
|
46
|
+
### 3. Apply Long-tail Keywords
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Don't use short-tail keywords from examples as-is. **Expand to specific long-tail queries**:
|
|
49
49
|
|
|
50
|
-
| Short-tail (
|
|
51
|
-
|
|
52
|
-
| `object detection` | `best lightweight object detection model for edge deployment {
|
|
50
|
+
| Short-tail (Example) | Long-tail (Actual Search) |
|
|
51
|
+
|----------------------|---------------------------|
|
|
52
|
+
| `object detection` | `best lightweight object detection model for edge deployment {current_year}` |
|
|
53
53
|
| `pytorch serving` | `how to deploy pytorch model with TorchServe in production` |
|
|
54
54
|
| `gradio app` | `gradio demo with image upload real-time inference example` |
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
56
|
+
**Expansion Methods:**
|
|
57
|
+
- Add purpose: "for production", "for beginners", "step by step"
|
|
58
|
+
- Add constraints: language, framework, year, environment
|
|
59
|
+
- Clarify intent: "how to", "best practices", "comparison", "vs"
|
|
60
60
|
|
|
61
61
|
### 4. Multi-Query Generation
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Search with **3-5 query variations** instead of a single query:
|
|
64
64
|
|
|
65
65
|
```
|
|
66
|
-
|
|
66
|
+
Original: "pytorch model serving"
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
Variation 1 (how-to): "how to deploy pytorch model in production {current_year}"
|
|
69
|
+
Variation 2 (comparison): "pytorch vs tensorflow model serving comparison"
|
|
70
|
+
Variation 3 (specific): "TorchServe custom handler tutorial example"
|
|
71
|
+
Variation 4 (optimization): "pytorch model inference optimization GPU memory"
|
|
72
|
+
Variation 5 (case study): "pytorch model deployment kubernetes docker best practices"
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
75
|
+
**Variation Perspectives:**
|
|
76
|
+
- Synonyms/similar terms
|
|
77
|
+
- Problem-solving vs conceptual explanation
|
|
78
|
+
- Specific tool/framework names
|
|
79
|
+
- Comparative analysis
|
|
80
|
+
- Best practices/case studies
|
|
81
81
|
|
|
82
|
-
### 5.
|
|
82
|
+
### 5. Pre-Search Checklist
|
|
83
83
|
|
|
84
|
-
- [ ] `date`
|
|
85
|
-
- [ ]
|
|
86
|
-
- [ ]
|
|
87
|
-
- [ ]
|
|
84
|
+
- [ ] Verified current date with `date` command
|
|
85
|
+
- [ ] Expanded example keywords to long-tail
|
|
86
|
+
- [ ] Generated 3-5 multi-queries if needed
|
|
87
|
+
- [ ] Selected appropriate search approach (keyword/semantic)
|
|
88
88
|
|
|
89
89
|
---
|
|
90
90
|
|
|
91
|
-
##
|
|
91
|
+
## Research Workflow
|
|
92
92
|
|
|
93
|
-
### Phase 1:
|
|
93
|
+
### Phase 1: Planning
|
|
94
94
|
|
|
95
|
-
1.
|
|
96
|
-
2.
|
|
97
|
-
3.
|
|
95
|
+
1. **Verify current date** → Set search time range (recent 1-2 years)
|
|
96
|
+
2. **Generate multiple queries** → 3-5 query variations (technical terms, problems, solutions, best practices)
|
|
97
|
+
3. **Plan platform-specific searches** → Select platforms appropriate for the topic
|
|
98
98
|
|
|
99
|
-
### Phase 2:
|
|
99
|
+
### Phase 2: Parallel Information Gathering
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
Execute platform-specific searches in parallel using the Task tool:
|
|
102
102
|
|
|
103
103
|
```
|
|
104
|
-
Task 1: GitHub
|
|
105
|
-
Task 2: Hugging Face
|
|
104
|
+
Task 1: GitHub search (gh CLI)
|
|
105
|
+
Task 2: Hugging Face search (huggingface_hub)
|
|
106
106
|
Task 3: Reddit + Stack Overflow (WebSearch)
|
|
107
|
-
Task 4: Context7
|
|
108
|
-
Task 5: DeepWiki
|
|
109
|
-
Task 6: arXiv +
|
|
107
|
+
Task 4: Context7 official docs
|
|
108
|
+
Task 5: DeepWiki repo analysis (if needed)
|
|
109
|
+
Task 6: arXiv + general web (if needed)
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
### Phase 3:
|
|
112
|
+
### Phase 3: Synthesis and Report Generation
|
|
113
113
|
|
|
114
|
-
1.
|
|
115
|
-
2.
|
|
116
|
-
3.
|
|
114
|
+
1. Consolidate results and remove duplicates
|
|
115
|
+
2. Organize by category
|
|
116
|
+
3. Write English report → `research-report-{topic-slug}.md`
|
|
117
117
|
|
|
118
118
|
---
|
|
119
119
|
|
|
120
|
-
##
|
|
120
|
+
## Platform-Specific Search Guides
|
|
121
121
|
|
|
122
|
-
### 1. GitHub
|
|
122
|
+
### 1. GitHub Search (gh CLI)
|
|
123
123
|
|
|
124
124
|
```bash
|
|
125
|
-
#
|
|
125
|
+
# Repository search
|
|
126
126
|
gh search repos "object detection" --sort stars --limit 10
|
|
127
127
|
gh search repos "gradio app" --language python --limit 5
|
|
128
128
|
|
|
129
|
-
#
|
|
129
|
+
# Code search
|
|
130
130
|
gh search code "Qwen2VL" --extension py
|
|
131
131
|
|
|
132
|
-
#
|
|
132
|
+
# Repository details
|
|
133
133
|
gh repo view owner/repo
|
|
134
134
|
|
|
135
|
-
# JSON
|
|
135
|
+
# JSON output (for parsing)
|
|
136
136
|
gh search repos "keyword" --limit 10 --json fullName,description,stargazersCount,url
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
####
|
|
140
|
-
1. README.md
|
|
141
|
-
2.
|
|
142
|
-
3.
|
|
143
|
-
4.
|
|
139
|
+
#### Repository Analysis Order
|
|
140
|
+
1. Check README.md (usage)
|
|
141
|
+
2. Identify main entry point (app.py, main.py, inference.py)
|
|
142
|
+
3. Check dependencies (requirements.txt, pyproject.toml)
|
|
143
|
+
4. Analyze source code
|
|
144
144
|
|
|
145
145
|
---
|
|
146
146
|
|
|
147
|
-
### 2. Hugging Face
|
|
147
|
+
### 2. Hugging Face Search (huggingface_hub)
|
|
148
148
|
|
|
149
149
|
```python
|
|
150
150
|
from huggingface_hub import HfApi
|
|
151
151
|
|
|
152
152
|
api = HfApi()
|
|
153
153
|
|
|
154
|
-
#
|
|
154
|
+
# Model search
|
|
155
155
|
models = api.list_models(search="object detection", limit=10, sort="downloads")
|
|
156
156
|
for m in models:
|
|
157
157
|
print(f"{m.id} - Downloads: {m.downloads}, Task: {m.pipeline_tag}")
|
|
158
158
|
|
|
159
|
-
#
|
|
159
|
+
# Dataset search
|
|
160
160
|
datasets = api.list_datasets(search="coco", limit=10, sort="downloads")
|
|
161
161
|
|
|
162
|
-
# Spaces
|
|
162
|
+
# Spaces search
|
|
163
163
|
spaces = api.list_spaces(search="gradio demo", limit=10, sort="likes")
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
-
#### CLI
|
|
166
|
+
#### CLI Downloads
|
|
167
167
|
```bash
|
|
168
|
-
# Space
|
|
168
|
+
# Download Space source code (for temporary analysis)
|
|
169
169
|
uvx hf download <space_id> --repo-type space --include "*.py" --local-dir /tmp/<name>
|
|
170
170
|
|
|
171
|
-
#
|
|
171
|
+
# Download model files
|
|
172
172
|
uvx hf download <model_id> --include "*.json" --local-dir /tmp/<name>
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
####
|
|
175
|
+
#### Key Search Patterns
|
|
176
176
|
```bash
|
|
177
|
-
#
|
|
177
|
+
# Models for specific tasks
|
|
178
178
|
python -c "from huggingface_hub import HfApi; [print(m.id) for m in HfApi().list_models(search='grounding dino', limit=5)]"
|
|
179
179
|
|
|
180
|
-
# Gradio
|
|
180
|
+
# Find Gradio demos
|
|
181
181
|
python -c "from huggingface_hub import HfApi; [print(s.id) for s in HfApi().list_spaces(search='object detection', sdk='gradio', limit=5)]"
|
|
182
182
|
```
|
|
183
183
|
|
|
184
184
|
---
|
|
185
185
|
|
|
186
|
-
### 3. Reddit
|
|
186
|
+
### 3. Reddit Search (WebSearch)
|
|
187
187
|
|
|
188
188
|
```
|
|
189
189
|
WebSearch: site:reddit.com {query} {year}
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
####
|
|
193
|
-
- r/MachineLearning - ML
|
|
194
|
-
- r/pytorch - PyTorch
|
|
195
|
-
- r/deeplearning -
|
|
196
|
-
- r/LocalLLaMA -
|
|
197
|
-
- r/computervision -
|
|
192
|
+
#### Key Subreddits
|
|
193
|
+
- r/MachineLearning - ML in general
|
|
194
|
+
- r/pytorch - PyTorch related
|
|
195
|
+
- r/deeplearning - Deep learning
|
|
196
|
+
- r/LocalLLaMA - Local LLMs
|
|
197
|
+
- r/computervision - Computer vision
|
|
198
198
|
|
|
199
|
-
####
|
|
199
|
+
#### Search Examples
|
|
200
200
|
```
|
|
201
201
|
site:reddit.com TorchServe deployment 2024
|
|
202
202
|
site:reddit.com r/MachineLearning "best practices" inference
|
|
@@ -204,13 +204,13 @@ site:reddit.com r/MachineLearning "best practices" inference
|
|
|
204
204
|
|
|
205
205
|
---
|
|
206
206
|
|
|
207
|
-
### 4. Stack Overflow
|
|
207
|
+
### 4. Stack Overflow Search (WebSearch)
|
|
208
208
|
|
|
209
209
|
```
|
|
210
210
|
WebSearch: site:stackoverflow.com [tag] {query}
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
####
|
|
213
|
+
#### Search Examples
|
|
214
214
|
```
|
|
215
215
|
site:stackoverflow.com [pytorch] model serving
|
|
216
216
|
site:stackoverflow.com [huggingface-transformers] inference optimization
|
|
@@ -218,27 +218,27 @@ site:stackoverflow.com [huggingface-transformers] inference optimization
|
|
|
218
218
|
|
|
219
219
|
---
|
|
220
220
|
|
|
221
|
-
### 5. Context7 -
|
|
221
|
+
### 5. Context7 - Official Library Documentation (MCP)
|
|
222
222
|
|
|
223
223
|
```
|
|
224
224
|
1. mcp__context7__resolve-library-id
|
|
225
|
-
- libraryName: "pytorch"
|
|
225
|
+
- libraryName: "pytorch" or "torchserve"
|
|
226
226
|
|
|
227
227
|
2. mcp__context7__get-library-docs
|
|
228
228
|
- context7CompatibleLibraryID: "/pytorch/pytorch"
|
|
229
|
-
- topic: "deployment" (
|
|
229
|
+
- topic: "deployment" (optional)
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
####
|
|
232
|
+
#### Key Library IDs
|
|
233
233
|
- `/pytorch/pytorch` - PyTorch
|
|
234
234
|
- `/huggingface/transformers` - Transformers
|
|
235
235
|
- `/gradio-app/gradio` - Gradio
|
|
236
236
|
|
|
237
237
|
---
|
|
238
238
|
|
|
239
|
-
### 6. DeepWiki - GitHub
|
|
239
|
+
### 6. DeepWiki - In-depth GitHub Repo Analysis (MCP)
|
|
240
240
|
|
|
241
|
-
> `/ask-deepwiki`
|
|
241
|
+
> See `/ask-deepwiki` command
|
|
242
242
|
|
|
243
243
|
```
|
|
244
244
|
mcp__deepwiki__read_wiki_structure
|
|
@@ -249,20 +249,20 @@ mcp__deepwiki__ask_question
|
|
|
249
249
|
- question: "How to deploy custom model handler?"
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
####
|
|
252
|
+
#### Useful Repositories
|
|
253
253
|
- `pytorch/serve` - TorchServe
|
|
254
254
|
- `huggingface/transformers` - Transformers
|
|
255
255
|
- `facebookresearch/segment-anything` - SAM
|
|
256
256
|
|
|
257
257
|
---
|
|
258
258
|
|
|
259
|
-
### 7. arXiv
|
|
259
|
+
### 7. arXiv Search (WebSearch)
|
|
260
260
|
|
|
261
261
|
```
|
|
262
262
|
WebSearch: site:arxiv.org {topic} 2024
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
-
####
|
|
265
|
+
#### Search Examples
|
|
266
266
|
```
|
|
267
267
|
site:arxiv.org "image forgery detection" 2024
|
|
268
268
|
site:arxiv.org "vision language model" benchmark 2024
|
|
@@ -270,7 +270,7 @@ site:arxiv.org "vision language model" benchmark 2024
|
|
|
270
270
|
|
|
271
271
|
---
|
|
272
272
|
|
|
273
|
-
### 8.
|
|
273
|
+
### 8. General Web Search (Firecrawl)
|
|
274
274
|
|
|
275
275
|
```
|
|
276
276
|
mcp__firecrawl__firecrawl_search
|
|
@@ -284,76 +284,76 @@ mcp__firecrawl__firecrawl_scrape
|
|
|
284
284
|
|
|
285
285
|
---
|
|
286
286
|
|
|
287
|
-
##
|
|
287
|
+
## Report Template
|
|
288
288
|
|
|
289
289
|
```markdown
|
|
290
|
-
#
|
|
290
|
+
# Research Report: {Topic}
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
**Research Date**: {date}
|
|
293
|
+
**Search Range**: {start_date} ~ {end_date}
|
|
294
294
|
|
|
295
|
-
##
|
|
295
|
+
## Summary
|
|
296
296
|
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
297
|
+
- Key finding 1
|
|
298
|
+
- Key finding 2
|
|
299
|
+
- Key finding 3
|
|
300
300
|
|
|
301
|
-
## 1.
|
|
301
|
+
## 1. Key Findings
|
|
302
302
|
|
|
303
|
-
###
|
|
303
|
+
### Community Insights (Reddit/GitHub/SO)
|
|
304
304
|
|
|
305
|
-
####
|
|
306
|
-
-
|
|
307
|
-
-
|
|
305
|
+
#### Common Issues
|
|
306
|
+
- Issue 1 ([source](URL))
|
|
307
|
+
- Issue 2 ([source](URL))
|
|
308
308
|
|
|
309
|
-
####
|
|
310
|
-
-
|
|
311
|
-
-
|
|
309
|
+
#### Solutions
|
|
310
|
+
- Solution 1 ([source](URL))
|
|
311
|
+
- Solution 2 ([source](URL))
|
|
312
312
|
|
|
313
|
-
###
|
|
313
|
+
### Official Documentation Summary (Context7/DeepWiki)
|
|
314
314
|
|
|
315
|
-
-
|
|
316
|
-
-
|
|
317
|
-
-
|
|
315
|
+
- Best practice 1
|
|
316
|
+
- Best practice 2
|
|
317
|
+
- Caveats
|
|
318
318
|
|
|
319
|
-
### GitHub
|
|
319
|
+
### GitHub Projects
|
|
320
320
|
|
|
321
|
-
|
|
|
322
|
-
|
|
323
|
-
| [owner/repo](URL) | 1.2k |
|
|
321
|
+
| Project | Stars | Description |
|
|
322
|
+
|---------|-------|-------------|
|
|
323
|
+
| [owner/repo](URL) | 1.2k | Description |
|
|
324
324
|
|
|
325
|
-
### Hugging Face
|
|
325
|
+
### Hugging Face Resources
|
|
326
326
|
|
|
327
|
-
|
|
|
328
|
-
|
|
327
|
+
| Resource | Type | Downloads/Likes |
|
|
328
|
+
|----------|------|-----------------|
|
|
329
329
|
| [model-id](URL) | Model | 10k |
|
|
330
330
|
|
|
331
|
-
## 2.
|
|
331
|
+
## 2. Recommendations
|
|
332
332
|
|
|
333
|
-
1.
|
|
334
|
-
2.
|
|
335
|
-
3.
|
|
333
|
+
1. Recommendation 1
|
|
334
|
+
2. Recommendation 2
|
|
335
|
+
3. Recommendation 3
|
|
336
336
|
|
|
337
|
-
##
|
|
337
|
+
## Sources
|
|
338
338
|
|
|
339
|
-
1. [
|
|
340
|
-
2. [
|
|
339
|
+
1. [Title](URL) - Platform, Date
|
|
340
|
+
2. [Title](URL) - Platform, Date
|
|
341
341
|
```
|
|
342
342
|
|
|
343
|
-
|
|
343
|
+
**Save as**: `research-report-{topic-slug}.md` (English, single file)
|
|
344
344
|
|
|
345
345
|
---
|
|
346
346
|
|
|
347
|
-
##
|
|
347
|
+
## Quality Standards
|
|
348
348
|
|
|
349
|
-
1.
|
|
350
|
-
2.
|
|
351
|
-
3.
|
|
352
|
-
4.
|
|
353
|
-
5.
|
|
349
|
+
1. **Recency**: Prioritize content from the last 1-2 years
|
|
350
|
+
2. **Reliability**: Official docs > GitHub issues > Stack Overflow > Reddit
|
|
351
|
+
3. **Specificity**: Include code examples and concrete solutions
|
|
352
|
+
4. **Attribution**: Include links and dates for all information
|
|
353
|
+
5. **Actionability**: Clear and actionable recommendations
|
|
354
354
|
|
|
355
|
-
##
|
|
355
|
+
## File Management
|
|
356
356
|
|
|
357
|
-
-
|
|
358
|
-
-
|
|
359
|
-
-
|
|
357
|
+
- Keep intermediate data in memory only
|
|
358
|
+
- **Final deliverable**: Single `research-report-{topic-slug}.md` file only
|
|
359
|
+
- Do not create temporary files or intermediate drafts
|
|
@@ -51,26 +51,31 @@ Perform branch cleanup and CLAUDE.md updates after a PR has been merged. Follow
|
|
|
51
51
|
- Run `gh project item-edit` to set Status to "Done"
|
|
52
52
|
- Skip if issue is not in project or Status field does not exist
|
|
53
53
|
|
|
54
|
-
6. **Analyze and Update
|
|
55
|
-
- Check
|
|
56
|
-
-
|
|
57
|
-
|
|
54
|
+
6. **Analyze and Update Configuration Files**
|
|
55
|
+
- Check which configuration files exist:
|
|
56
|
+
- `CLAUDE.md` - Claude Code specific instructions
|
|
57
|
+
- `AGENTS.md` - Cross-tool AI coding agent instructions (Codex, Cursor, Gemini, etc.)
|
|
58
|
+
- `GEMINI.md` - Google Gemini CLI specific instructions
|
|
59
|
+
- For each existing file, analyze:
|
|
58
60
|
- Find temporary instructions related to resolved issue (e.g., mentions of `#<issue_number>`, `issue-<number>`)
|
|
59
61
|
- Identify outdated or inaccurate information
|
|
60
62
|
- Identify redundant or unnecessary content
|
|
61
|
-
- Prepare update proposal:
|
|
63
|
+
- Prepare update proposal for each file:
|
|
62
64
|
- **To remove**: Temporary notes/instructions related to resolved issue
|
|
63
65
|
- **To add**: New patterns/conventions discovered during issue resolution
|
|
64
66
|
- **To modify**: Outdated or inaccurate information
|
|
65
67
|
- Present proposal to user for confirmation before applying
|
|
66
68
|
|
|
67
69
|
7. **Commit Changes (Optional)**
|
|
68
|
-
- If
|
|
70
|
+
- If any configuration files were modified, prompt user to confirm commit
|
|
69
71
|
- If confirmed: Commit using Conventional Commits format
|
|
72
|
+
- Example: `git add CLAUDE.md AGENTS.md GEMINI.md 2>/dev/null || true`
|
|
70
73
|
|
|
71
74
|
> See [Work Guidelines](../guidelines/work-guidelines.md)
|
|
72
75
|
|
|
73
|
-
##
|
|
76
|
+
## Configuration File Update Guide
|
|
77
|
+
|
|
78
|
+
The following guidelines apply to CLAUDE.md, AGENTS.md, and GEMINI.md:
|
|
74
79
|
|
|
75
80
|
### Examples of Content to Remove
|
|
76
81
|
- Temporary notes like `TODO: remove after #123 is resolved`
|
|
@@ -10,10 +10,20 @@ Act as an expert developer who systematically analyzes and resolves GitHub issue
|
|
|
10
10
|
- If milestone exists, run `gh issue list --milestone "<milestone-name>" --json number,title,state` to view related issues and understand overall context
|
|
11
11
|
- Identify requirements precisely
|
|
12
12
|
|
|
13
|
-
2. **
|
|
13
|
+
2. **Verify Plan File Alignment (If Exists)**:
|
|
14
|
+
- Check if issue body or milestone description contains a plan file path
|
|
15
|
+
- Common patterns: `Plan: /path/to/plan.md`, `See: .claude/plans/xxx.md`
|
|
16
|
+
- If plan file exists:
|
|
17
|
+
1. Read the plan file content
|
|
18
|
+
2. Compare plan objectives with issue requirements
|
|
19
|
+
3. Verify scope alignment (plan covers issue, no scope creep)
|
|
20
|
+
4. If misaligned, ask user for clarification before proceeding
|
|
21
|
+
- If no plan file, continue to next step
|
|
22
|
+
|
|
23
|
+
3. **Create Branch**: Create and checkout a new branch named `issue-$ISSUE_NUMBER` from `main` or `master` branch.
|
|
14
24
|
- **Initialize submodules**: When using worktree, run `git submodule update --init --recursive`
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
4. **Update GitHub Project Status (Optional)**
|
|
17
27
|
- Run `gh project list --owner <owner> --format json` to check for projects
|
|
18
28
|
- If no projects exist, skip silently
|
|
19
29
|
- If projects exist:
|
|
@@ -26,20 +36,20 @@ Act as an expert developer who systematically analyzes and resolves GitHub issue
|
|
|
26
36
|
```
|
|
27
37
|
- Skip if Status field does not exist
|
|
28
38
|
|
|
29
|
-
|
|
39
|
+
5. **Analyze Codebase**: Use sub-agents to analyze the codebase in parallel, identifying relevant files and structure needed to resolve the issue.
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
6. **Plan Resolution**: Based on analysis results, develop a concrete resolution plan and define work steps.
|
|
32
42
|
|
|
33
|
-
|
|
43
|
+
7. **Resolve Issue**: Spawn sub-agents to modify code and implement features according to the plan.
|
|
34
44
|
- **Execution verification required**: For Python scripts, executables, or any runnable code, always execute to verify correct behavior. Do not rely solely on file existence or previous results.
|
|
35
45
|
|
|
36
|
-
|
|
46
|
+
8. **Write Tests**: Spawn independent sub-agents per file to write unit tests in parallel, achieving at least 80% coverage.
|
|
37
47
|
|
|
38
|
-
|
|
48
|
+
9. **Validate**: Run tests, lint checks, and build verification in parallel using independent sub-agents to validate code quality.
|
|
39
49
|
|
|
40
|
-
|
|
50
|
+
10. **Create PR**: Create a pull request for the resolved issue.
|
|
41
51
|
|
|
42
|
-
|
|
52
|
+
11. **Update Issue Checkboxes**: Mark completed checkbox items in the issue as done.
|
|
43
53
|
|
|
44
54
|
> See [Work Guidelines](../guidelines/work-guidelines.md)
|
|
45
55
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Convert a draft file to TaskMaster PRD format.
|
|
4
4
|
|
|
5
|
-
**Template:** Copy `.claude/
|
|
5
|
+
**Template:** Copy `.claude/guidelines/prd-guide.md` to create draft
|
|
6
6
|
|
|
7
7
|
**Principles:**
|
|
8
8
|
- Preserve original content (do not add or remove arbitrarily)
|
|
@@ -119,25 +119,31 @@ task-master next
|
|
|
119
119
|
# Dependencies satisfied: Task 1 (done)
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
### 8. Analyze and Update
|
|
122
|
+
### 8. Analyze and Update Configuration Files
|
|
123
123
|
|
|
124
|
-
**
|
|
124
|
+
**Target files (check if exist):**
|
|
125
|
+
- `CLAUDE.md` - Claude Code specific instructions
|
|
126
|
+
- `AGENTS.md` - Cross-tool AI coding agent instructions (Codex, Cursor, Gemini, etc.)
|
|
127
|
+
- `GEMINI.md` - Google Gemini CLI specific instructions
|
|
128
|
+
|
|
129
|
+
**For each existing file, analyze:**
|
|
125
130
|
- Temporary instructions related to resolved Issue/Task (mentions of `#1`, `task 1`)
|
|
126
131
|
- Outdated or inaccurate information
|
|
127
132
|
- Newly discovered patterns/conventions
|
|
128
133
|
|
|
129
|
-
**Draft update proposal and confirm with user:**
|
|
134
|
+
**Draft update proposal and confirm with user for each file:**
|
|
130
135
|
- Delete: Temporary notes related to resolved issues
|
|
131
136
|
- Add: New patterns discovered during work
|
|
132
137
|
- Modify: Changed information
|
|
133
138
|
|
|
134
139
|
### 9. Commit Changes (Optional)
|
|
135
140
|
|
|
136
|
-
If
|
|
141
|
+
If any configuration files were modified, ask via AskUserQuestion about committing:
|
|
137
142
|
|
|
138
143
|
```bash
|
|
139
|
-
|
|
140
|
-
git
|
|
144
|
+
# Add all modified config files
|
|
145
|
+
git add CLAUDE.md AGENTS.md GEMINI.md 2>/dev/null || true
|
|
146
|
+
git commit -m "docs: update config files (reflecting task $TASK_ID completion)"
|
|
141
147
|
git push origin main
|
|
142
148
|
```
|
|
143
149
|
|
|
@@ -162,6 +168,8 @@ Cleanup:
|
|
|
162
168
|
- [x] Local branch deleted: issue-<N>
|
|
163
169
|
- [x] TaskMaster status updated
|
|
164
170
|
- [ ] CLAUDE.md updated (no changes)
|
|
171
|
+
- [ ] AGENTS.md updated (no changes / not found)
|
|
172
|
+
- [ ] GEMINI.md updated (no changes / not found)
|
|
165
173
|
|
|
166
174
|
Next Steps:
|
|
167
175
|
- task-master next -> Task <M>
|
|
@@ -85,6 +85,27 @@ task-master show $TASK_ID
|
|
|
85
85
|
- [ ] Task status is `pending` or `in-progress`
|
|
86
86
|
- [ ] All dependency tasks are complete (check dependencies via `task-master show`)
|
|
87
87
|
|
|
88
|
+
### 2.5. Verify Plan File Alignment (If Exists)
|
|
89
|
+
|
|
90
|
+
Check if Issue body or Milestone description references a plan file:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Extract plan file path from issue body
|
|
94
|
+
gh issue view $ISSUE_NUMBER --json body --jq '.body' | grep -oP '(?:Plan|plan|See|see)[:\s]+[`"]?([^\s`"]+\.md)'
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**If plan file found:**
|
|
98
|
+
1. Read the plan file and understand the implementation approach
|
|
99
|
+
2. Verify alignment:
|
|
100
|
+
- [ ] Plan objectives match Issue requirements
|
|
101
|
+
- [ ] Plan scope covers all Issue checkboxes
|
|
102
|
+
- [ ] No conflicting approaches between plan and issue
|
|
103
|
+
3. If misaligned:
|
|
104
|
+
- Use AskUserQuestion to clarify which to follow
|
|
105
|
+
- Options: "Follow plan", "Follow issue", "Abort for revision"
|
|
106
|
+
|
|
107
|
+
**If no plan file, continue to Step 3.**
|
|
108
|
+
|
|
88
109
|
### 3. Expand Subtasks (If Needed)
|
|
89
110
|
|
|
90
111
|
```bash
|
|
@@ -1,17 +1,160 @@
|
|
|
1
1
|
# Work Guidelines
|
|
2
2
|
|
|
3
|
-
Common guidelines for all Claude Code commands.
|
|
3
|
+
Common guidelines for all Claude Code commands and development workflow.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
+
## Core Principles
|
|
8
|
+
|
|
9
|
+
### Response Rules
|
|
7
10
|
- Follow the instructions in `@CLAUDE.md`
|
|
11
|
+
- Answer in the same language as user's request
|
|
12
|
+
- Append sources that you've referenced at the very end of your answer
|
|
8
13
|
- Do not use emoji in code or documentation
|
|
9
|
-
- If anything is unclear, use the `AskUserQuestion` tool instead of guessing
|
|
10
14
|
- Never add Claude attribution (e.g., "Generated with Claude", "Co-Authored-By: Claude") to commits, PRs, or issues
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
### Uncertainty Handling
|
|
17
|
+
- If you are uncertain, confused, or lack clarity about the requirements or approach, **STOP immediately** and ask the user for clarification
|
|
18
|
+
- Do not proceed with assumptions or guesses that could lead to incorrect implementations
|
|
19
|
+
- If any instruction/requirement is unclear, ambiguous, or potentially incorrect, use the `AskUserQuestion` tool (do not ask inline in the response text)
|
|
13
20
|
|
|
21
|
+
### User Confirmation Required
|
|
14
22
|
Always confirm with the user before:
|
|
15
23
|
- Irreversible operations (branch deletion, status changes)
|
|
16
|
-
- Modifying CLAUDE.md
|
|
24
|
+
- Modifying configuration files (CLAUDE.md, AGENTS.md, GEMINI.md)
|
|
17
25
|
- Making architectural decisions
|
|
26
|
+
- Implementing features beyond requested scope
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Development Workflow
|
|
31
|
+
|
|
32
|
+
### Parallel Execution
|
|
33
|
+
Use Task tool for independent tasks. For large projects, split into sub-tasks that:
|
|
34
|
+
- Avoid consuming entire context window (maximizes token efficiency)
|
|
35
|
+
- Produce separate files or distinct code sections (mergeable outputs)
|
|
36
|
+
- Have no cross-dependencies (can run without coordination)
|
|
37
|
+
- Example: Separate handlers, independent tests, different modules
|
|
38
|
+
|
|
39
|
+
### Dependency Version Policy (Stable First)
|
|
40
|
+
- Prefer widely adopted stable releases over the newest/bleeding-edge versions
|
|
41
|
+
- Avoid `alpha`/`beta`/`rc`/canary/nightly releases
|
|
42
|
+
- Respect existing project pins
|
|
43
|
+
- If a newer version is required (security fix, critical bugfix, or mandatory feature), propose the upgrade with rationale and risks before changing
|
|
44
|
+
|
|
45
|
+
### Performance/Optimization Gate
|
|
46
|
+
- If you identify a clearly faster or more reliable library/framework/approach with meaningful benefit, **PAUSE** implementation and recommend it with trade-offs
|
|
47
|
+
- Proceed only after user approval
|
|
48
|
+
|
|
49
|
+
### Permission-Based Development
|
|
50
|
+
- Never overengineer or go beyond the requested scope
|
|
51
|
+
- Always ask user for permission when implementing new features
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Code Standards
|
|
56
|
+
|
|
57
|
+
### MCP Server Usage
|
|
58
|
+
Utilize MCP servers whenever possible:
|
|
59
|
+
- `context7` - Library documentation queries
|
|
60
|
+
- `deepwiki` - GitHub repository analysis
|
|
61
|
+
- `mcpdocs` - Documentation fetching
|
|
62
|
+
- `firecrawl` - Web scraping and search
|
|
63
|
+
|
|
64
|
+
### Serena MCP (Symbolic Code Analysis)
|
|
65
|
+
|
|
66
|
+
Serena provides LSP-based semantic code analysis. Use it for precise code navigation and modification.
|
|
67
|
+
|
|
68
|
+
**When to Use:**
|
|
69
|
+
- Understanding codebase structure → `get_symbols_overview`
|
|
70
|
+
- Finding specific symbols → `find_symbol`
|
|
71
|
+
- Tracing references → `find_referencing_symbols`
|
|
72
|
+
- Precise code modifications → `replace_symbol_body`, `insert_after_symbol`
|
|
73
|
+
|
|
74
|
+
**Key Tools:**
|
|
75
|
+
|
|
76
|
+
| Tool | Use Case |
|
|
77
|
+
|------|----------|
|
|
78
|
+
| `get_symbols_overview` | First step: understand file structure |
|
|
79
|
+
| `find_symbol` | Search by name pattern (supports substring matching) |
|
|
80
|
+
| `find_referencing_symbols` | Find all usages of a symbol |
|
|
81
|
+
| `replace_symbol_body` | Replace entire function/class/method |
|
|
82
|
+
| `insert_after_symbol` / `insert_before_symbol` | Add new code at precise locations |
|
|
83
|
+
| `search_for_pattern` | Flexible regex search across codebase |
|
|
84
|
+
|
|
85
|
+
**Best Practices:**
|
|
86
|
+
1. Start with `get_symbols_overview` for new files
|
|
87
|
+
2. Use `find_symbol` with `depth=1` to see class methods before diving deeper
|
|
88
|
+
3. Prefer symbolic editing over file-based editing when modifying functions/classes
|
|
89
|
+
4. Always check `find_referencing_symbols` before renaming/removing symbols
|
|
90
|
+
|
|
91
|
+
### Python Development
|
|
92
|
+
- **Virtual Environment (MANDATORY)**: Always use virtual environment (uv) when running Python
|
|
93
|
+
- **NEVER** use system Python (`python`, `python3`) directly
|
|
94
|
+
- If `ModuleNotFoundError` occurs when attempting to run without virtual environment, immediately stop and report to user
|
|
95
|
+
- **Syntax Validation**: After modifying Python (.py) files, always validate syntax using `py_compile`:
|
|
96
|
+
```bash
|
|
97
|
+
python -m py_compile file.py
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Pip Installation Issues
|
|
101
|
+
If pip install errors occur, try in order:
|
|
102
|
+
1. `pip install --upgrade pip setuptools wheel`
|
|
103
|
+
2. `pip cache purge && pip install -r requirements.txt`
|
|
104
|
+
3. `pip install --no-cache-dir -r requirements.txt` (install packages one by one)
|
|
105
|
+
|
|
106
|
+
### Jupyter Notebook Editing
|
|
107
|
+
- **ALWAYS** use the `edit_notebook` tool exclusively for editing .ipynb files
|
|
108
|
+
- **NEVER** use `search_replace`, `write`, or any other text editing tools on .ipynb files
|
|
109
|
+
- After modifying .ipynb files, verify:
|
|
110
|
+
- JSON syntax validity
|
|
111
|
+
- Original cell execution order/outputs preserved (unless explicitly instructed to clear)
|
|
112
|
+
- Changes are correct, no missing functions/imports/dependencies
|
|
113
|
+
|
|
114
|
+
### Output Standards
|
|
115
|
+
- **Minimal Output**: Avoid unnecessary print statements in code - only include meaningful debug output when explicitly requested
|
|
116
|
+
- **No Emojis**: Never use emojis anywhere, whether in documentation or code
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## File Organization
|
|
121
|
+
|
|
122
|
+
### Avoid Root Clutter
|
|
123
|
+
- **NEVER** create output files in project root:
|
|
124
|
+
- Analysis notebooks
|
|
125
|
+
- Visualizations
|
|
126
|
+
- CSV data
|
|
127
|
+
- Logs
|
|
128
|
+
- Temporary files
|
|
129
|
+
- Only essential project configuration files belong in root (e.g., `README.md`, `requirements.txt`, config files)
|
|
130
|
+
|
|
131
|
+
### Module-Level Organization
|
|
132
|
+
Each module should maintain its own organized structure:
|
|
133
|
+
```
|
|
134
|
+
[module]/
|
|
135
|
+
analysis/ # Analysis files
|
|
136
|
+
outputs/ # Generated outputs
|
|
137
|
+
tests/ # Test files
|
|
138
|
+
...
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Temporary Files
|
|
142
|
+
- Create and use a dedicated temporary directory
|
|
143
|
+
- Never commit temporary files to git
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Translation Guidelines
|
|
148
|
+
|
|
149
|
+
When translating into Korean:
|
|
150
|
+
- Keep technical terms, code blocks, and commands in their original form
|
|
151
|
+
- Translate the surrounding text into natural, context-appropriate Korean
|
|
152
|
+
- After completing the translation, review it to ensure it meets these criteria
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Related Guidelines
|
|
157
|
+
|
|
158
|
+
- [ID Reference](./id-reference.md) - GitHub/TaskMaster ID conventions
|
|
159
|
+
- [CV Guidelines](./cv-guidelines.md) - Computer vision specific guidelines
|
|
160
|
+
- [PRD Guide](./prd-guide.md) - PRD template for TaskMaster
|
package/README.md
CHANGED
|
@@ -28,7 +28,9 @@ A collection of custom slash commands, agents, and skills for Claude Code CLI.
|
|
|
28
28
|
│ └── sync-to-github.md # Sync TaskMaster -> GitHub
|
|
29
29
|
├── guidelines/ # Shared guidelines
|
|
30
30
|
│ ├── work-guidelines.md # Common work guidelines
|
|
31
|
-
│
|
|
31
|
+
│ ├── id-reference.md # GitHub/TaskMaster ID reference
|
|
32
|
+
│ ├── cv-guidelines.md # Computer vision guidelines
|
|
33
|
+
│ └── prd-guide.md # PRD template for TaskMaster
|
|
32
34
|
├── agents/ # Custom agents
|
|
33
35
|
│ ├── web-researcher.md # Multi-platform web research
|
|
34
36
|
│ └── python-pro.md # Python expert
|
|
@@ -71,7 +73,7 @@ A collection of custom slash commands, agents, and skills for Claude Code CLI.
|
|
|
71
73
|
| `/gh/create-issue-label` | Analyze project and create appropriate GitHub issue labels |
|
|
72
74
|
| `/gh/decompose-issue` | Decompose large work into manageable independent issues |
|
|
73
75
|
| `/gh/init-project` | Initialize and configure GitHub Project board |
|
|
74
|
-
| `/gh/post-merge` | Clean up branch and update CLAUDE.md after PR merge |
|
|
76
|
+
| `/gh/post-merge` | Clean up branch and update config files (CLAUDE.md, AGENTS.md, GEMINI.md) after PR merge |
|
|
75
77
|
| `/gh/resolve-issue` | Systematically analyze and resolve GitHub issues |
|
|
76
78
|
|
|
77
79
|
### TaskMaster Integration Commands (`/tm/`)
|
|
@@ -81,7 +83,7 @@ A collection of custom slash commands, agents, and skills for Claude Code CLI.
|
|
|
81
83
|
| `/tm/convert-prd` | Convert PRD draft to TaskMaster PRD format |
|
|
82
84
|
| `/tm/sync-to-github` | Sync TaskMaster tasks.json to GitHub Issues/Milestones |
|
|
83
85
|
| `/tm/resolve-issue` | Resolve GitHub Issues by TaskMaster subtask units |
|
|
84
|
-
| `/tm/post-merge` | TaskMaster status update and branch cleanup after PR merge |
|
|
86
|
+
| `/tm/post-merge` | TaskMaster status update, config file updates, and branch cleanup after PR merge |
|
|
85
87
|
|
|
86
88
|
## Agents
|
|
87
89
|
|
|
@@ -163,6 +165,18 @@ Options:
|
|
|
163
165
|
-v, --version Show version
|
|
164
166
|
```
|
|
165
167
|
|
|
168
|
+
### Installation Modes
|
|
169
|
+
|
|
170
|
+
When existing folders are detected, you'll be prompted to choose:
|
|
171
|
+
|
|
172
|
+
| Mode | Behavior |
|
|
173
|
+
|------|----------|
|
|
174
|
+
| **update** (default) | Overwrite existing files, add new files, keep custom files |
|
|
175
|
+
| **merge** | Add new files only, skip existing files |
|
|
176
|
+
|
|
177
|
+
- **update**: Recommended when upgrading to a new version
|
|
178
|
+
- **merge**: Safe when you have heavily customized files you don't want changed
|
|
179
|
+
|
|
166
180
|
## MCP Server Configuration
|
|
167
181
|
|
|
168
182
|
The package includes `.mcp.json` that can be copied to your project root.
|
package/bin/cli.js
CHANGED
|
@@ -64,8 +64,8 @@ const dest = isGlobal
|
|
|
64
64
|
function askQuestion(question) {
|
|
65
65
|
// Detect non-interactive environment (CI/CD, pipelines, etc.)
|
|
66
66
|
if (!process.stdin.isTTY) {
|
|
67
|
-
console.log('Non-interactive environment detected. Using default (
|
|
68
|
-
return Promise.resolve('
|
|
67
|
+
console.log('Non-interactive environment detected. Using default (update).');
|
|
68
|
+
return Promise.resolve('update');
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
const rl = readline.createInterface({
|
|
@@ -100,9 +100,9 @@ function checkExistingFolders() {
|
|
|
100
100
|
* Copy folder recursively
|
|
101
101
|
* @param {string} src - Source path
|
|
102
102
|
* @param {string} dst - Destination path
|
|
103
|
-
* @param {
|
|
103
|
+
* @param {string} mode - Installation mode: 'merge' | 'update'
|
|
104
104
|
*/
|
|
105
|
-
function copyFolder(src, dst,
|
|
105
|
+
function copyFolder(src, dst, mode = 'merge') {
|
|
106
106
|
if (!fs.existsSync(src)) {
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
@@ -123,12 +123,14 @@ function copyFolder(src, dst, mergeMode = false) {
|
|
|
123
123
|
const dstPath = path.join(dst, entry.name);
|
|
124
124
|
|
|
125
125
|
if (entry.isDirectory()) {
|
|
126
|
-
copyFolder(srcPath, dstPath,
|
|
126
|
+
copyFolder(srcPath, dstPath, mode);
|
|
127
127
|
} else {
|
|
128
|
-
// In merge mode, keep existing files
|
|
129
|
-
if (
|
|
128
|
+
// In merge mode, keep existing files (skip if exists)
|
|
129
|
+
if (mode === 'merge' && fs.existsSync(dstPath)) {
|
|
130
130
|
continue;
|
|
131
131
|
}
|
|
132
|
+
// In update mode, overwrite existing files + add new files
|
|
133
|
+
// Custom files (only in dest) are preserved since we don't delete them
|
|
132
134
|
try {
|
|
133
135
|
fs.copyFileSync(srcPath, dstPath);
|
|
134
136
|
} catch (err) {
|
|
@@ -140,11 +142,9 @@ function copyFolder(src, dst, mergeMode = false) {
|
|
|
140
142
|
|
|
141
143
|
/**
|
|
142
144
|
* Selectively copy installation target folders
|
|
143
|
-
* @param {string} mode - 'merge' | '
|
|
145
|
+
* @param {string} mode - 'merge' | 'update'
|
|
144
146
|
*/
|
|
145
147
|
function installFolders(mode) {
|
|
146
|
-
const mergeMode = mode === 'merge';
|
|
147
|
-
|
|
148
148
|
for (const folder of INSTALL_FOLDERS) {
|
|
149
149
|
const srcFolder = path.join(source, folder);
|
|
150
150
|
const dstFolder = path.join(dest, folder);
|
|
@@ -153,16 +153,10 @@ function installFolders(mode) {
|
|
|
153
153
|
continue;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
//
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
} catch (err) {
|
|
161
|
-
throw new Error(`Failed to delete folder: ${dstFolder} - ${err.message}`);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
copyFolder(srcFolder, dstFolder, mergeMode);
|
|
156
|
+
// Both modes now preserve custom files
|
|
157
|
+
// - merge: skip existing files, add new files only
|
|
158
|
+
// - update: overwrite existing files, add new files, keep custom files
|
|
159
|
+
copyFolder(srcFolder, dstFolder, mode);
|
|
166
160
|
}
|
|
167
161
|
}
|
|
168
162
|
|
|
@@ -203,7 +197,7 @@ async function main() {
|
|
|
203
197
|
|
|
204
198
|
// Check existing installation folders
|
|
205
199
|
const existingFolders = checkExistingFolders();
|
|
206
|
-
let installMode = '
|
|
200
|
+
let installMode = 'update';
|
|
207
201
|
|
|
208
202
|
if (existingFolders.length > 0) {
|
|
209
203
|
console.log('Existing installation folders found:');
|
|
@@ -218,25 +212,25 @@ async function main() {
|
|
|
218
212
|
}
|
|
219
213
|
|
|
220
214
|
console.log('Installation options:');
|
|
221
|
-
console.log(' [
|
|
222
|
-
console.log(' [
|
|
223
|
-
console.log(' [c] cancel
|
|
215
|
+
console.log(' [u] update - Update existing files, keep custom files (Recommended)');
|
|
216
|
+
console.log(' [m] merge - Add new files only, skip existing');
|
|
217
|
+
console.log(' [c] cancel - Cancel installation');
|
|
224
218
|
console.log('');
|
|
225
219
|
|
|
226
|
-
const answer = await askQuestion('Choose (m/
|
|
220
|
+
const answer = await askQuestion('Choose (u/m/c) [default: u]: ');
|
|
227
221
|
|
|
228
222
|
if (answer === 'c' || answer === 'cancel') {
|
|
229
223
|
console.log('Installation cancelled.');
|
|
230
224
|
process.exit(0);
|
|
231
|
-
} else if (answer === '
|
|
232
|
-
installMode = 'overwrite';
|
|
233
|
-
console.log('');
|
|
234
|
-
console.log('Installing in overwrite mode...');
|
|
235
|
-
} else {
|
|
236
|
-
// Default: merge (empty, 'm', 'merge', etc.)
|
|
225
|
+
} else if (answer === 'm' || answer === 'merge') {
|
|
237
226
|
installMode = 'merge';
|
|
238
227
|
console.log('');
|
|
239
228
|
console.log('Installing in merge mode (keeping existing files)...');
|
|
229
|
+
} else {
|
|
230
|
+
// Default: update (empty, 'u', 'update', etc.)
|
|
231
|
+
installMode = 'update';
|
|
232
|
+
console.log('');
|
|
233
|
+
console.log('Installing in update mode (updating existing files, keeping custom files)...');
|
|
240
234
|
}
|
|
241
235
|
}
|
|
242
236
|
|
package/package.json
CHANGED
|
File without changes
|