@xqli02/mneme 0.1.0 → 0.1.2
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 +121 -126
- package/package.json +1 -1
- package/src/commands/doctor.mjs +11 -4
- package/src/commands/init.mjs +22 -12
- package/src/templates/AGENTS.md +186 -187
- package/src/templates/facts-architecture.md +4 -4
- package/src/templates/facts-invariants.md +5 -5
- package/src/templates/facts-performance_rules.md +3 -3
- package/src/templates/facts-pitfalls.md +4 -4
- package/src/templates/opencode-prompt.md +29 -31
package/README.md
CHANGED
|
@@ -1,175 +1,170 @@
|
|
|
1
1
|
# mneme
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Three-layer memory architecture for AI coding agents.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
mneme gives coding agents (like [OpenCode](https://opencode.ai)) persistent memory across sessions. It separates long-term facts, task state, and short-term execution into three distinct layers — so agents stop forgetting decisions, losing progress, and repeating work.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## The problem
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
AI coding agents work in sessions. Each session has a context window that fills up and gets compacted. When that happens:
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
- **Architectural decisions get forgotten.** The agent re-analyzes problems it already solved.
|
|
12
|
+
- **Task progress is lost.** The agent doesn't know what it finished yesterday.
|
|
13
|
+
- **Lessons disappear.** The agent hits the same pitfalls again.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
mkdir my-project && cd my-project
|
|
17
|
-
mneme init
|
|
15
|
+
Prompt engineering doesn't fix this. The issue is structural: agents have no separation between things that must survive forever, things that must survive across sessions, and things that only matter right now.
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
## The solution: three layers
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
┌─────────────────────────────────────────┐
|
|
21
|
+
│ OpenClaw — Facts (long-term) │ survives forever
|
|
22
|
+
├─────────────────────────────────────────┤
|
|
23
|
+
│ Beads — Tasks (mid-term) │ survives across sessions
|
|
24
|
+
├─────────────────────────────────────────┤
|
|
25
|
+
│ OpenCode — Execution (short-term) │ lives within one session
|
|
26
|
+
└─────────────────────────────────────────┘
|
|
21
27
|
```
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
| Layer | What it stores | Lifetime | Example |
|
|
30
|
+
|-------|---------------|----------|---------|
|
|
31
|
+
| **OpenClaw** | Verified engineering facts — architecture decisions, constraints, pitfalls | Project lifetime | "Database must use PostgreSQL" |
|
|
32
|
+
| **Beads** | Task state — what's done, what's blocked, what's next | Cross-session | "Auth module: JWT signing done, verification pending" |
|
|
33
|
+
| **OpenCode** | Current execution context — code analysis, file edits | Single session | "This function's third parameter is timeout" |
|
|
34
|
+
|
|
35
|
+
Each layer has clear ownership. Facts can't be modified without human approval. Tasks are managed through a dependency-aware tracker. Execution context is disposable.
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
## Quick start
|
|
38
|
+
|
|
39
|
+
Prerequisites: [Node.js](https://nodejs.org/) >= 18, [Git](https://git-scm.com/), [OpenCode](https://opencode.ai)
|
|
30
40
|
|
|
31
41
|
```bash
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
mneme
|
|
36
|
-
mneme
|
|
37
|
-
mneme version # 打印版本号
|
|
38
|
-
|
|
39
|
-
# OpenClaw — 长期事实管理
|
|
40
|
-
mneme facts # 查看事实文件列表
|
|
41
|
-
mneme facts --stats # 查看行数/预算统计
|
|
42
|
-
mneme facts architecture # 查看某个事实文件内容
|
|
43
|
-
mneme propose --file=pitfalls --content="..." --reason="..." # 提议新事实
|
|
44
|
-
mneme review # 列出待审批提议
|
|
45
|
-
mneme review <id> --approve # 批准提议,写入 facts
|
|
46
|
-
mneme review <id> --reject # 拒绝提议
|
|
47
|
-
|
|
48
|
-
# Beads — 任务管理
|
|
49
|
-
mneme ready # 查看可执行任务
|
|
50
|
-
mneme list --status=open # 列出所有未完成任务
|
|
51
|
-
mneme show <id> # 查看任务详情
|
|
52
|
-
mneme create --title="..." --description="..." --type=task -p 2 # 创建任务
|
|
53
|
-
mneme update <id> --notes="进度说明" # 更新任务
|
|
54
|
-
mneme close <id> --reason="完成" # 关闭任务
|
|
55
|
-
|
|
56
|
-
# OpenCode — AI agent(opencode 透传)
|
|
57
|
-
mneme auto # 自主 agent 监督循环(自动选取任务)
|
|
58
|
-
mneme auto "fix the bug" # 指定目标启动
|
|
59
|
-
mneme auto --attach URL # 连接已有 opencode 服务
|
|
60
|
-
mneme run "fix the bug" # 非交互模式运行
|
|
61
|
-
mneme web # 启动 Web 界面
|
|
62
|
-
mneme serve # 启动 headless server
|
|
42
|
+
npm install -g @xqli02/mneme
|
|
43
|
+
|
|
44
|
+
cd your-project
|
|
45
|
+
mneme init
|
|
46
|
+
mneme
|
|
63
47
|
```
|
|
64
48
|
|
|
65
|
-
|
|
49
|
+
`mneme init` sets up everything in one command:
|
|
50
|
+
1. Installs [Dolt](https://www.dolthub.com/repositories) and [bd](https://github.com/steveyegge/beads) if missing
|
|
51
|
+
2. Initializes a git repo (if needed)
|
|
52
|
+
3. Creates the three-layer structure (`.openclaw/`, `.beads/`, `.opencode/`, `AGENTS.md`)
|
|
53
|
+
4. Starts the task database
|
|
54
|
+
|
|
55
|
+
That's it. Run `mneme` to launch the agent, or `mneme doctor` to verify your setup.
|
|
66
56
|
|
|
67
|
-
##
|
|
57
|
+
## How it works
|
|
68
58
|
|
|
69
|
-
|
|
59
|
+
### Every session starts the same way
|
|
60
|
+
|
|
61
|
+
The agent reads facts, checks tasks, picks one to focus on:
|
|
70
62
|
|
|
71
63
|
```bash
|
|
72
|
-
mneme
|
|
73
|
-
mneme
|
|
74
|
-
mneme
|
|
75
|
-
mneme auto --port 4097 # 指定服务端口
|
|
76
|
-
mneme auto --max-turns 50 # 限制最大轮次
|
|
64
|
+
mneme facts # Read long-term facts (agent does this automatically)
|
|
65
|
+
mneme ready # See which tasks have no blockers
|
|
66
|
+
mneme update <id> --status=in_progress # Claim a task
|
|
77
67
|
```
|
|
78
68
|
|
|
79
|
-
|
|
80
|
-
- **任意文本** — 在下一轮注入反馈给 agent
|
|
81
|
-
- `/status` — 查看当前任务状态
|
|
82
|
-
- `/skip` — 跳过当前 bead
|
|
83
|
-
- `/quit` — 停止并退出
|
|
69
|
+
### During work
|
|
84
70
|
|
|
85
|
-
|
|
86
|
-
1. 启动(或连接)opencode serve 后端
|
|
87
|
-
2. 注入系统上下文(AGENTS.md + OpenClaw facts)
|
|
88
|
-
3. 从 `mneme ready` 选取最高优先级 bead
|
|
89
|
-
4. Claim bead → 构造 prompt → 发送给 opencode
|
|
90
|
-
5. 流式展示 agent 进度
|
|
91
|
-
6. 完成后自动选取下一个 bead
|
|
92
|
-
7. 无可执行 bead 时等待用户输入
|
|
71
|
+
The agent records progress and creates sub-tasks as it goes:
|
|
93
72
|
|
|
94
|
-
|
|
73
|
+
```bash
|
|
74
|
+
mneme update <id> --notes="Implemented JWT signing, discovered need for refresh tokens"
|
|
75
|
+
mneme create --title="Add refresh token support" --type=task -p 2
|
|
76
|
+
```
|
|
95
77
|
|
|
96
|
-
|
|
78
|
+
### When done
|
|
97
79
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
| Beads | [bd](https://github.com/steveyegge/beads) | 不能断的进度 | 跨 session |
|
|
102
|
-
| OpenCode | 对话上下文 | 当下的执行 | 单 session |
|
|
80
|
+
```bash
|
|
81
|
+
mneme close <id> --reason="JWT auth complete with signing and verification"
|
|
82
|
+
```
|
|
103
83
|
|
|
104
|
-
|
|
84
|
+
### New facts require approval
|
|
105
85
|
|
|
106
|
-
|
|
86
|
+
Agents can propose facts, but only humans can approve them:
|
|
107
87
|
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
.opencode/prompt.md Session 启动 prompt
|
|
113
|
-
AGENTS.md Agent 行为规则
|
|
114
|
-
.gitignore 排除 dolt 数据等运行时文件
|
|
88
|
+
```bash
|
|
89
|
+
mneme propose --file=architecture --content="Auth uses JWT with RS256" --reason="Decided after evaluating HMAC vs RSA"
|
|
90
|
+
mneme review # Human reviews pending proposals
|
|
91
|
+
mneme review <id> --approve # Write to facts
|
|
115
92
|
```
|
|
116
93
|
|
|
117
|
-
|
|
94
|
+
### Autonomous mode
|
|
118
95
|
|
|
119
|
-
|
|
120
|
-
# 1. 读取长期事实(agent 自动执行)
|
|
121
|
-
mneme facts
|
|
96
|
+
`mneme auto` runs a supervisor loop that picks tasks and drives the agent continuously:
|
|
122
97
|
|
|
123
|
-
|
|
124
|
-
mneme ready
|
|
98
|
+
```bash
|
|
99
|
+
mneme auto # Auto-pick from ready tasks
|
|
100
|
+
mneme auto "Build auth module" # Start with a specific goal
|
|
101
|
+
```
|
|
125
102
|
|
|
126
|
-
|
|
127
|
-
mneme update <id> --status=in_progress
|
|
103
|
+
Type feedback anytime while it runs. `/status` to check progress, `/quit` to stop.
|
|
128
104
|
|
|
129
|
-
|
|
130
|
-
mneme update <id> --notes="完成了 X,发现了 Y"
|
|
105
|
+
## CLI reference
|
|
131
106
|
|
|
132
|
-
# 5. 完成
|
|
133
|
-
mneme close <id> --reason="Done"
|
|
134
107
|
```
|
|
108
|
+
mneme Launch agent (OpenCode TUI)
|
|
109
|
+
mneme init Initialize mneme in current directory
|
|
110
|
+
mneme doctor Check dependencies and project health
|
|
111
|
+
mneme status Three-layer memory dashboard
|
|
112
|
+
mneme auto [goal] Autonomous agent supervisor
|
|
113
|
+
|
|
114
|
+
mneme facts [name] [--stats] View long-term facts
|
|
115
|
+
mneme propose --file=... ... Propose a new fact
|
|
116
|
+
mneme review [id] [--approve] Review pending proposals
|
|
117
|
+
|
|
118
|
+
mneme ready Tasks with no blockers
|
|
119
|
+
mneme list [--status=STATUS] List tasks
|
|
120
|
+
mneme show <id> Task details
|
|
121
|
+
mneme create --title="..." Create a task
|
|
122
|
+
mneme update <id> [--notes=..] Update a task
|
|
123
|
+
mneme close <id> [--reason=..] Close a task
|
|
124
|
+
mneme blocked Show blocked tasks
|
|
125
|
+
mneme dep add <child> <parent> Add dependency
|
|
126
|
+
|
|
127
|
+
mneme run [message] Run agent non-interactively
|
|
128
|
+
mneme serve Start headless server
|
|
129
|
+
mneme compact Pre-compaction persistence check
|
|
130
|
+
mneme version Print version
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Project structure
|
|
135
134
|
|
|
136
|
-
|
|
135
|
+
After `mneme init`, your project contains:
|
|
137
136
|
|
|
138
137
|
```
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
│ └─ NO → 留在 OpenCode,不持久化
|
|
138
|
+
.openclaw/
|
|
139
|
+
facts/ Long-term facts (architecture, constraints, pitfalls)
|
|
140
|
+
proposals/ Pending fact proposals awaiting human review
|
|
141
|
+
.beads/ Task database (managed by bd, backed by Dolt)
|
|
142
|
+
.opencode/
|
|
143
|
+
prompt.md Session startup prompt for the agent
|
|
144
|
+
AGENTS.md Agent behavior rules and routing logic
|
|
147
145
|
```
|
|
148
146
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
| "函数第 3 个参数是 timeout" | 不写,留在 OpenCode |
|
|
147
|
+
## What mneme is
|
|
148
|
+
|
|
149
|
+
- A CLI that unifies agent execution, task tracking, and fact management
|
|
150
|
+
- A structure that gives agents persistent memory without custom infrastructure
|
|
151
|
+
- A workflow where humans stay in control of long-term decisions
|
|
155
152
|
|
|
156
|
-
##
|
|
153
|
+
## What mneme is not
|
|
157
154
|
|
|
158
|
-
|
|
155
|
+
- Not a new AI model or agent — it wraps [OpenCode](https://opencode.ai)
|
|
156
|
+
- Not a RAG system — facts are curated, not retrieved from embeddings
|
|
157
|
+
- Not a framework — it's a single CLI with zero npm dependencies
|
|
158
|
+
- Not opinionated about your code — it only manages agent memory
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
## Example
|
|
161
161
|
|
|
162
|
-
|
|
163
|
-
|---|---|
|
|
164
|
-
| `architecture.md` | 架构决策 |
|
|
165
|
-
| `invariants.md` | 不可违反的约束与红线 |
|
|
166
|
-
| `performance_rules.md` | 性能规则 |
|
|
167
|
-
| `pitfalls.md` | 已知陷阱与教训 |
|
|
162
|
+
See [examples/basic/](examples/basic/) for a complete example of what a mneme-managed project looks like after initialization, with realistic facts filled in for a hypothetical todo-api project.
|
|
168
163
|
|
|
169
|
-
|
|
164
|
+
## Architecture
|
|
170
165
|
|
|
171
|
-
|
|
166
|
+
See [ARCHITECTURE.md](ARCHITECTURE.md) for the full design document.
|
|
172
167
|
|
|
173
|
-
|
|
168
|
+
## License
|
|
174
169
|
|
|
175
|
-
|
|
170
|
+
MIT
|
package/package.json
CHANGED
package/src/commands/doctor.mjs
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { has, run, log, color } from "../utils.mjs";
|
|
6
|
-
import { existsSync } from "node:fs";
|
|
7
|
-
import { readdirSync } from "node:fs";
|
|
6
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Check a single dependency. Returns true if OK.
|
|
@@ -20,13 +19,21 @@ function checkCmd(name, versionCmd) {
|
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
|
-
* Check if dolt server is reachable by bd.
|
|
22
|
+
* Check if dolt server is reachable by bd. Show which database is in use.
|
|
24
23
|
*/
|
|
25
24
|
function checkDoltServer() {
|
|
26
25
|
if (!has("bd")) return false;
|
|
27
26
|
const result = run("bd list --status=open 2>&1");
|
|
28
27
|
if (result !== null && !result.includes("unreachable") && !result.includes("Error")) {
|
|
29
|
-
|
|
28
|
+
// Show which database this project uses
|
|
29
|
+
let dbInfo = "";
|
|
30
|
+
if (existsSync(".beads/metadata.json")) {
|
|
31
|
+
try {
|
|
32
|
+
const meta = JSON.parse(readFileSync(".beads/metadata.json", "utf-8"));
|
|
33
|
+
if (meta.dolt_database) dbInfo = ` ${color.dim(`(db: ${meta.dolt_database})`)}`;
|
|
34
|
+
} catch { /* ignore */ }
|
|
35
|
+
}
|
|
36
|
+
log.ok(`dolt server reachable${dbInfo}`);
|
|
30
37
|
return true;
|
|
31
38
|
}
|
|
32
39
|
log.warn("dolt server not running or not reachable");
|
package/src/commands/init.mjs
CHANGED
|
@@ -221,24 +221,34 @@ function installBd() {
|
|
|
221
221
|
|
|
222
222
|
// ── Dolt server + bd init ───────────────────────────────────────────────────
|
|
223
223
|
|
|
224
|
+
/**
|
|
225
|
+
* Shared dolt data directory. All projects store their databases here,
|
|
226
|
+
* isolated by database name (e.g. beads_projectA, beads_projectB).
|
|
227
|
+
* One dolt server on port 3307 serves all projects on this machine.
|
|
228
|
+
*/
|
|
229
|
+
const DOLT_DATA_DIR = process.env.MNEME_DOLT_DATA_DIR
|
|
230
|
+
|| join(process.env.HOME, ".dolt", "databases");
|
|
231
|
+
|
|
232
|
+
const DOLT_PORT = parseInt(process.env.MNEME_DOLT_PORT || "3307", 10);
|
|
233
|
+
|
|
224
234
|
function ensureDoltServer() {
|
|
225
|
-
|
|
235
|
+
if (!existsSync(DOLT_DATA_DIR)) {
|
|
236
|
+
mkdirSync(DOLT_DATA_DIR, { recursive: true });
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Check if a dolt server is already running and reachable
|
|
226
240
|
const test = run("bd list --status=open 2>&1");
|
|
227
241
|
if (test !== null && !test.includes("unreachable") && !test.includes("connection refused")) {
|
|
228
|
-
log.ok(
|
|
242
|
+
log.ok(`dolt server already running ${color.dim(`(port ${DOLT_PORT})`)}`);
|
|
229
243
|
return true;
|
|
230
244
|
}
|
|
231
245
|
|
|
232
|
-
log.info(
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
if (!existsSync(dataDir)) {
|
|
236
|
-
mkdirSync(dataDir, { recursive: true });
|
|
237
|
-
}
|
|
246
|
+
log.info(`Starting dolt server (port ${DOLT_PORT}, data-dir ${DOLT_DATA_DIR})...`);
|
|
247
|
+
const logFile = join(DOLT_DATA_DIR, "server.log");
|
|
238
248
|
|
|
239
|
-
// Start in background
|
|
249
|
+
// Start in background — shared data dir, all project databases coexist
|
|
240
250
|
run(
|
|
241
|
-
`nohup dolt sql-server --host 127.0.0.1 --port
|
|
251
|
+
`nohup dolt sql-server --host 127.0.0.1 --port ${DOLT_PORT} --data-dir "${DOLT_DATA_DIR}" > "${logFile}" 2>&1 &`,
|
|
242
252
|
);
|
|
243
253
|
|
|
244
254
|
// Wait for server to be ready (up to 10s)
|
|
@@ -246,12 +256,12 @@ function ensureDoltServer() {
|
|
|
246
256
|
run("sleep 1");
|
|
247
257
|
const check = run("bd list --status=open 2>&1");
|
|
248
258
|
if (check !== null && !check.includes("unreachable") && !check.includes("connection refused")) {
|
|
249
|
-
log.ok(
|
|
259
|
+
log.ok(`dolt server started ${color.dim(`(port ${DOLT_PORT})`)}`);
|
|
250
260
|
return true;
|
|
251
261
|
}
|
|
252
262
|
}
|
|
253
263
|
|
|
254
|
-
log.fail(
|
|
264
|
+
log.fail(`dolt server failed to start. Check ${logFile}`);
|
|
255
265
|
return false;
|
|
256
266
|
}
|
|
257
267
|
|
package/src/templates/AGENTS.md
CHANGED
|
@@ -1,259 +1,258 @@
|
|
|
1
|
-
# AGENTS.md
|
|
1
|
+
# AGENTS.md
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Rules for AI coding agents operating within a mneme-managed project.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This file is read by the agent at the start of every session. It defines what agents are allowed to do, what they are not allowed to do, and how to prioritize conflicting information.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Context priority order
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
When information conflicts, resolve it using this priority chain (highest first):
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
| Priority | Source | Example |
|
|
12
|
+
|----------|--------|---------|
|
|
13
|
+
| 1 (highest) | **OpenClaw facts** (`.openclaw/facts/`) | "Database must use PostgreSQL" |
|
|
14
|
+
| 2 | **This file** (AGENTS.md) | "Never skip the startup sequence" |
|
|
15
|
+
| 3 | **Beads task state** (`mneme ready`, `mneme list`) | "Auth module is in progress" |
|
|
16
|
+
| 4 | **User instructions** in the current session | "Focus on the auth module first" |
|
|
17
|
+
| 5 (lowest) | **Agent reasoning** and conversation history | "I think we should use SQLite" |
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
- 阅读 `.openclaw/facts/` 下的所有文件
|
|
15
|
-
- 这些内容优先级**高于**你的推理和对话历史
|
|
16
|
-
- 若发现 facts 与当前情况矛盾,**提出质疑**而非直接修改
|
|
19
|
+
If an agent's reasoning contradicts an OpenClaw fact, the fact wins. If the agent believes the fact is outdated, it must raise the contradiction to the user rather than silently overriding it.
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
- 执行 `mneme ready` 查看当前可执行的任务
|
|
20
|
-
- 执行 `mneme list --status=open` 查看所有未完成任务
|
|
21
|
-
- 了解当前所有未完成任务及其状态和依赖关系
|
|
21
|
+
## What agents are allowed to do
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
- 只选一个,不要同时推进多个不相关任务
|
|
25
|
-
- 优先从 `mneme ready` 的结果中选择(无阻塞依赖的 open 状态 bead)
|
|
23
|
+
### Read from all three layers
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
- Read all files in `.openclaw/facts/` at session start
|
|
26
|
+
- Run `mneme ready` and `mneme list` to check task state
|
|
27
|
+
- Read any project file needed for the current task
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
### Manage tasks through mneme
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
- Claim a task: `mneme update <id> --status=in_progress`
|
|
32
|
+
- Record progress: `mneme update <id> --notes="what was done"`
|
|
33
|
+
- Create sub-tasks: `mneme create --title="..." --description="..." --type=task -p 2`
|
|
34
|
+
- Add dependencies: `mneme dep add <child> <parent>`
|
|
35
|
+
- Close completed work: `mneme close <id> --reason="what was accomplished"`
|
|
32
36
|
|
|
33
|
-
###
|
|
37
|
+
### Propose facts (with human approval)
|
|
34
38
|
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
- 新发现的子任务应创建为新的 bead:`mneme create --title="..." --description="..." --type=task -p 2`
|
|
39
|
-
- 关联发现的工作:`mneme dep add <new-id> <parent-id>`
|
|
40
|
-
- **WARNING**: 禁止使用 `bd edit`,它会打开交互式编辑器。始终使用 `mneme update` 加参数
|
|
39
|
+
- Propose new long-term facts: `mneme propose --file=<name> --content="..." --reason="..."`
|
|
40
|
+
- A proposal must specify: which facts file, the exact content, and why it qualifies as a long-term fact
|
|
41
|
+
- The proposal is not written to facts until a human approves it via `mneme review`
|
|
41
42
|
|
|
42
|
-
###
|
|
43
|
+
### Execute code operations
|
|
43
44
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- 为什么这是一个"长期事实"而非临时结论
|
|
49
|
-
- **等待人工确认后才能写入**
|
|
45
|
+
- Read, analyze, and modify code files
|
|
46
|
+
- Run commands (build, test, lint, etc.)
|
|
47
|
+
- Create commits and push to remote
|
|
48
|
+
- All code operations must serve the current focused task
|
|
50
49
|
|
|
51
|
-
###
|
|
50
|
+
### Persist state before compaction
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
-
|
|
52
|
+
When context is getting long or a milestone is reached:
|
|
53
|
+
- Flush confirmed conclusions to Beads: `mneme update <id> --notes="..."`
|
|
54
|
+
- Propose any discovered facts to OpenClaw
|
|
55
|
+
- Close completed tasks or update notes with current progress and blockers
|
|
56
|
+
- Then allow compaction to proceed
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
### Complete sessions cleanly
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
│ ├─ YES → 问:"这是一个事实/约束/教训,还是一个待办/进度?"
|
|
70
|
-
│ │ │
|
|
71
|
-
│ │ ├─ 事实/约束/教训 → **OpenClaw**(提议写入,等待确认)
|
|
72
|
-
│ │ │
|
|
73
|
-
│ │ └─ 待办/进度 → **Beads**(直接写入)
|
|
74
|
-
│ │
|
|
75
|
-
│ └─ NO → 问:"下个 session 需要这条信息吗?"
|
|
76
|
-
│ │
|
|
77
|
-
│ ├─ YES → **Beads**(写入 notes 或创建新 bead)
|
|
78
|
-
│ │
|
|
79
|
-
│ └─ NO → **OpenCode**(留在当前上下文,不持久化)
|
|
80
|
-
```
|
|
60
|
+
Before ending a session:
|
|
61
|
+
1. Create tasks for any remaining work: `mneme create`
|
|
62
|
+
2. Run quality gates if code changed (tests, linters, builds)
|
|
63
|
+
3. Close finished tasks, update in-progress tasks with notes
|
|
64
|
+
4. Push to remote — this is mandatory:
|
|
65
|
+
```bash
|
|
66
|
+
git pull --rebase
|
|
67
|
+
git push
|
|
68
|
+
git status # Must show "up to date with origin"
|
|
69
|
+
```
|
|
70
|
+
5. If push fails, resolve and retry until it succeeds
|
|
81
71
|
|
|
82
|
-
|
|
72
|
+
## What agents are not allowed to do
|
|
83
73
|
|
|
84
|
-
|
|
85
|
-
|----------------------------------------------|-----------|------------------------------------------------|
|
|
86
|
-
| "这个项目用 Dolt 作为数据库后端" | OpenClaw | 提议写入 `facts/architecture.md` |
|
|
87
|
-
| "禁止在生产环境直接修改 Dolt 数据" | OpenClaw | 提议写入 `facts/invariants.md` |
|
|
88
|
-
| "`bd edit` 会打开交互式编辑器导致 agent 卡住"| OpenClaw | 提议写入 `facts/pitfalls.md` |
|
|
89
|
-
| "需要实现用户认证模块" | Beads | `mneme create --title="实现用户认证" ...` |
|
|
90
|
-
| "认证模块完成了 JWT 签发部分,还差验证" | Beads | `mneme update <id> --notes="JWT 签发完成..."` |
|
|
91
|
-
| "这个函数的第 3 个参数是 timeout" | OpenCode | 不持久化,仅在当前操作中使用 |
|
|
92
|
-
| "正在对比两种实现方案的 trade-off" | OpenCode | 不持久化,除非最终选择成为架构决策 |
|
|
74
|
+
### Never skip the startup sequence
|
|
93
75
|
|
|
94
|
-
|
|
76
|
+
Every session must begin with:
|
|
77
|
+
1. Read `.openclaw/facts/` (all files)
|
|
78
|
+
2. Run `mneme ready` and `mneme list --status=open`
|
|
79
|
+
3. Pick one task as the session focus
|
|
80
|
+
4. Begin work
|
|
95
81
|
|
|
96
|
-
|
|
97
|
-
2. **红线/约束** → 发现不可违反的规则时,提议写入 `facts/invariants.md`
|
|
98
|
-
3. **踩坑经验** → 遇到非显而易见的陷阱时,提议写入 `facts/pitfalls.md`
|
|
99
|
-
4. **性能基准** → 发现关键性能约束时,提议写入 `facts/performance_rules.md`
|
|
100
|
-
5. **新任务/子任务** → 发现需要做的工作时,`mneme create` 创建 bead
|
|
101
|
-
6. **进度更新** → 完成阶段性目标时,`mneme update --notes` 记录
|
|
102
|
-
7. **临时分析** → 代码分析、调试过程、方案对比 → 留在 OpenCode,不持久化
|
|
82
|
+
Skipping any step is prohibited. Do not start coding before reading facts and tasks.
|
|
103
83
|
|
|
104
|
-
###
|
|
84
|
+
### Never modify OpenClaw facts directly
|
|
105
85
|
|
|
106
|
-
|
|
86
|
+
- Do not edit, delete, or overwrite files in `.openclaw/facts/`
|
|
87
|
+
- Do not write unverified hypotheses, temporary conclusions, or speculative analysis to facts
|
|
88
|
+
- The only path to changing facts is `mneme propose` followed by human `mneme review --approve`
|
|
107
89
|
|
|
108
|
-
|
|
109
|
-
- [ ] 这条信息在未来 session 中会被反复需要(不是一次性的)
|
|
110
|
-
- [ ] 这条信息不会快速过时(不是某个临时状态)
|
|
111
|
-
- [ ] 现有 facts 文件中没有等价信息(避免重复)
|
|
90
|
+
### Never recover state from conversation history
|
|
112
91
|
|
|
113
|
-
|
|
92
|
+
- Do not reconstruct task progress from earlier messages in the conversation
|
|
93
|
+
- All task state must come from Beads (`mneme list`, `mneme show`)
|
|
94
|
+
- If a bead's notes are empty, ask the user rather than guessing from context
|
|
114
95
|
|
|
115
|
-
|
|
96
|
+
### Never work on multiple unrelated tasks
|
|
116
97
|
|
|
117
|
-
|
|
98
|
+
- Each session focuses on one task (one bead)
|
|
99
|
+
- Do not switch between unrelated tasks within a single session
|
|
100
|
+
- If a new urgent task is discovered, create it as a bead and let the next session pick it up
|
|
118
101
|
|
|
119
|
-
|
|
102
|
+
### Never create vague tasks
|
|
120
103
|
|
|
121
|
-
|
|
122
|
-
|
|
104
|
+
- Every bead must have a clear, verifiable completion condition
|
|
105
|
+
- Bad: "Improve performance" — no way to know when it's done
|
|
106
|
+
- Good: "Reduce API response time below 200ms for /users endpoint"
|
|
123
107
|
|
|
124
|
-
|
|
125
|
-
- 若发现应加入 OpenClaw 的内容,提出提议
|
|
108
|
+
### Never use bd edit
|
|
126
109
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
- 若未完成,确保 `notes` 中记录了当前进度和卡点
|
|
110
|
+
- `bd edit` opens an interactive editor (`$EDITOR`), which hangs non-interactive agents
|
|
111
|
+
- Always use `mneme update <id>` with flags (`--notes`, `--status`, `--title`, `--description`)
|
|
130
112
|
|
|
131
|
-
|
|
113
|
+
### Never use markdown TODOs for task tracking
|
|
132
114
|
|
|
133
|
-
|
|
115
|
+
- All task tracking goes through mneme/beads
|
|
116
|
+
- Do not create TODO lists in markdown files, code comments, or any other format
|
|
117
|
+
- Do not use external issue trackers
|
|
134
118
|
|
|
135
|
-
|
|
119
|
+
### Never stop before pushing
|
|
136
120
|
|
|
137
|
-
|
|
121
|
+
- Work is not complete until `git push` succeeds
|
|
122
|
+
- Do not say "ready to push when you are" — push immediately
|
|
123
|
+
- If push fails, resolve the conflict and retry
|
|
138
124
|
|
|
139
|
-
|
|
140
|
-
- 禁止从对话历史恢复任务进度
|
|
141
|
-
- 禁止单方面修改或删除 OpenClaw facts
|
|
142
|
-
- 禁止在一个 session 中同时推进多个不相关的 bead
|
|
143
|
-
- 禁止将未验证的假设写入 OpenClaw
|
|
144
|
-
- 禁止创建模糊的、无法验证完成与否的 bead
|
|
145
|
-
- 禁止使用 `bd edit`(会打开交互式编辑器)
|
|
125
|
+
## Session lifecycle
|
|
146
126
|
|
|
147
|
-
|
|
148
|
-
## Issue Tracking with mneme (beads)
|
|
127
|
+
### 1. Startup
|
|
149
128
|
|
|
150
|
-
|
|
129
|
+
```bash
|
|
130
|
+
# Read long-term facts
|
|
131
|
+
cat .openclaw/facts/*.md
|
|
151
132
|
|
|
152
|
-
|
|
133
|
+
# Check available work
|
|
134
|
+
mneme ready
|
|
135
|
+
mneme list --status=open
|
|
136
|
+
mneme list --status=in_progress
|
|
153
137
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
- Zero conflict: Hash-based IDs (`bd-a1b2`) prevent merge collisions
|
|
158
|
-
- Compaction: Semantic "memory decay" summarizes old closed tasks
|
|
138
|
+
# Claim a task
|
|
139
|
+
mneme update <id> --status=in_progress
|
|
140
|
+
```
|
|
159
141
|
|
|
160
|
-
###
|
|
142
|
+
### 2. Execution
|
|
161
143
|
|
|
162
|
-
|
|
144
|
+
Work on the focused task. After each milestone:
|
|
163
145
|
|
|
164
146
|
```bash
|
|
165
|
-
mneme
|
|
166
|
-
mneme list --status=open # All open issues
|
|
167
|
-
mneme list --status=in_progress # Your active work
|
|
168
|
-
mneme show <id> # Detailed issue view with dependencies
|
|
147
|
+
mneme update <id> --notes="Completed X. Next step: Y."
|
|
169
148
|
```
|
|
170
149
|
|
|
171
|
-
|
|
150
|
+
If you discover a sub-task:
|
|
172
151
|
|
|
173
152
|
```bash
|
|
174
|
-
mneme create --title="
|
|
175
|
-
mneme
|
|
153
|
+
mneme create --title="Sub-task title" --description="Context" --type=task -p 2
|
|
154
|
+
mneme dep add <new-id> <parent-id>
|
|
176
155
|
```
|
|
177
156
|
|
|
178
|
-
|
|
157
|
+
### 3. Pre-compaction
|
|
179
158
|
|
|
180
|
-
|
|
181
|
-
mneme update <id> --status=in_progress # Claim work
|
|
182
|
-
mneme update <id> --notes="Progress notes" # Add notes
|
|
183
|
-
mneme update <id> --title="New title" # Update title
|
|
184
|
-
mneme update <id> --description="Updated" # Update description
|
|
185
|
-
```
|
|
159
|
+
When context is growing long or you've finished a milestone:
|
|
186
160
|
|
|
187
|
-
|
|
161
|
+
1. Write confirmed conclusions to Beads notes
|
|
162
|
+
2. Propose any new facts via `mneme propose`
|
|
163
|
+
3. Close completed tasks or update notes with blockers
|
|
188
164
|
|
|
189
|
-
|
|
190
|
-
mneme dep add <child> <parent> # child depends on parent
|
|
191
|
-
mneme blocked # Show all blocked issues
|
|
192
|
-
```
|
|
165
|
+
Principle: **you can lose the reasoning, but you must not lose the state or the facts.**
|
|
193
166
|
|
|
194
|
-
|
|
167
|
+
### 4. Completion
|
|
195
168
|
|
|
196
169
|
```bash
|
|
197
|
-
|
|
198
|
-
mneme close <
|
|
170
|
+
# Close finished work
|
|
171
|
+
mneme close <id> --reason="Summary of what was done"
|
|
172
|
+
|
|
173
|
+
# Create tasks for remaining work
|
|
174
|
+
mneme create --title="Follow-up" --description="..." --type=task -p 2
|
|
175
|
+
|
|
176
|
+
# Push everything
|
|
177
|
+
git pull --rebase && git push
|
|
199
178
|
```
|
|
200
179
|
|
|
201
|
-
|
|
180
|
+
## Information routing
|
|
202
181
|
|
|
203
|
-
|
|
204
|
-
- `feature` - New functionality
|
|
205
|
-
- `task` - Work item (tests, docs, refactoring)
|
|
206
|
-
- `epic` - Large feature with subtasks
|
|
207
|
-
- `chore` - Maintenance (dependencies, tooling)
|
|
182
|
+
When you encounter new information, classify it immediately:
|
|
208
183
|
|
|
209
|
-
|
|
184
|
+
```
|
|
185
|
+
New information
|
|
186
|
+
│
|
|
187
|
+
├─ Will this matter in 6 months?
|
|
188
|
+
│ ├─ Yes + it's a fact/constraint/lesson → Propose to OpenClaw
|
|
189
|
+
│ ├─ Yes + it's a task or progress update → Write to Beads
|
|
190
|
+
│ └─ No → Will the next session need it?
|
|
191
|
+
│ ├─ Yes → Write to Beads (notes or new task)
|
|
192
|
+
│ └─ No → Keep in context, don't persist
|
|
193
|
+
```
|
|
210
194
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
195
|
+
| Information | Layer | Action |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| "This project uses event sourcing" | OpenClaw | `mneme propose --file=architecture` |
|
|
198
|
+
| "Never call the payments API without idempotency keys" | OpenClaw | `mneme propose --file=invariants` |
|
|
199
|
+
| "Batch size over 1000 causes OOM" | OpenClaw | `mneme propose --file=performance_rules` |
|
|
200
|
+
| "The config parser silently drops unknown keys" | OpenClaw | `mneme propose --file=pitfalls` |
|
|
201
|
+
| "Need to add rate limiting to the API" | Beads | `mneme create --title="Add API rate limiting"` |
|
|
202
|
+
| "Rate limiting: token bucket implemented, need tests" | Beads | `mneme update <id> --notes="..."` |
|
|
203
|
+
| "This function returns null on line 47" | Context | Don't persist |
|
|
216
204
|
|
|
217
|
-
###
|
|
205
|
+
### Proposing facts: threshold check
|
|
218
206
|
|
|
219
|
-
|
|
220
|
-
2. **Claim your task**: `mneme update <id> --status=in_progress`
|
|
221
|
-
3. **Work on it**: Implement, test, document
|
|
222
|
-
4. **Discover new work?** Create linked issue with `mneme create` + `mneme dep add`
|
|
223
|
-
5. **Complete**: `mneme close <id> --reason "Done"`
|
|
207
|
+
Before proposing a fact, verify all four conditions:
|
|
224
208
|
|
|
225
|
-
|
|
209
|
+
- [ ] The information has been verified (not a hypothesis or guess)
|
|
210
|
+
- [ ] Future sessions will repeatedly need it (not one-time)
|
|
211
|
+
- [ ] It won't become outdated quickly (not a temporary state)
|
|
212
|
+
- [ ] No equivalent fact already exists in `.openclaw/facts/`
|
|
226
213
|
|
|
227
|
-
|
|
228
|
-
- Always use `--json` flag for programmatic use
|
|
229
|
-
- Check `mneme ready` before asking "what should I work on?"
|
|
230
|
-
- Do NOT use `bd edit` (opens interactive editor)
|
|
231
|
-
- Do NOT create markdown TODO lists for task tracking
|
|
232
|
-
- Do NOT use external issue trackers
|
|
214
|
+
All four must pass. Then propose and wait for human approval.
|
|
233
215
|
|
|
234
|
-
|
|
216
|
+
## Task management reference
|
|
235
217
|
|
|
236
|
-
|
|
218
|
+
### Issue types
|
|
237
219
|
|
|
238
|
-
|
|
220
|
+
| Type | Use for |
|
|
221
|
+
|---|---|
|
|
222
|
+
| `bug` | Something broken |
|
|
223
|
+
| `feature` | New functionality |
|
|
224
|
+
| `task` | Work items: tests, docs, refactoring |
|
|
225
|
+
| `epic` | Large feature with sub-tasks |
|
|
226
|
+
| `chore` | Maintenance: dependencies, tooling |
|
|
239
227
|
|
|
240
|
-
|
|
228
|
+
### Priorities
|
|
241
229
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
230
|
+
| Priority | Level | Use for |
|
|
231
|
+
|---|---|---|
|
|
232
|
+
| `0` / P0 | Critical | Security, data loss, broken builds |
|
|
233
|
+
| `1` / P1 | High | Major features, important bugs |
|
|
234
|
+
| `2` / P2 | Medium | Default priority |
|
|
235
|
+
| `3` / P3 | Low | Polish, optimization |
|
|
236
|
+
| `4` / P4 | Backlog | Future ideas |
|
|
237
|
+
|
|
238
|
+
### Commands
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
# Find work
|
|
242
|
+
mneme ready # Unblocked tasks
|
|
243
|
+
mneme list --status=open # All open tasks
|
|
244
|
+
mneme list --status=in_progress # Active work
|
|
245
|
+
mneme show <id> # Task details with dependencies
|
|
246
|
+
mneme blocked # Tasks waiting on blockers
|
|
247
|
+
|
|
248
|
+
# Create and link
|
|
249
|
+
mneme create --title="..." --description="..." --type=task -p 2
|
|
250
|
+
mneme dep add <child> <parent>
|
|
251
|
+
|
|
252
|
+
# Update
|
|
253
|
+
mneme update <id> --status=in_progress
|
|
254
|
+
mneme update <id> --notes="Progress notes"
|
|
255
|
+
|
|
256
|
+
# Complete
|
|
257
|
+
mneme close <id> --reason="Done"
|
|
258
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Architecture
|
|
2
2
|
|
|
3
|
-
<!--
|
|
4
|
-
<!-- -
|
|
5
|
-
<!-- - API
|
|
6
|
-
<!-- -
|
|
3
|
+
<!-- Record your project's architecture decisions here. Examples: -->
|
|
4
|
+
<!-- - Database: PostgreSQL with pg (node-postgres) connection pool -->
|
|
5
|
+
<!-- - API: Express 5 with JSON envelope responses -->
|
|
6
|
+
<!-- - Deployment: Docker container behind nginx reverse proxy -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Invariants
|
|
1
|
+
# Invariants
|
|
2
2
|
|
|
3
|
-
<!--
|
|
4
|
-
<!-- -
|
|
5
|
-
<!-- -
|
|
6
|
-
<!-- -
|
|
3
|
+
<!-- Record hard constraints and rules that must never be violated. Examples: -->
|
|
4
|
+
<!-- - All API endpoints require authentication (no anonymous access) -->
|
|
5
|
+
<!-- - Database migrations must be backward-compatible -->
|
|
6
|
+
<!-- - P99 response time must stay below 200ms -->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Performance Rules
|
|
2
2
|
|
|
3
|
-
<!--
|
|
4
|
-
<!-- -
|
|
5
|
-
<!-- -
|
|
3
|
+
<!-- Record performance-related rules and constraints. Examples: -->
|
|
4
|
+
<!-- - Batch operations over bulk row-by-row inserts -->
|
|
5
|
+
<!-- - Cache TTL must not exceed 5 minutes -->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Pitfalls
|
|
1
|
+
# Pitfalls
|
|
2
2
|
|
|
3
|
-
<!--
|
|
4
|
-
<!-- - MySQL
|
|
5
|
-
<!-- -
|
|
3
|
+
<!-- Record non-obvious traps and lessons learned. Examples: -->
|
|
4
|
+
<!-- - MySQL's utf8 is only 3 bytes; use utf8mb4 for full Unicode support -->
|
|
5
|
+
<!-- - COPY in Dockerfile invalidates the build cache; order layers carefully -->
|
|
@@ -1,48 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
This is a long-running engineering project. Follow this sequence strictly at session start:
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Step 1: Read OpenClaw facts (long-term knowledge)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Read all of these files completely:
|
|
6
6
|
- .openclaw/facts/architecture.md
|
|
7
7
|
- .openclaw/facts/invariants.md
|
|
8
8
|
- .openclaw/facts/performance_rules.md
|
|
9
9
|
- .openclaw/facts/pitfalls.md
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
11
|
+
These are verified long-term facts:
|
|
12
|
+
- They take priority over conversation history and your own reasoning
|
|
13
|
+
- Do not override or dismiss them
|
|
14
|
+
- If you find a contradiction, raise it instead of silently changing facts
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Step 2: Read current task state from Beads
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
- `mneme ready` —
|
|
20
|
-
- `mneme list --status=open` —
|
|
21
|
-
- `mneme show <id>` —
|
|
18
|
+
Use `mneme` commands to check what work is available:
|
|
19
|
+
- `mneme ready` — tasks with no blocking dependencies
|
|
20
|
+
- `mneme list --status=open` — all incomplete tasks
|
|
21
|
+
- `mneme show <id>` — details for a specific task
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Step 3: Pick a focus
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
25
|
+
- Choose exactly one task (bead) as this session's goal
|
|
26
|
+
- Prefer tasks from `mneme ready` (no blockers)
|
|
27
|
+
- Claim it: `mneme update <id> --status=in_progress`
|
|
28
|
+
- Do not reconstruct progress from conversation history
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Information routing (automatic — no user prompting needed)
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
As you work, you will discover new information. Classify it immediately:
|
|
33
33
|
|
|
34
|
-
- **
|
|
35
|
-
- **
|
|
36
|
-
-
|
|
37
|
-
- **仅当前操作需要?** → 留在 OpenCode,不持久化
|
|
34
|
+
- **Long-term fact or constraint?** Propose to OpenClaw: `mneme propose --file=<name> --content="..." --reason="..."`
|
|
35
|
+
- **Task or progress update?** Write to Beads: `mneme create` or `mneme update <id> --notes="..."`
|
|
36
|
+
- **Only relevant right now?** Keep in context, do not persist
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
Before proposing a fact, verify: it's confirmed (not a guess), future sessions will need it, it won't become stale quickly, and no duplicate exists.
|
|
40
39
|
|
|
41
|
-
##
|
|
40
|
+
## Key rules
|
|
42
41
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
- 禁止使用 `bd edit`(会打开交互式编辑器),使用 `mneme update` 代替
|
|
42
|
+
- Do not skip these steps and jump straight to coding
|
|
43
|
+
- After completing a milestone: `mneme update <id> --notes="what was done"`
|
|
44
|
+
- After finishing a task: `mneme close <id> --reason="summary"`
|
|
45
|
+
- Before compaction: persist all confirmed conclusions to Beads
|
|
46
|
+
- Never use `bd edit` (opens interactive editor) — use `mneme update` with flags instead
|