@dzhechkov/p-replicator 1.0.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.
- package/README.md +314 -0
- package/bin/cli.js +4 -0
- package/package.json +62 -0
- package/src/cli.js +160 -0
- package/src/commands/doctor.js +151 -0
- package/src/commands/init.js +155 -0
- package/src/commands/list.js +133 -0
- package/src/commands/remove.js +111 -0
- package/src/commands/update.js +102 -0
- package/src/utils.js +280 -0
- package/templates/.claude/agents/doc-validator.md +92 -0
- package/templates/.claude/agents/harvest-coordinator.md +91 -0
- package/templates/.claude/agents/product-discoverer.md +57 -0
- package/templates/.claude/agents/replicate-coordinator.md +98 -0
- package/templates/.claude/commands/harvest.md +106 -0
- package/templates/.claude/commands/replicate.md +389 -0
- package/templates/.claude/rules/replicate-pipeline.md +92 -0
- package/templates/.claude/skills/brutal-honesty-review/README.md +218 -0
- package/templates/.claude/skills/brutal-honesty-review/SKILL.md +225 -0
- package/templates/.claude/skills/brutal-honesty-review/resources/assessment-rubrics.md +295 -0
- package/templates/.claude/skills/brutal-honesty-review/resources/review-template.md +102 -0
- package/templates/.claude/skills/brutal-honesty-review/scripts/assess-code.sh +179 -0
- package/templates/.claude/skills/brutal-honesty-review/scripts/assess-tests.sh +223 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/SKILL.md +374 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/claude-md-strategy.md +178 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/enhanced-recommendations.md +416 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/extended-mapping.md +370 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/automation-commands.md +733 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-agents.md +416 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-hooks-commands.md +524 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/ddd-skills.md +350 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/enhanced-claude-md.md +235 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle-ent.md +400 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-lifecycle.md +325 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/feature-suggestions.md +423 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/insights-system.md +349 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/mcp.md +274 -0
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/references/templates/start-command.md +283 -0
- package/templates/.claude/skills/explore/SKILL.md +215 -0
- package/templates/.claude/skills/explore/references/questioning-techniques.md +151 -0
- package/templates/.claude/skills/explore/references/task-brief-templates.md +355 -0
- package/templates/.claude/skills/goap-research-ed25519/SKILL.md +415 -0
- package/templates/.claude/skills/goap-research-ed25519/references/ed25519-verification.md +658 -0
- package/templates/.claude/skills/goap-research-ed25519/references/research-actions.md +544 -0
- package/templates/.claude/skills/goap-research-ed25519/references/source-evaluation.md +560 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +662 -0
- package/templates/.claude/skills/goap-research-ed25519/scripts/goap_planner.py +720 -0
- package/templates/.claude/skills/knowledge-extractor/SKILL.md +412 -0
- package/templates/.claude/skills/knowledge-extractor/examples/rate-limiting-extraction.md +259 -0
- package/templates/.claude/skills/knowledge-extractor/modules/01-agent-review.md +192 -0
- package/templates/.claude/skills/knowledge-extractor/modules/02-classify.md +122 -0
- package/templates/.claude/skills/knowledge-extractor/modules/03-decontextualize.md +156 -0
- package/templates/.claude/skills/knowledge-extractor/modules/04-integrate.md +178 -0
- package/templates/.claude/skills/knowledge-extractor/references/artifact-categories.md +342 -0
- package/templates/.claude/skills/knowledge-extractor/references/decontextualization-guide.md +247 -0
- package/templates/.claude/skills/knowledge-extractor/references/maturity-model.md +153 -0
- package/templates/.claude/skills/knowledge-extractor/templates/artifact-card.md +60 -0
- package/templates/.claude/skills/knowledge-extractor/templates/harvest-report.md +70 -0
- package/templates/.claude/skills/knowledge-extractor/templates/toolkit-harvest.md +38 -0
- package/templates/.claude/skills/pipeline-forge/SKILL.md +523 -0
- package/templates/.claude/skills/pipeline-forge/examples/replicate-analysis.md +291 -0
- package/templates/.claude/skills/pipeline-forge/references/patterns-catalog.md +408 -0
- package/templates/.claude/skills/pipeline-forge/references/quality-gates.md +268 -0
- package/templates/.claude/skills/pipeline-forge/references/skill-anatomy.md +292 -0
- package/templates/.claude/skills/pipeline-forge/templates/agent-template.md +60 -0
- package/templates/.claude/skills/pipeline-forge/templates/command-template.md +80 -0
- package/templates/.claude/skills/pipeline-forge/templates/pipeline-template.md +137 -0
- package/templates/.claude/skills/pipeline-forge/templates/skill-template.md +132 -0
- package/templates/.claude/skills/problem-solver-enhanced/SKILL.md +562 -0
- package/templates/.claude/skills/requirements-validator/SKILL.md +121 -0
- package/templates/.claude/skills/requirements-validator/assets/templates/bdd-feature-template.feature +69 -0
- package/templates/.claude/skills/requirements-validator/references/bdd-patterns.md +184 -0
- package/templates/.claude/skills/requirements-validator/references/invest-criteria.md +121 -0
- package/templates/.claude/skills/requirements-validator/references/scoring-system.md +134 -0
- package/templates/.claude/skills/requirements-validator/references/smart-criteria.md +130 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/SKILL.md +194 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/examples/noom-cjm-example.md +100 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/examples/noom-module1-example.md +88 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/01-intelligence.md +328 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/02-product-customers.md +221 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/025-cjm-prototype.md +206 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/03-market-competition.md +402 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/04-business-finance.md +287 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/05-growth-engine.md +290 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/06-playbook-synthesis.md +286 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/references/blue-ocean-canvas.md +39 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/references/industry-benchmarks.md +67 -0
- package/templates/.claude/skills/reverse-engineering-unicorn/references/jtbd-canvas.md +48 -0
- package/templates/.claude/skills/sparc-prd-mini/SKILL.md +955 -0
- package/templates/.claude/skills/sparc-prd-mini/references/sparc-methodology.md +360 -0
- package/templates/.claude/skills/sparc-prd-mini/templates/CLAUDE.md +91 -0
- package/templates/.claude/skills/sparc-prd-mini/templates/prd.md +336 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
# Insights System Templates
|
|
2
|
+
|
|
3
|
+
Templates for generating the insights knowledge base system.
|
|
4
|
+
Architecture: **index file + individual detail files** (like llms.txt pattern).
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Command Template: `/myinsights`
|
|
9
|
+
|
|
10
|
+
Generate as `.claude/commands/myinsights.md`:
|
|
11
|
+
|
|
12
|
+
````markdown
|
|
13
|
+
---
|
|
14
|
+
description: Capture a development insight or manage existing insights.
|
|
15
|
+
Creates structured entry in myinsights/ folder with auto-indexing.
|
|
16
|
+
$ARGUMENTS: brief title OR subcommand (archive INS-NNN, status INS-NNN [active|workaround|obsolete])
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# /myinsights $ARGUMENTS
|
|
20
|
+
|
|
21
|
+
## What You Do
|
|
22
|
+
|
|
23
|
+
Manage the project's living knowledge base in `myinsights/` folder.
|
|
24
|
+
Each insight is stored as an individual file for precise context loading.
|
|
25
|
+
|
|
26
|
+
## Subcommands
|
|
27
|
+
|
|
28
|
+
- `/myinsights [title]` — capture a new insight (default)
|
|
29
|
+
- `/myinsights archive INS-NNN` — move insight to archive (obsolete)
|
|
30
|
+
- `/myinsights status INS-NNN [active|workaround|obsolete]` — change insight status
|
|
31
|
+
|
|
32
|
+
## Capture Flow (default)
|
|
33
|
+
|
|
34
|
+
### Step 0. Duplicate Detection
|
|
35
|
+
|
|
36
|
+
**BEFORE creating a new insight**, search the index for duplicates:
|
|
37
|
+
|
|
38
|
+
1. Read `myinsights/1nsights.md`
|
|
39
|
+
2. Search the `Error Signatures` column for matching error strings from the current issue
|
|
40
|
+
3. Search the `Summary` column for semantically similar descriptions
|
|
41
|
+
|
|
42
|
+
**If potential duplicate found:**
|
|
43
|
+
```
|
|
44
|
+
⚠️ Possible duplicate of [INS-NNN] Title
|
|
45
|
+
File: myinsights/INS-NNN-slug.md
|
|
46
|
+
|
|
47
|
+
Options:
|
|
48
|
+
1. View existing insight and update it with new info
|
|
49
|
+
2. Create new insight anyway (different root cause)
|
|
50
|
+
3. Cancel
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If the user chooses to update — append new info to the existing detail file under
|
|
54
|
+
a `### Update YYYY-MM-DD` subsection and update the index entry if needed.
|
|
55
|
+
|
|
56
|
+
### Step 1. Collect Information
|
|
57
|
+
|
|
58
|
+
Ask the user (or reconstruct from conversation context) these details:
|
|
59
|
+
|
|
60
|
+
- **Title:** One-line summary of the problem/finding
|
|
61
|
+
- **Error Signatures:** Exact error strings, codes, or exception names that can be grepped
|
|
62
|
+
(e.g., `ECONNREFUSED`, `P1001`, `TypeError: Cannot read properties of undefined`)
|
|
63
|
+
- **Symptoms:** What went wrong? What was the unexpected behavior?
|
|
64
|
+
- **Diagnostic Steps:** What steps were taken to identify the root cause?
|
|
65
|
+
- **Root Cause:** What was the actual underlying problem?
|
|
66
|
+
- **Solution:** What fixed it? Step-by-step resolution.
|
|
67
|
+
- **Prevention:** How to avoid this in the future? Any guards, tests, or checks to add?
|
|
68
|
+
- **Tags:** Relevant categories (e.g., `docker`, `auth`, `deployment`, `database`, `config`)
|
|
69
|
+
- **Related:** Links to other insights, docs, or issues (e.g., `INS-003`, `INS-017`)
|
|
70
|
+
|
|
71
|
+
### Step 2. Create Individual Detail File
|
|
72
|
+
|
|
73
|
+
**File naming:** `myinsights/INS-NNN-slug.md` where slug is a short kebab-case description.
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
# [INS-NNN] Title
|
|
77
|
+
|
|
78
|
+
**Date:** YYYY-MM-DD
|
|
79
|
+
**Status:** 🟢 Active | 🟡 Workaround | 🔴 Obsolete
|
|
80
|
+
**Severity:** 🔴 Critical / 🟡 Medium / 🟢 Low
|
|
81
|
+
**Tags:** `tag1`, `tag2`, `tag3`
|
|
82
|
+
**Hits:** 0
|
|
83
|
+
|
|
84
|
+
## Error Signatures
|
|
85
|
+
```
|
|
86
|
+
EXACT_ERROR_STRING_1
|
|
87
|
+
EXACT_ERROR_STRING_2
|
|
88
|
+
error code or exception name
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Symptoms
|
|
92
|
+
[What went wrong — error messages, unexpected behavior, failing tests]
|
|
93
|
+
|
|
94
|
+
## Diagnostic Steps
|
|
95
|
+
1. [What was checked first]
|
|
96
|
+
2. [What was tried]
|
|
97
|
+
3. [What led to the root cause]
|
|
98
|
+
|
|
99
|
+
## Root Cause
|
|
100
|
+
[The actual underlying problem — be specific]
|
|
101
|
+
|
|
102
|
+
## Solution
|
|
103
|
+
1. [Step-by-step fix]
|
|
104
|
+
2. [Code changes, config changes]
|
|
105
|
+
3. [Verification that it works]
|
|
106
|
+
|
|
107
|
+
## Prevention
|
|
108
|
+
- [How to avoid this in the future]
|
|
109
|
+
- [Tests to add, checks to implement]
|
|
110
|
+
|
|
111
|
+
## Related
|
|
112
|
+
- [INS-XXX](INS-XXX-slug.md) — related insight description
|
|
113
|
+
- [Link to external doc or issue]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Step 3. Update Index (`myinsights/1nsights.md`)
|
|
117
|
+
|
|
118
|
+
If `myinsights/1nsights.md` doesn't exist, create it:
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
# 🔍 Development Insights Index
|
|
122
|
+
|
|
123
|
+
Living knowledge base. **Read this file first** — then load specific detail files as needed.
|
|
124
|
+
|
|
125
|
+
> **For Claude Code:** When you encounter an error, `grep` the Error Signatures column below.
|
|
126
|
+
> If you find a match, read ONLY the linked detail file — don't load everything.
|
|
127
|
+
|
|
128
|
+
| ID | Error Signatures | Summary | Status | Hits | File |
|
|
129
|
+
|----|-----------------|---------|--------|------|------|
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Then append a new row:
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
| INS-NNN | `ERROR_SIG_1`, `ERROR_SIG_2` | One-line summary | 🟢 Active | 0 | [INS-NNN-slug.md](INS-NNN-slug.md) |
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Step 4. Auto-numbering
|
|
139
|
+
|
|
140
|
+
List existing `INS-*.md` files in `myinsights/` (including `archive/`),
|
|
141
|
+
find the highest `INS-NNN` number, increment by 1. First entry is `INS-001`.
|
|
142
|
+
|
|
143
|
+
### Step 5. Notify
|
|
144
|
+
|
|
145
|
+
After saving:
|
|
146
|
+
```
|
|
147
|
+
✅ Insight captured: [INS-NNN] Title
|
|
148
|
+
📄 myinsights/INS-NNN-slug.md created
|
|
149
|
+
📋 myinsights/1nsights.md index updated
|
|
150
|
+
🔄 Will be auto-committed on session end (Stop hook)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
If this is the FIRST insight in the project, also notify:
|
|
154
|
+
```
|
|
155
|
+
📌 myinsights/ reference added to CLAUDE.md as knowledge source
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Archive Flow (`/myinsights archive INS-NNN`)
|
|
159
|
+
|
|
160
|
+
1. Move `myinsights/INS-NNN-slug.md` → `myinsights/archive/INS-NNN-slug.md`
|
|
161
|
+
2. Update status in `1nsights.md` index to `🔴 Obsolete`
|
|
162
|
+
3. Add `(archived)` suffix to the file link in index
|
|
163
|
+
4. Notify: `📦 INS-NNN archived → myinsights/archive/`
|
|
164
|
+
|
|
165
|
+
## Status Flow (`/myinsights status INS-NNN [status]`)
|
|
166
|
+
|
|
167
|
+
1. Update `**Status:**` line in the detail file
|
|
168
|
+
2. Update status column in `1nsights.md` index
|
|
169
|
+
3. If new status is `obsolete` — suggest archiving: `💡 Consider: /myinsights archive INS-NNN`
|
|
170
|
+
4. Notify: `🔄 INS-NNN status → [new status]`
|
|
171
|
+
|
|
172
|
+
## Hit Counter
|
|
173
|
+
|
|
174
|
+
When an insight is used to solve a problem (matched via grep or manual lookup):
|
|
175
|
+
1. Increment `**Hits:**` counter in the detail file
|
|
176
|
+
2. Increment `Hits` column in `1nsights.md` index
|
|
177
|
+
3. Note: `📊 INS-NNN hit count → N (helped solve current issue)`
|
|
178
|
+
|
|
179
|
+
Insights with higher hit counts are more valuable — consider this when prioritizing
|
|
180
|
+
which insights to check first during debugging.
|
|
181
|
+
````
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 2. Rule Template: `insights-capture.md`
|
|
186
|
+
|
|
187
|
+
Generate as `.claude/rules/insights-capture.md`:
|
|
188
|
+
|
|
189
|
+
````markdown
|
|
190
|
+
# Insights Capture Protocol
|
|
191
|
+
|
|
192
|
+
## 🔍 Error-First Lookup (CRITICAL — do this BEFORE debugging)
|
|
193
|
+
|
|
194
|
+
**IMPORTANT:** When you encounter ANY error, ALWAYS do this before starting to debug:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# Step 1: Check if index exists
|
|
198
|
+
if [ -f "myinsights/1nsights.md" ]; then
|
|
199
|
+
# Step 2: Grep for the error signature in the index
|
|
200
|
+
grep -i "ERROR_STRING_OR_CODE" myinsights/1nsights.md
|
|
201
|
+
fi
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Pattern:**
|
|
205
|
+
1. User reports a problem or an error occurs
|
|
206
|
+
2. Extract the key error string (error code, exception name, or unique message fragment)
|
|
207
|
+
3. `grep` the error string against `myinsights/1nsights.md` Error Signatures column
|
|
208
|
+
4. **If match found** → read ONLY the linked detail file → suggest documented solution FIRST
|
|
209
|
+
5. **If match found AND solution works** → increment hit counter in both index and detail file
|
|
210
|
+
6. **If no match** → debug normally → after resolution, suggest capturing with `/myinsights`
|
|
211
|
+
|
|
212
|
+
**Example lookup flow:**
|
|
213
|
+
```
|
|
214
|
+
Error: ECONNREFUSED 127.0.0.1:5432
|
|
215
|
+
→ grep "ECONNREFUSED" myinsights/1nsights.md
|
|
216
|
+
→ Match: INS-001 | `ECONNREFUSED`, `port 5432` | Postgres in Docker... | INS-001-docker-pg-network.md
|
|
217
|
+
→ cat myinsights/INS-001-docker-pg-network.md
|
|
218
|
+
→ Apply documented solution
|
|
219
|
+
→ Increment hit counter
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## When to Suggest Capturing an Insight
|
|
223
|
+
|
|
224
|
+
Proactively suggest `/myinsights` when ANY of these occur:
|
|
225
|
+
|
|
226
|
+
1. **Error → Fix cycle**: A non-trivial bug was debugged and resolved
|
|
227
|
+
- Especially: errors that took >3 attempts to fix
|
|
228
|
+
- Especially: misleading error messages that pointed wrong direction
|
|
229
|
+
|
|
230
|
+
2. **Configuration surprise**: A config setting behaved unexpectedly
|
|
231
|
+
- Docker networking quirks
|
|
232
|
+
- Environment variable gotchas
|
|
233
|
+
- Build tool configuration issues
|
|
234
|
+
|
|
235
|
+
3. **Dependency issue**: A library/package caused problems
|
|
236
|
+
- Version conflicts
|
|
237
|
+
- Undocumented breaking changes
|
|
238
|
+
- Platform-specific behavior
|
|
239
|
+
|
|
240
|
+
4. **Architecture decision under pressure**: A design choice was made
|
|
241
|
+
during debugging that should be documented
|
|
242
|
+
|
|
243
|
+
5. **Workaround applied**: A temporary fix was applied that needs
|
|
244
|
+
future attention (suggest status: 🟡 Workaround)
|
|
245
|
+
|
|
246
|
+
## How to Suggest
|
|
247
|
+
|
|
248
|
+
After resolving a tricky issue, say:
|
|
249
|
+
```
|
|
250
|
+
💡 This looks like a valuable insight. Want me to capture it?
|
|
251
|
+
Run `/myinsights [brief title]` or say "да, запиши"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## When NOT to Suggest
|
|
255
|
+
|
|
256
|
+
- Trivial typos or syntax errors
|
|
257
|
+
- Well-known framework patterns
|
|
258
|
+
- Issues already documented in `myinsights/` (check index first!)
|
|
259
|
+
- User explicitly said they don't want to capture
|
|
260
|
+
|
|
261
|
+
## Lifecycle Awareness
|
|
262
|
+
|
|
263
|
+
When reviewing insights during lookup, check the status:
|
|
264
|
+
- `🟢 Active` — trusted solution, apply directly
|
|
265
|
+
- `🟡 Workaround` — temporary fix, may need better solution. Apply but flag to user.
|
|
266
|
+
- `🔴 Obsolete` — should be in archive. If found in main folder, suggest `/myinsights archive INS-NNN`
|
|
267
|
+
|
|
268
|
+
When a workaround gets a proper fix, suggest:
|
|
269
|
+
```
|
|
270
|
+
💡 INS-NNN was a workaround. Now we have a proper fix — update it?
|
|
271
|
+
Run `/myinsights status INS-NNN active` and I'll update the solution.
|
|
272
|
+
```
|
|
273
|
+
````
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## 3. Hook Template: Stop Event
|
|
278
|
+
|
|
279
|
+
Add to `.claude/settings.json` hooks section:
|
|
280
|
+
|
|
281
|
+
```json
|
|
282
|
+
{
|
|
283
|
+
"hooks": {
|
|
284
|
+
"Stop": [
|
|
285
|
+
{
|
|
286
|
+
"matcher": "",
|
|
287
|
+
"command": "bash -c '\nDIR=\"myinsights\"\nINDEX=\"myinsights/1nsights.md\"\nCLAUDE=\"CLAUDE.md\"\n\n# Check if myinsights/ has any uncommitted changes\nif [ -d \"$DIR\" ] && (git diff --name-only -- \"$DIR\" 2>/dev/null | grep -q . || git diff --name-only --cached -- \"$DIR\" 2>/dev/null | grep -q . || git ls-files --others --exclude-standard -- \"$DIR\" 2>/dev/null | grep -q .); then\n \n # Auto-add insights reference to CLAUDE.md on first time\n if ! grep -q \"myinsights\" \"$CLAUDE\" 2>/dev/null; then\n printf \"\\n## 🔍 Development Insights (живая база знаний)\\nIndex: [myinsights/1nsights.md](myinsights/1nsights.md) — check here FIRST before debugging.\\n⚠️ On error → grep the error string in the index → read only the matched detail file.\\nCapture new findings: \\`/myinsights [title]\\`\\n\" >> \"$CLAUDE\"\n git add \"$CLAUDE\"\n echo \"📌 myinsights/ reference added to CLAUDE.md\"\n fi\n \n # Auto-commit all changes in myinsights/\n git add \"$DIR\"\n git commit -m \"docs(insights): update knowledge base\"\n echo \"✅ myinsights/ auto-committed\"\nfi\n'"
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Readable version:**
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
#!/bin/bash
|
|
298
|
+
DIR="myinsights"
|
|
299
|
+
INDEX="myinsights/1nsights.md"
|
|
300
|
+
CLAUDE="CLAUDE.md"
|
|
301
|
+
|
|
302
|
+
# Check if myinsights/ has any uncommitted or untracked changes
|
|
303
|
+
if [ -d "$DIR" ] && \
|
|
304
|
+
(git diff --name-only -- "$DIR" 2>/dev/null | grep -q . || \
|
|
305
|
+
git diff --name-only --cached -- "$DIR" 2>/dev/null | grep -q . || \
|
|
306
|
+
git ls-files --others --exclude-standard -- "$DIR" 2>/dev/null | grep -q .); then
|
|
307
|
+
|
|
308
|
+
# Auto-add insights reference to CLAUDE.md on first time
|
|
309
|
+
if ! grep -q "myinsights" "$CLAUDE" 2>/dev/null; then
|
|
310
|
+
cat >> "$CLAUDE" << 'EOF'
|
|
311
|
+
|
|
312
|
+
## 🔍 Development Insights (живая база знаний)
|
|
313
|
+
Index: [myinsights/1nsights.md](myinsights/1nsights.md) — check here FIRST before debugging.
|
|
314
|
+
⚠️ On error → grep the error string in the index → read only the matched detail file.
|
|
315
|
+
Capture new findings: `/myinsights [title]`
|
|
316
|
+
EOF
|
|
317
|
+
git add "$CLAUDE"
|
|
318
|
+
echo "📌 myinsights/ reference added to CLAUDE.md"
|
|
319
|
+
fi
|
|
320
|
+
|
|
321
|
+
# Auto-commit all changes in myinsights/
|
|
322
|
+
git add "$DIR"
|
|
323
|
+
git commit -m "docs(insights): update knowledge base"
|
|
324
|
+
echo "✅ myinsights/ auto-committed"
|
|
325
|
+
fi
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**Why `Stop` event:**
|
|
329
|
+
- Non-intrusive — doesn't interrupt work flow
|
|
330
|
+
- Catches ALL changes in `myinsights/` — new files, edits, hit counter updates, archives
|
|
331
|
+
- Handles **untracked** new files (the old version only caught modified tracked files)
|
|
332
|
+
- Ensures the entire knowledge base folder is always committed
|
|
333
|
+
- First-time CLAUDE.md update happens seamlessly
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## 4. CLAUDE.md Integration
|
|
338
|
+
|
|
339
|
+
When generating CLAUDE.md, ALWAYS include this section (even before first insight exists):
|
|
340
|
+
|
|
341
|
+
```markdown
|
|
342
|
+
## 🔍 Development Insights (живая база знаний)
|
|
343
|
+
Index: [myinsights/1nsights.md](myinsights/1nsights.md) — check here FIRST before debugging.
|
|
344
|
+
⚠️ On error → grep the error string in the index → read only the matched detail file.
|
|
345
|
+
Capture new findings: `/myinsights [title]`
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
The Stop hook will add this section automatically if it's missing (safety net), but generating
|
|
349
|
+
it upfront ensures Claude Code reads insights from the very first session.
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
# MCP Configuration Template
|
|
2
|
+
|
|
3
|
+
Use this template to generate .mcp.json for Claude Code projects.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Base Structure
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"mcpServers": {
|
|
12
|
+
|
|
13
|
+
},
|
|
14
|
+
"disabledMcpServers": []
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Common MCP Server Configs
|
|
21
|
+
|
|
22
|
+
### GitHub
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"github": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
29
|
+
"env": {
|
|
30
|
+
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### PostgreSQL
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"postgres": {
|
|
42
|
+
"command": "npx",
|
|
43
|
+
"args": ["-y", "@modelcontextprotocol/server-postgres"],
|
|
44
|
+
"env": {
|
|
45
|
+
"DATABASE_URL": "${DATABASE_URL}"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Supabase
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcpServers": {
|
|
56
|
+
"supabase": {
|
|
57
|
+
"command": "npx",
|
|
58
|
+
"args": ["-y", "@supabase/mcp-server"],
|
|
59
|
+
"env": {
|
|
60
|
+
"SUPABASE_URL": "${SUPABASE_URL}",
|
|
61
|
+
"SUPABASE_KEY": "${SUPABASE_KEY}"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Slack
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"mcpServers": {
|
|
72
|
+
"slack": {
|
|
73
|
+
"command": "npx",
|
|
74
|
+
"args": ["-y", "@modelcontextprotocol/server-slack"],
|
|
75
|
+
"env": {
|
|
76
|
+
"SLACK_BOT_TOKEN": "${SLACK_BOT_TOKEN}"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Notion
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"notion": {
|
|
88
|
+
"command": "npx",
|
|
89
|
+
"args": ["-y", "@modelcontextprotocol/server-notion"],
|
|
90
|
+
"env": {
|
|
91
|
+
"NOTION_TOKEN": "${NOTION_TOKEN}"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Brave Search
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"mcpServers": {
|
|
102
|
+
"brave-search": {
|
|
103
|
+
"command": "npx",
|
|
104
|
+
"args": ["-y", "@anthropic/mcp-server-brave-search"],
|
|
105
|
+
"env": {
|
|
106
|
+
"BRAVE_API_KEY": "${BRAVE_API_KEY}"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Puppeteer
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"puppeteer": {
|
|
118
|
+
"command": "npx",
|
|
119
|
+
"args": ["-y", "@anthropic/mcp-server-puppeteer"]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Sequential Thinking
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"mcpServers": {
|
|
129
|
+
"sequential-thinking": {
|
|
130
|
+
"command": "npx",
|
|
131
|
+
"args": ["-y", "@anthropic/mcp-server-sequential-thinking"]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Memory (KV Store)
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"mcpServers": {
|
|
141
|
+
"memory": {
|
|
142
|
+
"command": "npx",
|
|
143
|
+
"args": ["-y", "@anthropic/mcp-server-memory"]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Filesystem
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"mcpServers": {
|
|
153
|
+
"filesystem": {
|
|
154
|
+
"command": "npx",
|
|
155
|
+
"args": ["-y", "@anthropic/mcp-server-filesystem", "/path/to/allowed/dir"]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Combined Example
|
|
164
|
+
|
|
165
|
+
For a project with GitHub, PostgreSQL, and Slack:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"mcpServers": {
|
|
170
|
+
"github": {
|
|
171
|
+
"command": "npx",
|
|
172
|
+
"args": ["-y", "@modelcontextprotocol/server-github"],
|
|
173
|
+
"env": {
|
|
174
|
+
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"postgres": {
|
|
178
|
+
"command": "npx",
|
|
179
|
+
"args": ["-y", "@modelcontextprotocol/server-postgres"],
|
|
180
|
+
"env": {
|
|
181
|
+
"DATABASE_URL": "${DATABASE_URL}"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"slack": {
|
|
185
|
+
"command": "npx",
|
|
186
|
+
"args": ["-y", "@modelcontextprotocol/server-slack"],
|
|
187
|
+
"env": {
|
|
188
|
+
"SLACK_BOT_TOKEN": "${SLACK_BOT_TOKEN}"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"disabledMcpServers": []
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Generation Rules
|
|
199
|
+
|
|
200
|
+
### From Architecture.md
|
|
201
|
+
|
|
202
|
+
1. Extract `External Integrations` or `Third-Party Services` section
|
|
203
|
+
2. Match each integration to known MCP servers
|
|
204
|
+
3. Generate config with appropriate env vars
|
|
205
|
+
4. Add unmatched integrations as comments
|
|
206
|
+
|
|
207
|
+
### Matching Priority
|
|
208
|
+
|
|
209
|
+
1. **Exact match** — use official server
|
|
210
|
+
2. **Category match** — use generic server (e.g., any SQL → postgres)
|
|
211
|
+
3. **No match** — add comment for custom consideration
|
|
212
|
+
|
|
213
|
+
### Environment Variables
|
|
214
|
+
|
|
215
|
+
Always use `${VAR_NAME}` syntax for secrets:
|
|
216
|
+
- Never hardcode tokens/keys
|
|
217
|
+
- Use descriptive names: `GITHUB_TOKEN`, `DATABASE_URL`
|
|
218
|
+
- Document required vars in INSTALL.md
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Best Practices
|
|
223
|
+
|
|
224
|
+
1. **Minimal** — only include servers actually needed
|
|
225
|
+
2. **Disabled by default** — use `disabledMcpServers` for optional ones
|
|
226
|
+
3. **Env vars** — never hardcode secrets
|
|
227
|
+
4. **Test locally** — verify servers work before committing
|
|
228
|
+
|
|
229
|
+
## Context Window Considerations
|
|
230
|
+
|
|
231
|
+
| Servers Enabled | Approximate Context Impact |
|
|
232
|
+
|-----------------|---------------------------|
|
|
233
|
+
| 1-5 | Minimal (~5k tokens) |
|
|
234
|
+
| 5-10 | Moderate (~15k tokens) |
|
|
235
|
+
| 10-20 | Significant (~30k tokens) |
|
|
236
|
+
| 20+ | High risk of overflow |
|
|
237
|
+
|
|
238
|
+
**Recommendation:** Keep <10 servers enabled per project.
|
|
239
|
+
|
|
240
|
+
## File Location
|
|
241
|
+
|
|
242
|
+
- Project-level: `.mcp.json` in project root
|
|
243
|
+
- User-level: `~/.config/claude-code/mcp.json`
|
|
244
|
+
|
|
245
|
+
Project-level takes precedence.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Complete Server Reference
|
|
250
|
+
|
|
251
|
+
| Integration | Package | Env Vars |
|
|
252
|
+
|-------------|---------|----------|
|
|
253
|
+
| GitHub | @modelcontextprotocol/server-github | GITHUB_TOKEN |
|
|
254
|
+
| GitLab | @modelcontextprotocol/server-gitlab | GITLAB_TOKEN |
|
|
255
|
+
| PostgreSQL | @modelcontextprotocol/server-postgres | DATABASE_URL |
|
|
256
|
+
| MySQL | @modelcontextprotocol/server-mysql | DATABASE_URL |
|
|
257
|
+
| SQLite | @modelcontextprotocol/server-sqlite | DB_PATH |
|
|
258
|
+
| MongoDB | @modelcontextprotocol/server-mongodb | MONGODB_URI |
|
|
259
|
+
| Redis | @modelcontextprotocol/server-redis | REDIS_URL |
|
|
260
|
+
| Supabase | @supabase/mcp-server | SUPABASE_URL, SUPABASE_KEY |
|
|
261
|
+
| Slack | @modelcontextprotocol/server-slack | SLACK_BOT_TOKEN |
|
|
262
|
+
| Notion | @modelcontextprotocol/server-notion | NOTION_TOKEN |
|
|
263
|
+
| Linear | mcp-linear | LINEAR_API_KEY |
|
|
264
|
+
| Jira | mcp-atlassian | JIRA_TOKEN |
|
|
265
|
+
| AWS | @aws/mcp-server | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY |
|
|
266
|
+
| Vercel | mcp-vercel | VERCEL_TOKEN |
|
|
267
|
+
| Stripe | @stripe/mcp-server | STRIPE_API_KEY |
|
|
268
|
+
| Twilio | mcp-twilio | TWILIO_SID, TWILIO_TOKEN |
|
|
269
|
+
| Brave Search | @anthropic/mcp-server-brave-search | BRAVE_API_KEY |
|
|
270
|
+
| Puppeteer | @anthropic/mcp-server-puppeteer | (none) |
|
|
271
|
+
| Playwright | mcp-playwright | (none) |
|
|
272
|
+
| Memory | @anthropic/mcp-server-memory | (none) |
|
|
273
|
+
| Sequential Thinking | @anthropic/mcp-server-sequential-thinking | (none) |
|
|
274
|
+
| Filesystem | @anthropic/mcp-server-filesystem | (path arg) |
|