@skedulo/memory-hub-mcp 0.2.15 → 0.2.16

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.
@@ -0,0 +1,497 @@
1
+ ---
2
+ name: project-knowledge
3
+ description: Use when building, refreshing or importing a customer project's knowledge in the memory hub (rules with IDs and tiers, work not to build, reference pages, sources), e.g. "create the project knowledge for Welbehealth", "refresh the Welbehealth knowledge", "import the knowledge pack for this customer", or when fold-findings or plan-ticket hands over changes. It discovers and reads code, tickets, technical and business documents and Slack, maps the project's features, decides on its own and asks almost nothing.
4
+ argument-hint: "create|update|import <project> [prefix <PREFIX>]"
5
+ ---
6
+
7
+ # Project knowledge
8
+
9
+ Project knowledge is a set of Team wiki pages in the memory hub, one set per project (a hub team), on
10
+ the project's delivery repo. Read `references/page-format.md` in this skill's folder before reading or
11
+ writing any page: it defines the titles, the entry line format, IDs, tiers, statuses, the change log,
12
+ the Sources page, the team-safe editing steps and the confidentiality rules. Follow it exactly.
13
+
14
+ ## How this skill works with the developer
15
+
16
+ Decide, then report. Work out every answer yourself with the decision rules below, write your
17
+ reasoning into the entries (sources, `Conflict:` notes, troubleshooting) and into the final summary,
18
+ and keep going. Do not ask the developer to choose between options, confirm entries, pick tiers,
19
+ resolve flags or approve saves.
20
+
21
+ Ask only in these three cases, and nowhere else:
22
+
23
+ 1. The delivery repo is not linked to the project's team (see "Before any mode"). Nothing can be
24
+ saved until it is.
25
+ 2. Update mode would change an existing `core` entry that the developer has not already named (see
26
+ "Core changes"). Ask once, at the end, for all of them together, with your recommendation already
27
+ chosen.
28
+ 3. The developer asked to import, and the shared memory repo checkout cannot be found (see "Import").
29
+
30
+ Some conditions end the run instead of asking: a memory-hub server that is too old, a missing token
31
+ for the import command, an interrupted import with no shared memory repo checkout, or no source that
32
+ can be read. Say what is missing and how to fix it.
33
+
34
+ Before anything is saved, a second AI checks the work (see "Check the work"). Everything else goes
35
+ into the summary at the end (see "Summary"). The developer reviews it once and can change anything by
36
+ saying so, for example "R117 isn't core" or "drop D2"; apply such a request with update mode.
37
+
38
+ For a large project, draft each feature in its own subagent, giving it the decision rules and the
39
+ entry format, then check and number every draft yourself before saving. Keep progress notes in
40
+ `$TMPDIR/memory-hub-knowledge/<PREFIX>/`, never in a repo checkout, so a long run can continue after
41
+ an interruption. Never quote sources or write amounts or personal names there. After the summary,
42
+ run `git -C <checkout> worktree remove --force <path>` for each worktree you added (see "Discover
43
+ sources"), then delete the folder.
44
+
45
+ ## First, check the server version
46
+
47
+ Look at the parameters of the `memory_update` and `memory_save` tools; if only their names are
48
+ listed, load their schemas first. If either tool is missing, the memory-hub server is not connected:
49
+ say so and stop. If `memory_update` has no `expectedLastModified` parameter, or `memory_save`'s `tags`
50
+ values do not include `ProjectRules`, the memory-hub server is older than this release. Stop, do
51
+ nothing else, and tell the developer to update it:
52
+
53
+ - plugin installs, and `setup` installs with auto-update: restart Claude Code;
54
+ - pinned installs: re-run `npx -y @skedulo/memory-hub-mcp@latest setup --no-auto-update`;
55
+ - a checkout of the se-ai-memory-hub repo: pull and re-run `scripts/setup-dev.sh`.
56
+
57
+ ## Before any mode
58
+
59
+ 1. Find the project's team. When the caller hands over a team and project, or a delivery repo and
60
+ project (plan-ticket, delegate-ticket and fold-findings do), use them. Otherwise try in order: the team of the ticket's `repo/…` label, if a ticket was named
61
+ (`memory_listRepos`); the team linked to the current checkout (`memory_checkRepoStatus`), used only
62
+ when its team name matches the project the developer named (or neither a project nor a ticket was
63
+ named); the Linear project or team name matched to a `teamName` from `memory_listRepos`, ignoring
64
+ case and punctuation. The delivery repo is the team's repo that holds
65
+ the project's pages. With no pages yet, it is the team's repo whose name best matches the project
66
+ (ignoring case, punctuation and a `cx-` prefix); on a tie, the one most of the team's Linear tickets
67
+ label (`repo/…`), then the most recently pushed (`gh api repos/<owner>/<name> --jq .pushed_at`).
68
+ Name the choice in the summary.
69
+ 2. If the delivery repo is not linked to the project's team, stop and ask the developer which team it
70
+ belongs to; call `memory_linkRepoTeam` only when they say so. This is the only reason to stop
71
+ before starting.
72
+ 3. List the existing pages: `memory_list type=Wiki repo=<repo uid> titlePrefix="<Project> ›"` (page
73
+ through with `offset` until you reach `total`). Read the ID prefix from existing entries. With no
74
+ pages yet, choose the prefix yourself (page-format.md) and say which in the summary.
75
+ 4. Pick the mode:
76
+ - a change list handed over by plan-ticket, delegate-ticket or fold-findings, or a change the
77
+ developer asks for by entry ID: the targeted update (see "Update"), whatever else the bullets
78
+ below would pick;
79
+ - an unfinished import: the plan file `$TMPDIR/memory-hub-import/<PREFIX>.json` exists, has pages
80
+ or facts with neither `savedUid` nor `skip`, and every existing `<Project> ›` page is one whose
81
+ uid the plan records as a `savedUid`. If any item has a `savedUid`, apply was interrupted: re-run
82
+ `import apply` (Import step 7), then Import steps 8 and 9. If none has, the import stopped before
83
+ saving: resume Import at step 5 on the existing plan file, then steps 6 to 9. If pages exist that
84
+ the plan did not save, the plan is stale: delete it and its review file, because they hold
85
+ flagged values, and pick the mode from the bullets below;
86
+ - no pages, and Import step 2 finds a knowledge pack for the project without asking: import. When
87
+ no checkout of the shared memory repo is found, create, and say under "Worth a look" that no pack
88
+ was checked, unless the developer asked to import: then ask for the path (case 3). When the
89
+ developer asked to import and a checkout has no matching pack, create, and say so in the
90
+ summary;
91
+ - no pages otherwise: create;
92
+ - pages but no `<Project> › Sources` page, and their change logs say
93
+ `Imported every entry as unverified · knowledge pack <name>`: an import stopped partway and its
94
+ plan file is gone; rebuild the plan (see "Import", "Resuming an import without its plan file");
95
+ - pages but no `<Project> › Sources` page otherwise: an earlier create stopped partway; resume it
96
+ (see "Create");
97
+ - pages and a Sources page: update.
98
+
99
+ ## Discover sources, in order of authority
100
+
101
+ Find the sources yourself; never ask which to use. Use any the developer names too. Look in every
102
+ place listed below. A place you cannot reach (a connector that is not connected, a repo you cannot
103
+ read) is listed in the summary as not read; carry on with the rest.
104
+
105
+ 1. **Code and configuration**: the delivery repo, other repos linked to the same team, and repos the
106
+ code calls. Read each at its default branch as it is on the remote, never a feature branch or
107
+ uncommitted work: run `git -C <checkout> fetch -q origin`, find the default branch with
108
+ `gh api repos/<owner>/<name> --jq .default_branch`, and read the checkout in place only when it is
109
+ on that branch, `git status --porcelain` is empty and HEAD equals `origin/<default>`; otherwise add
110
+ a worktree for that repo (`git -C <checkout> worktree add --detach
111
+ "$TMPDIR/memory-hub-knowledge/<PREFIX>/<repo>" origin/<default>`) and read that.
112
+ Configuration that defines behaviour counts as code: the object model, triggered actions, Horizon
113
+ pages and list configs, config-variable definitions. Cite `code: <owner/name>@<short sha> <path>`.
114
+ 2. **Tickets**: Linear issues, projects and epics for this project, found by the team, the repo label
115
+ (`repo/skedulo/<repo>`) and the project name. Record each one's status, its workflow state type
116
+ (`triage`, `backlog`, `unstarted`, `started`, `completed`, `canceled`), its labels and any linked PR.
117
+ For each ticket a `Pending` entry names, and each ticket that is not `started`, `completed` or
118
+ `canceled` whose content differs from the code, also read its comments: a
119
+ `Delivery plan (approved <date>)` comment on it makes it decided (see "Decision rules").
120
+ 3. **Technical documents**: TDDs and design notes, and in-house docs: as-built docs, ADRs, READMEs
121
+ and `docs/` folders in the repos, `CLAUDE.md` or `AGENTS.md`, runbooks and release notes. Search
122
+ Confluence (Atlassian connector) and Google Drive by the project name together with words such as
123
+ "TDD", "technical design", "as-built", "architecture", "runbook". Cite a repo file as
124
+ `doc: <owner/name>@<short sha> <path>`.
125
+ 4. **Business documents**: SOWs, work orders and change requests; business requirements; process and
126
+ workflow descriptions; the business context in user stories; training material and customer
127
+ guides (the Knowledge Hub corpus, `customers/<slug>/` in Skedulo/se-knowledge-corpus, when you can
128
+ read it); glossaries. Search the same places with words such as "SOW", "work order",
129
+ "change request", "requirements", "process", "user guide", "glossary".
130
+ 5. **Slack**: the project's internal channels. Find them by name with `slack_search_channels` on its
131
+ default public type; never use the search that includes private channels, and read a private
132
+ channel only when the developer names it. Skip a channel whose permalink is not on
133
+ skedulo.slack.com. Before using any other channel, look up every distinct human author, including
134
+ the authors of thread replies you read, with `slack_read_user_profile`. Treat an author as Skedulo
135
+ staff only when the profile shows a skedulo.com email and is not restricted. If any author is not,
136
+ or a lookup fails, skip the whole channel and list it under "Left out".
137
+
138
+ A document marked as a draft, or not approved, is a lead, never an authority: confirm it in another
139
+ source before it becomes an entry, and never let it create a `core` or don't-build entry on its own.
140
+
141
+ **Existing hub knowledge** for this project is a set of leads, not an authority. Use only items the
142
+ whole project team can read: `memory_list` with each of the project's repos and `visibility=Team`,
143
+ and `memory_recall scope=team` results whose visibility is Org, or Team on one of the project's
144
+ repos. Never use or cite Private or Restricted items. Confirm each lead in the sources above before it
145
+ becomes an entry, cite the source that confirms it, and never copy a hub item as it is.
146
+
147
+ Record every source you read on the Sources page.
148
+
149
+ ## Discover features
150
+
151
+ Build the feature map before drafting any entry, and refresh it whenever update mode refreshes from
152
+ sources. A feature is a part of the system a ticket can be about: one business capability with its
153
+ own code.
154
+
155
+ 1. Collect candidates from four signals: code areas, the section headings of the technical documents,
156
+ Linear projects, epics and labels, and the process names in the business documents. A code area
157
+ is a function handler, a group of triggered actions, a Horizon page or component, a custom object
158
+ with its fields, or an integration or scheduled job. Ignore tests, generated files, vendored code
159
+ and build configuration.
160
+ 2. Merge candidates that point at the same code or the same process. Aim for 5 to 15 features. Merge,
161
+ split and fold only candidates that have no key yet: an existing key keeps its section, its code
162
+ paths and its Rules page. When an existing feature's code now spans unrelated areas, suggest the
163
+ split under "Worth a look" instead of moving code paths.
164
+ 3. Give each new feature a stable kebab-case key (`ride-automation`, `region-rollout`). Reuse the keys
165
+ already in the feature map or in the Rules page titles, and never rename one.
166
+ 4. Write `<Project> › Reference › feature-map` (format in page-format.md): for each feature, a one-line
167
+ purpose and the code paths, document sections, ticket labels or epics, business processes and
168
+ Slack channels it covers.
169
+ 5. Check coverage both ways. Every code area belongs to a feature. Every feature has code: a feature
170
+ without code is either not built yet (list it under "Worth a look") or a business concept that
171
+ belongs on a reference page. Report what does not fit under "Coverage" in the summary.
172
+
173
+ ## Decision rules
174
+
175
+ Apply these instead of asking. Every decision must be visible in the entry it affects.
176
+
177
+ **Which source wins when they disagree:**
178
+
179
+ 1. A **decided ticket** wins over the code: one whose workflow state type is `started` (whatever its
180
+ name: In Progress, In Review, In QA, Ready for Prod), one with a linked open PR, or a confirmed bug
181
+ report (a Bug label and a state type of `unstarted` or `started`). Keep its rule as `unverified`
182
+ with `Pending SOL-1234 (PR #452)` after the source, and add the current built behaviour to the
183
+ troubleshooting page as a known gap. A ticket whose delivery plan was approved (plan-ticket posted
184
+ `Delivery plan (approved <date>)` on it) is decided too, whatever its state, until it is
185
+ `completed` or `canceled`. Other tickets in `triage`, `backlog` or `unstarted`, and `canceled` or
186
+ duplicate tickets, are ideas, not decisions: they never override the code; note
187
+ relevant ones on the troubleshooting page. For `completed` tickets the code wins, because it
188
+ already reflects them.
189
+ 2. Otherwise the **code** wins: it is what the system does.
190
+ 3. Among documents, after a newer ticket decision: on whether something is in or out of scope, SOWs,
191
+ work orders and change requests win over technical documents, and among them the newer one wins (a
192
+ change request amends the SOW). On how the system works, technical documents win over business
193
+ documents, and between two technical documents the newer one wins. Slack comes last.
194
+ 4. The losing claim is never rewritten silently. Keep its line with
195
+ `Conflict: overridden by <PREFIX>-R<n> (<rule>: <one-line reason>)`, for example
196
+ `(code over TDD: the code uses travel time, capped at 60 min)`, and add the winning entry with its
197
+ own ID and source.
198
+
199
+ **Pending entries:** when a refresh finds that the ticket behind a `Pending` entry is now `completed`,
200
+ confirm the behaviour in the code: if the code has it, drop the `Pending` note, make the entry
201
+ `verified` citing the code, and remove its known-gap line from the troubleshooting page; if not, the
202
+ code wins (rule 1): replace the `Pending` note with `(not found in code)`, keep it `unverified`, and
203
+ keep the gap on the troubleshooting page.
204
+ When the ticket is `canceled`, the code wins: add a `Conflict:` note pointing at the built behaviour,
205
+ or retire the entry when nothing replaces it, and remove its known-gap line from the troubleshooting
206
+ page.
207
+
208
+ **What becomes an entry:**
209
+
210
+ - Built behaviour with no rule in any document becomes a rule, `verified`, citing the code, with its
211
+ tier set by the tier rule below.
212
+ - A document rule the code should show but does not stays a rule, `unverified`, with
213
+ `(not found in code)` after the source, however many documents state it. The summary lists these as
214
+ gaps.
215
+ - A business rule that the code implements becomes a rule citing both the business document and the
216
+ code, with the business reason in its text, and is `verified`.
217
+ - Work a SOW, work order, change request or completed ticket explicitly descopes becomes a don't-build
218
+ entry, `verified` unless a newer source brings it back into scope. A descope from a decided ticket
219
+ that is still pending is `unverified` with `Pending <ticket>`; one that only Slack or a ticket that
220
+ is not decided states is `unverified`, and never `core`. A draft alone never creates a don't-build
221
+ entry: note its descope on the troubleshooting page.
222
+ - Business processes, terms and the reasons behind rules go on the reference pages (workflows,
223
+ glossary, overview), each citing its source.
224
+ - Ambiguous wording, inconsistent code and open questions go to the
225
+ `<Project> › Reference › troubleshooting` page, never to a question for the developer.
226
+
227
+ **Tier:** `core` when breaking the entry would lose or corrupt data; change something another system
228
+ relies on (an external sync, an integration, a locked record); bypass a permission, role, region or
229
+ tenant guard; or break contracted scope. Never demote an entry that meets these criteria to `standard`
230
+ to keep the count low. `detail` for wording,
231
+ labels, defaults and configuration values. `standard` for everything else.
232
+
233
+ **Status:** `verified` when the code shows it; for a don't-build entry, when a SOW, work order, change
234
+ request or completed ticket that is not a draft descopes it and no newer source brings it back; for
235
+ another entry the code
236
+ cannot show (a scope limit, an external constraint, a manual process), when two independent documents
237
+ agree.
238
+ Two documents are independent only if neither was written from the other or from the hub. Knowledge
239
+ Hub corpus files are compiled from the other sources: cite them for business context, but never count
240
+ one toward `verified`. `unverified` in every other case, including when only Slack says it or a
241
+ decided ticket is still pending.
242
+
243
+ **Feature keys:** come from the feature map (see "Discover features"). Every Rules page belongs to one
244
+ feature in it.
245
+
246
+ **Slack:** use it to find leads, then confirm them in code or tickets. Never quote Slack. A claim only
247
+ Slack makes is `unverified`.
248
+
249
+ ## Check the work
250
+
251
+ Before saving anything, have the drafts checked by a fresh subagent that did not write them: AI checks
252
+ AI, so the developer does not have to.
253
+
254
+ 1. Give it:
255
+ - the entries to check: every `core` entry; every entry with a `Conflict:` note; every entry about a
256
+ permission, role, region or tenant guard, data deletion or loss, an external sync or integration,
257
+ or contracted scope; and a random tenth of the rest, at least three per feature;
258
+ - the location of every source each entry cites (URL, Confluence page or Drive file ID, absolute
259
+ path, or `owner/name@sha`), and each feature's code paths from the feature map;
260
+ - the Tier and Status rules above, and nothing about how each entry was decided;
261
+ - the instruction that any corrected text restates the source as function: it never quotes a SOW,
262
+ work order, change request or Slack, and never includes names, contact details, amounts or
263
+ record IDs.
264
+ 2. For each entry it opens the cited sources and answers one of: **confirmed**; **corrected** (the
265
+ source says something else, or the tier or status breaks the rules: it returns the corrected line
266
+ and the evidence location); **not confirmed** (the sources do not say it); **could not open**
267
+ (with the reason). For an entry that cites only a document or a ticket and is not `Pending`,
268
+ including one marked `(not found in code)`, it also looks in the feature's code paths: when the code
269
+ does something else, the answer is **code differs**, with the code's behaviour and its location.
270
+ An entry that cites both a document and the code, where the document supports the line but the
271
+ code does something else, is code differs too, never corrected.
272
+ Leave out of this code look every entry with a `Conflict:` note and every retired entry: their
273
+ override is already recorded, so for those the checker confirms only that the cited source says
274
+ what the entry says and that the entry the note names exists.
275
+ 3. Apply the results. Keep confirmed entries. Apply the confidentiality rules to each corrected line
276
+ before it replaces the entry, and list what you removed under "Left out". A code-differs answer
277
+ never replaces the entry: apply decision rule 4, because the code wins. Keep the line, drop its
278
+ `(not found in code)` and any code citation that does not support it, add
279
+ `Conflict: overridden by <PREFIX>-R<n> (code over <source>: <reason>)`, and add a new entry citing
280
+ the code with the next free ID, after the confidentiality rules. When the overridden entry is an
281
+ existing `core` entry, that is a core change (see "Core changes"). Mark not-confirmed entries
282
+ `unverified` with `(checker: not confirmed)` after the source, or move them to troubleshooting when
283
+ nothing supports them. Could-not-open entries keep their drafted status and are listed under
284
+ "Checked".
285
+ 4. Accuracy is confirmed divided by the entries the checker could open. Below 90%, check every entry
286
+ of the features where the misses were, once, and apply those results the same way. Then stop:
287
+ report the checked count and the final accuracy under "Checked".
288
+
289
+ ## Create
290
+
291
+ 1. Discover and read the sources in order of authority, and note each one's version for the Sources
292
+ page.
293
+ 2. Discover the features and draft the feature map.
294
+ 3. Draft per feature: rules (`R`) and constraints (`C`), the don't-build list (`D`), and the reference
295
+ topics worth a page (data model, APIs, workflows, glossary, troubleshooting, overview).
296
+ 4. Apply the decision rules to every entry: winner, `Conflict:` notes, tier, status, gaps.
297
+ 5. Apply the confidentiality rules. Remove anything they forbid and list what you removed.
298
+ 6. Check the work.
299
+ 7. Number the entries with the next free IDs and save each page with
300
+ `memory_save type=Wiki repo=<delivery repo uid> title=... content=...`, with
301
+ `tags=["ProjectRules"]` on rules and don't-build pages. Every page ends with a change-log line
302
+ (`<date> · <developer> via project-knowledge · Created · from <sources>`). Check each result
303
+ reports `visibility: "Team"`; if one does not, stop and tell the developer. Save the feature map
304
+ with them.
305
+ 8. Save the Sources page last, then give the summary.
306
+
307
+ **Resuming a create that stopped partway** (pages but no Sources page): leave the saved pages and
308
+ their IDs as they are and do not re-draft them. Run discovery and the feature map, reusing the feature
309
+ keys from the saved Rules page titles. Draft, check and save only the pages that are missing, numbered
310
+ from the highest existing ID, then save the Sources page.
311
+
312
+ ## Update
313
+
314
+ Update has two paths.
315
+
316
+ **Targeted update**: a change list handed over by plan-ticket, delegate-ticket or fold-findings, or a
317
+ change the developer asks for by entry ID. Do not re-read sources, rediscover or touch the Sources
318
+ page or the feature map, except for feature-map changes the list itself carries. When the handed-over
319
+ delivery repo has no `<Project> ›` pages or no Sources page, end the run and say so, naming the
320
+ changes not applied: a targeted update never creates, resumes or imports. A change marked
321
+ "from ticket" by plan-ticket becomes a new entry, `unverified` with `Pending <PARENT-ID>`, and the entry
322
+ it overrides gets a `Conflict:` note; a change marked "from code" cites the code.
323
+
324
+ 1. Apply the confidentiality rules to the listed changes, then check them (see "Check the work",
325
+ limited to the listed entries).
326
+ 2. Apply every change that does not touch an existing `core` entry, with the team-safe editing steps
327
+ in page-format.md. Before numbering a new entry, re-read the highest IDs; after saving, if another
328
+ entry has the same ID, renumber yours to the next free one. Each change-log line gives the
329
+ caller's reason word for word as its why (fold-findings puts the PR URL in it), so a later run can
330
+ tell the change is already made.
331
+ 3. Handle core changes (see "Core changes").
332
+ 4. Give the summary, including the entry ID each listed change was given or changed, so the caller can
333
+ use the real IDs, and each listed change that was not saved as an entry (declined, or moved to
334
+ troubleshooting because the checker found nothing that supports it) with the reason.
335
+
336
+ **Refresh from sources**: the developer asks to refresh, or no change list was handed over.
337
+
338
+ 1. Read the Sources page. For each source, read its current version (page-format.md lists how) and
339
+ compare it with the recorded one. A source you cannot reach is listed as not checked, not as
340
+ unchanged. Discover new sources in the order of authority too, and refresh the feature map: new
341
+ code areas join an existing feature or become a new one.
342
+ 2. For each changed or new source, re-read it and compare with the pages it feeds. Work out, per
343
+ feature: new entries (next free IDs), changed text, tier changes, entries a newer decision
344
+ overrides (a `Conflict:` note plus a new entry), entries to retire, `Pending` entries to resolve,
345
+ and status changes the Status rule now supports, using the decision rules.
346
+
347
+ A `pack` source has moved when its recorded commit differs from the checkout's HEAD or
348
+ `memory_checkSources` reports its pages behind. Re-read it by running `import convert` again with
349
+ the same `--project` and `--prefix` and `--out "$TMPDIR/memory-hub-import/<PREFIX>-refresh.json"`
350
+ (it saves nothing, and nothing is written in the checkout). Compare that plan's pages with the hub
351
+ pages entry by entry, matched by ID (an entry moved to Don't build cites its old ID as
352
+ `(was <PREFIX>-C<n>)`), on rule text and source only: a fresh convert marks every entry `standard`
353
+ and `unverified`, so never revert a hub entry's tier, status, `Conflict:` note or retirement, and
354
+ never remove an entry the pack does not have. If a pack entry's ID is already used by a different
355
+ hub entry, give the pack entry the next free ID and say so in the summary. Never run
356
+ `import apply` for a project that already has pages; the CLI refuses it. Delete the new plan and
357
+ review files when you are done: they may hold flagged values.
358
+ 3. Apply the confidentiality rules to every change, then check the changed and new entries (see
359
+ "Check the work").
360
+ 4. Apply every change that does not touch an existing `core` entry, with the team-safe editing steps
361
+ in page-format.md, renumbering a new entry if its ID turns out to be taken.
362
+ 5. Handle core changes (see "Core changes").
363
+ 6. Update the Sources page with the versions you read, through the same editing steps, then give the
364
+ summary. For each pack source, also set the pages it feeds to the new commit
365
+ (`memory_update ... source={repo: "<owner/name>", commit: "<sha>"}` with `expectedLastModified`),
366
+ so `memory_checkSources` stops reporting them.
367
+
368
+ ### Core changes
369
+
370
+ A core change is a change to or from `core`, or any edit, `Conflict:` note or retirement of an
371
+ existing `core` entry. A new entry you mark `core` while creating it is not a core change, unless it
372
+ overrides an existing `core` entry: the `Conflict:` note and the winning entry are then one core
373
+ change, held back together.
374
+
375
+ A core change the developer asked for, or accepted by entry ID, earlier in this conversation is
376
+ already confirmed (for example "R117 isn't core", or an answer naming the ID). Apply it without asking.
377
+ Approving a plan or a change list as a whole is not that.
378
+
379
+ Collect the rest and ask once, in a single question that lists each change with its ID, the current
380
+ and new lines, and one sentence of reasoning, with your recommendation already selected. Apply what
381
+ the developer accepts. For a declined one, apply neither its `Conflict:` note nor its winning entry,
382
+ note the unresolved finding on the troubleshooting page with the caller's reason, and list it in
383
+ the summary as declined.
384
+ When the caller says not to ask (fold-findings folding a blocker inside another run), apply none of
385
+ them, write nothing about them to the pages, and list them in the summary as waiting.
386
+
387
+ ## Import
388
+
389
+ Imports a knowledge pack, `domains/<name>/` in a checkout of the shared memory repo, through the
390
+ `memory-hub-mcp import` CLI, which saves through the same path as `memory_save`, so every page is
391
+ embedded. Each imported page records the pack's repo and commit as its source. Never edit the shared
392
+ memory repo from this skill: it changes only through its own publish tool.
393
+
394
+ 1. If pages already exist for the project, do not import: importing again would duplicate titles or
395
+ start a second ID prefix, and `import apply` refuses it. To pick up a pack that has moved, use
396
+ update mode.
397
+ 2. Find the shared memory repo checkout: a git repo beside the delivery repo's checkout or in its
398
+ parent folder that has `domains/*/rules.json` or `domains/*/memory/`. Ask for its path only when the
399
+ developer asked to import and you cannot find one. The pack is the `domains/<name>` whose name
400
+ equals the delivery repo's name, or else contains the team's name without punctuation; when several
401
+ contain it, take the one with the most recent commit
402
+ (`git -C <checkout> log -1 --format=%ct -- domains/<name>`) and name the choice in the summary.
403
+ Also settle the project name, the ID prefix and the delivery repo as `owner/name`.
404
+ 3. The CLI needs `MEMORY_HUB_MCP_TOKEN` in the environment. `memory-hub-mcp setup` stores it in
405
+ `~/.claude/settings.json`, which Claude Code passes to commands. If it is missing, stop and tell the
406
+ developer how to provide it. A plugin install whose token was entered only in the plugin's token
407
+ option gives it to the memory-hub server alone: add `"env": {"MEMORY_HUB_MCP_TOKEN": "<token>"}` to
408
+ `~/.claude/settings.json` and restart Claude Code, or export it in this shell; do not re-run setup,
409
+ which would add a second memory-hub server. Any other install: run
410
+ `npx -y @skedulo/memory-hub-mcp@latest setup --code`, or export the token in this shell.
411
+ 4. Convert. This saves nothing:
412
+
413
+ ```bash
414
+ npx -y @skedulo/memory-hub-mcp@latest import convert "<checkout>/domains/<name>" --project "<Project>" --prefix <PREFIX> --by "<developer name>"
415
+ ```
416
+
417
+ It prints the plan file (JSON) and the review file (Markdown) beside it.
418
+ 5. Resolve every flag yourself, one by one, using the confidentiality rules, including those listed
419
+ under "Probably project terms"; never resolve that group as a block. Look at every occurrence the
420
+ flag lists, not only the first. Never resolve a `uuid`, `salesforce-id`, `phone` or `currency` flag,
421
+ nor an `email` flag unless the address is at skedulo.com: remove those values. Mark a `person-name`
422
+ flag `"resolved": true` only for a Skedulo staff name (a Slack or Linear profile shows a skedulo.com
423
+ email), the customer's organisation name, or a term that names a thing in the code or the technical
424
+ documents. Remove every other flagged value from the content of every item the flag lists in the
425
+ plan JSON, and skip an item (`"skip": true`) only when nothing useful is left. List what you removed
426
+ in the summary.
427
+ 6. Every imported entry arrives `standard` and `unverified`. Set tiers with the decision rules, and set
428
+ an entry `verified` when the delivery repo's code, read at its default branch on the remote (see
429
+ "Discover sources"), shows it. Move each constraint whose category is
430
+ `scope` to a planned `<Project> › Don't build` page (tagged `ProjectRules`, with the change-log
431
+ footer) as a new `<PREFIX>-D<n>` entry with the next free D number, citing `(was <PREFIX>-C<n>)`;
432
+ move the C line under `## Retired` on its Rules page with `Retired <date>: moved to <PREFIX>-D<n>`.
433
+ Put that page in the plan's `pages` before the Sources page, so the Sources page is always saved
434
+ last. Then check the work, with the code as the source to check against. Edit all results into the
435
+ plan JSON. Step 5 and this step are safe to redo on a plan that is already partly edited.
436
+ 7. Save:
437
+
438
+ ```bash
439
+ npx -y @skedulo/memory-hub-mcp@latest import apply "<plan.json>" --repo <owner/name>
440
+ ```
441
+
442
+ It refuses while a flagged value is unresolved, when the repo has no team, or when the embedding
443
+ model does not load. It writes each saved uid into the plan file, so if it stops partway, run the
444
+ same command again and it resumes.
445
+ 8. When apply has finished without errors, delete the plan and review files: they still hold the
446
+ flagged values. Keep them while an apply is unfinished: the plan file is what it resumes from.
447
+ 9. Run a refresh from sources in the same run: it discovers the other sources and the features, checks
448
+ the imported entries against them, and writes the feature map. Then give the summary.
449
+
450
+ **Resuming an import without its plan file** (pages whose change logs say
451
+ `Imported every entry as unverified · knowledge pack <name>`, but no Sources page and no plan file, for
452
+ example on another machine): `import apply` refuses pages its plan did not record, so rebuild the
453
+ plan.
454
+
455
+ 1. Take the pack from the saved pages, never by Import step 2's matching: its name from the change-log
456
+ line (`knowledge pack <name>`), its repo and commit from the pages' `source` (`memory_get`). Find a
457
+ checkout of that repo as Import step 2 does. If there is none, end the run: save nothing, and say
458
+ the import must be finished where the shared memory repo is checked out. Run Import steps 3 and 4
459
+ on `domains/<name>` at that commit: when the checkout's HEAD differs, convert from a worktree of it
460
+ at that commit under `$TMPDIR/memory-hub-import/`, removed afterwards with `git worktree remove`.
461
+ 2. For each plan page whose title matches an existing `<Project> ›` page, write that page's uid into
462
+ its `savedUid`. An existing `<Project> › Don't build` page has no plan page yet: add one before
463
+ the Sources page with its uid as `savedUid`. For each plan fact whose content matches a Fact
464
+ already on the delivery repo (`memory_list type=Fact repo=<delivery repo uid> titlePrefix="<its
465
+ first words>"`), write that Fact's uid into its `savedUid`, so apply does not save it twice. If any
466
+ other existing page has no matching title in the plan, stop the import and resume it as a create
467
+ (see "Create") instead.
468
+ 3. Run Import step 5 on the new plan, and step 6 only on the pages without a `savedUid`. Number every
469
+ new R or D entry above the highest IDs on the saved pages, and take each moved constraint's D
470
+ number from the saved Rules pages' `Retired <date>: moved to <PREFIX>-D<n>` lines. When the Don't
471
+ build page is already saved, add its new D entries to it now, before step 7, with the team-safe
472
+ editing steps in page-format.md, so an interruption still finds no Sources page and resumes here.
473
+ 4. Continue with Import steps 7 to 9.
474
+
475
+ ## Summary
476
+
477
+ End every run with one short summary in plain language, the only thing the developer has to read.
478
+ Use these headings and leave out any that would be empty:
479
+
480
+ - **Saved**: each page title with its uid and ID range, and the prefix if you chose it. For a
481
+ targeted update, the entry ID each listed change was given or changed.
482
+ - **Decisions I made**: the conflicts, grouped by rule (for example "code over TDD: 7, R118 to R120,
483
+ C55 ..."), with one line on the most important ones.
484
+ - **Core**: each `core` ID with one line on why, and any core change the developer declined.
485
+ - **Checked**: how many entries the checker looked at, how many were confirmed, corrected, code
486
+ differs, not confirmed or could not be opened, and the final accuracy.
487
+ - **Worth a look**: `unverified` entries, rules not found in code, pending tickets, new feature keys,
488
+ suggested feature splits.
489
+ - **Coverage**: how many features, the code areas no feature covers, features with no code, and
490
+ documents that fed no entry.
491
+ - **Left out**: what the confidentiality rules removed, skipped Slack channels, and sources not read
492
+ and why.
493
+ - **Sources read**: one line per kind (code, tickets, technical docs, business docs, Slack, hub leads)
494
+ with counts.
495
+ - **Changed by teammates meanwhile**: pages that were edited while you worked, if any.
496
+
497
+ Finish with one line telling the developer they can change anything by saying so.