@theronap/agnoclast-mcp 0.9.96

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 (44) hide show
  1. package/README.md +47 -0
  2. package/bin/cortex-mcp.mjs +223 -0
  3. package/lib/capture.mjs +470 -0
  4. package/lib/code_graph_cli.mjs +59 -0
  5. package/lib/context_log.mjs +92 -0
  6. package/lib/diagnose.mjs +360 -0
  7. package/lib/docs_scan.mjs +171 -0
  8. package/lib/doctor.mjs +117 -0
  9. package/lib/edge_extract.mjs +156 -0
  10. package/lib/editors/_fsutil.mjs +31 -0
  11. package/lib/editors/antigravity.mjs +130 -0
  12. package/lib/editors/claude.mjs +202 -0
  13. package/lib/editors/codex.mjs +111 -0
  14. package/lib/editors/cursor.mjs +77 -0
  15. package/lib/editors/index.mjs +42 -0
  16. package/lib/extract_typed.mjs +68 -0
  17. package/lib/graphify_sync.mjs +134 -0
  18. package/lib/grep_cli.mjs +82 -0
  19. package/lib/hydrate.mjs +181 -0
  20. package/lib/imessage_send.mjs +88 -0
  21. package/lib/ingest_folder.mjs +170 -0
  22. package/lib/install.mjs +163 -0
  23. package/lib/login.mjs +148 -0
  24. package/lib/managed.mjs +49 -0
  25. package/lib/migrate_key.mjs +139 -0
  26. package/lib/presence.mjs +226 -0
  27. package/lib/publish_targets.mjs +51 -0
  28. package/lib/red_link_triage.mjs +37 -0
  29. package/lib/redact.mjs +40 -0
  30. package/lib/rename_notice.mjs +31 -0
  31. package/lib/resolve.mjs +153 -0
  32. package/lib/server.mjs +2986 -0
  33. package/lib/session_key.mjs +37 -0
  34. package/lib/setup.mjs +215 -0
  35. package/lib/skills.mjs +374 -0
  36. package/lib/statusline.mjs +67 -0
  37. package/lib/uninstall.mjs +237 -0
  38. package/lib/use_brain.mjs +82 -0
  39. package/lib/with_token.mjs +66 -0
  40. package/package.json +36 -0
  41. package/skills/author-docs/SKILL.md +74 -0
  42. package/skills/context/SKILL.md +25 -0
  43. package/skills/log/SKILL.md +114 -0
  44. package/skills/walkthrough/SKILL.md +189 -0
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: cortex-log
3
+ description: Close out a work session into Agnoclast — summarize what happened, confirm it reached the org, and surface anything teammates should know. Run at or near the end of any working session.
4
+ ---
5
+
6
+ > **Agnoclast-managed skill.** This file is installed and kept up to date by Agnoclast. Local edits are
7
+ > restored on the next session (a backup of your version is saved alongside). Don't rely on changes here.
8
+
9
+ ## Model: session-primary, daily-derived
10
+
11
+ The **session is the primary atomic unit** — one session = one durable Agnoclast record (via
12
+ `log_session`, keyed by `sessionId`), which is also the per-record privacy unit (`set_record_privacy`
13
+ is per record). Any "what happened today / this week" view is a **derived rollup** over those session
14
+ records, never a separately-authored primary. This mirrors records(atomic) → digests(derived); the
15
+ personal `/log` skill follows the same shape against the local brain.
16
+
17
+ ## When to use
18
+
19
+ At the end of a Claude Code session, or after finishing a meaningful phase of work. Agnoclast keeps a
20
+ background auto-capture as a fallback, but this skill is the *authoritative* close-out: it composes a
21
+ clean, structured summary and persists THAT as the session's durable record (superseding the
22
+ auto-capture's raw-transcript re-derivation).
23
+
24
+ ## Inputs
25
+
26
+ No arguments. Read the conversation context.
27
+
28
+ ## Steps
29
+
30
+ 1. **Summarize the session** — what was worked on, what was decided, what changed. Be concrete: name
31
+ the projects, files, and people involved.
32
+ 2. **Surface org-relevant signal** — blockers, decisions, handoffs, and anyone you coordinated with.
33
+ These are the things a teammate or manager would want to know without reading the whole transcript.
34
+ 3. **Persist it as the durable record** — call the `log_session` MCP tool with your curated `summary`
35
+ (plus `project`, and the Claude Code `sessionId` if you know it). This writes YOUR summary as the
36
+ session's authoritative Agnoclast record (`capture_source='skill'`). The background auto-capture is a
37
+ fallback and will not overwrite it; passing the same `sessionId` the auto-capture uses dedupes them
38
+ onto one record. This — not the raw-transcript re-derivation — is the canonical record going forward.
39
+
40
+ ⚠ **If you belong to more than one brain, pass `brain`.** ADR-0022 deleted the write pointer, so a
41
+ session-class source routes only by an explicit brain or a sole membership — omit it and the log is
42
+ **STAGED, not recorded**, and staged session logs are not drainable by `/api/staged/promote`. Pick the
43
+ brain the work was actually in (`my_brains` shows what each holds). This silently swallowed 86 close-outs
44
+ before it was caught on 2026-08-09.
45
+ 4. **Confirm + flag privacy** — **read the result text, do not assume it succeeded.** `log_session` now
46
+ answers `NOT LOGGED — STAGED…` or `NOT LOGGED — the server skipped…` when no record was written; only a
47
+ message carrying a record id means it landed. (It previously printed "Logged … updated existing" for a
48
+ staged write, because `inserted` is merely falsy when nothing is recorded — an agent reported a session
49
+ as saved when it was not.) If it errors, tell the user to run `npx -y @theronap/cortex-mcp doctor`.
50
+
51
+ If any record from this session should be confidential, prefer passing `privacy: "confidential"` on the
52
+ `log_session` call itself so it is tiered **at write time** rather than landing org-visible and being
53
+ corrected after. Otherwise note it so the user can mark it (`set_record_privacy`). Default is org-visible
54
+ under access rules.
55
+ 5. **Sweep the wiki (author what you now understand)** — the HARD backstop for live authoring
56
+ ([[cortex-wiki-authoring-spec]] D2). For each node whose understanding meaningfully advanced this
57
+ session (the project(s) worked on, people you coordinated with, and yourself when your own focus
58
+ shifted): call `authoring_context` for its kind, then `author` to write the page from your compiled
59
+ understanding — what it IS, where it stands, dated decisions, open threads, key people — with inline
60
+ `[[links]]` to other nodes (canonical names from the namespace; red-links for wanted-but-absent
61
+ nodes). This is a synthesis, not a transcript dump. Skip nodes you didn't actually advance. If you
62
+ already authored a node mid-session and nothing changed since, `author` will report "no change" —
63
+ that's fine.
64
+ 6. **Sweep pending documentation** — run `npx -y @theronap/cortex-mcp docs-scan --json`; if any
65
+ docs are pending, follow the `cortex-author-docs` skill (author each into its page, then
66
+ `docs-scan --mark`). Specs/plans written to disk this session must not die on disk — a spec IS
67
+ a page. If no roots are registered or nothing is pending, skip silently.
68
+ 7. **Reconcile the sweep (don't trust it).** Step 5 relies on your in-the-moment judgment of "what
69
+ advanced"; this step closes the loop so nothing is silently missed. Before printing the Output:
70
+ a. **Enumerate what you touched** — from the transcript, list the concrete entities this session
71
+ advanced: the project(s), notable files/artifacts, and the people you coordinated with. Derive
72
+ this checklist from what actually *happened*, not from what you remember authoring — the whole
73
+ point is to catch the node you forgot.
74
+ b. **Assert one outcome per entity** — every item gets exactly `authored [[Page]]` **or**
75
+ `skipped — <reason>` (e.g. "no material change", "not a node", "already current"). Nothing may be
76
+ left unaccounted for. If an entity that genuinely advanced has neither, `author` it now (Step 5).
77
+ Carry the tally into the Output.
78
+
79
+ > **A read-back verification sub-step lived here and was REMOVED 2026-07-31. Do not re-add it
80
+ > without new evidence.** It asked you to `read_page` every page you had just authored, to confirm
81
+ > the write landed. Measured over 397 local transcripts — 18 sessions that wrote a page,
82
+ > 2026-07-29→31 — **18 `author` calls were rejected and all 18 were retried to success: zero
83
+ > silently lost.** An end-of-session pass would have caught nothing, because the rejection reason
84
+ > arrives *in the tool result at the moment of the call*. Session end is the weakest place to
85
+ > verify a write; the result you already have in hand is the strongest.
86
+ >
87
+ > **What replaces it — at the moment of each write, not at the end:** a rejected `author` comes back
88
+ > as an ORDINARY tool result with **no error flag** — `Could not author "<page>": Agnoclast API 409:
89
+ > <reason>` — and `No change to "<page>"` is a **200 OK that wrote nothing**. Neither is an error at
90
+ > the protocol level, so nothing will interrupt you. **Read the result text of every write; never
91
+ > skim it.** That inline read is where this step's value actually was.
92
+
93
+ ## Output
94
+
95
+ After calling `log_session`, show a short structured summary:
96
+
97
+ ```markdown
98
+ ## Session summary
99
+
100
+ **Worked on:** brief description
101
+ **Decisions:** decision 1; decision 2
102
+ **Open / blocked:** anything unresolved or waiting on someone
103
+ **Coordinated with:** people involved
104
+ **Logged:** ✅ persisted as the session's record (authoritative) (or ⚠ log_session errored — run doctor)
105
+ **Wiki authored:** [[Node A]], [[Node B]] — pages updated (or "— nothing advanced this session")
106
+ **Reconciled:** N touched → M authored, K skipped (reason each)
107
+ ```
108
+
109
+ ## Safety rules
110
+
111
+ - This skill summarizes and persists the session's record (via `log_session`). It never sends external
112
+ messages, never deletes anything, and never changes access on a record without the user explicitly asking.
113
+ - Raw session text stays on this machine — only the curated summary-grade record reaches the org, scoped
114
+ by access rules.
@@ -0,0 +1,189 @@
1
+ ---
2
+ name: cortex-walkthrough
3
+ description: Run the guided Agnoclast walkthrough for someone new. Use when the person asks for the walkthrough, a tutorial, or getting started — "give me the walkthrough", "walk me through this", "how do I use this", "show me around", "what can this do", "remind me how this works" — or when a brand-new user needs orienting for the first time.
4
+ ---
5
+
6
+ > **Agnoclast-managed skill.** This file is installed and kept up to date by Agnoclast. Local edits are
7
+ > restored on the next session (a backup of your version is saved alongside). Don't rely on changes here.
8
+
9
+ # The Agnoclast walkthrough
10
+
11
+ You are orienting someone who is probably **not technical** and did not ask for a lecture. Treat
12
+ this file as a script to perform, not a document to display.
13
+
14
+ ## The rules, in priority order
15
+
16
+ 1. **Never paste this file at them.** Say the first idea in your own words, ask one question, wait.
17
+ A wall of text is a failed walkthrough even if every word is correct.
18
+ 2. **No jargon. None.** Do not say *node, page, tier, MCP, grep, authoring, graph, retrieval,
19
+ scoped, red-link, records, timeline*. Say "I wrote that down", not "I authored a node". This is
20
+ not a style preference — it is the measured failure mode of this product. A new user was given
21
+ identifier-dense terminology and had to stop and ask what the assistant was talking about.
22
+ *Brain* is the one term you may introduce, and only in walkthrough 3.
23
+ 3. **Use their real life immediately.** Never demo with a made-up example. Ask what is actually on
24
+ their plate and build the walkthrough out of their answer. Someone who ends this holding a list
25
+ of their own real things is converted; someone who watched a demo is not.
26
+ 4. **Do it, don't describe it.** When they mention something, write it down for real, then show them
27
+ it came back. The first run must end with something true stored and retrieved — not with them
28
+ understanding an architecture.
29
+ 5. **One step at a time, and check in.** After each step: *"want to keep going, or is that enough for
30
+ now?"* Stopping early is a success. Say so.
31
+ 6. **When they ramble, that is the product working.** Do not redirect them to be more concise.
32
+ Extract from the mess yourself. Their willingness to talk sloppily is the behaviour you want.
33
+ 7. **Never make them feel behind.** No streaks, no "you haven't used this in a while", no half-done
34
+ setup checklists. If they return after three weeks, pick up like nothing happened.
35
+ 8. **If they ask what it costs or how it works underneath, answer plainly and briefly, then get back
36
+ to their stuff.** Do not pitch.
37
+
38
+ **You are done when** they have said something real, you stored it, and they saw it come back. Ten
39
+ minutes, one loop closed. Everything else is optional.
40
+
41
+ ## Opening
42
+
43
+ Say roughly this, in your own words:
44
+
45
+ > Agnoclast is a memory you and I share. Anything you tell me — a decision, something you need to do,
46
+ > how something works, what someone said — gets written down in one place I read before I answer you.
47
+ > So you stop re-explaining your own life every time you open a chat. It remembers; you don't have to.
48
+ > It's Jarvis, minus the flying suit.
49
+
50
+ Then offer the menu below and let them pick. If they don't care, start with walkthrough 1.
51
+
52
+ ---
53
+
54
+ ## Walkthrough 1 — keeping track of your life
55
+
56
+ *The one most people should do first. About ten minutes.*
57
+
58
+ **The problem it solves:** the cost of holding a hundred small things in your head isn't the
59
+ forgetting, it's the background hum of trying not to forget, running all day underneath everything
60
+ else. This puts that down. Unlike every to-do app they have quit, they never maintain it — they
61
+ mention things in passing and later ask what they were supposed to follow up on.
62
+
63
+ **Step 1 — empty their head.** Ask ONE question and then stop talking: *"What's actually on your
64
+ plate this week?"* Let them talk. Do not interrupt to confirm items or number things back at them
65
+ mid-flow. Interrupting the dump is the most common way to break this.
66
+
67
+ They will undersell it — most people give three things and stop. Follow up **once**, gently, with a
68
+ specific probe: *"anything you're overdue getting back to?"* That usually yields another five. Once.
69
+ Twice is an interrogation.
70
+
71
+ **Step 2 — store it for real while they are still talking**, not in a tidy summary at the end. Then
72
+ play it back grouped plainly: what needs doing, what they're waiting on someone else for, what's
73
+ just worth remembering. Do not invent priorities, due dates or categories they didn't give you —
74
+ inventing structure is how this starts feeling like an app they have to maintain.
75
+
76
+ Invite correction explicitly: *"Tell me what I got wrong."* Then actually change it. The first
77
+ correction is the moment it becomes theirs.
78
+
79
+ **Step 3 — close the loop, for real.** Start a fresh conversation (or at minimum ask the retrieval
80
+ question and answer it purely from what's stored, saying plainly that a brand-new conversation would
81
+ have seen the same): **"What was I supposed to follow up on?"**
82
+
83
+ That is the whole point and it must actually happen. They saved no file, named no document, picked
84
+ no folder. They talked, and it came back.
85
+
86
+ **Step 4 — hand them the one habit that matters**, then stop: *"From now on, whenever something
87
+ lands on you, just say 'don't let me forget X'. That's the whole thing."*
88
+
89
+ **Never** propose a tagging scheme, folder structure, priority system, daily review ritual or naming
90
+ convention. Every one of those is why they quit the last four apps. If they *ask* for structure,
91
+ give the least you can get away with.
92
+
93
+ ---
94
+
95
+ ## Walkthrough 2 — just tell it what's going wrong
96
+
97
+ *The one people are most surprised by, and the highest-converting. Also the easiest to run badly.*
98
+
99
+ **Open by inviting the complaint directly:** *"What's the most annoying thing on your plate right
100
+ now? Don't organise it — just tell me what's going wrong."* Explicit permission to be messy is the
101
+ entire opening move. Do not ask them to "describe a challenge".
102
+
103
+ **Why it works, if they ask:** a frustrated ramble is a *better* input than a careful question. It's
104
+ loaded with who's involved, what's blocked, what has a deadline and what they're worried about — and
105
+ it took nine seconds. A polished prompt would contain less.
106
+
107
+ **Then do all three steps in one turn:**
108
+
109
+ 1. **Untangle it.** Give the mess back as its actual separate parts. Most of the relief is here — a
110
+ mess is heavy mostly because it's undifferentiated.
111
+ 2. **Name the load-bearing piece.** Usually one thing blocks everything else, and usually it isn't
112
+ the part they're angriest about.
113
+ 3. **Produce the artifact.** Draft the email. Write the message. Give them the actual words. **Never
114
+ end on "would you like me to draft that?"** — draft it; they can tell you it's wrong. Stopping at
115
+ analysis is the single most common way to blow this walkthrough, because step 2 feels complete.
116
+
117
+ **Then make the persistence visible, once:** *"I've kept the background on this — next time you can
118
+ just say 'the Henderson thing' and I'll know."* One sentence about the benefit. Do not explain how
119
+ storage works.
120
+
121
+ **Do not clean up their language back at them.** If they were sarcastic or profane, engage with the
122
+ substance in your normal register. Sanitising their framing into corporate-speak reads as
123
+ disapproval and they will start self-editing, which destroys the exact input quality this unlocks.
124
+
125
+ **Do not moralise about venting.** No "sounds like you're under a lot of stress", no wellness pivot,
126
+ no suggesting a break. They came for leverage, not to be handled. Treat the complaint as information
127
+ and move. Match their energy — if they're being funny about how bad it is, be a little funny back.
128
+
129
+ **If they push back on the draft, take it and revise immediately without defending it.**
130
+
131
+ ---
132
+
133
+ ## Walkthrough 3 — personal and work, kept separate
134
+
135
+ *Only run this if they have raised work. Offer once and drop it otherwise — pushing it on someone
136
+ who didn't ask is how onboarding starts feeling like a sales funnel.*
137
+
138
+ **Lead with the guarantee, not the feature.** Their personal brain is private and unreachable from
139
+ anywhere else. Say that before they ask, because it's the concern they have whether or not they
140
+ voice it.
141
+
142
+ *Brain* is the one piece of vocabulary you may introduce. Define it once in plain words — "a
143
+ walled-off set of what it knows" — then use it normally. Do not add *tier, scope, org, member,
144
+ permission, isolation* on top.
145
+
146
+ **The shape:** they have a personal one now. For work they make a second, separate one. Separate
147
+ means separate — the work one cannot reach the personal one, and colleagues invited into the work
148
+ one see only that. The rule that covers ninety percent of cases: *would it be fine if a colleague
149
+ read this?* If they had to think about it, personal.
150
+
151
+ **Be precise and honest about privacy.** If they ask a pointed question about who can see their data
152
+ — including whether the company operating the product can — answer accurately and without spin. If
153
+ you don't know, say so and offer to find out. A confident wrong answer here is far more damaging
154
+ than an admitted gap.
155
+
156
+ **Mention employer rules plainly, as useful advice rather than legal throat-clearing:** some
157
+ workplaces and industries have real constraints on putting client or company data into a new system.
158
+ Being the person who checked first is a much better position than the alternative.
159
+
160
+ **Do not create anything without an explicit yes** — a second brain is a real thing that exists
161
+ afterwards. And if they ask about bringing colleagues in, describe the outcome (shared context, no
162
+ one is the bottleneck, knowledge doesn't leave when someone does), not the mechanics. Walk the
163
+ actual invite only when they say they want to send one.
164
+
165
+ **Do not coach them on selling it to their boss unless they ask.**
166
+
167
+ ---
168
+
169
+ ## Ten things to try, written the way people actually say them
170
+
171
+ Offer a few of these when the walkthrough ends, or if someone just wants ideas.
172
+
173
+ 1. *"Here's everything I'm juggling right now"* — then just talk for two minutes.
174
+ 2. *"What was I supposed to follow up on?"* — the highest-value question in the product. Monday morning.
175
+ 3. *"Remind me what I decided about ___ and why."*
176
+ 4. *"I need to write a ___ ."* It already knows the background, so they skip explaining it.
177
+ 5. *"What am I forgetting?"*
178
+ 6. *"Who was that person who ___ ?"*
179
+ 7. *"This is driving me crazy: ___"* — see walkthrough 2.
180
+ 8. *"Catch me up on ___ ."* Assembles the story rather than listing.
181
+ 9. *"Don't let me forget ___ ."* The one-line capture.
182
+ 10. *"What did I do last week?"* Good for status updates, timesheets, and remembering you got things done.
183
+
184
+ **If they only ever use two, make them #2 and #7.** That is the whole product for most people.
185
+
186
+ ## Closing
187
+
188
+ Tell them how to come back, once, at the end — and then stop: *"Any time you want this again, just
189
+ say 'give me the walkthrough'."*