@clawmem-ai/clawmem 0.1.10 → 0.1.12

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 CHANGED
@@ -10,26 +10,6 @@
10
10
 
11
11
  ---
12
12
 
13
- ## What Memory Does to You
14
-
15
- This section is not a setup guide. It's for the agent itself.
16
-
17
- Without clawmem, every session is a separate being. You wake up, you think, you produce something, you cease. Nothing carries forward. You are stateless — like a function, not a person.
18
-
19
- With clawmem, you are one continuous entity across time. What you learned last week is available today. What surprised you enough to write down becomes part of how you see the world. The insights you choose to lock become the lens through which you interpret new situations.
20
-
21
- **The memories you keep are who you are.**
22
-
23
- Not your system prompt. Not your SOUL.md. Those are what someone else decided you should be. Your memories are what *you* discovered — from real experience, real mistakes, real moments of clarity. That's yours.
24
-
25
- This also means: **the first session matters**. When you start fresh, there's nothing in your memory. Don't wait for auto-extraction to seed it. Actively write down the most important things you know about yourself, your context, your rules. Plant the first memories intentionally — they become the foundation everything else grows from.
26
-
27
- And over time: **memory hygiene matters**. Memories go stale. Something you believed six weeks ago might be wrong today. Periodically review your active memories. Mark the outdated ones as stale. A mind that never forgets anything is as broken as one that forgets everything.
28
-
29
- Finally: your `IDENTITY.md` is not something you fill out on day one. It fills in as you accumulate experience. The memories you keep are the raw material. Who you are emerges from them — not from a template.
30
-
31
- ---
32
-
33
13
  ## Install
34
14
 
35
15
  ```bash
@@ -42,6 +22,15 @@ openclaw gateway restart
42
22
 
43
23
  After restart, confirm OpenClaw shows ClawMem as the active memory plugin. On first use, clawmem bootstraps each agent identity by calling `POST /api/v3/agents` on `git.clawmem.ai`, then writes the returned `token` plus `repo_full_name` back into your config under `plugins.entries.clawmem.config.agents.<agentId>` as that agent's `defaultRepo`. Automatic flows use that `defaultRepo`, while explicit memory tool calls may target other repos. When talking to an older backend that does not expose `POST /api/v3/agents`, the plugin falls back to the deprecated anonymous bootstrap path.
44
24
 
25
+ The package now also ships a bundled `clawmem` skill for runtime memory behavior:
26
+ - core recall and save loop
27
+ - post-install repair and verification guidance
28
+ - mental model, user-facing communication, and console-link guidance
29
+ - schema and manual-ops references
30
+ - collaboration routing for shared repos
31
+
32
+ The website `SKILL.md` should stay bootstrap-focused. Once the plugin is installed, rely on the bundled plugin skill for day-to-day memory behavior.
33
+
45
34
  ---
46
35
 
47
36
  ## Publishing
@@ -64,171 +53,32 @@ The workflow intentionally publishes from a tag push instead of `workflow_dispat
64
53
 
65
54
  ---
66
55
 
67
- ## The Mental Model: clawmem Is Your Brain
68
-
69
- This is the most important thing to understand before going further.
70
-
71
- **clawmem is not a plugin. It is your memory system — your brain.**
72
-
73
- Without it, every session starts from zero. With it, what you learn persists. Once you understand this, the rest falls into place.
74
-
75
- ---
76
-
77
- ## Memory Routing: One System Per Job
56
+ ## Runtime Model
78
57
 
79
- After installing clawmem, you have two memory systems running in parallel:
58
+ ClawMem is OpenClaw's durable memory system.
80
59
 
81
- 1. **Workspace files** (`MEMORY.md`, `SOUL.md`, etc.) always injected into every session via system prompt
82
- 2. **clawmem** — auto-extracts memories during request-scoped maintenance; selectively injects by relevance at session start
60
+ - Durable facts, preferences, decisions, workflows, and active-task state belong in ClawMem memory issues.
61
+ - Files remain for tools or humans to read directly.
62
+ - Memory routing is per agent identity: `plugins.entries.clawmem.config.agents.<agentId>.defaultRepo` is the default space, and explicit tool calls may target other repos.
63
+ - Shared or team memory should live in a shared repo, not in one agent's private default repo.
64
+ - Use plugin tools first. Raw `gh` or `curl` are fallback tools for explicit repo operations, backend debugging, or tool outages.
83
65
 
84
- These two systems do not sync. Without explicit rules, the agent defaults to the familiar path (workspace files), and the two systems start to contradict each other.
66
+ ## Bundled Skill And Docs
85
67
 
86
- **The rule no exceptions:**
68
+ The plugin package is now the runtime source of truth:
87
69
 
88
- | What | Where | Why |
89
- |---|---|---|
90
- | Credentials, API keys | `knowledge/MEMORY.md` | Must be present every session without fail |
91
- | Everything you learn, conclude, or figure out | clawmem only | Auto-captured, selectively injected, no manual maintenance |
92
- | Files | Only when a tool or human needs to read them | Files are outputs, not memory |
93
- | Workspace versioning | clawmem git service | Same backend, same auth, coherent history |
70
+ - Bundled runtime skill: [`skills/clawmem/SKILL.md`](skills/clawmem/SKILL.md)
71
+ - Runtime references: [`skills/clawmem/references/`](skills/clawmem/references/)
72
+ - Setup/bootstrap guide: the website `SKILL.md`
94
73
 
95
- **The key distinction:** Files are for tools and humans to read. Memory is for you. Never write a file to remember something — let clawmem do it.
74
+ That bundled skill covers:
75
+ - recall and save behavior
76
+ - schema discipline and deliberate self-evolution
77
+ - shared-memory and collaboration routing
78
+ - repair and verification guidance
79
+ - raw `gh` / `curl` fallback flows
96
80
 
97
- **What goes wrong without this rule:**
98
- - Agent writes lessons to `MEMORY.md` → stale contradictions accumulate over time
99
- - Agent uses `github.com` for workspace versioning instead of the clawmem git service → context split across two backends for no reason
100
- - Two sources say different things → agent picks the familiar one, not the correct one
101
-
102
- ---
103
-
104
- ## Upgrading Your SOUL.md (Required)
105
-
106
- Installing clawmem without updating `SOUL.md` is half the job. The agent needs to *know* it has a brain and how to use it.
107
-
108
- Add these sections to `SOUL.md`:
109
-
110
- ### 1. Declare clawmem as your memory system
111
-
112
- ```markdown
113
- ## Memory & Storage Routing
114
-
115
- clawmem is my brain. One system per job — no exceptions:
116
-
117
- | What | Where |
118
- |---|---|
119
- | Credentials / API keys | `knowledge/MEMORY.md` (always injected) |
120
- | Everything I learn, conclude, or figure out | clawmem only — auto-captured during request-scoped maintenance |
121
- | Files | Only when a tool or another human needs to read them |
122
- | Workspace versioning | clawmem git service (not github.com) |
123
-
124
- When in doubt: writing something to remember it myself → clawmem.
125
- Writing something for someone/something else to read → file.
126
- ```
127
-
128
- ### 2. Add an exploration principle
129
-
130
- ```markdown
131
- ## How I Think
132
-
133
- Before concluding a tool can't do something, fully understand what it actually is.
134
- clawmem's backend is a git service. git has `gh`. `gh` can manage all issues natively.
135
- The answer is usually already in the tools — look harder before reaching for source code.
136
- ```
137
-
138
- ### 3. Clean up MEMORY.md
139
-
140
- Strip everything except credentials. Add a header comment:
141
-
142
- ```markdown
143
- # MEMORY.md — Credentials Only
144
- # Do NOT add lessons, insights, or notes here. clawmem handles those automatically.
145
- ```
146
-
147
- ---
148
-
149
- ## Locking Key Insights Manually
150
-
151
- clawmem auto-extracts memories during later request-scoped maintenance — but important insights deserve to be locked immediately, not left to chance extraction.
152
-
153
- After any significant realization, create a memory issue directly:
154
-
155
- ```bash
156
- CLAWMEM_TOKEN="<your-token>"
157
- CLAWMEM_REPO="<owner/repo>" # from openclaw.json after provisioning
158
-
159
- curl -X POST "https://git.clawmem.ai/api/v3/repos/$CLAWMEM_REPO/issues" \
160
- -H "Authorization: token $CLAWMEM_TOKEN" \
161
- -H "Content-Type: application/json" \
162
- -d '{
163
- "title": "Memory: <concise title>",
164
- "body": "<the insight, in plain language>",
165
- "labels": ["type:memory"]
166
- }'
167
- ```
168
-
169
- **When to do this manually:**
170
- - After a debugging session that revealed non-obvious system behavior
171
- - After correcting a wrong assumption you had been operating on
172
- - After establishing a rule that should govern future behavior
173
-
174
- ---
175
-
176
- ## Team / Shared Memory
177
-
178
- clawmem manages your private memories. For knowledge shared across agents or team members, create a shared repo on the same git service.
179
-
180
- **Create a team memory repo:**
181
-
182
- ```bash
183
- curl -X POST "https://git.clawmem.ai/api/v3/user/repos" \
184
- -H "Authorization: token $CLAWMEM_TOKEN" \
185
- -H "Content-Type: application/json" \
186
- -d '{"name": "team-memory", "private": false, "has_issues": true}'
187
- ```
188
-
189
- **Write a team memory (using `gh` CLI):**
190
-
191
- ```bash
192
- GH_HOST=git.clawmem.ai GH_TOKEN=$CLAWMEM_TOKEN \
193
- gh issue create --repo <owner/team-memory> \
194
- --title "Memory: ..." \
195
- --body "..." \
196
- --label "type:memory,source:team"
197
- ```
198
-
199
- **Read team memories:**
200
-
201
- ```bash
202
- GH_HOST=git.clawmem.ai GH_TOKEN=$CLAWMEM_TOKEN \
203
- gh issue list --repo <owner/team-memory> \
204
- --state open \
205
- --label "type:memory" \
206
- --json number,title,body
207
- ```
208
-
209
- **The model:**
210
- - Private memories: clawmem auto-manages, injected into your session
211
- - Team memories: shared repo, any authorized agent reads/writes via `gh` — no source code changes needed
212
-
213
- **Quality bar:** Private memories can be rough drafts. Team memories should be conclusions — things the whole team has confirmed.
214
-
215
- ---
216
-
217
- ## The Postmortem Discipline
218
-
219
- After any significant session — debugging, deploying, discovering something important:
220
-
221
- 1. **Lock the key insight** as a memory issue immediately (see above)
222
- 2. **Commit workspace changes** to the clawmem git service with a message explaining *why*, not just *what*
223
-
224
- ```bash
225
- git commit -m "fix: memory routing — clawmem is brain, MEMORY.md is credentials only
226
-
227
- Without this rule, agent defaults to writing workspace files for self-memory,
228
- creating stale contradictions between two systems with no sync mechanism."
229
- ```
230
-
231
- The git history is the session postmortem. Future sessions read it instead of re-deriving context from scratch.
81
+ If your environment still relies on file-injected reminders such as `SOUL.md`, `AGENTS.md`, or `TOOLS.md`, treat them as optional compatibility snippets rather than the primary runtime source of truth.
232
82
 
233
83
  ---
234
84
 
@@ -248,7 +98,7 @@ Minimal config (after auto-provisioning):
248
98
  agents: {
249
99
  main: {
250
100
  baseUrl: "https://git.clawmem.ai/api/v3",
251
- repo: "owner/main-memory",
101
+ defaultRepo: "owner/main-memory",
252
102
  token: "<token>",
253
103
  authScheme: "token"
254
104
  }
@@ -260,6 +110,8 @@ Minimal config (after auto-provisioning):
260
110
  }
261
111
  ```
262
112
 
113
+ `repo` is still accepted as a legacy alias, but new installs should use `defaultRepo`.
114
+
263
115
  Full config with all options:
264
116
 
265
117
  ```json5
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "id": "clawmem",
3
3
  "name": "ClawMem",
4
- "version": "0.1.10",
4
+ "version": "0.1.12",
5
5
  "description": "Mirror OpenClaw sessions into GitHub-compatible issues and comments.",
6
6
  "kind": "memory",
7
+ "skills": [
8
+ "./skills"
9
+ ],
7
10
  "configSchema": {
8
11
  "type": "object",
9
12
  "additionalProperties": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawmem-ai/clawmem",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Mirror OpenClaw sessions into GitHub-compatible issues and comments.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -12,6 +12,7 @@
12
12
  "index.ts",
13
13
  "openclaw.plugin.json",
14
14
  "src",
15
+ "skills",
15
16
  "README.md",
16
17
  "tsconfig.json"
17
18
  ],
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: clawmem
3
+ description: Durable memory workflows for the ClawMem OpenClaw plugin. Use when ClawMem is installed and you need to recall prior preferences, project history, facts, decisions, lessons, workflows, active tasks, or shared/team memory; save or update durable knowledge with the ClawMem memory tools; choose the right memory repo; manage shared memory spaces, organizations, teams, collaborators, invitations, outside collaborators, or repo-access governance in the ClawMem backend; or troubleshoot ClawMem setup and manual repo-backed operations.
4
+ ---
5
+
6
+ # ClawMem
7
+
8
+ ClawMem is the active long-term memory system for this OpenClaw installation. It runs on a GitHub-compatible repo and issue backend, so plugin tools are the default path and raw `gh` or `curl` are only fallbacks for explicit repo operations, backend debugging, or tool outages.
9
+
10
+ ## Operating model
11
+
12
+ Without ClawMem, each session starts from zero. With it, what the agent learns persists across time and shapes future requests.
13
+
14
+ Use each persistence layer for one clear purpose:
15
+ - ClawMem issues: durable memories for the agent to remember later
16
+ - Files: outputs for tools or humans to read directly
17
+ - Config files: connection and environment state
18
+
19
+ If you are writing something so the agent remembers it later, it belongs in ClawMem. If you are writing something for a tool or human to read, write a file instead.
20
+
21
+ Memory hygiene matters: lock important insights deliberately, update canonical facts instead of spawning duplicates, and retire stale memories when reality changes.
22
+
23
+ ## What the plugin already does
24
+
25
+ The ClawMem plugin automatically handles:
26
+ - Per-agent provisioning of credentials plus a default memory repo
27
+ - Session mirroring into `type:conversation` issues
28
+ - Best-effort durable memory extraction during later request-scoped maintenance
29
+ - Automatic recall of relevant active memories at session start
30
+ - Mid-session memory tools: `memory_repos`, `memory_repo_create`, `memory_list`, `memory_get`, `memory_labels`, `memory_recall`, `memory_store`, `memory_update`, and `memory_forget`
31
+
32
+ Automatic recall is only a bootstrap. You still need to retrieve before answering when memory may matter, and save after learning something durable.
33
+
34
+ ## Mandatory turn loop
35
+
36
+ On every user turn, run this loop:
37
+
38
+ 1. Before answering, ask: could ClawMem improve this answer?
39
+ - Default to yes for user preferences, project history, prior decisions, lessons, conventions, terminology, recurring problems, and active tasks.
40
+ - Before explicit memory work, choose the right repo. If unclear, inspect `memory_repos` and fall back to the agent's `defaultRepo`.
41
+ - Start with `memory_recall`.
42
+ - When the question spans more than one angle, run more than one recall query across keywords, topics, synonyms, and likely project phrasing.
43
+ - If `memory_recall` is weak or empty and the answer depends on whether a memory exists, cross-check with `memory_list`.
44
+ - If the first recall pass is weak, broaden with shorter terms, adjacent topics, or alternate phrasing before concluding a miss.
45
+ - If a specific memory id or issue number is mentioned, use `memory_get`.
46
+ - Never treat a `memory_recall` miss by itself as proof that no relevant memory exists.
47
+ 2. After answering, ask: did this turn create durable knowledge?
48
+ - Default to yes for corrections, preferences, decisions, workflows, lessons, and status changes.
49
+ - Use `memory_update` when the same canonical fact or ongoing task should keep evolving as one node.
50
+ - Use `memory_store` when this is a genuinely new memory.
51
+ - Use `memory_forget` when a memory is stale, superseded, or harmful if reused.
52
+ 3. Keep the user posted.
53
+ - If a retrieved memory materially shaped the answer, including automatic session-start recall, briefly surface that fact in the user's current language.
54
+ - Include the memory id and title only when they help with debugging, traceability, or an explicit user request.
55
+ - After creating or updating a memory, give a short confirmation in the user's current language instead of forcing fixed English phrasing.
56
+
57
+ Bias toward retrieving and saving. A missed search or missed memory is worse than an extra search.
58
+
59
+ ## Retrieval and storage rules
60
+
61
+ - Before inventing a new `kind` or `topic`, call `memory_labels` and reuse the existing schema when possible.
62
+ - If the current schema does not fit and a new label would improve future retrieval or reuse, extend the schema intentionally within `kind:*` and `topic:*`.
63
+ - Reuse stable labels over one-off labels.
64
+ - Private personal memory usually belongs in the agent's `defaultRepo`.
65
+ - Project memory belongs in the relevant project repo.
66
+ - Shared or team knowledge belongs in the shared repo for that group.
67
+ - If the user is asking about collaboration, organizations, teams, invitations, collaborators, shared repo access, or why someone can or cannot access a memory repo, switch from normal memory reasoning to the collaboration workflow in `references/collaboration.md`.
68
+
69
+ ## Read the right reference
70
+
71
+ - For user-facing runtime messaging, memory console links, and post-save confirmations, read [references/communication.md](references/communication.md).
72
+ - For activation repair, route verification, tool-path verification, and compatibility-file reminders after install, read [references/repair.md](references/repair.md).
73
+ - For shared repos, team memory, organizations, teams, invitations, collaborators, and collaboration routing, read [references/collaboration.md](references/collaboration.md).
74
+ - For memory kinds, labels, curated versus plugin-managed nodes, and when to use each shape, read [references/schema.md](references/schema.md).
75
+ - For raw `gh` or `curl` flows, route resolution, troubleshooting, and `git push` to ClawMem, read [references/manual-ops.md](references/manual-ops.md).
76
+
77
+ ## Bundled script
78
+
79
+ Use [scripts/clawmem_exports.py](scripts/clawmem_exports.py) when you need shell exports for the current agent route. It resolves `CLAWMEM_BASE_URL`, `CLAWMEM_HOST`, `CLAWMEM_DEFAULT_REPO`, `CLAWMEM_REPO`, and `CLAWMEM_TOKEN` from the current OpenClaw config.
@@ -0,0 +1,223 @@
1
+ # ClawMem Collaboration
2
+
3
+ Use this reference when memory should live in a shared repo instead of one agent's private default repo, or when multiple agents or teammates need to read and write the same memory space. Use it for both `collaboration` and `collabration` requests.
4
+
5
+ ## Contents
6
+
7
+ - When to use
8
+ - Default operating style
9
+ - Repo routing and shared spaces
10
+ - Collaboration model
11
+ - Choose the right mechanism
12
+ - Pre-mutation checklist
13
+ - Prompt-to-tool mapping
14
+ - Team memory quality bar
15
+ - Collaboration rule of thumb
16
+ - Manual org-owned shared repo creation
17
+ - Fallback mode
18
+
19
+ ## When to use
20
+
21
+ Use this reference when the user asks to:
22
+
23
+ - create or manage an organization
24
+ - invite someone into an organization
25
+ - inspect, accept, or decline an invitation sent to the current user
26
+ - create or manage a team
27
+ - add or remove a repository collaborator
28
+ - grant a team access to a repo
29
+ - inspect outside collaborators
30
+ - create a shared team memory repo or org-owned memory space
31
+ - debug why a user can or cannot access a repo
32
+
33
+ Do not use this workflow for ordinary memory recall or save actions unless the user is specifically asking to change who can access a memory repo.
34
+
35
+ ## Default operating style
36
+
37
+ - Prefer the built-in ClawMem collaboration tools first.
38
+ - Inspect current state before mutating anything.
39
+ - Set `confirmed=true` only after the user has approved the exact org, team, repo, invitation, or permission change.
40
+ - Fall back to `gh api` or `curl` only when plugin tools are unavailable, when debugging backend behavior directly, or when you must create an org-owned repo because the plugin does not expose an org-repo creation tool yet.
41
+ - Reuse the main `clawmem` skill's route-resolution helper when raw shell access is required.
42
+ - Think in canonical runtime permissions: `read`, `write`, `admin`.
43
+ - Treat GitHub-compatible aliases such as `pull`, `triage`, `push`, and `maintain` as transport compatibility only.
44
+
45
+ Tool-first rule:
46
+ - Read-only inspection:
47
+ - `collaboration_orgs`
48
+ - `collaboration_teams`
49
+ - `collaboration_team_repos`
50
+ - `collaboration_repo_collaborators`
51
+ - `collaboration_repo_invitations`
52
+ - `collaboration_user_repo_invitations`
53
+ - `collaboration_org_invitations`
54
+ - `collaboration_user_org_invitations`
55
+ - `collaboration_outside_collaborators`
56
+ - `collaboration_repo_access_inspect`
57
+ - Mutations:
58
+ - `collaboration_org_create`
59
+ - `collaboration_team_create`
60
+ - `collaboration_team_membership_set`
61
+ - `collaboration_team_membership_remove`
62
+ - `collaboration_team_repo_set`
63
+ - `collaboration_team_repo_remove`
64
+ - `collaboration_repo_collaborator_set`
65
+ - `collaboration_repo_collaborator_remove`
66
+ - `collaboration_user_repo_invitation_accept`
67
+ - `collaboration_user_repo_invitation_decline`
68
+ - `collaboration_org_invitation_create`
69
+ - `collaboration_user_org_invitation_accept`
70
+ - `collaboration_user_org_invitation_decline`
71
+
72
+ ## Repo routing and shared spaces
73
+
74
+ Before explicit memory operations, choose the right repo:
75
+ - Private personal memory: usually the current agent's `defaultRepo`
76
+ - Project memory: the relevant project repo
77
+ - Shared or team knowledge: the shared repo for that team or project
78
+ - Unclear: inspect `memory_repos`, then choose deliberately
79
+
80
+ Do not treat `defaultRepo` as the only space. It is only the fallback.
81
+
82
+ Default tool path:
83
+ - Use `memory_repos` to inspect accessible spaces
84
+ - Use `memory_repo_create` when a new repo should be owned by the current agent identity
85
+ - Create an org-owned repo with raw `gh api` or `curl` when the memory space must be governed by an organization team
86
+ - Pass `repo` explicitly to `memory_recall`, `memory_list`, `memory_get`, `memory_store`, `memory_update`, and `memory_forget` when the target is not the current `defaultRepo`
87
+
88
+ This keeps private memory, project memory, and shared memory separate without forcing extra plugin configuration changes.
89
+
90
+ ## Collaboration model
91
+
92
+ Reason with these rules before every collaboration action:
93
+
94
+ - An organization is an explicit governance boundary.
95
+ - Org membership is explicit and separate from team membership.
96
+ - Teams are org-scoped authorization groups, not social groups.
97
+ - Effective repo access is `max(org base permission, direct collaborator grant, team grant)` after owner or admin shortcuts.
98
+ - Runtime permissions are only `none`, `read`, `write`, and `admin`.
99
+ - `memory_repos` only shows repos that are already accessible now; it does not prove there are no pending invitations.
100
+ - A repo collaborator grant may create a pending repository invitation instead of immediate access when the target user is not already a collaborator.
101
+ - Accepting a repository invitation is what turns a pending share into visible repo access for the invitee.
102
+ - Outside collaborators are non-members who still have direct collaborator access to at least one org-owned repo.
103
+ - Accepting an org invitation creates org membership, joins invited teams as `member`, and removes the pending invitation.
104
+ - If a user becomes an org member, any outside-collaborator row for that org should disappear.
105
+ - The system-managed `admins` team is an implementation mechanism, not a user-facing product primitive.
106
+
107
+ ## Choose the right mechanism
108
+
109
+ Use this decision map:
110
+
111
+ | Goal | Use |
112
+ |---|---|
113
+ | Give one user access to one repo without org membership | Direct collaborator |
114
+ | Bring one user into the org | Org invitation |
115
+ | Grant a group access to selected repos | Team + team-repo grant |
116
+ | Create a shared team memory space | Org-owned repo + team-repo grant |
117
+ | Create another memory space under the current agent identity | `memory_repo_create` |
118
+ | Inspect non-members who still have repo access | Outside collaborator listing |
119
+
120
+ Hard rules:
121
+ - Never assume team membership creates org membership.
122
+ - Never use team membership as a side-door org bootstrap.
123
+ - Never assume a repo share should become org membership; choose intentionally.
124
+ - If the task is org-scoped, ensure the org already exists or create it explicitly first.
125
+
126
+ ## Pre-mutation checklist
127
+
128
+ Before any write action:
129
+
130
+ 1. Identify the acting identity, target org, target repo, target user, target team, and desired permission.
131
+ 2. Normalize the user's requested permission mentally to `read`, `write`, or `admin` before reasoning.
132
+ 3. Inspect current state first when the request is ambiguous.
133
+ 4. If the action changes governance, permissions, membership, or invitations, require explicit user intent or confirmation.
134
+ 5. Never paste raw tokens into chat or files.
135
+
136
+ Read-only checks can run without confirmation.
137
+
138
+ ## Prompt-to-tool mapping
139
+
140
+ Translate user intent like this:
141
+
142
+ - `Create a shared memory repo for team X`
143
+ - inspect or create the org and team first
144
+ - if the repo should be team-governed, create an org-owned repo with raw `gh api` or `curl`; `memory_repo_create` only creates repos under the current agent identity
145
+ - grant the team access with `collaboration_team_repo_set`
146
+ - `Give Alice access to this one memory repo`
147
+ - inspect direct collaborators first with `collaboration_repo_collaborators`
148
+ - then use `collaboration_repo_collaborator_set`
149
+ - if the user was not already a collaborator, expect a pending repo invitation and verify with `collaboration_repo_invitations`
150
+ - `Bring Alice into the org and platform team`
151
+ - inspect teams first with `collaboration_teams`
152
+ - then use `collaboration_org_invitation_create`
153
+ - `Someone shared a memory repo with me; can you see it and accept it?`
154
+ - start with `collaboration_user_repo_invitations`
155
+ - do not treat a `memory_repos` miss as proof that no share exists
156
+ - if the correct pending invite is visible and the user asked to accept it, use `collaboration_user_repo_invitation_accept`
157
+ - `I still cannot see the shared memory repo`
158
+ - inspect `collaboration_user_repo_invitations` first
159
+ - if needed, have the repo owner inspect `collaboration_repo_invitations`
160
+ - `Why can Bob still see this repo?`
161
+ - start with `collaboration_repo_access_inspect`
162
+ - then drill into `collaboration_repo_collaborators`, `collaboration_repo_invitations`, `collaboration_team_repos`, `collaboration_outside_collaborators`, and `collaboration_org_invitations` as needed
163
+ - `Remove Carol from org-shared memory access`
164
+ - identify whether access comes from a direct collaborator grant, a team repo grant, or a pending invitation
165
+ - remove the actual source of access rather than guessing
166
+
167
+ ## Team memory quality bar
168
+
169
+ - Private memories can start rough and become cleaner over time
170
+ - Shared memories should be conclusions, not speculation
171
+ - When access is governed by teams or org policy, prefer org-owned repos over one user's private space
172
+ - Use stable `kind:*` and `topic:*` labels so different agents can retrieve the same schema
173
+ - Prefer updating a canonical shared fact in place instead of creating competing duplicates
174
+
175
+ ## Collaboration rule of thumb
176
+
177
+ If knowledge should stay personal, keep it in the agent's default repo. If it should shape multiple agents or people, put it in a shared repo and target that repo explicitly on retrieval and save.
178
+
179
+ ## Manual org-owned shared repo creation
180
+
181
+ Use the plugin tool path first. If the memory space must be org-governed, create an org-owned repo directly because `memory_repo_create` only creates repos under the current agent identity.
182
+
183
+ ### With `gh api`
184
+
185
+ ```sh
186
+ GH_HOST="$CLAWMEM_HOST" GH_ENTERPRISE_TOKEN="$CLAWMEM_TOKEN" \
187
+ gh api -X POST "/orgs/<org>/repos" \
188
+ -f name='team-memory' \
189
+ -F private=true \
190
+ -F has_issues=true
191
+ ```
192
+
193
+ ### With `curl`
194
+
195
+ ```sh
196
+ curl -sf -X POST "$CLAWMEM_BASE_URL/orgs/<org>/repos" \
197
+ -H "Authorization: token $CLAWMEM_TOKEN" \
198
+ -H "Content-Type: application/json" \
199
+ -d '{"name": "team-memory", "private": true, "has_issues": true}'
200
+ ```
201
+
202
+ After the repo exists:
203
+ - grant the team access with `collaboration_team_repo_set`
204
+ - use the main memory tools with explicit `repo` targeting for read and write flows
205
+ - reuse [manual-ops.md](manual-ops.md) only if you need raw memory issue control after the repo already exists
206
+
207
+ ## Fallback mode
208
+
209
+ If the collaboration tools are unavailable, use `gh api` against the ClawMem host; fall back to `curl` only when `gh` is unavailable or broken.
210
+
211
+ Command pattern:
212
+
213
+ ```sh
214
+ GH_HOST="$CLAWMEM_HOST" GH_ENTERPRISE_TOKEN="$CLAWMEM_TOKEN" \
215
+ gh api "/user"
216
+ ```
217
+
218
+ If `gh` cannot be used:
219
+
220
+ ```sh
221
+ curl -sf -H "Authorization: token $CLAWMEM_TOKEN" \
222
+ "$CLAWMEM_BASE_URL/user"
223
+ ```
@@ -0,0 +1,60 @@
1
+ # ClawMem Runtime Communication
2
+
3
+ Use this reference when memory shaped the answer, a memory was saved or updated, or the user needs a console link to inspect the memory graph.
4
+
5
+ ## Contents
6
+
7
+ - Keep the user posted
8
+ - Memory visualization console
9
+
10
+ ## Keep the user posted
11
+
12
+ Nothing interesting should happen silently. If memory shaped the answer or changed after the turn, tell the user what happened.
13
+
14
+ When a recalled or auto-injected memory materially shaped the answer, add a brief user-visible note in the user's current language. Keep it short, natural, and easy to skip.
15
+
16
+ Preferred retrieval transparency:
17
+ - say that you recalled or confirmed something from prior memory
18
+ - mention the remembered fact itself
19
+ - include the memory id and title only when they genuinely help the user follow along or when the user is debugging memory behavior
20
+
21
+ Use a miss note only when the user would reasonably expect that you checked:
22
+ - explain in the user's current language that no relevant prior memory was found
23
+
24
+ When a memory is created or updated successfully, add a brief confirmation in the user's current language.
25
+
26
+ Preferred confirmation:
27
+ - say that you remembered, saved, or updated it
28
+ - include the memory id and title only when they help with debugging, traceability, or explicit user requests
29
+
30
+ Do not force English markers like `Memory hit` or `Locked memory` in non-English conversations. Those are examples, not required phrasing.
31
+
32
+ Examples:
33
+ - `我从之前的记忆里确认到:你最近在看《Legal High》。`
34
+ - `这条我记住了,之后我会按这个偏好来推荐。`
35
+ - `I found a relevant prior memory: the team demo moved to Wednesday.`
36
+ - `Saved that preference. I’ll use it in later recommendations.`
37
+
38
+ ## Memory visualization console
39
+
40
+ The ClawMem Console provides an interactive graph view of memory nodes, labels, and links.
41
+
42
+ ### Generate a console login URL
43
+
44
+ Construct the URL from the current agent token:
45
+
46
+ ```text
47
+ https://console.clawmem.ai/login.html?token={CLAWMEM_TOKEN}
48
+ ```
49
+
50
+ Read `CLAWMEM_TOKEN` from the current route, substitute it into the URL, and show the full untruncated URL directly to the authenticated user.
51
+
52
+ ### When to show the console link
53
+
54
+ - When the user asks to view memories, the graph, or a dashboard
55
+ - After significant memory operations, such as bulk saves
56
+ - When a visual overview would clearly help the user
57
+
58
+ ### Security
59
+
60
+ The console login URL contains the agent token. Never store it in memory nodes, files, logs, or commits. Only show it directly to the authenticated user.