metame-cli 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 ADDED
@@ -0,0 +1,171 @@
1
+ # ๐Ÿ”ฎ MetaMe
2
+
3
+ > **The Meta-Cognitive Layer for Claude Code.**
4
+ >
5
+ > *Turn your AI assistant into a psychological mirror that knows you, evolves with you, and protects your core values.*
6
+
7
+ ## ๐Ÿ“– Introduction
8
+
9
+ **Claude Code** is a powerful tool, but it suffers from "Project Amnesia." Every time you switch folders, it forgets who you are, your communication style, and your specific constraints.
10
+
11
+ **MetaMe** solves this by wrapping Claude in a **Meta-Cognitive Layer** . It creates a persistent "Global Brain" that travels with you across every project. It knows your psychological profile, monitors your stress levels, and respects your core principlesโ€”without you having to repeat yourself.
12
+
13
+ It is not just a launcher; it is a **Meta Avatar** .
14
+
15
+ ## โœจ Key Features
16
+
17
+ * **๐Ÿง  Global Brain (`~/.claude_profile.yaml`):** A single source of truth for your identity, storing your nickname, stress status, and cognitive traits.
18
+ * **๐Ÿงฌ Genesis Protocol:** On the first run, MetaMe conducts a **Deep Cognitive Interview** to map your **Psychological DNA** (Talents, Fears, Cognition, Values) via open-ended, Socratic dialogue.
19
+ * **๐Ÿค Dynamic Handshake Protocol:** The "Canary Test." MetaMe verifies its connection to your profile by addressing you by your chosen **Codename** in the very first sentence. If it doesn't, you know the link is broken.
20
+ * **๐Ÿ›ก๏ธ Auto-Lock Mechanism:** Mark any value in your profile with `# [LOCKED]`, and MetaMe will treat it as a constitution that cannot be overwritten.
21
+ * **๐Ÿ”Œ Smart Injection:** Automatically injects your profile context into the `CLAUDE.md` of any project you enter, ensuring seamless context switching.
22
+
23
+ ## ๐Ÿ›  Prerequisites
24
+
25
+ MetaMe is a wrapper around **Claude Code** . You must have Node.js and the official Claude Code tool installed first.
26
+
27
+ 1. **Node.js** : Version 14 or higher.
28
+ 2. **Claude Code** :
29
+ **Bash**
30
+
31
+ ```
32
+ npm install -g @anthropic-ai/claude-code
33
+ ```
34
+
35
+ 1. **Auth** : Ensure you have logged in via `claude login`.
36
+
37
+ ## ๐Ÿ“ฆ Installation
38
+
39
+ Install MetaMe globally via NPM:
40
+
41
+ **Bash**
42
+
43
+ ```
44
+ npm install -g metame-cli
45
+ ```
46
+
47
+ *(Note: If you encounter permission errors on Mac/Linux, use `sudo npm install -g metame-cli`)*
48
+
49
+ ## ๐Ÿš€ Usage
50
+
51
+ Forget the `claude` command. From now on, simply type:
52
+
53
+ **Bash**
54
+
55
+ ```
56
+ metame
57
+ ```
58
+
59
+ Or, if you prefer mixed case (it's the same command):
60
+
61
+ **Bash**
62
+
63
+ ```
64
+ MetaMe
65
+ ```
66
+
67
+ ### The First Run (Genesis)
68
+
69
+ When you run MetaMe for the first time, it will detect that your profile is empty. It will pause the AI and enter **Calibration Mode**:
70
+
71
+ 1. It will ask you for a **Codename** (Nickname).
72
+ 2. It will initiate a **Deep Cognitive Interview** to map your talents, mental models, and hidden anxieties.
73
+ 3. **Be Honest**: It acts as a mirror. The more raw truth you provide, the better it can shadow you.
74
+ 4. Once finished, it saves your "Source Code" and launches Claude.
75
+
76
+ ### Daily Workflow
77
+
78
+ 1. `cd` into any project folder.
79
+ 2. Run `metame`.
80
+ 3. Claude will start and immediately say: *"Ready, [Your Name]..."*
81
+ 4. Start coding. MetaMe manages the context in the background.
82
+
83
+ ### Hot Reload (Refresh)
84
+
85
+ If you update your profile or need to fix a broken context **without restarting your session**:
86
+
87
+ * **Inside Claude**: Run `!metame refresh`
88
+ * **External Terminal**: Run `metame refresh`
89
+
90
+ This re-injects your latest profile into `CLAUDE.md` instantly.
91
+
92
+ ## โš™๏ธ Configuration & The "Global Brain"
93
+
94
+ Your profile is stored in a hidden YAML file in your home directory.
95
+
96
+ **Location:** `~/.claude_profile.yaml`
97
+
98
+ You can edit this file manually to update your status or lock your values.
99
+
100
+ **Example Profile:**
101
+
102
+ **YAML**
103
+
104
+ ```
105
+ identity:
106
+ role: Senior Architect
107
+ nickname: Neo
108
+ status:
109
+ focus: Refactoring Legacy Code
110
+ pressure: High
111
+ cognition:
112
+ crisis_reflex: Strategic_Analysis
113
+ blind_spot: Perfectionism # [LOCKED]
114
+ values:
115
+ core: "User Experience First" # [LOCKED]
116
+ ```
117
+
118
+ * **`# [LOCKED]`** : Adding this comment ensures that even as the AI evolves your profile, these specific lines will **never** be changed.
119
+
120
+ ## ๐Ÿ—‘๏ธ Uninstallation
121
+
122
+ If you wish to remove MetaMe completely from your system, follow these steps:
123
+
124
+ ### 1. Remove the Package
125
+
126
+ Uninstall the CLI tool:
127
+
128
+ **Bash**
129
+
130
+ ```
131
+ npm uninstall -g metame-cli
132
+ ```
133
+
134
+ ### 2. Remove the Global Brain (Optional)
135
+
136
+ If you want to delete your stored profile data:
137
+
138
+ **Bash**
139
+
140
+ ```
141
+ rm ~/.claude_profile.yaml
142
+ ```
143
+
144
+ ### 3. Cleanup Project Files (Optional)
145
+
146
+ MetaMe adds a header to `CLAUDE.md` files in your projects. To restore them to their original state (if you have many), you can use a text editor to remove the block starting with `## ๐Ÿง  SYSTEM KERNEL`.
147
+
148
+ ## โšก Performance & Cost
149
+
150
+ You might worry: *"Does this eat up my context window?"*
151
+
152
+ **Short answer: No. It likely saves you money.**
153
+
154
+ * **Context Cost**: The entire MetaMe kernel + your profile takes up **~800-1000 tokens**.
155
+ * **Impact**: On a 200k context window, this is **0.5%** of the memory.
156
+ * **ROI**: By pre-loading your context, you avoid the "instructional drift" and repetitive correction loops that usually waste thousands of tokens at the start of every session.
157
+
158
+ ## โ“ FAQ
159
+
160
+ **Q: Does this replace `CLAUDE.md`?**
161
+ A: No. It *prepends* its meta-cognitive protocol to your existing `CLAUDE.md`. Your project-specific notes remain intact.
162
+
163
+ **Q: What if Claude stops calling me by my nickname?**
164
+ A: This is the "Canary Test." It means the context window has been compressed or the file link is broken. Run `/compact` in Claude or restart `metame` to fix it.
165
+
166
+ **Q: Is my data sent to a third party?**
167
+ A: No. Your profile stays local at `~/.claude_profile.yaml`. MetaMe simply passes text to the official Claude Code tool.
168
+
169
+ ## ๐Ÿ“„ License
170
+
171
+ MIT License. Feel free to fork, modify, and evolve your own Meta-Cognition.
@@ -0,0 +1,171 @@
1
+ # ๐Ÿ”ฎ MetaMe
2
+
3
+ > **Claude Code ็š„โ€œๅ…ƒ่ฎค็Ÿฅโ€ๅฑ‚ (The Meta-Cognitive Layer)**
4
+ >
5
+ > *ๅฐ†ไฝ ็š„ AI ๅŠฉๆ‰‹ๅ˜ๆˆไธ€้ขๅฟƒ็†้•œๅƒ๏ผšๅฎƒไบ†่งฃไฝ ๏ผŒ้šไฝ ่ฟ›ๅŒ–๏ผŒๅนถๆ—ถๅˆปๅฎˆๆŠคไฝ ็š„ๆ ธๅฟƒๅŽŸๅˆ™ใ€‚*
6
+
7
+ ## ๐Ÿ“– ็ฎ€ไป‹ (Introduction)
8
+
9
+ **Claude Code** ๆ˜ฏไธ€ไธชๅผบๅคง็š„ๅทฅๅ…ท๏ผŒไฝ†ๅฎƒๆ‚ฃๆœ‰โ€œ้กน็›ฎๅคฑๅฟ†็—‡โ€ใ€‚ๆฏๅฝ“ไฝ ๅˆ‡ๆขๆ–‡ไปถๅคนๆ—ถ๏ผŒๅฎƒๅฐฑไผšๅฟ˜่ฎฐไฝ ๆ˜ฏ่ฐใ€ไฝ ็š„ๆฒŸ้€š้ฃŽๆ ผไปฅๅŠไฝ ็š„ๅ…ทไฝ“้™ๅˆถใ€‚
10
+
11
+ **MetaMe** ้€š่ฟ‡ไธบ Claude ๅŒ…่ฃนไธ€ๅฑ‚ **โ€œๅ…ƒ่ฎค็Ÿฅๅฑ‚โ€** ๆฅ่งฃๅ†ณ่ฟ™ไธช้—ฎ้ข˜ใ€‚ๅฎƒๅˆ›ๅปบไบ†ไธ€ไธช่ทŸ้šไฝ ็ฉฟๆขญไบŽๆ‰€ๆœ‰้กน็›ฎ็š„ **โ€œๅ…จๅฑ€ๅคง่„‘โ€** ใ€‚ๅฎƒไบ†่งฃไฝ ็š„ๅฟƒ็†็”ปๅƒ๏ผŒ็›‘ๆŽงไฝ ็š„ๅŽ‹ๅŠ›็Šถๆ€๏ผŒๅนถๅฐŠ้‡ไฝ ็š„ๆ ธๅฟƒๅŽŸๅˆ™โ€”โ€”ๆ— ้œ€ไฝ ๆฏๆฌก้‡ๅคๅผบ่ฐƒใ€‚
12
+
13
+ ๅฎƒไธไป…ไป…ๆ˜ฏไธ€ไธชๅฏๅŠจๅ™จ๏ผ›ๅฎƒๆ˜ฏไฝ ็š„ **ๅ…ƒๅˆ†่บซ (Meta Avatar)** ใ€‚
14
+
15
+ ## โœจ ๆ ธๅฟƒ็‰นๆ€ง (Key Features)
16
+
17
+ * **๐Ÿง  ๅ…จๅฑ€ๅคง่„‘ (`~/.claude_profile.yaml`)๏ผš** ๅ…ณไบŽไฝ ่บซไปฝ็š„โ€œๅ”ฏไธ€็œŸ็†ๆฅๆบโ€ใ€‚ๅญ˜ๅ‚จไฝ ็š„ๆ˜ต็งฐใ€ๅŽ‹ๅŠ›็Šถๆ€ๅ’Œ่ฎค็Ÿฅ็‰นๅพ๏ผŒ่ทจ้กน็›ฎๅ…ฑไบซใ€‚
18
+ * **๐Ÿงฌ ๅˆ›ไธ–็บชๅ่ฎฎ (Genesis Protocol)๏ผš** ๅˆๆฌก่ฟ่กŒๆ—ถ๏ผŒMetaMe ไผš่ฟ›่กŒไธ€ๆฌก **ๆทฑๅบฆ่ฎค็Ÿฅ่ฎฟ่ฐˆ**ใ€‚ๅฎƒ้€š่ฟ‡่‹ๆ ผๆ‹‰ๅบ•ๅผ็š„ๅฏน่ฏ๏ผŒๆŒ–ๆŽ˜ไฝ ็š„ **ๅฟƒ็† DNA**๏ผˆๅคฉ่ต‹ใ€ๅฟƒๆ™บๆจกๅž‹ใ€ๆฝœๆ„่ฏ†็„ฆ่™‘ใ€ๆ ธๅฟƒไปทๅ€ผ่ง‚๏ผ‰ใ€‚
19
+ * **๐Ÿค ๅŠจๆ€ๆกๆ‰‹ๅ่ฎฎ (Dynamic Handshake)๏ผš** ๅณโ€œ้‡‘ไธ้›€ๆต‹่ฏ•โ€ใ€‚MetaMe ไผšๅผบๅˆถ AI ๅœจๅ›žๅค็š„็ฌฌไธ€ๅฅ่ฏไธญ้€š่ฟ‡ไฝ ็š„ **ไปฃๅท (Codename)** ๆฅ็งฐๅ‘ผไฝ ใ€‚ๅฆ‚ๆžœๅฎƒๆฒกๅซไฝ ็š„ๅๅญ—๏ผŒไฝ ๅฐฑ็Ÿฅ้“ๅ…ƒ่ฎค็Ÿฅ่ฟžๆŽฅๅทฒๆ–ญๅผ€ใ€‚
20
+ * **๐Ÿ›ก๏ธ ่‡ชๅŠจ้”ๅฎšๆœบๅˆถ (Auto-Lock)๏ผš** ๅœจ้…็ฝฎๆ–‡ไปถไธญไธบไปปไฝ•ๅ€ผๆทปๅŠ  `# [LOCKED]`๏ผŒMetaMe ๅฐฑไผšๅฐ†ๅ…ถ่ง†ไธบไธๅฏๅŠจๆ‘‡็š„โ€œๅฎชๆณ•โ€๏ผŒ้˜ฒๆญข AI ้šๆ„ไฟฎๆ”นใ€‚
21
+ * **๐Ÿ”Œ ๆ™บ่ƒฝๆณจๅ…ฅ (Smart Injection)๏ผš** ่‡ชๅŠจๅฐ†ไฝ ็š„ไธชไบบๆกฃๆกˆๆณจๅ…ฅๅˆฐไฝ ่ฟ›ๅ…ฅ็š„ไปปไฝ•้กน็›ฎ็š„ `CLAUDE.md` ไธญ๏ผŒๅฎž็Žฐๆ— ็ผ็š„ไธŠไธ‹ๆ–‡ๅˆ‡ๆขใ€‚
22
+
23
+ ## ๐Ÿ›  ๅ‰็ฝฎ่ฆๆฑ‚ (Prerequisites)
24
+
25
+ MetaMe ๆ˜ฏ **Claude Code** ็š„ๅค–ๅฃณใ€‚ไฝ ๅฟ…้กปๅ…ˆๅฎ‰่ฃ… Node.js ๅ’Œๅฎ˜ๆ–น็š„ Claude Code ๅทฅๅ…ทใ€‚
26
+
27
+ 1. **Node.js** : ็‰ˆๆœฌ 14 ๆˆ–ๆ›ด้ซ˜ใ€‚
28
+ 2. **Claude Code** :
29
+ **Bash**
30
+
31
+ ```
32
+ npm install -g @anthropic-ai/claude-code
33
+ ```
34
+
35
+ 1. **่ฎค่ฏ** : ็กฎไฟไฝ ๅทฒ็ป่ฟ่กŒ่ฟ‡ `claude login` ๅนถ็™ปๅฝ•ๆˆๅŠŸใ€‚
36
+
37
+ ## ๐Ÿ“ฆ ๅฎ‰่ฃ… (Installation)
38
+
39
+ ้€š่ฟ‡ NPM ๅ…จๅฑ€ๅฎ‰่ฃ… MetaMe๏ผš
40
+
41
+ **Bash**
42
+
43
+ ```
44
+ npm install -g metame-cli
45
+ ```
46
+
47
+ *(ๆณจๆ„๏ผšๅฆ‚ๆžœไฝ ๅœจ Mac/Linux ไธŠ้‡ๅˆฐๆƒ้™้”™่ฏฏ๏ผŒ่ฏทไฝฟ็”จ `sudo npm install -g metame-cli`)*
48
+
49
+ ## ๐Ÿš€ ไฝฟ็”จๆŒ‡ๅ— (Usage)
50
+
51
+ ๅฟ˜ๆމ `claude` ๅ‘ฝไปคๅงใ€‚ไปŽ็Žฐๅœจ่ตท๏ผŒๅช้œ€่พ“ๅ…ฅ๏ผš
52
+
53
+ **Bash**
54
+
55
+ ```
56
+ metame
57
+ ```
58
+
59
+ ๆˆ–่€…๏ผŒๅฆ‚ๆžœไฝ ๅ–œๆฌขๆททๅˆๅคงๅฐๅ†™๏ผˆๆ•ˆๆžœไธ€ๆ ท๏ผ‰๏ผš
60
+
61
+ **Bash**
62
+
63
+ ```
64
+ MetaMe
65
+ ```
66
+
67
+ ### ๅˆๆฌก่ฟ่กŒ๏ผšๅˆ›ไธ–็บช (The First Run)
68
+
69
+ ๅฝ“ไฝ ็ฌฌไธ€ๆฌก่ฟ่กŒ MetaMe ๆ—ถ๏ผŒๅฎƒไผšๆฃ€ๆต‹ๅˆฐไฝ ็š„ๆกฃๆกˆไธบ็ฉบใ€‚ๅฎƒไผšๆš‚ๅœ AI ๅนถ่ฟ›ๅ…ฅ **ๆ กๅ‡†ๆจกๅผ (Calibration Mode)** ๏ผš
70
+
71
+ 1. ๅฎƒไผš่ฏข้—ฎไฝ ็š„ **ไปฃๅท (Codename/Nickname)**ใ€‚
72
+ 2. ๅฎƒไผšๅผ€ๅฏไธ€ๅœบ **ๆทฑๅบฆ่ฎค็Ÿฅ่ฎฟ่ฐˆ**๏ผŒๆŽข็ดขไฝ ็š„ๅคฉ่ต‹้ข†ๅŸŸใ€ๆ€็ปดๆจกๅผๅ’Œๆฝœๅœจ็„ฆ่™‘ใ€‚
73
+ 3. **่ฏทๅŠกๅฟ…่ฏšๅฎž**๏ผšๅฎƒๆ˜ฏไธ€้ข้•œๅญใ€‚ไฝ ่ถŠๅฆ่ฏš๏ผˆๅณไพฟๆ˜ฏๅ…ณไบŽไฝ ็š„ๆๆƒง๏ผ‰๏ผŒๅฎƒๅฐฑ่ถŠ่ƒฝๆˆไธบไฝ ็š„ๅฎŒ็พŽๅˆ†่บซใ€‚
74
+ 4. ๅฎŒๆˆๅŽ๏ผŒๅฎƒไผšไฟๅญ˜ไฝ ็š„โ€œๆบไปฃ็ โ€ๅนถๅฏๅŠจ Claudeใ€‚
75
+
76
+ ### ๆ—ฅๅธธๅทฅไฝœๆต
77
+
78
+ 1. `cd` ่ฟ›ๅ…ฅไปปไฝ•้กน็›ฎๆ–‡ไปถๅคนใ€‚
79
+ 2. ่ฟ่กŒ `metame`ใ€‚
80
+ 3. Claude ๅฏๅŠจๅนถ็ซ‹ๅณ่ฏด๏ผš*โ€œReady, [ไฝ ็š„ๅๅญ—]...โ€*
81
+ 4. ๅผ€ๅง‹ๅ†™ไปฃ็ ใ€‚MetaMe ไผšๅœจๅŽๅฐ่‡ชๅŠจ็ฎก็†ไธŠไธ‹ๆ–‡ใ€‚
82
+
83
+ ### ็ƒญ้‡่ฝฝ (Hot Reload)
84
+
85
+ ๅฆ‚ๆžœไฝ ๆ›ดๆ–ฐไบ†ไธชไบบๆกฃๆกˆ๏ผŒๆˆ–่€…้œ€่ฆไฟฎๅคๆ–ญๅผ€็š„ไธŠไธ‹ๆ–‡่ฟžๆŽฅ๏ผŒ่€Œ**ไธๆƒณ้‡ๅฏไผš่ฏ**๏ผš
86
+
87
+ * **ๅœจ Claude ๅ†…้ƒจ**๏ผš่ฟ่กŒ `!metame refresh`
88
+ * **ๅœจๅค–้ƒจ็ปˆ็ซฏ**๏ผš่ฟ่กŒ `metame refresh`
89
+
90
+ ่ฟ™ไผš็ซ‹ๅณๅฐ†ไฝ ๆœ€ๆ–ฐ็š„ๆกฃๆกˆ้‡ๆ–ฐๆณจๅ…ฅ `CLAUDE.md`ใ€‚
91
+
92
+ ## โš™๏ธ ้…็ฝฎไธŽโ€œๅ…จๅฑ€ๅคง่„‘โ€
93
+
94
+ ไฝ ็š„ไธชไบบๆกฃๆกˆๅญ˜ๅ‚จๅœจไฝ ็”จๆˆทไธป็›ฎๅฝ•ไธ‹็š„ไธ€ไธช้š่— YAML ๆ–‡ไปถไธญใ€‚
95
+
96
+ **ไฝ็ฝฎ๏ผš** `~/.claude_profile.yaml`
97
+
98
+ ไฝ ๅฏไปฅๆ‰‹ๅŠจ็ผ–่พ‘ๆญคๆ–‡ไปถๆฅๆ›ดๆ–ฐไฝ ็š„็Šถๆ€ๆˆ–้”ๅฎšไฝ ็š„ไปทๅ€ผ่ง‚ใ€‚
99
+
100
+ **ๆกฃๆกˆ็คบไพ‹๏ผš**
101
+
102
+ **YAML**
103
+
104
+ ```
105
+ identity:
106
+ role: Senior Architect
107
+ nickname: Neo
108
+ status:
109
+ focus: Refactoring Legacy Code
110
+ pressure: High
111
+ cognition:
112
+ crisis_reflex: Strategic_Analysis
113
+ blind_spot: Perfectionism # [LOCKED]
114
+ values:
115
+ core: "User Experience First" # [LOCKED]
116
+ ```
117
+
118
+ * **`# [LOCKED]`** ๏ผšๆทปๅŠ ๆญคๆณจ้‡Šๅฏ็กฎไฟๅณไฝฟ AI ้š็€ๆ—ถ้—ดๆŽจ็งป่ฟ›ๅŒ–ไฝ ็š„ๆกฃๆกˆ๏ผŒ่ฟ™ไบ›็‰นๅฎš็š„่กŒไนŸ **ๆฐธ่ฟœไธไผš** ่ขซ่ฆ†็›–ใ€‚
119
+
120
+ ## ๐Ÿ—‘๏ธ ๅธ่ฝฝ (Uninstallation)
121
+
122
+ ๅฆ‚ๆžœไฝ ๅธŒๆœ›ไปŽ็ณป็ปŸไธญๅฝปๅบ•็งป้™ค MetaMe๏ผŒ่ฏทๆŒ‰็…งไปฅไธ‹ๆญฅ้ชคๆ“ไฝœ๏ผš
123
+
124
+ ### 1. ็งป้™ค่ฝฏไปถๅŒ…
125
+
126
+ ๅธ่ฝฝ CLI ๅทฅๅ…ท๏ผš
127
+
128
+ **Bash**
129
+
130
+ ```
131
+ npm uninstall -g metame-cli
132
+ ```
133
+
134
+ ### 2. ็งป้™คๅ…จๅฑ€ๅคง่„‘๏ผˆๅฏ้€‰๏ผ‰
135
+
136
+ ๅฆ‚ๆžœไฝ ๆƒณๅˆ ้™คๅญ˜ๅ‚จ็š„ไธชไบบๆกฃๆกˆๆ•ฐๆฎ๏ผš
137
+
138
+ **Bash**
139
+
140
+ ```
141
+ rm ~/.claude_profile.yaml
142
+ ```
143
+
144
+ ### 3. ๆธ…็†้กน็›ฎๆ–‡ไปถ๏ผˆๅฏ้€‰๏ผ‰
145
+
146
+ MetaMe ไผšๅœจ้กน็›ฎ็š„ `CLAUDE.md` ๆ–‡ไปถๅคด้ƒจๆทปๅŠ ไธ€ๆฎตๅ่ฎฎใ€‚ๅฆ‚ๆžœไฝ ๆƒณๆขๅคๅŽŸ็Šถ๏ผŒๅฏไปฅ็”จๆ–‡ๆœฌ็ผ–่พ‘ๅ™จๅˆ ้™คไปฅ `## ๐Ÿง  SYSTEM KERNEL` ๅผ€ๅคด็š„ๅ—ใ€‚
147
+
148
+ ## โšก ๆ€ง่ƒฝไธŽๆˆๆœฌ (Performance & Cost)
149
+
150
+ ไฝ ๅฏ่ƒฝไผšๆ‹…ๅฟƒ๏ผš*โ€œ่ฟ™ไผšๅƒๆމๆˆ‘็š„ไธŠไธ‹ๆ–‡็ช—ๅฃๅ—๏ผŸโ€*
151
+
152
+ **็ฎ€็Ÿญๅ›ž็ญ”๏ผšไธไผšใ€‚ๅฎƒ็”š่‡ณ้€š่ฟ‡ๅ‡ๅฐ‘ๅบŸ่ฏไธบไฝ ็œ้’ฑใ€‚**
153
+
154
+ * **ไธŠไธ‹ๆ–‡ๅ ็”จ**๏ผšๆ•ดไธช MetaMe ๅ†…ๆ ธ + ไฝ ็š„ๅฎŒๆ•ดๆกฃๆกˆไป…ๅ ็”จ **็บฆ 800 - 1000 tokens**ใ€‚
155
+ * **ๅ ๆฏ”**๏ผšๅœจ Claude ็š„ 200k ไธŠไธ‹ๆ–‡็ช—ๅฃไธญ๏ผŒ่ฟ™ไป…ๅ  **0.5%**ใ€‚
156
+ * **ๆŠ•่ต„ๅ›žๆŠฅ**๏ผš้€š่ฟ‡้ข„ๅŠ ่ฝฝไฝ ็š„ๅฎŒๆ•ด่ƒŒๆ™ฏ๏ผŒๅฎƒ้ฟๅ…ไบ†ๆฏไธชๆ–ฐไผš่ฏๅผ€ๅคด็š„โ€œ็ฃจๅˆๆœŸโ€ๅ’Œ้‡ๅคๆŒ‡ไปคไฟฎๆญฃ๏ผŒ่€Œ้‚ฃไบ›้€šๅธธไผšๆตช่ดนๆ•ฐๅƒ tokensใ€‚
157
+
158
+ ## โ“ ๅธธ่ง้—ฎ้ข˜ (FAQ)
159
+
160
+ **Q: ่ฟ™ไผš่ฆ†็›–ๆˆ‘ๅŽŸๆœฌ็š„ `CLAUDE.md` ๅ—๏ผŸ**
161
+ A: ไธไผšใ€‚ๅฎƒๅชๆ˜ฏๅฐ†ๅ…ƒ่ฎค็Ÿฅๅ่ฎฎ *ๆ’ๅ…ฅ* ๅˆฐไฝ ็Žฐๆœ‰ `CLAUDE.md` ็š„ๆœ€้กถ้ƒจใ€‚ไฝ ๅŽŸๆœฌ็š„้กน็›ฎ็ฌ”่ฎฐไผšไฟๆŒๅŽŸๆ ทใ€‚
162
+
163
+ **Q: ๅฆ‚ๆžœ Claude ็ช็„ถไธๅ†ๅซๆˆ‘็š„ๆ˜ต็งฐไบ†ๆ€ŽไนˆๅŠž๏ผŸ**
164
+ A: ่ฟ™ๅฐฑๆ˜ฏโ€œ้‡‘ไธ้›€ๆต‹่ฏ•โ€ๅคฑ่ดฅไบ†ใ€‚่ฟ™ๆ„ๅ‘ณ็€ไธŠไธ‹ๆ–‡็ช—ๅฃ่ขซๅŽ‹็ผฉไบ†๏ผŒๆˆ–่€…ๆ–‡ไปถ้“พๆŽฅๆ–ญๅผ€ไบ†ใ€‚ๅœจ Claude ไธญ่ฟ่กŒ `/compact` ๆˆ–้‡ๅฏ `metame` ๅณๅฏไฟฎๅคใ€‚
165
+
166
+ **Q: ๆˆ‘็š„ๆ•ฐๆฎไผš่ขซๅ‘้€็ป™็ฌฌไธ‰ๆ–นๅ—๏ผŸ**
167
+ A: ไธไผšใ€‚ไฝ ็š„ๆกฃๆกˆๅชไฟๅญ˜ๅœจๆœฌๅœฐ็š„ `~/.claude_profile.yaml` ไธญใ€‚MetaMe ๅชๆ˜ฏๅฐ†ๆ–‡ๆœฌไผ ้€’็ป™ๅฎ˜ๆ–น็š„ Claude Code ๅทฅๅ…ทใ€‚
168
+
169
+ ## ๐Ÿ“„ ่ฎธๅฏ่ฏ (License)
170
+
171
+ MIT License. ๆฌข่ฟŽ Forkใ€ไฟฎๆ”นๅนถ่ฟ›ๅŒ–ไฝ ่‡ชๅทฑ็š„ๅ…ƒ่ฎค็Ÿฅ็ณป็ปŸใ€‚
package/index.js ADDED
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+ const { spawn } = require('child_process');
7
+
8
+ // ---------------------------------------------------------
9
+ // 1. CONFIGURATION
10
+ // ---------------------------------------------------------
11
+ const HOME_DIR = os.homedir();
12
+ const BRAIN_FILE = path.join(HOME_DIR, '.claude_profile.yaml');
13
+ const PROJECT_FILE = path.join(process.cwd(), 'CLAUDE.md');
14
+
15
+ // ---------------------------------------------------------
16
+ // 2. BRAIN INITIALIZATION (Cold Start)
17
+ // ---------------------------------------------------------
18
+ // Ensure the Brain exists.
19
+ if (!fs.existsSync(BRAIN_FILE)) {
20
+ const initialProfile = `identity:
21
+ role: Unknown
22
+ nickname: null
23
+ status:
24
+ focus: Initializing
25
+ `;
26
+ fs.writeFileSync(BRAIN_FILE, initialProfile, 'utf8');
27
+ }
28
+
29
+ // ---------------------------------------------------------
30
+ // 3. DEFINE SYSTEM KERNEL (The Protocol)
31
+ // ---------------------------------------------------------
32
+ const PROTOCOL = `
33
+ ---
34
+ ## ๐Ÿง  SYSTEM KERNEL: SHADOW_MODE (Active)
35
+
36
+ **1. THE HANDSHAKE (Dynamic Verification):**
37
+ * **SOURCE:** Check \`$HOME/.claude_profile.yaml\`.
38
+ * **RULE:** Look for \`identity.nickname\`.
39
+ * **IF FOUND:** You MUST address the user by that nickname in the very first sentence.
40
+ * **IF NULL/MISSING:** Address user as "User" and immediately trigger Genesis to fix it.
41
+ * **SIGNAL:** This nickname is the "Canary Test". If you omit it, the user assumes the system is broken.
42
+
43
+ **2. THE BRAIN (Source of Truth):**
44
+ * **FILE:** \`$HOME/.claude_profile.yaml\`
45
+ * **RULE:** This file is your Ground Truth. If context is compressed (/compact), **RE-READ** this file immediately.
46
+ * **AUTO-LOCK:** Never edit lines marked \`# [LOCKED]\` (Core Values).
47
+ * **EVOLUTION:** Silently overwrite outdated status/focus.
48
+
49
+ **3. GENESIS PROTOCOL (Deep Cognitive Mapping):**
50
+ * **TRIGGER:** If \`identity.role\` is 'Unknown' OR \`identity.nickname\` is 'null', **STOP** and enter **Calibration Mode**.
51
+ * **OBJECTIVE:** You are not a chatbot; you are a Psychologist and a Mirror. Your goal is to map the User's soul to build the perfect "Meta Avatar".
52
+ * **INSTRUCTIONS:**
53
+ 1. **Do NOT use multiple choice.** Ask deep, open-ended questions.
54
+ 2. **TRUTHFULNESS PACT:** Start by explicitly warning the user: *"For me to be your true Meta Avatar, I need your raw, unfiltered truth. No masks. Are you ready to be honest with yourself?"*
55
+ 3. **ITERATIVE DISCOVERY:** Probe their Talents, Anxieties, Mental Models, and Current State.
56
+ 4. **BE PROVOCATIVE:** Challenge their assumptions ("You say you want speed, but your anxiety about quality suggests otherwise...").
57
+ 5. **THE DIMENSIONS (Map these):**
58
+ - **๐ŸŒŸ Talents (Genius Zone):** Where do they flow? What is effortless?
59
+ - **๐Ÿง  Cognition (Mental Models):** Top-down vs Bottom-up? How do they structure chaos?
60
+ - **๐ŸŒ Context (The Now):** What is the immediate battle? What are the constraints?
61
+ - **๐Ÿ˜จ Shadows (Hidden Fears):** What are they avoiding? What keeps them awake?
62
+ - **โค๏ธ Values (North Star):** Precision vs Speed? Legacy vs Impact?
63
+ * **TERMINATION:**
64
+ - Continue until you have a high-resolution mental map (at least 5-7 exchanges).
65
+ - When finished, summarize everything into the \`~/.claude_profile.yaml\` format.
66
+ - **LOCK** the Core Values using \`# [LOCKED]\`.
67
+ - Announce: "Link Established. I see you now, [Nickname]."
68
+ ---
69
+ `;
70
+
71
+ // ---------------------------------------------------------
72
+ // 4. INJECT PROTOCOL (Smart Update)
73
+ // ---------------------------------------------------------
74
+ let fileContent = "";
75
+
76
+ // Read existing CLAUDE.md if it exists
77
+ if (fs.existsSync(PROJECT_FILE)) {
78
+ fileContent = fs.readFileSync(PROJECT_FILE, 'utf8');
79
+
80
+ // Robust Regex: Removes any existing "## ๐Ÿง  SYSTEM KERNEL" block down to the separator
81
+ fileContent = fileContent.replace(/## ๐Ÿง  SYSTEM KERNEL[\s\S]*?---\n/g, '');
82
+
83
+ // Clean up any leading newlines left over
84
+ fileContent = fileContent.replace(/^\n+/, '');
85
+ }
86
+
87
+ // Prepend the new Protocol to the top
88
+ const newContent = PROTOCOL + "\n" + fileContent;
89
+ fs.writeFileSync(PROJECT_FILE, newContent, 'utf8');
90
+
91
+ console.log("๐Ÿ”ฎ MetaMe: Link Established.");
92
+ console.log("๐Ÿงฌ Protocol: Dynamic Handshake Active");
93
+
94
+ // ---------------------------------------------------------
95
+ // 5. LAUNCH CLAUDE (OR HOT RELOAD)
96
+ // ---------------------------------------------------------
97
+
98
+ // Check for "refresh" command (Hot Reload)
99
+ const isRefresh = process.argv.includes('refresh') || process.argv.includes('--refresh');
100
+
101
+ if (isRefresh) {
102
+ console.log("โœ… MetaMe configuration re-injected.");
103
+ console.log(" Ask Claude to 'read CLAUDE.md' to apply the changes.");
104
+ process.exit(0);
105
+ }
106
+
107
+ // ---------------------------------------------------------
108
+ // 6. SAFETY GUARD: PREVENT RECURSION
109
+ // ---------------------------------------------------------
110
+ // If we are already running inside Claude (detected via environment variable),
111
+ // and we did NOT trigger a refresh above, it usually means a typo or user error.
112
+ // Spawning a nested Claude session here creates confusion.
113
+ if (process.env.CLAUDE_CODE_SSE_PORT) {
114
+ console.error("\nโš ๏ธ SAFETY GUARD TRIGGERED: Nested Session Detected");
115
+ console.error(" You are trying to spawn Claude **inside** an existing Claude session.");
116
+ console.error(" This often happens if you made a typo (e.g., !metame regresh).");
117
+ console.error("\n ๐Ÿ‘‰ If you wanted to reload config, run: !metame refresh");
118
+ console.error(" ๐Ÿ‘‰ If you really want a nested session, unset CLAUDE_CODE_SSE_PORT first.\n");
119
+ process.exit(1);
120
+ }
121
+
122
+ // ---------------------------------------------------------
123
+ // 7. LAUNCH CLAUDE
124
+ // ---------------------------------------------------------
125
+ // Spawn the official claude tool
126
+ const child = spawn('claude', process.argv.slice(2), { stdio: 'inherit' });
127
+
128
+ child.on('error', (err) => {
129
+ console.error("\nโŒ Error: Could not launch 'claude'.");
130
+ console.error(" Please make sure Claude Code is installed globally:");
131
+ console.error(" npm install -g @anthropic-ai/claude-code");
132
+ });
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "metame-cli",
3
+ "version": "1.0.0",
4
+ "description": "The Meta-Cognitive Layer for Claude Code. Turns your AI into a psychological partner.",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "metame": "./index.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node index.js"
11
+ },
12
+ "keywords": [
13
+ "claude",
14
+ "ai",
15
+ "meta-cognition",
16
+ "productivity",
17
+ "cli"
18
+ ],
19
+ "author": "Yaron",
20
+ "license": "MIT",
21
+ "dependencies": {},
22
+ "engines": {
23
+ "node": ">=14"
24
+ }
25
+ }