@skedulo/memory-hub-mcp 0.2.21 → 0.2.23
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.
- package/assets/session-start.sh +2 -1
- package/assets/skills/ask/SKILL.md +19 -15
- package/assets/skills/delegate-ticket/SKILL.md +2 -1
- package/assets/skills/plan-ticket/SKILL.md +23 -12
- package/assets/skills/project-knowledge/references/create-refresh.md +3 -1
- package/assets/skills/project-knowledge/references/decision-rules.md +2 -1
- package/assets/user-prompt-submit.sh +39 -14
- package/dist/ask-prompt.js +2 -2
- package/dist/index.js +6 -5
- package/dist/similar-notice.js +1 -1
- package/package.json +1 -1
- package/skill-guide.md +46 -16
package/assets/session-start.sh
CHANGED
|
@@ -601,7 +601,8 @@ REMINDER="${REMINDER}${SAVE_LINE}${NL}"
|
|
|
601
601
|
REMINDER="${REMINDER}Invoke the memory-hub skill during this session: memory_recall before${NL}"
|
|
602
602
|
REMINDER="${REMINDER}investigating something that smells like prior context, and memory_save${NL}"
|
|
603
603
|
REMINDER="${REMINDER}(type \"Fact\" or \"Scenario\") once a task produces a durable decision, root${NL}"
|
|
604
|
-
REMINDER="${REMINDER}cause, or fix worth keeping for next time
|
|
604
|
+
REMINDER="${REMINDER}cause, or fix worth keeping for next time. On an error, memory_recall${NL}"
|
|
605
|
+
REMINDER="${REMINDER}scope=all with its text first: another project may have the fix.${NL}${NL}"
|
|
605
606
|
REMINDER="${REMINDER}${STALE_MCP}${NUDGE}"
|
|
606
607
|
NOTICES=$(collect_capture_notices "$STATE_DIR" "$((REMAINING - ${#REMINDER} - ${#DIAG}))" 2>/dev/null || true)
|
|
607
608
|
[ -z "$NOTICES" ] || NOTICES="${NOTICES}${NL}${NL}"
|
|
@@ -14,9 +14,9 @@ a PR moved, and grows the hub when it did not know. It answers in the role the q
|
|
|
14
14
|
|
|
15
15
|
- **Plain language.** The person may not be a developer. Short sentences, no jargon they did not
|
|
16
16
|
use, and no tool names in the answer, unless the role's file says otherwise.
|
|
17
|
-
- **Ask only for:
|
|
18
|
-
(steps
|
|
19
|
-
without their yes.
|
|
17
|
+
- **Ask only for: which sources to read, which repo when it is unclear, and joining a team**
|
|
18
|
+
(steps 7 and 9; joining only when a save needs a team's repo). Everything else you decide.
|
|
19
|
+
Joining is the person's choice, so never join without their yes.
|
|
20
20
|
- **Never paste SOW or Slack text.** Say what it means in your own words and name where it came from.
|
|
21
21
|
- **Never reveal others' Private items.** The hub never returns them; never guess at them either.
|
|
22
22
|
- **End every answer with one line** listing what you updated and saved, by uid, for example
|
|
@@ -77,23 +77,24 @@ steps 4 to 7 say what changes.
|
|
|
77
77
|
|
|
78
78
|
## 2. Search the hub
|
|
79
79
|
|
|
80
|
-
1. For each type picked, `memory_recall` with `scope=
|
|
81
|
-
|
|
80
|
+
1. For each type picked, `memory_recall` with `scope=all`, using the question's key words. It
|
|
81
|
+
returns every project's shared items, from every team, plus the person's own, Private ones
|
|
82
|
+
included. Each item names its `repoName` and `teamName`.
|
|
82
83
|
2. When a project is named, also list its pages, which works outside a repo too:
|
|
83
|
-
`memory_list type=Wiki titlePrefix="<Project> ›"` (paginate with `offset` until you
|
|
84
|
-
`total`). Pick the pages the question needs.
|
|
85
|
-
3.
|
|
86
|
-
|
|
84
|
+
`memory_list type=Wiki scope=all titlePrefix="<Project> ›"` (paginate with `offset` until you
|
|
85
|
+
have `total`). Pick the pages the question needs.
|
|
86
|
+
3. When the question is about one project and an answer comes from another, say which project it
|
|
87
|
+
came from and treat it as precedent, not as that project's rule. Keep the other customer's
|
|
88
|
+
names, data and terms out of anything meant for this one.
|
|
89
|
+
4. Read with `memory_get` every item you will rely on whose text came back cut short.
|
|
90
|
+
5. When an item has `superseded: true`, prefer the newer memory that replaced it; look it up if it
|
|
87
91
|
was not returned.
|
|
88
92
|
|
|
89
93
|
## 3. When a named project's pages are not found
|
|
90
94
|
|
|
91
|
-
If the question names a project and step 2 found none of its pages,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
shows it, using the project's name as the team name when you know no better. Call `memory_joinTeam`
|
|
95
|
-
only after they say yes, since joining changes who reads what; then go back to step 2. If it says no
|
|
96
|
-
such team exists, or they do not say yes, carry on to step 7 with what you have.
|
|
95
|
+
If the question names a project and step 2 found none of its pages, the hub has nothing shared for
|
|
96
|
+
it: `scope=all` already reads every team's Team and Org items, so joining its team would not show
|
|
97
|
+
more. Carry on to step 7 with what you have.
|
|
97
98
|
|
|
98
99
|
## 4. Check what you rely on
|
|
99
100
|
|
|
@@ -250,6 +251,9 @@ source.
|
|
|
250
251
|
|
|
251
252
|
Decide the visibility by the guide's "What to share" section
|
|
252
253
|
(`memory_getSkillGuide section="What to share"`), and state the choice and the reason in the answer.
|
|
254
|
+
A save on a project's repo needs the person on that project's team. When `memory_listTeams` shows
|
|
255
|
+
they are not, ask whether to join it, and call `memory_joinTeam` only after they say yes; then look
|
|
256
|
+
up the status snapshot again (step 6) before saving one. If they say no, save Private and say why.
|
|
253
257
|
|
|
254
258
|
## 10. Close
|
|
255
259
|
|
|
@@ -34,7 +34,8 @@ nothing else, and tell the developer to update it:
|
|
|
34
34
|
`memory_get type=Scenario uid=<uid>` on the one whose summary starts with
|
|
35
35
|
`# Delivery plan: <PARENT-ID>` (with several, the one most recently modified). Note its `repoId`
|
|
36
36
|
from the recall result: it is the delivery repo uid. Compare it with the latest
|
|
37
|
-
`Delivery plan (approved <date>)` comment on the parent issue (Linear connector)
|
|
37
|
+
`Delivery plan (approved <date>)` comment on the parent issue (Linear connector), if there is one
|
|
38
|
+
(the developer may have chosen not to post the plan). Use the comment
|
|
38
39
|
only when it was posted after the Scenario's `lastModifiedDate` (a revision whose hub save failed):
|
|
39
40
|
then update the Scenario with it (`memory_update` with `expectedLastModified`) and say so.
|
|
40
41
|
Otherwise the Scenario wins, because this skill records declines, Auto-assign changes and
|
|
@@ -12,7 +12,8 @@ is defined in the project-knowledge skill's `references/page-format.md`; the par
|
|
|
12
12
|
restated here.
|
|
13
13
|
|
|
14
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
|
|
15
|
+
reasoning into the plan. The developer is asked two things only: to approve the plan, and whether to
|
|
16
|
+
post it on the ticket. Approval also
|
|
16
17
|
starts delivery: the plan is delegated and the first sub-issues go to the Linear Dev Agent, unless the
|
|
17
18
|
developer says "plan only" or "don't assign".
|
|
18
19
|
|
|
@@ -64,7 +65,12 @@ connector is not connected, stop and tell the developer.
|
|
|
64
65
|
5. Read what the hub already knows about this ticket: `memory_recall type=Fact scope=team
|
|
65
66
|
externalRef=<parent>` and `memory_recall type=Scenario scope=team externalRef=<parent>`. Read an
|
|
66
67
|
existing plan Scenario in full with `memory_get`, because recall shortens items.
|
|
67
|
-
6.
|
|
68
|
+
6. Ask whether another project already solved this: `memory_recall type=Fact scope=all`, then
|
|
69
|
+
`type=Skill` and `type=Wiki`, with the ticket's title and its problem in one sentence as the
|
|
70
|
+
`query`. An item whose `repoName` is not this project's is precedent: say in the plan's Decisions
|
|
71
|
+
which project it came from and check it against this code, and keep that customer's names, data
|
|
72
|
+
and settings out of the plan.
|
|
73
|
+
7. For each repo involved, read its architecture map: `memory_list type=Skill tags=["ArchitectureMap"]`,
|
|
68
74
|
then `memory_get type=Skill uid=<uid>` on the ones for those repos.
|
|
69
75
|
|
|
70
76
|
Entry lines look like `- **LMB-R13** · core · verified — <rule> _Source: ..._`. `core` entries change
|
|
@@ -93,7 +99,8 @@ with the reason and the source. These are the project-knowledge skill's decision
|
|
|
93
99
|
- Sources disagree: a decided ticket wins over the code: one whose workflow state type is `started`,
|
|
94
100
|
one with a linked open PR, a confirmed bug report (a Bug label and a state type of `unstarted` or
|
|
95
101
|
`started`), or a ticket whose delivery plan was approved (a `Delivery plan (approved <date>)`
|
|
96
|
-
comment on it
|
|
102
|
+
comment on it, or a hub Scenario for it whose summary starts with `# Delivery plan: <its ID>`),
|
|
103
|
+
whatever its state, until it is `completed` or `canceled`. Other tickets in
|
|
97
104
|
`triage`, `backlog` or `unstarted`, and `canceled` or duplicate tickets, are ideas, not decisions:
|
|
98
105
|
they never override the code. For `completed` tickets the code wins, because it already reflects
|
|
99
106
|
them. Otherwise the code wins. Among documents, after a newer ticket decision: on whether something
|
|
@@ -175,11 +182,14 @@ verbatim contract text (restate scope as function), no customer data rows or pro
|
|
|
175
182
|
(UUIDs, Salesforce record IDs), no credentials, tokens or secrets.
|
|
176
183
|
|
|
177
184
|
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
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
end with what approval does: it saves the plan to the hub, creates one sub-issue per outcome, and
|
|
186
|
+
starts the Linear Dev Agent on the ones that are not blocked; "plan only" or "don't assign" stops
|
|
187
|
+
that. Then ask whether to also post the plan as a comment on <PARENT-ID>, where the customer and
|
|
188
|
+
everyone on the ticket can read it. Post it only on an explicit yes to that question; a bare yes to
|
|
189
|
+
the plan, or no answer, means do not post. "Plan only" and "don't assign" do not change this answer.
|
|
190
|
+
Approval is an explicit yes to the plan as last shown, with nothing to change. If the reply asks for
|
|
191
|
+
any change, even next to a yes, revise the plan, show it again and ask again. Do not write anything
|
|
192
|
+
to Linear or the hub before it is approved.
|
|
183
193
|
|
|
184
194
|
## 6. Record the approved plan
|
|
185
195
|
|
|
@@ -194,8 +204,9 @@ again. Do not write anything to Linear or the hub before it is approved.
|
|
|
194
204
|
save as an entry (it reports these with the reason), from "Knowledge changes" to "Open questions",
|
|
195
205
|
naming the outcomes that rely on it. Under "plan only", leave the changes unapplied:
|
|
196
206
|
delegate-ticket applies them later.
|
|
197
|
-
3.
|
|
198
|
-
revision is a new comment with a new date, so the
|
|
207
|
+
3. Only if the developer said yes to posting, post the plan as a comment on the parent issue, headed
|
|
208
|
+
`Delivery plan (approved <date>)`. A later revision is a new comment with a new date, so the
|
|
209
|
+
history stays on the issue.
|
|
199
210
|
4. Save it in the hub as a Scenario on the delivery repo:
|
|
200
211
|
`memory_save type=Scenario repo=<delivery repo uid> externalRef=<parent> summary=<the plan>`, and
|
|
201
212
|
check the result reports `visibility: "Team"`. If step 2.5 found a plan Scenario for this ticket (a
|
|
@@ -205,5 +216,5 @@ again. Do not write anything to Linear or the hub before it is approved.
|
|
|
205
216
|
`memory_get` it again: if the other change is an older revision of the same plan, overwrite it with
|
|
206
217
|
the approved one; otherwise save the approved plan as a new Scenario and say so.
|
|
207
218
|
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
|
|
209
|
-
delegated in one message.
|
|
219
|
+
(`memory-hub:delegate-ticket` when installed as a plugin). Then report what you posted (or that
|
|
220
|
+
the plan was not posted), saved and delegated in one message.
|
|
@@ -25,7 +25,9 @@ read) is listed in the summary as not read; carry on with the rest.
|
|
|
25
25
|
order or change request cites that you have not read yet. The rest stay as titles: the
|
|
26
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
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").
|
|
28
|
+
`Delivery plan (approved <date>)` comment on it makes it decided (see "Decision rules"). So does
|
|
29
|
+
an approved plan the developer chose not to post: list those once with `memory_list type=Scenario
|
|
30
|
+
repo=<delivery repo uid> titlePrefix="# Delivery plan:"` and match the ticket IDs in the titles.
|
|
29
31
|
3. **Technical documents**: TDDs and design notes, and in-house docs: as-built docs, ADRs, READMEs
|
|
30
32
|
and `docs/` folders in the repos, `CLAUDE.md` or `AGENTS.md`, runbooks and release notes. Search
|
|
31
33
|
Confluence (Atlassian connector) and Google Drive by the project name together with words such as
|
|
@@ -9,7 +9,8 @@ Apply these instead of asking. Every decision must be visible in the entry it af
|
|
|
9
9
|
report (a Bug label and a state type of `unstarted` or `started`). Keep its rule as `unverified`
|
|
10
10
|
with `Pending SOL-1234 (PR #452)` after the source, and add the current built behaviour to the
|
|
11
11
|
troubleshooting page as a known gap. A ticket whose delivery plan was approved (plan-ticket posted
|
|
12
|
-
`Delivery plan (approved <date>)` on it
|
|
12
|
+
`Delivery plan (approved <date>)` on it, or saved a hub Scenario whose summary starts with
|
|
13
|
+
`# Delivery plan: <its ID>`; the developer may choose not to post it) is decided too, whatever its state, until it is
|
|
13
14
|
`completed` or `canceled`. Other tickets in `triage`, `backlog` or `unstarted`, and `canceled` or
|
|
14
15
|
duplicate tickets, are ideas, not decisions: they never override the code; note
|
|
15
16
|
relevant ones on the troubleshooting page. For `completed` tickets the code wins, because it
|
|
@@ -269,11 +269,15 @@ if [ "${#EMBED[@]}" -gt 0 ]; then
|
|
|
269
269
|
fi
|
|
270
270
|
|
|
271
271
|
QUERY=$(printf '%s' "$PROMPT" | head -c 300)
|
|
272
|
+
# Without a vector nothing can hold other projects to a closer match, so the word search stays on your teams.
|
|
272
273
|
body() {
|
|
273
274
|
jq -nc --arg q "$QUERY" --arg v "${VECTOR:-null}" --argjson cap "$((BUDGET / 2))" \
|
|
274
|
-
--argjson min "$MIN_SIMILARITY" '
|
|
275
|
-
{
|
|
276
|
-
+ (if $v == "null" then {
|
|
275
|
+
--argjson min "$MIN_SIMILARITY" --arg repo "$REPO" --argjson other "$OTHER_REPO_MIN" --argjson band "$SIMILARITY_BAND" '
|
|
276
|
+
{query: $q, diverse: true, maxCharsPerItem: 500, maxTotalChars: $cap}
|
|
277
|
+
+ (if $v == "null" then {scope: "team"}
|
|
278
|
+
else {scope: "all", queryEmbedding: ($v | fromjson), minSimilarity: $min}
|
|
279
|
+
+ (if $repo == "" then {} else {homeRepo: $repo, otherRepoMinSimilarity: $other, similarityBand: $band} end)
|
|
280
|
+
end)'
|
|
277
281
|
}
|
|
278
282
|
|
|
279
283
|
call() {
|
|
@@ -298,20 +302,38 @@ call "/memory/recall-wiki" "$TMP_DIR/wiki.json" &
|
|
|
298
302
|
call "/memory/recall-scenarios" "$TMP_DIR/scenarios.json" &
|
|
299
303
|
wait
|
|
300
304
|
|
|
305
|
+
SCORED='[(.facts // [])[], (.skills // [])[], (.pages // [])[], (.scenarios // [])[]] | map(select(.similarity != null))'
|
|
306
|
+
SCORE='(.similarity + (.boost // 0))'
|
|
307
|
+
HOME_ITEM='($repo == "" or ((.repoName // "" | ascii_downcase) == ($repo | ascii_downcase)))'
|
|
308
|
+
higher() {
|
|
309
|
+
if [ -z "$1" ]; then printf '%s' "$2"
|
|
310
|
+
elif [ -z "$2" ] || [ "$(jq -n --argjson a "$1" --argjson b "$2" '$a > $b' 2>/dev/null)" = true ]; then printf '%s' "$1"
|
|
311
|
+
else printf '%s' "$2"; fi
|
|
312
|
+
}
|
|
313
|
+
floor_of() { if [ -n "$1" ]; then jq -n --argjson best "$1" --argjson band "$SIMILARITY_BAND" '$best - $band'; else echo -1; fi; }
|
|
301
314
|
# Judged across every list: one list alone may have no strong match, and would keep its weak ones.
|
|
315
|
+
# This repo's items are judged against this repo's best, so a strong match elsewhere cannot push them out.
|
|
302
316
|
BEST=""
|
|
317
|
+
BEST_HOME=""
|
|
303
318
|
for kind in facts skills wiki scenarios; do
|
|
304
|
-
top=$(jq -r
|
|
305
|
-
|
|
319
|
+
top=$(jq -r "$SCORED | map($SCORE) | max // empty" "$TMP_DIR/$kind.json" 2>/dev/null)
|
|
320
|
+
top_home=$(jq -r --arg repo "$REPO" "$SCORED | map(select($HOME_ITEM) | $SCORE) | max // empty" "$TMP_DIR/$kind.json" 2>/dev/null)
|
|
321
|
+
BEST=$(higher "$top" "$BEST")
|
|
322
|
+
BEST_HOME=$(higher "$top_home" "$BEST_HOME")
|
|
306
323
|
done
|
|
307
|
-
FLOOR
|
|
308
|
-
|
|
309
|
-
KEEP=
|
|
310
|
-
KEEP_ARGS=(--argjson floor "$FLOOR" --arg repo "$REPO" --argjson other "$OTHER_REPO_MIN")
|
|
324
|
+
FLOOR=$(floor_of "$BEST")
|
|
325
|
+
HOME_FLOOR=$(floor_of "$BEST_HOME")
|
|
326
|
+
KEEP="select(.similarity == null or (if $HOME_ITEM then $SCORE >= \$home_floor else ($SCORE >= \$floor and $SCORE >= \$other) end))"
|
|
327
|
+
KEEP_ARGS=(--argjson floor "$FLOOR" --argjson home_floor "$HOME_FLOOR" --arg repo "$REPO" --argjson other "$OTHER_REPO_MIN")
|
|
328
|
+
ORIGIN_DEF='def origin:
|
|
329
|
+
if (.repoName | type) == "string" and .repoName != "" and (.repoName | ascii_downcase) != ($repo | ascii_downcase)
|
|
330
|
+
then " · from " + (.repoName | gsub("[[:cntrl:]]"; " ")) + (if (.teamName | type) == "string" and .teamName != "" then " (" + (.teamName | gsub("[[:cntrl:]]"; " ")) + ")" else "" end)
|
|
331
|
+
else "" end;'
|
|
311
332
|
|
|
312
333
|
HEADING="## Memory relevant to this prompt"
|
|
313
334
|
FOOTER="_Matched to your prompt, not newest-first. memory_recall with a query finds more; memory_get fetches a cut item._"
|
|
314
|
-
|
|
335
|
+
PRECEDENT_NOTE="_An item marked \"from\" another project is precedent: check it against this code, and keep that customer's names, data and terms out of this work._"
|
|
336
|
+
room=$((BUDGET - ${#HEADING} - ${#FOOTER} - ${#PRECEDENT_NOTE} - 5))
|
|
315
337
|
BODY=""
|
|
316
338
|
used=0
|
|
317
339
|
# Whole items only: each item is one logical record, so it is shown entirely or not at all.
|
|
@@ -322,11 +344,14 @@ while IFS= read -r -d $'\x1e' item; do
|
|
|
322
344
|
used=$((used + ${#item} + 1))
|
|
323
345
|
fi
|
|
324
346
|
done < <(
|
|
325
|
-
jq -j "${KEEP_ARGS[@]}" "$EXTRAS_DEF [.facts[]? | $KEEP][:$FACTS_N][] | ((\"- \" + (.content | $ELIDE) + $(cut_pointer Fact) + $STAMP + extras(\"\"; .content)) | $CLOSE_FENCE | $INDENT), \"\\u001e\"" "$TMP_DIR/facts.json" 2>/dev/null
|
|
326
|
-
jq -j "${KEEP_ARGS[@]}" "$EXTRAS_DEF [.skills[]? | $KEEP][:$SKILLS_N][] | ((\"- \" + .title + \": \" + (.content | $ELIDE) + $(cut_pointer Skill) + $STAMP + extras(\"\"; .content)) | $CLOSE_FENCE | $INDENT), \"\\u001e\"" "$TMP_DIR/skills.json" 2>/dev/null
|
|
327
|
-
jq -j "${KEEP_ARGS[@]}" "$EXTRAS_DEF [.pages[]? | $KEEP][:$WIKI_N][] | ((\"- \" + .title + \": \" + (.content | $ELIDE) + $(cut_pointer Wiki) + $STAMP + extras(\"\"; .content)) | $CLOSE_FENCE | $INDENT), \"\\u001e\"" "$TMP_DIR/wiki.json" 2>/dev/null
|
|
328
|
-
jq -j "${KEEP_ARGS[@]}" "$EXTRAS_DEF [.scenarios[]? | $KEEP][:$SCENARIOS_N][] | ((\"- \" + (.summary | $ELIDE) + $(cut_pointer Scenario summary) + $STAMP + extras(\"\"; .summary)) | $CLOSE_FENCE | $INDENT), \"\\u001e\"" "$TMP_DIR/scenarios.json" 2>/dev/null
|
|
347
|
+
jq -j "${KEEP_ARGS[@]}" "$EXTRAS_DEF $ORIGIN_DEF [.facts[]? | $KEEP][:$FACTS_N][] | ((\"- \" + (.content | $ELIDE) + $(cut_pointer Fact) + $STAMP + extras(\"\"; .content) + origin) | $CLOSE_FENCE | $INDENT), \"\\u001e\"" "$TMP_DIR/facts.json" 2>/dev/null
|
|
348
|
+
jq -j "${KEEP_ARGS[@]}" "$EXTRAS_DEF $ORIGIN_DEF [.skills[]? | $KEEP][:$SKILLS_N][] | ((\"- \" + .title + \": \" + (.content | $ELIDE) + $(cut_pointer Skill) + $STAMP + extras(\"\"; .content) + origin) | $CLOSE_FENCE | $INDENT), \"\\u001e\"" "$TMP_DIR/skills.json" 2>/dev/null
|
|
349
|
+
jq -j "${KEEP_ARGS[@]}" "$EXTRAS_DEF $ORIGIN_DEF [.pages[]? | $KEEP][:$WIKI_N][] | ((\"- \" + .title + \": \" + (.content | $ELIDE) + $(cut_pointer Wiki) + $STAMP + extras(\"\"; .content) + origin) | $CLOSE_FENCE | $INDENT), \"\\u001e\"" "$TMP_DIR/wiki.json" 2>/dev/null
|
|
350
|
+
jq -j "${KEEP_ARGS[@]}" "$EXTRAS_DEF $ORIGIN_DEF [.scenarios[]? | $KEEP][:$SCENARIOS_N][] | ((\"- \" + (.summary | $ELIDE) + $(cut_pointer Scenario summary) + $STAMP + extras(\"\"; .summary) + origin) | $CLOSE_FENCE | $INDENT), \"\\u001e\"" "$TMP_DIR/scenarios.json" 2>/dev/null
|
|
329
351
|
)
|
|
330
352
|
[ -n "$BODY" ] || finish_with_notices
|
|
353
|
+
case "$BODY" in
|
|
354
|
+
*" · from "*) FOOTER="${FOOTER}${NL}${PRECEDENT_NOTE}" ;;
|
|
355
|
+
esac
|
|
331
356
|
|
|
332
357
|
emit "${NOTICES}${HEADING}${NL}${BODY}${NL}${FOOTER}${NL}"
|
package/dist/ask-prompt.js
CHANGED
|
@@ -8,8 +8,8 @@ const FALLBACK = [
|
|
|
8
8
|
'',
|
|
9
9
|
'Answer the question below from what the memory hub already knows, in plain language.',
|
|
10
10
|
'',
|
|
11
|
-
|
|
12
|
-
'2. When a project is named, list its pages with `memory_list type=Wiki titlePrefix="<Project> ›"`.',
|
|
11
|
+
"1. Search with `memory_recall` scope=all, which covers every project's shared items and your own, for Facts, Skills, Scenarios and Wiki pages. Say which project an answer came from, and keep another customer's names, data and terms out of anything meant for this one.",
|
|
12
|
+
'2. When a project is named, list its pages with `memory_list type=Wiki scope=all titlePrefix="<Project> ›"`.',
|
|
13
13
|
'3. Read anything cut short with `memory_get`, and back each claim with the uid it came from.',
|
|
14
14
|
"4. When the hub has nothing, say so and ask which sources to read; reading sources costs tokens. Searching everything for a project needs Claude Code in the project's repo.",
|
|
15
15
|
'5. Never paste SOW or Slack text, and never save prices, rates, budgets, customer personal data or credentials.',
|
package/dist/index.js
CHANGED
|
@@ -111,9 +111,9 @@ server.tool('memory_getSkillGuide', 'Get the current Memory Hub usage guide —
|
|
|
111
111
|
const registered = Object.keys(server._registeredTools ?? {});
|
|
112
112
|
return { content: [{ type: 'text', text: (0, guide_check_1.staleBuildNotice)(guide, registered) + (section ? (0, guide_check_1.guideSection)(guide, section) : guide) }] };
|
|
113
113
|
});
|
|
114
|
-
server.tool('memory_recall', "Recall
|
|
114
|
+
server.tool('memory_recall', "Recall Facts, Skills, Scenarios, or Wiki pages. scope: self is your own Private items; team is yours plus what your teams share; all is yours plus every Team and Org item from every project, so use all to find whether another project already solved something. Each item carries repoName and teamName: one from another project is precedent to check against this code, and its customer's names, data and terms stay out of this project's work. See memory_getSkillGuide for when to use each type. An item with a `staleness` field cites files that changed since it was verified; follow the skill guide's 'Stale memories' rules before relying on it.", {
|
|
115
115
|
type: zod_1.z.enum(['Fact', 'Skill', 'Scenario', 'Wiki']),
|
|
116
|
-
scope: zod_1.z.enum(['self', 'team']),
|
|
116
|
+
scope: zod_1.z.enum(['self', 'team', 'all']),
|
|
117
117
|
query: zod_1.z.string().optional(),
|
|
118
118
|
tags: zod_1.z.array(zod_1.z.enum(tags_1.TAG_VALUES)).optional().describe('Fact only.'),
|
|
119
119
|
externalRef: zod_1.z.string().optional().describe("Fact, Scenario only — filter to items linked to this Linear/Jira ticket ref, e.g. 'SOL-1234'. Does not create a task if the ref doesn't resolve to one — returns no results instead."),
|
|
@@ -123,7 +123,7 @@ server.tool('memory_recall', "Recall this developer's (or their team's) Facts, S
|
|
|
123
123
|
const result = await (0, recall_1.performRecall)({ client, embed: embeddings_1.embed, staleness: currentStaleness() }, input);
|
|
124
124
|
return { content: [...embeddingNoticeBlocks(), { type: 'text', text: JSON.stringify(result) }] };
|
|
125
125
|
});
|
|
126
|
-
server.tool('memory_get', "Fetch one Fact/Skill/Scenario/Wiki page in full by its uid (a Wiki page also returns its links and backlinks), with its lastModifiedDate to pass to memory_update as expectedLastModified. memory_recall truncates every item it lists (500 chars by default), so use this to read anything longer than a paragraph — take the uid from a memory_recall result. An item with a `staleness` field cites files that changed since it was verified; follow the skill guide's 'Stale memories' rules before relying on it.", {
|
|
126
|
+
server.tool('memory_get', "Fetch one Fact/Skill/Scenario/Wiki page in full by its uid (a Wiki page also returns its links and backlinks), with the repoName and teamName it belongs to and its lastModifiedDate to pass to memory_update as expectedLastModified. memory_recall truncates every item it lists (500 chars by default), so use this to read anything longer than a paragraph — take the uid from a memory_recall result. An item with a `staleness` field cites files that changed since it was verified; follow the skill guide's 'Stale memories' rules before relying on it.", {
|
|
127
127
|
type: zod_1.z.enum(['Fact', 'Skill', 'Scenario', 'Wiki']),
|
|
128
128
|
uid: zod_1.z.string().min(1).describe('The uid from a memory_recall result.'),
|
|
129
129
|
}, async (input) => {
|
|
@@ -147,7 +147,7 @@ const saveShape = {
|
|
|
147
147
|
tags: zod_1.z.array(zod_1.z.enum(tags_1.TAG_VALUES)).optional().describe('Fact, Skill, Wiki only.'),
|
|
148
148
|
externalRef: zod_1.z.string().optional().describe("Fact, Scenario, Wiki only — the Linear/Jira ticket this relates to, e.g. 'SOL-1234' — pass it when the user mentions a ticket."),
|
|
149
149
|
repo: zod_1.z.string().min(1).optional().describe('A DevRepos uid from memory_listRepos, or the owner/name of a repo memory_listRepos lists, overriding the current-directory auto-detected repo. A repo on a team you are not on is refused, never joined.'),
|
|
150
|
-
visibility: zod_1.z.enum(['Private', 'Team', 'Org']).optional().describe('Choose it on every save ("What to share" in memory_getSkillGuide). Team: work knowledge about a project or customer (decisions, fixes, root causes, how-tos, gotchas, conventions), on that project\'s repo. Org (everyone in the tenant): knowledge about Skedulo\'s own platform, products, tools or practices with no customer names or data, project detail, commercial terms, credentials, unpatched security detail or anything about a person. Private only with a stated reason: personal, an unverified guess, about a person, or barred by the confidentiality rules. Unsure between Org and Team: Team. Team is refused on a repo no team owns yet. Omit it in capture mode, which saves Private.'),
|
|
150
|
+
visibility: zod_1.z.enum(['Private', 'Team', 'Org']).optional().describe('Choose it on every save ("What to share" in memory_getSkillGuide). Team: work knowledge about a project or customer (decisions, fixes, root causes, how-tos, gotchas, conventions), on that project\'s repo; every agent can find it with scope all, so keep customer specifics to what the lesson needs. Org (everyone in the tenant): knowledge about Skedulo\'s own platform, products, tools or practices with no customer names or data, project detail, commercial terms, credentials, unpatched security detail or anything about a person. Private only with a stated reason: personal, an unverified guess, about a person, or barred by the confidentiality rules. Unsure between Org and Team: Team. Team is refused on a repo no team owns yet. Omit it in capture mode, which saves Private.'),
|
|
151
151
|
source: source_1.sourceSchema.optional().describe(source_1.SOURCE_DESCRIPTION),
|
|
152
152
|
supersedes: zod_1.z.string().min(1).optional().describe('Fact, Skill, Wiki only — the uid of a memory of the same type that this one replaces. After saving, that memory is tagged Superseded if you may edit it (yours, or a Team item on your repo); otherwise the result says why it was not marked.'),
|
|
153
153
|
};
|
|
@@ -192,6 +192,7 @@ server.tool('memory_saveBatch', 'Save up to 25 Facts/Skills/Scenarios/Wiki pages
|
|
|
192
192
|
});
|
|
193
193
|
server.tool('memory_list', "List memory items of one type that you can see, newest first, with a title, visibility, repo and whether each is yours — an inventory for choosing which items to share, move or review. Feed the uids to memory_setVisibility or memory_moveResourceRepo as resourceIds. Returns total (all matches) and one page of items; page with offset. Not a search: use memory_recall to find content by meaning.", {
|
|
194
194
|
type: zod_1.z.enum(['Fact', 'Scenario', 'Skill', 'Wiki']),
|
|
195
|
+
scope: zod_1.z.enum(['team', 'all']).optional().describe("team (default): yours plus what your teams share. all: also every other team's Team and Org items."),
|
|
195
196
|
repo: zod_1.z.string().min(1).nullable().optional().describe('A DevRepos uid from memory_listRepos. null lists only items with no repo; omit for any repo.'),
|
|
196
197
|
visibility: zod_1.z.enum(['Private', 'Team', 'Restricted', 'Org']).optional(),
|
|
197
198
|
titlePrefix: zod_1.z.string().min(1).optional().describe('Case-insensitive start of the title (Fact: content, Scenario: summary).'),
|
|
@@ -271,7 +272,7 @@ server.tool('memory_listTeamMembers', "List the members (uid and display name) o
|
|
|
271
272
|
const result = await (0, teams_1.performListTeamMembers)({ client }, input);
|
|
272
273
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
273
274
|
});
|
|
274
|
-
server.tool('memory_whoCanRead', "Preview who can read one Fact/Scenario/Skill/Wiki page you can read, from its actual visibility: { visibility, audience }. audience
|
|
275
|
+
server.tool('memory_whoCanRead', "Preview who can read one Fact/Scenario/Skill/Wiki page you can read, from its actual visibility: { visibility, audience }. audience is who sees it by default: author (Private), everyone (Org), team (the repo's owning team with memberCount), coMembers (Team with no repo: the author's teams, with memberCount and readerCount) or grants (Restricted: the granted agents by display name). searchableByEveryone is true for Team and Org: any agent's scope=all search and memory_get reach them. Use it to check sharing instead of guessing from your own session.", {
|
|
275
276
|
type: zod_1.z.enum(['Fact', 'Scenario', 'Skill', 'Wiki']),
|
|
276
277
|
uid: zod_1.z.string().min(1),
|
|
277
278
|
}, async (input) => {
|
package/dist/similar-notice.js
CHANGED
|
@@ -13,7 +13,7 @@ function ownerLabel(match) {
|
|
|
13
13
|
if (match.mine) {
|
|
14
14
|
return ', yours';
|
|
15
15
|
}
|
|
16
|
-
return canEdit(match) ? ", a teammate's, editable" : ",
|
|
16
|
+
return canEdit(match) ? ", a teammate's, editable" : ", someone else's";
|
|
17
17
|
}
|
|
18
18
|
exports.ownerLabel = ownerLabel;
|
|
19
19
|
const UPDATE_GUARD = "expectedLastModified=<its lastModifiedDate from memory_get>";
|
package/package.json
CHANGED
package/skill-guide.md
CHANGED
|
@@ -18,9 +18,27 @@ for the one optional hook that does.
|
|
|
18
18
|
If you're about to work on something that might have prior context not
|
|
19
19
|
already surfaced at session start — a past decision on this specific repo,
|
|
20
20
|
a known gotcha, a previously-solved version of this exact problem — call
|
|
21
|
-
`memory_recall` with
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
`memory_recall` with an optional `query` string to narrow it. `scope: 'team'`
|
|
22
|
+
is your own items plus what your teams share; `scope: 'all'` adds every other
|
|
23
|
+
project's Team and Org items, so use `all` to find whether another project
|
|
24
|
+
already met this; `scope: 'self'` is your Private items only. Don't call it
|
|
25
|
+
reflexively for every task; call it when the task smells like something that
|
|
26
|
+
may have come up before.
|
|
27
|
+
|
|
28
|
+
**When you hit a problem, ask the whole hub first.** When an error, a failing
|
|
29
|
+
test or unexpected platform behaviour shows up and the cause is not obvious,
|
|
30
|
+
call `memory_recall` with `scope: 'all'` and the error text or a one-line
|
|
31
|
+
description as the `query`, before debugging. Every project runs on the same
|
|
32
|
+
platform, so the fix often exists already. The prompt hook searches only on
|
|
33
|
+
the first prompt of a session; a problem that appears later needs this call.
|
|
34
|
+
|
|
35
|
+
**Another project's item is precedent, not this project's rule.** Each
|
|
36
|
+
recalled or fetched item names its `repoName` and `teamName`, and the prompt hook marks
|
|
37
|
+
one from another repo `· from <repo> (<team>)`. Check it against this code
|
|
38
|
+
before applying it, and say which project it came from when you rely on it.
|
|
39
|
+
Keep that customer's names, data, configuration values and commercial terms
|
|
40
|
+
out of this project's code, documents and messages: carry the lesson, not the
|
|
41
|
+
details.
|
|
24
42
|
|
|
25
43
|
Pass `type: 'Fact'`, `'Skill'`, `'Scenario'`, or `'Wiki'` to pick what kind of
|
|
26
44
|
content you're looking for — a past decision/gotcha, a reusable procedure, a
|
|
@@ -197,6 +215,12 @@ project's sync job."). You make this choice yourself; nobody has to approve it.
|
|
|
197
215
|
hub entirely.
|
|
198
216
|
- **Unsure between Org and Team: Team.**
|
|
199
217
|
|
|
218
|
+
**Team items are searchable by everyone.** A Team item shows by default only
|
|
219
|
+
to the team that owns its repo, but every agent's `scope: 'all'` search and
|
|
220
|
+
`memory_get` reach it, from any project. Write it so the lesson reads on its
|
|
221
|
+
own, with the customer's specifics kept to what the lesson needs. Private is
|
|
222
|
+
the only way to keep an item to yourself.
|
|
223
|
+
|
|
200
224
|
Auto-capture is the exception: its saves are `Private` (see "Automatic
|
|
201
225
|
capture" below).
|
|
202
226
|
|
|
@@ -377,7 +401,8 @@ one client engagement's general notes to another client's team the moment
|
|
|
377
401
|
you're working both engagements concurrently — so it stays `Private` by
|
|
378
402
|
default instead. A repo that isn't linked to any team yet is treated the
|
|
379
403
|
same as repo-less (no defined audience) until someone links it with
|
|
380
|
-
`memory_linkRepoTeam`.
|
|
404
|
+
`memory_linkRepoTeam`. Either way, a Team item is also found by every agent's
|
|
405
|
+
`scope: 'all'` search; the team decides only who sees it by default.
|
|
381
406
|
|
|
382
407
|
Two consequences worth knowing:
|
|
383
408
|
|
|
@@ -402,19 +427,22 @@ Two consequences worth knowing:
|
|
|
402
427
|
## Checking who can read an item
|
|
403
428
|
|
|
404
429
|
- **`memory_whoCanRead`** — `type` and `uid` of an item you can read; returns
|
|
405
|
-
`{ visibility, audience }
|
|
430
|
+
`{ visibility, audience, searchableByEveryone }`. `audience` is who sees it by
|
|
431
|
+
default, and its `kind` is `author`, `everyone`,
|
|
406
432
|
`team` (the repo's team, with `memberCount`), `coMembers` (Team item with no
|
|
407
433
|
repo: the author's teams plus `readerCount`) or `grants` (Restricted: display
|
|
408
|
-
names of the granted agents).
|
|
409
|
-
|
|
410
|
-
|
|
434
|
+
names of the granted agents). `searchableByEveryone` is true for Team and
|
|
435
|
+
Org: any agent's `scope: 'all'` search reaches them. Use it to check who sees
|
|
436
|
+
an item instead of guessing from the author's session. It only reads, so it
|
|
437
|
+
needs no permission.
|
|
411
438
|
|
|
412
439
|
## Sharing tools
|
|
413
440
|
|
|
414
441
|
- **`memory_joinTeam`** — `teamName` of an existing team (never creates one).
|
|
415
442
|
**`memory_addTeamMember`** — `teamName` you already belong to and `agent`
|
|
416
|
-
(a uid or exact display name; idempotent). Both change who
|
|
417
|
-
|
|
443
|
+
(a uid or exact display name; idempotent). Both change who sees Team items
|
|
444
|
+
by default and who can edit them, so call them only on a person's yes, never
|
|
445
|
+
on your own judgment.
|
|
418
446
|
Membership is symmetric: adding someone shares their own repo-less Team
|
|
419
447
|
items with every member of the team, and theirs with them, so tell the
|
|
420
448
|
person being added first.
|
|
@@ -429,9 +457,10 @@ Two consequences worth knowing:
|
|
|
429
457
|
- **`memory_grantAccess`** — shares a specific item with one named teammate
|
|
430
458
|
(automatically promotes it to `Restricted` if needed).
|
|
431
459
|
|
|
432
|
-
Visibility levels: `Private` is you only. `Team`
|
|
433
|
-
item's repo (or, for a repo-less item, every team you're in)
|
|
434
|
-
|
|
460
|
+
Visibility levels: `Private` is you only. `Team` shows by default to the team
|
|
461
|
+
that owns the item's repo (or, for a repo-less item, every team you're in),
|
|
462
|
+
and every agent finds it with `scope: 'all'`. `Org` is every agent in the
|
|
463
|
+
tenant, whatever their team. Which one a save gets is the "What
|
|
435
464
|
to share" rule above; when in doubt, `Team`. `Restricted`
|
|
436
465
|
needs a named person, so only `memory_grantAccess` sets it, never a save.
|
|
437
466
|
|
|
@@ -564,7 +593,8 @@ Rules:
|
|
|
564
593
|
developer and suggest "catch up the <Project> knowledge with the code".
|
|
565
594
|
- Never attempt an edit you cannot make. Org items are author-only. A Team item you did not write
|
|
566
595
|
can be edited only on one of your teams' repos and only with `expectedLastModified`. Private and
|
|
567
|
-
Restricted items of others are never yours to edit. Flag these instead
|
|
596
|
+
Restricted items of others are never yours to edit. Flag these instead; for an item from another
|
|
597
|
+
team's repo, name its repo and team so the developer can tell its owners.
|
|
568
598
|
- Automatic capture never fixes or marks other items; it only updates its own Facts and Scenarios.
|
|
569
599
|
- Never write stale text into content: no "may be out of date" notes. Staleness is worked out each
|
|
570
600
|
time an item is read, never stored.
|
|
@@ -599,8 +629,8 @@ clear it back to unscoped rather than reassign it. To move many at once, pass
|
|
|
599
629
|
`resourceIds` (up to 100 of one `resourceType`) instead of `resourceId`. List
|
|
600
630
|
the set with `memory_list` and collect every page's uids before moving
|
|
601
631
|
anything, since a move drops items out of a `repo` filter and shifts later
|
|
602
|
-
pages. Moving Team-visible items into another team's repo changes who
|
|
603
|
-
them.
|
|
632
|
+
pages. Moving Team-visible items into another team's repo changes who sees them
|
|
633
|
+
by default and who can edit them.
|
|
604
634
|
|
|
605
635
|
## Linking a repo to a team
|
|
606
636
|
|