@skedulo/memory-hub-mcp 0.2.17 → 0.2.18
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 +3 -3
- package/assets/session-start.sh +78 -9
- package/assets/session-stop.sh +1 -1
- package/assets/skills/ask/SKILL.md +163 -0
- package/assets/skills/{se-ai-memory-hub → memory-hub}/SKILL.md +5 -3
- package/assets/skills/project-knowledge/SKILL.md +18 -5
- package/assets/skills/project-knowledge/references/create-refresh.md +21 -2
- package/assets/skills/project-knowledge/references/targeted-update.md +30 -5
- package/assets/skills/project-knowledge/references/touch.md +4 -3
- package/assets/skills/sweep-knowledge/SKILL.md +170 -0
- package/assets/user-prompt-submit.sh +4 -2
- package/dist/annotate.js +55 -0
- package/dist/ask-prompt.js +41 -0
- package/dist/bulk.js +5 -3
- package/dist/capture.js +34 -4
- package/dist/check-sources.js +4 -2
- package/dist/cli.js +18 -1
- package/dist/git-remote.js +14 -9
- package/dist/guide-check.js +33 -1
- package/dist/index.js +46 -22
- package/dist/list-repos.js +10 -4
- package/dist/recall.js +8 -7
- package/dist/repo-context.js +7 -1
- package/dist/save.js +90 -13
- package/dist/session-context.js +18 -15
- package/dist/similar-notice.js +52 -7
- package/dist/soft.js +16 -0
- package/dist/staleness.js +156 -0
- package/dist/sweep.js +191 -0
- package/dist/tags.js +2 -0
- package/package.json +2 -2
- package/skill-guide.md +164 -43
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Local stdio MCP server wrapping `memory-hub`.
|
|
4
4
|
|
|
5
5
|
`memory_getSkillGuide` serves `skill-guide.md` (this package's own file, read fresh on every
|
|
6
|
-
call) as the current usage guide for the `
|
|
6
|
+
call) as the current usage guide for the `memory-hub` skill. The skill's own
|
|
7
7
|
`SKILL.md` is a thin stub that just tells Claude to call this tool — the actual guidance
|
|
8
8
|
lives here so it updates on the next `yarn build`, not via a manual `cp` into
|
|
9
9
|
`~/.claude/skills/`. Edit `skill-guide.md` directly; never hand-copy its content elsewhere.
|
|
@@ -203,7 +203,7 @@ matching the `AgentFacts`/`AgentSkills`/`AgentWikiPages` custom objects' `Tags`
|
|
|
203
203
|
`ConnectedFunction`, `HorizonComponent`, `TriggeredAction`, `ObjectModel`, `MobileExtension`,
|
|
204
204
|
`Deployment`, `Auth`, `Testing`, `BreezeUI`, `PSS`, `PSF`, `Optimization`, `Webhooks`, `Salesforce`,
|
|
205
205
|
`Other`, `ArchitectureMap`, `SOW`, `TDD`, `AI`, `API`, `Mobile`, `Infrastructure`, `Security`,
|
|
206
|
-
`Messaging`, `ProjectRules`,
|
|
206
|
+
`Messaging`, `ProjectRules`, `ProductRules`, its old name, kept for skills older than 0.2.16, `Superseded` and `SkillDrift` (28 in all; `TAG_VALUES` in `src/tags.ts` is the source of truth). The tool's Zod schema enforces this — any other value fails validation
|
|
207
207
|
before the request reaches the connected function (which otherwise 400s with no indication of
|
|
208
208
|
what went wrong). If the underlying Picklist's `allowedValues` ever changes, update `TAG_VALUES`
|
|
209
|
-
in `src/
|
|
209
|
+
in `src/tags.ts` and the panel's `TAG_OPTIONS` to match.
|
package/assets/session-start.sh
CHANGED
|
@@ -209,11 +209,16 @@ cut_pointer() {
|
|
|
209
209
|
|
|
210
210
|
# Same as user-prompt-submit.sh; change both together.
|
|
211
211
|
EXTRAS_DEF='def extras($under; $text):
|
|
212
|
-
(if (.
|
|
213
|
-
+ ((
|
|
212
|
+
(if (.source | type) == "object" and (.source.verifiedAt | type) == "string" and .source.verifiedAt != "" then " · verified " + .source.verifiedAt[0:10] else "" end)
|
|
213
|
+
+ (if (.externalRef | type) == "string" and .externalRef != "" and .externalRef != $under then " · " + (.externalRef | gsub("[[:cntrl:]]"; " ")) else "" end)
|
|
214
|
+
+ ((first(($text // "") | gsub("[A-Za-z][A-Za-z0-9+.-]*://[^\\s)]*"; " ") | scan("[A-Za-z0-9_./-]+\\.(?:tsx|ts|jsx|js|mjs|sh|py|json|md|yml|yaml|cls|java|kt|swift|go|rb)\\b") | select(startswith("http") | not)) // null) | if . then " · cites " + . else "" end)
|
|
215
|
+
+ (if ((.tags // []) | index("Superseded")) then " · superseded, prefer the newer memory" else "" end);'
|
|
216
|
+
|
|
217
|
+
# Creation date, not lastModifiedDate: re-verifying an old fact bumps lastModifiedDate without making it newer.
|
|
218
|
+
BORN_DEF='def born: if (.createdDate | type) == "string" then .createdDate else .lastModifiedDate end;'
|
|
214
219
|
|
|
215
220
|
SUPERSEDED_DEF='def superseded: (.externalRef) as $r
|
|
216
|
-
| if ($r | type) == "string" and ($newest[$r] != null) and (
|
|
221
|
+
| if ($r | type) == "string" and ($newest[$r] != null) and (born | type) == "string" and born < $newest[$r].date
|
|
217
222
|
then " · older than " + $newest[$r].uid[0:8] + " for " + ($r | gsub("[[:cntrl:]]"; " ")) + ", may be superseded"
|
|
218
223
|
else "" end;'
|
|
219
224
|
|
|
@@ -222,15 +227,15 @@ newest_fact_per_ref() {
|
|
|
222
227
|
local f
|
|
223
228
|
for f in "$@"; do
|
|
224
229
|
jq -c '.facts[]? | select(type == "object")' "$f" 2>/dev/null || true
|
|
225
|
-
done | jq -s -c '
|
|
226
|
-
[.[] | select((.externalRef | type) == "string" and .externalRef != "" and (
|
|
230
|
+
done | jq -s -c "$BORN_DEF"'
|
|
231
|
+
[.[] | select((.externalRef | type) == "string" and .externalRef != "" and (born | type) == "string" and (.uid | type) == "string")]
|
|
227
232
|
| unique_by(.uid) | group_by(.externalRef)
|
|
228
|
-
| map(select(length > 1) | max_by(
|
|
233
|
+
| map(select(length > 1) | max_by(born) | {key: .externalRef, value: {uid: .uid, date: born}})
|
|
229
234
|
| from_entries' 2>/dev/null || true
|
|
230
235
|
}
|
|
231
236
|
|
|
232
237
|
extract_facts() {
|
|
233
|
-
jq -c --argjson newest "$NEWEST_BY_REF" "$EXTRAS_DEF $SUPERSEDED_DEF .facts[]? | (\"- \" + (.content | $ELIDE) + $(cut_pointer Fact) + $STAMP + extras(\"\"; .content) + superseded) | $CLOSE_FENCE | $INDENT" "$1" 2>/dev/null || true
|
|
238
|
+
jq -c --argjson newest "$NEWEST_BY_REF" "$EXTRAS_DEF $BORN_DEF $SUPERSEDED_DEF .facts[]? | (\"- \" + (.content | $ELIDE) + $(cut_pointer Fact) + $STAMP + extras(\"\"; .content) + superseded) | $CLOSE_FENCE | $INDENT" "$1" 2>/dev/null || true
|
|
234
239
|
}
|
|
235
240
|
|
|
236
241
|
extract_skills() {
|
|
@@ -504,13 +509,77 @@ collect_capture_notices() {
|
|
|
504
509
|
printf '%s%s%s' "${heading}${NL}" "$lines"
|
|
505
510
|
}
|
|
506
511
|
|
|
512
|
+
origin_ref() {
|
|
513
|
+
local ref
|
|
514
|
+
for ref in origin/HEAD origin/main origin/master; do
|
|
515
|
+
git rev-parse --verify --quiet "$ref^{commit}" >/dev/null 2>&1 && { printf '%s' "$ref"; return 0; }
|
|
516
|
+
done
|
|
517
|
+
return 1
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
# The Sources page's repo line is the watermark a catch-up moves; page commits stand in when recall cut or lacks it.
|
|
521
|
+
WATERMARK_COMMITS='[.pages[]? | objects | select((.title | type) == "string" and (.title | contains(" › ")))] as $project
|
|
522
|
+
| ($repo | ascii_downcase) as $here
|
|
523
|
+
| [$project[] | select(.title | endswith(" › Sources")) | .content | strings
|
|
524
|
+
| scan("`repo` · ([^ @·]+)(?:@[^ ·]*)? · commit ([0-9a-f]{7,40})\\b") | select(.[0] | ascii_downcase == $here) | .[1]] as $watermark
|
|
525
|
+
| (if ($watermark | length) > 0 then $watermark
|
|
526
|
+
else [$project[] | .source | objects | select((.repo | type) != "string" or .repo == $repo) | .commit | strings | select(test("^[0-9a-f]{7,40}$"))] end)
|
|
527
|
+
| reduce .[] as $c ([]; if any(.[]; . == $c) then . else . + [$c] end) | .[:5][]'
|
|
528
|
+
|
|
529
|
+
# Once a day per repo; compared with the fetched origin ref, never the working tree, and never fetches.
|
|
530
|
+
catch_up_nudge() {
|
|
531
|
+
local wiki="$TMP_DIR/wiki_repo.json" stamp_dir="$HOME/.claude/memory-hub" stamp today ref sha n behind=0 name start
|
|
532
|
+
[ -n "$REPO_UID" ] && [ -s "$wiki" ] || return 0
|
|
533
|
+
stamp="$stamp_dir/nudge-$(printf '%s' "$REPO_UID" | tr -c 'A-Za-z0-9_-' '_')"
|
|
534
|
+
today=$(date +%Y-%m-%d)
|
|
535
|
+
[ "$(cat "$stamp" 2>/dev/null)" != "$today" ] || return 0
|
|
536
|
+
ref=$(origin_ref) || return 0
|
|
537
|
+
start=$SECONDS
|
|
538
|
+
while IFS= read -r sha; do
|
|
539
|
+
[ $((SECONDS - start)) -lt 2 ] || break
|
|
540
|
+
n=$(git rev-list --count "$sha..$ref" 2>/dev/null) || continue
|
|
541
|
+
case "$n" in '' | *[!0-9]*) continue ;; esac
|
|
542
|
+
[ "$n" -le "$behind" ] || behind=$n
|
|
543
|
+
done < <(jq -r --arg repo "$REPO_NAME" "$WATERMARK_COMMITS" "$wiki" 2>/dev/null)
|
|
544
|
+
[ "$behind" -gt 0 ] || return 0
|
|
545
|
+
name=$(jq -r --slurpfile repo "$TMP_DIR/repo.json" 'first(.pages[]? | .title | strings | select(contains(" › ")) | split(" › ")[0] | select(. != "")) // ($repo[0].teamName | strings) // empty' "$wiki" 2>/dev/null)
|
|
546
|
+
[ -n "$name" ] || name="$REPO_NAME"
|
|
547
|
+
mkdir -p "$stamp_dir" 2>/dev/null && printf '%s\n' "$today" > "$stamp" 2>/dev/null
|
|
548
|
+
printf '%s knowledge is %d commits behind %s; say "catch up" to update it.' "$(printf '%s' "$name" | tr '[:cntrl:]' ' ')" "$behind" "$ref"
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
# A stamp from before uids were stored holds a date, which matches no uid, so it nudges once more.
|
|
552
|
+
share_nudge() {
|
|
553
|
+
local stamp_dir="$HOME/.claude/memory-hub" stamp uids fresh n
|
|
554
|
+
stamp="$stamp_dir/share-nudge-$(printf '%s' "$TOKEN" | cksum | cut -d' ' -f1)"
|
|
555
|
+
uids=$(jq -rs '[.[] | objects | (.facts, .skills) | arrays | .[] | objects
|
|
556
|
+
| select(.visibility == "Private" and (.teamName | type) == "string" and .teamName != "") | .uid | strings
|
|
557
|
+
| select(test("^[A-Za-z0-9_-]+$"))] | unique | .[]' \
|
|
558
|
+
"$TMP_DIR/facts_self.json" "$TMP_DIR/skills_self.json" 2>/dev/null) || return 0
|
|
559
|
+
[ -n "$uids" ] || return 0
|
|
560
|
+
if [ -f "$stamp" ]; then
|
|
561
|
+
fresh=$(printf '%s\n' "$uids" | grep -vxF -f "$stamp")
|
|
562
|
+
else
|
|
563
|
+
fresh=$uids
|
|
564
|
+
fi
|
|
565
|
+
[ -n "$fresh" ] || return 0
|
|
566
|
+
n=$(printf '%s\n' "$uids" | wc -l | tr -d ' ')
|
|
567
|
+
mkdir -p "$stamp_dir" 2>/dev/null && printf '%s\n' "$uids" > "$stamp" 2>/dev/null
|
|
568
|
+
printf '%d of your private notes on team repos look shareable; say "share them" to review and share.' "$n"
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
NUDGE=$(catch_up_nudge 2>/dev/null || true)
|
|
572
|
+
[ -z "$NUDGE" ] || NUDGE="${NUDGE}${NL}${NL}"
|
|
573
|
+
SHARE_NUDGE=$(share_nudge 2>/dev/null || true)
|
|
574
|
+
[ -z "$SHARE_NUDGE" ] || NUDGE="${NUDGE}${SHARE_NUDGE}${NL}${NL}"
|
|
575
|
+
|
|
507
576
|
REMINDER="## Reminder${NL}"
|
|
508
577
|
REMINDER="${REMINDER}${SAVE_LINE}${NL}"
|
|
509
|
-
REMINDER="${REMINDER}Invoke the
|
|
578
|
+
REMINDER="${REMINDER}Invoke the memory-hub skill during this session: memory_recall before${NL}"
|
|
510
579
|
REMINDER="${REMINDER}investigating something that smells like prior context, and memory_save${NL}"
|
|
511
580
|
REMINDER="${REMINDER}(type \"Fact\" or \"Scenario\") once a task produces a durable decision, root${NL}"
|
|
512
581
|
REMINDER="${REMINDER}cause, or fix worth keeping for next time.${NL}${NL}"
|
|
513
|
-
REMINDER="${REMINDER}${STALE_MCP}"
|
|
582
|
+
REMINDER="${REMINDER}${STALE_MCP}${NUDGE}"
|
|
514
583
|
NOTICES=$(collect_capture_notices "$STATE_DIR" "$((REMAINING - ${#REMINDER} - ${#DIAG}))" 2>/dev/null || true)
|
|
515
584
|
[ -z "$NOTICES" ] || NOTICES="${NOTICES}${NL}${NL}"
|
|
516
585
|
REMINDER="${REMINDER}${NOTICES}"
|
package/assets/session-stop.sh
CHANGED
|
@@ -157,7 +157,7 @@ Rules for what you write:
|
|
|
157
157
|
- One memory per topic or ticket. If you already saved or updated one for it in this session, update that one instead of saving again.
|
|
158
158
|
EOF
|
|
159
159
|
read -r -d '' tail <<'EOF' || true
|
|
160
|
-
For anything not listed above: call memory_recall with a short query first; if one of your own memories already covers it, memory_update that memory with the merged, corrected full text. Otherwise memory_save (type "Fact" or "Scenario"). Never delete anything.
|
|
160
|
+
For anything not listed above: call memory_recall with a short query first; if one of your own memories already covers it, memory_update that memory with the merged, corrected full text. Otherwise memory_save (type "Fact" or "Scenario"). Never pass visibility: capture saves are Private. Never delete anything.
|
|
161
161
|
EOF
|
|
162
162
|
printf '%s\n%s%s' "${head//<NOW>/$now}" "$existing" "$tail"
|
|
163
163
|
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ask
|
|
3
|
+
description: Use when someone asks what the team, a project or the hub knows, e.g. "what do we know about the Welbehealth rostering rules?", "ask the hub how job allocation works", "why did we stop syncing contacts for Acme?", "has anyone solved the token refresh problem?". It answers from hub knowledge in plain language, inside or outside a project folder, fixes what it relies on when the code or a cited document moved, and saves what it learns when the hub did not know.
|
|
4
|
+
argument-hint: "<question>"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ask the hub
|
|
8
|
+
|
|
9
|
+
Answer a question from what the hub already knows, for anyone: a developer in a repo, or someone in
|
|
10
|
+
Claude Desktop with no project folder open. Keeping knowledge current is one of the hub's core
|
|
11
|
+
principles, so this skill also fixes what it relies on when the code or a cited document moved, and grows the hub when
|
|
12
|
+
it did not know.
|
|
13
|
+
|
|
14
|
+
- **Plain language.** The person may not be a developer. Short sentences, no jargon they did not
|
|
15
|
+
use, and no tool names in the answer.
|
|
16
|
+
- **Ask only for: joining a team, which repo when it is unclear, and which sources to read**
|
|
17
|
+
(steps 3, 8 and 6). Everything else you decide. Joining is the person's choice, so never join
|
|
18
|
+
without their yes.
|
|
19
|
+
- **Never paste SOW or Slack text.** Say what it means in your own words and name where it came from.
|
|
20
|
+
- **Never reveal others' Private items.** The hub never returns them; never guess at them either.
|
|
21
|
+
- **End every answer with one line** listing what you updated and saved, by uid, for example
|
|
22
|
+
"Updated: F-123 (moved its source). Saved: F-456 (Team, Skedulo/acme-delivery)." or
|
|
23
|
+
"Nothing changed."
|
|
24
|
+
|
|
25
|
+
## First, check the server version
|
|
26
|
+
|
|
27
|
+
Look at the parameters of the `memory_recall`, `memory_list`, `memory_save` and `memory_update`
|
|
28
|
+
tools; if only their names are listed, load their schemas first. If any of them is missing, the
|
|
29
|
+
memory-hub server is not connected: say so and stop. If `memory_update` has no
|
|
30
|
+
`expectedLastModified` parameter, or `memory_save` has no `supersedes` parameter, the memory-hub
|
|
31
|
+
server is older than this release. Stop, do nothing else, and say it must be updated:
|
|
32
|
+
|
|
33
|
+
- plugin installs, and `setup` installs with auto-update: restart Claude Code or Claude Desktop;
|
|
34
|
+
- pinned installs: re-run `npx -y @skedulo/memory-hub-mcp@latest setup --no-auto-update`;
|
|
35
|
+
- a checkout of the se-ai-memory-hub repo: pull and re-run `scripts/setup-dev.sh`.
|
|
36
|
+
|
|
37
|
+
## 1. Read the question
|
|
38
|
+
|
|
39
|
+
Note the project or customer it names, if any, and pick the types to search:
|
|
40
|
+
|
|
41
|
+
- **Facts and Scenarios** for decisions, history and "why did we…";
|
|
42
|
+
- **Skills** for how-tos and architecture maps ("how does X work", "how do I…");
|
|
43
|
+
- **Wiki** for a project's rules, its work not to build and its reference pages.
|
|
44
|
+
|
|
45
|
+
When unsure, search all four.
|
|
46
|
+
|
|
47
|
+
Note too whether you have a checkout of the project's repo and the project-knowledge skill
|
|
48
|
+
(`memory-hub:project-knowledge` when installed as a plugin). In Claude Desktop you have neither, and
|
|
49
|
+
steps 4 to 6 say what changes.
|
|
50
|
+
|
|
51
|
+
## 2. Search the hub
|
|
52
|
+
|
|
53
|
+
1. For each type picked, `memory_recall` with `scope=team`, using the question's key words. It
|
|
54
|
+
also returns the person's own items, Private ones included.
|
|
55
|
+
2. When a project is named, also list its pages, which works outside a repo too:
|
|
56
|
+
`memory_list type=Wiki titlePrefix="<Project> ›"` (paginate with `offset` until you have
|
|
57
|
+
`total`). Pick the pages the question needs.
|
|
58
|
+
3. Read with `memory_get` every item you will rely on whose text came back cut short.
|
|
59
|
+
4. When an item has `superseded: true`, prefer the newer memory that replaced it; look it up if it
|
|
60
|
+
was not returned.
|
|
61
|
+
|
|
62
|
+
## 3. When a named project's pages are not found
|
|
63
|
+
|
|
64
|
+
If the question names a project and step 2 found none of its pages, check `memory_listTeams` (the
|
|
65
|
+
teams the person is on) before treating it as unrecorded. If none of their teams is the project's,
|
|
66
|
+
say that its knowledge may be shared with its team only, and that saying "join the <team> team"
|
|
67
|
+
shows it, using the project's name as the team name when you know no better. Call `memory_joinTeam`
|
|
68
|
+
only after they say yes, since joining changes who reads what; then go back to step 2. If it says no
|
|
69
|
+
such team exists, or they do not say yes, carry on to step 6 with what you have.
|
|
70
|
+
|
|
71
|
+
## 4. Check what you rely on
|
|
72
|
+
|
|
73
|
+
For every item you will rely on that has a `staleness` field, follow the guide's "Stale memories"
|
|
74
|
+
section before answering (`memory_getSkillGuide section="Stale memories"`, loaded once per run).
|
|
75
|
+
|
|
76
|
+
- At most three fixes per question, counting those made in step 5; flag the rest in the answer.
|
|
77
|
+
- With no checkout of the repo an item cites (for example in Claude Desktop), staleness cannot be
|
|
78
|
+
worked out, so no item carries it: for each item you rely on that has a `source.verifiedAt`, say
|
|
79
|
+
in the answer "verified <n> days ago".
|
|
80
|
+
|
|
81
|
+
Keep each fix (uid and what changed) for the closing line.
|
|
82
|
+
|
|
83
|
+
## 5. Check the documents you rely on
|
|
84
|
+
|
|
85
|
+
A memory can cite a Confluence page or a Google Drive file, so an edited document may no longer match
|
|
86
|
+
it. For each such document that an item you will rely on cites (a project page lists them on its
|
|
87
|
+
`<Project> › Sources` page), make one metadata call and compare it with what the hub recorded:
|
|
88
|
+
|
|
89
|
+
- Confluence: the page's `version.number` and last-updated time. Google Drive: `modifiedTime`.
|
|
90
|
+
- **Project page:** it names a document by title (for example `TDD For Schools §4.2`), not by id.
|
|
91
|
+
Find the document's line on `<Project> › Sources` by that title: it gives the page or file id for
|
|
92
|
+
the metadata call and the recorded version to compare with
|
|
93
|
+
(`confluence · page <id> "<title>" · version <n>`, `gdrive · file <id> "<title>" · modifiedTime <t>`).
|
|
94
|
+
- **Any other memory:** compare the document's last-updated time with the memory's
|
|
95
|
+
`source.verifiedAt`, or with its `createdDate` (from `memory_recall`) when it has none.
|
|
96
|
+
|
|
97
|
+
Unchanged: use the memory as it is. Changed: read only that document, answer from it, and say in the
|
|
98
|
+
answer that the hub's memory was behind it. Then:
|
|
99
|
+
|
|
100
|
+
- **Project page:** it is never edited here. Without a checkout of the project's repo or the
|
|
101
|
+
project-knowledge skill (for example in Claude Desktop), never hand off: answer from the reread
|
|
102
|
+
document, save a Fact on the page's repo that names the page and entry ID and says what the
|
|
103
|
+
document now says (step 8), and tell the person a developer can update the project page with
|
|
104
|
+
"update the <Project> knowledge". With both, hand the change to project-knowledge's targeted
|
|
105
|
+
update, which owns the page and its Sources line. Hand over what you took from the reread document as the change list. Add the document's
|
|
106
|
+
new version (Confluence `version.number`, or Drive `modifiedTime`) only when you read the whole
|
|
107
|
+
document and listed every change in it that differs from the project's pages; the targeted update
|
|
108
|
+
then records it on that document's Sources line. Otherwise hand over the changes without the
|
|
109
|
+
version, so the line stays behind and the next refresh reads the document. Tell the person the
|
|
110
|
+
page was behind the document.
|
|
111
|
+
- **Any other memory:** if still true, leave it; if clearly wrong with an obvious fix, correct it
|
|
112
|
+
with one `memory_update` under the "Stale memories" rules; if unclear, leave it and say why. Each correction is one of the
|
|
113
|
+
three fixes.
|
|
114
|
+
|
|
115
|
+
If the Atlassian or Google Drive connector is not connected, or cannot open the document, say in the
|
|
116
|
+
answer that the document was not checked, and use the memory as it is. Never paste the document's
|
|
117
|
+
text: say what it means in your own words and name the document.
|
|
118
|
+
|
|
119
|
+
Keep each fix (uid and what changed) for the closing line.
|
|
120
|
+
|
|
121
|
+
## 6. When the hub has nothing
|
|
122
|
+
|
|
123
|
+
If nothing found answers the question, say so plainly, then ask which sources to read:
|
|
124
|
+
links or names of documents, tickets, Slack channels or repos. In the
|
|
125
|
+
same message, say that reading sources costs tokens: a few links are small; searching everything
|
|
126
|
+
for a project (building its knowledge from scratch) reads its code, tickets and documents and can
|
|
127
|
+
cost millions of tokens. Say too that what you find will be saved to the hub, for the project's
|
|
128
|
+
team when it is about a project.
|
|
129
|
+
|
|
130
|
+
- Read only the sources they give.
|
|
131
|
+
- If they say "search everything" after that warning, and you have a checkout of the project's
|
|
132
|
+
repo and the project-knowledge skill, run it for that project, then answer from the pages it
|
|
133
|
+
saved. It saves those pages itself: step 8 saves nothing more. Without them (for example in
|
|
134
|
+
Claude Desktop), explain that searching everything needs Claude Code opened in the project's
|
|
135
|
+
repo, and offer to read the sources they name instead.
|
|
136
|
+
- If they give no sources, answer that the hub does not know, and end with "Nothing changed."
|
|
137
|
+
|
|
138
|
+
Then answer (step 7), and save what you found (step 8) without asking again.
|
|
139
|
+
|
|
140
|
+
## 7. Answer
|
|
141
|
+
|
|
142
|
+
Answer briefly, in plain language. Back each claim with the item it came from: its uid, its title
|
|
143
|
+
and, when it has one, its source as `<owner/name>@<short commit>`. Say plainly what the hub does not
|
|
144
|
+
know. Mention anything flagged in steps 4 and 5.
|
|
145
|
+
|
|
146
|
+
## 8. Save what was learned
|
|
147
|
+
|
|
148
|
+
Save only what came from the sources read in steps 5 and 6, not what the hub already had;
|
|
149
|
+
corrections found in steps 4 and 5 are already made by their `memory_update`. One `memory_save` per
|
|
150
|
+
durable point: a Fact for a decision or finding, a Skill for a how-to. Pass `supersedes` with the old
|
|
151
|
+
uid when it replaces an existing memory, and a `source` when it came from code.
|
|
152
|
+
|
|
153
|
+
Never save commercial terms (prices, rates, budgets), customer personal data, credentials, or text
|
|
154
|
+
copied from a SOW or Slack. Restate it as what the system does or what was decided, and name the
|
|
155
|
+
source.
|
|
156
|
+
|
|
157
|
+
Decide the visibility by the guide's "What to share" section
|
|
158
|
+
(`memory_getSkillGuide section="What to share"`), and state the choice and the reason in the answer.
|
|
159
|
+
|
|
160
|
+
## 9. Close
|
|
161
|
+
|
|
162
|
+
End with the one line of what changed: each update and save by uid, with the visibility of each
|
|
163
|
+
save, or "Nothing changed."
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description: Use when working in a repo where the memory-hub MCP tools (memory_recall, memory_list, memory_save, memory_saveBatch, memory_upsertPersona, memory_setVisibility, memory_bulkPromoteRepoScoped, memory_grantAccess, memory_checkRepoStatus, memory_linkRepoTeam, memory_moveResourceRepo, memory_listRepos, memory_registerRepo, memory_checkSources, memory_listTeams, memory_joinTeam, memory_addTeamMember, memory_listTeamMembers, memory_whoCanRead, memory_update, memory_getSkillGuide) are available, to recall prior context mid-session, save durable facts/skills/scenarios, update your persona, and share
|
|
2
|
+
name: memory-hub
|
|
3
|
+
description: Use when working in a repo where the memory-hub MCP tools (memory_recall, memory_list, memory_save, memory_saveBatch, memory_upsertPersona, memory_setVisibility, memory_bulkPromoteRepoScoped, memory_grantAccess, memory_checkRepoStatus, memory_linkRepoTeam, memory_moveResourceRepo, memory_listRepos, memory_registerRepo, memory_checkSources, memory_listTeams, memory_joinTeam, memory_addTeamMember, memory_listTeamMembers, memory_whoCanRead, memory_update, memory_getSkillGuide) are available, to recall prior context mid-session, save durable facts/skills/scenarios with a deliberate visibility, update your persona, and share private notes when asked
|
|
4
4
|
argument-hint: "[what to recall or save]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Memory Hub
|
|
8
8
|
|
|
9
9
|
Call `memory_getSkillGuide` now — it returns the current, full usage guide
|
|
10
10
|
(when to recall, what to save where, sharing rules, repo linking). That
|
|
@@ -12,3 +12,5 @@ guide is served live from `memory-hub-mcp`, not copied here, so it can't go
|
|
|
12
12
|
stale on this machine the way this stub's own content once did. This file
|
|
13
13
|
stays intentionally thin: only what the harness needs to discover and
|
|
14
14
|
trigger the skill.
|
|
15
|
+
|
|
16
|
+
Give every save a deliberate visibility by the guide's "What to share" rule (work knowledge is Team, on the project's repo by name), and state the choice and the reason. Follow the guide's "Stale memories" rules before relying on an item with a `staleness` field, and its "Skill drift" rule when a plugin skill contradicts the code.
|
|
@@ -19,8 +19,8 @@ and never skip one:
|
|
|
19
19
|
- `page-format.md`: every run, before reading or writing any page.
|
|
20
20
|
- `decision-rules.md`: before deciding which source wins, what becomes an entry, or a tier or status.
|
|
21
21
|
- `checker.md`: before anything is saved ("Check the work").
|
|
22
|
-
- `create-refresh.md`: create, resuming a create,
|
|
23
|
-
"Discover sources" and "Discover features".
|
|
22
|
+
- `create-refresh.md`: create, resuming a create, refresh from sources and the sources-only refresh.
|
|
23
|
+
It also holds "Discover sources" and "Discover features".
|
|
24
24
|
- `targeted-update.md`: a change list handed over by another skill, or a change asked for by entry ID.
|
|
25
25
|
- `touch.md`: keeping the pages in step with the code from a commit range, used by fold-findings and
|
|
26
26
|
by refresh, or when the developer asks to catch up with the code.
|
|
@@ -28,7 +28,8 @@ and never skip one:
|
|
|
28
28
|
|
|
29
29
|
A section named in quotes is in: this file for "Before any mode", "Core changes" and "Summary";
|
|
30
30
|
`decision-rules.md` for "Decision rules"; `checker.md` for "Check the work"; `create-refresh.md`
|
|
31
|
-
for "Discover sources", "Discover features", "Create"
|
|
31
|
+
for "Discover sources", "Discover features", "Create", "Refresh from sources" and
|
|
32
|
+
"Sources-only refresh";
|
|
32
33
|
`targeted-update.md` for "Update" and "Targeted update"; `touch.md` for "Touch update"; `import.md` for "Import" and "Import step <n>".
|
|
33
34
|
|
|
34
35
|
## How this skill works with the developer
|
|
@@ -93,11 +94,14 @@ nothing else, and tell the developer to update it:
|
|
|
93
94
|
through with `offset` until you reach `total`). Read the ID prefix from existing entries. With no
|
|
94
95
|
pages yet, choose the prefix yourself (page-format.md) and say which in the summary.
|
|
95
96
|
4. Pick the mode:
|
|
96
|
-
- a change list, a commit range or a PR's changed files handed over by plan-ticket, delegate-ticket or fold-findings,
|
|
97
|
-
a
|
|
97
|
+
- a change list, a commit range or a PR's changed files handed over by plan-ticket, delegate-ticket or fold-findings,
|
|
98
|
+
a commit range with no change list handed over by the weekly sweep (sweep-knowledge), or a
|
|
99
|
+
change the developer asks for by entry ID: the targeted update (see "Update"), whatever else
|
|
98
100
|
the bullets below would pick;
|
|
99
101
|
- the developer asks to catch up with the code, and pages and a Sources page exist: the touch update
|
|
100
102
|
over every repo on the Sources page, as one run (see "Touch update");
|
|
103
|
+
- the developer asks to refresh the sources (not the code), or the weekly sweep runs this skill,
|
|
104
|
+
and pages and a Sources page exist: the sources-only refresh (see "Sources-only refresh");
|
|
101
105
|
- an unfinished import: the plan file `$TMPDIR/memory-hub-import/<PREFIX>.json` exists, has pages
|
|
102
106
|
or facts with neither `savedUid` nor `skip`, and every existing `<Project> ›` page is one whose
|
|
103
107
|
uid the plan records as a `savedUid`. If any item has a `savedUid`, apply was interrupted: re-run
|
|
@@ -161,4 +165,13 @@ Use these headings and leave out any that would be empty:
|
|
|
161
165
|
with counts.
|
|
162
166
|
- **Changed by teammates meanwhile**: pages that were edited while you worked, if any.
|
|
163
167
|
|
|
168
|
+
- **Help it find more**: what would make this knowledge more complete, so the developer can enrich
|
|
169
|
+
it. Name each connector that was not connected and what it would have added (Linear tickets,
|
|
170
|
+
Confluence or Google Drive documents, Slack channels). Name each kind of source the search found
|
|
171
|
+
none of (no technical design, no SOW, work order or change request, no project Slack channel),
|
|
172
|
+
and each feature that rests on code alone or has rules `(not found in code)`. Say that naming or
|
|
173
|
+
linking a document, channel or repo adds it to the Sources page, so every later refresh reads it,
|
|
174
|
+
and that documents titled with the project name are found on their own. Leave it out when nothing
|
|
175
|
+
is missing.
|
|
176
|
+
|
|
164
177
|
Finish with one line telling the developer they can change anything by saying so.
|
|
@@ -148,14 +148,33 @@ already there.
|
|
|
148
148
|
3. Apply the confidentiality rules to every change, then check the changed and new entries (see
|
|
149
149
|
"Check the work").
|
|
150
150
|
4. Apply every change that does not touch an existing `core` entry, with the team-safe editing steps
|
|
151
|
-
in page-format.md, numbering new entries from the `Next IDs` line.
|
|
152
|
-
|
|
151
|
+
in page-format.md, numbering new entries from the `Next IDs` line. For a `repo` whose commit moved, set the
|
|
152
|
+
`source` of every project page of that repo to the commit the refresh diffed through, touched or
|
|
153
|
+
not, since the whole range was checked ("Page source" in page-format.md); set any other page you
|
|
154
|
+
checked to the commit you checked it against. Never touch a page fed by a pack.
|
|
153
155
|
5. Handle core changes (see "Core changes").
|
|
154
156
|
6. Update the Sources page with the versions you read, through the same editing steps, then give the
|
|
155
157
|
summary. For each pack source, also set the pages it feeds to the new commit
|
|
156
158
|
(`memory_update ... source={repo: "<owner/name>", commit: "<sha>"}` with `expectedLastModified`),
|
|
157
159
|
so `memory_checkSources` stops reporting them.
|
|
158
160
|
|
|
161
|
+
## Sources-only refresh
|
|
162
|
+
|
|
163
|
+
**Sources-only refresh**: the developer asks to refresh the sources, or the weekly sweep runs it. The
|
|
164
|
+
touch update and the sweep keep the pages in step with the code; this reads everything else.
|
|
165
|
+
|
|
166
|
+
Run "Refresh from sources" steps 1 to 6, skipping every `repo` source:
|
|
167
|
+
|
|
168
|
+
- Step 1: never run the touch update and never read a repo. Repos newly linked to the team are
|
|
169
|
+
listed in the summary under "Worth a look", not read.
|
|
170
|
+
- Step 4: leave each page's `source` as it is, since no code was read.
|
|
171
|
+
- Step 6: leave the Sources page's `repo` lines as they are; update only the sources you read.
|
|
172
|
+
|
|
173
|
+
When it runs unattended (the sweep), it never asks. Apply only the changes that do not touch an
|
|
174
|
+
existing `core` entry. Apply none of the core changes, write nothing about them to the pages, and
|
|
175
|
+
list them in the summary as waiting. Anything that would make it stop and ask ends the run with a
|
|
176
|
+
summary that says why.
|
|
177
|
+
|
|
159
178
|
## Source versions
|
|
160
179
|
|
|
161
180
|
How to read each source's current version for the Sources page:
|
|
@@ -1,13 +1,38 @@
|
|
|
1
1
|
# Targeted update
|
|
2
2
|
|
|
3
|
-
**Targeted update**: a change list handed over by plan-ticket, delegate-ticket or fold-findings,
|
|
4
|
-
change
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
**Targeted update**: a change list handed over by plan-ticket, delegate-ticket or fold-findings, a
|
|
4
|
+
change list from a document ask reread (with that document's version, see "Document version"), a
|
|
5
|
+
commit range with no change list handed over by the weekly sweep (sweep-knowledge), or a change the
|
|
6
|
+
developer asks for by entry ID. Do not re-read sources or rediscover. It may touch only:
|
|
7
|
+
|
|
8
|
+
- the entries listed (for a commit range, the entries its touch update changes);
|
|
9
|
+
- the feature-map changes the list carries;
|
|
10
|
+
- the `Next IDs` line;
|
|
11
|
+
- the touch update's feature-map changes;
|
|
12
|
+
- a handed-over document version, on that document's Sources line (see "Document version").
|
|
13
|
+
|
|
14
|
+
When the handed-over delivery repo has no `<Project> ›` pages or no Sources page, end the run and
|
|
15
|
+
say so, naming the changes not applied: a targeted update never creates, resumes or imports. A change marked
|
|
8
16
|
"from ticket" by plan-ticket becomes a new entry, `unverified` with `Pending <PARENT-ID>`, and the entry
|
|
9
17
|
it overrides gets a `Conflict:` note; a change marked "from code" cites the code.
|
|
10
18
|
|
|
19
|
+
Never move a Sources page watermark; only a refresh or a catch-up does, except a document version
|
|
20
|
+
handed over with a reread of that document.
|
|
21
|
+
|
|
22
|
+
**Document version.** A caller that reread a Confluence page or Google Drive file (ask does, when
|
|
23
|
+
the document changed since its Sources line) may hand over that document's new version together
|
|
24
|
+
with the changes it took from it: the Confluence `version.number`, or the Drive `modifiedTime`. The
|
|
25
|
+
caller hands the version over only when it read the whole document and listed every change in it
|
|
26
|
+
that differs from the project's pages; a caller that read part of it (ask reads a document to answer
|
|
27
|
+
one question) hands over the changes without a version, and then nothing here touches the Sources
|
|
28
|
+
line, so the next refresh reads the document. A version handed over without such a full reread is
|
|
29
|
+
ignored. After the changes are applied (steps 1 and 2), replace the version on that document's own
|
|
30
|
+
line on the Sources page, and no other line, with the team-safe editing steps in page-format.md:
|
|
31
|
+
`confluence · page <id> "<title>" · version <n>` or `gdrive · file <id> "<title>" · modifiedTime <t>`, and set
|
|
32
|
+
`read` to today. Record it only when the changes taken from that document were saved or already
|
|
33
|
+
there; when any was declined or left waiting (core), leave the line as it is so a later run
|
|
34
|
+
reads the document again. Add a change-log line saying which document's version moved.
|
|
35
|
+
|
|
11
36
|
1. Apply the confidentiality rules to the listed changes, then check them (see "Check the work",
|
|
12
37
|
which says which of them need the checker).
|
|
13
38
|
2. Apply every change that does not touch an existing `core` entry, with the team-safe editing steps
|
|
@@ -59,7 +59,8 @@ unchanged code and never rebuilds the project. Callers:
|
|
|
59
59
|
- a catch-up: run steps 1 to 7 for every repo on the Sources page first, then, once for all of
|
|
60
60
|
them, check the new and changed entries ("Check the work"), apply them with the team-safe editing
|
|
61
61
|
steps, numbering from the `Next IDs` line, handle "Core changes", and give the summary, with the
|
|
62
|
-
ranges under "Sources read". Only after applying, set
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
ranges under "Sources read". Only after applying, set the `source` of every project page whose
|
|
63
|
+
`source` names that repo to its `<B>`, touched or not, since the whole range was diffed (except
|
|
64
|
+
a page fed by a pack), and each repo's line on the Sources page to its `<B>`.
|
|
65
|
+
A refresh sets the page sources the same way in its step 4 and the Sources page lines in its step 6. From fold-findings, leave both as
|
|
65
66
|
they are: other merges may lie between them and `<B>`, and the next refresh covers them.
|