@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
@@ -11,9 +11,30 @@ the project's delivery repo. Read `references/page-format.md` in this skill's fo
11
11
  writing any page: it defines the titles, the entry line format, IDs, tiers, statuses, the change log,
12
12
  the Sources page, the team-safe editing steps and the confidentiality rules. Follow it exactly.
13
13
 
14
+ ## Which file to read, and when
15
+
16
+ The rules live in this skill's `references/` folder. Read each file before the step that needs it,
17
+ and never skip one:
18
+
19
+ - `page-format.md`: every run, before reading or writing any page.
20
+ - `decision-rules.md`: before deciding which source wins, what becomes an entry, or a tier or status.
21
+ - `checker.md`: before anything is saved ("Check the work").
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
+ - `targeted-update.md`: a change list handed over by another skill, or a change asked for by entry ID.
25
+ - `touch.md`: keeping the pages in step with the code from a commit range, used by fold-findings and
26
+ by refresh, or when the developer asks to catch up with the code.
27
+ - `import.md`: import, and resuming an import.
28
+
29
+ A section named in quotes is in: this file for "Before any mode", "Core changes" and "Summary";
30
+ `decision-rules.md` for "Decision rules"; `checker.md` for "Check the work"; `create-refresh.md`
31
+ for "Discover sources", "Discover features", "Create", "Refresh from sources" and
32
+ "Sources-only refresh";
33
+ `targeted-update.md` for "Update" and "Targeted update"; `touch.md` for "Touch update"; `import.md` for "Import" and "Import step <n>".
34
+
14
35
  ## How this skill works with the developer
15
36
 
16
- Decide, then report. Work out every answer yourself with the decision rules below, write your
37
+ Decide, then report. Work out every answer yourself with the decision rules, write your
17
38
  reasoning into the entries (sources, `Conflict:` notes, troubleshooting) and into the final summary,
18
39
  and keep going. Do not ask the developer to choose between options, confirm entries, pick tiers,
19
40
  resolve flags or approve saves.
@@ -33,10 +54,10 @@ can be read. Say what is missing and how to fix it.
33
54
 
34
55
  Before anything is saved, a second AI checks the work (see "Check the work"). Everything else goes
35
56
  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.
57
+ saying so, for example "R117 isn't core" or "drop D2"; apply such a request as a targeted update.
37
58
 
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
59
+ For a large project, draft each feature in its own subagent, giving it `decision-rules.md` and the
60
+ entry-line part of `page-format.md` only, then check and number every draft yourself before saving. Keep progress notes in
40
61
  `$TMPDIR/memory-hub-knowledge/<PREFIX>/`, never in a repo checkout, so a long run can continue after
41
62
  an interruption. Never quote sources or write amounts or personal names there. After the summary,
42
63
  run `git -C <checkout> worktree remove --force <path>` for each worktree you added (see "Discover
@@ -73,9 +94,14 @@ nothing else, and tell the developer to update it:
73
94
  through with `offset` until you reach `total`). Read the ID prefix from existing entries. With no
74
95
  pages yet, choose the prefix yourself (page-format.md) and say which in the summary.
75
96
  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;
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
100
+ the bullets below would pick;
101
+ - the developer asks to catch up with the code, and pages and a Sources page exist: the touch update
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");
79
105
  - an unfinished import: the plan file `$TMPDIR/memory-hub-import/<PREFIX>.json` exists, has pages
80
106
  or facts with neither `savedUid` nor `skip`, and every existing `<Project> ›` page is one whose
81
107
  uid the plan records as a `savedUid`. If any item has a `savedUid`, apply was interrupted: re-run
@@ -94,278 +120,9 @@ nothing else, and tell the developer to update it:
94
120
  plan file is gone; rebuild the plan (see "Import", "Resuming an import without its plan file");
95
121
  - pages but no `<Project> › Sources` page otherwise: an earlier create stopped partway; resume it
96
122
  (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
123
+ - pages and a Sources page: refresh from sources (see "Refresh from sources").
250
124
 
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
125
+ ## Core changes
369
126
 
370
127
  A core change is a change to or from `core`, or any edit, `Conflict:` note or retirement of an
371
128
  existing `core` entry. A new entry you mark `core` while creating it is not a core change, unless it
@@ -374,6 +131,8 @@ change, held back together.
374
131
 
375
132
  A core change the developer asked for, or accepted by entry ID, earlier in this conversation is
376
133
  already confirmed (for example "R117 isn't core", or an answer naming the ID). Apply it without asking.
134
+ Moving an entry's code citation to a newer commit, or adding `checked <date>`, with its text, tier,
135
+ status and notes unchanged, is not a core change: apply it directly.
377
136
  Approving a plan or a change list as a whole is not that.
378
137
 
379
138
  Collect the rest and ask once, in a single question that lists each change with its ID, the current
@@ -384,94 +143,6 @@ the summary as declined.
384
143
  When the caller says not to ask (fold-findings folding a blocker inside another run), apply none of
385
144
  them, write nothing about them to the pages, and list them in the summary as waiting.
386
145
 
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
146
  ## Summary
476
147
 
477
148
  End every run with one short summary in plain language, the only thing the developer has to read.
@@ -494,4 +165,13 @@ Use these headings and leave out any that would be empty:
494
165
  with counts.
495
166
  - **Changed by teammates meanwhile**: pages that were edited while you worked, if any.
496
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
+
497
177
  Finish with one line telling the developer they can change anything by saying so.
@@ -0,0 +1,51 @@
1
+ # Check the work
2
+
3
+ Before saving anything, have the drafts checked by a fresh subagent that did not write them: AI checks
4
+ AI, so the developer does not have to.
5
+
6
+ Never re-check an entry that was already on a saved page before this run, is not new, edited or
7
+ overridden in this run, and whose sources have not changed since it was last confirmed: a code citation
8
+ whose path is unchanged since the cited commit (`git -C <checkout> diff --quiet <sha> origin/<default>
9
+ -- <path>`), or an entry marked `checked <date>` whose documents have no newer version on the Sources
10
+ page. Leave those out of everything below.
11
+
12
+ 1. Give it:
13
+ - the entries to check. Every `core` entry; every entry with a `Conflict:` note; every don't-build
14
+ entry; every entry about a permission, role, region or tenant guard, data deletion or loss, an
15
+ external sync or integration, or contracted scope. In a create or a refresh, also a random tenth
16
+ of the rest, at least three per feature. In a targeted update, nothing else: check each other
17
+ listed entry yourself instead, by opening its cited source and confirming it says the line;
18
+ - the location of every source each entry cites (URL, Confluence page or Drive file ID, absolute
19
+ path, or `owner/name@sha`), with a line range where you have one, and each feature's code paths
20
+ from the feature map. It opens a whole file only for the entries named in the first group;
21
+ - the Tier and Status rules from `decision-rules.md`, and nothing about how each entry was decided;
22
+ - the instruction that any corrected text restates the source as function: it never quotes a SOW,
23
+ work order, change request or Slack, and never includes names, contact details, amounts or
24
+ record IDs.
25
+ 2. For each entry it opens the cited sources and answers one of: **confirmed**; **corrected** (the
26
+ source says something else, or the tier or status breaks the rules: it returns the corrected line
27
+ and the evidence location); **not confirmed** (the sources do not say it); **could not open**
28
+ (with the reason). For an entry that cites only a document or a ticket and is not `Pending`,
29
+ including one marked `(not found in code)`, it also looks in the feature's code paths: when the code
30
+ does something else, the answer is **code differs**, with the code's behaviour and its location.
31
+ An entry that cites both a document and the code, where the document supports the line but the
32
+ code does something else, is code differs too, never corrected.
33
+ Leave out of this code look every entry with a `Conflict:` note and every retired entry: their
34
+ override is already recorded, so for those the checker confirms only that the cited source says
35
+ what the entry says and that the entry the note names exists.
36
+ 3. Apply the results. Keep confirmed entries. Apply the confidentiality rules to each corrected line
37
+ before it replaces the entry, and list what you removed under "Left out". A code-differs answer
38
+ never replaces the entry: apply decision rule 4, because the code wins. Keep the line, drop its
39
+ `(not found in code)` and any code citation that does not support it, add
40
+ `Conflict: overridden by <PREFIX>-R<n> (code over <source>: <reason>)`, and add a new entry citing
41
+ the code with the next free ID, after the confidentiality rules. When the overridden entry is an
42
+ existing `core` entry, that is a core change (see "Core changes"). Mark not-confirmed entries
43
+ `unverified` with `(checker: not confirmed)` after the source, or move them to troubleshooting when
44
+ nothing supports them. Could-not-open entries keep their drafted status and are listed under
45
+ "Checked". On a confirmed entry, set its code citation to the commit the checker read, or add
46
+ `checked <date>` after the source of an entry backed only by documents, so it is not checked
47
+ again until its sources change.
48
+ 4. Accuracy is confirmed divided by the entries the checker could open. Below 90%, check, once, the
49
+ rest of the entries like the missed ones: the same feature and the same kind of source (code,
50
+ ticket, technical document, business document, Slack). Apply those results the same way. Then stop:
51
+ report the checked count and the final accuracy under "Checked".