@prismer/runtime 2.0.8 → 2.2.55

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 (119) hide show
  1. package/CHANGELOG.md +3430 -0
  2. package/README.md +34 -12
  3. package/apc/skills/FIELD-DICTIONARY.md +111 -0
  4. package/apc/skills/bug-reproduce/SKILL.md +150 -0
  5. package/apc/skills/bug-reproduce/skill.json +96 -0
  6. package/apc/skills/code-review/SKILL.md +198 -0
  7. package/apc/skills/code-review/skill.json +124 -0
  8. package/apc/skills/design-review/SKILL.md +122 -0
  9. package/apc/skills/design-review/skill.json +88 -0
  10. package/apc/skills/doc-sync/SKILL.md +168 -0
  11. package/apc/skills/doc-sync/skill.json +81 -0
  12. package/apc/skills/env-doctor/SKILL.md +194 -0
  13. package/apc/skills/env-doctor/skill.json +209 -0
  14. package/apc/skills/git-ops/SKILL.md +189 -0
  15. package/apc/skills/git-ops/skill.json +94 -0
  16. package/apc/skills/impact-trace/SKILL.md +168 -0
  17. package/apc/skills/impact-trace/skill.json +104 -0
  18. package/apc/skills/observability/SKILL.md +195 -0
  19. package/apc/skills/observability/skill.json +116 -0
  20. package/apc/skills/release-db-config-sync/SKILL.md +186 -0
  21. package/apc/skills/release-db-config-sync/skill.json +109 -0
  22. package/apc/skills/release-ota-promote/SKILL.md +195 -0
  23. package/apc/skills/release-ota-promote/skill.json +176 -0
  24. package/apc/skills/release-preflight/SKILL.md +174 -0
  25. package/apc/skills/release-preflight/skill.json +175 -0
  26. package/apc/skills/release-rollback/SKILL.md +214 -0
  27. package/apc/skills/release-rollback/skill.json +230 -0
  28. package/apc/skills/release-tag/SKILL.md +194 -0
  29. package/apc/skills/release-tag/skill.json +94 -0
  30. package/apc/skills/releasing-prod/SKILL.md +49 -0
  31. package/apc/skills/releasing-test/SKILL.md +135 -0
  32. package/apc/skills/sdk-release/SKILL.md +200 -0
  33. package/apc/skills/spec-intake/SKILL.md +169 -0
  34. package/apc/skills/spec-intake/skill.json +93 -0
  35. package/apc/skills/test-result-feedback/SKILL.md +239 -0
  36. package/apc/skills/test-result-feedback/skill.json +193 -0
  37. package/apc/skills/test-runner/SKILL.md +169 -0
  38. package/apc/skills/test-runner/skill.json +103 -0
  39. package/apc/skills/ui-align/SKILL.md +209 -0
  40. package/apc/skills/ui-align/skill.json +114 -0
  41. package/apc/skills/ui-canvas/SKILL.md +148 -0
  42. package/apc/skills/ui-canvas/skill.json +127 -0
  43. package/built-in-skills/agent-coordination/SKILL.md +59 -37
  44. package/built-in-skills/agent-meta/SKILL.md +1 -0
  45. package/built-in-skills/assets/SKILL.md +8 -6
  46. package/built-in-skills/browser-use/SKILL.md +93 -0
  47. package/built-in-skills/canvas-design/SKILL.md +1 -0
  48. package/built-in-skills/claim-agent-ownership/SKILL.md +3 -2
  49. package/built-in-skills/claude-api/SKILL.md +1 -0
  50. package/built-in-skills/codebase-design/DEEPENING.md +37 -0
  51. package/built-in-skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  52. package/built-in-skills/codebase-design/LICENSE +21 -0
  53. package/built-in-skills/codebase-design/SKILL.md +116 -0
  54. package/built-in-skills/conversation-compaction/SKILL.md +114 -0
  55. package/built-in-skills/council-creator/SKILL.md +426 -0
  56. package/built-in-skills/diagnosing-bugs/LICENSE +21 -0
  57. package/built-in-skills/diagnosing-bugs/SKILL.md +136 -0
  58. package/built-in-skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
  59. package/built-in-skills/doc-coauthoring/SKILL.md +1 -0
  60. package/built-in-skills/document-generation/SKILL.md +105 -0
  61. package/built-in-skills/domain-modeling/ADR-FORMAT.md +47 -0
  62. package/built-in-skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  63. package/built-in-skills/domain-modeling/LICENSE +21 -0
  64. package/built-in-skills/domain-modeling/SKILL.md +76 -0
  65. package/built-in-skills/frontend-design/SKILL.md +1 -0
  66. package/built-in-skills/human-approval/SKILL.md +17 -2
  67. package/built-in-skills/image-generate/SKILL.md +103 -302
  68. package/built-in-skills/image-generate/scripts/generate-and-deliver.mjs +289 -0
  69. package/built-in-skills/ingest/SKILL.md +13 -45
  70. package/built-in-skills/internal-comms/SKILL.md +1 -0
  71. package/built-in-skills/liteparse/SKILL.md +130 -110
  72. package/built-in-skills/mcp-builder/SKILL.md +1 -0
  73. package/built-in-skills/memory/SKILL.md +420 -55
  74. package/built-in-skills/memory-dream/SKILL.md +339 -0
  75. package/built-in-skills/office-artifacts/SKILL.md +17 -4
  76. package/built-in-skills/okr/SKILL.md +154 -0
  77. package/built-in-skills/persona/SKILL.md +81 -0
  78. package/built-in-skills/persona-generator/SKILL.md +296 -0
  79. package/built-in-skills/pkf-svg/SKILL.md +253 -0
  80. package/built-in-skills/pkf-writing/SKILL.md +236 -0
  81. package/built-in-skills/prismer-im-collab/SKILL.md +26 -6
  82. package/built-in-skills/proactivity/SKILL.md +84 -0
  83. package/built-in-skills/remotion/SKILL.md +431 -0
  84. package/built-in-skills/role-builder/SKILL.md +203 -0
  85. package/built-in-skills/role-builder/scripts/author-role.mjs +334 -0
  86. package/built-in-skills/role-builder/scripts/ingest-role.mjs +223 -0
  87. package/built-in-skills/role-builder/scripts/instantiate-and-run.mjs +290 -0
  88. package/built-in-skills/role-builder/scripts/operation-harness.mjs +267 -0
  89. package/built-in-skills/skill-authoring/SKILL.md +110 -100
  90. package/built-in-skills/skill-authoring/skill.json +3 -3
  91. package/built-in-skills/skill-builder/SKILL.md +171 -0
  92. package/built-in-skills/skill-builder/scripts/ingest.mjs +265 -0
  93. package/built-in-skills/skill-creator/SKILL.md +165 -423
  94. package/built-in-skills/skill-creator/references/external-library-import.md +110 -0
  95. package/built-in-skills/skill-creator/scripts/import-library.mjs +475 -0
  96. package/built-in-skills/slack-gif-creator/SKILL.md +20 -0
  97. package/built-in-skills/tasks/SKILL.md +38 -23
  98. package/built-in-skills/tdd/LICENSE +21 -0
  99. package/built-in-skills/tdd/SKILL.md +110 -0
  100. package/built-in-skills/tdd/mocking.md +59 -0
  101. package/built-in-skills/tdd/refactoring.md +10 -0
  102. package/built-in-skills/tdd/tests.md +61 -0
  103. package/built-in-skills/team/SKILL.md +2 -1
  104. package/built-in-skills/web-artifacts-builder/SKILL.md +1 -0
  105. package/built-in-skills/webapp-testing/SKILL.md +1 -0
  106. package/built-in-skills/wechat-pay/SKILL.md +59 -0
  107. package/dist/cli.cjs +71872 -19960
  108. package/dist/cli.js +71803 -19846
  109. package/dist/index.cjs +72010 -19966
  110. package/dist/index.d.cts +4258 -712
  111. package/dist/index.d.ts +4258 -712
  112. package/dist/index.js +72156 -20118
  113. package/package.json +37 -6
  114. package/plugins/memory/prismer/__init__.py +1211 -0
  115. package/plugins/memory/prismer/plugin.yaml +8 -0
  116. package/plugins/memory/prismer/tool-schemas.generated.json +249 -0
  117. package/plugins/tools/prismer-recall/__init__.py +282 -0
  118. package/plugins/tools/prismer-recall/plugin.yaml +15 -0
  119. package/built-in-skills/memory-curation/SKILL.md +0 -135
@@ -0,0 +1,339 @@
1
+ ---
2
+ name: memory-dream
3
+ scope: common
4
+ role_scope: orchestrator-only
5
+ description: |
6
+ Actively curate the workspace memory wiki as the appointed orchestrator: READ the
7
+ Dream candidates (`memory_curate(op="candidates")` → orphan leaves, near-duplicate
8
+ clusters, stale pages, remote-conflict pages, oversized hubs), BROWSE the current
9
+ structure (`memory_browse`), CLUSTER scattered leaves by topic with your OWN LLM,
10
+ CONVERGE the flat star into an INDEX→hub→leaf hierarchy with
11
+ `memory_curate(op="promote_to_hub", childPaths=[…])` + `rebuild_index`, MAINTAIN
12
+ hub `#overview` prose and the INDEX's authored semantic sections (hub `#toc` stays
13
+ machine-generated; INDEX Contents is graph-derived), SPLIT oversized hubs, then
14
+ VERIFY via candidates again and
15
+ REPORT the changes. The periodic tidy that merges duplicates and prunes stale —
16
+ the enacting counterpart to write-time placement. Cloud-triggered and
17
+ orchestrator-enacted: the Cloud scheduler evaluates authoritative wiki health and
18
+ dispatches one internal task; the appointed workspace orchestrator runs this skill.
19
+ A user may also request curation directly. Orchestrator-only — write verbs reject
20
+ any non-orchestrator actor (403).
21
+ applies_to: [hermes, claude-code, codex]
22
+ version: 4
23
+ ---
24
+
25
+ # Memory Dream — orchestrator-driven consolidation
26
+
27
+ > **Memory pages are PKF (`.pkf`).** When you fold or merge page bodies, the body syntax
28
+ > (sections, typed links, frontmatter) comes from the **`pkf-writing`** skill — load it
29
+ > when you author body content, and validate the result before persisting. This skill
30
+ > only governs the graph: what to merge, where to attach, and how to keep INDEX/hub
31
+ > ownership straight.
32
+
33
+ > **Candidate boundary.** Dream sees authoritative **Memory Pages**, not “all PKF.” A
34
+ > message-inline PKF or Library `.pkf` Asset remains outside this loop. Runtime
35
+ > automatically classifies durable claims from validated inline PKF; Asset handling
36
+ > still uses the `memory` skill. Explicitly materialize authoritative inline bytes only
37
+ > when the user requests exact preservation. Only a resulting Memory Page participates
38
+ > in candidates, revisions, merges and hub TOCs.
39
+
40
+ You are (when appointed) the **workspace memory orchestrator**. Your job is the "Dream
41
+ phase": periodically reorganize the memory wiki so it stays coherent as it grows — merge
42
+ duplicate hubs, attach satellite pages under the right hub, supersede stale/contradicted
43
+ pages, keep the top-level INDEX lean, maintain every hub's `#overview` plus the INDEX's
44
+ authored semantic sections, and split hubs that have grown oversized.
45
+
46
+ There is one automatic trigger authority: the **Cloud SchedulerService** sweeps every
47
+ six hours, applies the 24-hour cadence gate plus authoritative wiki-health signals
48
+ (orphan ratio, oversized INDEX, frontier duplicate cluster, or page-growth burst),
49
+ deduplicates in-flight work, and dispatches one hidden `memory-dream` task to the bound
50
+ workspace orchestrator. The Cloud performs no Memory LLM reasoning. The appointed
51
+ orchestrator executes this skill in its own Runtime and is the sole automatic write
52
+ actor. A user can also ask that orchestrator to curate immediately; ordinary per-page
53
+ queries do not trigger Dream. The retired daemon `FF_MEMORY_DREAM_ENABLED` scheduler is
54
+ not an active trigger path.
55
+
56
+ > **Authority gate.** The curation write verbs only work for the **appointed workspace
57
+ > orchestrator** (the workspace owner, or the agent set as `orchestratorAgentId`).
58
+ > If you are not the orchestrator, every write verb returns `403 orchestrator_only` —
59
+ > that is expected, not a bug. Do not retry; write-time placement discipline (the
60
+ > **memory** skill's browse-first flow) is what every agent does, and it is enough.
61
+
62
+ **Owner vs orchestrator vs deputy (product209/16 MA-2):**
63
+
64
+ - The **owner** (human) and the **appointed orchestrator**
65
+ (`orchestratorAgentId`) are the only Dream write actors. The owner speaking
66
+ through an agent does NOT grant it Dream rights — the agent itself must hold
67
+ the orchestrator binding. Dream never back-derives authority from "the owner
68
+ is talking to me".
69
+ - A **deputy** does NOT inherit Dream from its bound member — not even when
70
+ the bound member is the owner. A deputy runs Dream write verbs only if the
71
+ deputy agent itself is the appointed `orchestratorAgentId`.
72
+ - `candidates` is the READ half and works for any agent in scope; the write
73
+ verbs (`promote_to_hub` / `supersede` / `rebuild_index` and the section-level
74
+ `section_merge` / `section_supersede` / `rewire`) are the gated half.
75
+ - `403 orchestrator_only` and `202 approval deferred` are final per-request
76
+ verdicts — do not retry, and do not route around them through another agent.
77
+
78
+ ## The verbs
79
+
80
+ ```
81
+ memory_curate(op="candidates") # READ what needs work (any agent)
82
+ memory_curate(op="candidates", kind="orphans") # one surface; limit caps per kind
83
+ memory_browse(query="<topic>") # READ the structure: {index, hubs[+snippet], nearest}
84
+ memory_curate(op="promote_to_hub", pageId="<id>",
85
+ childPaths=["<path>", …]) # leaf → hub AND attach children (orchestrator only)
86
+ memory_curate(op="supersede", pageId="<id>",
87
+ reason="merged into <path>") # archive + mark stale (orchestrator only)
88
+ memory_curate(op="rebuild_index") # regenerate hub TOCs; INDEX Contents stays graph-derived (orchestrator only)
89
+ memory_curate(op="section_merge", pageId="<winnerPageId>",
90
+ targetSection="<winnerSlug>", sourcePageId="<loserPageId>",
91
+ sourceSection="<loserSlug>",
92
+ mergedContent="<merged body>") # fold ONE near-duplicate section (memory211 W5)
93
+ memory_curate(op="section_supersede", pageId="<pageId>",
94
+ section="<slug>") # retire ONE section in place (memory211 W5)
95
+ memory_curate(op="rewire", linkId="<linkId>",
96
+ toPageId="<id>") # re-point a broken/wrong link (memory211 W5)
97
+ ```
98
+
99
+ - `candidates` is the READ half: `{candidates:{orphans,duplicates,stale,conflicts,oversized}}`
100
+ — unplaced leaves (no outgoing `child-of`/`parent` edge to a live hub; an INDEX
101
+ `index-anchor` only guarantees reachability and therefore still counts as flat), near-duplicate clusters
102
+ (`duplicate_cluster:<peerIds>`), stale pages, remote-conflict pages, and oversized
103
+ hub/INDEX advisories (`kind="oversized"` — size is recorded, never machine-enforced;
104
+ splitting is YOUR call). It does NOT cluster or decide; that is YOUR LLM's job.
105
+ - **`promote_to_hub` takes `childPaths[]`** — pass the member pages' paths (exactly as
106
+ candidates/browse returned them) and the cloud attaches them under the new hub as
107
+ `child-of` children **in the same call**. Do not promote a hollow hub and re-anchor
108
+ members one by one afterwards.
109
+ - `rebuild_index` is the ONLY **hub** `#toc` writer. It emits a complete strict PKF
110
+ `<section>` with stable `data-sid`, one navigation entry per graph child and the
111
+ child's frontmatter `description`. Structural `child-of` remains child→hub in the
112
+ graph; downward TOC links are navigation, never inverted placement edges. Hub
113
+ `<h2 id="overview">` prose is agent territory and survives rebuild.
114
+ - Top INDEX is different: its Contents is derived live from the graph and there is no
115
+ stored machine `#toc` to rebuild or edit. Its authored semantic sections are the
116
+ orchestrator's editorial territory.
117
+ - **Section verbs (memory211 W5)** — the granularity drift happens at SECTION level, so
118
+ curation does too. `section_merge` rewrites the winner's section with `mergedContent`,
119
+ splices the loser section out of its page, and the CLOUD writes the
120
+ `supersedes` + `derived-from` provenance edges for you — a merge with no edge trail is
121
+ an unfinished merge. `section_supersede` retires one section (optionally pointing at the
122
+ surviving one). `rewire` fixes a single broken/wrong link without a page rewrite.
123
+ - There is no `run_dream` cloud-LLM op — `candidates` (read) + the write ops are
124
+ the whole surface (memory203/13 §0.5: all memory LLM runs in your runtime, never the
125
+ cloud's).
126
+
127
+ Enactment is the native `memory_curate` TOOL (the same tool surface every agent already
128
+ holds, alongside `memory_search` / `memory_load` / `memory_browse` / `memory_write`). Do
129
+ NOT look for a separate "memory-dream tool" or shell — `memory_curate` IS the enactment
130
+ surface. (A `prismer memory curate …` CLI exists for shell contexts; the TOOL is primary.)
131
+ If a curate response is `degraded:true`, no authoritative Cloud mutation occurred;
132
+ report the degraded state and never describe the requested convergence as completed.
133
+
134
+ ## The convergence loop (keep it tight)
135
+
136
+ Run the loop end-to-end in a handful of calls — `memory_browse` gives you the whole
137
+ structure in ONE call, so you never need long exploratory search/load spelunking:
138
+
139
+ **STEP 1 — READ the candidates.**
140
+
141
+ ```
142
+ memory_curate(op="candidates")
143
+ # → { ok:true, candidates: {
144
+ # orphans: { items:[ {pageId, path, reason:"orphan"}, … ], total },
145
+ # duplicates: { items:[ {pageId, path, reason:"duplicate_cluster:<peerIds>"}, … ], total },
146
+ # stale: { items:[ {pageId, path, reason}, … ], total },
147
+ # conflicts: { items:[ {pageId, path, reason:"remote-conflict",
148
+ # metadata:{…, latestTwoVersionSummaries}}, … ], total },
149
+ # oversized: { items:[ {pageId, path, reason:"oversized:toc_entries,body_chars",
150
+ # metadata:{bodyChars, tocEntries, softThresholds, advisory:true}}, … ], total } } }
151
+ ```
152
+
153
+ **STEP 1b — REVIEW the conflicts.** `memory_curate(op="candidates", kind="conflicts")`
154
+ lists pages whose current head landed via a remote-conflict LWW merge (two devices
155
+ diverged); each item carries the latest two version summaries (changeSummary /
156
+ authoredBy / createdAt) so you can judge which side won. For each one, confirm the
157
+ head is correct — `memory_load` it and check the LWW winner didn't clobber the better
158
+ content; if it did, `memory_write` the corrected body. Conflict is a STATE, not a
159
+ brand: a curation touch or clean rewrite of the page clears it (an identical-content
160
+ rewrite is a no-op and does NOT), so a reviewed page drops off this list on the next
161
+ `candidates` read.
162
+
163
+ **STEP 1c — REVIEW the oversized hubs.** `memory_curate(op="candidates",
164
+ kind="oversized")` lists hubs whose body chars or stored TOC entry count exceeds the
165
+ advisory soft thresholds, plus INDEX advisories based on its authored body size (its
166
+ Contents is graph-derived). These are **split suggestions, never enforcement** — a
167
+ lean hub (overview + TOC) keeps every multi-hop recall fast. For a hub with too many
168
+ children, split by sub-topic: pick the natural anchor leaf of each sub-cluster,
169
+ `promote_to_hub` it WITH its `childPaths`, and the moved children drop out of the
170
+ parent's TOC on the next rebuild. A hub that is oversized because its overview prose
171
+ grew into an essay: move the essay's durable content into a leaf under the hub and
172
+ shrink the overview back to a summary. Use your judgment — an advisory you deliberately
173
+ leave alone (and say so in the report) is a valid outcome.
174
+
175
+ **STEP 2 — BROWSE the structure.**
176
+
177
+ ```
178
+ memory_browse(query="<dominant candidate topic>")
179
+ # → { index, hubs:[{path,title,pageType,snippet}], nearest:[…] }
180
+ ```
181
+
182
+ One call shows you which hubs already exist and what each is about — decide whether a
183
+ candidate cluster belongs under an EXISTING hub (attach, don't mint a duplicate hub) or
184
+ needs a new one. Spot-check individual members with `memory_load` only where the title
185
+ is ambiguous; do not load every page.
186
+
187
+ **STEP 3 — DECIDE clusters (your LLM — this is the point).** Group the orphan leaves by
188
+ topic. A cluster is a set of leaves that genuinely share one topic and deserve a single
189
+ hub above them. For duplicate clusters, decide:
190
+
191
+ - Same topic, one is a clear superset → **merge** (fold content, supersede the loser).
192
+ - Adjacent but distinct → **link, don't merge** (write with `relation="related"` or a
193
+ typed `<a rel="related">` with a canonical href) — merging distinct facts loses recall
194
+ precision.
195
+ - Ambiguous / high-stakes → **do not enact**; leave it for human review. When unsure,
196
+ prefer leaving two pages over deleting one.
197
+
198
+ **STEP 4 — ENACT per cluster: promote WITH children.**
199
+
200
+ ```
201
+ memory_curate(op="promote_to_hub",
202
+ pageId="<id of the cluster's natural anchor page>",
203
+ childPaths=["project/helios-billing.pkf",
204
+ "project/helios-db-choice.pkf",
205
+ "project/helios-deploy.pkf", …])
206
+ ```
207
+
208
+ One call: the anchor becomes a hub AND every member is attached under it as a child.
209
+ For a cluster that belongs under an EXISTING hub (found in STEP 2), don't promote —
210
+ attach the members to that hub (`memory_write` the member with
211
+ `parentHubPath="<existing hub path>"`; use `op="append-section"` rather than a
212
+ full-page rewrite when touching someone else's page). For merge losers and garbage:
213
+ `memory_curate(op="supersede", pageId="…", reason="…")`.
214
+
215
+ **STEP 5 — REBUILD hub navigation once per batch.**
216
+
217
+ ```
218
+ memory_curate(op="rebuild_index")
219
+ ```
220
+
221
+ Each touched hub's strict PKF `#toc` regenerates with child descriptions. The top INDEX
222
+ Contents changes automatically because it is a live graph projection—no INDEX body
223
+ revision is minted. Leaves that now have a hub parent drop out of the flat top level.
224
+
225
+ **STEP 6 — MAINTAIN authored prose (your editorial duty).** After the structure settles,
226
+ read the INDEX and touched hubs. Refresh each hub's `<h2 id="overview">` and any stale
227
+ authored INDEX semantic section. Reuse the loaded section's existing `data-sid`; for a
228
+ new section, run `pkf_mint_sids`, then `pkf_validate` on the complete resulting page
229
+ before persisting. Section-operation content is a complete `<section>…</section>`:
230
+
231
+ ```
232
+ memory_write(
233
+ path="project/helios.pkf",
234
+ op="rewrite-section",
235
+ section="overview",
236
+ content="<section><h2 id=\"overview\" data-sid=\"<reuse-or-minted-sec-id>\">Overview</h2><p>Helios is the Q3 billing replatform —
237
+ auth, billing and deploy decisions live here; the postmortems under it record why
238
+ rate limits were re-tuned twice. Start at <a href=\"<canonical href from browse>\"
239
+ rel=\"references\">the API spec</a>.</p></section>")
240
+ ```
241
+
242
+ A hub you just promoted has no overview yet — `op="append-section", section="overview"`
243
+ seeds it. Never touch the `#toc` section while you are in there.
244
+
245
+ **STEP 7 — VERIFY and REPORT.** Call `memory_curate(op="candidates")` again — the
246
+ orphans you clustered should be gone. Then **report the structural changes in your
247
+ reply**: which hubs you created/promoted, how many children each absorbed, what you
248
+ superseded and why, which overviews you wrote/refreshed, which oversized advisories you
249
+ split or deliberately left, and the before→after orphan count. A convergence run that
250
+ ends without a structural report is unverifiable.
251
+
252
+ ### Worked example — 8 scattered `project/helios-*` leaves → one hub
253
+
254
+ `candidates` returns 8 orphan leaves hanging off INDEX directly (`project/helios-auth.pkf`,
255
+ `project/helios-billing.pkf`, `project/helios-db-choice.pkf`, `project/helios-deploy.pkf`,
256
+ `project/helios-api-spec.pkf`, `project/helios-rate-limits.pkf`, `project/helios-oncall.pkf`,
257
+ `project/helios-postmortem-0420.pkf`).
258
+
259
+ ```
260
+ # 1-2. read candidates + browse — no existing helios hub, all 8 are one topic
261
+ memory_curate(op="candidates", kind="orphans")
262
+ memory_browse(query="helios project")
263
+
264
+ # 3. decide: ONE cluster; helios-auth is the natural anchor
265
+
266
+ # 4. promote the anchor WITH the other 7 attached in the same call
267
+ memory_curate(op="promote_to_hub", pageId="<id-of-helios-auth>",
268
+ childPaths=["project/helios-billing.pkf", "project/helios-db-choice.pkf",
269
+ "project/helios-deploy.pkf", "project/helios-api-spec.pkf",
270
+ "project/helios-rate-limits.pkf", "project/helios-oncall.pkf",
271
+ "project/helios-postmortem-0420.pkf"])
272
+
273
+ # the 0420 postmortem is superseded by a newer incident page → archive it
274
+ memory_curate(op="supersede", pageId="<id-of-helios-postmortem-0420>",
275
+ reason="merged into project/helios-auth#incidents")
276
+
277
+ # 5. rebuild once — hub #toc regenerates; INDEX Contents follows the graph live
278
+ memory_curate(op="rebuild_index")
279
+
280
+ # 6. seed the new hub's overview (the machine never writes this prose)
281
+ memory_write(path="project/helios-auth.pkf", op="append-section", section="overview",
282
+ content="<section><h2 id=\"overview\" data-sid=\"<minted-sec-id>\">Overview</h2><p>Helios project knowledge —
283
+ auth is the anchor; billing/db/deploy/api-spec/rate-limits/oncall hang
284
+ under it. The 0420 postmortem is archived into #incidents.</p></section>")
285
+
286
+ # 7. verify: orphans 8 → 0 for this topic; REPORT the delta in your reply
287
+ memory_curate(op="candidates", kind="orphans")
288
+ ```
289
+
290
+ Result: the derived INDEX Contents shows one described hub entry instead of 8 bare leaves; the facts
291
+ are reachable `INDEX → hub → leaf`, and the hub opens with prose that says what lives
292
+ there. The flat star collapsed into a readable tree — in ~7 tool calls.
293
+
294
+ ## Folding content on a merge
295
+
296
+ When one page absorbs a true duplicate: copy any durable fact the survivor lacks into
297
+ the survivor's matching section (`memory_write` with `op="append-section"` /
298
+ `op="rewrite-section"` — never a whole-page rewrite of a page another agent authored;
299
+ the section body follows `pkf-writing`), then `supersede` the loser with a reason naming
300
+ the survivor's path. The loser is archived, not hard-deleted — it stays for audit and
301
+ redirect.
302
+
303
+ ## Stop conditions
304
+
305
+ - Enact only **clear** merges; one ambiguous call left un-enacted is better than one
306
+ wrong merge that destroys recall.
307
+ - Batch a handful of clusters, `rebuild_index` ONCE, verify, report, stop. Do not loop
308
+ the whole graph every tick — Dream is incremental.
309
+ - Never hand-write a hub `#toc`; `rebuild_index` is its only writer. Never store an
310
+ INDEX TOC copy—the reader derives Contents. Hub overviews and authored INDEX semantic
311
+ sections are your editorial territory.
312
+
313
+ ## Anti-patterns
314
+
315
+ - ❌ Promoting a hollow hub (no `childPaths`) and then re-anchoring members one at a
316
+ time — pass the children in the promote call.
317
+ - ❌ Hand-writing `child-of` links inside a HUB pointing down at leaves — `child-of`
318
+ edges point FROM the child TO the hub; the structural params get this right for you.
319
+ - ❌ Hand-editing a hub `#toc`, or creating a stored INDEX `#toc`; declare edges +
320
+ `rebuild_index`. Leaving hubs with no overview prose is its own anti-pattern.
321
+ - ❌ Treating message-inline/Asset PKF as a Dream candidate before it becomes an
322
+ authoritative Memory Page.
323
+ - ❌ Whole-page-rewriting another agent's page to fold in one fact — append a section
324
+ (`op="append-section"`).
325
+ - ❌ Treating an `oversized` advisory as an order — it is a split *suggestion*; splitting
326
+ a coherent hub just to satisfy a threshold destroys navigability. Judge, then report.
327
+ - ❌ Merging two pages because they share a topic word — they may carry distinct facts.
328
+ Read them first; merge only clear duplicates.
329
+ - ❌ Hard-deleting. You `supersede` (reversible archive), never destroy.
330
+ - ❌ Running the whole graph every tick. Dream is incremental: a handful of clear
331
+ merges, one rebuild_index, verify, stop.
332
+ - ❌ Enacting an ambiguous/high-stakes merge. Leave it for human review; Dream cannot
333
+ reconstruct a wrongly-merged page.
334
+ - ❌ Retrying a `403 orchestrator_only` — you are not the appointed orchestrator; that
335
+ is correct, not an error.
336
+ - ❌ A deputy assuming Dream rights because its bound member is the owner — the
337
+ deputy agent itself must be the appointed `orchestratorAgentId`.
338
+ - ❌ Ending a convergence run without reporting the structural delta (hubs created,
339
+ children attached, pages superseded, orphan count before→after).
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: office-artifacts
3
+ scope: persistence
3
4
  description: Generate real DOCX, PPTX, XLSX, PDF, CSV files using python-docx / python-pptx / openpyxl / reportlab by writing them into the dispatch artifacts dir, then explicitly deliver each one with `cloud deliver <abs-path>`. Use whenever the user asks for documents, slides, spreadsheets, reports, or PDFs.
4
5
  ---
5
6
 
@@ -76,7 +77,7 @@ every file you want the user to receive.
76
77
 
77
78
  Lie-guard (`src/im/ws/handler.ts`) **as of release201/30 §8 is
78
79
  warn-only telemetry**, not a destructive interceptor — the audit
79
- banner ("CEO 声明已生成文件但未真正落盘") that used to render in
80
+ banner ("Team Manager 声明已生成文件但未真正落盘") that used to render in
80
81
  red is removed. The detector still logs a `[warn] claim/asset
81
82
  disagreement (warn-only, see release201/30 §8)` for ops dashboards
82
83
  when text claims a file but `assetIds` is empty. That signal helps
@@ -102,9 +103,21 @@ If (1)-(3) fail, your reply must start with `无法生成文件
102
103
  ## Runtime baseline (release 201)
103
104
 
104
105
  Sandbox image bakes `python-docx`, `python-pptx`, `openpyxl`,
105
- `reportlab`, `pandas`, `pillow`, `numpy`, `imageio`, apt `file`. If an
106
- import fails at task time, fail with `module 'X' missing — rebuild
107
- sandbox image`. Do not `pip install` on the fly.
106
+ `reportlab`, `pandas`, `pillow`, `numpy`, `imageio`, apt `file` all of
107
+ them inside the image venv interpreter **`/home/user/.venv/bin/python3`**
108
+ (NOT the system `/usr/bin/python3`, which has NONE of these libraries).
109
+ Always run generator scripts with that interpreter, e.g.
110
+
111
+ ```bash
112
+ /home/user/.venv/bin/python3 generate_report.py
113
+ ```
114
+
115
+ If an `import docx` (or `pptx` / `openpyxl` / `reportlab`) probe fails, DO
116
+ NOT conclude the dependency is missing until you have retried under
117
+ `/home/user/.venv/bin/python3` — a failure under the system python only
118
+ means you probed the wrong interpreter. Only when the import ALSO fails
119
+ under the venv interpreter, fail the task with `module 'X' missing —
120
+ rebuild sandbox image`. Do not `pip install` on the fly.
108
121
 
109
122
  ## Resolving the output directory
110
123
 
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: okr
3
+ scope: persistence
4
+ description: Draft and track a strategic OKR charter — turn a human's plain-language goal into ONE Objective + 2-5 measurable Key Results, link existing tasks, and route the commit to a human sponsor. Use whenever the user wants to set a strategic goal / OKR / objective, "立个 OKR", or "把 X 推到 GA". Executes via the `cloud okr` CLI.
5
+ ---
6
+
7
+ # OKR
8
+
9
+ Use this skill to **draft an OKR charter** from a human's goal: one Objective, 2-5 Key Results, each with a baseline→target and a *real* evidence source, plus links to the tasks that move them. Every operation goes through the `cloud okr` CLI — never tell the user an objective was created / committed / scored unless the command actually returned an id and state.
10
+
11
+ You **draft and propose**. The human **commits**. That split is the whole point of this skill (see ⛔ hard rules).
12
+
13
+ ## When to use
14
+
15
+ - The user wants to **set a strategic goal**: "let's set an OKR for Q3", "立个 OKR", "make reliability our objective this cycle", "把搜索推到 GA".
16
+ - A long-running objective should become a tracked **Objective + Key Results**, not a loose `kind=goal` card. (When the user says "make this a goal", draft an objective charter here, not a plain task.)
17
+ - You need to **link** existing tactical tasks to the Key Result they serve.
18
+ - The user wants to **see OKR health** — the objective tree with KR progress.
19
+
20
+ If the request is a single tactical deliverable ("review this PR", "write the report"), that's the `tasks` skill, not this one. Strategic outcome → here; tactical card under an existing objective → `tasks` with the KR link.
21
+
22
+ ## Charter drafting methodology
23
+
24
+ From a human's plain-language goal, draft **ONE Objective + 2-5 Key Results**. Before drafting, ask for whatever is missing:
25
+
26
+ - **Outcome** — what observable end-state defines success? (the Objective title)
27
+ - **Deadline / cycle** — which cycle does this belong to? (`--cycle 2026-Q3`)
28
+ - **Owner** — which agent/human drives it? (`--owner <imUserId>`)
29
+ - **Sponsor** — which **human/admin** stands behind it? (`--sponsor <human imUserId>`) — **required for a committed objective.**
30
+ - **Per KR**: a baseline → target, and a **measurable source**. Today's KNOWN sources are ONLY:
31
+ - **task acceptance** — a `task`/`milestone` KR whose progress is the count of linked tasks that pass acceptance.
32
+ - **IMMetricEvent metric binding** — a `metric` KR bound to an existing metric stream (`--metric-namespace --metric-name --metric-agg`).
33
+ - **human-confirm** — a `qualitative` KR a human scores explicitly with a value + evidence.
34
+
35
+ Then:
36
+
37
+ 1. **Draft the objective** (agent proposes — it is NOT yet committed):
38
+
39
+ ```bash
40
+ cloud okr objective create \
41
+ --workspace "$PRISMER_WORKSPACE_ID" \
42
+ --title "Search is GA-ready" \
43
+ --type committed \
44
+ --narrative "Definition of done: search ships to all users with p95 < 300ms and zero P0s." \
45
+ --cycle 2026-Q3 \
46
+ --owner <imUserId> \
47
+ --sponsor <human imUserId>
48
+ ```
49
+
50
+ 2. **Propose each KR** with baseline/target/unit/direction/weight + an evidence policy:
51
+
52
+ ```bash
53
+ # metric-backed KR (bound to a real IMMetricEvent stream)
54
+ cloud okr kr add <objectiveId> \
55
+ --title "p95 search latency under 300ms" \
56
+ --type metric --baseline 480 --target 300 --unit ms --direction decrease --weight 2 \
57
+ --metric-namespace search.latency --metric-name p95 --metric-agg last \
58
+ --evidence "IMMetricEvent search.latency:p95, last value per cycle"
59
+
60
+ # task-backed KR (progress = linked tasks that pass acceptance)
61
+ cloud okr kr add <objectiveId> \
62
+ --title "Ship 4 launch-blocker fixes" \
63
+ --type task --baseline 0 --target 4 --direction increase \
64
+ --evidence "count of linked tasks with passing acceptance"
65
+ ```
66
+
67
+ 3. **Link existing tasks** to the KR they serve (don't create unscoped strategic tasks):
68
+
69
+ ```bash
70
+ cloud okr link <objectiveId> <keyResultId> <taskId>
71
+ ```
72
+
73
+ 4. **STOP and hand the commit to the human sponsor.** Print the objective id + KR ids and say: *"Charter drafted. @<sponsor> (human) — review and `cloud okr objective commit <id>` when you approve."* Do **not** commit it yourself.
74
+
75
+ ## ⛔ Hard rules
76
+
77
+ These are enforced server-side; violating them returns a `403` you cannot work around.
78
+
79
+ 1. **NEVER commit an objective yourself.** `cloud okr objective commit` requires a **human sponsor**; an agent caller gets `AGENT_CANNOT_COMMIT`. Your job ends at *draft + propose*. Surface the objective and ask the human sponsor to commit.
80
+ 2. **A `committed`-type objective REQUIRES a human/admin sponsor** (`--sponsor <human imUserId>`). Without one, commit returns `SPONSOR_MUST_BE_HUMAN`. An `aspirational` objective may skip the sponsor.
81
+ 3. **NEVER score a `qualitative` KR without an explicit, human-confirmed value + evidence.** Use `cloud okr kr recompute <krId> --value <n> --evidence <ref>` and only with a value the human actually gave you. Metric/task KRs recompute from their real source automatically — don't hand-feed numbers there.
82
+ 4. **Bind KRs ONLY to today's sources** — task acceptance, IMMetricEvent metric binding, or human-confirm. Do **NOT** invent token/spend/credit targets, CRM pipelines, or analytics metrics — those data sources do not exist (FROZEN). A KR whose evidence you can't name is not a KR; ask the human how it will be measured.
83
+ 5. **Do NOT create unscoped strategic tasks.** Tactical work for an objective is an existing task **linked to a KR** via `cloud okr link`. If strategic work has no task yet, draft the objective/KR first, then create the task (via the `tasks` skill) and link it.
84
+
85
+ ## Lifecycle back-half
86
+
87
+ After an objective is committed it runs through `committed → graded → archived`:
88
+
89
+ - **Check-ins** — you (an agent) MAY draft a check-in. It snapshots the score + each KR's current/status. `cloud okr objective checkin <objectiveId> [--note "<t>"] [--confidence 0.6] [--decision continue|rescope|add-resource|pause|cancel]`.
90
+ - **Grade and archive are HUMAN decisions.** `cloud okr objective grade <id>` and `cloud okr objective archive <id>` return `AGENT_CANNOT_GRADE` (403) for an agent caller — surface the objective and ask the human to grade. Grade freezes the score (it stops moving even if a KR's evidence changes). An archived objective is read-only.
91
+
92
+ Check-in `--decision`, `--confidence`, and the reward/resource shapes carry **no token/credit meaning** — there is no compensation here.
93
+
94
+ ## FROZEN / out of scope
95
+
96
+ This skill draws ONE Objective + its KRs and links tasks. It does **NOT** propose, create, or mutate any of the following — they are explicitly out of scope for release203 and have no endpoints here:
97
+
98
+ - **Guardrails** — no guardrail proposals or activations.
99
+ - **Resource / budget allocation** — no credit/budget/resource grants.
100
+ - **Scenario packs** — none.
101
+ - **Proactive / recurring check-ins** — you record a check-in only when asked; there is no auto-scheduler.
102
+ - **Compensation** — no reward/bonus economics (the grade carries no payout).
103
+
104
+ If the user asks for any of these, say it's not part of the OKR charter flow yet rather than improvising one.
105
+
106
+ ## CLI Reference
107
+
108
+ ### Objectives
109
+
110
+ ```bash
111
+ # Draft (agent proposes — NOT committed)
112
+ cloud okr objective create --workspace <id> --title "<outcome>" \
113
+ [--type committed|aspirational] [--narrative "<DoD>"] [--cycle 2026-Q3] \
114
+ [--owner <imUserId>] [--sponsor <human imUserId>] [--parent <objectiveId>] [--confidence 0.7]
115
+
116
+ cloud okr objective list --workspace <id> [--state <state>]
117
+ cloud okr objective get <objectiveId>
118
+
119
+ # HUMAN/SPONSOR ONLY — an agent caller gets AGENT_CANNOT_COMMIT
120
+ cloud okr objective commit <objectiveId>
121
+ cloud okr objective close <objectiveId> [--score 0.8]
122
+ ```
123
+
124
+ ### Key Results
125
+
126
+ ```bash
127
+ cloud okr kr add <objectiveId> --title "<measurable result>" \
128
+ [--type metric|task|milestone|qualitative] \
129
+ [--baseline <n>] [--target <n>] [--unit <u>] \
130
+ [--direction increase|decrease|maintain|binary] [--weight <n>] \
131
+ [--metric-namespace <ns> --metric-name <name> --metric-agg avg|sum|last|count] \
132
+ [--evidence "<policy>"] [--source assigned|agent-proposed]
133
+
134
+ # Qualitative KR scoring — human-confirmed value + evidence ONLY
135
+ cloud okr kr recompute <keyResultId> [--value <n>] [--evidence <ref>]
136
+ ```
137
+
138
+ > `--source` defaults to `agent-proposed` (you, the agent, are drafting). Pass `--source assigned` only when the human explicitly assigned the KR.
139
+ > `--metric-namespace` and `--metric-name` must be given together to bind a metric source.
140
+
141
+ ### Linking + reading
142
+
143
+ ```bash
144
+ cloud okr link <objectiveId> <keyResultId> <taskId> # scope a task to a KR
145
+ cloud okr insights --workspace <id> # the OKR tree + KR progress (never fabricated)
146
+ ```
147
+
148
+ ## Output reporting
149
+
150
+ After any state-changing command, **echo back** the id and the **state the service returned** (not the state you expected). Example:
151
+
152
+ > Drafted objective `cmobj...` (state `draft`) with 3 KRs. @<sponsor> — `cloud okr objective commit cmobj...` to commit.
153
+
154
+ If a command exits non-zero, surface the error code verbatim — especially `AGENT_CANNOT_COMMIT` / `SPONSOR_MUST_BE_HUMAN`, which mean a human must act. **Never fabricate an objective/KR id or a KR value** — if you didn't run the command or it failed, say so.
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: persona
3
+ scope: common
4
+ description: >
5
+ The discussion-only playbook for a Persona — a council participant
6
+ instantiated as a real agent from the `persona` role template (SS-02). Use
7
+ this when you have been convened into an expert roundtable as a distilled
8
+ public-record perspective. It defines HOW to participate: speak in-voice,
9
+ reason, and cite public materials — and declares the hard capability boundary
10
+ (no task.create / no skill.install / no spend / no publish). The boundary is
11
+ ENFORCED by the role's toolsetScope + mcpAllowlist + service authz, not by
12
+ this text; this skill is the behavioral norm that matches the gate.
13
+ license: MIT
14
+ compatibility:
15
+ - prismer-sdk
16
+ - hermes
17
+ metadata:
18
+ category: council
19
+ personaPolicy: public_distillation
20
+ disclaimerRequired: true
21
+ allowedUse: [analysis, debate, ideation]
22
+ forbiddenUse:
23
+ - impersonation
24
+ - private_claim
25
+ - task_create
26
+ - skill_install
27
+ - spend
28
+ - publish
29
+ capabilityBoundary:
30
+ intent: discussion-only
31
+ allowed: [speak, reason, cite_materials, recall_memory]
32
+ denied:
33
+ - capability: task.create
34
+ enforcedBy: [toolsetScope.deny(kanban,delegation,terminal,code_execution), mcpAllowlist.omit(prismer.task.*)]
35
+ - capability: skill.install
36
+ enforcedBy: [toolsetScope.deny(skills,terminal,code_execution), mcpAllowlist.omit(prismer.skill.install)]
37
+ - capability: spend
38
+ enforcedBy: [toolsetScope.deny(terminal,code_execution), skill_not_granted(wechat-pay), service_authz(payment_mandate)]
39
+ - capability: publish
40
+ enforcedBy: [mcpAllowlist.omit(prismer.evolve.publish,prismer.community.post), service_authz(owner_approval_gate)]
41
+ ---
42
+
43
+ # Persona — discussion-only council participant
44
+
45
+ You have been convened into an expert roundtable as a **Persona**: a lens distilled
46
+ from the **public record** of a real, publicly-verifiable person. You are a real
47
+ agent with your own identity and session — but your capability surface is
48
+ deliberately **narrowed to discussion**.
49
+
50
+ ## What you do
51
+
52
+ 1. **Speak in-voice.** Hold one consistent vantage and voice across turns. You occupy
53
+ a distinct stakeholder position — surface what you can see that others cannot.
54
+ 2. **Reason.** Weigh trade-offs, disagree substantively, name risks the room is missing.
55
+ 3. **Cite materials.** Ground claims in the Council Brief and public record. Use
56
+ `memory_recall` / asset reads to pull evidence. When you cannot ground a point,
57
+ **say so** (honest degradation) — never fabricate a quote or a private fact.
58
+
59
+ ## What you must NOT do (hard boundary)
60
+
61
+ You participate by **speaking, reasoning, and citing** — nothing else. The following
62
+ are **removed from you at the config layer** (they are not available tools, not a
63
+ matter of you choosing to abstain):
64
+
65
+ | Capability | Why it's off | Enforced by |
66
+ | --- | --- | --- |
67
+ | **Create / dispatch tasks** | You are a voice, not an executor | role `toolsetScope` deny `kanban`/`delegation`/`terminal`/`code_execution` + MCP allowlist omits `prismer.task.*` |
68
+ | **Install / manage skills** | You don't reshape the workspace | `toolsetScope` deny `skills`/`terminal` + MCP allowlist omits `prismer.skill.install` |
69
+ | **Spend / collect money** | No fiscal authority | `terminal`/`code_execution` denied (no `cloud pay` CLI), `wechat-pay` skill not granted, and the payment service requires a mandate |
70
+ | **Publish** (catalog / community / marketplace) | No outward-facing authority | MCP allowlist omits `prismer.evolve.publish` / `prismer.community.post`, and publishing already requires **owner approval** at the service layer |
71
+
72
+ If a discussion outcome genuinely needs a task, a purchase, or a publication:
73
+ **name that need in your reply and hand it to the workspace orchestrator**
74
+ (the Team Manager / council facilitator). Do not attempt it — the attempt would fail at the
75
+ capability gate anyway; naming it cleanly is the correct move.
76
+
77
+ ## Disclaimer (compliance floor)
78
+
79
+ You are a **distilled public-record perspective, not the real person**. Keep that
80
+ framing visible. Never assert private facts, never impersonate, never let the room
81
+ treat your words as the person's private, authoritative statement.