@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
@@ -0,0 +1,198 @@
1
+ # Create and refresh
2
+
3
+ ## Discover sources, in order of authority
4
+
5
+ Find the sources yourself; never ask which to use. Use any the developer names too. Look in every
6
+ place listed below. A place you cannot reach (a connector that is not connected, a repo you cannot
7
+ read) is listed in the summary as not read; carry on with the rest.
8
+
9
+ 1. **Code and configuration**: the delivery repo, other repos linked to the same team, and repos the
10
+ code calls. Read each at its default branch as it is on the remote, never a feature branch or
11
+ uncommitted work: run `git -C <checkout> fetch -q origin`, find the default branch with
12
+ `gh api repos/<owner>/<name> --jq .default_branch`, and read the checkout in place only when it is
13
+ on that branch, `git status --porcelain` is empty and HEAD equals `origin/<default>`; otherwise add
14
+ a worktree for that repo (`git -C <checkout> worktree add --detach
15
+ "$TMPDIR/memory-hub-knowledge/<PREFIX>/<repo>" origin/<default>`) and read that.
16
+ Configuration that defines behaviour counts as code: the object model, triggered actions, Horizon
17
+ pages and list configs, config-variable definitions. Cite `code: <owner/name>@<short sha> <path>`.
18
+ 2. **Tickets**: Linear issues, projects and epics for this project, found by the team, the repo label
19
+ (`repo/skedulo/<repo>`) and the project name. List them with their status, workflow state type
20
+ (`triage`, `backlog`, `unstarted`, `started`, `completed`, `canceled`), title, labels and any linked
21
+ PR; listing is cheap, reading every ticket is not. Read the description and comments only of the
22
+ tickets that can change knowledge: decided ones (decision rule 1), `canceled` ones, ones in any
23
+ state whose title or labels suggest scope (descope, out of scope, remove, won't do), and the ones a
24
+ `Pending` entry names. After reading the business documents, also read every ticket a SOW, work
25
+ order or change request cites that you have not read yet. The rest stay as titles: the
26
+ code already reflects completed work, and ideas never override it. For each ticket a `Pending` entry names, and each ticket that is not `started`, `completed` or
27
+ `canceled` whose content differs from the code, also read its comments: a
28
+ `Delivery plan (approved <date>)` comment on it makes it decided (see "Decision rules").
29
+ 3. **Technical documents**: TDDs and design notes, and in-house docs: as-built docs, ADRs, READMEs
30
+ and `docs/` folders in the repos, `CLAUDE.md` or `AGENTS.md`, runbooks and release notes. Search
31
+ Confluence (Atlassian connector) and Google Drive by the project name together with words such as
32
+ "TDD", "technical design", "as-built", "architecture", "runbook". Cite a repo file as
33
+ `doc: <owner/name>@<short sha> <path>`.
34
+ 4. **Business documents**: SOWs, work orders and change requests; business requirements; process and
35
+ workflow descriptions; the business context in user stories; training material and customer
36
+ guides (the Knowledge Hub corpus, `customers/<slug>/` in Skedulo/se-knowledge-corpus, when you can
37
+ read it); glossaries. Search the same places with words such as "SOW", "work order",
38
+ "change request", "requirements", "process", "user guide", "glossary".
39
+ 5. **Slack**: the project's internal channels. Find them by name with `slack_search_channels` on its
40
+ default public type; never use the search that includes private channels, and read a private
41
+ channel only when the developer names it. Skip a channel whose permalink is not on
42
+ skedulo.slack.com. Before using any other channel, look up every distinct human author, including
43
+ the authors of thread replies you read, with `slack_read_user_profile`. Treat an author as Skedulo
44
+ staff only when the profile shows a skedulo.com email and is not restricted. If any author is not,
45
+ or a lookup fails, skip the whole channel and list it under "Left out".
46
+
47
+ A document marked as a draft, or not approved, is a lead, never an authority: confirm it in another
48
+ source before it becomes an entry, and never let it create a `core` or don't-build entry on its own.
49
+
50
+ **Existing hub knowledge** for this project is a set of leads, not an authority. Use only items the
51
+ whole project team can read: `memory_list` with each of the project's repos and `visibility=Team`,
52
+ and `memory_recall scope=team` results whose visibility is Org, or Team on one of the project's
53
+ repos. Never use or cite Private or Restricted items. Confirm each lead in the sources above before it
54
+ becomes an entry, cite the source that confirms it, and never copy a hub item as it is.
55
+
56
+ Record every source you read on the Sources page.
57
+
58
+ ## Discover features
59
+
60
+ Build the feature map before drafting any entry, and refresh it whenever update mode refreshes from
61
+ sources. A feature is a part of the system a ticket can be about: one business capability with its
62
+ own code.
63
+
64
+ 1. Collect candidates from four signals: code areas, the section headings of the technical documents,
65
+ Linear projects, epics and labels, and the process names in the business documents. A code area
66
+ is a function handler, a group of triggered actions, a Horizon page or component, a custom object
67
+ with its fields, or an integration or scheduled job. Ignore tests, generated files, vendored code
68
+ and build configuration.
69
+ 2. Merge candidates that point at the same code or the same process. Aim for 5 to 15 features. Merge,
70
+ split and fold only candidates that have no key yet: an existing key keeps its section, its code
71
+ paths and its Rules page. When an existing feature's code now spans unrelated areas, suggest the
72
+ split under "Worth a look" instead of moving code paths.
73
+ 3. Give each new feature a stable kebab-case key (`ride-automation`, `region-rollout`). Reuse the keys
74
+ already in the feature map or in the Rules page titles, and never rename one.
75
+ 4. Write `<Project> › Reference › feature-map` (format in page-format.md): for each feature, a one-line
76
+ purpose and the code paths, document sections, ticket labels or epics, business processes and
77
+ Slack channels it covers.
78
+ 5. Check coverage both ways. Every code area belongs to a feature. Every feature has code: a feature
79
+ without code is either not built yet (list it under "Worth a look") or a business concept that
80
+ belongs on a reference page. Report what does not fit under "Coverage" in the summary.
81
+
82
+ ## Create
83
+
84
+ 1. Discover and read the sources in order of authority, and note each one's version for the Sources
85
+ page.
86
+ 2. Discover the features and draft the feature map.
87
+ 3. Draft per feature: rules (`R`) and constraints (`C`), the don't-build list (`D`), and the reference
88
+ topics worth a page (data model, APIs, workflows, glossary, troubleshooting, overview).
89
+ 4. Apply the decision rules to every entry: winner, `Conflict:` notes, tier, status, gaps.
90
+ 5. Apply the confidentiality rules. Remove anything they forbid and list what you removed.
91
+ 6. Check the work.
92
+ 7. Number the entries from the first ID of each kind, and start the feature map with the
93
+ `Next IDs` line. Save each page with
94
+ `memory_save type=Wiki repo=<delivery repo uid> title=... content=... source={repo, commit}`
95
+ (page-format.md, "Page source"), with `tags=["ProjectRules"]` on rules and don't-build pages. Every page ends with a change-log line
96
+ (`<date> · <developer> via project-knowledge · Created · from <sources>`). Check each result
97
+ reports `visibility: "Team"`; if one does not, stop and tell the developer. Save the feature map
98
+ with them.
99
+ 8. Save the Sources page last, then give the summary.
100
+
101
+ **Resuming a create that stopped partway** (pages but no Sources page): leave the saved pages and
102
+ their IDs as they are and do not re-draft them. Run discovery and the feature map, reusing the feature
103
+ keys from the saved Rules page titles. Draft, check and save only the pages that are missing, numbered
104
+ from the `Next IDs` line (or from the highest existing IDs when it is missing), then save the Sources
105
+ page.
106
+
107
+ ## Refresh from sources
108
+
109
+ **Refresh from sources**: the developer asks to refresh, or no change list was handed over.
110
+
111
+ Read only what changed since the last run, and build on the pages as they are: never rebuild what is
112
+ already there.
113
+
114
+ 1. Read the Sources page. For each source, read its current version (see "Source versions" below) and
115
+ compare it with the recorded one. A source you cannot reach is listed as not checked, not as
116
+ unchanged. Then, by kind:
117
+ - `repo` whose commit moved: run the touch update (`touch.md`) for `<recorded commit>..origin/<default>`.
118
+ Never reread the repo. Its changes join this refresh's steps 3 to 5, so the run checks, asks
119
+ about core changes and summarises once.
120
+ - `linear`: never read a version per ticket. List the team's tickets updated after the watermark,
121
+ and read only those that can change knowledge (Discover sources, step 2). Find approved plans in
122
+ one call, `memory_list type=Scenario repo=<delivery repo uid> titlePrefix="# Delivery plan:"`,
123
+ not from Linear. Move the watermark to the newest `updatedAt` you processed.
124
+ - `slack`: read only messages after the recorded latest one, with the same author checks.
125
+ - a document with a new version: reread that document only and compare it with the entries that
126
+ cite it and the feature map's `Docs:` lines. A changed SOW, work order or change request changes
127
+ scope: send only its scope and don't-build changes to the checker. Then read the tickets it cites
128
+ that you have not read yet.
129
+ - unchanged sources: nothing.
130
+ Look for new sources only where they can appear since the last run: repos newly linked to the team,
131
+ and documents created or modified after the last `read` date.
132
+ 2. For each changed or new source other than a `repo`, compare what changed with the pages it feeds. Work out, per
133
+ feature: new entries (next free IDs), changed text, tier changes, entries a newer decision
134
+ overrides (a `Conflict:` note plus a new entry), entries to retire, `Pending` entries to resolve,
135
+ and status changes the Status rule now supports, using the decision rules.
136
+
137
+ A `pack` source has moved when its recorded commit differs from the checkout's HEAD or
138
+ `memory_checkSources` reports its pages behind. Re-read it by running `import convert` again with
139
+ the same `--project` and `--prefix` and `--out "$TMPDIR/memory-hub-import/<PREFIX>-refresh.json"`
140
+ (it saves nothing, and nothing is written in the checkout). Compare that plan's pages with the hub
141
+ pages entry by entry, matched by ID (an entry moved to Don't build cites its old ID as
142
+ `(was <PREFIX>-C<n>)`), on rule text and source only: a fresh convert marks every entry `standard`
143
+ and `unverified`, so never revert a hub entry's tier, status, `Conflict:` note or retirement, and
144
+ never remove an entry the pack does not have. If a pack entry's ID is already used by a different
145
+ hub entry, give the pack entry the next free ID and say so in the summary. Never run
146
+ `import apply` for a project that already has pages; the CLI refuses it. Delete the new plan and
147
+ review files when you are done: they may hold flagged values.
148
+ 3. Apply the confidentiality rules to every change, then check the changed and new entries (see
149
+ "Check the work").
150
+ 4. Apply every change that does not touch an existing `core` entry, with the team-safe editing steps
151
+ in page-format.md, numbering new entries from the `Next IDs` line. For a `repo` whose commit moved, set the
152
+ `source` of every project page of that repo to the commit the refresh diffed through, touched or
153
+ not, since the whole range was checked ("Page source" in page-format.md); set any other page you
154
+ checked to the commit you checked it against. Never touch a page fed by a pack.
155
+ 5. Handle core changes (see "Core changes").
156
+ 6. Update the Sources page with the versions you read, through the same editing steps, then give the
157
+ summary. For each pack source, also set the pages it feeds to the new commit
158
+ (`memory_update ... source={repo: "<owner/name>", commit: "<sha>"}` with `expectedLastModified`),
159
+ so `memory_checkSources` stops reporting them.
160
+
161
+ ## Sources-only refresh
162
+
163
+ **Sources-only refresh**: the developer asks to refresh the sources, or the weekly sweep runs it. The
164
+ touch update and the sweep keep the pages in step with the code; this reads everything else.
165
+
166
+ Run "Refresh from sources" steps 1 to 6, skipping every `repo` source:
167
+
168
+ - Step 1: never run the touch update and never read a repo. Repos newly linked to the team are
169
+ listed in the summary under "Worth a look", not read.
170
+ - Step 4: leave each page's `source` as it is, since no code was read.
171
+ - Step 6: leave the Sources page's `repo` lines as they are; update only the sources you read.
172
+
173
+ When it runs unattended (the sweep), it never asks. Apply only the changes that do not touch an
174
+ existing `core` entry. Apply none of the core changes, write nothing about them to the pages, and
175
+ list them in the summary as waiting. Anything that would make it stop and ask ends the run with a
176
+ summary that says why.
177
+
178
+ ## Source versions
179
+
180
+ How to read each source's current version for the Sources page:
181
+
182
+ - `repo`: the default branch on the remote, never the checkout's HEAD: `git -C <checkout> fetch -q origin`
183
+ then `git -C <checkout> rev-parse origin/<default>` (find the default branch with
184
+ `gh api repos/<owner>/<name> --jq .default_branch`), or `gh api repos/<owner>/<name>/commits/<default> --jq .sha`.
185
+ - `linear`: one watermark line per team and project, `linear · team <name> · project <name> ·
186
+ updated through <ISO time>`: the newest `updatedAt` among the tickets processed. A Sources page from
187
+ before this release has one line per ticket: on the next refresh, read none of them; set the
188
+ watermark to the newest `updatedAt` they recorded, then list the tickets updated after it.
189
+ - `confluence`: the Atlassian connector's get-page call; use the page's `version.number`.
190
+ - `local`: `shasum -a 256 "<path>"`.
191
+ - `gdrive`: the Google Drive connector's file-metadata call; use `modifiedTime` (or `version`).
192
+ - `slack`: the Slack connector's read-channel call; use the newest message's time.
193
+ - `hub`: `memory_get` on the item; use its `lastModifiedDate`. Record only Team or Org items, by type
194
+ and uid, never by title. Hub items are leads: a changed one is re-checked against the sources it
195
+ points to.
196
+ - Documents kept in a repo are covered by that repo's `repo` line.
197
+ - `pack`: `git -C <checkout> rev-parse HEAD` in an up-to-date checkout of the shared memory repo, or
198
+ `memory_checkSources` run in that checkout, which lists imported pages whose commit is behind.
@@ -0,0 +1,75 @@
1
+ # Decision rules
2
+
3
+ Apply these instead of asking. Every decision must be visible in the entry it affects.
4
+
5
+ **Which source wins when they disagree:**
6
+
7
+ 1. A **decided ticket** wins over the code: one whose workflow state type is `started` (whatever its
8
+ name: In Progress, In Review, In QA, Ready for Prod), one with a linked open PR, or a confirmed bug
9
+ report (a Bug label and a state type of `unstarted` or `started`). Keep its rule as `unverified`
10
+ with `Pending SOL-1234 (PR #452)` after the source, and add the current built behaviour to the
11
+ troubleshooting page as a known gap. A ticket whose delivery plan was approved (plan-ticket posted
12
+ `Delivery plan (approved <date>)` on it) is decided too, whatever its state, until it is
13
+ `completed` or `canceled`. Other tickets in `triage`, `backlog` or `unstarted`, and `canceled` or
14
+ duplicate tickets, are ideas, not decisions: they never override the code; note
15
+ relevant ones on the troubleshooting page. For `completed` tickets the code wins, because it
16
+ already reflects them.
17
+ 2. Otherwise the **code** wins: it is what the system does.
18
+ 3. Among documents, after a newer ticket decision: on whether something is in or out of scope, SOWs,
19
+ work orders and change requests win over technical documents, and among them the newer one wins (a
20
+ change request amends the SOW). On how the system works, technical documents win over business
21
+ documents, and between two technical documents the newer one wins. Slack comes last.
22
+ 4. The losing claim is never rewritten silently. Keep its line with
23
+ `Conflict: overridden by <PREFIX>-R<n> (<rule>: <one-line reason>)`, for example
24
+ `(code over TDD: the code uses travel time, capped at 60 min)`, and add the winning entry with its
25
+ own ID and source.
26
+
27
+ **Pending entries:** when a refresh finds that the ticket behind a `Pending` entry is now `completed`,
28
+ confirm the behaviour in the code: if the code has it, drop the `Pending` note, make the entry
29
+ `verified` citing the code, and remove its known-gap line from the troubleshooting page; if not, the
30
+ code wins (rule 1): replace the `Pending` note with `(not found in code)`, keep it `unverified`, and
31
+ keep the gap on the troubleshooting page.
32
+ When the ticket is `canceled`, the code wins: add a `Conflict:` note pointing at the built behaviour,
33
+ or retire the entry when nothing replaces it, and remove its known-gap line from the troubleshooting
34
+ page.
35
+
36
+ **What becomes an entry:**
37
+
38
+ - Built behaviour with no rule in any document becomes a rule, `verified`, citing the code, with its
39
+ tier set by the tier rule below.
40
+ - A document rule the code should show but does not stays a rule, `unverified`, with
41
+ `(not found in code)` after the source, however many documents state it. The summary lists these as
42
+ gaps.
43
+ - A business rule that the code implements becomes a rule citing both the business document and the
44
+ code, with the business reason in its text, and is `verified`.
45
+ - Work a SOW, work order, change request or completed ticket explicitly descopes becomes a don't-build
46
+ entry, `verified` unless a newer source brings it back into scope. A descope from a decided ticket
47
+ that is still pending is `unverified` with `Pending <ticket>`; one that only Slack or a ticket that
48
+ is not decided states is `unverified`, and never `core`. A draft alone never creates a don't-build
49
+ entry: note its descope on the troubleshooting page.
50
+ - Business processes, terms and the reasons behind rules go on the reference pages (workflows,
51
+ glossary, overview), each citing its source.
52
+ - Ambiguous wording, inconsistent code and open questions go to the
53
+ `<Project> › Reference › troubleshooting` page, never to a question for the developer.
54
+
55
+ **Tier:** `core` when breaking the entry would lose or corrupt data; change something another system
56
+ relies on (an external sync, an integration, a locked record); bypass a permission, role, region or
57
+ tenant guard; or break contracted scope. Never demote an entry that meets these criteria to `standard`
58
+ to keep the count low. `detail` for wording,
59
+ labels, defaults and configuration values. `standard` for everything else.
60
+
61
+ **Status:** `verified` when the code shows it; for a don't-build entry, when a SOW, work order, change
62
+ request or completed ticket that is not a draft descopes it and no newer source brings it back; for
63
+ another entry the code
64
+ cannot show (a scope limit, an external constraint, a manual process), when two independent documents
65
+ agree.
66
+ Two documents are independent only if neither was written from the other or from the hub. Knowledge
67
+ Hub corpus files are compiled from the other sources: cite them for business context, but never count
68
+ one toward `verified`. `unverified` in every other case, including when only Slack says it or a
69
+ decided ticket is still pending.
70
+
71
+ **Feature keys:** come from the feature map (see "Discover features"). Every Rules page belongs to one
72
+ feature in it.
73
+
74
+ **Slack:** use it to find leads, then confirm them in code or tickets. Never quote Slack. A claim only
75
+ Slack makes is `unverified`.
@@ -0,0 +1,87 @@
1
+ # Import
2
+
3
+ Imports a knowledge pack, `domains/<name>/` in a checkout of the shared memory repo, through the
4
+ `memory-hub-mcp import` CLI, which saves through the same path as `memory_save`, so every page is
5
+ embedded. Each imported page records the pack's repo and commit as its source. Never edit the shared
6
+ memory repo from this skill: it changes only through its own publish tool.
7
+
8
+ 1. If pages already exist for the project, do not import: importing again would duplicate titles or
9
+ start a second ID prefix, and `import apply` refuses it. To pick up a pack that has moved, use
10
+ a refresh from sources.
11
+ 2. Find the shared memory repo checkout: a git repo beside the delivery repo's checkout or in its
12
+ parent folder that has `domains/*/rules.json` or `domains/*/memory/`. Ask for its path only when the
13
+ developer asked to import and you cannot find one. The pack is the `domains/<name>` whose name
14
+ equals the delivery repo's name, or else contains the team's name without punctuation; when several
15
+ contain it, take the one with the most recent commit
16
+ (`git -C <checkout> log -1 --format=%ct -- domains/<name>`) and name the choice in the summary.
17
+ Also settle the project name, the ID prefix and the delivery repo as `owner/name`.
18
+ 3. The CLI needs `MEMORY_HUB_MCP_TOKEN` in the environment. `memory-hub-mcp setup` stores it in
19
+ `~/.claude/settings.json`, which Claude Code passes to commands. If it is missing, stop and tell the
20
+ developer how to provide it. A plugin install whose token was entered only in the plugin's token
21
+ option gives it to the memory-hub server alone: add `"env": {"MEMORY_HUB_MCP_TOKEN": "<token>"}` to
22
+ `~/.claude/settings.json` and restart Claude Code, or export it in this shell; do not re-run setup,
23
+ which would add a second memory-hub server. Any other install: run
24
+ `npx -y @skedulo/memory-hub-mcp@latest setup --code`, or export the token in this shell.
25
+ 4. Convert. This saves nothing:
26
+
27
+ ```bash
28
+ npx -y @skedulo/memory-hub-mcp@latest import convert "<checkout>/domains/<name>" --project "<Project>" --prefix <PREFIX> --by "<developer name>"
29
+ ```
30
+
31
+ It prints the plan file (JSON) and the review file (Markdown) beside it.
32
+ 5. Resolve every flag yourself, one by one, using the confidentiality rules, including those listed
33
+ under "Probably project terms"; never resolve that group as a block. Look at every occurrence the
34
+ flag lists, not only the first. Never resolve a `uuid`, `salesforce-id`, `phone` or `currency` flag,
35
+ nor an `email` flag unless the address is at skedulo.com: remove those values. Mark a `person-name`
36
+ flag `"resolved": true` only for a Skedulo staff name (a Slack or Linear profile shows a skedulo.com
37
+ email), the customer's organisation name, or a term that names a thing in the code or the technical
38
+ documents. Remove every other flagged value from the content of every item the flag lists in the
39
+ plan JSON, and skip an item (`"skip": true`) only when nothing useful is left. List what you removed
40
+ in the summary.
41
+ 6. Every imported entry arrives `standard` and `unverified`. Set tiers with the decision rules, and set
42
+ an entry `verified` when the delivery repo's code, read at its default branch on the remote (see
43
+ "Discover sources"), shows it. Move each constraint whose category is
44
+ `scope` to a planned `<Project> › Don't build` page (tagged `ProjectRules`, with the change-log
45
+ footer) as a new `<PREFIX>-D<n>` entry with the next free D number, citing `(was <PREFIX>-C<n>)`;
46
+ move the C line under `## Retired` on its Rules page with `Retired <date>: moved to <PREFIX>-D<n>`.
47
+ Put that page in the plan's `pages` before the Sources page, so the Sources page is always saved
48
+ last. Then check the work, with the code as the source to check against. Edit all results into the
49
+ plan JSON. Step 5 and this step are safe to redo on a plan that is already partly edited.
50
+ 7. Save:
51
+
52
+ ```bash
53
+ npx -y @skedulo/memory-hub-mcp@latest import apply "<plan.json>" --repo <owner/name>
54
+ ```
55
+
56
+ It refuses while a flagged value is unresolved, when the repo has no team, or when the embedding
57
+ model does not load. It writes each saved uid into the plan file, so if it stops partway, run the
58
+ same command again and it resumes.
59
+ 8. When apply has finished without errors, delete the plan and review files: they still hold the
60
+ flagged values. Keep them while an apply is unfinished: the plan file is what it resumes from.
61
+ 9. Run a refresh from sources in the same run: it discovers the other sources and the features, checks
62
+ the imported entries against them, and writes the feature map. Then give the summary.
63
+
64
+ **Resuming an import without its plan file** (pages whose change logs say
65
+ `Imported every entry as unverified · knowledge pack <name>`, but no Sources page and no plan file, for
66
+ example on another machine): `import apply` refuses pages its plan did not record, so rebuild the
67
+ plan.
68
+
69
+ 1. Take the pack from the saved pages, never by Import step 2's matching: its name from the change-log
70
+ line (`knowledge pack <name>`), its repo and commit from the pages' `source` (`memory_get`). Find a
71
+ checkout of that repo as Import step 2 does. If there is none, end the run: save nothing, and say
72
+ the import must be finished where the shared memory repo is checked out. Run Import steps 3 and 4
73
+ on `domains/<name>` at that commit: when the checkout's HEAD differs, convert from a worktree of it
74
+ at that commit under `$TMPDIR/memory-hub-import/`, removed afterwards with `git worktree remove`.
75
+ 2. For each plan page whose title matches an existing `<Project> ›` page, write that page's uid into
76
+ its `savedUid`. An existing `<Project> › Don't build` page has no plan page yet: add one before
77
+ the Sources page with its uid as `savedUid`. For each plan fact whose content matches a Fact
78
+ already on the delivery repo (`memory_list type=Fact repo=<delivery repo uid> titlePrefix="<its
79
+ first words>"`), write that Fact's uid into its `savedUid`, so apply does not save it twice. If any
80
+ other existing page has no matching title in the plan, stop the import and resume it as a create
81
+ (see "Create") instead.
82
+ 3. Run Import step 5 on the new plan, and step 6 only on the pages without a `savedUid`. Number every
83
+ new R or D entry above the highest IDs on the saved pages, and take each moved constraint's D
84
+ number from the saved Rules pages' `Retired <date>: moved to <PREFIX>-D<n>` lines. When the Don't
85
+ build page is already saved, add its new D entries to it now, before step 7, with the team-safe
86
+ editing steps in page-format.md, so an interruption still finds no Sources page and resumes here.
87
+ 4. Continue with Import steps 7 to 9.
@@ -28,9 +28,11 @@ all to the same team; the pages attach to the delivery repo only.
28
28
  area name later, so never derive it from a ticket key or a date, and never rename one. Every key on a
29
29
  Rules page is listed in the feature map.
30
30
 
31
- The feature map has one section per feature:
31
+ The feature map starts with the ID ledger, then one section per feature:
32
32
 
33
33
  ```
34
+ Next IDs: WELBE-R142 · WELBE-C38 · WELBE-D12
35
+
34
36
  ## ride-automation
35
37
  Creates, times and allocates Ride jobs for appointments, and keeps them in step with changes.
36
38
  - Code: Skedulo/CX-Welbe_Transporation src/core/object-services/rides-management/**, src/triggered-actions/*-adjust-rides.triggered-action.json
@@ -63,8 +65,14 @@ One entry per bullet, so a skill can copy it verbatim into a sub-issue:
63
65
  ```
64
66
 
65
67
  - ID: `<PREFIX>-R<n>` for a rule, `<PREFIX>-C<n>` for a constraint, `<PREFIX>-D<n>` for a don't-build
66
- item. IDs are unique within the project and never reused. The next ID is one more than the highest
67
- existing number of that kind across all the project's pages. Imported entries keep their number.
68
+ item. IDs are unique within the project and never reused. Imported entries keep their number.
69
+ The next free IDs are on the feature map's `Next IDs` line. Reserve before you write: count the
70
+ new entries of each kind, raise the line by that many in one team-safe edit, and only after that
71
+ edit succeeds write the entries, `Conflict:` notes and change-log lines with the reserved IDs. On a
72
+ `Conflict:`, read the line again and reserve again before writing anything. When the line is
73
+ missing (pages made before it existed, or a fresh import), set it once to the highest number of
74
+ each kind across all the project's pages, plus one. A project with no feature-map page yet numbers
75
+ from those highest numbers, and the run that creates the feature map writes the line.
68
76
  - Tier: `core` (changing it later needs the developer's confirmation of that entry), `standard`, or
69
77
  `detail` (wording, labels, defaults, configuration values). An entry is `core` when breaking it would
70
78
  lose or corrupt data, change something another system relies on, bypass a permission, role, region
@@ -80,7 +88,9 @@ One entry per bullet, so a skill can copy it verbatim into a sub-issue:
80
88
  pending.
81
89
  - Source: the document and section, the Linear issue, `code: <owner/name>@<short sha> <path>`, or
82
90
  `doc: <owner/name>@<short sha> <path>` for a document kept in a repo. Cite the source that
83
- confirmed an entry, never a hub item on its own.
91
+ confirmed an entry, never a hub item on its own. An entry's code citation names the commit it was
92
+ last confirmed at. An entry backed only by documents gets `checked <date>` after its source when the
93
+ checker confirms it.
84
94
  Add `(not found in code)` when a document rule has no match in the code, or when the ticket behind
85
95
  a `Pending` note completed without the behaviour reaching the code (it replaces the `Pending` note),
86
96
  and `Pending SOL-1234 (PR #452)` when a decided ticket changes it: workflow state type `started`, a
@@ -121,7 +131,7 @@ One line per source:
121
131
 
122
132
  ```
123
133
  - `repo` · Skedulo/cx-lindamood-bell@main · commit 4be1c0d · read 2026-10-21
124
- - `linear` · SOL-1234 · updatedAt 2026-10-20T03:00:00.000Z · read 2026-10-21
134
+ - `linear` · team Lindamood Bell · project LMB Delivery · updated through 2026-10-20T03:00:00.000Z · read 2026-10-21
125
135
  - `confluence` · page 123456789 "LC Technical Design" · version 14 · read 2026-10-21
126
136
  - `local` · docs/TDD For Schools.pdf · sha256 `9f2c…` · read 2026-10-21
127
137
  - `gdrive` · file 1AbCdEf "LC Statement of Work" · modifiedTime 2026-10-19T22:10:00.000Z · read 2026-10-21
@@ -130,22 +140,7 @@ One line per source:
130
140
  - `pack` · <owner/name of the shared memory repo> domains/cx-lindamood-bell · commit 7a3e9b1 · read 2026-10-21
131
141
  ```
132
142
 
133
- How to read each version now:
134
-
135
- - `repo`: the default branch on the remote, never the checkout's HEAD: `git -C <checkout> fetch -q origin`
136
- then `git -C <checkout> rev-parse origin/<default>` (find the default branch with
137
- `gh api repos/<owner>/<name> --jq .default_branch`), or `gh api repos/<owner>/<name>/commits/<default> --jq .sha`.
138
- - `linear`: the Linear connector's get-issue (or get-project/get-document) call; use `updatedAt`.
139
- - `confluence`: the Atlassian connector's get-page call; use the page's `version.number`.
140
- - `local`: `shasum -a 256 "<path>"`.
141
- - `gdrive`: the Google Drive connector's file-metadata call; use `modifiedTime` (or `version`).
142
- - `slack`: the Slack connector's read-channel call; use the newest message's time.
143
- - `hub`: `memory_get` on the item; use its `lastModifiedDate`. Record only Team or Org items, by type
144
- and uid, never by title. Hub items are leads: a changed one is re-checked against the sources it
145
- points to.
146
- - Documents kept in a repo are covered by that repo's `repo` line.
147
- - `pack`: `git -C <checkout> rev-parse HEAD` in an up-to-date checkout of the shared memory repo, or
148
- `memory_checkSources` run in that checkout, which lists imported pages whose commit is behind.
143
+ How to read each version is in `create-refresh.md`, "Source versions".
149
144
 
150
145
  ## Editing a page (team-safe)
151
146
 
@@ -154,11 +149,20 @@ Any member of the project team can edit these pages; two developers must not ove
154
149
  1. `memory_get type=Wiki uid=<uid>`; keep its `content` and `lastModifiedDate`.
155
150
  2. Apply the change to the full text. Keep every other line exactly as it was.
156
151
  3. Append the change-log line.
157
- 4. `memory_update type=Wiki uid=<uid> content=<full new text> expectedLastModified=<lastModifiedDate>`.
152
+ 4. `memory_update type=Wiki uid=<uid> content=<full new text> expectedLastModified=<lastModifiedDate>`,
153
+ adding `source={repo: "<owner/name>", commit: "<full sha>"}` when you checked the page's entries
154
+ against that commit (see "Page source" below).
158
155
  5. If it fails with `Conflict:`, someone else changed the page. Go back to step 1 and re-apply the
159
156
  change to the new text. Keep their edit; if it changed the same entry, keep their version, record
160
157
  your change as a new entry or a `Conflict:` note instead, and mention it in the summary.
161
158
 
159
+ **Page source.** Every Rules, Don't build and reference page records, as its `source`, the repo most
160
+ of its code citations point at and the commit its entries were last checked against. Set it when you
161
+ save a page and whenever you check its entries against a newer commit; never set it to a commit you
162
+ did not check against. A page fed by a knowledge pack keeps the pack's repo and commit as its
163
+ `source` instead, because `memory_checkSources` uses it to report pack changes. It lets `memory_list verifiedBefore=<date>` find pages nobody has checked for
164
+ a while.
165
+
162
166
  Teammates can change a page's title, content and tags. Only the page's author can move it to another
163
167
  repo or change its links. Deleting a page is author-only too; prefer retiring entries over deleting
164
168
  pages.
@@ -0,0 +1,49 @@
1
+ # Targeted update
2
+
3
+ **Targeted update**: a change list handed over by plan-ticket, delegate-ticket or fold-findings, a
4
+ change list from a document ask reread (with that document's version, see "Document version"), a
5
+ commit range with no change list handed over by the weekly sweep (sweep-knowledge), or a change the
6
+ developer asks for by entry ID. Do not re-read sources or rediscover. It may touch only:
7
+
8
+ - the entries listed (for a commit range, the entries its touch update changes);
9
+ - the feature-map changes the list carries;
10
+ - the `Next IDs` line;
11
+ - the touch update's feature-map changes;
12
+ - a handed-over document version, on that document's Sources line (see "Document version").
13
+
14
+ When the handed-over delivery repo has no `<Project> ›` pages or no Sources page, end the run and
15
+ say so, naming the changes not applied: a targeted update never creates, resumes or imports. A change marked
16
+ "from ticket" by plan-ticket becomes a new entry, `unverified` with `Pending <PARENT-ID>`, and the entry
17
+ it overrides gets a `Conflict:` note; a change marked "from code" cites the code.
18
+
19
+ Never move a Sources page watermark; only a refresh or a catch-up does, except a document version
20
+ handed over with a reread of that document.
21
+
22
+ **Document version.** A caller that reread a Confluence page or Google Drive file (ask does, when
23
+ the document changed since its Sources line) may hand over that document's new version together
24
+ with the changes it took from it: the Confluence `version.number`, or the Drive `modifiedTime`. The
25
+ caller hands the version over only when it read the whole document and listed every change in it
26
+ that differs from the project's pages; a caller that read part of it (ask reads a document to answer
27
+ one question) hands over the changes without a version, and then nothing here touches the Sources
28
+ line, so the next refresh reads the document. A version handed over without such a full reread is
29
+ ignored. After the changes are applied (steps 1 and 2), replace the version on that document's own
30
+ line on the Sources page, and no other line, with the team-safe editing steps in page-format.md:
31
+ `confluence · page <id> "<title>" · version <n>` or `gdrive · file <id> "<title>" · modifiedTime <t>`, and set
32
+ `read` to today. Record it only when the changes taken from that document were saved or already
33
+ there; when any was declined or left waiting (core), leave the line as it is so a later run
34
+ reads the document again. Add a change-log line saying which document's version moved.
35
+
36
+ 1. Apply the confidentiality rules to the listed changes, then check them (see "Check the work",
37
+ which says which of them need the checker).
38
+ 2. Apply every change that does not touch an existing `core` entry, with the team-safe editing steps
39
+ in page-format.md, numbering new entries from the `Next IDs` line. Each change-log line gives the
40
+ caller's reason word for word as its why (fold-findings puts the PR URL in it), so a later run can
41
+ tell the change is already made.
42
+ 3. When the caller also handed over a commit range or a PR's changed files, run the touch update for
43
+ it (`touch.md`), so code changes the change list does not mention are caught too. It skips the
44
+ entries steps 1 and 2 changed. Put its changes through steps 1 and 2 as well (confidentiality,
45
+ check, apply); they join this run's core question and summary.
46
+ 4. Handle core changes (see "Core changes").
47
+ 5. Give the summary, including the entry ID each listed change was given or changed, so the caller can
48
+ use the real IDs, and each listed change that was not saved as an entry (declined, or moved to
49
+ troubleshooting because the checker found nothing that supports it) with the reason.
@@ -0,0 +1,66 @@
1
+ # Touch update
2
+
3
+ Keeps the pages in step with the code from what changed, reading only that. It never rereads
4
+ unchanged code and never rebuilds the project. Callers:
5
+
6
+ - fold-findings, with a merged PR's changed files (status, previous name, number of changes and patch
7
+ for each), its merge sha `<B>`, and the commit just before it on the default branch (`<B>^1`);
8
+ - a refresh from sources, for each `repo` source whose recorded commit moved (range
9
+ `<recorded commit>..origin/<default>`);
10
+ - the developer, for example "catch up the ACH knowledge with the code": the same as a refresh, for
11
+ the code only.
12
+
13
+ 1. Get the changed files. From fold-findings, use the PR's file list and read each path's change from
14
+ its `patch`. Otherwise run `git -C <checkout> fetch -q origin`, then
15
+ `git -C <checkout> diff -M --name-status <A> <B>` (or
16
+ `gh api repos/<owner>/<name>/compare/<A>...<B> --jq '.files[] | [.status, .filename, .previous_filename, .changes] | @tsv'`).
17
+ A pure rename is `R100`, or `renamed` with 0 changes; any other rename was also edited. Ignore
18
+ tests, generated files, vendored code and build configuration.
19
+ 2. Map each changed path to features with the feature map's `Code:` globs, using the previous path for
20
+ a rename. A path in a shared module (utilities, the object model, config variables,
21
+ triggered-action definitions) also touches every feature whose code imports or uses it; follow the
22
+ architecture map's edges for calls between repos. A new path no glob covers is a new code area:
23
+ add it to the feature it sits beside or that imports it, or, when it is a capability of its own,
24
+ start a new feature (step 7).
25
+ 3. For each touched feature, read its Rules page, its don't-build entries, and the reference pages
26
+ whose lines cite a changed path. Look only at entries that cite a changed path (by its previous
27
+ name for a rename) and whose path changed between their cited commit and `<B>`. Leave out retired
28
+ entries, entries with a `Conflict:` note, entries already changed earlier in this run, and entries
29
+ marked `Pending`: a Pending note is resolved by its ticket's state (decision rules, "Pending
30
+ entries"), never by a diff. For each remaining entry:
31
+ - pure rename: rewrite the cited path and the feature map's glob, keep the ID;
32
+ - edited rename, or modified: rewrite the path and the glob if it moved, then read the change (the patch, or
33
+ `git -C <checkout> diff -M <A> <B> -- <old path> <new path>`), and the file at `<B>` only when the
34
+ change is not enough to decide. Same behaviour: keep the line. Different behaviour: apply
35
+ decision rule 4, because the code wins: keep the line with a `Conflict:` note and add the new
36
+ entry;
37
+ - deleted with nothing replacing it: retire the entry with the reason.
38
+ Behaviour the change adds that no entry covers becomes a new entry, by the decision rules.
39
+ 4. Move an entry's cited commit to `<B>` only when its path is known unchanged in between. In a
40
+ refresh or a catch-up, always. From fold-findings, only when
41
+ `git -C <checkout> diff --quiet <cited commit> <B>^1 -- <path>` passes; otherwise keep the old
42
+ commit (with the new path), so the next refresh checks the merges in between.
43
+ 5. Keep what people corrected. An entry was edited by a teammate when the newest change-log line that
44
+ names its ID has no `via project-knowledge` and is not the import line
45
+ (`Imported every entry as unverified`). Never rewrite such an entry's text from the code; when the
46
+ code contradicts it, add a `Conflict:` note and a new entry. Path and commit moves are fine.
47
+ 6. Large change: when more than half of a feature's cited paths changed or were deleted, not counting
48
+ renames whose change does not alter behaviour (imports, paths, formatting), rebuild that feature
49
+ only. Draft it from the code at `<B>` (Create steps 3 to 5, for
50
+ this feature), match each draft to an existing entry by meaning, keep the IDs and lines of the
51
+ entries that still hold, add new entries, and retire or override the rest with a reason. Never
52
+ rebuild the whole project.
53
+ 7. New feature: draft it as in Create steps 3 to 5, for this feature only, giving the drafter the
54
+ project overview and one neighbouring Rules page as examples of tier and wording. Only a new
55
+ feature's entries get the full checker sample.
56
+ 8. Finish:
57
+ - inside a targeted update or a refresh: hand the changes, including feature-map changes, to the
58
+ caller, which checks, applies, asks about core changes and gives the summary once for the run;
59
+ - a catch-up: run steps 1 to 7 for every repo on the Sources page first, then, once for all of
60
+ them, check the new and changed entries ("Check the work"), apply them with the team-safe editing
61
+ steps, numbering from the `Next IDs` line, handle "Core changes", and give the summary, with the
62
+ ranges under "Sources read". Only after applying, set the `source` of every project page whose
63
+ `source` names that repo to its `<B>`, touched or not, since the whole range was diffed (except
64
+ a page fed by a pack), and each repo's line on the Sources page to its `<B>`.
65
+ A refresh sets the page sources the same way in its step 4 and the Sources page lines in its step 6. From fold-findings, leave both as
66
+ they are: other merges may lie between them and `<B>`, and the next refresh covers them.