@skedulo/memory-hub-mcp 0.2.15 → 0.2.17

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.
@@ -1,21 +1,28 @@
1
1
  ---
2
2
  name: plan-ticket
3
- description: Use when a developer wants to plan a Linear ticket for a customer product against that product's knowledge in the memory hub, e.g. "plan SOL-1234", "break this story down", before creating sub-issues with delegate-ticket.
3
+ description: Use when a developer wants to plan a Linear ticket for a customer project against that project's knowledge in the memory hub, e.g. "plan SOL-1234", "break this story down". Approving the plan creates the sub-issues and starts the Linear Dev Agent, unless the developer says "plan only" or "don't assign".
4
+ argument-hint: "<ticket, e.g. SOL-1234>"
4
5
  ---
5
6
 
6
7
  # Plan a ticket
7
8
 
8
- Turn one Linear issue (the parent) into a master plan of outcomes that the developer approves, using
9
- the product's rules, don't-build list and reference pages from the memory hub, and the code. The
10
- product knowledge format is defined in the product-knowledge skill's `references/page-format.md`;
11
- the parts you need are restated here.
9
+ Turn one Linear issue (the parent) into a master plan of outcomes, using the project's rules,
10
+ don't-build list and reference pages from the memory hub, and the code. The project knowledge format
11
+ is defined in the project-knowledge skill's `references/page-format.md`; the parts you need are
12
+ restated here.
13
+
14
+ Decide, then report. Resolve conflicts and gaps yourself with the rules in step 4 and write your
15
+ reasoning into the plan. The developer is asked one thing only: to approve the plan. Approval also
16
+ starts delivery: the plan is delegated and the first sub-issues go to the Linear Dev Agent, unless the
17
+ developer says "plan only" or "don't assign".
12
18
 
13
19
  ## First, check the server version
14
20
 
15
- Look at the parameters of the `memory_update` tool; if only its name is listed, load its schema first.
16
- If there is no `memory_update` tool at all, the memory-hub server is not connected: say so and stop.
17
- If it has no `expectedLastModified` parameter, the memory-hub server is older than this release and
18
- cannot edit safely. Stop, do nothing else, and tell the developer to update it:
21
+ Look at the parameters of the `memory_update` and `memory_save` tools; if only their names are
22
+ listed, load their schemas first. If either tool is missing, the memory-hub server is not connected:
23
+ say so and stop. If `memory_update` has no `expectedLastModified` parameter, or `memory_save`'s `tags`
24
+ values do not include `ProjectRules`, the memory-hub server is older than this release. Stop, do
25
+ nothing else, and tell the developer to update it:
19
26
 
20
27
  - plugin installs, and `setup` installs with auto-update: restart Claude Code;
21
28
  - pinned installs: re-run `npx -y @skedulo/memory-hub-mcp@latest setup --no-auto-update`;
@@ -32,56 +39,106 @@ connector is not connected, stop and tell the developer.
32
39
  `memory_list` returns `total` and one page of items; call it again with `offset` until you have all
33
40
  `total` of them.
34
41
 
35
- 1. Find the product: `memory_checkRepoStatus` in the delivery repo's checkout, or ask and take the
36
- repo's uid from `memory_listRepos`. Then
37
- `memory_list type=Wiki repo=<delivery repo uid> tags=["ProductRules"]`, which lists the Rules pages
38
- and the Don't build page. If there are no Rules pages, stop and offer the product-knowledge skill in
39
- create mode.
40
- 2. Pick the features the ticket touches from those titles and read them in full with
41
- `memory_get type=Wiki uid=<uid>` (every part of a split page). Always read `<Product> › Don't build`
42
- (every part).
43
- 3. Read only the reference pages the work needs (data model, APIs, workflows), found the same way
44
- with `titlePrefix="<Product> › Reference ›"`.
45
- 4. Read what the hub already knows about this ticket: `memory_recall type=Fact scope=team
46
- externalRef=<parent>` and `memory_recall type=Scenario scope=team externalRef=<parent>`.
47
- 5. For each repo involved, read its architecture map: `memory_list type=Skill tags=["ArchitectureMap"]`,
42
+ 1. Find the project's team and delivery repo. Try in order: the team of the ticket's `repo/…` label
43
+ (`memory_listRepos`); the ticket's Linear project or team name matched to a `teamName` from
44
+ `memory_listRepos`, ignoring case and punctuation; the team linked to the current checkout
45
+ (`memory_checkRepoStatus`). When the checkout's team differs from one the ticket gives, the
46
+ ticket's own signals win; say so in the plan's Decisions. When only the checkout gives a team, it is
47
+ a guess: put it first in the plan's Decisions, so approving the plan confirms it. The delivery repo
48
+ is the team's repo that holds pages titled `<Project> › Rules ›` (list each of the team's repos with
49
+ `memory_list type=Wiki repo=<repo uid>`).
50
+ 2. If no repo of the team has Rules pages, or the delivery repo has them but no
51
+ `<Project> › Sources` page (an earlier run stopped partway), run the project-knowledge skill first
52
+ (`memory-hub:project-knowledge` when installed as a plugin), handing it the team and project from
53
+ step 1; it picks create or import itself. Never do this for a team only the checkout gave: end the
54
+ run instead, saying that no knowledge exists for the guessed team and that adding a
55
+ `repo/skedulo/<repo>` label to the ticket fixes it.
56
+ Then continue, and show its summary together with the plan in the approval message.
57
+ 3. Find the features the ticket touches with `<Project> › Reference › feature-map`: match the files,
58
+ repos and screens the ticket names, its labels, epic and project, and its wording against each
59
+ feature's code paths, tickets and business processes. Read those features' Rules pages in full with
60
+ `memory_get type=Wiki uid=<uid>` (every part of a split page), and say in the plan's Decisions which
61
+ features you matched and why. Without a feature map, pick from the Rules page titles. Always read
62
+ `<Project> › Don't build` (every part).
63
+ 4. Read only the reference pages the work needs (data model, APIs, workflows, troubleshooting).
64
+ 5. Read what the hub already knows about this ticket: `memory_recall type=Fact scope=team
65
+ externalRef=<parent>` and `memory_recall type=Scenario scope=team externalRef=<parent>`. Read an
66
+ existing plan Scenario in full with `memory_get`, because recall shortens items.
67
+ 6. For each repo involved, read its architecture map: `memory_list type=Skill tags=["ArchitectureMap"]`,
48
68
  then `memory_get type=Skill uid=<uid>` on the ones for those repos.
49
69
 
50
- Entry lines look like `- **LMB-R13** · core · verified — <rule> _Source: ..._`. `core` entries never
51
- change without the developer's explicit confirmation; `unverified` entries came from code or an import
52
- and need checking before you rely on them. Ignore entries under a page's `## Retired` section. For an
53
- entry marked `Conflict: overridden by ...`, use the entry that overrides it, never the overridden one.
70
+ Entry lines look like `- **LMB-R13** · core · verified — <rule> _Source: ..._`. `core` entries change
71
+ only with the developer's explicit confirmation. An `unverified` entry marked `Pending <ticket>` is a
72
+ decision the code does not have yet; any other `unverified` entry is backed by a single document, by
73
+ Slack, or was not found in the code. Ignore entries under a page's `## Retired` section. For an entry
74
+ marked `Conflict: overridden by ...`, use the entry that overrides it, never the overridden one.
54
75
 
55
76
  ## 3. Read the code
56
77
 
57
- 1. Search the local checkout first.
78
+ 1. Search the local checkout first, at the repo's default branch as it is on the remote: run
79
+ `git -C <checkout> fetch -q origin`, then search with `git -C <checkout> grep "<term>" origin/<default>`
80
+ and read files with `git -C <checkout> show origin/<default>:<path>`, never the working tree, which
81
+ may be on a feature branch.
58
82
  2. Then the other repos the work touches: those named in `package.json` dependencies, in imports, and
59
83
  in architecture-map edges (runtime calls that imports miss). Read them with `gh`:
60
84
  `gh search code --repo <owner/name> "<term>"`, `gh api repos/<owner>/<name>/contents/<path>`.
61
- 3. Note the commit each repo was read at: `git rev-parse HEAD` locally, or
85
+ 3. Note the commit each repo was read at: `git rev-parse origin/<default>` locally, or
62
86
  `gh api repos/<owner>/<name>/commits/<branch> --jq .sha`. The plan records it.
63
87
 
64
- ## 4. Ask before deciding
65
-
66
- Stop and ask the developer, with the entries and sources side by side, when:
67
-
68
- - two rules conflict, or the ticket contradicts a rule or a don't-build item;
69
- - an acceptance criterion cannot be tested as written;
70
- - sources disagree (TDD against code, ticket against a rule, a rule against a recent decision).
71
-
72
- Never resolve a conflict on a `core` entry yourself. Record each answer; if it changes product
73
- knowledge, list it under "Knowledge changes" in the plan.
88
+ ## 4. Decide instead of asking
89
+
90
+ Settle each of these yourself and record the decision under "Decisions" in the plan, one line each
91
+ with the reason and the source. These are the project-knowledge skill's decision rules:
92
+
93
+ - Sources disagree: a decided ticket wins over the code: one whose workflow state type is `started`,
94
+ one with a linked open PR, a confirmed bug report (a Bug label and a state type of `unstarted` or
95
+ `started`), or a ticket whose delivery plan was approved (a `Delivery plan (approved <date>)`
96
+ comment on it), whatever its state, until it is `completed` or `canceled`. Other tickets in
97
+ `triage`, `backlog` or `unstarted`, and `canceled` or duplicate tickets, are ideas, not decisions:
98
+ they never override the code. For `completed` tickets the code wins, because it already reflects
99
+ them. Otherwise the code wins. Among documents, after a newer ticket decision: on whether something
100
+ is in or out of scope, SOWs, work orders and change requests win over technical documents, and among
101
+ them the newer one wins (a change request amends the SOW). On how the system works, technical
102
+ documents win over business documents, and between two technical documents the newer one wins.
103
+ Slack comes last.
104
+ - The parent ticket being planned counts as a decided ticket. Where it contradicts a `standard` or
105
+ `detail` rule, follow the ticket and list the change under "Knowledge changes", marked
106
+ "from ticket".
107
+ - The ticket contradicts a `core` rule or a don't-build item: plan the outcome so it keeps the rule,
108
+ and put the conflict under "Open questions". Never plan work that breaks a `core` entry.
109
+ - An acceptance criterion cannot be tested as written: rewrite it as a testable check and note the
110
+ rewrite under "Decisions".
111
+ - An entry marked `Pending <ticket>`: if that ticket is the parent, plan it as this work's own
112
+ decision. If its ticket is still decided, plan for the pending decision and add `<ticket> (pending)`
113
+ to the outcome's "Depends on", so the sub-issue waits for that ticket. If its ticket is now
114
+ `completed`: when the code has the behaviour, list a "from code" Knowledge change that drops the
115
+ `Pending` note, makes the entry `verified` and removes its known-gap line from the troubleshooting
116
+ page; when it does not, the code wins: plan from what the code does and list a "from code" change
117
+ that replaces the `Pending` note with `(not found in code)`, keeping the entry `unverified` and its
118
+ gap on the troubleshooting page. If its ticket was `canceled` or is no longer decided by the rule
119
+ above, the code wins: list the entry under "Knowledge changes", marked "from code", with the
120
+ removal of its known-gap line from the troubleshooting page. Never list a still-pending entry under
121
+ "Knowledge changes".
122
+ - Any other `unverified` entry the work depends on: check it in the code. If the code confirms it,
123
+ say so. If not, plan from what the code does and list the entry under "Knowledge changes", marked
124
+ "from code".
125
+ - A `verified` entry that cites code the work depends on: check only whether its file changed since
126
+ the cited commit (`git -C <checkout> diff --quiet <sha> origin/<default> -- <path>`, or
127
+ `gh api repos/<owner>/<name>/compare/<sha>...<default> --jq '.files[].filename'`). Unchanged: use it
128
+ as it is, without reading the file. Changed: read the file at `origin/<default>`. When it still does
129
+ what the entry says, list a "from code" Knowledge change that moves the citation to that commit;
130
+ when it does something else, the code wins: plan from what it does and list a "from code" change.
74
131
 
75
132
  ## 5. Write the plan
76
133
 
77
134
  Outcomes are grouped by milestone and ordered: object model first, then functions and automations,
78
135
  then UI. Each outcome is one pull request in one repo, small enough for one agent session. If one is
79
- bigger, split it.
136
+ bigger, split it. When revising a plan, keep the numbers of the outcomes that remain.
80
137
 
81
138
  ```markdown
82
139
  # Delivery plan: <PARENT-ID> <title>
83
140
 
84
- Product: <Product> · Read at: <owner/name>@<full sha>, ...
141
+ Project: <Project> · Read at: <owner/name>@<full sha>, ... · Auto-assign: on
85
142
 
86
143
  ## Milestone 1: <name>
87
144
 
@@ -89,40 +146,64 @@ Product: <Product> · Read at: <owner/name>@<full sha>, ...
89
146
  - Repo: <owner/name> · Base branch: <branch>
90
147
  - Goal: <one sentence>
91
148
  - Done when: <testable checks: commands to run, observable behaviour>
92
- - Rules: <IDs it must satisfy, e.g. LMB-R13, LMB-C4>
149
+ - Rules: <existing IDs it must satisfy, e.g. LMB-R13, LMB-C4, and `new: Knowledge change <n>` for a
150
+ change below>
93
151
  - Must not: <don't-build IDs and explicit exclusions>
94
152
  - Files it may change: <paths or globs>
95
- - Depends on: <outcome numbers, or none>
153
+ - Depends on: <outcome numbers, other tickets as `<ID> (pending)`, or none>
154
+
155
+ ## Decisions
156
+ - <each conflict or gap you settled, with the rule and source, and the features you matched, or "None">
96
157
 
97
158
  ## Knowledge changes
98
- - <proposed new or changed entries, with the decision that prompted each, or "None">
159
+ 1. <from code | from ticket>: <the new or changed entry, with the decision that prompted it> (or "None")
99
160
 
100
161
  ## Open questions
101
- - <anything still unanswered, or "None">
162
+ - <only conflicts with core rules or don't-build items, naming the outcomes they affect, or "None">
102
163
  ```
103
164
 
104
- Show the plan and revise it until the developer says it is approved. Do not write anything to Linear
105
- or the hub before that.
165
+ The `Rules:` line names existing IDs only; a new entry is a numbered item under "Knowledge changes"
166
+ without an ID. `Auto-assign` is `on` for a first plan unless the developer says "don't assign". When
167
+ revising, copy the value from the existing plan Scenario's header (a header without it counts as
168
+ `off`), set it to `off` when the developer says "don't assign", and to `on` when they say "assign" or
169
+ "start the agent".
170
+
171
+ Before showing the plan, apply the confidentiality rules to it, so the text the developer approves is
172
+ the text that is posted: no commercial terms (prices, rates, budgets, contract values, payment
173
+ terms), no customer personal data (names, emails or phone numbers of customer staff or end users), no
174
+ verbatim contract text (restate scope as function), no customer data rows or production record IDs
175
+ (UUIDs, Salesforce record IDs), no credentials, tokens or secrets.
176
+
177
+ Show the plan with a short note of what to look at first (the decisions and any open questions), and
178
+ end with what approval does: it posts the plan to <PARENT-ID>, saves it to the hub, creates one
179
+ sub-issue per outcome, and starts the Linear Dev Agent on the ones that are not blocked; "plan only"
180
+ or "don't assign" stops that. Approval is an explicit yes to the plan as last shown, with nothing to
181
+ change. If the reply asks for any change, even next to a yes, revise the plan, show it again and ask
182
+ again. Do not write anything to Linear or the hub before it is approved.
106
183
 
107
184
  ## 6. Record the approved plan
108
185
 
109
- 1. Before writing anything, check the approved plan against the confidentiality rules. Remove:
110
- commercial terms (prices, rates, budgets, contract values, payment terms); customer personal data
111
- (names, emails or phone numbers of customer staff or end users); verbatim contract text (restate
112
- scope as function); customer data rows and production record IDs (UUIDs, Salesforce record IDs);
113
- credentials, tokens and secrets. Tell the developer what you removed. If that changes an outcome,
114
- show the plan again and get it approved before going on.
115
- 2. Post the plan as a comment on the parent issue, headed `Delivery plan (approved <date>)`. A later
186
+ 1. Check the approved plan against the confidentiality rules once more. If anything still has to be
187
+ removed, note it in your report.
188
+ 2. Unless the developer said "plan only", apply the "Knowledge changes" with the project-knowledge
189
+ skill's targeted update (`memory-hub:project-knowledge` when installed as a plugin), handing it the
190
+ delivery repo uid and the project. Approving the
191
+ plan approves the non-core changes; update mode asks once about any change to a `core` entry. Then
192
+ replace each `new: Knowledge change <n>`, in the outcomes and in the list, with the entry ID update
193
+ mode reports. Move each `core` change the developer declines, and each change update mode did not
194
+ save as an entry (it reports these with the reason), from "Knowledge changes" to "Open questions",
195
+ naming the outcomes that rely on it. Under "plan only", leave the changes unapplied:
196
+ delegate-ticket applies them later.
197
+ 3. Post the plan as a comment on the parent issue, headed `Delivery plan (approved <date>)`. A later
116
198
  revision is a new comment with a new date, so the history stays on the issue.
117
- 3. Save it in the hub as a Scenario on the delivery repo:
199
+ 4. Save it in the hub as a Scenario on the delivery repo:
118
200
  `memory_save type=Scenario repo=<delivery repo uid> externalRef=<parent> summary=<the plan>`, and
119
- check the result reports `visibility: "Team"`. If step 2.4 found a plan Scenario for this ticket (a
201
+ check the result reports `visibility: "Team"`. If step 2.5 found a plan Scenario for this ticket (a
120
202
  Scenario whose summary starts with `# Delivery plan: <PARENT-ID>`), update that one instead:
121
203
  `memory_get type=Scenario uid=<its uid>`, then `memory_update type=Scenario uid=<its uid>
122
204
  summary=<the plan> expectedLastModified=<its lastModifiedDate>`. If it fails with `Conflict:`,
123
- someone else changed the plan since you read it: `memory_get` it again, show the developer what
124
- changed, and ask before updating.
125
- 4. If "Knowledge changes" is not empty, offer to apply them with the product-knowledge skill in update
126
- mode (`memory-hub:product-knowledge` when installed as a plugin). Approving the plan does not
127
- confirm a change to a `core` entry; update mode asks about each one by ID.
128
- 5. Offer the next step: delegate-ticket.
205
+ `memory_get` it again: if the other change is an older revision of the same plan, overwrite it with
206
+ the approved one; otherwise save the approved plan as a new Scenario and say so.
207
+ 5. Unless the developer said "plan only", run delegate-ticket straight away
208
+ (`memory-hub:delegate-ticket` when installed as a plugin). Then report what you posted, saved and
209
+ delegated in one message.
@@ -0,0 +1,164 @@
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
+ ## 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, and refresh from sources. It also holds
23
+ "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" and "Refresh from sources";
32
+ `targeted-update.md` for "Update" and "Targeted update"; `touch.md` for "Touch update"; `import.md` for "Import" and "Import step <n>".
33
+
34
+ ## How this skill works with the developer
35
+
36
+ Decide, then report. Work out every answer yourself with the decision rules, write your
37
+ reasoning into the entries (sources, `Conflict:` notes, troubleshooting) and into the final summary,
38
+ and keep going. Do not ask the developer to choose between options, confirm entries, pick tiers,
39
+ resolve flags or approve saves.
40
+
41
+ Ask only in these three cases, and nowhere else:
42
+
43
+ 1. The delivery repo is not linked to the project's team (see "Before any mode"). Nothing can be
44
+ saved until it is.
45
+ 2. Update mode would change an existing `core` entry that the developer has not already named (see
46
+ "Core changes"). Ask once, at the end, for all of them together, with your recommendation already
47
+ chosen.
48
+ 3. The developer asked to import, and the shared memory repo checkout cannot be found (see "Import").
49
+
50
+ Some conditions end the run instead of asking: a memory-hub server that is too old, a missing token
51
+ for the import command, an interrupted import with no shared memory repo checkout, or no source that
52
+ can be read. Say what is missing and how to fix it.
53
+
54
+ Before anything is saved, a second AI checks the work (see "Check the work"). Everything else goes
55
+ into the summary at the end (see "Summary"). The developer reviews it once and can change anything by
56
+ saying so, for example "R117 isn't core" or "drop D2"; apply such a request as a targeted update.
57
+
58
+ For a large project, draft each feature in its own subagent, giving it `decision-rules.md` and the
59
+ entry-line part of `page-format.md` only, then check and number every draft yourself before saving. Keep progress notes in
60
+ `$TMPDIR/memory-hub-knowledge/<PREFIX>/`, never in a repo checkout, so a long run can continue after
61
+ an interruption. Never quote sources or write amounts or personal names there. After the summary,
62
+ run `git -C <checkout> worktree remove --force <path>` for each worktree you added (see "Discover
63
+ sources"), then delete the folder.
64
+
65
+ ## First, check the server version
66
+
67
+ Look at the parameters of the `memory_update` and `memory_save` tools; if only their names are
68
+ listed, load their schemas first. If either tool is missing, the memory-hub server is not connected:
69
+ say so and stop. If `memory_update` has no `expectedLastModified` parameter, or `memory_save`'s `tags`
70
+ values do not include `ProjectRules`, the memory-hub server is older than this release. Stop, do
71
+ nothing else, and tell the developer to update it:
72
+
73
+ - plugin installs, and `setup` installs with auto-update: restart Claude Code;
74
+ - pinned installs: re-run `npx -y @skedulo/memory-hub-mcp@latest setup --no-auto-update`;
75
+ - a checkout of the se-ai-memory-hub repo: pull and re-run `scripts/setup-dev.sh`.
76
+
77
+ ## Before any mode
78
+
79
+ 1. Find the project's team. When the caller hands over a team and project, or a delivery repo and
80
+ 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
81
+ (`memory_listRepos`); the team linked to the current checkout (`memory_checkRepoStatus`), used only
82
+ when its team name matches the project the developer named (or neither a project nor a ticket was
83
+ named); the Linear project or team name matched to a `teamName` from `memory_listRepos`, ignoring
84
+ case and punctuation. The delivery repo is the team's repo that holds
85
+ the project's pages. With no pages yet, it is the team's repo whose name best matches the project
86
+ (ignoring case, punctuation and a `cx-` prefix); on a tie, the one most of the team's Linear tickets
87
+ label (`repo/…`), then the most recently pushed (`gh api repos/<owner>/<name> --jq .pushed_at`).
88
+ Name the choice in the summary.
89
+ 2. If the delivery repo is not linked to the project's team, stop and ask the developer which team it
90
+ belongs to; call `memory_linkRepoTeam` only when they say so. This is the only reason to stop
91
+ before starting.
92
+ 3. List the existing pages: `memory_list type=Wiki repo=<repo uid> titlePrefix="<Project> ›"` (page
93
+ through with `offset` until you reach `total`). Read the ID prefix from existing entries. With no
94
+ pages yet, choose the prefix yourself (page-format.md) and say which in the summary.
95
+ 4. Pick the mode:
96
+ - a change list, a commit range or a PR's changed files handed over by plan-ticket, delegate-ticket or fold-findings, or
97
+ a change the developer asks for by entry ID: the targeted update (see "Update"), whatever else
98
+ the bullets below would pick;
99
+ - the developer asks to catch up with the code, and pages and a Sources page exist: the touch update
100
+ over every repo on the Sources page, as one run (see "Touch update");
101
+ - an unfinished import: the plan file `$TMPDIR/memory-hub-import/<PREFIX>.json` exists, has pages
102
+ or facts with neither `savedUid` nor `skip`, and every existing `<Project> ›` page is one whose
103
+ uid the plan records as a `savedUid`. If any item has a `savedUid`, apply was interrupted: re-run
104
+ `import apply` (Import step 7), then Import steps 8 and 9. If none has, the import stopped before
105
+ saving: resume Import at step 5 on the existing plan file, then steps 6 to 9. If pages exist that
106
+ the plan did not save, the plan is stale: delete it and its review file, because they hold
107
+ flagged values, and pick the mode from the bullets below;
108
+ - no pages, and Import step 2 finds a knowledge pack for the project without asking: import. When
109
+ no checkout of the shared memory repo is found, create, and say under "Worth a look" that no pack
110
+ was checked, unless the developer asked to import: then ask for the path (case 3). When the
111
+ developer asked to import and a checkout has no matching pack, create, and say so in the
112
+ summary;
113
+ - no pages otherwise: create;
114
+ - pages but no `<Project> › Sources` page, and their change logs say
115
+ `Imported every entry as unverified · knowledge pack <name>`: an import stopped partway and its
116
+ plan file is gone; rebuild the plan (see "Import", "Resuming an import without its plan file");
117
+ - pages but no `<Project> › Sources` page otherwise: an earlier create stopped partway; resume it
118
+ (see "Create");
119
+ - pages and a Sources page: refresh from sources (see "Refresh from sources").
120
+
121
+ ## Core changes
122
+
123
+ A core change is a change to or from `core`, or any edit, `Conflict:` note or retirement of an
124
+ existing `core` entry. A new entry you mark `core` while creating it is not a core change, unless it
125
+ overrides an existing `core` entry: the `Conflict:` note and the winning entry are then one core
126
+ change, held back together.
127
+
128
+ A core change the developer asked for, or accepted by entry ID, earlier in this conversation is
129
+ already confirmed (for example "R117 isn't core", or an answer naming the ID). Apply it without asking.
130
+ Moving an entry's code citation to a newer commit, or adding `checked <date>`, with its text, tier,
131
+ status and notes unchanged, is not a core change: apply it directly.
132
+ Approving a plan or a change list as a whole is not that.
133
+
134
+ Collect the rest and ask once, in a single question that lists each change with its ID, the current
135
+ and new lines, and one sentence of reasoning, with your recommendation already selected. Apply what
136
+ the developer accepts. For a declined one, apply neither its `Conflict:` note nor its winning entry,
137
+ note the unresolved finding on the troubleshooting page with the caller's reason, and list it in
138
+ the summary as declined.
139
+ When the caller says not to ask (fold-findings folding a blocker inside another run), apply none of
140
+ them, write nothing about them to the pages, and list them in the summary as waiting.
141
+
142
+ ## Summary
143
+
144
+ End every run with one short summary in plain language, the only thing the developer has to read.
145
+ Use these headings and leave out any that would be empty:
146
+
147
+ - **Saved**: each page title with its uid and ID range, and the prefix if you chose it. For a
148
+ targeted update, the entry ID each listed change was given or changed.
149
+ - **Decisions I made**: the conflicts, grouped by rule (for example "code over TDD: 7, R118 to R120,
150
+ C55 ..."), with one line on the most important ones.
151
+ - **Core**: each `core` ID with one line on why, and any core change the developer declined.
152
+ - **Checked**: how many entries the checker looked at, how many were confirmed, corrected, code
153
+ differs, not confirmed or could not be opened, and the final accuracy.
154
+ - **Worth a look**: `unverified` entries, rules not found in code, pending tickets, new feature keys,
155
+ suggested feature splits.
156
+ - **Coverage**: how many features, the code areas no feature covers, features with no code, and
157
+ documents that fed no entry.
158
+ - **Left out**: what the confidentiality rules removed, skipped Slack channels, and sources not read
159
+ and why.
160
+ - **Sources read**: one line per kind (code, tickets, technical docs, business docs, Slack, hub leads)
161
+ with counts.
162
+ - **Changed by teammates meanwhile**: pages that were edited while you worked, if any.
163
+
164
+ 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".