Skip to content

Commit ff7baca

Browse files
committed
🦐 Initial commit: ClawCore — a core version of OpenClaw
0 parents  commit ff7baca

27 files changed

Lines changed: 5134 additions & 0 deletions

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
node_modules/
2+
dist/
3+
*.tgz
4+
5+
# OS files
6+
.DS_Store
7+
Thumbs.db
8+
9+
# IDE
10+
.vscode/
11+
.idea/
12+
*.swp
13+
*.swo
14+
15+
# Environment
16+
.env
17+
.env.local

README.md

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
<p align="center">
2+
<img src="assets/banner.jpg" alt="ClawCore Banner" width="100%" />
3+
</p>
4+
5+
# ClawCore 🦐
6+
7+
> A core version of [OpenClaw](https://github.com/openclaw/openclaw) — an AI assistant with a soul.
8+
9+
ClawCore extracts the soul of OpenClaw into a minimal, self-contained personal AI assistant. It keeps the personality system that makes AI feel alive, while stripping away the infrastructure complexity.
10+
11+
**What makes it different:** Your AI develops its own personality, remembers things across sessions, organizes work into task folders, and periodically scans your files to proactively offer help — all without a database or cloud service.
12+
13+
## ✨ Features
14+
15+
| Feature | Description |
16+
|---------|-------------|
17+
| 🧬 **Soul System** | AI develops its own personality via `SOUL.md` — not a chatbot, a character |
18+
| 🪪 **Identity Bootstrap** | First-run "awakening" ritual where the AI discovers who it is |
19+
| 🧠 **Index-based Memory** | Simple file-based memory with `MEMORY_INDEX.md` as table of contents — no vector DB needed |
20+
| 🔧 **Skill System** | Extensible skills via `SKILL.md` files with progressive disclosure |
21+
| 📁 **User Vault** | Read-only folder for your personal files — AI can read but never modify originals |
22+
| 🛠️ **Task Workbench** | Per-task workspace folders with lifecycle management and archiving |
23+
| 💓 **Heartbeat Scan** | Periodic autonomous scans — AI proactively creates tasks when it spots something |
24+
25+
## 🚀 Quick Start
26+
27+
```bash
28+
git clone https://github.com/user/ClawCore.git
29+
cd ClawCore
30+
npm install
31+
npm run dev
32+
```
33+
34+
On first run, ClawCore will:
35+
36+
1. Ask for your LLM API key
37+
2. Start a "bootstrap" conversation to discover its identity
38+
3. Create your workspace at `~/Desktop/ClawCore/`
39+
40+
## ⚙️ Configuration
41+
42+
Edit `~/Desktop/ClawCore/config.json`:
43+
44+
```json
45+
{
46+
"llm": {
47+
"baseUrl": "https://api.openai.com/v1",
48+
"apiKey": "sk-...",
49+
"model": "gpt-4o"
50+
},
51+
"heartbeat": {
52+
"enabled": true,
53+
"intervalMinutes": 60
54+
}
55+
}
56+
```
57+
58+
### Compatible Providers
59+
60+
<details>
61+
<summary><b>OpenAI</b></summary>
62+
63+
```json
64+
{
65+
"llm": {
66+
"baseUrl": "https://api.openai.com/v1",
67+
"apiKey": "sk-...",
68+
"model": "gpt-4o"
69+
}
70+
}
71+
```
72+
</details>
73+
74+
<details>
75+
<summary><b>DeepSeek</b></summary>
76+
77+
```json
78+
{
79+
"llm": {
80+
"baseUrl": "https://api.deepseek.com/v1",
81+
"apiKey": "sk-...",
82+
"model": "deepseek-chat"
83+
}
84+
}
85+
```
86+
</details>
87+
88+
<details>
89+
<summary><b>Alibaba Qwen (通义千问)</b></summary>
90+
91+
```json
92+
{
93+
"llm": {
94+
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
95+
"apiKey": "sk-...",
96+
"model": "qwen-plus"
97+
}
98+
}
99+
```
100+
</details>
101+
102+
<details>
103+
<summary><b>Local Ollama</b></summary>
104+
105+
```json
106+
{
107+
"llm": {
108+
"baseUrl": "http://localhost:11434/v1",
109+
"apiKey": "ollama",
110+
"model": "llama3"
111+
}
112+
}
113+
```
114+
</details>
115+
116+
## 📂 Workspace Structure
117+
118+
ClawCore creates a visible workspace on your Desktop:
119+
120+
```
121+
~/Desktop/ClawCore/
122+
├── config.json # LLM and heartbeat settings
123+
├── state.json # Runtime state (last heartbeat time, etc.)
124+
125+
├── soul/ # 🧬 AI's personality
126+
│ ├── SOUL.md # Core personality & values
127+
│ ├── IDENTITY.md # Name, vibe, emoji
128+
│ └── BOOTSTRAP.md # First-run script (auto-deleted after setup)
129+
130+
├── user/ # 📁 Your files (READ-ONLY for AI)
131+
│ ├── USER_PROFILE.md # Your profile
132+
│ └── ... # PDFs, Word docs, spreadsheets, etc.
133+
134+
├── memory/ # 🧠 AI's memory
135+
│ ├── MEMORY_INDEX.md # Table of contents
136+
│ ├── preferences.md # Evergreen knowledge
137+
│ └── 2026-02-23.md # Daily journal entries
138+
139+
├── workbench/ # 🛠️ Task workspace
140+
│ ├── 2026-02-23_报告分析/
141+
│ │ ├── _TASK.md # Task metadata & status
142+
│ │ └── output.md # Work product
143+
│ ├── 🤖_2026-02-23_资料整理/ # Agent-initiated task
144+
│ └── _archive/ # Archived completed tasks
145+
146+
└── skills/ # 🔧 Skill definitions
147+
└── my-skill/
148+
└── SKILL.md
149+
```
150+
151+
### Permission Model
152+
153+
| Directory | AI Permissions | Purpose |
154+
|-----------|---------------|---------|
155+
| `soul/` | Read + Write | AI manages its own personality |
156+
| `user/` | **Read-only** | Your files — AI copies to workbench before editing |
157+
| `memory/` | Read + Write | AI's persistent memory |
158+
| `workbench/` | Read + Write | Per-task work area |
159+
| `skills/` | Read-only | Skill definitions |
160+
161+
## 🔧 Adding Skills
162+
163+
Create a folder in `~/Desktop/ClawCore/skills/` with a `SKILL.md`:
164+
165+
```markdown
166+
---
167+
name: my-skill
168+
description: "When to use: user asks about X. NOT for: Y."
169+
---
170+
171+
# My Skill
172+
173+
Detailed instructions for the AI...
174+
```
175+
176+
The AI uses **progressive disclosure** — it sees skill names and descriptions in its prompt, and loads the full `SKILL.md` content only when needed.
177+
178+
## 💓 Heartbeat
179+
180+
ClawCore includes a lightweight heartbeat mechanism inspired by OpenClaw:
181+
182+
- **Default interval:** 60 minutes
183+
- **What it does:** Scans `user/` and `workbench/` folders for changes
184+
- **Smart scheduling:** Won't interrupt active conversations — defers until idle
185+
- **Agent tasks:** Creates workbench folders prefixed with 🤖 for self-initiated work
186+
187+
## 📄 Document Support
188+
189+
ClawCore can read various file formats in the `user/` folder:
190+
191+
| Format | Library |
192+
|--------|---------|
193+
| PDF | `pdf-parse` |
194+
| Word (.docx) | `mammoth` |
195+
| Excel (.xlsx) | `xlsx` |
196+
| Markdown, JSON, CSV, TXT | Native |
197+
198+
## 🏗️ Architecture
199+
200+
```
201+
CLI (index.ts)
202+
└── Agent (agent.ts)
203+
├── System Prompt Builder ← Soul + Identity + Memory Index + Skills
204+
├── LLM Provider (OpenAI-compatible)
205+
├── Tool Executor (15 tools with permission enforcement)
206+
└── Heartbeat Runner (setInterval with busy guard)
207+
```
208+
209+
### Built-in Tools
210+
211+
| Tool | Description |
212+
|------|-------------|
213+
| `read_file` | Read files (with document parsing) |
214+
| `write_file` | Write files (memory/ and workbench/ only) |
215+
| `list_dir` | List directory contents |
216+
| `copy_to_workbench` | Copy from user/ to a task folder |
217+
| `create_task` | Create a new task folder |
218+
| `update_task_status` | Update task status |
219+
| `archive_task` | Move task to archive |
220+
| `memory_read` / `memory_write` / `memory_index` | Memory operations |
221+
| `read_skill` | Load full skill instructions |
222+
| `update_soul` / `update_identity` | Modify personality files |
223+
| `complete_bootstrap` | Finish first-run setup |
224+
| `exec` | Run shell commands |
225+
226+
## 🤝 Acknowledgments
227+
228+
ClawCore is inspired by [OpenClaw](https://github.com/openclaw/openclaw) and its vision of AI assistants with genuine personality. We extracted the soul and made it tiny.
229+
230+
## 📜 License
231+
232+
MIT

assets/banner.jpg

363 KB
Loading

0 commit comments

Comments
 (0)