@reddb-io/red-skills-memory 2.75.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/LICENSE +202 -0
- package/README.md +27 -0
- package/package.json +30 -0
- package/skills/core/README.md +28 -0
- package/skills/core/context-status/SKILL.md +48 -0
- package/skills/core/doctor/SKILL.md +63 -0
- package/skills/core/export/SKILL.md +63 -0
- package/skills/core/extract/SKILL.md +52 -0
- package/skills/core/health/SKILL.md +50 -0
- package/skills/core/improve-skills/SKILL.md +123 -0
- package/skills/core/ingest/SKILL.md +91 -0
- package/skills/core/init/SKILL.md +97 -0
- package/skills/core/init/graph-reference.md +40 -0
- package/skills/core/recall/SKILL.md +50 -0
- package/skills/core/skills-status/SKILL.md +47 -0
- package/skills/core/store/SKILL.md +47 -0
- package/skills/core/view/SKILL.md +59 -0
- package/skills/core/wiki/C4-reference.md +101 -0
- package/skills/core/wiki/REFERENCES.md +48 -0
- package/skills/core/wiki/SKILL.md +154 -0
- package/skills/core/wiki-init/SKILL.md +127 -0
- package/skills/core/wiki-init/TEMPLATE-REFERENCE.md +17 -0
- package/skills/core/wiki-init/examples/book-reading.md +42 -0
- package/skills/core/wiki-init/examples/research.md +70 -0
- package/skills/core/wiki-init/index-template.md +19 -0
- package/skills/core/wiki-init/page-template-concept.md +38 -0
- package/skills/core/wiki-init/page-template-entity.md +34 -0
- package/skills/core/wiki-init/page-template-source.md +43 -0
- package/skills/core/wiki-init/page-template-synthesis.md +45 -0
- package/skills/core/wiki-init/schema-template.md +156 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @reddb-io/red-skills-memory
|
|
2
|
+
|
|
3
|
+
reddb.io memory plugin - governed operational memory for code agents that lives on top of dev. Supports markdown notes, RedDB graph memory, zero-token governed recall, context packs, claim checks, readiness, optional lifecycle hooks, MCP/HTTP read surfaces, Workbench diagnostics, and Skill telemetry for self-improvement.
|
|
4
|
+
|
|
5
|
+
This package ships the **memory** plugin's skill tree for [pi](https://pi.dev) (the `@earendil-works/pi-coding-agent` harness). It carries the same `SKILL.md` files the Claude Code and Codex marketplaces already expose, scoped to the published buckets only:
|
|
6
|
+
|
|
7
|
+
- `skills/core/`
|
|
8
|
+
|
|
9
|
+
Install:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pi install npm:@reddb-io/red-skills-memory
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Updates follow the same release train as the rest of the red-skills monorepo. `pi update --all` resolves the latest matching version from the npm registry.
|
|
16
|
+
|
|
17
|
+
## Source
|
|
18
|
+
|
|
19
|
+
This package is generated from `plugins/memory/` in [reddb-io/red-skills](https://github.com/reddb-io/red-skills). To regenerate locally:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm pi:packages:build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## License
|
|
26
|
+
|
|
27
|
+
Apache-2.0.
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reddb-io/red-skills-memory",
|
|
3
|
+
"version": "2.75.2",
|
|
4
|
+
"description": "reddb.io memory plugin - governed operational memory for code agents that lives on top of dev. Supports markdown notes, RedDB graph memory, zero-token governed recall, context packs, claim checks, readiness, optional lifecycle hooks, MCP/HTTP read surfaces, Workbench diagnostics, and Skill telemetry for self-improvement.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"homepage": "https://github.com/reddb-io/red-skills",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/reddb-io/red-skills.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"pi-package",
|
|
13
|
+
"reddb-io",
|
|
14
|
+
"red-skills",
|
|
15
|
+
"dep:dev"
|
|
16
|
+
],
|
|
17
|
+
"pi": {
|
|
18
|
+
"skills": [
|
|
19
|
+
"./skills/core/"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"skills/**/*",
|
|
27
|
+
"package.json",
|
|
28
|
+
"README.md"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# core — memory essentials
|
|
2
|
+
|
|
3
|
+
The minimal Memory surface is the governed loop: initialize a project-local
|
|
4
|
+
store, capture one durable work fact, recall it as evidence, verify risky claims,
|
|
5
|
+
and hand off cited context to the next agent/session.
|
|
6
|
+
|
|
7
|
+
Two modes exist:
|
|
8
|
+
|
|
9
|
+
- **markdown-only** — plain `.red/memory/notes/` files, no RedDB engine, hooks,
|
|
10
|
+
MCP, or provider requirement. Good for cautious adoption.
|
|
11
|
+
- **graph** — governed operational memory in `.red/memory/graph.rdb`, with
|
|
12
|
+
provenance, freshness, supersession, readiness, claim checks, context packs,
|
|
13
|
+
optional hooks, and read-only MCP/HTTP/Workbench surfaces.
|
|
14
|
+
|
|
15
|
+
| Skill | What it does |
|
|
16
|
+
|-------|--------------|
|
|
17
|
+
| **[init](./init/SKILL.md)** | One-time setup wizard for markdown-only notes or graph-backed governed operational memory. |
|
|
18
|
+
| **[store](./store/SKILL.md)** | Save one scoped decision, gotcha, validation, risk, or why-note to the configured memory surface. |
|
|
19
|
+
| **[recall](./recall/SKILL.md)** | Return governed context from notes/graph evidence; graph mode ranks by usefulness and hides superseded guidance by default. |
|
|
20
|
+
| **[ingest](./ingest/SKILL.md)** | Walk a repo and populate the graph from code symbols + markdown structure (graph mode). |
|
|
21
|
+
| **[extract](./extract/SKILL.md)** | Extract durable `INFERRED` facts from a transcript into the graph through the configured AI provider. |
|
|
22
|
+
| **[skills-status](./skills-status/SKILL.md)** | Diagnose Skill telemetry and recent Skill usage events before self-improvement/curation. |
|
|
23
|
+
| **[improve-skills](./improve-skills/SKILL.md)** | Generate approval-gated Skill improvement proposals from Skill telemetry, then explicitly apply reviewed structured patches with `memory improve apply ... --yes`. |
|
|
24
|
+
| **[health](./health/SKILL.md)** | Report operational Memory health: graph readiness, freshness, telemetry rollups, ranked candidates, pending proposals, and next actions. |
|
|
25
|
+
| **[context-status](./context-status/SKILL.md)** | Report context stack readiness: agent rules, domain docs, ADRs, Memory mode/graph/freshness/telemetry, Wiki state, score, and recommendations. |
|
|
26
|
+
| **[doctor](./doctor/SKILL.md)** | List stale nodes (long-unaccessed, never recalled) and prune them after confirmation (graph mode). |
|
|
27
|
+
| **[export](./export/SKILL.md)** | Export the graph to a navigable graph.html + graph.json + audit.md (graph mode). |
|
|
28
|
+
| **[view](./view/SKILL.md)** | Open the graph store visually in red-ui (cluster/query/collections) via the red-ui MCP App, with a browser Workbench fallback in terminal hosts (graph mode). |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-status
|
|
3
|
+
description: Report the project context stack posture without mutating anything. Use when checking whether agent rules, domain docs, ADRs, Memory graph/telemetry, and LLM Wiki are ready before a large task or self-improvement loop.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# memory context-status
|
|
7
|
+
|
|
8
|
+
Read-only healthcheck for the agent context stack. It reports committed context, Memory mode, graph store presence, graph freshness, Skill telemetry, Wiki readiness, a simple score, and concrete recommendations.
|
|
9
|
+
|
|
10
|
+
<what-to-do>
|
|
11
|
+
|
|
12
|
+
**Run the context-status report, read every section together, and surface `recommendations` as concrete next steps — never trigger initialization or mutations from this diagnostic.**
|
|
13
|
+
|
|
14
|
+
## 1. Run the status report
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.mjs" status context
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Use JSON for automation:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.mjs" status context --json
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 2. Interpret the posture
|
|
27
|
+
|
|
28
|
+
Read these sections together:
|
|
29
|
+
|
|
30
|
+
- `committedContext` — whether `CLAUDE.md`/`AGENTS.md`, `.red/CONTEXT.md`, `.red/CONTEXT-MAP.md`, and `.red/adr/*.md` are present.
|
|
31
|
+
- `memory` — init-chain state (see [Memory preconditions](../../references/PRECONDITIONS.md#init-chain-state-taxonomy)), plus graph store, freshness, hooks, and Skill telemetry availability.
|
|
32
|
+
- `wiki` — whether `.red/agents/wiki.md` and `.red/wiki/` are both present.
|
|
33
|
+
- `score` — count of ready checks; this is a grounding signal, not a quality guarantee.
|
|
34
|
+
- `recommendations` — setup actions that would improve context readiness.
|
|
35
|
+
|
|
36
|
+
## 3. Keep it read-only
|
|
37
|
+
|
|
38
|
+
This command must not initialize Memory, ingest a graph, create Wiki files, update skills, or mutate project docs. If setup is needed, report the exact recommendation and let the user or calling workflow decide.
|
|
39
|
+
|
|
40
|
+
## DOs / DON'Ts
|
|
41
|
+
|
|
42
|
+
- ✅ Run before large changes, `/afk` waves, onboarding, or Skill curation.
|
|
43
|
+
- ✅ Treat a low score as a reason to gather context, not as a failure.
|
|
44
|
+
- ✅ Pair with `/context` from the `dev` plugin for the full context stack loop.
|
|
45
|
+
- ❌ Do not auto-ingest when graph freshness is stale; recommend `memory ingest . --root .` instead.
|
|
46
|
+
- ❌ Do not auto-enable hooks, MCP, graph mode, telemetry, or Wiki state from this diagnostic.
|
|
47
|
+
|
|
48
|
+
</what-to-do>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doctor
|
|
3
|
+
description: Inspect and maintain the memory graph — list stale nodes (long-unaccessed and never recalled) and, only after explicit confirmation, prune them. Use when the user says "memory doctor", "clean up memory", "what's stale in memory", "prune old memory", or wants a health check of the graph. Graph mode only.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# memory doctor
|
|
8
|
+
|
|
9
|
+
The maintenance + inspection surface over the graph (graph mode only). Flags
|
|
10
|
+
**stale** nodes — last accessed more than the threshold (90 days by default)
|
|
11
|
+
*and* never recalled (`access_count == 0`) — and prunes them, but **only after
|
|
12
|
+
explicit confirmation**. Pinned nodes (`importance >= 0.8`) are never stale.
|
|
13
|
+
Recall maintains the access overlay, so a node that keeps getting recalled stays
|
|
14
|
+
fresh; one that nobody reads goes cold and surfaces here.
|
|
15
|
+
|
|
16
|
+
<what-to-do>
|
|
17
|
+
|
|
18
|
+
**Run a read-only stale-node scan first, show the list to the user, and prune only after they explicitly confirm — never pass `--prune --yes` on their behalf.**
|
|
19
|
+
|
|
20
|
+
## 1. Require graph mode
|
|
21
|
+
|
|
22
|
+
`doctor` needs graph mode — see [Memory preconditions](../../references/PRECONDITIONS.md). If memory is not initialized or is markdown-only, say so and stop — there is no graph to inspect.
|
|
23
|
+
|
|
24
|
+
## 2. Diagnose (read-only first)
|
|
25
|
+
|
|
26
|
+
Always list before deleting:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.mjs" doctor
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Add `--stale-days N` to change the threshold. This only **lists** — nothing is
|
|
33
|
+
deleted.
|
|
34
|
+
|
|
35
|
+
## 3. Prune only with confirmation
|
|
36
|
+
|
|
37
|
+
If the user wants the stale nodes gone, re-run with `--prune`. It re-lists the
|
|
38
|
+
candidates and asks for a typed `yes` before deleting:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.mjs" doctor --prune
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
In a non-interactive shell, `--prune` refuses unless `--yes` is also passed. Pass
|
|
45
|
+
`--yes` only when the user has already confirmed.
|
|
46
|
+
|
|
47
|
+
## DOs / DON'Ts
|
|
48
|
+
|
|
49
|
+
- ✅ Show the stale list and let the user decide — pruning is destructive.
|
|
50
|
+
- ✅ Treat pinned (`importance >= 0.8`) nodes as keepers; they never appear stale.
|
|
51
|
+
- ❌ Never run `--prune --yes` on the user's behalf without their explicit go-ahead — pruning is destructive.
|
|
52
|
+
- ❌ Don't lower `--stale-days` to force-flag nodes the user didn't ask to clean.
|
|
53
|
+
|
|
54
|
+
</what-to-do>
|
|
55
|
+
|
|
56
|
+
<supporting-info>
|
|
57
|
+
|
|
58
|
+
## MCP
|
|
59
|
+
|
|
60
|
+
The MCP server exposes the read-only half as `memory_doctor` (`stale_days`
|
|
61
|
+
arg). Pruning stays a confirmed CLI operation — it is not exposed over MCP.
|
|
62
|
+
|
|
63
|
+
</supporting-info>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: export
|
|
3
|
+
description: Export the memory graph to a self-contained, navigable bundle — graph.json (data), graph.html (an interactive node-link view that opens straight from disk), and audit.md (a health summary). Use when the user says "export memory", "visualize the memory graph", "show me the graph", "dump the memory graph", or wants to browse what's stored. Graph mode only.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# memory export
|
|
8
|
+
|
|
9
|
+
Dumps the whole graph (graph mode only) into a directory as three files:
|
|
10
|
+
|
|
11
|
+
- **graph.json** — nodes + edges + stats, machine-readable.
|
|
12
|
+
- **graph.html** — a single self-contained page (data inlined, no network, no
|
|
13
|
+
build) with a force-directed node-link diagram plus a searchable list. Opens
|
|
14
|
+
straight from disk.
|
|
15
|
+
- **audit.md** — a human-readable health summary: counts by node type and edge
|
|
16
|
+
label, superseded chains, orphan nodes, and the most connected nodes.
|
|
17
|
+
|
|
18
|
+
<what-to-do>
|
|
19
|
+
|
|
20
|
+
**Export the graph to a self-contained bundle, then point the user at the three output files — this is a read-only snapshot; never commit the export.**
|
|
21
|
+
|
|
22
|
+
## 1. Require graph mode
|
|
23
|
+
|
|
24
|
+
`export` needs graph mode — see [Memory preconditions](../../references/PRECONDITIONS.md). If memory is not initialized or is markdown-only, say so and stop.
|
|
25
|
+
|
|
26
|
+
## 2. Export
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.mjs" export [<out-dir>] [--communities]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`<out-dir>` defaults to `.red/memory/export`. The command prints the three file
|
|
33
|
+
paths. `graph` is an alias of `export`.
|
|
34
|
+
|
|
35
|
+
Pass `--communities` to colour the graph by **thematic cluster**: it runs
|
|
36
|
+
RedDB's native Louvain (`GRAPH COMMUNITY … RETURN ASSIGNMENTS`) and paints each
|
|
37
|
+
node by the community it belongs to, with a `community` id threaded into both
|
|
38
|
+
`graph.json` and `graph.html`. No external graph-algorithms dependency — the
|
|
39
|
+
engine computes the partition (the competitive point vs Neo4j, which needs a
|
|
40
|
+
separate plugin). Requires engine ≥ 1.3.1.
|
|
41
|
+
|
|
42
|
+
## 3. Point the user at the output
|
|
43
|
+
|
|
44
|
+
Tell the user where the files are and that `graph.html` opens in any browser
|
|
45
|
+
straight from disk (no server needed). Summarize anything notable from
|
|
46
|
+
`audit.md` (orphans, superseded chains) if relevant.
|
|
47
|
+
|
|
48
|
+
## DOs / DON'Ts
|
|
49
|
+
|
|
50
|
+
- ✅ Open `graph.html` from disk — it is self-contained, no CDN or server.
|
|
51
|
+
- ✅ Use `audit.md` to spot orphans / stale structure worth a `/memory:doctor` pass.
|
|
52
|
+
- ❌ Don't commit the export bundle — it's a generated snapshot, like `dist/`.
|
|
53
|
+
|
|
54
|
+
</what-to-do>
|
|
55
|
+
|
|
56
|
+
<supporting-info>
|
|
57
|
+
|
|
58
|
+
## MCP
|
|
59
|
+
|
|
60
|
+
The MCP server's `memory_export` returns the graph as JSON by default; pass
|
|
61
|
+
`out_dir` to also write the graph.json + graph.html + audit.md bundle there.
|
|
62
|
+
|
|
63
|
+
</supporting-info>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: extract
|
|
3
|
+
description: Extract durable facts from a transcript into the Memory graph through the configured AI provider. Use when the user wants to preserve decisions, gotchas, root causes, or reasoning traces from a conversation or log. Graph mode only; requires `provider` in the `plugins.memory` block of `.red/config.yaml`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# memory extract
|
|
7
|
+
|
|
8
|
+
Turns a transcript into `INFERRED` memory graph facts. This is the LLM-backed write path: it reads a conversation/log from a file or stdin, asks the configured provider to extract durable facts, and upserts nodes/edges into the graph.
|
|
9
|
+
|
|
10
|
+
<what-to-do>
|
|
11
|
+
|
|
12
|
+
**Extract durable facts from the transcript into the graph through the configured provider, then verify with a targeted recall — never run this just to summarize.**
|
|
13
|
+
|
|
14
|
+
## 1. Require graph mode and provider
|
|
15
|
+
|
|
16
|
+
`extract` needs graph mode and a `provider` block — see [Memory preconditions](../../references/PRECONDITIONS.md). If either is missing, stop and explain; do not silently fall back to markdown notes.
|
|
17
|
+
|
|
18
|
+
## 2. Select the transcript deliberately
|
|
19
|
+
|
|
20
|
+
Use a transcript/log that contains durable operational learning: decisions, root causes, gotchas, why-notes, or failed attempts that explain constraints. Do not extract secrets, raw credentials, private personal data, Odysseus-style Personal facts, biographical details, issue-only progress, PR numbers, commit SHAs, or stale task-completion logs. Long-lived human preferences and identity context belong in Brain — see [Brain-vs-Memory boundary](../../../../brain/skills/references/BRAIN_VS_MEMORY.md).
|
|
21
|
+
|
|
22
|
+
## 3. Run extraction
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# From a file
|
|
26
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.mjs" extract <transcript-file>
|
|
27
|
+
|
|
28
|
+
# Or from stdin
|
|
29
|
+
cat <transcript-file> | node "${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.mjs" extract
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The command prints how many `INFERRED` facts and edges were written and which provider mode/egress was used.
|
|
33
|
+
|
|
34
|
+
## 4. Verify with recall
|
|
35
|
+
|
|
36
|
+
Run a targeted recall for one or two extracted topics:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.mjs" recall "<topic>"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Report whether the new facts are discoverable. If extraction produced nothing, say so plainly and do not invent facts.
|
|
43
|
+
|
|
44
|
+
## DOs / DON'Ts
|
|
45
|
+
|
|
46
|
+
- ✅ Prefer concise transcripts with clear decisions and why-notes.
|
|
47
|
+
- ✅ Treat extracted facts as `INFERRED`; verify before relying on them later.
|
|
48
|
+
- ✅ Use `/memory:store` for a single hand-authored fact; use `extract` for a rich transcript.
|
|
49
|
+
- ❌ Do not extract secrets or transient task progress.
|
|
50
|
+
- ❌ Do not run extraction just to summarize; it mutates the Memory graph.
|
|
51
|
+
|
|
52
|
+
</what-to-do>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: health
|
|
3
|
+
description: Report Memory plugin operational health. Use before memory self-improvement, CI checks, or large agent runs to verify initialization, graph mode, freshness, Skill telemetry, ranked proposal candidates, and pending proposal files without mutating anything.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# memory health
|
|
7
|
+
|
|
8
|
+
Read-only operational healthcheck for the Memory plugin.
|
|
9
|
+
|
|
10
|
+
<what-to-do>
|
|
11
|
+
|
|
12
|
+
**Run the healthcheck in JSON mode, interpret every counter against the state table, and report `recommendedNextActions` — never mutate any file from this diagnostic.**
|
|
13
|
+
|
|
14
|
+
## 1. Run the healthcheck
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.mjs" health --json
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Use `--root <dir>` when checking a repository other than the current working directory.
|
|
21
|
+
|
|
22
|
+
## 2. Interpret the state
|
|
23
|
+
|
|
24
|
+
Match the `state` field against the [init-chain state taxonomy](../../references/PRECONDITIONS.md#init-chain-state-taxonomy). `health` additionally reports `degraded` (a sub-component not ready), `attention` (pending improvement work), and `ready` (no action needed).
|
|
25
|
+
|
|
26
|
+
## 3. Use the operational counters
|
|
27
|
+
|
|
28
|
+
Read these JSON fields before deciding the next action:
|
|
29
|
+
|
|
30
|
+
- `initialized` — whether memory is configured (see [Memory preconditions](../../references/PRECONDITIONS.md)).
|
|
31
|
+
- `graphMode` — whether graph mode is configured and the graph store exists.
|
|
32
|
+
- `skillTelemetry` — `enabled` or `unavailable`.
|
|
33
|
+
- `graphFreshness` — freshness of the graph store versus project files.
|
|
34
|
+
- `rollups` — number of observed Skill telemetry rollups.
|
|
35
|
+
- `proposalCandidates` — number of ranked improvement candidates.
|
|
36
|
+
- `highPriorityProposals` — candidates that should be reviewed first.
|
|
37
|
+
- `pendingProposalFiles` — pending `.md` files directly under `.red/memory/proposals/`; archived files are excluded.
|
|
38
|
+
- `topProposals` — top ranked proposals, already sorted by deterministic score.
|
|
39
|
+
- `recommendedNextActions` — concrete next steps for the agent or CI.
|
|
40
|
+
|
|
41
|
+
## DOs / DON'Ts
|
|
42
|
+
|
|
43
|
+
- ✅ Run this before `bootstrap.mjs improve skills --write-proposal` in automated workflows.
|
|
44
|
+
- ✅ Treat `attention` as actionable, not as failure.
|
|
45
|
+
- ✅ Use `recommendedNextActions` rather than inventing recovery steps.
|
|
46
|
+
- ✅ When `pendingProposalFiles > 0`, inspect them with `bootstrap.mjs improve proposals list/show --json`; proposal fingerprints let repeated generation refresh existing work instead of creating duplicates.
|
|
47
|
+
- ❌ Do not mutate graph, proposal, or Skill files from this healthcheck.
|
|
48
|
+
- ❌ Do not parse human text when `--json` is available.
|
|
49
|
+
|
|
50
|
+
</what-to-do>
|