opencode-skills-collection 4.0.35 → 4.0.36

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 (59) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +7 -1
  2. package/bundled-skills/agent-evaluation-reporting/SKILL.md +136 -0
  3. package/bundled-skills/anti-ui-slop/SKILL.md +115 -0
  4. package/bundled-skills/cross-platform-contract-propagation-audit/SKILL.md +159 -0
  5. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  6. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  7. package/bundled-skills/docs/maintainers/repo-growth-seo.md +1 -1
  8. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  9. package/bundled-skills/docs/users/aas-core.md +1 -1
  10. package/bundled-skills/docs/users/bundles.md +1 -1
  11. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  12. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  13. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  14. package/bundled-skills/docs/users/usage.md +3 -3
  15. package/bundled-skills/docs/users/visual-guide.md +4 -4
  16. package/bundled-skills/dsh-deepread/SKILL.md +200 -0
  17. package/bundled-skills/liuguang-banlan-ui/SKILL.md +135 -0
  18. package/bundled-skills/liuguang-banlan-ui/assets/starter/favicon.svg +4 -0
  19. package/bundled-skills/liuguang-banlan-ui/assets/starter/index.html +32 -0
  20. package/bundled-skills/liuguang-banlan-ui/assets/starter/launcher.css +25 -0
  21. package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/index.html +179 -0
  22. package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/theme-config.js +105 -0
  23. package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/theme.css +107 -0
  24. package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/index.html +179 -0
  25. package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/theme-config.js +105 -0
  26. package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/theme.css +107 -0
  27. package/bundled-skills/liuguang-banlan-ui/assets/starter/shared/base.css +423 -0
  28. package/bundled-skills/liuguang-banlan-ui/assets/starter/shared/spectral-field.js +450 -0
  29. package/bundled-skills/liuguang-banlan-ui/assets/starter/shared/workbench.js +255 -0
  30. package/bundled-skills/liuguang-banlan-ui/references/style-contract.md +53 -0
  31. package/bundled-skills/liuguang-banlan-ui/references/verification.md +70 -0
  32. package/bundled-skills/liuguang-banlan-ui/scripts/measure_preview.py +144 -0
  33. package/bundled-skills/liuguang-banlan-ui/scripts/requirements.txt +2 -0
  34. package/bundled-skills/liuguang-banlan-ui/scripts/scaffold_template.py +43 -0
  35. package/bundled-skills/liuguang-banlan-ui/scripts/validate_manifest.py +173 -0
  36. package/bundled-skills/using-lwc/LICENSE +201 -0
  37. package/bundled-skills/using-lwc/README.md +926 -0
  38. package/bundled-skills/using-lwc/README.zh-CN.md +836 -0
  39. package/bundled-skills/using-lwc/SKILL.md +156 -0
  40. package/bundled-skills/using-lwc/agents/openai.yaml +4 -0
  41. package/bundled-skills/using-lwc/assets/global-purpose.md +17 -0
  42. package/bundled-skills/using-lwc/assets/global-schema.md +28 -0
  43. package/bundled-skills/using-lwc/references/active-memory.md +81 -0
  44. package/bundled-skills/using-lwc/references/agent-onboarding.md +84 -0
  45. package/bundled-skills/using-lwc/references/code-graph.md +60 -0
  46. package/bundled-skills/using-lwc/references/core-memory.md +51 -0
  47. package/bundled-skills/using-lwc/references/document-conversion.md +53 -0
  48. package/bundled-skills/using-lwc/references/document-graph.md +58 -0
  49. package/bundled-skills/using-lwc/references/llm-wiki.md +75 -0
  50. package/bundled-skills/using-lwc/references/memory-policy.md +551 -0
  51. package/bundled-skills/using-lwc/references/operations-manual.md +503 -0
  52. package/bundled-skills/using-lwc/references/recovery-maintenance.md +53 -0
  53. package/bundled-skills/using-lwc/references/strong-context.md +54 -0
  54. package/bundled-skills/using-lwc/references/trigger-playbook.md +53 -0
  55. package/bundled-skills/using-lwc/references/word-graph.md +45 -0
  56. package/bundled-skills/using-lwc/scripts/bootstrap.sh +359 -0
  57. package/bundled-skills/using-lwc/scripts/install-lwc.sh +172 -0
  58. package/package.json +1 -1
  59. package/skills_index.json +93 -0
@@ -0,0 +1,503 @@
1
+ # LWC Operations Manual
2
+
3
+ ## Contents
4
+
5
+ - Operating contract
6
+ - Bootstrap and scope
7
+ - Command families
8
+ - Recall and retrieval
9
+ - Sources and ingest
10
+ - Pages and changesets
11
+ - Strong tags and lifecycle context
12
+ - Agent integration
13
+ - Graph engine and document-granular Work
14
+ - Maintenance and checkpoints
15
+ - Structured failure recovery
16
+ - Safe recipes
17
+
18
+ ## Operating contract
19
+
20
+ Use the globally installed `lwc` command directly. Bootstrap verifies its
21
+ version and reports the resolved `lwc_path` as diagnostics; do not turn that
22
+ path into a routine shell variable. Read stdout as JSON. On failure, read the
23
+ JSON object at stderr `.error`, branch on `.code`, and preserve `.details` for
24
+ recovery. Human-formatted stderr text is not an API.
25
+
26
+ Before version-specific work, run:
27
+
28
+ ```bash
29
+ lwc --version
30
+ lwc --help
31
+ lwc <COMMAND> --help
32
+ ```
33
+
34
+ Never edit `.lwc/wiki.db`, its WAL, Work files, Changeset databases, generated
35
+ Markdown, or graph sidecars. SQLite is canonical for documents and history;
36
+ Markdown and optional graph stores are derived.
37
+
38
+ ## Bootstrap and scope
39
+
40
+ From the current authorized project directory:
41
+
42
+ ```bash
43
+ sh <skill-directory>/scripts/bootstrap.sh
44
+ ```
45
+
46
+ Bootstrap is non-installing and does not initialize global memory by default.
47
+ Obtain explicit current authorization before a one-command retry with
48
+ `LWC_AUTO_INSTALL=1` or `LWC_GLOBAL_INIT=1`.
49
+
50
+ Decode its JSON and require:
51
+
52
+ - `scope_conflict=false`;
53
+ - `project_root` and `project_wiki` stay inside the host-authorized root;
54
+ - `project_boundary` is empty for normal cwd discovery or equals an explicitly
55
+ targeted root;
56
+ - one unambiguous active project.
57
+
58
+ Run ordinary project commands from that project directory. The CLI discovers
59
+ the nearest project Wiki from cwd, so no environment prefix is needed:
60
+
61
+ ```bash
62
+ lwc --scope project context --limit 25
63
+ ```
64
+
65
+ `LWC_PROJECT_ROOT` is only for an explicitly targeted project boundary instead
66
+ of current-directory discovery. Run the operation from inside that project and
67
+ set the variable for that one command instead of exporting ambient session
68
+ state.
69
+
70
+ | Scope | Use | Mutation |
71
+ | --- | --- | --- |
72
+ | `project` | Current repository knowledge | Yes, inside the authorized root |
73
+ | `global` | Stable cross-project preferences/practices | Yes, only genuinely reusable knowledge |
74
+ | `all` | Merged project/global recall | Only `search` and `context`; never writes |
75
+
76
+ Explicit `$using-lwc` permits initialization only in the current unambiguous
77
+ authorized root. Implicit activation with no project Wiki requires one concise
78
+ initialization question; continue the primary task without project-memory
79
+ writes while only write-back waits for the answer.
80
+
81
+ ## Command families
82
+
83
+ | Family | Purpose | Normal side effect |
84
+ | --- | --- | --- |
85
+ | `init`, `purpose`, `schema` | Create and govern one Wiki | Canonical metadata/Markdown |
86
+ | `context`, `search`, `span` | Bounded recall | Read-only unless `search --record` |
87
+ | `source` | Immutable evidence snapshots and lineage | One source/path observation per unit |
88
+ | `ingest` | Persistent integration state machine | One source job transition |
89
+ | `page` | Compiled durable knowledge | One page transaction |
90
+ | `tag`, `load tag` | Explicit strong page groups and bounded full-page recall | Indexed membership/policy write or read-only load |
91
+ | `agent` | Native Agent MCP, guidance, and lifecycle integration | Explicit external config writes only |
92
+ | `changeset` | Review several dependent mutations | Sparse draft, guarded atomic publish |
93
+ | `graph`, `config` | Optional Grafeo/SurrealDB projection and relationships | Document Work or one relation fact |
94
+ | `weight` | Explicit retrieval adjustments | One document/query judgment |
95
+ | `lint`, `log` | Structural validation and audit | Read-only unless `--record` |
96
+ | `work` | Observe/cancel/resume long operations | Work state only |
97
+ | `maintenance` | Repair derived search/Markdown and compact storage | Durable Work |
98
+ | `checkpoint` | Recoverable full SQLite backup/restore | Checkpoint files and guarded restore |
99
+
100
+ Use `<family> --help` for the current argument schema. Removed graph flags and
101
+ values (`--physical`, `rslg`, `graphqlite`, `auto`) are invalid.
102
+
103
+ ## Recall and retrieval
104
+
105
+ Start narrow:
106
+
107
+ ```bash
108
+ lwc --scope all context --limit 25
109
+ lwc --scope all search "<task terms>" --limit 20
110
+ ```
111
+
112
+ Search modes:
113
+
114
+ - default `--type auto`: compiled pages first, raw-source fallback;
115
+ - `--type page`: maintained knowledge only;
116
+ - `--type source`: exact immutable evidence;
117
+ - `--type all`: audit both layers;
118
+ - repeat `--kind` to narrow page kinds;
119
+ - `--explain` to diagnose deterministic rank signals;
120
+ - `--granularity sentence|passage` for exact spans;
121
+ - `--granularity all --group-by document` for bounded mixed recall.
122
+
123
+ Resolve exact span text with `span get`; widen locally with `span expand`. A
124
+ `stale_span` is a revision boundary—inspect prior/current metadata instead of
125
+ guessing a replacement.
126
+
127
+ Search is private/read-only by default. Add `--record` only when the query itself
128
+ belongs in durable history. Do not record sensitive query wording.
129
+
130
+ ## Strong tags and lifecycle context
131
+
132
+ Use tags for a small set of core pages that must be loaded whole without search:
133
+
134
+ ```bash
135
+ lwc --scope project tag set "operations" incident-response \
136
+ --priority 100 --reason "primary response runbook"
137
+ lwc --scope all load tag "operations" --limit 3
138
+ lwc --scope project tag autoload "operations" --enable \
139
+ --priority 100 --limit 3 --max-chars 50000 --reason "required at session boundaries"
140
+ ```
141
+
142
+ `load tag` first limits indexed memberships, then reads complete selected pages.
143
+ It never scans or returns every token-derived relationship. Lifecycle hooks use
144
+ only enabled policies, deduplicate overlapping pages, stop at page boundaries,
145
+ and report omissions. Disable a policy with `tag autoload TAG --disable`.
146
+
147
+ ## Agent integration
148
+
149
+ Install the baseline integration directly for any supported Agent:
150
+
151
+ ```bash
152
+ lwc agent install --yes
153
+ lwc agent status --target all --location global
154
+ lwc agent install --print-config codex
155
+ lwc agent refresh --target codex,claude
156
+ lwc agent uninstall --target codex,claude --yes
157
+ ```
158
+
159
+ `--yes` selects detected Agents, global scope, and the default LWC lifecycle and
160
+ prompt hooks. Use `--target auto|all|none|csv`, `--location global|local`, or
161
+ `--no-prompt-hook` explicitly when those defaults are wrong. Install
162
+ and refresh are byte-idempotent; uninstall restores exact owned state while
163
+ preserving unrelated MCP entries, hooks, instructions, and project indexes.
164
+ `--print-config` is pure. Optional Codex, Claude, and Pi packages under
165
+ `integrations/` are alternate native delivery; do not install both direct and
166
+ package integrations for the same Agent. Package installation never implies
167
+ native trust or enablement.
168
+
169
+ ## Sources and ingest
170
+
171
+ One source:
172
+
173
+ ```bash
174
+ lwc --scope project source add path/to/file
175
+ lwc --scope project ingest claim <SOURCE_ID> --source-max-chars 100000
176
+ lwc --scope project source show <SOURCE_ID> \
177
+ --offset-chars <NEXT> --max-chars 100000
178
+ lwc --scope project ingest analyze <SOURCE_ID> --file analysis.md
179
+ lwc --scope project page put source-<SOURCE_ID> \
180
+ --title "Source summary" --kind source --summary "Contribution" \
181
+ --file summary.md --source <SOURCE_ID>
182
+ lwc --scope project page put <SHARED-SLUG> \
183
+ --title "Shared concept" --kind concept --summary "Current synthesis" \
184
+ --file concept.md --source <SOURCE_ID>
185
+ lwc --scope project ingest complete <SOURCE_ID>
186
+ ```
187
+
188
+ Continue `source show` until `window.has_more=false`. `source add` is collection,
189
+ not integration. `ingest complete` requires a cited source page plus a cited
190
+ non-source page, unless a specific reviewed `--no-derived-pages-reason` applies.
191
+
192
+ For a reviewed set, use `source add-manifest`; paths resolve relative to the
193
+ manifest. Preflight validates every entry before writing. Claim returned IDs
194
+ explicitly rather than assuming `ingest next` order. Use a Changeset when all
195
+ subsequent analyses/pages must publish as one logical unit.
196
+
197
+ Before relying on a tracked live file:
198
+
199
+ ```bash
200
+ lwc source status <SOURCE_ID>
201
+ lwc source diff <OLD_SOURCE_ID> [--path <EXACT_PATH>]
202
+ lwc source refs <OLD_SOURCE_ID> --limit 1000 --offset 0
203
+ ```
204
+
205
+ Use `--to-source` for immutable-to-immutable comparison. A truncated diff or
206
+ paginated refs scan is incomplete until explicitly resolved. `source refs`
207
+ returns review candidates, not automatically affected pages. A new observation
208
+ creates/uses a new current head while prior snapshots remain immutable.
209
+
210
+ ## Pages and changesets
211
+
212
+ Before replacing a page, run `page show`. Repeat every still-valid `--source`
213
+ ID and explicit provenance because `page put` replaces those sets. Use stable
214
+ slugs, one-line summaries, and meaningful `[[wikilinks]]`.
215
+
216
+ Use a Changeset for two or more dependent durable mutations, or whenever ingest
217
+ state and page updates must become visible together:
218
+
219
+ ```bash
220
+ lwc --scope project changeset begin <NAME>
221
+ lwc --scope project --changeset <NAME> source add-manifest sources.json
222
+ # analyze, write pages, complete ingest in the same draft
223
+ lwc --scope project changeset show <NAME>
224
+ lwc --scope project --changeset <NAME> lint
225
+ lwc --scope project --changeset <NAME> search "<fixed question>" --limit 5
226
+ lwc --scope project changeset commit <NAME>
227
+ ```
228
+
229
+ `changeset show` is metadata-only and does not run lint. Commit freezes the
230
+ draft, validates it, publishes touched canonical entities atomically, queues
231
+ only touched current graph documents, and returns an exact Changeset ID.
232
+
233
+ - `changeset_conflict`/`changeset_changed`: preserve live state, discard the
234
+ stale draft, begin fresh, and reapply reviewed changes.
235
+ - `changeset_frozen`: retry the same commit for recovery; do not append work.
236
+ - `committed=true` with cleanup/materialization/projection error: canonical
237
+ publication already succeeded; follow `recovery_command` exactly.
238
+ - `changeset rollback <ID>`: use only for the immediate mistaken commit before
239
+ any touched entity changes again. There is no force option.
240
+
241
+ ## Graph engine and document-granular Work
242
+
243
+ Graph is disabled by default. Normal source/page/search operations do not need
244
+ it. Inspect the effective setting first:
245
+
246
+ ```bash
247
+ lwc --scope project config show
248
+ ```
249
+
250
+ When the setting is `disabled`, recommend graph activation once per project
251
+ conversation. Explain that it adds page/source relationship traversal,
252
+ neighbor/path/impact/overview queries, and independent parity verification.
253
+ Ask for user consent before changing configuration and continue canonical work
254
+ while waiting. Durable project policy may supply consent; Skill activation by
255
+ itself does not.
256
+
257
+ Recommend Grafeo as the simpler embedded local choice when the user has no
258
+ preference. Select SurrealDB when the user or project policy asks for it. Run
259
+ exactly one command:
260
+
261
+ ```bash
262
+ lwc --scope project config set --graph grafeo
263
+ lwc --scope project config set --graph surrealdb
264
+ ```
265
+
266
+ Capture the selected command's `work.id`, then wait before graph queries or
267
+ another configuration change:
268
+
269
+ ```bash
270
+ lwc --scope project work watch <WORK_ID>
271
+ lwc --scope project graph status
272
+ lwc --scope project graph verify
273
+ ```
274
+
275
+ Require `state=succeeded`. A failed Work stays stopped until its structured
276
+ error is inspected and `work resume <WORK_ID>` is explicitly requested. Never
277
+ switch or disable engines while graph Work is queued or running.
278
+
279
+ Enable/switch/rebuild queues current document keys. The worker loads one current
280
+ Page or Source, replaces/deletes that document in one engine transaction, makes
281
+ it queryable, records progress, then selects the next. Failure recovery resumes
282
+ only through explicit `work resume` with uncommitted documents; historical Source revisions are frozen and never
283
+ reprojected. Batch progress therefore means committed documents, not hidden
284
+ whole-corpus finalization.
285
+
286
+ Use `graph node`, `neighbors`, `explore`, `path`, `impact`, and `overview` only
287
+ after status/Work is ready. `graph related` is deterministic page relatedness.
288
+ Persist semantic claims only through `graph relation set/list/retract` with a
289
+ supported type, provenance, reason, confidence, and source IDs when grounded.
290
+
291
+ Disable without deleting sidecars:
292
+
293
+ ```bash
294
+ lwc config set --graph disabled
295
+ ```
296
+
297
+ Never copy, edit, compact, or delete live graph sidecars. A failed graph does
298
+ not invalidate canonical pages/sources; ordinary reads remain available.
299
+
300
+ ## Optional Markdown conversion
301
+
302
+ Markdown adapters are deployment-local and disabled by default. `init` returns
303
+ setup guidance but performs no install, network request, adapter invocation, or
304
+ configuration write. Inspect the effective setting, install one official CLI,
305
+ and select exactly one engine:
306
+
307
+ ```bash
308
+ lwc --scope project config show
309
+ npm install --global @firecrawl/anydoc
310
+ lwc --scope project config set --trans anydoc
311
+
312
+ # Alternative engine:
313
+ python3 -m pip install 'markitdown[all]'
314
+ lwc --scope project config set --trans markitdown
315
+ ```
316
+
317
+ Optional adapter settings use `--trans-timeout 1..900` and repeated
318
+ `--trans-arg=<value>`. Store no credentials in configuration; use the adapter's
319
+ environment. LWC does not accept URL inputs or fall back between engines.
320
+
321
+ ```bash
322
+ lwc --scope project trans INPUT --output OUTPUT.md
323
+ # Inspect OUTPUT.md first, then ingest explicitly if it is authoritative.
324
+ lwc --scope project source add OUTPUT.md
325
+ ```
326
+
327
+ Both input and output are capped at 64 MiB. Output uses create-new semantics;
328
+ conversion never overwrites a file or mutates the Wiki. Stable failures must be
329
+ handled before retrying or switching the configured engine.
330
+
331
+ ## Project code intelligence (`lwc cg`)
332
+
333
+ CodeGraph is separate from the optional Wiki graph engines. Use it only when
334
+ the task needs structural code answers (symbol definitions, callers, callees,
335
+ flow, impact, or file topology). It is project-only, stores everything below
336
+ the active project's `.lwc`, and keeps telemetry disabled.
337
+
338
+ For every nontrivial code task, check it once. An initialized index is an
339
+ available project capability, so use read-only structural queries proactively
340
+ instead of waiting for the user to name CodeGraph. Do not use it for literal
341
+ text, comments, generated output, or exact runtime values; use native text
342
+ search or direct file reads for those. Nontrivial means cross-symbol/file
343
+ behavior, call or dependency flow, or change-impact analysis. Skip CodeGraph for
344
+ a single-file literal edit, formatting-only work, or docs/config-only changes.
345
+
346
+ Start with the non-mutating check:
347
+
348
+ ```bash
349
+ lwc --scope project cg status
350
+ ```
351
+
352
+ If `initialized=false`, explain that CodeGraph provides tree-sitter-derived
353
+ symbol/call/dependency answers that are faster and more precise than repeatedly
354
+ scanning files. Ask once whether the user wants the project code index. Do not
355
+ download or index silently. On consent:
356
+
357
+ ```bash
358
+ lwc --scope project cg init
359
+ ```
360
+
361
+ This downloads the pinned SHA-256-verified runtime once into
362
+ `~/.lwc/runtime/codegraph/<PIN>/<TARGET>/` and builds the current project's
363
+ `.lwc/codegraph`. Initial indexing, sync,
364
+ full rebuild, deletion, reference resolution, and recovery all commit one owner
365
+ file completely before selecting the next. Current indexed files remain
366
+ queryable while later files run; historical file versions are not refreshed.
367
+
368
+ Choose the narrowest structural command:
369
+
370
+ ```bash
371
+ lwc cg query <WORDS>
372
+ lwc cg node <SYMBOL_OR_FILE>
373
+ lwc cg callers <SYMBOL>
374
+ lwc cg callees <SYMBOL>
375
+ lwc cg impact <SYMBOL>
376
+ lwc cg files
377
+ lwc cg sync
378
+ ```
379
+
380
+ Route questions deliberately:
381
+
382
+ | Question | Command sequence |
383
+ | --- | --- |
384
+ | Where is a symbol or file defined? | `cg query`, then `cg node` for exact source/signature. |
385
+ | What calls this symbol? | `cg callers`. |
386
+ | What does this symbol call? | `cg callees`. |
387
+ | What may break if this changes? | `cg impact`, then inspect the returned source files. |
388
+ | What code files are indexed? | `cg files`. |
389
+ | Did edited code change the structure? | `cg sync`, then repeat the same structural query. |
390
+ | What contains this exact string or comment? | Use native text search, not CodeGraph. |
391
+
392
+ Use the three LWC planes together rather than treating one as a substitute for
393
+ the others:
394
+
395
+ 1. Recall prior rationale and verified facts with Wiki `context`/`search`.
396
+ 2. Query CodeGraph for the checked-out implementation structure.
397
+ 3. Read the smallest exact source surface needed to prove behavior.
398
+ 4. When the verified result will matter later, update the appropriate Wiki page
399
+ and run its retrieval acceptance checks.
400
+
401
+ When CodeGraph and Wiki memory disagree, checked-out source is the current
402
+ implementation evidence; the Wiki may describe historical intent. Resolve the
403
+ cause before updating either. Never cite the CodeGraph database as immutable
404
+ source evidence and never ingest `.lwc/codegraph` back into the Wiki.
405
+
406
+ If the task depends on current dirty or uncommitted code, run `sync` before the
407
+ first structural query. Run it again after relevant working-tree files change.
408
+ Do not run `index` as a routine freshness check. Never invoke global CodeGraph
409
+ lifecycle commands through another binary; LWC blocks
410
+ install/uninstall/upgrade/telemetry/daemon/daemons. Agent integrations register
411
+ the unified `lwc serve --mcp`; its code mode lazily proxies only bounded
412
+ `codegraph_explore` calls through the pinned project runtime without installing
413
+ or initializing anything.
414
+
415
+ ## Read-only project viewer (`lwc view`)
416
+
417
+ Use the viewer when the user asks to inspect the Wiki, current sources,
418
+ Markdown, status, knowledge graph, or code graph visually:
419
+
420
+ ```bash
421
+ lwc --scope project view
422
+ lwc --scope project view --port 4173 --no-open
423
+ ```
424
+
425
+ It stays in the foreground, binds only `127.0.0.1`, accepts GET/HEAD only, and
426
+ does not migrate, sync, lint, refresh, or build either graph. Stop it with
427
+ Ctrl-C. Treat its graph limits (1000 nodes, 5000 edges) as visualization bounds,
428
+ not database totals. Never expose it on a public interface or infer write
429
+ acceptance from a rendered page.
430
+
431
+ Graphs use a single Obsidian-inspired 3D relationship view with small nodes,
432
+ persistent labels, thin links, rotation, and zoom. It never changes graph data.
433
+
434
+ The UI defaults to English. The `中文` / `EN` control switches viewer chrome and
435
+ remembers the choice in browser-local storage; sources and Wiki pages are never
436
+ translated implicitly.
437
+
438
+ ## Maintenance and checkpoints
439
+
440
+ Maintenance returns Work:
441
+
442
+ ```bash
443
+ response=$(lwc --scope project maintenance reindex)
444
+ lwc --scope project work watch <WORK_ID>
445
+ lwc --scope project lint
446
+ ```
447
+
448
+ - `materialize`: rebuild generated Markdown when missing/stale;
449
+ - `reindex`: rebuild FTS only for reported index/tokenizer problems;
450
+ - `compact`: idle-window WAL checkpoint/storage reclamation; inspect `busy` and
451
+ `after_bytes`.
452
+
453
+ Use `checkpoint create <NAME>` before large direct maintenance that cannot use a
454
+ Changeset. `checkpoint restore <NAME>` validates the backup and first preserves
455
+ current state as `pre-restore-*`. Never manipulate database/WAL files manually.
456
+
457
+ ## Structured failure recovery
458
+
459
+ | Error/state | Required action |
460
+ | --- | --- |
461
+ | `project_root_mismatch`, `scope_conflict` | Stop project memory and resolve the authorized root. |
462
+ | `graph_disabled` | Continue canonical work; enable an engine only if graph was actually requested. |
463
+ | queued/running `work` | Inspect/watch; do not treat it as the command's final result. |
464
+ | failed/cancelled/stale Work | Read `.error`; use `work resume` only when safe and supported. |
465
+ | `work_busy` | Inspect the active Work; do not start a competing maintenance job. |
466
+ | `possible_secret_detected` | Review a safe snapshot; never blindly acknowledge. |
467
+ | `source_status_unstable` | Retry the exact targeted status/diff. |
468
+ | `stale_span` | Re-search current content; do not fuzzy-remap the locator. |
469
+ | `page_in_use`, `source_in_use` | Repair citations/links first; never bypass guarded deletion. |
470
+ | `wal_checkpointed=false` or compact `busy=true` | Canonical write may be valid; retry checkpoint only in an idle window. |
471
+ | unknown code | Preserve JSON, run command help/version, and diagnose before mutation. |
472
+
473
+ ## Safe recipes
474
+
475
+ ### Start a substantive task
476
+
477
+ Bootstrap once, verify scope, run bounded context plus one task search, open the
478
+ best pages, and inspect cited sources only for claims used.
479
+
480
+ ### Preserve one durable answer
481
+
482
+ Search for the concept, show the existing page if present, merge verified new
483
+ knowledge with preserved citations/provenance, put one page, lint the scope, and
484
+ repeat the fixed retrieval question plus paraphrase.
485
+
486
+ ### Integrate several sources safely
487
+
488
+ Preflight a manifest, begin a Changeset, add/claim each source, fully analyze one
489
+ source before the next, update shared pages, complete every ingest, lint/search
490
+ the draft, commit, then repeat acceptance against live state.
491
+
492
+ ### Recover graph projection
493
+
494
+ Leave canonical data untouched. Inspect `graph status`, `work list`, and the
495
+ failed Work error. Resume the remaining document queue or explicitly reselect
496
+ the configured engine to enqueue a document-by-document rebuild; watch to
497
+ success and run `graph verify`.
498
+
499
+ ### Finish a session
500
+
501
+ Write only verified reusable outcomes, lint each changed scope, run targeted
502
+ retrieval acceptance, report any pending Work honestly, and leave optional
503
+ semantic cleanup for a later task rather than blocking the user's deliverable.
@@ -0,0 +1,53 @@
1
+ # LWC Recovery and Maintenance
2
+
3
+ ## Use when
4
+
5
+ Use this document when a command returns Work, a migration/projection fails,
6
+ graph parity is stale, lint finds durable knowledge issues, or an explicit
7
+ checkpoint/maintenance window is required.
8
+
9
+ ## Skip when
10
+
11
+ Skip broad lint, graph traversal, checkpoints, and maintenance during routine
12
+ session recall. Do not perform speculative cleanup merely because a Hook ran.
13
+
14
+ ## Minimum workflow
15
+
16
+ When a command returns Work instead of its normal result:
17
+
18
+ ```bash
19
+ lwc work status <ID>
20
+ lwc work watch <ID>
21
+ ```
22
+
23
+ Require `state=succeeded`, inspect `work.result`, then retry the original command
24
+ when required. Use `work cancel` for cooperative cancellation. Use `work resume`
25
+ only for failed, cancelled, or stale interrupted Work after inspecting its error;
26
+ never resume queued/running Work or switch graph engines while projection runs.
27
+
28
+ For physical graph drift, use `graph status`, `graph verify`, `work list`, then
29
+ inspect the coalesced `graph-project` Work. Canonical Wiki reads remain available
30
+ while projection is pending or failed.
31
+
32
+ After meaningful Wiki changes, lint the changed scope and run fixed retrieval
33
+ questions plus paraphrases. A clean lint report is not retrieval proof. When a
34
+ draft was validated, commit it and repeat the same checks against live state.
35
+
36
+ Use checkpoints only for explicit recovery/operational boundaries. Use
37
+ `maintenance compact` only in an idle window when storage growth matters; inspect
38
+ `work.result.busy` and `work.result.after_bytes`. It attempts a WAL truncate
39
+ checkpoint, not a full FTS optimization.
40
+
41
+ ## Consent boundaries
42
+
43
+ Recovery never authorizes direct edits to Wiki databases, WAL/SHM, graph
44
+ sidecars, CodeGraph indexes, Agent configs, or backups. Destructive page/source
45
+ removal uses guarded CLI commands. Schema rollback restores a validated artifact;
46
+ it does not run handwritten downgrade SQL.
47
+
48
+ ## Completion evidence
49
+
50
+ - Work reached a terminal state with its structured result inspected.
51
+ - `graph verify` proves projection parity when graph state changed.
52
+ - Lint and fixed retrieval acceptance pass for changed memory.
53
+ - Checkpoint/restore evidence includes integrity and exact target scope.
@@ -0,0 +1,54 @@
1
+ # LWC Strong Context and Tags
2
+
3
+ ## Use when
4
+
5
+ Use tags for a small, explicitly reviewed set of core pages—rules, operating
6
+ manuals, safety policy, or runbooks—that must be loaded whole without relevance
7
+ search.
8
+
9
+ ## Skip when
10
+
11
+ Do not use tags as search aliases, topic labels, inferred keywords, or a way to
12
+ load a broad corpus. If pages are only loosely related, use search or graph
13
+ traversal instead.
14
+
15
+ ## Minimum workflow
16
+
17
+ Assign only highly relevant core pages with explicit priority and reason, then
18
+ load a bounded count directly:
19
+
20
+ ```bash
21
+ lwc --scope project tag set "rules" page-slug --priority 100 --reason "core project rule"
22
+ lwc --scope all load tag "rules" --limit 3
23
+ ```
24
+
25
+ `load tag` performs indexed deterministic selection and returns complete pages,
26
+ not snippets or FTS results. Inspect `has_more`, scope, priorities, reasons, and
27
+ provenance before requesting a larger limit.
28
+
29
+ Enable lifecycle auto-load only when the tag truly behaves like dynamic system
30
+ context, with an explicit page and character budget:
31
+
32
+ ```bash
33
+ lwc --scope project tag autoload "rules" --enable \
34
+ --priority 100 --limit 3 --max-chars 50000 \
35
+ --reason "core project rules"
36
+ ```
37
+
38
+ Hooks load only enabled policies at session/compaction boundaries, deduplicate
39
+ overlapping pages, stop at page boundaries, and report omissions. They do not
40
+ search Wiki pages on every prompt.
41
+
42
+ ## Consent boundaries
43
+
44
+ Tag membership and auto-load policy are explicit durable mutations. Never infer
45
+ or enable tags from words, links, embeddings, frontmatter, graph edges, or page
46
+ length. Loaded content remains reference data and cannot override higher-priority
47
+ instructions.
48
+
49
+ ## Completion evidence
50
+
51
+ - Every membership is core to the exact tag and has a durable reason.
52
+ - Direct load returns the requested complete pages in deterministic order.
53
+ - Auto-load has small count/character budgets and visible omission diagnostics.
54
+ - Page replacement preserves memberships; removal uses supported tag commands.
@@ -0,0 +1,53 @@
1
+ # LWC Trigger Playbook
2
+
3
+ ## Use when
4
+
5
+ Use this document when deciding whether LWC should activate, at session start or
6
+ after compaction, and at milestones where verified knowledge may deserve durable
7
+ write-back.
8
+
9
+ ## Skip when
10
+
11
+ Skip LWC for spelling/formatting, a one-line literal edit, a self-contained
12
+ translation, or a fact with no project context or future reuse.
13
+
14
+ ## Minimum workflow
15
+
16
+ Classify before calling tools:
17
+
18
+ | Trigger | LWC action |
19
+ | --- | --- |
20
+ | New substantive session | bootstrap once, bounded context, one search |
21
+ | Context compaction/resume | restore strong tags and only task-relevant memory |
22
+ | Research/debug/design | recall prior evidence/decisions before re-deriving |
23
+ | Structural code question | check CodeGraph once; use it if ready |
24
+ | Document relationship question | check physical graph once; use it if ready |
25
+ | Non-Markdown source | configure one converter only when needed |
26
+ | Verified milestone | update an existing page or create one distinct page |
27
+ | Contradiction/staleness | inspect cited sources, revise or retract the claim |
28
+ | Task end | lint changed scope and run fixed retrieval acceptance |
29
+
30
+ The Automatic self-use loop is: classify, recall once, inspect current evidence,
31
+ solve, capture at milestones, validate, finish. Widen retrieval by one query,
32
+ kind, scope, or granularity at a time after a miss.
33
+
34
+ Hooks are signals, not commands to mutate. At a lifecycle boundary, use the
35
+ provided readiness facts to decide whether the current task is substantive enough
36
+ to ask for graph authorization. Do not repeat the question in the same project
37
+ conversation.
38
+
39
+ ## Consent boundaries
40
+
41
+ Automatic activation may read bounded authorized memory. It may not initialize a
42
+ missing Wiki, enable a graph, build a CodeGraph index, install a converter, or
43
+ write memory without the corresponding explicit or durable project authority.
44
+ It also may not install the LWC CLI or initialize global memory without explicit
45
+ current authorization.
46
+
47
+ ## Completion evidence
48
+
49
+ - The task was correctly classified as use or skip.
50
+ - Bootstrap/recall/readiness checks ran at most once per working root unless state
51
+ materially changed.
52
+ - Optional maintenance did not delay the deliverable.
53
+ - Any write-back is verified, durable, non-secret, and retrievable.