@skedulo/memory-hub-mcp 0.2.16 → 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.
Files changed (39) hide show
  1. package/README.md +3 -3
  2. package/assets/session-start.sh +78 -9
  3. package/assets/session-stop.sh +1 -1
  4. package/assets/skills/ask/SKILL.md +163 -0
  5. package/assets/skills/delegate-ticket/SKILL.md +2 -2
  6. package/assets/skills/fold-findings/SKILL.md +6 -3
  7. package/assets/skills/{se-ai-memory-hub → memory-hub}/SKILL.md +5 -3
  8. package/assets/skills/plan-ticket/SKILL.md +6 -0
  9. package/assets/skills/project-knowledge/SKILL.md +46 -366
  10. package/assets/skills/project-knowledge/references/checker.md +51 -0
  11. package/assets/skills/project-knowledge/references/create-refresh.md +198 -0
  12. package/assets/skills/project-knowledge/references/decision-rules.md +75 -0
  13. package/assets/skills/project-knowledge/references/import.md +87 -0
  14. package/assets/skills/project-knowledge/references/page-format.md +26 -22
  15. package/assets/skills/project-knowledge/references/targeted-update.md +49 -0
  16. package/assets/skills/project-knowledge/references/touch.md +66 -0
  17. package/assets/skills/sweep-knowledge/SKILL.md +170 -0
  18. package/assets/user-prompt-submit.sh +4 -2
  19. package/dist/annotate.js +55 -0
  20. package/dist/ask-prompt.js +41 -0
  21. package/dist/bulk.js +5 -3
  22. package/dist/capture.js +34 -4
  23. package/dist/check-sources.js +4 -2
  24. package/dist/cli.js +18 -1
  25. package/dist/git-remote.js +14 -9
  26. package/dist/guide-check.js +33 -1
  27. package/dist/index.js +46 -22
  28. package/dist/list-repos.js +10 -4
  29. package/dist/recall.js +8 -7
  30. package/dist/repo-context.js +7 -1
  31. package/dist/save.js +90 -13
  32. package/dist/session-context.js +18 -15
  33. package/dist/similar-notice.js +52 -7
  34. package/dist/soft.js +16 -0
  35. package/dist/staleness.js +156 -0
  36. package/dist/sweep.js +191 -0
  37. package/dist/tags.js +2 -0
  38. package/package.json +2 -2
  39. 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 `se-ai-memory-hub` skill. The skill's own
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`, and `ProductRules`, its old name, kept for skills older than 0.2.16 (26 in all; `TAG_VALUES` in `src/index.ts` is the source of truth). The tool's Zod schema enforces this — any other value fails validation
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/index.ts` to match.
209
+ in `src/tags.ts` and the panel's `TAG_OPTIONS` to match.
@@ -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 (.externalRef | type) == "string" and .externalRef != "" and .externalRef != $under then " · " + (.externalRef | gsub("[[:cntrl:]]"; " ")) else "" end)
213
- + ((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);'
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 (.lastModifiedDate | type) == "string" and .lastModifiedDate < $newest[$r].date
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 (.lastModifiedDate | type) == "string" and (.uid | type) == "string")]
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(.lastModifiedDate) | {key: .externalRef, value: {uid: .uid, date: .lastModifiedDate}})
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 se-ai-memory-hub skill during this session: memory_recall before${NL}"
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}"
@@ -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."
@@ -60,7 +60,7 @@ nothing else, and tell the developer to update it:
60
60
  6. Hold back outcomes: an outcome an open question affects, one that relies on a declined or
61
61
  unapplied `core` change or on a Knowledge change that did not become an entry, one that names a
62
62
  rule ID found on no page, one with a `<ID> (pending)` dependency whose ticket is now `canceled`, or
63
- is not `completed` and no longer decided by the project-knowledge decision rule 1 (its outcome was
63
+ is not `completed` and no longer decided by the decision rule 1 (project-knowledge `references/decision-rules.md`) (its outcome was
64
64
  planned toward a decision that is gone; a `completed` one is a finished dependency), and every
65
65
  outcome
66
66
  that depends on a held-back one, directly or through others. Create no sub-issue for them. List each
@@ -78,7 +78,7 @@ For each outcome that is not held back:
78
78
  - A retired entry, or one with a `Conflict:` note: use the entry that replaced it, and say so. A
79
79
  retired entry with no replacement is left out, and noted in your report. When the replacement is
80
80
  marked `Pending <ID>` and `<ID>` is neither the parent nor one of its sub-issues: if `<ID>` is
81
- still decided by the project-knowledge decision rule 1, the outcome now waits for that ticket:
81
+ still decided by the decision rule 1 (project-knowledge `references/decision-rules.md`), the outcome now waits for that ticket:
82
82
  add `<ID> (pending)` to its dependencies (a derived dependency, set in step 4.3 like the plan's
83
83
  own). If `<ID>` is `completed`, nothing waits: copy the entry under "Unverified entries" as it
84
84
  is. If `<ID>` is `canceled`, or not `completed` and no longer decided, never copy that entry as
@@ -45,8 +45,9 @@ nothing else, and tell the developer to update it:
45
45
  plan-ticket step 1 does. Load the pages the findings touch, and every Rules and Don't build page that has
46
46
  a `Pending` entry naming this sub-issue, its parent, or a ticket the PR closes
47
47
  (`memory_list type=Wiki repo=<delivery repo uid> titlePrefix="<Project> ›"`, then
48
- `memory_get type=Wiki uid=<uid>` on every part of a split page); for new IDs, read every Rules and
49
- Don't build page. `memory_list` returns `total` and one page of items; call it again with `offset`
48
+ `memory_get type=Wiki uid=<uid>` on every part of a split page). New entries take their IDs from
49
+ the feature map's `Next IDs` line in the targeted update, so no other page is needed for numbering.
50
+ `memory_list` returns `total` and one page of items; call it again with `offset`
50
51
  until you have all of them. The entry format and the confidentiality rules are in the
51
52
  project-knowledge skill's `references/page-format.md`.
52
53
  2. Drop each finding that is already folded, judged per finding, never per page: a change-log line that
@@ -85,7 +86,9 @@ nothing else, and tell the developer to update it:
85
86
 
86
87
  1. Page changes: run the project-knowledge skill's targeted update
87
88
  (`memory-hub:project-knowledge` when installed as a plugin) with the change list, the delivery repo
88
- uid and project, and the reason "findings from <SUB-ID> (<PR url>)". It applies them with
89
+ uid and project, the PR's changed files, its merge sha and the commit just before it (`<merge sha>^1`) on its repo
90
+ (`gh api repos/<owner>/<name>/pulls/<n>/files --paginate` gives each file's status, previous name,
91
+ number of changes and patch) so the touch update catches what the Findings do not mention, and the reason "findings from <SUB-ID> (<PR url>)". It applies them with
89
92
  `expectedLastModified`, writes the change-log lines with that reason, and asks once about any
90
93
  change to a `core` entry. If it ends without applying them (no project pages on that repo), stop
91
94
  before step 3.3 and report it: the sub-issue is not folded. A nested
@@ -1,10 +1,10 @@
1
1
  ---
2
- name: se-ai-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, update your persona, and share items with your team on explicit request
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
- # SE AI Memory Hub
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.
@@ -122,6 +122,12 @@ with the reason and the source. These are the project-knowledge skill's decision
122
122
  - Any other `unverified` entry the work depends on: check it in the code. If the code confirms it,
123
123
  say so. If not, plan from what the code does and list the entry under "Knowledge changes", marked
124
124
  "from code".
125
+ - A `verified` entry that cites code the work depends on: check only whether its file changed since
126
+ the cited commit (`git -C <checkout> diff --quiet <sha> origin/<default> -- <path>`, or
127
+ `gh api repos/<owner>/<name>/compare/<sha>...<default> --jq '.files[].filename'`). Unchanged: use it
128
+ as it is, without reading the file. Changed: read the file at `origin/<default>`. When it still does
129
+ what the entry says, list a "from code" Knowledge change that moves the citation to that commit;
130
+ when it does something else, the code wins: plan from what it does and list a "from code" change.
125
131
 
126
132
  ## 5. Write the plan
127
133