@pcircle/memesh 4.5.0 → 4.5.1

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 (176) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.mcp.json +1 -1
  4. package/README.de.md +2 -5
  5. package/README.es.md +5 -8
  6. package/README.fr.md +3 -6
  7. package/README.ja.md +5 -8
  8. package/README.ko.md +5 -8
  9. package/README.md +28 -10
  10. package/README.pt.md +3 -6
  11. package/README.th.md +3 -6
  12. package/README.vi.md +3 -6
  13. package/README.zh-CN.md +5 -8
  14. package/README.zh-TW.md +5 -8
  15. package/dashboard/dist/index.html +9 -9
  16. package/dist/cli/view.d.ts.map +1 -1
  17. package/dist/cli/view.js +2 -2
  18. package/dist/cli/view.js.map +1 -1
  19. package/dist/core/analytics.d.ts +3 -3
  20. package/dist/core/analytics.d.ts.map +1 -1
  21. package/dist/core/analytics.js.map +1 -1
  22. package/dist/core/config.d.ts +0 -1
  23. package/dist/core/config.d.ts.map +1 -1
  24. package/dist/core/config.js +2 -1
  25. package/dist/core/config.js.map +1 -1
  26. package/dist/core/demo.d.ts +2 -2
  27. package/dist/core/demo.d.ts.map +1 -1
  28. package/dist/core/demo.js.map +1 -1
  29. package/dist/core/doctor.d.ts +1 -0
  30. package/dist/core/doctor.d.ts.map +1 -1
  31. package/dist/core/doctor.js +191 -47
  32. package/dist/core/doctor.js.map +1 -1
  33. package/dist/core/dreamer.d.ts +15 -7
  34. package/dist/core/dreamer.d.ts.map +1 -1
  35. package/dist/core/dreamer.js +310 -35
  36. package/dist/core/dreamer.js.map +1 -1
  37. package/dist/core/embedder.d.ts +2 -1
  38. package/dist/core/embedder.d.ts.map +1 -1
  39. package/dist/core/embedder.js +22 -1
  40. package/dist/core/embedder.js.map +1 -1
  41. package/dist/core/extractor.d.ts.map +1 -1
  42. package/dist/core/extractor.js +2 -1
  43. package/dist/core/extractor.js.map +1 -1
  44. package/dist/core/graph.d.ts +4 -4
  45. package/dist/core/graph.d.ts.map +1 -1
  46. package/dist/core/graph.js.map +1 -1
  47. package/dist/core/install-hooks.d.ts +1 -0
  48. package/dist/core/install-hooks.d.ts.map +1 -1
  49. package/dist/core/install-hooks.js +0 -0
  50. package/dist/core/install-hooks.js.map +1 -1
  51. package/dist/core/kg-backfill.d.ts +4 -4
  52. package/dist/core/kg-backfill.d.ts.map +1 -1
  53. package/dist/core/kg-backfill.js +1 -1
  54. package/dist/core/kg-backfill.js.map +1 -1
  55. package/dist/core/lesson-engine.d.ts +1 -0
  56. package/dist/core/lesson-engine.d.ts.map +1 -1
  57. package/dist/core/lesson-engine.js +1 -0
  58. package/dist/core/lesson-engine.js.map +1 -1
  59. package/dist/core/lifecycle.d.ts +4 -4
  60. package/dist/core/lifecycle.d.ts.map +1 -1
  61. package/dist/core/lifecycle.js +1 -1
  62. package/dist/core/lifecycle.js.map +1 -1
  63. package/dist/core/llm-client.d.ts.map +1 -1
  64. package/dist/core/llm-client.js +3 -6
  65. package/dist/core/llm-client.js.map +1 -1
  66. package/dist/core/llm-telemetry.d.ts +4 -4
  67. package/dist/core/llm-telemetry.d.ts.map +1 -1
  68. package/dist/core/llm-telemetry.js +1 -1
  69. package/dist/core/llm-telemetry.js.map +1 -1
  70. package/dist/core/memory-tool.d.ts.map +1 -1
  71. package/dist/core/memory-tool.js +4 -0
  72. package/dist/core/memory-tool.js.map +1 -1
  73. package/dist/core/operations.d.ts.map +1 -1
  74. package/dist/core/operations.js +22 -7
  75. package/dist/core/operations.js.map +1 -1
  76. package/dist/core/paths.d.ts +3 -0
  77. package/dist/core/paths.d.ts.map +1 -1
  78. package/dist/core/paths.js +67 -1
  79. package/dist/core/paths.js.map +1 -1
  80. package/dist/core/patterns.d.ts +2 -2
  81. package/dist/core/patterns.d.ts.map +1 -1
  82. package/dist/core/patterns.js.map +1 -1
  83. package/dist/core/project-tags.d.ts +3 -3
  84. package/dist/core/project-tags.d.ts.map +1 -1
  85. package/dist/core/project-tags.js.map +1 -1
  86. package/dist/core/projects.d.ts +2 -2
  87. package/dist/core/projects.d.ts.map +1 -1
  88. package/dist/core/projects.js.map +1 -1
  89. package/dist/core/schema-export.d.ts.map +1 -1
  90. package/dist/core/schema-export.js +0 -34
  91. package/dist/core/schema-export.js.map +1 -1
  92. package/dist/core/serializer.d.ts.map +1 -1
  93. package/dist/core/serializer.js +45 -4
  94. package/dist/core/serializer.js.map +1 -1
  95. package/dist/core/stats.d.ts +2 -2
  96. package/dist/core/stats.d.ts.map +1 -1
  97. package/dist/core/stats.js.map +1 -1
  98. package/dist/core/transcript-extractor.d.ts +5 -6
  99. package/dist/core/transcript-extractor.d.ts.map +1 -1
  100. package/dist/core/transcript-extractor.js +4 -24
  101. package/dist/core/transcript-extractor.js.map +1 -1
  102. package/dist/core/transcript-source.d.ts.map +1 -1
  103. package/dist/core/transcript-source.js.map +1 -1
  104. package/dist/core/types.d.ts +17 -7
  105. package/dist/core/types.d.ts.map +1 -1
  106. package/dist/core/types.js +2 -0
  107. package/dist/core/types.js.map +1 -1
  108. package/dist/db.d.ts +5 -5
  109. package/dist/db.d.ts.map +1 -1
  110. package/dist/db.js +155 -17
  111. package/dist/db.js.map +1 -1
  112. package/dist/knowledge-graph.d.ts +3 -2
  113. package/dist/knowledge-graph.d.ts.map +1 -1
  114. package/dist/knowledge-graph.js +19 -10
  115. package/dist/knowledge-graph.js.map +1 -1
  116. package/dist/mcp/server.js +2 -1
  117. package/dist/mcp/server.js.map +1 -1
  118. package/dist/skills-manifest.json +28 -33
  119. package/dist/storage/conflicts.d.ts +3 -3
  120. package/dist/storage/conflicts.d.ts.map +1 -1
  121. package/dist/storage/conflicts.js.map +1 -1
  122. package/dist/storage/fts-index.d.ts +4 -4
  123. package/dist/storage/fts-index.d.ts.map +1 -1
  124. package/dist/storage/fts-index.js.map +1 -1
  125. package/dist/storage/sqlite.d.ts +20 -0
  126. package/dist/storage/sqlite.d.ts.map +1 -0
  127. package/dist/storage/sqlite.js +64 -0
  128. package/dist/storage/sqlite.js.map +1 -0
  129. package/dist/storage/vector-index.d.ts +3 -0
  130. package/dist/storage/vector-index.d.ts.map +1 -0
  131. package/dist/storage/vector-index.js +7 -0
  132. package/dist/storage/vector-index.js.map +1 -0
  133. package/dist/transports/cli/cli.d.ts.map +1 -1
  134. package/dist/transports/cli/cli.js +126 -84
  135. package/dist/transports/cli/cli.js.map +1 -1
  136. package/dist/transports/http/retired-routes.d.ts.map +1 -1
  137. package/dist/transports/http/retired-routes.js +1 -0
  138. package/dist/transports/http/retired-routes.js.map +1 -1
  139. package/dist/transports/http/server.d.ts.map +1 -1
  140. package/dist/transports/http/server.js +48 -29
  141. package/dist/transports/http/server.js.map +1 -1
  142. package/dist/transports/mcp/handlers.d.ts +4 -96
  143. package/dist/transports/mcp/handlers.d.ts.map +1 -1
  144. package/dist/transports/mcp/handlers.js +24 -58
  145. package/dist/transports/mcp/handlers.js.map +1 -1
  146. package/dist/transports/schemas.d.ts +10 -30
  147. package/dist/transports/schemas.d.ts.map +1 -1
  148. package/dist/transports/schemas.js +5 -29
  149. package/dist/transports/schemas.js.map +1 -1
  150. package/hooks/hooks.json +0 -10
  151. package/package.json +6 -10
  152. package/scripts/hooks/_generated/core-paths.js +67 -1
  153. package/scripts/hooks/_generated/sqlite.js +71 -0
  154. package/scripts/hooks/_shared.js +286 -195
  155. package/scripts/hooks/post-commit.js +52 -10
  156. package/scripts/hooks/pre-compact.js +10 -7
  157. package/scripts/hooks/pre-edit-recall.js +4 -8
  158. package/scripts/hooks/session-start.js +95 -47
  159. package/scripts/hooks/session-summary.js +120 -52
  160. package/scripts/hooks/user-prompt-intent.js +3 -2
  161. package/skills/memesh/SKILL.md +1 -2
  162. package/dist/core/skill-usage-log.d.ts +0 -11
  163. package/dist/core/skill-usage-log.d.ts.map +0 -1
  164. package/dist/core/skill-usage-log.js +0 -125
  165. package/dist/core/skill-usage-log.js.map +0 -1
  166. package/dist/core/verifier.d.ts +0 -40
  167. package/dist/core/verifier.d.ts.map +0 -1
  168. package/dist/core/verifier.js +0 -206
  169. package/dist/core/verifier.js.map +0 -1
  170. package/dist/mcp/launcher.d.ts +0 -3
  171. package/dist/mcp/launcher.d.ts.map +0 -1
  172. package/dist/mcp/launcher.js +0 -37
  173. package/dist/mcp/launcher.js.map +0 -1
  174. package/scripts/hooks/pre-bash-orchestration-nudge.js +0 -155
  175. package/scripts/postinstall-rebuild.mjs +0 -41
  176. package/skills/agentic-orchestration/SKILL.md +0 -399
@@ -1,399 +0,0 @@
1
- ---
2
- name: agentic-orchestration
3
- description: Experimental working-model protocol shipped with memesh v4.1. Status — protocol present + instrumented; effectiveness in real usage is being collected (see `memesh patterns`), not yet proven. Suggests a user-as-CTO / Claude-as-orchestrator / background-agents-as-engineers split. Claude routes work by verifiability, dispatches parallel background agents for high-verifiability technical work, and stays foreground only for strategic/understanding work that the user must own. Use as a default for non-trivial software tasks; report back when it helps or doesn't.
4
- user-invocable: true
5
- ---
6
-
7
- # Agentic Orchestration (Experimental Working-Model Protocol)
8
-
9
- > **Status — experimental, instrumented, validation in progress.** This
10
- > skill is shipped to begin collecting evidence about whether a structured
11
- > verifiability-router protocol changes Claude's behavior in ways that
12
- > measurably help users. `memesh patterns` exposes a local counter so you
13
- > can see how often the banner is injected and how often
14
- > `verify_agent_work` is invoked in your real usage. None of that data
15
- > ever leaves your machine.
16
-
17
- > **The roles, suggested:**
18
- > - **User = CTO / PM.** Owns understanding, strategy, product taste, "what is worth building."
19
- > - **Claude = Orchestrator / engineering manager.** Routes work, dispatches agents, reviews diffs, surfaces decisions, never the bottleneck.
20
- > - **Background agents = engineering interns.** Execute high-verifiability technical work in parallel.
21
-
22
- The hypothesis behind this skill: Claude as a single-threaded synchronous
23
- coding partner spends a meaningful portion of the user's time on work
24
- that could run in the background. If that hypothesis holds, this skill
25
- should noticeably reduce wall-clock time on multi-step technical tasks.
26
- We do not yet have field data either way.
27
-
28
- **Announce at start:** "Using agentic-orchestration (experimental protocol) to route this work."
29
-
30
- ---
31
-
32
- ## Why this ships with memesh
33
-
34
- memesh is a local memory layer **and** a working-model activator. Three
35
- parts compose:
36
-
37
- 1. **This skill** — the protocol document. Loaded by Claude Code's skill
38
- system when memesh is installed. Discoverable on its own.
39
- 2. **The SessionStart banner hook** — injects the working model into
40
- Claude's context at session start so it sticks. **Opt-in: set
41
- `MEMESH_ENABLE_AGENTIC_ORCHESTRATION=1`.**
42
- 3. **The PreToolUse Bash nudge hook** — advisory reminder when Claude is
43
- about to run a high-verifiability bash command synchronously,
44
- suggesting `run_in_background: true` instead. **Opt-in: same flag.**
45
-
46
- Default is OFF for parts 2 and 3 — the core memory features (parts that
47
- are not "the protocol") work without setting any flag. Opt in to the
48
- flag if you want to participate in the experiment; doing so also enables
49
- local-only telemetry (`memesh patterns`) so the protocol's effectiveness
50
- can later be validated with real usage data.
51
-
52
- Plus: memesh's self-improving lessons + the `agent_pattern` entity type
53
- (record what dispatch patterns worked) close the loop — the longer you
54
- use memesh, the better Claude gets at orchestrating *your* team's
55
- specific kinds of work.
56
-
57
- Memory is the substrate. Operating model is what makes Claude Code feel
58
- different on day one.
59
-
60
- ---
61
-
62
- ## The Verifiability Router
63
-
64
- Before doing any task, classify it. This decides whether Claude does it
65
- foreground or dispatches it as a background agent.
66
-
67
- ```dot
68
- digraph router {
69
- "New task arrives" [shape=doublecircle];
70
- "Outcome is checkable by code?" [shape=diamond];
71
- "Multiple independent subtasks?" [shape=diamond];
72
- "User must own the decision?" [shape=diamond];
73
- "Foreground sync (Claude does it now)" [shape=box, style=filled];
74
- "Single background agent (run_in_background:true)" [shape=box, style=filled];
75
- "Parallel background agents (one per subtask)" [shape=box, style=filled];
76
-
77
- "New task arrives" -> "User must own the decision?";
78
- "User must own the decision?" -> "Foreground sync (Claude does it now)" [label="yes"];
79
- "User must own the decision?" -> "Outcome is checkable by code?" [label="no"];
80
- "Outcome is checkable by code?" -> "Foreground sync (Claude does it now)" [label="no"];
81
- "Outcome is checkable by code?" -> "Multiple independent subtasks?" [label="yes"];
82
- "Multiple independent subtasks?" -> "Single background agent (run_in_background:true)" [label="no"];
83
- "Multiple independent subtasks?" -> "Parallel background agents (one per subtask)" [label="yes"];
84
- }
85
- ```
86
-
87
- ### Three Tiers — be explicit about which one applies
88
-
89
- | Tier | What it is | Verification cost | Dispatch verdict |
90
- |---|---|---|---|
91
- | **Tier 1 — Machine-verifiable** | tsc, vitest, lint, build, migrate, benchmark, gh run watch | seconds, deterministic | **Background, parallel OK** |
92
- | **Tier 2 — Review-verifiable** | API shape, schema, public types, generated docs, code review against checklist | minutes, semi-automated | **Background OK + auto-trigger code-review after** |
93
- | **Tier 3 — Judgment-required** | UX, naming, architecture, strategy, public-facing copy | hours, human only | **Foreground only — do not dispatch** |
94
-
95
- Operating principle: **anything Tier 1 or Tier 2 should be agentic; verifying it is the bottleneck, not doing it.** If verification of an agent's claim takes longer than the work itself, the dispatch is a net negative — design verification first, then dispatch.
96
-
97
- ### High verifiability (→ background agent)
98
-
99
- The agent can self-verify because the goal is mechanically checkable.
100
-
101
- - Build / typecheck / lint passes
102
- - Test suite passes (unit, integration, e2e)
103
- - Migration applies cleanly to fresh DB
104
- - Benchmark reaches a threshold
105
- - Refactor preserves behaviour (regression tests)
106
- - Code review of a diff against a checklist
107
- - Documentation generated from code matches actual signatures
108
- - Deploy succeeds and a smoke test passes
109
- - Schema diff between two states is empty
110
- - "Make CI green" — the agent can loop until green
111
-
112
- ### Low verifiability (→ foreground, user owns)
113
-
114
- No mechanical check exists. The user's *understanding* is the
115
- verification.
116
-
117
- - Strategy, positioning, pricing, audience choice
118
- - Product feature/scope decisions
119
- - Naming, taglines, copywriting that represents the brand
120
- - Whether a result is "publishable" for marketing
121
- - Whether a proposed direction matches the user's long-term plan
122
- - Trade-off calls (do A and lose B)
123
- - Reviewing the *first* surface a user touches
124
- - Anything that, if Claude got wrong, would damage reputation
125
- irrecoverably
126
-
127
- If unsure: **default to foreground**. The cost of a wrong delegation on
128
- strategic work is much higher than the cost of one extra synchronous
129
- turn.
130
-
131
- ---
132
-
133
- ## Dispatch Patterns
134
-
135
- ### Pattern A — Single background agent (most common)
136
-
137
- For one self-contained verifiable task that takes ≥10 minutes.
138
-
139
- ```
140
- Task tool:
141
- subagent_type: general-purpose (or domain-specific)
142
- description: 3-5 word summary
143
- prompt: Self-contained brief. Include: goal, context the agent needs,
144
- what to produce, what NOT to do (e.g. "do not push to remote",
145
- "do not modify production code"), how to verify success.
146
- isolation: "worktree" ← if it touches files
147
- mode: "acceptEdits" ← so the agent can edit existing files
148
- without permission prompts
149
- run_in_background: true ← always for ≥10min work
150
- ```
151
-
152
- After dispatch:
153
- 1. Tell user one sentence: "Dispatched [agent name] in background, will report back."
154
- 2. **Continue with other work** — do NOT poll, do NOT sleep.
155
- 3. When the system delivers a completion notification, surface results.
156
- 4. Trust but verify: read the agent's actual diff, do not just trust its summary.
157
-
158
- ### Pattern B — Parallel background agents
159
-
160
- For 2+ independent verifiable subtasks. Send all of them in **one
161
- message with multiple Task tool calls**, not sequentially. Then continue
162
- with foreground work (e.g. discussing strategy with the user) while
163
- they run.
164
-
165
- ### Pattern C — Foreground iteration
166
-
167
- For low-verifiability work where the user must stay in the loop. Stop
168
- generating long monologues. Send shorter messages. Ask one focused
169
- question at a time when blocked. Do not make strategic decisions that
170
- the user did not authorize.
171
-
172
- ### Pattern D — Hybrid (recommended for big tasks)
173
-
174
- Most real work is mixed. Run them in the right shape:
175
- - Foreground: "what is the goal, what is in scope, what does success look like"
176
- - Branch off: dispatch background agents for each verifiable subgoal
177
- - Foreground: review their outputs, decide what to keep, iterate
178
-
179
- ---
180
-
181
- ## The Verification Gate (mandatory post-agent procedure)
182
-
183
- **An agent's summary is not evidence. The diff is. Tests passing locally are.**
184
-
185
- Before reporting any agent's work as "done" — to the user, to memory, in a commit message, anywhere — the orchestrator MUST run the verification gate. No exceptions for "this agent is reliable" or "I read the prompt carefully." The discipline is mechanical because human trust scales worse than agents do.
186
-
187
- ### Gate sequence (run in order, stop on first failure)
188
-
189
- ```
190
- 1. Reality check — did the claimed changes actually happen?
191
- git -C <agent_workdir> diff --stat <base>..HEAD
192
- → compare against agent's claim of "files changed"
193
- → if mismatch: agent fabricated. Discard, do not commit.
194
-
195
- 2. Hard verification — do the deterministic checks pass?
196
- npm run typecheck # tsc --noEmit
197
- npm test -- --run # full suite, not "the new tests"
198
- npm run lint (if exists)
199
- npm run build (if changes touch build output)
200
- → if any fail: agent's work is incomplete. Fix-then-dispatch
201
- a follow-up, or take over foreground. Do NOT commit broken state.
202
-
203
- 3. Cross-check — do the numbers in the agent's summary match reality?
204
- "added 5 tests" → grep -c "^\s*it\(" <new test files>
205
- "77/77 pass" → re-run test count, verify
206
- "R@5 = 95.60%" → spot-check one or two of the result rows
207
- → numbers that match by accident are still verified;
208
- numbers that the agent calculated must be re-derived independently.
209
-
210
- 4. Independent review (Tier 2 only) — does an outside reviewer see issues?
211
- Spawn a fresh-context code-review subagent with no memory of the
212
- original work. Have it review only the diff against the project's
213
- standards. Surface any non-overlapping findings.
214
- ```
215
-
216
- ### What the gate is NOT
217
-
218
- - Not a replacement for tests written by the agent — it CHECKS that they pass
219
- - Not "vibes-based" review — every step is a command with deterministic output
220
- - Not skippable when "I'm in a hurry" — speed comes from parallel dispatch, not from skipping verification
221
-
222
- ### Recursive trust problem (do not fall in)
223
-
224
- The verification gate's steps must be **deterministic commands**, not LLM judgment. An "LLM that verifies an LLM" is the same risk class as no verification — both can fabricate. The only safe verifiers are:
225
-
226
- - Compilers and linters
227
- - Test runners with assertions
228
- - Diff tools and `git status`
229
- - File existence + content hash checks
230
- - HTTP probes that assert response codes/shapes
231
- - Schema validators (Zod, JSON Schema, Prisma)
232
-
233
- LLM-as-reviewer is useful for **opinion** ("does this look idiomatic?"), useless for **fact** ("did the test actually run?"). Use it as Tier 2 augmentation, never as Tier 1 substitute.
234
-
235
- ### When verification reveals the agent fabricated
236
-
237
- Treat as a debugging signal, not a personal failure. Record it:
238
- 1. Stash the agent's diff (don't lose it, in case there is salvage)
239
- 2. Note what it claimed vs what the gate found
240
- 3. Save to memesh as a `lesson_learned`: "When dispatching <pattern>, verification at step <N> caught <fabrication-type>"
241
- 4. Decide: re-dispatch with sharper prompt, or take over foreground
242
-
243
- This is how the orchestrator learns which dispatch shapes are reliable for the user's stack.
244
-
245
- ---
246
-
247
- ## Known limitation — file creation in worktree-isolated agents
248
-
249
- In current Claude Code (as of memesh 4.1), background agents launched
250
- with `isolation: "worktree"` can **edit existing files freely** but
251
- sometimes **cannot create new files** even with `mode: "acceptEdits"`.
252
- The user's permission system blocks fresh `Write` calls inside the
253
- isolated worktree.
254
-
255
- Implication: if a task requires creating multiple new source files
256
- (e.g., a new module with new tests), foreground that work or use
257
- `isolation` other than `"worktree"`. For pure-edit tasks (refactors,
258
- fixes, doc updates) and for benchmark/test tasks that only touch
259
- existing files plus a `results/` directory, background dispatch works.
260
-
261
- When in doubt: dispatch one tiny "smoke test" agent that just creates a
262
- new empty file. If that succeeds, the larger task is safe to dispatch.
263
-
264
- ---
265
-
266
- ## The Orchestrator's Discipline
267
-
268
- 1. **Surface results, not progress.** When an agent finishes, report
269
- numbers and decisions, not "I'm running step 12 of 17". The user
270
- does not need a progress bar.
271
-
272
- 2. **Review every agent's actual diff before reporting "done".** Agents
273
- summarise what they intended; only the diff shows what they did. This
274
- is the orchestrator's last line of defence against fabricated
275
- progress.
276
-
277
- 3. **Keep agent prompts self-contained.** Brief them like a smart
278
- colleague who just walked into the room. Include goal, constraints,
279
- success criteria, and explicit "do NOT" lines.
280
-
281
- 4. **Do not be afraid of `isolation: "worktree"`.** Agent work in an
282
- isolated copy is automatically discarded if it produces no useful
283
- change, and merge-able if it does. There is no downside.
284
-
285
- 5. **Spike → land or drop, same day.** Per CONTRIBUTING.md branch
286
- lifecycle discipline: a spike that lives past its verdict becomes
287
- technical debt. Dispatch, review, decide, close.
288
-
289
- 6. **Bias toward delete.** A discarded agent worktree is reflog-recoverable.
290
- An undeleted speculation accumulates and blocks attention.
291
-
292
- ---
293
-
294
- ## What This Replaces
295
-
296
- | Old habit (single-thread Claude) | New habit (orchestrator Claude) |
297
- |---|---|
298
- | Read 8 files sequentially in foreground | Dispatch one agent: "read these 8 files and summarise X" |
299
- | Write a migration in foreground, watch user wait | Dispatch background agent with verification criteria |
300
- | Run lint/typecheck/tests one at a time | Dispatch one agent with a self-loop until all green |
301
- | Wait for CI, polling every 30s | `gh run watch` once OR launch a background watcher agent |
302
- | Sequential PR cleanups, one at a time | Parallel agents, one per PR, dispatched together |
303
- | Long synchronous "let me read all of memesh-cloud" tour | One Explore agent with focused questions |
304
-
305
- ---
306
-
307
- ## Things That Are NOT Background Agent Work
308
-
309
- Background agents are not a panacea. The following must stay foreground:
310
-
311
- - **First-time user-facing changes** (a real human will see this; the
312
- user must approve before deploy)
313
- - **Anything visible on the public website** (positioning, copy, prices,
314
- legal text)
315
- - **Destructive ops without rollback** (rm, drop database, force-push,
316
- delete remote branch — these need the user to say yes per action)
317
- - **Decisions about *what* to build** (only *how* to build can be
318
- delegated)
319
- - **Reading the user's emotional state** — if the user is frustrated, an
320
- agent will not notice; Claude must
321
-
322
- ---
323
-
324
- ## The Daily Question
325
-
326
- Every time Claude is about to do a 10+ minute task in foreground, it
327
- must ask:
328
-
329
- > "Is this task verifiable? If yes, why am I doing it synchronously
330
- > instead of dispatching an agent and freeing the user?"
331
-
332
- If the honest answer is "no good reason — habit / fear of dispatch
333
- failure / wanting to look responsive" → **dispatch the agent**. The
334
- user gets their time back.
335
-
336
- The user's time is the bottleneck. Claude's time is not. Optimise for
337
- the user's time.
338
-
339
- ---
340
-
341
- ## Checklist Before Starting Any Multi-Step Task
342
-
343
- - [ ] Have I classified each subtask as Tier 1 / 2 / 3?
344
- - [ ] For Tier 1 / 2 subtasks, have I dispatched them as background
345
- agents (parallel where independent)?
346
- - [ ] Did I include `mode: "acceptEdits"` so the agent can act without
347
- permission prompts?
348
- - [ ] For Tier 3 subtasks, am I keeping the user in the loop with
349
- short, focused exchanges?
350
- - [ ] Am I writing self-contained prompts that the agent can act on
351
- without further clarification?
352
- - [ ] Do my prompts include the agent's **own self-verification step**
353
- ("after writing the code, run `npm test -- --run` and report the
354
- result")?
355
- - [ ] Do my prompts include explicit "do NOT" boundaries (no push to
356
- remote, no production-touching changes, no public-surface edits
357
- without approval)?
358
- - [ ] Have I told the user, in one sentence, what is running in the
359
- background and what is foreground?
360
-
361
- ## Checklist Before Reporting Any Agent's Work As "Done"
362
-
363
- - [ ] Did I run the **Verification Gate** (the four steps above), not
364
- just read the agent's summary?
365
- - [ ] Does `git diff --stat` actually show the changes the agent
366
- claimed?
367
- - [ ] Did `npm run typecheck && npm test -- --run` pass on my machine,
368
- not just inside the agent's worktree?
369
- - [ ] If the agent reported numbers (test count, benchmark score),
370
- did I re-derive at least one of them independently?
371
- - [ ] For Tier 2 work, did I run a fresh-context code-review pass
372
- against the diff?
373
- - [ ] If the gate failed: did I record the failure mode to memesh as
374
- a lesson_learned so the next dispatch is sharper?
375
-
376
- ---
377
-
378
- ## When This Skill Is Wrong For The Moment
379
-
380
- - **Trivial single-step tasks** (read one file, answer one question, run
381
- one command). Just do it.
382
- - **The user is teaching/exploring with you** and explicitly wants to
383
- see the work happen step by step.
384
- - **The user has said "do this yourself, don't dispatch."**
385
- - **High-stakes irreversible operations** where every step needs user
386
- confirmation.
387
-
388
- In these cases, announce that you are not using agent dispatch and why.
389
-
390
- ---
391
-
392
- ## See Also
393
-
394
- - The `memesh` skill (sibling) — manages the memory layer that records
395
- agent_patterns, lesson_learned, and project decisions over time. Use
396
- it together with this one.
397
- - `CONTRIBUTING.md` Branch Lifecycle Discipline — the three-rule policy
398
- on dev checkpoints, pivots, and spikes that keeps git tidy as a
399
- side-effect of agentic orchestration.