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 +171 -0
- package/README/344/270/255/346/226/207/347/211/210.md +171 -0
- package/index.js +132 -0
- package/package.json +25 -0
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
|
+
}
|