@life-os/opc-cli 0.1.0 → 0.1.2

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 (2) hide show
  1. package/dist/opc.mjs +921 -41
  2. package/package.json +1 -1
package/dist/opc.mjs CHANGED
@@ -106,7 +106,7 @@ const DEPARTMENTS = [
106
106
  const ZH_LAYOUT = {
107
107
  id: 'zh',
108
108
  label: 'Chinese OPC LifeOS',
109
- rootFiles: ['OPC LifeOS.md', 'CEO 驾驶舱.md', 'CEO 驾驶舱.AI.md', 'Agent.md', 'Soul.md', 'Memory.md'],
109
+ rootFiles: ['OPC LifeOS.md', 'CEO 驾驶舱.md', 'CEO 驾驶舱.AI.md', 'AGENTS.md', 'SOUL.md', 'STYLE.md', 'MEMORY.md'],
110
110
  layers: ['0 周期笔记', '1 输入', '2 输出', '3 部门', '99 模板'],
111
111
  ceoSourcePath: 'CEO 驾驶舱.md',
112
112
  ceoAiPath: 'CEO 驾驶舱.AI.md',
@@ -118,7 +118,15 @@ const ZH_LAYOUT = {
118
118
  const EN_LAYOUT = {
119
119
  id: 'en',
120
120
  label: 'English OPC LifeOS',
121
- rootFiles: ['OPC LifeOS.md', 'CEO Dashboard.md', 'CEO Dashboard.AI.md', 'Agent.md', 'Soul.md', 'Memory.md'],
121
+ rootFiles: [
122
+ 'OPC LifeOS.md',
123
+ 'CEO Dashboard.md',
124
+ 'CEO Dashboard.AI.md',
125
+ 'AGENTS.md',
126
+ 'SOUL.md',
127
+ 'STYLE.md',
128
+ 'MEMORY.md',
129
+ ],
122
130
  layers: ['0 Periodic Notes', '1 Input', '2 Output', '3 Departments', '99 Templates'],
123
131
  ceoSourcePath: 'CEO Dashboard.md',
124
132
  ceoAiPath: 'CEO Dashboard.AI.md',
@@ -196,10 +204,10 @@ function isOpcVault(root) {
196
204
  }
197
205
  function aiPromptFor(sourcePath, aiPath, layout = ZH_LAYOUT) {
198
206
  return [
199
- `Update \`${aiPath}\` from \`${sourcePath}\`, nearby files in the same folder, recent periodic notes matching #OPC tags, and related material under \`${layout.inputPath}\` / \`${layout.outputPath}\`.`,
207
+ `Update the OPC AI Wiki page \`${aiPath}\` from \`${sourcePath}\`, nearby files in the same folder, recent periodic notes matching #OPC tags, and related material under \`${layout.inputPath}\` / \`${layout.outputPath}\`.`,
200
208
  '',
201
209
  'Rules:',
202
- '- Use `.AI.md`, never `.Dashboard.md`.',
210
+ '- Use `.AI.md` for the AI Wiki, never `.Dashboard.md`.',
203
211
  '- Keep `type: wiki/主题` frontmatter for LifeOS AI Wiki compatibility.',
204
212
  '- Describe these folders as departments or CEO dashboard, not as topic folders.',
205
213
  '- Include state summary, core judgments, metrics, material map, risks/blockers, review, and next actions.',
@@ -282,7 +290,7 @@ async function runDashboard(args, vault) {
282
290
  emitLines([
283
291
  `Target: ${result.target}`,
284
292
  `Source: ${result.sourcePath}`,
285
- `AI: ${result.aiPath}`,
293
+ `AI Wiki: ${result.aiPath}`,
286
294
  '',
287
295
  result.prompt,
288
296
  ]);
@@ -309,50 +317,893 @@ async function runDepartments(args, vault) {
309
317
  const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
310
318
  ;// CONCATENATED MODULE: ../../packages/skill-assets/dist/generated.js
311
319
  // AUTO-GENERATED by scripts/generate.mjs — do not edit by hand.
312
- // Source of truth: packages/skill-assets/lifeos-skill/ and packages/skill-assets/opc-skill/.
320
+ // Source of truth: packages/skill-assets/lifeos-skills/ and packages/skill-assets/opc-skill/.
313
321
  // Re-run `pnpm -C packages/skill-assets generate` (or just `build`).
314
- const LIFEOS_SKILL_VERSION = "0.1.3";
315
- const OPC_SKILL_VERSION = "0.1.3";
316
- const LIFEOS_SKILL_FILES = {
317
- "SKILL.md": "---\nname: lifeos\ndescription: \"Read, query and edit a LifeOS / Obsidian PARA vault (notes, tasks, periodic notes, theme notes, tags, AI Wiki) from the command line via the `lifeos` CLI — headless, no Obsidian or Aino needed. Use when the user asks about their tasks or 待办; periodic notes — daily/weekly/monthly/quarterly/yearly review or 日记/周记/月记/季记/年记; theme notes / PARA — projects/areas/resources/archives or 项目/领域/资源/归档/主题; tags / theme tags or 标签/主题标签; the LifeOS AI Wiki / `.AI.md` topic synthesis pages or 整理主题 / 更新 AI Wiki; or wants to find/search notes, capture a thought, or check/update what's on their plate in their LifeOS vault.\"\n---\n\n# LifeOS\n\nDrive a LifeOS vault through the `lifeos` CLI. It is **config-aware** — it reads\nthe user's real PARA folder names, periodic-note formats, Obsidian Daily Notes\ncore settings and section headers — and **headless**, working directly on the\nvault folder without Obsidian running. Query results match what the user sees in\nthe app.\n\n## Core concepts (核心概念)\n\nLifeOS organises a vault as two complementary kinds of note. Knowing which one a\nrequest is about tells you which command to reach for.\n\n**Periodic notes (周期笔记)** — organised by **time**. One file per period; resolve\nits path with `npx -y @life-os/cli <period>`. The longer the period the less predictable it is,\nso longer periods are for goals and shorter ones for tasks:\n\n- **yearly (年记)** / **quarterly (季记)** — long-term: **goal management (目标管理)**,\n set the direction for the year / quarter.\n- **monthly (月记)** / **weekly (周记)** — short-term: **task management (任务管理)**,\n break those goals into this month's / week's tasks.\n- **daily (日记)** — daily records: real-time capture of thoughts, tasks and time\n tracking. Most capture lands here.\n\n**Theme notes (主题笔记)** — organised by **subject**, usually via **PARA**. These live\nin the user's PARA folders (see `npx -y @life-os/cli config`); reach them with `search`/`read`.\nThe later→earlier order is increasing actionability (archive → resource → area → project):\n\n- **project (项目)** — most actionable: a concrete goal with a deadline, e.g. 「完成季度报告」.\n- **area (领域)** — an ongoing responsibility to maintain, e.g. 「健康」「财务」.\n- **resource (资源)** — a topic of interest or reference material, e.g. 「读书笔记」.\n- **archive (归档)** — finished or inactive projects / areas / resources.\n- PARA is just the common shape; a theme can be any subject (e.g. 「#节日」).\n\n**The link between them — theme tags (主题标签)**: each theme note is identified by a\nunique tag. Any task / fleeting note / file anywhere — including inside a daily or\nother periodic note — that carries that tag is **automatically indexed** into the\ntheme note. This is what makes capture stress-free: jot with the right `#tag` now,\nfind it under the theme later.\n\n- **Top-down (自上而下)**: tasks planned in a theme note surface in the daily note on\n their planned date, so `tasks due=today` reflects project/goal plans.\n- **Bottom-up (自下而上)**: a tagged thought or todo in the daily note is collected\n back into the matching theme note via its tag.\n\nSo: when a user talks about a 项目/领域/资源/主题, work in the theme note; when they\ntalk about a day/week/month/quarter/year or \"what's on my plate today\", work in the\nperiodic note — and reuse the theme's tag so the two stay linked.\n\n**AI Wiki (`.AI.md`)** — a third layer that sits **beside** the topic note as a\nsibling `{filename}.AI.md` file. It is the LifeOS AI Wiki: a synthesised\nsummary page of what the vault knows about that topic, maintained\nincrementally by this skill. Only **topic / index notes** get one — never\ncaptures, dailies, meeting notes, or other one-off source files. When the\nuser says \"整理一下 X 主题\"、\"更新 AI Wiki\"、\"看看 AI Wiki 怎么说\", follow the\nrules in [`references/ai-wiki.md`](references/ai-wiki.md): it covers source\nscope, page schema, ingest / query / lint flows, and the concrete CLI\nrecipes that touch `7 索引/7. AI Wiki 索引.md` and `7 索引/AI Wiki 变更日志.md`.\n\n## Invocation\n\nRun the CLI with **`npx -y @life-os/cli`** — npx fetches the published package on\nfirst use and `-y` skips the install prompt; nothing needs to be installed\nglobally. Every example below is written in that form.\n\n## First moves\n\n1. Run `npx -y @life-os/cli config` to confirm which vault and settings are in\n effect. If it can't find a vault, ask the user for the path and pass\n `vault=<path>`.\n2. `npx -y @life-os/cli help` is the authoritative command list. For exhaustive\n flags, output shapes and error codes, read\n [`references/commands.md`](references/commands.md).\n3. For LifeOS AI Wiki maintenance (`.AI.md` topic pages, the central index,\n the changelog and lint checks), read\n [`references/ai-wiki.md`](references/ai-wiki.md).\n\n## Syntax\n\n- Options are `key=value` (e.g. `tag=work`, `limit=10`). `--key=value` also works.\n- Flags are bare words after `--` (e.g. `--json`) or plain (`overwrite`, `case`).\n- Quote values with spaces: `vault=\"~/My Vault/LifeOS\"`.\n- Add `--json` whenever you need to parse output programmatically.\n\n## Vault selection\n\nThis skill is installed **inside the user's vault**, so you normally run from\nwithin it — the CLI auto-detects the vault from the current directory. Resolution\norder (first match wins): `vault=` → `$LIFEOS_VAULT` → walk up from cwd for\n`.obsidian/`/`.lifeos/` → the folder Aino last opened (fallback). Only pass\n`vault=` when the user means a _different_ vault than the one you're in.\n\n## Commands at a glance\n\n```bash\n# every command is invoked as: npx -y @life-os/cli <args>\nnpx -y @life-os/cli config # vault + effective settings (run this first)\nnpx -y @life-os/cli tasks [todo|done|all] # tasks; filters: tag= keyword= due=today|week|overdue limit=\nnpx -y @life-os/cli search query=<text> # type=file (default) | tag | content ; add `case` for content\nnpx -y @life-os/cli read file=<name>|path=<p> # print a note\nnpx -y @life-os/cli daily|weekly|monthly|quarterly|yearly # show the period note's path + whether it exists\nnpx -y @life-os/cli <period>:read # print the period note\nnpx -y @life-os/cli <period>:create # create the period note from its configured template\nnpx -y @life-os/cli <period>:append content=<t> # append (creates from template if missing)\nnpx -y @life-os/cli theme:create type=project|area|resource|archive|theme tag=<t> path=<p> # create a PARA note from its template\nnpx -y @life-os/cli append path=<p> content=<t> # append to an existing note\nnpx -y @life-os/cli create path=<p> [content=] # create a plain note (no template; add `overwrite` to replace)\nnpx -y @life-os/cli task done|todo ref=<file>:<n> # toggle a task by its file:line reference\n```\n\n**Template-aware creation:** `<period>:create`, `theme:create`, and the auto-create\ninside `<period>:append` all render the user's **configured template** through the\nsame engine the plugin/Aino use — `{{snapshot:Project}}`, `{{if weekday}}`,\n`{{date}}` etc. are expanded, and theme notes get their tag injected into\nfrontmatter. Plain `create path=…` stays template-free (use it for arbitrary notes).\n\n## Recipes (chain commands like this)\n\n**Morning review** — what's on my plate, then capture the plan:\n\n```bash\nnpx -y @life-os/cli tasks due=today --json # today's open tasks\nnpx -y @life-os/cli tasks due=overdue --json # anything slipping\nnpx -y @life-os/cli daily:append section=\"日常记录\" content=\"- 08:30 #计划 今天先做 ...\"\n```\n\n**Quick capture** — \"记一下:想法X\" (drop a timestamped line into today's record section):\n\n```bash\nnpx -y @life-os/cli daily:append section=\"日常记录\" content=\"- 14:30 #摘抄 想法X\" # echoes the resolved path\n```\n\n**Find then act** — never write blind:\n\n```bash\nnpx -y @life-os/cli tasks keyword=\"季度报告\" # locate the task, note its file:line\nnpx -y @life-os/cli task done ref=\"0. 周期笔记/2025/Daily/05/2025-05-30.md:14\"\n```\n\n**Research a topic across the vault**:\n\n```bash\nnpx -y @life-os/cli search query=\"超线性回报\" type=content limit=20 # path:line + matching text\nnpx -y @life-os/cli read path=\"-1. 捕获/....md\" # open the most relevant hit\n```\n\n**Weekly review**:\n\n```bash\nnpx -y @life-os/cli weekly # confirm this week's note path / existence\nnpx -y @life-os/cli tasks done due=week # what got done\nnpx -y @life-os/cli weekly:append content=\"## 复盘\\n...\"\n```\n\n## Journaling (日记)\n\nThe daily note is where most capture lands. Do it precisely:\n\n1. **Locate** — `npx -y @life-os/cli daily` shows today's path and `Exists`. Pass\n `date=YYYY-MM-DD` for another day, `locale=` for weekday/month names. For\n daily notes, the CLI honors Obsidian's `.obsidian/daily-notes.json`\n `folder` + `format` first, so never hand-build a path like\n `Daily/YYYY-MM-DD.md`.\n2. **Insert in the right place** — append into the record section with\n `section=<header>`, not the file tail. The header is the daily note's main\n record heading (commonly `日常记录` / `Daily Record`); confirm it by reading a\n recent daily note. `section=` lands the line at the **end of that section**\n (e.g. before `习惯打卡` / `Habit`) and creates the section only if absent.\n3. **Format** — default to `- HH:mm #tag 内容`. Use the current time from the\n environment; the user is usually in their local timezone. Reuse existing tags —\n `npx -y @life-os/cli search type=tag keyword=<x>` — rather than inventing\n fine-grained ones; 1–3 tags unless the entry needs more.\n4. **Polish, don't transcribe** — lightly smooth the user's words while keeping\n their facts, stance, emotion and first-person voice; add no judgments, advice\n or conclusions they didn't make. When they say `原文`/`逐字`/`原样`/`摘抄`/verbatim,\n or paste a quote, keep it exact and only tidy Markdown.\n5. **Creating a missing daily note** — just use `<period>:create` (or let\n `<period>:append` auto-create it). For daily notes, the CLI also honors the\n Obsidian Daily Notes core `template` path when configured. It renders the\n user's configured template via the shared engine: `{{snapshot:Project}}`\n expands to the live PARA index list, `{{if weekday}}`/`{{date}}`/etc. are\n resolved, and LifeOS query blocks (`ProjectListByTime`, `TaskDueListByTime`)\n are kept verbatim for the plugin to render at view time. No manual template\n rendering needed — the resulting note matches what the plugin/Aino would\n create.\n\nThe same `section=` works on `weekly|monthly|...:append` and on plain\n`append path=<p> section=<h>`, so you can log into any note's heading.\n\n## Creating theme notes (项目/领域/资源/归档)\n\nUse `theme:create` so the note is built from the PARA type's template and gets\nits theme tag wired into frontmatter (so the theme index collects it):\n\n```bash\n# read config first for the real PARA folder names, then place the note yourself\nnpx -y @life-os/cli config\nnpx -y @life-os/cli theme:create type=project tag=\"项目/季度OKR\" path=\"1. 项目/季度OKR/季度OKR.md\"\n```\n\n- `type=` picks the template (`<type>TemplateFilePath` → `<typeDir>/Template.md` → built-in).\n- `tag=` is the theme tag; it's injected into `tags`/`aliases` frontmatter.\n- `path=` is yours to choose — the convention is `<paraDir>/<name>/<name>.md` (a\n folder + same-named index note, which is what `{{snapshot}}` lists). Add\n `overwrite` to replace.\n\n## Upgrading the skill\n\nThe skill files inside `.agents/skills/lifeos/` should match your CLI version.\nRun this after upgrading `@life-os/cli`:\n\n```bash\nnpx -y @life-os/cli skill install\n```\n\nIt copies the bundled SKILL.md + references into your vault's `.agents/skills/lifeos/`\nfrom the npm package you just upgraded to — no manual download, no git clone.\n\n## Writing safely\n\n- Writes (`append`, `create`, `task`, `<period>:append`) take an **explicit\n `path=` / `ref=`** — they never guess a note from a loose name, so you won't\n write to the wrong same-named file. `search`/`tasks` first to get the exact\n target, then write.\n- `create` errors with _\"A note already exists…\"_ unless you pass `overwrite`.\n- Periodic `:append` **echoes the resolved path** and creates the note if missing.\n If `Exists: no` surprises you, the vault's format config may differ from how\n existing notes were named — surface the path to the user rather than creating a\n stray note.\n\n## Interpreting results\n\n- Tasks print `[ ]`/`[x] <text> (due … !priority #tags) — <file>:<line>`.\n The `<file>:<line>` is the stable reference for `task done|todo`.\n- `tasks` defaults to open (todo); pass `done`/`all` to widen. `due=` queries also\n hide completed tasks by default.\n- PARA folder names are the user's own (e.g. `1. 项目`) — see `npx -y @life-os/cli config`.\n- Errors are human-readable and exit non-zero (e.g. file-not-found, already-exists).\n\n## Performance\n\nIndex-backed commands (`tasks`, `search type=file|tag`) rebuild the index per run\n(~1s on a ~5k-note vault); `search type=content` scans note bodies (~0.5s). Fine\nfor interactive use; avoid tight loops of many index queries.\n\n## Scope\n\nReading, querying and editing note content (notes, tasks, periodic notes, PARA,\ntags). **Not** in scope: Google Calendar / CalDAV sync, and the plugin's UI —\nthose live in the LifeOS plugin and Aino app.\n",
318
- "references/ai-wiki.md": "# LifeOS AI Wiki — maintenance rules\n\nA LifeOS vault can host a **distributed AI-maintained wiki**: each topic /\nindex note gets a sibling `{filename}.AI.md` page that synthesises what the\nvault knows about that topic. This file is the authoritative spec for how to\ncreate, update, query and lint those pages.\n\nUse it whenever the user asks you to \"整理一下 X 主题\"、\"更新 AI Wiki\"、\n\"看看 AI Wiki 怎么说\" or anything similar.\n\n## Source scope\n\nOriginal source files stay in the existing PARA structure:\n\n- `0 周期笔记/`\n- `1 捕获/`\n- `2 项目/`\n- `3 领域/`\n- `4 资源/`\n- `5 存档/`\n\n**Do not rewrite source notes** during AI Wiki ingestion unless the user\nexplicitly asks for source-note edits.\n\nOnly **topic or index notes** receive `.AI.md` companions. Do **not** create\n`.AI.md` pages for individual capture notes, articles, imported sources,\nmeeting notes, or other non-index source files. If a source note contains\ndurable knowledge, first attach it to the appropriate topic and then update\nthat topic's `.AI.md` page.\n\nEach active PARA topic folder in `2 项目/`, `3 领域/`, and `4 资源/` should have\na sibling `{folder name}.AI.md` page. `0 周期笔记/`, `1 捕获/`, and `5 存档/`\nmay use section-level overview pages. `5 存档/` should use archive-family\noverview pages first because it contains many inactive project folders.\n\n## Wiki page schema\n\nEvery `.AI.md` page must include this frontmatter:\n\n```yaml\n---\ntype: wiki/主题\nsource: '[[同目录下的主题/索引笔记]]'\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\n---\n```\n\nAllowed `type` values:\n\n- `wiki/主题` — cross-source synthesis page\n\nBody convention — **required** sections (in this order):\n\n```markdown\n## 一句话摘要\n\n<one sentence: purpose + current focus>\n\n## 核心判断\n\n- <durable insight 1>\n- <durable insight 2>\n (3–6 bullets; long-lived judgements, not status)\n\n## 材料地图\n\n- N 篇子笔记 (类别 / 类别)\n- 关联主题:[[相关主题.AI]]\n- 关键节点:<recent milestone>\n\n## 复盘\n\n- 做对了:<what worked, why>\n- 做错了:<what didn't work, why>\n- 学到:<takeaway worth keeping>\n (short, specific. If a phase just ended, anchor to the period.)\n\n## 下一步建议\n\n- [优先级] <具体动作> — <时间感:本周/本月/下季>\n- [优先级] <具体动作> — <时间感>\n (2–5 bullets. Must be specific, owner-clear, time-anchored.\n The goal of this page is to drive the topic forward,\n not just summarise it.)\n```\n\nThe last two sections — **复盘 / 下一步建议** — are what make this a\nworking wiki instead of an archive. Without them the page just summarises\nthe past; with them it steers the topic.\n\n## Ingest flow\n\nWhen maintaining a topic or index note in the AI Wiki:\n\n1. **Read** the topic/index note and related local context.\n2. **Create or update** the sibling `{filename}.AI.md` page — only when the\n source is a topic or index note.\n3. **Link** to related topic `.AI.md` pages where the relationship is durable.\n4. **Update** `7 索引/7. AI Wiki 索引.md` with the page link and one-line\n summary.\n5. **Append** an operation entry to `7 索引/AI Wiki 变更日志.md`.\n\n### Concrete lifeos CLI commands\n\n```bash\n# 1. locate the topic note and confirm vault layout\nnpx -y @life-os/cli config\nnpx -y @life-os/cli search query=\"学日语\" type=file\n\n# 2. read the topic note + any sibling that already exists\nnpx -y @life-os/cli read path=\"4 资源/学日语/学日语.md\"\nnpx -y @life-os/cli read path=\"4 资源/学日语/学日语.AI.md\" # ok if missing — handle the error\n\n# 3. write or overwrite the .AI.md sibling\nnpx -y @life-os/cli create path=\"4 资源/学日语/学日语.AI.md\" content=\"---\\ntype: wiki/主题\\nsource: \\\"[[学日语]]\\\"\\ncreated: 2026-06-07\\nupdated: 2026-06-07\\n---\\n\\n## 一句话摘要\\n...\" overwrite\n\n# 4. update the central index (append a bullet under the right section)\nnpx -y @life-os/cli append path=\"7 索引/7. AI Wiki 索引.md\" section=\"4 资源\" content=\"- [[4 资源/学日语/学日语.AI|学日语]] — 五十音过关 / 每日 30 分钟 / N4 目标\"\n\n# 5. log the operation in the changelog\nnpx -y @life-os/cli append path=\"7 索引/AI Wiki 变更日志.md\" content=\"- 2026-06-07 update 4 资源/学日语/学日语.AI.md — refreshed core take + materials map\"\n```\n\nAlways use `overwrite` on step 3 only after reading the existing page — the\ngoal is incremental synthesis, not blind replacement.\n\n## Query flow\n\nWhen answering from the AI Wiki:\n\n1. **Read `7 索引/7. AI Wiki 索引.md` first.** It is the entry point.\n2. **Open** the relevant `.AI.md` pages.\n3. **Read original source files** only when the wiki page is missing, stale,\n or insufficient.\n4. If a query produces durable synthesis, update the relevant topic `.AI.md`\n page **when requested**. Do not create standalone non-topic `.AI.md` pages\n unless the user explicitly overrides this rule.\n\n```bash\nnpx -y @life-os/cli read path=\"7 索引/7. AI Wiki 索引.md\"\nnpx -y @life-os/cli read path=\"4 资源/学日语/学日语.AI.md\"\nnpx -y @life-os/cli search query=\"五十音\" type=content limit=10 # fall back to source scan\n```\n\n## Lint flow\n\nRun these checks during AI Wiki maintenance:\n\n- `.AI.md` pages missing required frontmatter\n- wiki pages not present in `7 索引/7. AI Wiki 索引.md`\n- `.AI.md` pages attached to non-topic source notes\n- obsolete `updated` dates after content changes\n- orphaned pages with no incoming index link\n- duplicate topic pages that should be merged or cross-linked\n\nUseful one-liners:\n\n```bash\nnpx -y @life-os/cli search query=\".AI.md\" type=file limit=200 # enumerate all wiki pages\nnpx -y @life-os/cli search query=\"type: wiki/\" type=content limit=200 # frontmatter sanity check\n```\n\n## Out of scope\n\n- Do not generate `.AI.md` for captures, daily / weekly / monthly notes, or\n any individual source note that isn't a topic / index.\n- Do not rewrite source notes during ingestion.\n- Do not invent new `type:` values beyond `wiki/主题` without an explicit user\n decision.\n",
319
- "references/commands.md": "# `lifeos` — full command reference\n\nExhaustive reference for the `lifeos` CLI. The SKILL.md covers the common path;\nload this when you need an exact flag, output shape, or error meaning.\n\n## Conventions\n\n- **Invocation**: run via `npx -y @life-os/cli <command> …` (npx fetches the\n published package on first use; `-y` skips the prompt). The command names below\n (`config`, `tasks`, …) are the `<command>` argument, e.g.\n `npx -y @life-os/cli tasks due=today`.\n- **Options**: `key=value` (or `--key=value`). **Flags**: `--json`, or bare\n `overwrite` / `case`. Quote values containing spaces.\n- **Output**: human-readable by default; `--json` (or `format=json`) emits a\n single JSON document on stdout.\n- **`content=` escapes**: in write commands (`append`, `create`, `<period>:append`)\n the `content=` value interprets `\\n` `\\t` `\\r` `\\\\`, so you can write multi-line\n content on one command line.\n- **Exit codes**: `0` success, `1` on any error. Error text is human-readable.\n\n## Vault selection\n\nResolved in order, first match wins:\n\n1. `vault=<path>` option (`~` is expanded; relative paths resolve against cwd)\n2. `$LIFEOS_VAULT` environment variable\n3. Walk up from the current directory for a folder containing `.obsidian/` or `.lifeos/`\n4. The folder Aino last opened (`<userData>/bootstrap.json` → `lastOpenedFolder`)\n\n`config` reports which one was used via `Found by` / `discoveredVia`.\n\n## Settings sources\n\nEffective settings merge built-in defaults with these files (later overrides\nearlier), the same set the plugin and Aino use:\n\n1. `.obsidian/plugins/periodic-para/data.json` (legacy plugin id)\n2. `.obsidian/plugins/lifeos-pro/data.json`\n3. `.lifeos/settings.json` (Aino's vault-portable settings)\n\n---\n\n## Commands\n\n### `config`\n\nShow the resolved vault, how it was found, the config source files applied, and\nkey LifeOS settings (PARA folders, periodic base, daily path format, and the daily\ntemplate path used when rendering a missing daily note). For the final daily note\npath, use `daily` itself: it also considers Obsidian Daily Notes core settings.\n`--json` → `{ vault: {root, discoveredVia}, sources: string[], settings }`.\n\n### `tasks [todo|done|all]`\n\nList tasks. Positional status defaults to `todo`.\n\n| Option | Meaning |\n| -------------------------- | ------------------------------------------------------------------- |\n| `tag=<tag>` | tasks tagged `<tag>` (matches the tag and its sub-tags `<tag>/...`) |\n| `keyword=<text>` | substring match on task text |\n| `due=today\\|week\\|overdue` | filter by **due date**; status still applies (default hides done) |\n| `limit=<n>` | max rows (default 50) |\n| `--json` | `{ totalCount, count, items: TaskItem[] }` |\n\n`TaskItem`: `{ file, line, text, checked, dueDate?, priority?, tags?, ... }`.\nHuman line: `[ ]|[x] <text> (due <date> !<priority> #<tags>) — <file>:<line>`.\n\nNotes: `due=*` over-fetches and post-filters by status, so a completed task with a\npast due date is hidden unless you ask for `done`/`all`.\n\n### `search query=<text>`\n\n| Option | Meaning |\n| --------------------- | ------------------------------------------------------- |\n| `type=file` (default) | match note name + path (case-insensitive substring) |\n| `type=tag` | match tag names; output `#tag (count)` |\n| `type=content` | full-text scan of note bodies; output `path:line text` |\n| `case` | content search becomes case-sensitive |\n| `limit=<n>` | max results (default 20, capped at 100) |\n| `--json` | `{ type, query, count, items }` |\n\nContent matching is plain substring (not regex). It reads files on demand and\nstops at `limit`.\n\n### `read file=<name> | path=<vault/rel/path>`\n\nPrint a note. `path=` is exact (vault-relative); `file=` resolves a loose name via\nthe index and errors if ambiguous (lists candidates). `.md` is added if omitted.\n`--json` → `{ filePath, content }`.\n\n### Periodic notes: `daily | weekly | monthly | quarterly | yearly`\n\nResolve the note path with the same formatter as the plugin/Aino (ISO weeks for\nweekly). For `daily`, `.obsidian/daily-notes.json` wins when present:\n`folder` is the base path and `format` is the date path template, so formats like\n`MM/YYYY-MM-DD` correctly create month subfolders. Other periods use\n`periodicNotesPath` + `periodicNotesPathFormat<Type>` from LifeOS settings,\nfalling back to LifeOS defaults. Weekday/month name tokens (`dddd`/`MMMM`) honor\n`locale=` (default: system locale).\n\n| Form | Effect |\n| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |\n| `<period>` | print `Type/Date/Path/Exists/Format`; `--json` adds `exists` |\n| `<period>:read` | print the note (errors if it doesn't exist) |\n| `<period>:create [overwrite]` | create the note from its configured template (rendered); errors if it exists unless `overwrite` |\n| `<period>:append content=<text>` | append; **creates the note from its template if missing** |\n| `section=<header>` | insert at the end of that header's section (creates it if absent) instead of the file tail — e.g. `section=\"日常记录\"` for daily-record logging |\n| `date=YYYY-MM-DD` | target a specific period (default: today) |\n| `locale=<bcp47>` | locale for name tokens, e.g. `zh-CN` |\n\nTemplate resolution: for `daily`, Obsidian Daily Notes core `template` wins when\nset; otherwise `periodicNotesTemplateFilePath<Type>` if set, else\n`<periodicNotesPath>/Templates/<Type>.md`, else a built-in default. The template\nis rendered with the shared engine: `{{snapshot:Project}}` → numbered\n`[[index|name]]` list of PARA sub-folders that have an index note;\n`{{if weekday}}…{{endif}}`, `{{date}}`, `{{date+N:FORMAT}}`, `{{title}}` are\nexpanded; unknown `{{…}}` (LifeOS query blocks) are left verbatim.\n`:create`/`:append` `--json` adds `created` / `templatePath`.\n\nEvery form echoes the resolved path. `<period> read` / `<period>:read` are both\naccepted.\n\n### `theme:create type=<t> tag=<tag> path=<vault/rel/path> [overwrite]`\n\nCreate a PARA/theme note from its template. `type` ∈ `project|area|resource|archive|theme`.\nTemplate resolution: `<type>TemplateFilePath` if set, else `<typeDir>/Template.md`,\nelse a built-in default. The template is rendered (same engine as periodic notes),\nthen `tag` is injected into the note's `tags`/`aliases` frontmatter so the theme\nindex collects it. `path=` is caller-supplied (read `config` for PARA folder\nnames); convention is `<paraDir>/<name>/<name>.md`. Errors if the note exists\nunless `overwrite`. `--json` → `{ ok, filePath, created, templatePath, type, tag }`.\n\n### `append path=<vault/rel/path> content=<text> [section=<header>]`\n\nAppend to an **existing** note. Errors if the note doesn't exist (use `create`).\nWithout `section=`, appends to the file tail with a newline boundary. With\n`section=<header>`, inserts at the **end of that header's section body** (matching\nthe header at any `#` depth, ignoring case/whitespace) and creates the section at\nthe end of the file if the header is missing. `--json` →\n`{ ok, filePath, created:false, section }`.\n\n### `create path=<vault/rel/path> [content=<text>] [overwrite]`\n\nCreate a note (parent folders auto-created, `.md` added if omitted). Errors if it\nexists unless `overwrite`. `--json` → `{ ok, filePath, created }`.\n\n### `task done|todo ref=<file>:<line>`\n\nToggle one task's checkbox. `ref` is the `file:line` printed by `tasks` (only the\ntrailing `:<digits>` is the line number, so paths with colons are fine).\n`--json` → `{ ok, filePath, action }`.\n\n### `skill install [vault=<path>]`\n\nInstall or update the bundled LifeOS agent skill into\n`.agents/skills/lifeos/` inside the resolved vault. The command overwrites\n`SKILL.md` and `references/` with the files embedded in the current\n`@life-os/cli` package, so it is the upgrade path after installing a newer CLI.\n\n### `help`, `version`\n\nPrint usage / version.\n\n---\n\n## Errors\n\nSurfaced as readable text with exit code 1. Common cases:\n\n| Situation | Message |\n| ------------------------------ | ----------------------------------------------------------------- |\n| note missing (`read`/`append`) | `No such note in the vault.` |\n| `create` onto existing | `A note already exists at that path. Add the \\`overwrite\\` flag…` |\n| path escapes vault | `Refusing to touch a path outside the vault.` |\n| `task` ref not a checkbox line | `That line is not a \\`- [ ]\\` / \\`- [x]\\` task.` |\n| bad `due=` / `date=` value | explains the accepted values |\n| no vault found | explains the four resolution options |\n\n---\n\n## Performance (≈5k-note vault)\n\n- Fixed startup (node + import): ~70 ms.\n- `search type=content`: ~0.5 s worst case (scans bodies; stops at `limit`).\n- Index-backed (`tasks`, `search type=file|tag`): ~1 s (rebuilds the index per\n process; there is no persistent cache yet). Avoid tight loops of many such calls.\n\n## Out of scope\n\nUI views, Google Calendar / CalDAV sync, two-way task↔calendar sync, Pomodoro and\ndaily-record sync — these remain in the LifeOS plugin and the Aino desktop app.\n",
322
+ const LIFEOS_SKILL_VERSION = '0.2.0';
323
+ const OPC_SKILL_VERSION = '0.2.0';
324
+ const LIFEOS_SKILL_BUNDLE_CONTENT_HASH = 'fnv1a64-08173421a8cbc9aa';
325
+ const LIFEOS_SKILL_NAMES = [
326
+ 'lifeos',
327
+ 'lifeos-board',
328
+ 'lifeos-content',
329
+ 'lifeos-onboarding',
330
+ 'lifeos-today',
331
+ ];
332
+ const LIFEOS_SKILL_CONTENT_HASHES = {
333
+ lifeos: 'fnv1a64-5ab893b81ae6f2a7',
334
+ 'lifeos-board': 'fnv1a64-db6cecd918595543',
335
+ 'lifeos-content': 'fnv1a64-d7b74b91295c3c45',
336
+ 'lifeos-onboarding': 'fnv1a64-5a85c351dc9a2c37',
337
+ 'lifeos-today': 'fnv1a64-081805206fb3b3aa',
338
+ };
339
+ const OPC_SKILL_CONTENT_HASH = 'fnv1a64-91e0be0dbacd3e3c';
340
+ const LIFEOS_SKILL_BUNDLE_FILES = {
341
+ 'lifeos-board/SKILL.md': "---\nname: lifeos-board\ndescription: 'Inspect and reason about LifeOS Workflow or PARA boards through the `lifeos` CLI without Aino Desktop. Use for AI board analysis, Input/Projects/Tasks/Output flow, Projects/Areas/Resources/Archives structure, bottlenecks, stalled work, theme notes, topic workspaces, or safe project/theme tag wiring. Do not use for daily planning or vault onboarding.'\n---\n\n# LifeOS Board\n\nRead [`../lifeos/SKILL.md`](../lifeos/SKILL.md) first for host selection, vault\nresolution, association rules and write safety.\n\n## Inspect the visible model\n\nChoose the board from the user's intent or detected profile:\n\n```bash\nnpx -y @life-os/cli board mode=workflow --json\nnpx -y @life-os/cli board mode=para --json\n```\n\n- `workflow` returns Input, Projects, open Tasks and Output.\n- `para` returns Projects, Areas, Resources and Archives.\n\nGround analysis in returned column totals, bounded items and `sources`. Identify\nthe clearest bottleneck, no more than three worthwhile next steps, and any\nblocker or tradeoff that needs confirmation. A board read never authorizes\nmoving, creating, tagging or editing an item.\n\n## Work with themes\n\nRead [`references/theme-notes.md`](references/theme-notes.md) before creating or\nediting a project, area, resource, archive or topic workspace. Use time-oriented\nnotes for a day/week/month/quarter/year and theme notes for a durable subject.\n\nTreat theme tags as optional user-owned associations. Never infer one from the\nactive file, a nearby project, related search results or the only visible theme.\n\n## Boundaries\n\n- Use [`../lifeos-today/SKILL.md`](../lifeos-today/SKILL.md) for daily planning,\n due work, recent activity and weekly review.\n- Use [`../lifeos-content/SKILL.md`](../lifeos-content/SKILL.md) to synthesize a\n `.AI.md` page or HTML dashboard after the board identifies the target theme.\n- Use [`../lifeos-onboarding/SKILL.md`](../lifeos-onboarding/SKILL.md) when the\n Workflow/PARA structure does not exist or must change profiles.\n",
342
+ 'lifeos-board/agents/openai.yaml': "interface:\n display_name: 'LifeOS Board'\n short_description: 'Analyze Workflow and PARA board bottlenecks'\n default_prompt: 'Use $lifeos-board to analyze the current workflow board.'\n",
343
+ 'lifeos-board/references/theme-notes.md': '# Theme notes and tag wiring\n\nUse this reference when creating or maintaining a project, area, resource,\narchive or another subject-based LifeOS workspace.\n\n## Theme model\n\nA theme note is the durable subject workspace. PARA is the common shape:\n\n- **Project / 项目**: a concrete outcome, normally with a completion condition.\n- **Area / 领域**: an ongoing responsibility or standard to maintain.\n- **Resource / 资源**: reusable knowledge or material about a topic.\n- **Archive / 归档**: inactive work and its reusable conclusions or assets.\n- **Theme / 主题**: a generic subject when PARA does not fit.\n\nThe theme tag is the subject\'s unique association key. Tagged tasks, bullets and\nfiles across periodic notes and the vault can be indexed back into the theme.\nFolders hold durable medium/long-form material; tags connect short distributed\nrecords.\n\n## Select associations safely\n\nReuse a theme tag only when the user explicitly selected the association, the\noriginal content already contains it, or a durable user preference authorizes\nautomatic association. A relevant active note, search hit or unique visible\nproject is only a candidate.\n\nIf a new task or capture could belong to a theme but the association is not\nconfirmed, complete and verify the requested write without the tag, then ask a\nshort follow-up. On confirmation, update the same record rather than creating a\nduplicate.\n\nBefore inventing a new tag, inspect the target theme note and existing tag\nvocabulary:\n\n```bash\nnpx -y @life-os/cli search query="主题名" type=file\nnpx -y @life-os/cli search query="主题名" type=tag\nnpx -y @life-os/cli read path="exact/theme/index.md"\n```\n\n## Create from the configured template\n\nRun `config` first to learn the actual PARA directories. Use `theme:create` so\nthe selected type\'s configured template is rendered and its tag is merged into\nFrontmatter:\n\n```bash\nnpx -y @life-os/cli config\nnpx -y @life-os/cli theme:create type=project tag="项目/季度OKR" path="1. 项目/季度OKR/季度OKR.md"\n```\n\n`type=` accepts `project`, `area`, `resource`, `archive` or `theme`. Template\nresolution prefers the configured `<type>TemplateFilePath`, then the type\ndirectory\'s `Template.md`, then the built-in default. The caller supplies the\nexact path; the normal convention is `<configuredDir>/<name>/<name>.md`.\n\nDo not pass `overwrite` until the exact existing target has been read and the\nreplacement is intentional. Preserve unknown Frontmatter and body content when\nupdating an existing theme.\n\n## Choose the related surface\n\n- Maintain the Markdown theme note for source knowledge and working material.\n- Generate a sibling `.AI.md` only for a topic/index note; follow\n `../../lifeos-content/references/ai-wiki.md`.\n- Generate a sibling `.html` decision surface only when the user requests a\n theme dashboard; follow\n `../../lifeos-content/references/theme-dashboard.md`.\n- Route multi-record CRUD, forms, filters or repeated operational workflows to\n Aino App Builder; follow\n `../../lifeos-content/references/aino-mini-apps.md`.\n\nDo not silently convert one surface into another. Preserve the source note and\nask when the requested surface is ambiguous.\n',
344
+ 'lifeos-content/SKILL.md': '---\nname: lifeos-content\ndescription: \'Find, read, capture, create, and maintain LifeOS knowledge content through the `lifeos` CLI. Use for note or full-text search, precise Markdown reads/appends/creates, importing or pasting material into an existing vault, metadata for image/video/audio/PDF/DOC/PPT attachments, LifeOS AI Wiki `.AI.md` pages, sibling theme HTML dashboards, or deciding whether an interactive workflow belongs in an Aino mini app. Do not use for template/profile migration.\'\n---\n\n# LifeOS Content\n\nRead [`../lifeos/SKILL.md`](../lifeos/SKILL.md) first for host selection, exact\ntargeting, association rules and write safety.\n\n## Locate before writing\n\nUse bounded search and exact reads:\n\n```bash\nnpx -y @life-os/cli search query="keyword" type=content limit=20 --json\nnpx -y @life-os/cli read path="vault/relative/note.md" --json\n```\n\nUse the returned vault-relative path for `append` or `create`. Read and merge\nunknown Frontmatter/body content before `overwrite`. Route time-based capture to\n[`../lifeos-today/SKILL.md`](../lifeos-today/SKILL.md) and durable project/topic\nwork to [`../lifeos-board/SKILL.md`](../lifeos-board/SKILL.md).\n\n## Choose the content surface\n\n- Non-Markdown attachment tags or properties: read\n [`references/attachment-cards.md`](references/attachment-cards.md). A binary\n file uses a hidden sibling Markdown card; do not invent an `attachment` field.\n- Synthesized topic/index knowledge: read\n [`references/ai-wiki.md`](references/ai-wiki.md) and maintain the sibling\n `.AI.md`, source index and changelog contract.\n- Visual decision surface beside a theme/index note: read\n [`references/theme-dashboard.md`](references/theme-dashboard.md) and reuse\n [`assets/theme-dashboard-skeleton.html`](assets/theme-dashboard-skeleton.html).\n- Persistent interactive multi-record CRUD, forms, filters or repeated\n operations: read [`references/aino-mini-apps.md`](references/aino-mini-apps.md)\n and route development to Aino App Builder.\n\nAn AI Wiki is not a capture or meeting note. A theme dashboard is not a Markdown\nexport. An Aino mini app is not a replacement for Markdown as the business\nsource of truth.\n\n## Boundaries\n\n- Do not read binary content unless another tool actually extracts it.\n- Do not generate or edit Aino App Builder project internals or operate\n `.lifeos/custom-apps` directly.\n- Use [`../lifeos-onboarding/SKILL.md`](../lifeos-onboarding/SKILL.md) when the\n request changes the vault profile or classifies scattered folders.\n',
345
+ 'lifeos-content/agents/openai.yaml': "interface:\n display_name: 'LifeOS Content'\n short_description: 'Maintain notes, attachments, AI Wiki, and dashboards'\n default_prompt: 'Use $lifeos-content to find and maintain this LifeOS content.'\n",
346
+ 'lifeos-content/assets/theme-dashboard-skeleton.html': '<!doctype html>\n<html lang="zh-CN">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <title>主题名 Dashboard</title>\n <style>\n :root {\n color-scheme: light dark;\n --bg: #f6f4ef;\n --panel: #fffdf8;\n --panel-soft: #f2eee4;\n --text: #20252d;\n --muted: #667085;\n --line: #d9d1c3;\n --accent: #246a8d;\n --accent-2: #1f8a70;\n --warn: #b58121;\n --bad: #c7513f;\n --good: #247a4d;\n --shadow: 0 16px 40px rgba(32, 37, 45, 0.08);\n }\n @media (prefers-color-scheme: dark) {\n :root {\n --bg: #111418;\n --panel: #1b2027;\n --panel-soft: #242b34;\n --text: #eef2f7;\n --muted: #aab3c1;\n --line: #343c49;\n --accent: #7ab7d8;\n --accent-2: #73d3b5;\n --warn: #f1c56b;\n --bad: #ff8f80;\n --good: #88d7a8;\n --shadow: 0 16px 40px rgba(0, 0, 0, 0.24);\n }\n }\n * {\n box-sizing: border-box;\n }\n body {\n margin: 0;\n background:\n linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px),\n var(--bg);\n background-size: 32px 32px;\n color: var(--text);\n font-family:\n Inter,\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n \'Segoe UI\',\n sans-serif;\n line-height: 1.55;\n }\n .dashboard {\n width: min(1180px, calc(100% - 32px));\n margin: 0 auto;\n padding: 28px 0 42px;\n }\n .topbar,\n .panel,\n .signal {\n background: color-mix(in srgb, var(--panel) 94%, transparent);\n border: 1px solid var(--line);\n border-radius: 8px;\n box-shadow: var(--shadow);\n }\n .topbar {\n padding: 22px;\n }\n .eyebrow,\n .meta,\n .label {\n color: var(--muted);\n font-size: 12px;\n }\n h1,\n h2,\n h3,\n p {\n margin: 0;\n }\n h1 {\n margin: 6px 0 10px;\n font-size: clamp(30px, 4vw, 52px);\n letter-spacing: 0;\n }\n h2 {\n margin-bottom: 12px;\n font-size: 18px;\n }\n h3 {\n margin-bottom: 6px;\n font-size: 14px;\n }\n .pills {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin-top: 16px;\n }\n .pill {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n padding: 4px 9px;\n overflow-wrap: anywhere;\n color: var(--muted);\n font-size: 12px;\n border: 1px solid var(--line);\n border-radius: 999px;\n }\n .grid {\n display: grid;\n grid-template-columns: repeat(12, minmax(0, 1fr));\n gap: 14px;\n margin-top: 14px;\n }\n .panel {\n padding: 16px;\n }\n .span-3 {\n grid-column: span 3;\n }\n .span-4 {\n grid-column: span 4;\n }\n .span-6 {\n grid-column: span 6;\n }\n .span-8 {\n grid-column: span 8;\n }\n .span-12 {\n grid-column: span 12;\n }\n .signals {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 10px;\n }\n .signal {\n padding: 12px;\n box-shadow: none;\n }\n .metric {\n font-size: 28px;\n font-weight: 750;\n }\n .list {\n display: grid;\n gap: 10px;\n padding: 0;\n margin: 0;\n list-style: none;\n }\n .item {\n padding: 10px 10px 10px 12px;\n background: var(--panel-soft);\n border-left: 3px solid var(--accent);\n border-radius: 6px;\n }\n .item.risk {\n border-left-color: var(--bad);\n }\n table {\n width: 100%;\n font-size: 14px;\n border-collapse: collapse;\n }\n th,\n td {\n padding: 10px 8px;\n text-align: left;\n vertical-align: top;\n border-bottom: 1px solid var(--line);\n }\n th {\n color: var(--muted);\n font-size: 12px;\n font-weight: 650;\n }\n @media (max-width: 760px) {\n .dashboard {\n width: min(100% - 20px, 680px);\n padding-top: 16px;\n }\n .grid,\n .signals {\n grid-template-columns: 1fr;\n }\n .span-3,\n .span-4,\n .span-6,\n .span-8,\n .span-12 {\n grid-column: 1;\n }\n table {\n display: block;\n overflow-x: auto;\n }\n }\n </style>\n </head>\n <body>\n <main class="dashboard">\n <section class="topbar">\n <div class="eyebrow">LifeOS Theme Dashboard</div>\n <h1>主题名</h1>\n <p>一句话说明这个主题当前为什么重要,以及 dashboard 帮用户判断什么。</p>\n <div class="pills" aria-label="Theme metadata">\n <span class="pill">Tag: #主题标签</span>\n <span class="pill">Type: Project / Area / Resource / Archive</span>\n <span class="pill">Source: 主题索引.md</span>\n <span class="pill">Theme: Obsidian system</span>\n <span class="pill">Generated: YYYY-MM-DD</span>\n </div>\n </section>\n\n <section class="grid" aria-label="Dashboard overview">\n <article class="panel span-8">\n <h2>当前状态</h2>\n <p>基于主题索引、AI Wiki、任务/闪念/文件索引和同目录材料,总结当前状态。</p>\n </article>\n\n <article class="panel span-4">\n <h2>关键判断</h2>\n <p>当前最重要的判断或决策框架。没有证据时明确写缺少什么。</p>\n </article>\n\n <article class="panel span-12">\n <h2>索引信号</h2>\n <div class="signals">\n <div class="signal">\n <div class="label">TaskListByTag</div>\n <div class="metric">0</div>\n <p class="meta">No indexed task found</p>\n </div>\n <div class="signal">\n <div class="label">BulletListByTag</div>\n <div class="metric">0</div>\n <p class="meta">No tagged fleeting note found</p>\n </div>\n <div class="signal">\n <div class="label">FileListByTag</div>\n <div class="metric">0</div>\n <p class="meta">No tagged file found</p>\n </div>\n </div>\n </article>\n\n <article class="panel span-6">\n <h2>下一步行动</h2>\n <ul class="list">\n <li class="item">\n <strong>[P1] 具体行动</strong>\n <p class="meta">时间范围 · 负责人或来源 · 相关任务/笔记链接</p>\n </li>\n <li class="item">\n <strong>[P2] 候选行动</strong>\n <p class="meta">理由/证据 · 复查时机 · 缺失信息或验证方式</p>\n </li>\n </ul>\n </article>\n\n <article class="panel span-6">\n <h2>风险与阻塞</h2>\n <ul class="list">\n <li class="item risk">\n <strong>风险</strong>\n <p class="meta">影响 · 触发信号 · 应对方式</p>\n </li>\n </ul>\n </article>\n\n <article class="panel span-6">\n <h2>近期活动</h2>\n <p class="meta">No dated milestone found</p>\n </article>\n\n <article class="panel span-12">\n <h2>材料地图</h2>\n <table>\n <thead>\n <tr>\n <th>材料</th>\n <th>作用</th>\n <th>证据 / 路径</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>关键笔记</td>\n <td>为什么重要</td>\n <td>主题文件夹/Note.md</td>\n </tr>\n </tbody>\n </table>\n </article>\n </section>\n </main>\n </body>\n</html>\n',
347
+ 'lifeos-content/references/ai-wiki.md': '# LifeOS AI Wiki — maintenance rules\n\nA LifeOS vault can host a **distributed AI-maintained wiki**: each topic /\nindex note gets a sibling `{filename}.AI.md` page that synthesises what the\nvault knows about that topic. This file is the authoritative spec for how to\ncreate, update, query and lint those pages.\n\nUse it whenever the user asks you to "整理一下 X 主题"、"更新 AI Wiki"、\n"看看 AI Wiki 怎么说" or anything similar.\n\n## Contents\n\n- [Source scope](#source-scope)\n- [Wiki page schema](#wiki-page-schema)\n- [Ingest flow](#ingest-flow)\n- [Query flow](#query-flow)\n- [Lint flow](#lint-flow)\n- [Out of scope](#out-of-scope)\n\n## Source scope\n\nOriginal source files stay in the existing PARA structure:\n\n- `0 周期笔记/`\n- `1 捕获/`\n- `2 项目/`\n- `3 领域/`\n- `4 资源/`\n- `5 存档/`\n\n**Do not rewrite source notes** during AI Wiki ingestion unless the user\nexplicitly asks for source-note edits.\n\nOnly **topic or index notes** receive `.AI.md` companions. Do **not** create\n`.AI.md` pages for individual capture notes, articles, imported sources,\nmeeting notes, or other non-index source files. If a source note contains\ndurable knowledge, first attach it to the appropriate topic and then update\nthat topic\'s `.AI.md` page.\n\nEach active PARA topic folder in `2 项目/`, `3 领域/`, and `4 资源/` should have\na sibling `{folder name}.AI.md` page. `0 周期笔记/`, `1 捕获/`, and `5 存档/`\nmay use section-level overview pages. `5 存档/` should use archive-family\noverview pages first because it contains many inactive project folders.\n\n## Wiki page schema\n\nEvery `.AI.md` page must include this frontmatter:\n\n```yaml\n---\ntype: wiki/主题\nsource: \'[[同目录下的主题/索引笔记]]\'\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\n---\n```\n\nAllowed `type` values:\n\n- `wiki/主题` — cross-source synthesis page\n\nBody convention — **required** sections (in this order):\n\n```markdown\n## 一句话摘要\n\n<one sentence: purpose + current focus>\n\n## 核心判断\n\n- <durable insight 1>\n- <durable insight 2>\n (3–6 bullets; long-lived judgements, not status)\n\n## 材料地图\n\n- N 篇子笔记 (类别 / 类别)\n- 关联主题:[[相关主题.AI]]\n- 关键节点:<recent milestone>\n\n## 复盘\n\n- 做对了:<what worked, why>\n- 做错了:<what didn\'t work, why>\n- 学到:<takeaway worth keeping>\n (short, specific. If a phase just ended, anchor to the period.)\n\n## 下一步行动\n\n- [优先级] <具体动作> — <时间感:本周/本月/下季>\n- [优先级] <具体动作> — <时间感>\n (2–5 bullets. Must be specific, owner-clear, time-anchored.\n The goal of this page is to drive the topic forward,\n not just summarise it.)\n```\n\nThe last two sections — **复盘 / 下一步行动** — are what make this a\nworking wiki instead of an archive. Without them the page just summarises\nthe past; with them it steers the topic.\n\n## Ingest flow\n\nWhen maintaining a topic or index note in the AI Wiki:\n\n1. **Read** the topic/index note and related local context.\n2. **Create or update** the sibling `{filename}.AI.md` page — only when the\n source is a topic or index note.\n3. **Link** to related topic `.AI.md` pages where the relationship is durable.\n4. **Update** `7 索引/7. AI Wiki 索引.md` with the page link and one-line\n summary.\n5. **Append** an operation entry to `7 索引/AI Wiki 变更日志.md`.\n\n### Concrete lifeos CLI commands\n\n```bash\n# 1. locate the topic note and confirm vault layout\nnpx -y @life-os/cli config\nnpx -y @life-os/cli search query="学日语" type=file\n\n# 2. read the topic note + any sibling that already exists\nnpx -y @life-os/cli read path="4 资源/学日语/学日语.md"\nnpx -y @life-os/cli read path="4 资源/学日语/学日语.AI.md" # ok if missing — handle the error\n\n# 3. write or overwrite the .AI.md sibling\nnpx -y @life-os/cli create path="4 资源/学日语/学日语.AI.md" content="---\\ntype: wiki/主题\\nsource: \\"[[学日语]]\\"\\ncreated: 2026-06-07\\nupdated: 2026-06-07\\n---\\n\\n## 一句话摘要\\n..." overwrite\n\n# 4. update the central index (append a bullet under the right section)\nnpx -y @life-os/cli append path="7 索引/7. AI Wiki 索引.md" section="4 资源" content="- [[4 资源/学日语/学日语.AI|学日语]] — 五十音过关 / 每日 30 分钟 / N4 目标"\n\n# 5. log the operation in the changelog\nnpx -y @life-os/cli append path="7 索引/AI Wiki 变更日志.md" content="- 2026-06-07 update 4 资源/学日语/学日语.AI.md — refreshed core take + materials map"\n```\n\nAlways use `overwrite` on step 3 only after reading the existing page — the\ngoal is incremental synthesis, not blind replacement.\n\n## Query flow\n\nWhen answering from the AI Wiki:\n\n1. **Read `7 索引/7. AI Wiki 索引.md` first.** It is the entry point.\n2. **Open** the relevant `.AI.md` pages.\n3. **Read original source files** only when the wiki page is missing, stale,\n or insufficient.\n4. If a query produces durable synthesis, update the relevant topic `.AI.md`\n page **when requested**. Do not create standalone non-topic `.AI.md` pages\n unless the user explicitly overrides this rule.\n\n```bash\nnpx -y @life-os/cli read path="7 索引/7. AI Wiki 索引.md"\nnpx -y @life-os/cli read path="4 资源/学日语/学日语.AI.md"\nnpx -y @life-os/cli search query="五十音" type=content limit=10 # fall back to source scan\n```\n\n## Lint flow\n\nRun these checks during AI Wiki maintenance:\n\n- `.AI.md` pages missing required frontmatter\n- wiki pages not present in `7 索引/7. AI Wiki 索引.md`\n- `.AI.md` pages attached to non-topic source notes\n- obsolete `updated` dates after content changes\n- orphaned pages with no incoming index link\n- duplicate topic pages that should be merged or cross-linked\n\nUseful one-liners:\n\n```bash\nnpx -y @life-os/cli search query=".AI.md" type=file limit=200 # enumerate all wiki pages\nnpx -y @life-os/cli search query="type: wiki/" type=content limit=200 # frontmatter sanity check\n```\n\n## Out of scope\n\n- Do not generate `.AI.md` for captures, daily / weekly / monthly notes, or\n any individual source note that isn\'t a topic / index.\n- Do not rewrite source notes during ingestion.\n- Do not invent new `type:` values beyond `wiki/主题` without an explicit user\n decision.\n',
348
+ 'lifeos-content/references/aino-mini-apps.md': "# Aino Desktop AI mini apps\n\nUse this reference when a user asks for an Aino Desktop mini app, custom app,\ninteractive cockpit, tracker, CRM, library or another persistent interface over\nMarkdown data.\n\n## Choose the right surface\n\n- Use a normal note or LifeOS command when the user only needs content, capture,\n tasks, search or a one-off data change.\n- Use a sibling theme HTML dashboard when one theme needs a mostly read-only,\n source-backed decision surface that can live as one standalone `.html` file.\n- Use an Aino mini app when the request needs repeated interaction, multiple\n records or entities, forms, CRUD, filters, imports, subscriptions or an\n app-like workflow.\n\nIf the host is not Aino Desktop, explain that creating or publishing the app\nrequires Aino Desktop. Do not imitate the runtime by manufacturing its internal\nfiles.\n\n## Route to App Builder\n\nPrepare a short brief, then direct the user to Aino Desktop's **New App / 新建应用**\nentry and its App Builder. Include only decisions that are already known:\n\n1. the outcome and main user flows;\n2. whether relevant Markdown already exists;\n3. the selected data directory;\n4. each entity's document or block granularity;\n5. existing tags, Frontmatter keys, sections and Wikilink relations to preserve;\n6. which entities are read-only or writable;\n7. the smallest useful first-screen and core operations.\n\nAsk only about consequential unknowns. Do not invent a tag, directory or schema\nmerely to make the brief look complete.\n\n## LifeOS data guidance\n\n- Keep Markdown as the single business source of truth. Cache may hold only\n disposable, rebuildable derived data.\n- Reuse the vault's existing folder names, tags, Frontmatter keys and section\n headings when evidence exists; avoid equivalent duplicate vocabularies.\n- Model durable, independently editable records as `document` entities. Model\n dated logs or short entries embedded in periodic notes as `block` entities;\n current block entities are read-only.\n- Do not hardcode daily-note paths, date formats or PARA folder names. Resolve\n configured LifeOS/Obsidian conventions before proposing bindings.\n- Give writable document entities a stable ID. Express cross-entity relations\n through Wikilinks and preserve unknown Frontmatter and body content.\n- Keep the app inside its selected data-directory boundary. Do not silently\n scan, migrate or rewrite same-tag notes elsewhere in the vault.\n\n## Ownership and safety boundary\n\nThe Aino host owns the current project schema, permissions, Host SDK, sandbox,\ntheme variables, validation, functional acceptance, publication and rollback.\nThose rules are injected by App Builder and can evolve with Aino.\n\n- Do not output `<aino-app-project>` or `<aino-app-patch>` from this skill.\n- Do not create, edit or delete `.lifeos/custom-apps`, its registry, runtime,\n drafts, versions or logs.\n- Do not turn a mini-app request into a sibling HTML dashboard unless the user\n chooses the static dashboard after seeing the distinction.\n- Once the user is inside App Builder, follow the host-injected Builder rules;\n do not repeat or override them with the full LifeOS skill.\n",
349
+ 'lifeos-content/references/attachment-cards.md': '# Non-Markdown Attachment Frontmatter\n\nUse this reference when the user asks to tag or set properties on a PDF, image,\naudio, video, Office document, HTML file, or another non-Markdown attachment.\n\n## Contents\n\n- [Protocol](#protocol)\n- [Safe write workflow](#safe-write-workflow)\n- [Hidden files](#hidden-files)\n- [Moves and renames](#moves-and-renames)\n- [Aino Mobile](#aino-mobile)\n\n## Protocol\n\nDerive the hidden metadata Markdown path from the exact attachment path:\n\n```text\nAssets/合同.pdf -> Assets/.合同.pdf.md\nMedia/访谈.mp3 -> Media/.访谈.mp3.md\n```\n\nAssociate the two files only through the same directory and complete filename.\nDo not write an `attachment` field, wikilink, body embed, UUID, or content hash.\n\nCreate a Frontmatter-only file:\n\n```yaml\n---\naino-type: attachment-card\naino-version: 1\ntags:\n - 客户/acme\nstatus: 已签署\nowner: 法务\n---\n```\n\nReserve `aino-type` and `aino-version` for the system. Permit any other\nFrontmatter property. Treat a missing `tags` property as an empty tag list.\n\n## Safe Write Workflow\n\n1. Resolve one exact vault-relative non-Markdown attachment path. Do not mutate\n a result selected only by a loose or ambiguous filename.\n2. Confirm that the attachment exists and is not a Markdown file.\n3. Derive `.<complete attachment filename>.md` in the same directory.\n4. Read that exact metadata path before writing:\n\n ```bash\n npx -y @life-os/cli read path="Assets/.合同.pdf.md" --json\n ```\n\n5. If the hidden metadata file is missing, create it only after the user\n requested a property change. Include both reserved fields and the requested\n user properties.\n6. If a file already exists at the hidden metadata path, require\n `aino-type: attachment-card`, a supported `aino-version`, valid YAML, and the\n corresponding sibling attachment. Otherwise stop without overwriting.\n7. Merge only the requested changes. Preserve unknown keys, value types, key\n spelling, and any unexpected body text verbatim. Never silently normalize or\n delete data.\n8. For a generic “add this tag” request, add and de-duplicate tags without\n replacing unrelated tags. Remove or replace tags only when explicitly asked.\n9. Write the complete merged document back to the exact card path:\n\n ```bash\n npx -y @life-os/cli create path="Assets/.合同.pdf.md" content="<完整合并后的 Frontmatter>" overwrite\n ```\n\n Use `overwrite` only after step 6 validates an existing card. Omit it when\n creating a missing card so a concurrent file cannot be replaced.\n\n10. Read the frontmatter again and verify the reserved fields and requested properties.\n\n## Hidden Files\n\n- Keep the leading `.` on every platform.\n- On Windows, set the filesystem Hidden attribute after creating, moving, or\n renaming the hidden metadata file:\n\n ```powershell\n attrib +H "C:\\path\\to\\vault\\Assets\\.合同.pdf.md"\n ```\n\n- If setting the Windows attribute fails, keep the hidden metadata file and report that it may\n remain visible until Aino repairs the attribute. Do not claim full success\n without surfacing the warning.\n\n## Moves and Renames\n\nTreat the attachment and its hidden metadata Markdown file as one pair. Rename or move the\nmetadata file to the newly derived sibling path without changing its\nFrontmatter. Preflight both destinations and never overwrite a collision. If the\navailable tool cannot perform a safe paired operation, stop and ask the user to\nuse Aino.\n\n## Aino Mobile\n\nMobile supports syncing, hiding, recognizing, querying, reading, creating, and\nediting non-Markdown attachment frontmatter when `lifeos_get_vault_info` reports\n`lifeos_read_attachment_card` and `lifeos_update_attachment_card`.\n\nUse `lifeos_read_attachment_card` for the exact non-Markdown attachment path,\nmerge only the requested Frontmatter changes, then call\n`lifeos_update_attachment_card` with the complete user-owned YAML. That native\nwrite tool prepares a hidden-frontmatter preview and still requires the user\'s\nexplicit confirmation before commit. Do not emulate the operation with ordinary\nvisible-Markdown tools.\n',
350
+ 'lifeos-content/references/theme-dashboard.md': '# LifeOS Theme Dashboard — HTML generation rules\n\nUse this reference when the user asks to generate, refresh, rebuild or view a\ntheme dashboard / 主题 dashboard / 主题看板 / 主题仪表盘 / 主题驾驶舱 for a LifeOS\ntopic, project, area, resource or archive.\n\n## Contents\n\n- [Purpose and source model](#purpose-and-source-model)\n- [Output and path contract](#output-and-path-contract)\n- [Theme mode](#theme-mode)\n- [Source workflow](#source-workflow)\n- [Required modules](#required-modules)\n- [PARA-specific focus](#para-specific-focus)\n- [Visual design](#visual-design)\n- [Reusable skeleton](#reusable-skeleton)\n- [Write and verify](#write-and-verify)\n\n## Purpose and source model\n\nA theme dashboard is a sibling standalone HTML cockpit for a LifeOS theme/index\nnote. It is not a Markdown export, `.AI.md` page, landing page or Aino mini app.\nIt must expose the theme\'s identity and help the user decide what to do next.\n\nGround every statement in source notes. Do not invent metrics, deadlines, task\ncounts, health scores or conclusions.\n\n- The theme tag comes from the source note\'s `tags` Frontmatter and acts as the\n identity anchor. Show `Missing theme tag` instead of guessing one.\n- Theme index files may use `folderName` (`<folder>/<folder>.md`) or `readme`\n (`<folder>/<leaf-tag>.README.md`) naming.\n- `TaskListByTag`, `BulletListByTag` and `FileListByTag` provide the primary\n indexed task, fleeting-note and file signals. Use related theme/project/area/\n resource/archive lists when present.\n- Tags connect short records distributed through periodic notes. The theme\n folder holds durable research, meetings, drafts, plans and reference notes.\n- Periodic notes provide the time view; the theme note provides the subject\n workspace. A dashboard may show both, but the theme/index note remains its\n source.\n\nDo not generate a theme dashboard from a capture, daily/weekly note, meeting,\npasted article or other one-off source by default. Ask the user to confirm the\nsource theme/index note when the target is ambiguous.\n\n## Output and path contract\n\nGenerate one complete standalone `.html` file with:\n\n- inline CSS and no external CDN, remote font, image, analytics or network\n dependency;\n- semantic sections and readable class names;\n- JavaScript only for a concrete local interaction such as filtering;\n- a dense desktop grid and readable one-column mobile layout;\n- generated date, source note, theme tag, theme type and appearance mode;\n- one dedicated **Next actions / 下一步行动** section.\n\nDo not edit the source `.md`, sibling `.AI.md` or theme folder unless the user\nexplicitly requests those changes. Do not create `.Dashboard.md`.\n\nDerive the output by replacing the source Markdown extension:\n\n```text\n<dir>/<basename>.md -> <dir>/<basename>.html\n<dir>/<basename>.markdown -> <dir>/<basename>.html\n\n4 资源/学日语/学日语.md -> 4 资源/学日语/学日语.html\n1 项目/X/X.README.md -> 1 项目/X/X.README.html\n```\n\nWhen starting from `.AI.md`, use its `source:` note. Only remove `.AI` as a\nfallback when the matching theme/index note exists.\n\n## Theme mode\n\nMatch the current Obsidian or Aino appearance instead of choosing arbitrarily:\n\n1. Read `.obsidian/appearance.json`; use its `theme` field.\n2. If missing, check `.obsidian-mobile/appearance.json`.\n3. In Aino context, prefer an explicit Aino appearance/color-scheme setting.\n4. With no app setting, use `prefers-color-scheme` and say the page follows the\n system.\n\nSet `color-scheme: light dark`, define semantic variables for the default mode\nand provide alternate-mode variables with a media query. Show the resolved mode\nin a metadata pill. Do not make dashboards inconsistently fixed-dark or\nfixed-light unless the source app setting differs.\n\n## Source workflow\n\nBefore writing:\n\n1. Run `npx -y @life-os/cli config` when vault, PARA folders or index naming are\n unclear.\n2. Run `profile` and load the matching template reference for PARA or IPO. For\n GTD, do not force a theme dashboard unless the user selected a theme/index\n note. For OPC, switch to the separate `opc` skill.\n3. Locate the exact theme/index note with `search type=file` when needed.\n4. Confirm it belongs to a configured theme/PARA folder, follows an index naming\n convention, or clearly acts as a tagged topic index.\n5. Read the source note.\n6. Read its sibling `.AI.md` when present. Treat it as synthesis, not a\n replacement for source tags and indexed lists.\n7. Read an existing dashboard before overwriting and preserve useful manual\n structure unless the user requests full regeneration.\n\nUse evidence in this order:\n\n1. source Frontmatter: tag, title, type/category, status, outcome and dates;\n2. source body: goals, decisions, open questions and LifeOS query blocks;\n3. tag-indexed tasks, bullets, files and related-theme lists;\n4. sibling `.AI.md`, verified against source material when possible;\n5. same-folder durable notes;\n6. bounded relevant tag/keyword hits, including periodic-note evidence;\n7. useful user-authored structure from an existing dashboard.\n\nShow missing signals explicitly instead of filling empty sections with generic\nadvice.\n\n## Required modules\n\nInclude these modules unless the user asks for another layout:\n\n1. **Identity strip**: topic, tag, type, source, date and theme mode.\n2. **Current state**: what is reliably true now.\n3. **Key judgment**: the decision framing that matters most.\n4. **Indexed signals**: tasks, fleeting notes and files. Use counts only when\n supported; otherwise show clear empty states.\n5. **Next actions / 下一步行动**: existing commitments and grounded candidate\n moves, each with priority, time horizon, owner when known, evidence/link and\n missing validation.\n6. **Risks and blockers**: risk, impact, trigger signal and response.\n7. **Material map**: important notes, clusters, relations and why they matter.\n8. **Timeline / recent activity**: progress and checkpoints when dated evidence\n exists, otherwise a useful missing-signal state.\n9. **Evidence appendix**: compact source, tag, link and task references.\n\nUse one unified next-actions section. Do not create a separate recommendations\nor advisory panel for agent-synthesized moves. Candidate actions may include\ncontinue, pause, gather evidence, split the theme, change PARA type, archive,\nrefresh AI Wiki or create a task, but label weak evidence and a validation\nmethod.\n\n## PARA-specific focus\n\nInfer type from configured folders, path, Frontmatter and source wording. When\nuncertain, label it `Theme`.\n\n- **Project**: outcome, deadline, open/blocked work, progress, next milestone and\n completion criteria.\n- **Area**: responsibility, standard, cadence, drift, recurring risks and next\n review.\n- **Resource**: knowledge structure, important/unprocessed sources, reusable\n ideas and evidence that it should become an area or project.\n- **Archive**: historical conclusion, reusable assets, inactivity reason,\n recovery conditions and what remains searchable.\n- **Generic theme**: identity, context, high-signal material and relations to\n neighboring inputs, outputs or themes.\n\n## Visual design\n\nUse a quiet operational dashboard style, not a marketing page. Avoid hero copy,\ndecorative orbs, bokeh, stock imagery, large empty sections and fake product\nembellishment.\n\n- Use restrained multi-color semantic CSS variables; avoid a one-note purple,\n beige, dark-blue or brown palette.\n- Keep cards at `border-radius: 8px` or less.\n- Use compact readable typography and information-bearing visuals such as KPI\n cards, status pills, bars, timelines, tables and severity labels.\n- Keep current state, judgment, next actions and risks visible without deep\n scrolling.\n- Prevent overflow in cards, buttons and pills; use whitespace instead of cards\n nested inside cards.\n- Use clear empty states: `No source data found`, `No dated milestone found`,\n `No open task found` and `Missing theme tag`.\n- Do not scale body fonts with viewport width. Use bounded `clamp()` only where\n useful for titles.\n\n## Reusable skeleton\n\nStart from [`../assets/theme-dashboard-skeleton.html`](../assets/theme-dashboard-skeleton.html)\nwhen a baseline is useful. Read or copy the asset without loading its full HTML\ninto the general LifeOS workflow. Rewrite its placeholder content and adapt the\ninformation architecture, colors and modules to the actual source; the skeleton\nis not a fixed visual template.\n\n## Write and verify\n\nWrite the completed page to the derived sibling path:\n\n```bash\nnpx -y @life-os/cli create path="4 资源/学日语/学日语.html" content="<full html>" overwrite\n```\n\nDirect filesystem writing is acceptable for large dashboards when the runtime\nhas safe vault-scoped access. Preserve the same path rule.\n\nBefore reporting completion, verify:\n\n- the source is a confirmed theme/index note;\n- the theme tag or `Missing theme tag` is visible;\n- the output is `<source basename>.html`, including README-mode basenames;\n- the page opens standalone with no network dependency;\n- appearance follows the app setting or `prefers-color-scheme`;\n- current state, judgment, signals, next actions and risks appear near the top;\n- there is no separate advisory section outside Next actions;\n- no source `.md`, `.AI.md` or folder content changed unless requested;\n- generated date and source note are visible;\n- desktop and mobile layouts have no incoherent overlap or horizontal overflow.\n',
351
+ 'lifeos-onboarding/SKILL.md': "---\nname: lifeos-onboarding\ndescription: 'Initialize, take over, classify, or migrate a local Markdown folder into LifeOS through the `lifeos onboard` CLI workflow. Use for empty folders, existing knowledge bases, pasted or scattered material, choosing Memos/IPO/GTD/PARA, Topic-only requests, applying templates, changing profiles, or verifying a migration. These are consequential writes and require inspect, preview, explicit confirmation, bounded apply, and verification.'\n---\n\n# LifeOS Onboarding\n\nRead [`../lifeos/SKILL.md`](../lifeos/SKILL.md) first for host selection and\nshared safety. Onboarding plan/apply is CLI-only; Aino Mobile can inspect a\nprofile but cannot perform this workflow.\n\n## Inspect once, then route\n\nFor creation, import, paste, takeover or migration, start with the single\ninventory command:\n\n```bash\nnpx -y @life-os/cli onboard inspect --json\n```\n\nRead [`references/onboarding.md`](references/onboarding.md). Do not also run\nbroad `ls`, `find`, `config`, `profile` or template discovery unless inspection\nfails or omits a decision-critical fact.\n\nLoad only the matching reference:\n\n- Choose a model: [`references/template-selection.md`](references/template-selection.md)\n- Empty folder: [`references/from-scratch.md`](references/from-scratch.md)\n- Scattered material: [`references/migration.md`](references/migration.md)\n- Existing profile to another profile:\n [`references/template-migration.md`](references/template-migration.md)\n\nTemplate details:\n\n- Memos: [`references/template-memos.md`](references/template-memos.md)\n- IPO / Topic-only: [`references/template-ipo.md`](references/template-ipo.md)\n- GTD: [`references/template-gtd.md`](references/template-gtd.md)\n- PARA: [`references/template-para.md`](references/template-para.md)\n- OPC: use the separate `opc` Skill.\n\nPresent the normal order from easiest to hardest as Memos -> IPO -> GTD -> PARA\n-> OPC, but honor an explicit choice immediately. Normalize Topic-only to IPO.\n\n## Gate every mutation\n\nTreat onboarding as a resumable state machine:\n\n1. Inspect the folder.\n2. Ask one consequential question at a time.\n3. Run `onboard plan ... --json` and show creates, skips and conflicts.\n4. Obtain explicit confirmation for the exact profile, density and target.\n5. Run `onboard apply` or a confirmed `classify-apply` in bounded scope.\n6. Run `onboard verify --json` and report unresolved conflicts.\n\nNever overwrite existing bootstrap Agent Files automatically. Profiles manage\nroot `AGENTS.md`, `SOUL.md` and `STYLE.md`; do not generate singular `AGENT.md`\nor tool-specific `CLAUDE.md`. Create or edit optional `MEMORY.md` only after an\nexplicit remember request. Preserve attachments in place during inventory.\n\nWhen changing profiles, merge settings by field, preserve user context, exclude\ngenerated/system material, validate links and attachment pairs, and update the\nprofile manifest only after final verification.\n",
352
+ 'lifeos-onboarding/agents/openai.yaml': "interface:\n display_name: 'LifeOS Onboarding'\n short_description: 'Initialize or migrate a LifeOS knowledge base'\n default_prompt: 'Use $lifeos-onboarding to inspect and plan this knowledge base setup.'\n",
353
+ 'lifeos-onboarding/references/from-scratch.md': "# Starting from an Empty Folder\n\nUse this after the user chooses a template. The goal is a useful first working\nloop, not an empty directory tree.\n\n## Before applying\n\nAsk one question at a time:\n\n1. What real outcome, responsibility, topic, or action system should this\n knowledge base support first?\n2. What existing fact, note, task, or source should seed it?\n\nDo not demand a complete taxonomy. One real example is enough.\n\n## Apply the selected template\n\nPreview, obtain confirmation, apply, and verify through the onboarding workflow.\nUse `minimal` unless the user explicitly wants the full periodic template set.\n\n## Create the first useful content\n\n### Memos\n\n- Create or open today's daily note.\n- Add one real bullet or task under the configured Daily Record header.\n- Do not invent theme folders or tags before the user needs retrieval beyond time.\n- If full density is enabled, establish the first weekly review checkpoint.\n\n### PARA\n\n- Create one active Project when the user has a concrete outcome.\n- Create one Area only for an ongoing responsibility.\n- Create one Resource only when reusable source material already exists.\n- Put a new unprocessed item in Capture.\n- Put the user's first draft or synthesis in Express.\n- Add one concrete next action to the Project or current periodic note.\n\n### IPO\n\n- Add one real source to Input.\n- Create one Theme that states the current judgment or question.\n- Create an Output note only when a deliverable is genuinely intended.\n- Record the next transformation step from input to theme or theme to output.\n\n### GTD\n\n- Capture the user's real open loops in Inbox.\n- Clarify at least one item into an Action or Project.\n- Put non-actionable support material in Reference.\n- Establish the first review checkpoint.\n\n## Finish criteria\n\nOnboarding is complete when:\n\n- the template and Skill verify successfully;\n- the user can name the primary entry point;\n- at least one real note or task exists in that entry point;\n- the next capture or review action is clear.\n\nDo not generate fictional projects, responsibilities, sources, or tasks merely\nto make the knowledge base look populated.\n",
354
+ 'lifeos-onboarding/references/migration.md': '# Existing Folder and Material Migration\n\nUse this after a template has been previewed or applied and the workspace\ncontains existing notes, pasted text, or scattered attachments.\n\nIf those files already belong to a different LifeOS template, read\n`references/template-migration.md` first. It defines migration scope, settings\nmerging, semantic mappings, system-file exclusions, recovery, and completion.\nThis file supplies the bounded classification mechanics used inside that larger\nworkflow.\n\nMemos has no semantic destination folders, so do not run classification with\n`profile=memos`. Existing daily notes can remain where they are. If the user\nwants to organize historical material, first choose IPO, GTD, or PARA and\npreview that target structure. For Memos -> IPO / GTD / PARA upgrades, preserve\nthe periodic-note directory and add the target taxonomy; do not move old daily\nnotes. For OPC, switch to the separate `opc` skill and normally migrate into an\nOPC Blank Vault.\n\n## Contents\n\n- [Safety contract](#safety-contract)\n- [Build a bounded batch](#build-a-bounded-batch)\n- [Propose destinations](#propose-destinations)\n- [Save and validate the reviewed plan](#save-and-validate-the-reviewed-plan)\n- [Apply the confirmed safe subset](#apply-the-confirmed-safe-subset)\n- [Pasted text](#pasted-text)\n\n## Safety contract\n\n- Inventory and semantic classification are separate steps.\n- The agent proposes meaning; the service validates paths, collisions, and links.\n- Show destination, reason, evidence, and confidence for every item.\n- Require explicit user confirmation before moving any file.\n- Keep uncertain files in place until reviewed. For old material that the user\n wants out of the way, recommend the template\'s Archive directory.\n- Never overwrite a same-named target.\n\n## Build a bounded batch\n\n```bash\nnpx -y @life-os/cli onboard classify-input profile=para locale=en limit=30 --json\n```\n\nAlready managed template directories are excluded. Markdown previews are\nbounded. Attachments expose path, filename, size, and media type; binary contents\nare not extracted.\n\nFor Markdown, use filename, path, frontmatter, preview, and link context. For\nimages, PDF, DOC, PPT, audio, or video, use only filename, path, media type, and\nadjacent Markdown references unless a separate extraction tool supplied content.\n\n## Propose destinations\n\nUse `high`, `medium`, or `low` confidence:\n\n- **High**: explicit frontmatter, folder semantics, or clear content.\n- **Medium**: strong filename and contextual evidence.\n- **Low**: media type or weak naming only.\n\nKeep classifications faithful to the selected profile. In PARA, distinguish:\n\n- active outcome -> Projects;\n- ongoing responsibility -> Areas;\n- reusable reference -> Resources;\n- newly arrived and unprocessed -> Capture;\n- user-created draft or synthesis -> Express;\n- inactive or unclassifiable legacy material -> Archive.\n\n## Save and validate the reviewed plan\n\nAfter the user reviews a batch, save only their decisions under\n`.lifeos/classification-plans/<timestamp>.json`:\n\n```json\n{\n "root": ".",\n "profile": "para",\n "locale": "en",\n "suggestions": [\n {\n "source": "old-material.zip",\n "destinationDirectory": "4. Archive",\n "confidence": "low",\n "reason": "Inactive legacy material with no reliable topic evidence",\n "evidence": ["filename", "media-type"],\n "confirmed": true\n }\n ]\n}\n```\n\nThen validate without moving:\n\n```bash\nnpx -y @life-os/cli onboard classify-plan file=.lifeos/classification-plans/<timestamp>.json --json\n```\n\nResolve or skip every path escape, invalid destination, missing source, target\ncollision, or unsafe-link warning. Do not weaken validation to make a batch pass.\n\n## Apply the confirmed safe subset\n\n```bash\nnpx -y @life-os/cli onboard classify-apply file=.lifeos/classification-plans/<timestamp>.json --json\n```\n\nReport moved, unconfirmed, already-applied, and conflicted items separately.\nRepeat with the next bounded batch. Do not claim migration is complete while\nunclassified items remain.\n\n## Pasted text\n\nAsk whether pasted text is raw source, durable synthesis, or an intended output.\nCreate a Markdown note in the matching directory and preserve source attribution\nwhen provided. Do not place every paste in Capture: old unclassifiable imports\nbelong in Archive, while original writing belongs in Express or Output.\n',
355
+ 'lifeos-onboarding/references/onboarding.md': "# Knowledge Base Onboarding\n\nUse this workflow for an empty folder, an existing Markdown folder, a pasted\ncollection of notes, or a folder being taken over from another knowledge tool.\nThe folder does not need `.obsidian/`.\n\n## Contents\n\n- [Operating rules](#operating-rules)\n- [State machine](#state-machine)\n- [Recovery](#recovery)\n\n## Operating rules\n\n- Ask one consequential question at a time.\n- Inspect before recommending a template.\n- Preview before writing; require explicit confirmation before every apply step.\n- Preserve existing paths and attachments until the user confirms a migration batch.\n- Resume from `.lifeos/onboarding.json` when onboarding was started earlier.\n- Do not treat attachment inventory as content extraction.\n- Use `onboard inspect --json` as the single initial inventory. Do not duplicate\n it with `ls`, `find`, `config`, `profile`, or `onboard templates` unless the\n inspection failed or a specific required fact is missing.\n- Before presenting the first preview, the normal command budget is two calls:\n `onboard inspect --json`, then `onboard plan ... --json`.\n\n## State machine\n\n1. **Inspect**\n\n ```bash\n npx -y @life-os/cli onboard inspect --json\n ```\n\n Summarize Markdown count, attachment types, existing LifeOS metadata, Skill\n status, and detected profile. Do not dump a long file list. Run\n `onboard status --json` separately only when inspection reports an existing\n onboarding state or the user is resuming an interrupted setup.\n\n2. **Understand the starting point**\n\n Determine whether the user is starting from scratch, taking over an existing\n folder, or pasting/importing material in batches. If this is not obvious from\n the inventory, ask only that question.\n\n If the inventory detects one LifeOS profile and the user requests another,\n read `references/template-migration.md` before previewing. Do not treat an\n existing profiled vault like a blank onboarding target.\n\n3. **Choose a template**\n\n Read `references/template-selection.md`. Explain one recommendation and the\n closest alternative in plain language. If the user selects OPC, switch to the\n separate `opc` skill. If the user rejects formal frameworks or only wants to\n organize by topic, offer **Topic-only mode** and execute it as IPO. Do not\n create a separate profile or directory structure for this label. If the user\n already selected Topic-only, skip template discovery and go directly from\n inspection to an IPO onboarding plan. If the user has no stable capture habit\n or only wants chronological bullets and tasks, recommend Memos. Memos does not\n accept bulk classification because it has no taxonomy destinations.\n\n4. **Choose density and language**\n\n Use `minimal` by default. For Memos, prefer `full` when the user wants review\n pages immediately; Memos `minimal` still includes its essential empty Daily\n template. Use the user's writing language for generated folders, starter\n notes, and root Agent Files; this does not change the English Skill files\n installed under `.agents/skills/`.\n\n5. **Preview**\n\n ```bash\n npx -y @life-os/cli onboard plan profile=para density=minimal locale=en --json\n ```\n\n Show created, skipped, and conflicting paths. In JSON, `conflictEntries`\n includes the target content for conflicting files so an agent can prepare a\n field-level settings diff; it does not authorize replacement. Explain\n conflicts before asking for confirmation. Never use `apply` merely because\n the plan looks safe to you.\n\n Every profile plan includes exactly these root bootstrap Agent Files:\n - `AGENTS.md` — entry point and working rules;\n - `SOUL.md` — assistant identity;\n - `STYLE.md` — communication style;\n\n `MEMORY.md` is optional and free-form. Do not create it during onboarding;\n the agent creates it on the user's first explicit remember request. Never\n template-upgrade or rewrite an existing `MEMORY.md`. The bootstrap files'\n profile-specific sections must match Memos, IPO, GTD, or PARA. Do not add\n `AGENT.md` or `CLAUDE.md`.\n\n6. **Apply after explicit confirmation**\n\n ```bash\n npx -y @life-os/cli onboard apply profile=para density=minimal locale=en --json\n npx -y @life-os/cli onboard verify --json\n ```\n\n Report partial results honestly. Existing conflicting files are preserved;\n other safe entries may still be created. An existing `MEMORY.md` is not an\n onboarding conflict because it is not managed by the template.\n\n7. **Continue with content**\n - For existing files or pasted material, read `references/migration.md`.\n - For a source-profile to target-profile conversion, follow\n `references/template-migration.md` and keep its migration record current.\n - For an empty folder, read `references/from-scratch.md`.\n\n8. **Finish**\n\n Verify the profile, metadata, Skill, and at least one real entry point. Tell\n the user what was created, what stayed in place, and what remains unclassified.\n\n## Recovery\n\n- Re-run `onboard status` after interruption.\n- Re-run `onboard plan` before retrying; it is idempotent and reports new conflicts.\n- Do not delete a partially created structure to simulate rollback.\n- Do not overwrite a conflict unless the user separately requests and reviews\n that exact replacement.\n",
356
+ 'lifeos-onboarding/references/template-gtd.md': '# GTD Template Profile\n\nUse this reference when `lifeos profile` returns `gtd`, or when the vault is\norganised around inbox, next actions, waiting, someday and review lists.\n\n## Model\n\nGTD is an action-management profile, not primarily a theme-note profile:\n\n- **Inbox / 收件箱**: unclarified input.\n- **Next Actions / 下一步行动**: concrete executable tasks.\n- **Waiting For / 等待事项**: delegated or externally blocked tasks.\n- **Someday Maybe / 将来可能**: deferred ideas and options.\n- **Projects / 项目**: multi-step outcomes.\n- **Review / 复盘**: trusted-system maintenance.\n- **Reference / 参考**: non-actionable support material.\n- **Archive / 归档**: inactive or unclassifiable legacy material.\n\nDefault English structure:\n\n```text\n0. Periodic Notes\n1. Inbox\n2. Actions\n3. Projects\n4. Reference\n5. Reviews\n6. Archive\n```\n\nInbox is intrinsic to GTD: it contains new items waiting for clarification. It\nis not a generic migration fallback.\n\nCommon tags include `#gtd/next`, `#gtd/waiting`, `#gtd/someday` and context tags\nsuch as `#ctx/computer`. Reuse existing tag vocabulary instead of inventing a new\none.\n\n## Source Workflow\n\n1. Run `lifeos profile`.\n2. Read `TASK.md` when present; it is usually the execution entry.\n3. Read the `Actions`, `Projects`, `Reference`, `Reviews`, and `Inbox` folders,\n plus any waiting/someday lists or tags present inside them.\n4. Query tasks by GTD tags and context tags.\n5. Use project notes only when an action clearly belongs to a multi-step outcome.\n\n## Dashboard Focus\n\nFor GTD HTML dashboards, do not force the theme-dashboard model unless the user\nexplicitly selected a theme/index note. Use the selected list note as the source\nand write a sibling `.html` file:\n\n```text\nTASK.md -> TASK.html\nNext Actions.md -> Next Actions.html\nWeekly Review.md -> Weekly Review.html\n```\n\nRequired modules:\n\n- inbox state: unclarified items and oldest/stale signals;\n- next actions by context;\n- waiting-for items with owner and follow-up point when known;\n- someday/maybe candidates that need review or pruning;\n- projects with missing next actions;\n- review checklist;\n- next actions / 下一步行动 for maintaining the system;\n- risks: stale inbox, blocked waiting items, actions without context, projects\n without next actions.\n\n## Do Not\n\n- Do not present GTD list dashboards as PARA theme dashboards.\n- Do not invent owners, deadlines, contexts or project links.\n- Do not create a separate recommendations section outside `Next actions` /\n `下一步行动`.\n',
357
+ 'lifeos-onboarding/references/template-ipo.md': '# IPO Template Profile\n\nUse this reference when `lifeos profile` returns `ipo`, or when the vault is\norganised around Input -> Theme -> Output.\n\n## Model\n\nIPO treats knowledge work as a production line:\n\n- **Input / 输入**: raw material, clips, feedback, meeting notes and references.\n- **Theme / 主题**: processing layer where material is interpreted, clustered and\n turned into judgment.\n- **Output / 输出**: shipped or shippable artifacts such as articles, proposals,\n scripts, course material, documentation or product copy.\n- **Archive / 归档**: inactive or unclassifiable legacy material that should\n remain searchable without polluting the active pipeline.\n\nDefault English structure:\n\n```text\n0. Periodic Notes\n1. Input\n2. Themes\n3. Output\n4. Archive\n```\n\nThe theme note is the operating center. It should explain how input evidence\nsupports judgments and which outputs can be produced next.\n\n## Source Workflow\n\n1. Run `lifeos config` and `lifeos profile`.\n2. Read the theme/index note under the configured theme folder.\n3. Read linked or tagged input material that feeds the theme.\n4. Read output notes that already reference the theme.\n5. Read sibling `.AI.md` and existing HTML dashboard when present.\n\nKeep source gathering bounded: prefer linked files, theme tags and same-folder\nmaterial over broad keyword sweeps.\n\n## Dashboard Focus\n\nUse `../../lifeos-content/references/theme-dashboard.md` for the HTML path and visual contract, then\nshape the modules around the IPO flow:\n\n- input queue: important raw materials and their source;\n- processing state: what has been distilled, what still needs judgment;\n- key judgments: durable interpretations produced by the theme;\n- output candidates: concrete pieces that can be drafted or shipped;\n- next actions / 下一步行动: gather, distill, outline, draft, publish or archive;\n- risks: stale input, weak evidence, unclear audience, blocked output path;\n- material lineage: input -> theme judgment -> output.\n\n## Do Not\n\n- Do not convert raw input directly into finished output without showing the\n theme-level judgment.\n- Do not treat the input folder as a permanent topic workspace.\n- Do not use Input as a generic dump for old imports; use Archive when their\n role in the pipeline cannot be established.\n- Do not invent audience signals, publication dates or output status.\n',
358
+ 'lifeos-onboarding/references/template-memos.md': "# Memos Template\n\nUse this reference when `lifeos profile` returns `memos`, or when the user wants\nLogseq-, flomo-, or usememos-style chronological capture without PARA or themes.\n\n## Structure\n\n```text\n0. Periodic Notes\n└── Templates\n ├── Daily.md\n ├── Weekly.md\n ├── Monthly.md\n ├── Quarterly.md\n └── Yearly.md\n```\n\nThe daily template contains only the configured Daily Record heading. Write\nordinary bullets and Markdown tasks directly below it. Full density keeps four\nreview queries in longer-period templates:\n\n- `TaskDueListByTime`\n- `TaskRecordListByTime`\n- `BulletRecordListByTime`\n- `TaskDoneListByTime`\n\nDo not add project, area, or theme snapshots while the vault remains Memos.\n\n## Operating loop\n\n1. Capture bullets and tasks in today's daily note.\n2. Use task queries for open and completed work.\n3. Review the recorded bullets and tasks weekly.\n4. Add a taxonomy only after retrieval by time is no longer enough.\n\n## Upgrade without losing history\n\nMemos is a foundation, not a temporary format. IPO, GTD, and PARA use the same\nMarkdown tasks and periodic notes, so old daily notes stay in place.\n\nRead `references/template-migration.md` before changing an existing Memos vault.\nIt defines scope, settings-field merging, migration records, and verification.\n\n1. Run `onboard inspect --json`.\n2. Choose one target based on the current bottleneck.\n3. Preview `onboard plan profile=<ipo|gtd|para> ... --json`.\n4. Explain every conflict, especially `.lifeos/settings.json` and README.\n5. Do not apply over existing conflicting settings. Merge only the reviewed\n target paths and flags, preserving the existing periodic-note path and custom\n templates.\n6. Begin classifying new material under the target model. Move old material only\n in confirmed batches when that creates real retrieval value.\n\nFor OPC, use the separate `opc` skill and normally migrate selected material to\nan OPC Blank Vault. Do not approximate OPC by adding folders to Memos.\n\n## Moving back to Memos\n\nStop creating new theme/action material and return capture to daily notes. Keep\nthe old folders in place or archive them; deleting them can break links and\nhistorical queries. A template change is a workflow migration, not a reversible\nUI toggle.\n",
359
+ 'lifeos-onboarding/references/template-migration.md': '# Template-to-Template Migration\n\nUse this when the detected source profile differs from the requested target\nprofile, or when the user says switch, upgrade, convert, or migrate templates.\nThis is an agent-led, reviewed migration—not a template toggle.\n\nSupported here: Memos, IPO / Topic-only, GTD, and PARA. For OPC, load the\nseparate `opc` skill and normally migrate selected material into an OPC Blank\nVault.\n\n## Contents\n\n- [Migration contract](#migration-contract)\n- [Create a migration record](#create-a-migration-record)\n- [Inspect and preview](#inspect-and-preview)\n- [Merge settings by field](#merge-settings-by-field)\n- [Migrate Agent Files](#migrate-agent-files-without-losing-user-context)\n- [Apply structure before moving content](#apply-structure-before-moving-content)\n- [Classify by meaning](#classify-by-meaning-not-source-folder)\n- [Exclude system and generated material](#exclude-system-and-generated-material)\n- [Links and attachments](#links-and-attachments)\n- [Execute in bounded batches](#execute-in-bounded-batches)\n- [Verify before changing the profile manifest](#verify-before-changing-the-profile-manifest)\n- [Recovery and reversal](#recovery-and-reversal)\n\n## Migration contract\n\nBefore writing, establish these facts:\n\n1. **Source profile** — use the profile reported by `onboard inspect --json`.\n If it is `custom` or `unknown`, stop calling the operation a profile\n conversion; inventory the actual folders and settings first.\n2. **Target profile** — choose one model only. Topic-only maps to IPO.\n3. **Scope** — ask one consequential question and record one of:\n - `new-content-only`: add the target workflow; leave history where it is;\n - `selected-history` (default): migrate only material that creates immediate\n retrieval or execution value;\n - `full-history`: keep batching until every eligible item is moved,\n explicitly retained, or recorded as blocked.\n4. **Recovery checkpoint** — for `full-history`, require the user to confirm a\n current vault backup, version-control checkpoint, or sync snapshot before any\n move. A classification plan is an audit trail, not a backup.\n\nDo not ask the user to choose scope again when they already stated it.\n\n## Create a migration record\n\nKeep a resumable record at:\n\n```text\n.lifeos/migrations/<timestamp>-<source>-to-<target>.json\n```\n\nUse this schema:\n\n```json\n{\n "schemaVersion": 1,\n "sourceProfile": "memos",\n "targetProfile": "para",\n "scope": "selected-history",\n "status": "planned",\n "settingsChanges": [{ "key": "usePARANotes", "from": false, "to": true }],\n "classificationPlans": [],\n "moves": [],\n "conflicts": [],\n "unclassifiedCount": 0,\n "startedAt": "<ISO timestamp>"\n}\n```\n\nAllowed statuses are `planned`, `structure-applied`, `content-migrating`,\n`verified`, and `blocked`. Do not write the complete settings object into this\nrecord: it may contain activation, calendar, sync, or AI credentials. Record\nonly reviewed template-structure fields and file movements.\n\n## Inspect and preview\n\nRun the normal bounded path:\n\n```bash\nnpx -y @life-os/cli onboard inspect --json\nnpx -y @life-os/cli onboard plan profile=<target> density=<minimal|full> locale=<locale> --json\n```\n\nThe JSON plan includes `conflictEntries`. A conflicting file entry retains the\ntarget content so the agent can compare it with the current file; `onboard\napply` still never overwrites that conflict.\n\nShow the user:\n\n- source profile, target profile, and scope;\n- directories and files that can be added safely;\n- conflicting paths;\n- the settings fields proposed for change;\n- the target sections for `AGENTS.md`, `SOUL.md`, and `STYLE.md`;\n- whether a free-form `MEMORY.md` already exists (it remains unmanaged);\n- whether historical files will move in this phase.\n\nRequire explicit confirmation before applying structure or editing settings.\n\n## Merge settings by field\n\nRead the current `.lifeos/settings.json`. Use the target settings content from\nthe plan\'s `.lifeos/settings.json` `conflictEntries` item as a source of desired\ntemplate values, not as a replacement file.\n\nStart from the current settings and merge only reviewed template fields:\n\n- workflow flags such as `usePARANotes`, `usePARAAdvanced`, `useThemeNotes`, and\n `useThemeAdvanced`;\n- target taxonomy paths such as capture, project, area, resource, archive,\n express, input, theme, and output paths;\n- target taxonomy template paths only when the target workflow needs them.\n\nPreserve by default:\n\n- `periodicNotesPath`, every periodic path format, and every periodic template\n path;\n- daily, project, area, theme, and habit headers;\n- locale, week start, custom task statuses, and user naming conventions;\n- every AI, model, activation, calendar, sync, account, and unrelated UI field;\n- source-profile path fields while old folders still contain active material.\n\nIf the user explicitly wants target periodic defaults, present those fields as\na separate decision. Never leak unchanged sensitive settings in the diff or\nmigration record.\n\nUse the host agent\'s exact file-edit capability after confirmation. If exact\nediting is unavailable, stop and ask the user to make the field changes; do not\nreconstruct and overwrite the complete settings file with `create overwrite`.\n\n## Migrate Agent Files without losing user context\n\nThe target onboarding plan includes exactly three root bootstrap Agent Files:\n`AGENTS.md`, `SOUL.md`, and `STYLE.md`. If any already exist, they appear in\n`conflictEntries`; `onboard apply` preserves them. `MEMORY.md` is optional,\nfree-form, and outside template management.\n\nAfter confirmation, compare each existing file with its target content:\n\n- Keep `AGENTS.md` as the entry point. Preserve user-authored working rules and\n make sure it points to `SOUL.md`, `STYLE.md`, and `MEMORY.md`. Replace only\n the old profile operating-model section with the target profile section.\n- Preserve custom identity constraints in `SOUL.md`; replace only the old\n profile identity section.\n- Preserve custom voice and formatting preferences in `STYLE.md`; replace only\n the old profile expression section.\n- If `MEMORY.md` exists, keep it byte-for-byte unchanged during migration.\n Change it only for a separate, explicit user request to update durable memory;\n never add profile scaffolding or impose headings.\n\nDo not create `AGENT.md` or `CLAUDE.md`. If a file mixes generated and\nuser-authored text so tightly that the boundary is unclear, show a focused diff\nand ask before editing it.\n\n## Apply structure before moving content\n\nAfter confirmation, run target `onboard apply`. It may create safe directories,\ntemplates, entry pages, and missing bootstrap Agent Files while preserving\nconflicts. Then apply the reviewed settings and bootstrap Agent File merges.\n\nKeep the existing `.lifeos/template-profile.json` during structural and content\nmigration. Its old value makes the in-progress state visible. Update it to the\ntarget content from `conflictEntries` only after target settings, directories,\nentry points, bootstrap Agent Files, and queries have been verified.\n\nSet the migration record to `structure-applied` before classifying history.\n\n## Classify by meaning, not source folder\n\nFolder names are evidence, not decisions. A PARA Project does not automatically\nbecome a GTD Project, and an IPO Theme does not automatically become a PARA\nResource. Read enough of each item to identify its current role.\n\n### Target IPO / Topic-only\n\n| Meaning | Default destination |\n| --------------------------------------------------------------- | ------------------- |\n| Raw source, evidence, clipping, or unprocessed import | Input |\n| Durable judgment, topic synthesis, or maintained subject page | Themes |\n| Article, proposal, decision memo, or other intended deliverable | Output |\n| Inactive or unclassifiable legacy material | Archive |\n\nKeep Markdown tasks in their existing notes or periodic notes unless moving the\nowning note is useful; IPO has no generic action folder.\n\n### Target GTD\n\n| Meaning | Default destination |\n| --------------------------------------------------------- | ------------------------------------- |\n| New or unclear open loop | Inbox |\n| Executable next action, waiting-for item, or someday item | Actions, with reviewed GTD tags |\n| Multi-step outcome requiring more than one action | Projects |\n| Non-actionable supporting information | Reference |\n| Review checklist or system review record | Reviews or the matching periodic note |\n| Inactive material | Archive |\n\nDo not split tasks out of a project note merely to fill the Actions folder. The\nproject note remains the source of truth; action indexes may aggregate tasks.\n\n### Target PARA\n\n| Meaning | Default destination |\n| ---------------------------------------------- | ------------------- |\n| Newly arrived and not yet processed | Capture |\n| Active outcome with a finish condition | Projects |\n| Ongoing responsibility or standard to maintain | Areas |\n| Reusable reference or subject knowledge | Resources |\n| User-authored synthesis or deliverable | Express |\n| Inactive or unclassifiable legacy material | Archive |\n\n### Target Memos\n\nDo not use `classify-*`; Memos has no taxonomy destinations. Keep all old\nfolders and links. Disable or stop using the taxonomy only after confirmation,\npreserve periodic notes, and route new capture to daily notes. Old folders may\nbe archived later in separately reviewed batches, but they are not deleted as\npart of switching to Memos.\n\n## Exclude system and generated material\n\nDo not automatically classify:\n\n- `.lifeos/`, `.obsidian/`, `.agents/`, plugin directories, or hidden files;\n- root README / task entry pages belonging to the source workflow;\n- template files and template directories;\n- generated query/index pages, `.AI.md` pages, or HTML dashboards;\n- migration and classification plan files.\n\nPreserve these until the target workflow works. Regenerate target indexes,\nAI Wiki pages, or dashboards from their sources instead of treating generated\noutput as ordinary imported knowledge. Move a system file only after a separate,\npath-specific confirmation.\n\n## Links and attachments\n\nBefore confirming a move, inspect standard Markdown links, Wikilinks, embeds,\nand attachment references. The classifier rejects known unsafe moves; never\nweaken or bypass that validation.\n\nFor a linked item choose one reviewed strategy:\n\n1. **Keep in place** and create a target index note that links to it. This is the\n safest default.\n2. **Move a self-contained bundle** of a note and its exclusively owned\n attachments, then update every inbound and outbound reference with exact\n edits and verify them.\n3. **Defer as blocked** in the migration record when ownership or links are\n unclear.\n\nShared attachments remain in place. An attachment follows its primary note only\nwhen that ownership is clear; filename and media type alone are insufficient.\nDo not claim to understand binary content without an extraction tool.\n\n## Execute in bounded batches\n\nFor `selected-history` or `full-history`, follow `references/migration.md`:\n\n1. Produce at most 30 candidates with `onboard classify-input`.\n2. Filter system/generated material.\n3. Propose destinations with reason, evidence, and confidence.\n4. Save the reviewed classification plan and add its path to the migration\n record.\n5. Run `classify-plan`; resolve or defer every conflict.\n6. Run `classify-apply` only after explicit confirmation.\n7. Append successful source/destination pairs to `moves`; update conflicts and\n remaining count.\n8. Repeat only while the selected scope requires it.\n\nSet status to `content-migrating` when the first batch begins. If work stops,\nleave the record resumable and report the exact next batch or conflict.\n\n## Verify before changing the profile manifest\n\nDo not treat folder creation as completion. Verify:\n\n- current periodic notes still resolve to the original files;\n- target directories and settings fields match;\n- the target daily entry point opens or can be created;\n- target task and review queries work;\n- moved files exist only at the confirmed targets;\n- links and attachments used by moved files still resolve;\n- every in-scope item is moved, explicitly retained, or recorded as blocked;\n- no secret-bearing setting was copied into a migration or classification file.\n\nAfter those checks and user confirmation, update\n`.lifeos/template-profile.json` to the target content from the onboarding plan,\nthen run:\n\n```bash\nnpx -y @life-os/cli profile --json\nnpx -y @life-os/cli onboard verify --json\n```\n\nSet the migration record to `verified`, add `completedAt`, and report moved,\nretained, blocked, and unclassified counts separately. `verified` means the\nselected scope is complete; it does not imply every historical file moved when\nscope was `new-content-only` or `selected-history`.\n\n## Recovery and reversal\n\n- Resume from the migration record and its referenced classification plans.\n- Never delete a partially created target structure to simulate rollback.\n- To reverse confirmed file moves, build a separate reverse plan from the\n recorded `moves`, validate it against the original profile, and ask for fresh\n confirmation.\n- Revert only the recorded template settings fields. Do not overwrite the full\n settings file with a stale backup.\n- If links were edited after a move, review those edits before reversing paths.\n\nMark the migration `blocked` only when the unresolved condition cannot be\nhandled safely without user input or an external state change. Otherwise leave\nit in progress with a concrete next action.\n',
360
+ 'lifeos-onboarding/references/template-para.md': "# PARA Template Profile\n\nUse this reference when `lifeos profile` returns `para`, or when the vault is\nclearly organised around projects / areas / resources / archives.\n\n## Model\n\nThe LifeOS PARA profile keeps capture and expression around the core PARA model:\n\n- **Capture / 捕获**: newly arrived material that has not been processed yet.\n- **Projects / 项目**: active outcomes with deadlines or completion criteria.\n- **Areas / 领域**: ongoing responsibilities and standards.\n- **Resources / 资源**: reusable reference material and topics of interest.\n- **Archives / 存档 / 归档**: inactive or completed material.\n- **Express / 表达**: the user's own drafts, synthesis, and output.\n- **Periodic notes / 周期笔记**: time-based capture, planning and review.\n\nDefault English structure:\n\n```text\n-1. Capture\n0. Periodic Notes\n1. Projects\n2. Areas\n3. Resources\n4. Archive\n5. Express\n```\n\nDo not create a generic Inbox for PARA. During migration, recommend Archive for\nold material that cannot be classified reliably. Reserve Capture for new,\nunprocessed material.\n\nTheme tags connect periodic capture back to project / area / resource index\nnotes. Prefer the configured paths from `lifeos config` over hard-coded folder\nnames.\n\n## Source Workflow\n\n1. Run `lifeos config` and `lifeos profile`.\n2. Locate the project / area / resource / archive index note.\n3. Read the source note, sibling `.AI.md` if present, same-folder material and\n relevant recent periodic notes.\n4. Preserve existing useful dashboard / AI Wiki structure when refreshing.\n\n## Dashboard Focus\n\nFor PARA theme dashboards, use\n`../../lifeos-content/references/theme-dashboard.md` and emphasise:\n\n- theme identity and tag;\n- current state and key judgment;\n- indexed tasks, fleeting notes and files;\n- next actions / 下一步行动;\n- risks and blockers;\n- material map and recent activity.\n\nAdjust focus by category:\n\n- Project: outcome, deadline, open work, blocker and next milestone.\n- Area: standard, cadence, drift, recurring risk and next review point.\n- Resource: knowledge structure, unread material and reuse potential.\n- Archive: historical conclusion, reusable assets and recovery condition.\n\n## Do Not\n\n- Do not treat one-off captures or daily notes as theme dashboards unless the\n user explicitly asks.\n- Do not invent theme tags, deadlines, task counts or progress scores.\n- Do not create a separate recommendations section outside `Next actions` /\n `下一步行动`.\n",
361
+ 'lifeos-onboarding/references/template-selection.md': "# Template Selection\n\nRead this before recommending a structure. Prefer the simplest model that\nmatches how the user retrieves and advances work.\n\nStart from the user's current bottleneck, not from the most complete template.\nIf they do not yet have a stable capture habit, recommend Memos instead of PARA.\n\nPresent templates in this default order, from easiest to hardest:\n\n```text\nMemos -> IPO -> GTD -> PARA -> OPC\n```\n\nThis is a complexity ladder, not a mandatory migration route. A user with a\nclear bottleneck may skip directly to the matching template.\n\n## Contents\n\n- [Memos](#memos)\n- [IPO](#ipo)\n- [GTD](#gtd)\n- [PARA](#para)\n- [OPC](#opc)\n- [Decision shortcut](#decision-shortcut)\n- [Complexity and upgrade path](#complexity-and-upgrade-path)\n\n## Memos\n\nChoose Memos when the first need is frictionless chronological capture: daily\nbullets, tasks, and periodic review without a theme taxonomy.\n\n```text\n0. Periodic Notes\n```\n\nMemos is the lowest-maintenance starting point and is especially suitable for\npeople coming from Logseq, flomo, or usememos. It is not a dead end. Existing\ndaily notes stay in place when the user later adds IPO, GTD, or PARA folders.\nUse `density=full` when the user wants weekly, monthly, quarterly, and yearly\nreview queries immediately; `minimal` creates only the empty daily-record\ntemplate.\n\n## IPO\n\nChoose IPO when the user describes a pipeline from source material through\ninterpretation to published or delivered output.\n\nAlso present IPO as **Topic-only mode** when the user does not want to learn or\nchoose a formal organization method and simply wants to organize knowledge by\ntopic. Topic-only is a user-facing name for IPO, not a separate profile or\ndirectory structure. If the user says \"just organize it by topic,\" select IPO.\n\n```text\n0. Periodic Notes\n1. Input\n2. Themes\n3. Output\n4. Archive\n```\n\nPut raw evidence in Input, durable synthesis in Themes, deliverables in Output,\nand inactive or unclassifiable legacy material in Archive.\n\n## GTD\n\nChoose GTD when the main problem is trusted action management: clarifying new\nitems, identifying next actions, tracking projects, and reviewing the system.\n\n```text\n0. Periodic Notes\n1. Inbox\n2. Actions\n3. Projects\n4. Reference\n5. Reviews\n6. Archive\n```\n\nInbox is a GTD method stage, not a universal LifeOS folder. Use it for new,\nunclarified items. Use Archive for inactive or unclassifiable legacy material.\n\n## PARA\n\nChoose PARA when the user thinks in active outcomes, ongoing responsibilities,\nreusable topics, and inactive material.\n\n```text\n-1. Capture\n0. Periodic Notes\n1. Projects\n2. Areas\n3. Resources\n4. Archive\n5. Express\n```\n\n- Capture is for newly arrived, unprocessed material.\n- Express is for the user's own drafts, synthesis, and output.\n- Archive is the fallback for old imported material that cannot be classified\n reliably; do not misuse Capture as a generic migration dump.\n\n## OPC\n\nChoose OPC for a one-person company with explicit input, output, department,\nCEO cockpit, memory, and reusable-asset workflows. Load the separate `opc`\nskill; do not approximate OPC with PARA onboarding.\n\n## Decision shortcut\n\n- “I just need to write things down every day.” -> Memos.\n- “What input becomes which output?” -> IPO.\n- “I only want to organize things by topic.” -> Topic-only mode (IPO).\n- “What is the next physical action?” -> GTD.\n- “What outcome or responsibility does this support?” -> PARA.\n- “How does my one-person company operate?” -> OPC.\n\nWhen two models fit, recommend one and explain the closest alternative. Do not\ncreate a hybrid directory tree during onboarding.\n\n## Complexity and upgrade path\n\nUse this order when the user is unsure:\n\n1. No stable capture habit -> Memos.\n2. Source material must become synthesis or deliverables -> IPO.\n3. Trusted actions and follow-ups are the bottleneck -> GTD.\n4. Projects, ongoing responsibilities, and reusable knowledge all matter -> PARA.\n5. A real one-person business needs departments and a CEO cockpit -> OPC.\n\nTemplates are not switchable skins. They share Markdown and periodic notes, but\ntheir folders and semantics differ:\n\nFor an actual conversion, follow `references/template-migration.md`; the rules\nbelow describe routing, not a complete execution plan.\n\n- Memos -> IPO / GTD / PARA is additive: keep periodic notes, preview the target\n structure, then add folders and settings. Do not move old daily notes.\n- IPO / GTD / PARA conversions require semantic reclassification. Never present\n them as a settings toggle.\n- Any profile -> OPC should normally start from OPC Blank Vault and migrate\n selected material under the separate `opc` skill.\n- Moving back to Memos means stopping use of the taxonomy, not deleting its old\n folders. Preserve links and history.\n\nNever copy a Blank Vault's `.lifeos/settings.json` over an existing vault. It\nwould overwrite custom paths and settings. Inspect, preview, and apply only the\nneeded target structure.\n",
362
+ 'lifeos-today/SKILL.md': "---\nname: lifeos-today\ndescription: 'Build and act on LifeOS time-oriented views through the `lifeos` CLI without Aino Desktop. Use when the user asks what to do today, wants AI Today, overdue or due tasks, timed work, completed-today evidence, recent work, daily/weekly/monthly/quarterly/yearly notes, capture into a periodic note, or a weekly review. Do not use for Workflow/PARA board analysis or vault onboarding.'\n---\n\n# LifeOS Today\n\nRead [`../lifeos/SKILL.md`](../lifeos/SKILL.md) first for host selection, vault\nresolution and write safety.\n\n## Start from the grounded view\n\nFor “what should I do today?”, use one bounded command rather than assembling a\nbrief from broad scans:\n\n```bash\nnpx -y @life-os/cli today --json\n```\n\nUse `date=YYYY-MM-DD` only when the user names another date. Verify the returned\n`sources`, distinguish overdue from due-today work, and recommend at most three\nordered next steps. Completed work is based on completion date, not due date.\n\nUse these narrower commands when the user asks for a specific slice:\n\n```bash\nnpx -y @life-os/cli tasks due=today --json\nnpx -y @life-os/cli tasks due=overdue --json\nnpx -y @life-os/cli tasks done completed=this-week --json\nnpx -y @life-os/cli recent range=this-week --json\nnpx -y @life-os/cli review:weekly --json\n```\n\n`due=` filters due dates. It cannot answer what was completed in a period; use\n`completed=` or `review:weekly` for completion evidence.\n\n## Work with periodic notes\n\nRead [`references/periodic-notes.md`](references/periodic-notes.md) before\ncreating, reading, appending to or reviewing daily, weekly, monthly, quarterly\nor yearly notes. Resolve the actual path and section through LifeOS rather than\nguessing either one.\n\nShow a source-backed brief or review before proposing a write. Append a plan,\nreview or synthesized conclusion only after the user approves the concrete\ncontent and target section.\n\n## Boundaries\n\n- Use [`../lifeos-board/SKILL.md`](../lifeos-board/SKILL.md) for Workflow/PARA\n columns, theme workspaces or flow bottlenecks.\n- Use [`../lifeos-onboarding/SKILL.md`](../lifeos-onboarding/SKILL.md) when the\n vault or periodic structure must first be initialized or migrated.\n- Do not require Aino Desktop: `today`, `tasks`, `recent` and `review:weekly`\n reproduce the relevant AI Home evidence headlessly.\n",
363
+ 'lifeos-today/agents/openai.yaml': "interface:\n display_name: 'LifeOS Today'\n short_description: 'Plan today and review time-based LifeOS work'\n default_prompt: 'Use $lifeos-today to build a grounded plan for today.'\n",
364
+ 'lifeos-today/references/periodic-notes.md': '# Periodic notes and reviews\n\nUse this reference for daily capture, weekly/monthly/quarterly/yearly notes,\ntime-based tasks, section-aware appends and reviews.\n\n## Resolve before writing\n\nNever construct a periodic-note path by hand. Start with the period resolver:\n\n```bash\nnpx -y @life-os/cli daily\nnpx -y @life-os/cli weekly date=2026-08-13\n```\n\nFor daily notes, the CLI honors Obsidian Daily Notes `folder`, `format` and\n`template` settings before LifeOS fallbacks. Other periods use the configured\nLifeOS base path, format and template. Locale-sensitive weekday and month tokens\nfollow `locale=` or the system locale.\n\nUse `<period>:create` to render a missing note from its configured template.\n`<period>:append` creates the note from that template when it is missing. The\nshared renderer expands LifeOS date/conditional/snapshot variables and preserves\nunknown LifeOS query blocks for the plugin or Aino to render.\n\n## Capture into the correct section\n\n1. Resolve the target with `daily`, `weekly`, `monthly`, `quarterly` or\n `yearly`; pass `date=YYYY-MM-DD` for another date.\n2. Read the note or a recent note of the same type when the section name is not\n already known.\n3. Append with `section=<header>` so content lands at the end of that section,\n before the next heading. The CLI creates the section only when absent.\n4. For daily records, use `- HH:mm 内容` unless a tag association is already\n authorized. Use the environment\'s local time.\n5. Lightly polish the user\'s wording while preserving facts, stance, emotion\n and first-person voice. Keep exact text when they request 原文 / 逐字 / 原样 /\n 摘抄 / verbatim.\n6. Verify the echoed path or structured result before reporting completion.\n\nExample:\n\n```bash\nnpx -y @life-os/cli daily:append section="日常记录" content="- 14:30 记录一个新想法"\n```\n\nDo not infer a project/theme tag from nearby context. Follow the association\nrules in `../../lifeos/SKILL.md`; an unconfirmed candidate tag is a follow-up after the\nrequested capture succeeds, not part of the initial write.\n\n## Reviews and time-based task queries\n\nUse the single weekly-review bundle instead of manually combining incompatible\ndate semantics:\n\n```bash\nnpx -y @life-os/cli review:weekly --json\n```\n\nIt resolves the configured week and returns the weekly note, tasks completed by\ncompletion time, open/due tasks, weekly bullets and recent files. Show the\nsource-backed review first; append a synthesized review only after explicit\nconfirmation.\n\nFor a morning check, query open work before capturing the plan:\n\n```bash\nnpx -y @life-os/cli tasks due=today --json\nnpx -y @life-os/cli tasks due=overdue --json\nnpx -y @life-os/cli daily:append section="日常记录" content="- 08:30 今天先处理 ..."\n```\n\n`due=` filters task due dates. It does not answer what was completed during a\nperiod. Use `tasks done completed=this-week` or `review:weekly` for completion\nevidence.\n\n## Period roles\n\n- Yearly / quarterly: direction, goals and longer-horizon review.\n- Monthly / weekly: nearer-term plans, milestones and task review.\n- Daily: capture, tasks, thoughts and time records.\n\nWhen the request is primarily about a durable subject rather than a time period,\nroute it to the theme note workflow in\n`../../lifeos-board/references/theme-notes.md`.\n',
365
+ 'lifeos/SKILL.md': "---\nname: lifeos\ndescription: 'Operate and configure a LifeOS Markdown knowledge base through the `lifeos` CLI without requiring Obsidian or Aino. Use for LifeOS vault discovery, configuration, profile detection, exact note search/read/create/append operations, Skill installation or status, shared write safety, or routing an ambiguous LifeOS request to lifeos-today, lifeos-board, lifeos-onboarding, or lifeos-content.'\n---\n\n# LifeOS Core\n\nUse this Skill as the shared runtime and safety contract for the LifeOS Skill\nbundle. Domain Skills must read this file before running commands or proposing\nwrites.\n\n## Choose the domain\n\n- Today, tasks, periodic notes, recent work or weekly review: use\n [`../lifeos-today/SKILL.md`](../lifeos-today/SKILL.md).\n- Workflow/PARA boards, theme notes or flow bottlenecks: use\n [`../lifeos-board/SKILL.md`](../lifeos-board/SKILL.md).\n- Empty folders, template choice, takeover, classification or migration: use\n [`../lifeos-onboarding/SKILL.md`](../lifeos-onboarding/SKILL.md).\n- Search, capture, attachment metadata, AI Wiki, HTML dashboards or Aino mini-app\n routing: use [`../lifeos-content/SKILL.md`](../lifeos-content/SKILL.md).\n- OPC company operations: use the separate `opc` Skill.\n\nFor exact flags, result schemas, errors and uncommon commands, read\n[`references/commands.md`](references/commands.md).\n\n## Choose the host\n\nFor headless or desktop work, invoke:\n\n```bash\nnpx -y @life-os/cli <command>\n```\n\nThe first run downloads the published package; `-y` skips the install prompt.\nDo not require Aino Desktop or Obsidian to be open.\n\nOn **Aino Mobile**, use the native `lifeos_*` tools reported by\n`lifeos_get_vault_info`. Never ask a mobile user to install Node.js or run shell\ncommands. Mobile writes prepare previews only: require explicit confirmation and\na commit receipt before claiming a mutation succeeded. Mobile never exposes\npermanent deletion. Onboarding plan/apply are CLI-only.\n\n## Resolve the vault and model\n\nOutside onboarding, run `config` before a workflow whose real folders, periodic\nformats or templates matter. Run `profile` when the operating model is not\nalready known.\n\n```bash\nnpx -y @life-os/cli config --json\nnpx -y @life-os/cli profile --json\n```\n\nVault resolution order is explicit `vault=` -> `$LIFEOS_VAULT` -> walk upward\nfor `.obsidian/`, `.lifeos/` or `.agents/skills/lifeos/` -> Aino's last-opened\nfolder. Pass `vault=` when the intended vault differs from the current context.\nNever construct PARA folders, periodic paths, formats or section headers from\nmemory; use resolved configuration.\n\nOptions use `key=value`; flags use `--json` or a bare word such as `overwrite`.\nQuote values containing spaces and request `--json` for machine-readable work.\n\n## Read and target precisely\n\n- Read existing content before changing it. Use the exact vault-relative `path=`\n or task `ref=` returned by a query; never write through a guessed loose name.\n- Preserve unknown Frontmatter and body content. Use `overwrite` only after\n intentionally rebuilding the complete target.\n- Keep writes inside the selected vault. Surface unexpected path resolution\n instead of creating a stray note.\n- Treat an echoed resolved path, structured result or mobile commit receipt as\n evidence of a completed write. A click, preview or proposed tool call is not\n completion evidence.\n- Never claim to understand a binary attachment unless another tool extracted\n its content. Inventory visibility alone is not content parsing.\n\n## Confirm associations and consequential writes\n\nProject/theme tags are optional, user-owned associations. Add one only when the\nuser explicitly names it, the source already carries it, or a durable preference\nauthorizes automatic association.\n\nIf a tag only looks relevant, complete the requested task without that inferred\ntag, then ask whether to add it. If confirmed, update the exact item just\ncreated; never create a duplicate.\n\nPreview and obtain explicit confirmation before onboarding apply, migration,\nclassification apply, file moves, recoverable deletion, or a broad overwrite.\nDo not silently broaden a precise request into repository-wide organization.\n\n## Maintain the bundle\n\nInstall and update the complete, versioned bundle with one command:\n\n```bash\nnpx -y @life-os/cli@latest skill status\nnpx -y @life-os/cli@latest skill install\n```\n\nThe bundle contains `lifeos`, `lifeos-today`, `lifeos-board`,\n`lifeos-onboarding` and `lifeos-content`. The installer backs up locally modified\nmanaged files, migrates legacy single-Skill installs, removes obsolete managed\nfiles only after backup, and never downgrades a newer installed bundle.\n\n## Scope\n\nIn scope: config-aware local Markdown queries and mutations plus routing to the\nfour LifeOS domain Skills.\n\nOut of scope: Google Calendar / CalDAV sync, plugin or Aino UI implementation,\nand direct editing of `.lifeos/custom-apps` internals.\n",
366
+ 'lifeos/agents/openai.yaml': "interface:\n display_name: 'LifeOS Core'\n short_description: 'Configure and safely operate a LifeOS vault'\n default_prompt: 'Use $lifeos to inspect and safely operate this LifeOS vault.'\n",
367
+ 'lifeos/references/commands.md': '# `lifeos` — full command reference\n\nExhaustive reference for the `lifeos` CLI. The SKILL.md covers the common path;\nload this when you need an exact flag, output shape, or error meaning.\n\n## Contents\n\n- [Conventions](#conventions)\n- [Vault selection](#vault-selection)\n- [Settings sources](#settings-sources)\n- [Commands](#commands)\n- [Common command chains](#common-command-chains)\n- [Errors](#errors)\n- [Performance](#performance-5k-note-vault)\n- [Out of scope](#out-of-scope)\n\n## Conventions\n\n- **Invocation**: run via `npx -y @life-os/cli <command> …` (npx fetches the\n published package on first use; `-y` skips the prompt). The command names below\n (`config`, `profile`, `tasks`, …) are the `<command>` argument, e.g.\n `npx -y @life-os/cli tasks due=today`.\n- **Options**: `key=value` (or `--key=value`). **Flags**: `--json`, or bare\n `overwrite` / `case`. Quote values containing spaces.\n- **Output**: human-readable by default; `--json` (or `format=json`) emits a\n single JSON document on stdout.\n- **`content=` escapes**: in write commands (`append`, `create`, `<period>:append`)\n the `content=` value interprets `\\n` `\\t` `\\r` `\\\\`, so you can write multi-line\n content on one command line.\n- **Exit codes**: `0` success, `1` on any error. Error text is human-readable.\n\n## Vault selection\n\nResolved in order, first match wins:\n\n1. `vault=<path>` option (`~` is expanded; relative paths resolve against cwd)\n2. `$LIFEOS_VAULT` environment variable\n3. Walk up from the current directory for a folder containing `.obsidian/`,\n `.lifeos/`, or `.agents/skills/lifeos/`\n4. The folder Aino last opened (`<userData>/bootstrap.json` → `lastOpenedFolder`)\n\n`onboard` intentionally differs at the last step: when no workspace marker is\nfound, it uses the current directory instead of Aino\'s last-opened folder. This\nmakes an empty local folder safe to initialize. Pass `vault=<path>` whenever the\ntarget is not the current directory.\n\n`config` reports which one was used via `Found by` / `discoveredVia`.\n\n## Settings sources\n\nEffective settings merge built-in defaults with these files (later overrides\nearlier), the same set the plugin and Aino use:\n\n1. `.obsidian/plugins/periodic-para/data.json` (legacy plugin id)\n2. `.obsidian/plugins/lifeos-pro/data.json`\n3. `.lifeos/settings.json` (Aino\'s vault-portable settings)\n\n---\n\n## Commands\n\n### `config`\n\nShow the resolved vault, how it was found, the config source files applied, and\nkey LifeOS settings (PARA folders, periodic base, daily path format, and the daily\ntemplate path used when rendering a missing daily note). For the final daily note\npath, use `daily` itself: it also considers Obsidian Daily Notes core settings.\n`--json` → `{ vault: {root, discoveredVia}, sources: string[], settings }`.\n\n### `profile`\n\nDetect the vault\'s template profile. The detector reads\n`.lifeos/template-profile.json` first when present, then falls back to settings,\nfolders, key files and tag vocabulary.\n\nBuilt-in profiles:\n\n- `para`: projects / areas / resources / archives.\n- `ipo`: input -> theme processing -> output.\n- `gtd`: inbox -> next actions / waiting / someday / review.\n- `opc`: OPC LifeOS one-person-company template; use the `opc` skill.\n- `custom` / `unknown`: use generic LifeOS rules unless the vault provides its\n own skill.\n\n`--json` →\n`{ vault, profile, confidence, score, evidence, warnings, requiredSkills, recommendedReferences, manifest?, settingsSources }`.\n\n### `tasks [todo|done|all]`\n\nList tasks. Positional status defaults to `todo`.\n\n| Option | Meaning |\n| -------------------------- | ------------------------------------------------------------------- |\n| `tag=<tag>` | tasks tagged `<tag>` (matches the tag and its sub-tags `<tag>/...`) |\n| `keyword=<text>` | substring match on task text |\n| `due=today\\|week\\|overdue` | filter by **due date**; status still applies (default hides done) |\n| `completed=this-week` | filter done/all tasks by **completion date**, not due date |\n| `limit=<n>` | max rows (default 50) |\n| `--json` | `{ totalCount, count, items: TaskItem[] }` |\n\n`TaskItem`: `{ file, line, text, checked, dueDate?, priority?, tags?, ... }`.\nHuman line: `[ ]|[x] <text> (due <date> !<priority> #<tags>) — <file>:<line>`.\n\nNotes: `due=*` over-fetches and post-filters by status, so a completed task with a\npast due date is hidden unless you ask for `done`/`all`.\n`completed=this-week` is accepted only with `tasks done` or `tasks all`; use it\nwhen asking what was actually completed this calendar week.\n\n### `today [date=YYYY-MM-DD]`\n\nBuild the source-backed AI Today view without opening Aino Desktop. `date=`\ndefaults to the local current date. `limit=` caps returned task rows (default\n50); `recentLimit=` caps each recent file group (default 6).\n\n`--json` uses the shared LifeOS agent result envelope. `data` contains:\n\n- `date`\n- `summary`: `pendingCount`, `overdueCount`, `timedCount`, `completedCount`\n- `tasks`: `pending`, `timed`, and `completed`\n- `recent`: `captures`, `projects`, and `outputs`\n- `sources`: exact task/file references used to build the view\n\nPending work includes open tasks due on or before the selected date. Completed\nwork uses the task completion date, not its due date. Workflow folders honor\nthe effective vault settings: PARA vaults use captures/projects/expresses;\nnon-PARA vaults use inputs/themes/outputs.\n\n### `board [mode=workflow|para]`\n\nBuild the source-backed AI board view without opening Aino Desktop. The mode\ndefaults to `workflow` and can also be supplied positionally (`board para`).\n`limit=` caps returned items per column (default 20) while `totalCount` keeps the\nfull column count. The result envelope sets `truncated=true` when any column was\ncapped.\n\n- `workflow`: Input, Projects, open Tasks, Output\n- `para`: Projects, Areas, Resources, Archives\n\n`data.columns[]` contains `key`, `label`, optional configured `path`,\n`totalCount`, and bounded `items`. File items distinguish direct files from\ncollapsed top-level folders and expose a readable `sourcePath`; task items\ninclude their exact `file` and `line`.\nUse envelope `sources` to ground analysis. A board read never moves or edits\nfiles.\n\n### `recent [range=<named-range>]`\n\nList Markdown files with durable created/modified evidence in a date range.\nNamed ranges are `today`, `this-calendar-week`/`this-week`,\n`last-calendar-week`/`last-week`, `rolling-7-days`, and `this-month`.\nExplicit `dateFrom=YYYY-MM-DD` and `dateTo=YYYY-MM-DD` override the named range;\n`limit=` is capped at 100. `--json` uses the shared LifeOS agent result envelope\nand returns `data.range` plus `data.items`.\n\nEach item has `path`, `changedAt`, `changeType` (`created`, `modified`, or\n`unknown`) and `source`. A CLI-only filesystem mtime cannot prove file birth, so\nit is reported as `unknown`, never guessed as `created`.\n\n### `review:weekly [date=YYYY-MM-DD]`\n\nBuild a single source-backed weekly review bundle using the configured week\nstart. It includes the resolved weekly note, tasks completed by completion time,\nopen/due tasks, weekly bullets, and recent files. `--json` uses the shared result\nenvelope. Prefer this command over composing `weekly` with\n`tasks done due=week`: `due=week` means due date and cannot answer what was\ncompleted during the week.\n\n### `search query=<text>`\n\n| Option | Meaning |\n| --------------------- | ------------------------------------------------------- |\n| `type=file` (default) | match note name + path (case-insensitive substring) |\n| `type=tag` | match tag names; output `#tag (count)` |\n| `type=content` | full-text scan of note bodies; output `path:line text` |\n| `case` | content search becomes case-sensitive |\n| `limit=<n>` | max results (default 20, capped at 100) |\n| `--json` | `{ type, query, count, items }` |\n\nContent matching is plain substring (not regex). It reads files on demand and\nstops at `limit`.\n\n### `read file=<name> | path=<vault/rel/path>`\n\nPrint a note. `path=` is exact (vault-relative); `file=` resolves a loose name via\nthe index and errors if ambiguous (lists candidates). `.md` is added if omitted.\nExplicit `.md`, `.markdown`, `.html` and `.htm` extensions are preserved.\n`--json` → `{ filePath, content }`.\n\n### Periodic notes: `daily | weekly | monthly | quarterly | yearly`\n\nResolve the note path with the same formatter as the plugin/Aino (ISO weeks for\nweekly). For `daily`, `.obsidian/daily-notes.json` wins when present:\n`folder` is the base path and `format` is the date path template, so formats like\n`MM/YYYY-MM-DD` correctly create month subfolders. Other periods use\n`periodicNotesPath` + `periodicNotesPathFormat<Type>` from LifeOS settings,\nfalling back to LifeOS defaults. Weekday/month name tokens (`dddd`/`MMMM`) honor\n`locale=` (default: system locale).\n\n| Form | Effect |\n| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |\n| `<period>` | print `Type/Date/Path/Exists/Format`; `--json` adds `exists` |\n| `<period>:read` | print the note (errors if it doesn\'t exist) |\n| `<period>:create [overwrite]` | create the note from its configured template (rendered); errors if it exists unless `overwrite` |\n| `<period>:append content=<text>` | append; **creates the note from its template if missing** |\n| `section=<header>` | insert at the end of that header\'s section (creates it if absent) instead of the file tail — e.g. `section="日常记录"` for daily-record logging |\n| `date=YYYY-MM-DD` | target a specific period (default: today) |\n| `locale=<bcp47>` | locale for name tokens, e.g. `zh-CN` |\n\nTemplate resolution: for `daily`, Obsidian Daily Notes core `template` wins when\nset; otherwise `periodicNotesTemplateFilePath<Type>` if set, else\n`<periodicNotesPath>/Templates/<Type>.md`, else a built-in default. The template\nis rendered with the shared engine: `{{snapshot:Project}}` → numbered\n`[[index|name]]` list of PARA sub-folders that have an index note;\n`{{if weekday}}…{{endif}}`, `{{date}}`, `{{date+N:FORMAT}}`, `{{title}}` are\nexpanded; unknown `{{…}}` (LifeOS query blocks) are left verbatim.\n`:create`/`:append` `--json` adds `created` / `templatePath`.\n\nEvery form echoes the resolved path. `<period> read` / `<period>:read` are both\naccepted.\n\n### `theme:create type=<t> tag=<tag> path=<vault/rel/path> [overwrite]`\n\nCreate a PARA/theme note from its template. `type` ∈ `project|area|resource|archive|theme`.\nTemplate resolution: `<type>TemplateFilePath` if set, else `<typeDir>/Template.md`,\nelse a built-in default. The template is rendered (same engine as periodic notes),\nthen `tag` is injected into the note\'s `tags`/`aliases` frontmatter so the theme\nindex collects it. `path=` is caller-supplied (read `config` for PARA folder\nnames); convention is `<paraDir>/<name>/<name>.md`. Errors if the note exists\nunless `overwrite`. `--json` → `{ ok, filePath, created, templatePath, type, tag }`.\n\n### `append path=<vault/rel/path> content=<text> [section=<header>]`\n\nAppend to an **existing** note. Errors if the note doesn\'t exist (use `create`).\nWithout `section=`, appends to the file tail with a newline boundary. With\n`section=<header>`, inserts at the **end of that header\'s section body** (matching\nthe header at any `#` depth, ignoring case/whitespace) and creates the section at\nthe end of the file if the header is missing. `--json` →\n`{ ok, filePath, created:false, section }`.\n\n### `create path=<vault/rel/path> [content=<text>] [overwrite]`\n\nCreate a note or dashboard file. Parent folders are auto-created; `.md` is added\nwhen the path has no recognised extension. Explicit `.md`, `.markdown`, `.html`\nand `.htm` extensions are preserved. Errors if it exists unless `overwrite`.\n`--json` → `{ ok, filePath, created }`.\n\n### `task done|todo ref=<file>:<line>`\n\nToggle one task\'s checkbox. `ref` is the `file:line` printed by `tasks` (only the\ntrailing `:<digits>` is the line number, so paths with colons are fine).\n`--json` → `{ ok, filePath, action }`.\n\n### `onboard`\n\nInitialize or migrate any local Markdown folder. `.obsidian/` is optional.\n\n| Form | Effect |\n| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |\n| `onboard inspect [vault=<path>] [--json]` | Inventory `.md`, `.markdown`, common attachment types, metadata, Skill status, and detected profile without reading binary attachment contents. |\n| `onboard templates [locale=en\\|zh-cn\\|zh-tw] [--json]` | List the exact Memos, IPO, GTD, and PARA directory structures and root bootstrap Agent Files; does not require a vault. |\n| `onboard plan profile=<p> [density=minimal\\|full] [locale=…]` | Preview creates, skips, and conflicts, including profile-specific bootstrap Agent Files; JSON exposes target conflict content; never writes. |\n| `onboard apply profile=<p> [density=…] [locale=…]` | Apply the previewed template and missing bootstrap Agent Files without overwriting conflicts. |\n| `onboard status [--json]` | Read resumable state from `.lifeos/onboarding.json`. |\n| `onboard verify [--json]` | Verify metadata, Skill, and detected profile. |\n| `onboard classify-input profile=<p> [locale=…] [scope=<path>] [limit=30]` | Return a bounded batch of scattered files for semantic classification. |\n| `onboard classify-plan file=<json> [--json]` | Validate a reviewed classification plan without moving files. |\n| `onboard classify-apply file=<json> [--json]` | Move the confirmed safe subset and report conflicts separately. |\n\nProfiles are `memos`, `ipo`, `gtd`, or `para`. The aliases `topic` and `topic-only`\nnormalize to `ipo`; Topic-only mode is not a separate stored profile. Use the\nseparate `opc` skill for OPC.\n`minimal` creates the operational structure and starter entry points. For Memos,\nit also creates the essential empty Daily template. `full` adds the longer-period\nreview templates. Memos cannot be used with `classify-*` because it has no\ntaxonomy destination folders.\n\nAll profiles include root `AGENTS.md`, `SOUL.md`, and `STYLE.md` with\nprofile-specific content in the requested locale. `MEMORY.md` is an optional,\nfree-form durable-memory file created only after an explicit remember request; it\nis never generated, upgraded, or rewritten by onboarding. Existing bootstrap\nAgent Files are conflicts and remain unchanged; `AGENT.md` and `CLAUDE.md` are\nnot generated.\n\nClassification plan suggestions contain `source`, `destinationDirectory`,\n`confidence`, `reason`, `evidence`, and `confirmed`. Only confirmed items are\neligible to move. Validation rejects paths outside the workspace, destinations\noutside the selected profile, missing sources, same-name/case-equivalent\ncollisions, and moves that could break Markdown or attachment links.\n\nWhen the detected profile differs from the requested target, use\n`../../lifeos-onboarding/references/template-migration.md`. The target content in `conflictEntries` is\ncomparison input only; `onboard apply` never merges or overwrites it.\n\n### `skill status|install [vault=<path>]`\n\n`skill status` reports whether the vault copy is missing, legacy, invalid,\noutdated, current, or newer than the CLI bundle. It also checks the managed-file\nfingerprint and reports local changes. Add `--json` for structured output.\n\nInstall or update the complete LifeOS Skill bundle under `.agents/skills/` in\nthe resolved vault. The bundle contains `lifeos`, `lifeos-today`,\n`lifeos-board`, `lifeos-onboarding` and `lifeos-content`. The command writes the\nfiles embedded in the current `@life-os/cli` package, so it is the upgrade path\nafter installing a newer CLI. Legacy or locally modified managed files are\nbacked up below `.agents/skills/lifeos/.backup/` before replacement; obsolete\nfiles from the former single-Skill layout are then removed. A newer installed\nbundle is never downgraded.\n\n### `help`, `version`\n\nPrint usage / version.\n\n---\n\n## Common command chains\n\n### Find then act\n\nRead or locate the exact target before a mutation:\n\n```bash\nnpx -y @life-os/cli tasks keyword="季度报告"\nnpx -y @life-os/cli task done ref="0. 周期笔记/2025/Daily/05/2025-05-30.md:14"\n```\n\n### Research a topic\n\n```bash\nnpx -y @life-os/cli search query="超线性回报" type=content limit=20\nnpx -y @life-os/cli read path="-1. 捕获/相关笔记.md"\n```\n\n### Tag a non-Markdown attachment\n\nDerive the hidden sibling path mechanically, then read, validate and merge\ninstead of overwriting unknown Frontmatter:\n\n```bash\nnpx -y @life-os/cli read path="Assets/.合同.pdf.md" --json\nnpx -y @life-os/cli create path="Assets/.合同.pdf.md" content="<完整合并后的 Frontmatter>" overwrite\n```\n\nA missing card is expected when the attachment has never received metadata.\nCreate it only after the user requested a property change and follow\n`../../lifeos-content/references/attachment-cards.md` for the full identity and\nconflict rules.\n\n### Generate a theme dashboard\n\n```bash\nnpx -y @life-os/cli read path="4 资源/学日语/学日语.md"\nnpx -y @life-os/cli read path="4 资源/学日语/学日语.AI.md"\nnpx -y @life-os/cli create path="4 资源/学日语/学日语.html" content="<full html>" overwrite\n```\n\nThe `.AI.md` read may legitimately report a missing file. Before writing, load\n`../../lifeos-content/references/theme-dashboard.md`, gather the high-signal sources it requires and\npreserve the same-directory same-basename path rule.\n\n### Weekly review\n\n```bash\nnpx -y @life-os/cli review:weekly --json\n```\n\nShow the sourced review before proposing a write. Append the synthesized review\nonly after explicit confirmation. For capture and periodic-note examples, use\n`../../lifeos-today/references/periodic-notes.md`.\n\n---\n\n## Errors\n\nSurfaced as readable text with exit code 1. Common cases:\n\n| Situation | Message |\n| ------------------------------ | ----------------------------------------------------------------- |\n| note missing (`read`/`append`) | `No such note in the vault.` |\n| `create` onto existing | `A note already exists at that path. Add the \\`overwrite\\` flag…` |\n| path escapes vault | `Refusing to touch a path outside the vault.` |\n| `task` ref not a checkbox line | `That line is not a \\`- [ ]\\` / \\`- [x]\\` task.` |\n| bad `due=` / `date=` value | explains the accepted values |\n| no vault found | explains explicit path, env, cwd markers, and Aino fallback |\n\n---\n\n## Performance (≈5k-note vault)\n\n- Fixed startup (node + import): ~70 ms.\n- `search type=content`: ~0.5 s worst case (scans bodies; stops at `limit`).\n- Index-backed (`tasks`, `search type=file|tag`): ~1 s (rebuilds the index per\n process; there is no persistent cache yet). Avoid tight loops of many such calls.\n\n## Out of scope\n\nUI views, Google Calendar / CalDAV sync, two-way task↔calendar sync, Pomodoro and\ndaily-record sync — these remain in the LifeOS plugin and the Aino desktop app.\n',
320
368
  };
321
369
  const OPC_SKILL_FILES = {
322
- "SKILL.md": "---\nname: opc\ndescription: Operate an OPC LifeOS vault as an AI-agent-led one-person-company operating system. Use when the user asks to update the OPC vault, CEO dashboard, departments, input/output flow, periodic reviews, agent memory, or `.AI.md` dashboards.\n---\n\n# OPC LifeOS\n\nUse this skill when working inside an `OPC LifeOS` vault. The vault is an\noperating system for a one-person company, not a generic folder taxonomy.\n\n## First Moves\n\n1. Run `opc config` to confirm the vault path and required structure.\n2. Run `opc departments` before department-level work.\n3. Use `opc dashboard` to get the correct source note, sibling `.AI.md` path and\n generation prompt.\n4. Use the `lifeos` skill for low-level note, task, search and periodic-note\n operations.\n5. Read `references/dashboard.md` before creating or updating dashboards.\n6. Read `references/department-map.md` when routing material to departments.\n\n## Operating Model\n\nThe CLI supports two official OPC LifeOS layouts. Run `opc config` first and use\nthe detected layout.\n\n| Operating name | English vault path | Chinese vault path |\n| ---------------- | --------------------- | ------------------ |\n| CEO Dashboard | `CEO Dashboard.md` | `CEO 驾驶舱.md` |\n| CEO AI Dashboard | `CEO Dashboard.AI.md` | `CEO 驾驶舱.AI.md` |\n| Periodic Notes | `0 Periodic Notes/` | `0 周期笔记/` |\n| Input Pipeline | `1 Input/` | `1 输入/` |\n| Output Pipeline | `2 Output/` | `2 输出/` |\n| Departments | `3 Departments/` | `3 部门/` |\n| Templates | `99 Templates/` | `99 模板/` |\n\nThe seven departments are:\n\n| Operating name | English vault folder | Chinese vault folder |\n| --------------------------------- | -------------------------------------- | -------------------- |\n| Digital Infrastructure Department | `01 Digital Infrastructure Department` | `01 数字基建部` |\n| Finance & Legal Department | `02 Finance & Legal Department` | `02 财务法务部` |\n| Marketing & Growth Department | `03 Marketing & Growth Department` | `03 市场增长部` |\n| Sales & Customer Department | `04 Sales & Customer Department` | `04 销售客户部` |\n| Product R&D Department | `05 Product R&D Department` | `05 产品研发部` |\n| Delivery & Operations Department | `06 Delivery & Operations Department` | `06 交付运营部` |\n| Creative & Brand Department | `07 Creative & Brand Department` | `07 创作品牌部` |\n\nDo not describe these directories as topic folders in user-facing explanations.\nThey are departments. It is acceptable for frontmatter to keep\n`type: wiki/主题` for LifeOS AI Wiki compatibility.\n\n## Agent Files\n\nEvery operating layer and department should have:\n\n- `Agent.md` — responsibility, triggers, workflow and output format.\n- `Soul.md` — principles and judgment style.\n- `Memory.md` — durable facts, decisions, recurring context and rules.\n\nBefore changing a department, read its `Agent.md`, `Soul.md` and `Memory.md`.\nAfter making a durable decision, update `Memory.md` if the decision will matter\nin future sessions.\n\n## Input/Output Collaboration\n\nUse the Input Pipeline (`1 Input/` or `1 输入/`) and Output Pipeline (`2 Output/`\nor `2 输出/`) as lifecycle layers, not departments.\n\nInput pipeline folders:\n\n| Operating state | English vault folder | Chinese vault folder |\n| --------------- | -------------------- | -------------------- |\n| Inbox | `Inbox/` | `收件箱/` |\n| Processing | `Processing/` | `处理中/` |\n| Distilled | `Distilled/` | `已提炼/` |\n| Archived | `Archive/` | `归档/` |\n\nOutput pipeline folders:\n\n| Operating state | English vault folder | Chinese vault folder |\n| ---------------- | -------------------- | -------------------- |\n| Drafts | `Drafts/` | `草稿/` |\n| Ready to Publish | `Ready to Publish/` | `待发布/` |\n| Published | `Published/` | `已发布/` |\n| Delivered | `Delivered/` | `已交付/` |\n| Reusable Assets | `Reusable Assets/` | `可复用资产/` |\n| Archived | `Archive/` | `归档/` |\n\nWhen an input or output affects a department, use the relevant `#OPC/...` tag or\nwikilinks to the relevant department. Do not duplicate the same material into\nevery department folder.\n\n## Privacy Rules\n\nOPC templates are reusable examples and must not expose the user's private life,\nreal contacts or sensitive operations.\n\nBefore adding, regenerating or publishing template content, remove or replace:\n\n- real personal names, relationship details and private life events;\n- family, parenting, health, address, travel and household details;\n- real account names, emails, phone numbers, social handles and customer\n identities;\n- absolute local paths, private vault paths and machine-specific locations;\n- API keys, tokens, activation codes, passwords, payment data and calendar\n credentials;\n- production-only deployment rules or internal operational details unless the\n user explicitly asks to keep them.\n\nUse neutral sample identities such as `Alex`, `Client A`, `Client B`, `张三`,\n`A 客户` and `B 客户`. Keep business logic, pricing examples and workflows only\nwhen they are useful to understand the OPC operating system and do not identify\nthe user.\n\n## CLI\n\nUse the local or packaged CLI:\n\n```bash\nopc config\nopc departments\nopc dashboard\nopc dashboard dept=sales\nopc dashboard dept=04\nopc skill install\n```\n\nIf running from the monorepo before publishing:\n\n```bash\npnpm -C apps/opc-cli build\nnode apps/opc-cli/bin/opc.mjs config vault=\"/path/to/OPC LifeOS\"\nnode apps/opc-cli/bin/opc.mjs skill install vault=\"/path/to/OPC LifeOS\"\n```\n\n## Writing Rules\n\n- Prefer concrete LifeOS/Aino operating examples over generic placeholders.\n- For public or shareable templates, prefer realistic but fictional examples;\n do not copy personal daily-life records into the template.\n- Do not write empty placeholder sections unless the user explicitly asks for a\n blank template.\n- Write vault content in the language already used by the target note unless the\n user explicitly asks for another language.\n- Use wikilinks for vault notes and Markdown links for external URLs.\n- Keep daily notes factual. If a note is for a future date, label entries as\n plan or forecast rather than completed fact.\n",
323
- "references/commands.md": "# `opc` CLI Commands\n\n## `opc config`\n\nShow the resolved vault, whether it looks like an OPC vault, required root\nfiles, detected layout, required top-level layers and whether the `opc` /\n`lifeos` skills are installed.\n\n```bash\nopc config\nopc config --json\nopc config vault=\"/path/to/OPC LifeOS\"\n```\n\n## `opc departments`\n\nList the seven departments and whether their required files exist:\n\n- department index note\n- sibling `.AI.md`\n- `Agent.md`\n- `Soul.md`\n- `Memory.md`\n\n```bash\nopc departments\nopc departments --json\n```\n\n## `opc dashboard`\n\nPrint the correct source note, sibling `.AI.md` note and prompt for AI dashboard\ngeneration.\n\n```bash\nopc dashboard\nopc dashboard ceo\nopc dashboard dept=<department-name-or-id>\nopc dashboard dept=04\n```\n\nThe command does not generate the dashboard by itself. Use the prompt in Obsidian\nDeepask or Aino Desktop's right sidebar AI chat.\n\n## `opc skill install`\n\nInstall or update both bundled skills into the current vault:\n\n- `.agents/skills/opc/`\n- `.agents/skills/lifeos/`\n\n```bash\nopc skill install\nopc skill install vault=\"/path/to/OPC LifeOS\"\nopc skill install --opc-only\n```\n\nUse `--opc-only` only when you intentionally do not want to touch the LifeOS\nskill.\n",
324
- "references/dashboard.md": "# OPC Dashboard Rules\n\nUse `.AI.md`, never `.Dashboard.md`.\n\nGenerate dashboards as sibling files:\n\n- `CEO Dashboard.md` -> `CEO Dashboard.AI.md`\n- `CEO 驾驶舱.md` -> `CEO 驾驶舱.AI.md`\n- `3 Departments/03 Marketing & Growth Department/03 Marketing & Growth Department.md` ->\n `3 Departments/03 Marketing & Growth Department/03 Marketing & Growth Department.AI.md`\n- `3 部门/03 市场增长部/03 市场增长部.md` ->\n `3 部门/03 市场增长部/03 市场增长部.AI.md`\n\n## CEO Dashboard\n\nThe CEO dashboard must include:\n\n- goals\n- revenue\n- leads\n- active projects\n- risks\n- this week's focus\n- department-by-department operating state\n\nUse the heading language already established in the target vault. Do not invent a\nnew section taxonomy unless the user explicitly asks for it.\n\nApply the OPC privacy rules before writing the dashboard: do not include private\nlife details, real personal identities, local paths, credentials, production-only\nrules or internal operational details unless the user explicitly asks to keep\nthem. Replace them with neutral sample entities such as `Alex`, `Client A`,\n`张三`, `A 客户` and fictional operating examples.\n\n## Department Dashboard\n\nDepartment dashboards must include:\n\n- one-sentence state summary\n- core judgments\n- metrics\n- material map\n- risks and blockers\n- review\n- next actions\n\nUse the heading language already established in the target vault. The dashboard\nshould drive decisions, not merely summarize past notes.\n\nApply the OPC privacy rules before writing the dashboard: do not include private\nlife details, real personal identities, local paths, credentials, production-only\nrules or internal operational details unless the user explicitly asks to keep\nthem. Replace them with neutral sample entities such as `Alex`, `Client A`,\n`张三`, `A 客户` and fictional operating examples.\n\n## Frontmatter\n\nKeep this schema for LifeOS AI Wiki compatibility:\n\n```yaml\n---\ntype: wiki/主题\nsource: '[[source department or index note]]'\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\n---\n```\n\nUser-facing prose should describe these pages as department dashboards or the CEO\ndashboard, not as topic pages.\n",
325
- "references/department-map.md": "# OPC Department Map\n\nUse this map when routing notes, tasks and decisions.\n\n| Operating name | English folder | Chinese folder | Owns | English tag | Chinese tag |\n| --------------------------------- | -------------------------------------- | --------------- | ----------------------------------------------------------------------- | ----------------------------- | --------------- |\n| Digital Infrastructure Department | `01 Digital Infrastructure Department` | `01 数字基建部` | tool stack, automation, accounts, backup, prompts, APIs, servers | `#OPC/digital-infrastructure` | `#OPC/数字基建` |\n| Finance & Legal Department | `02 Finance & Legal Department` | `02 财务法务部` | pricing, revenue, cost, invoice, contract, tax, risk boundaries | `#OPC/finance-legal` | `#OPC/财务法务` |\n| Marketing & Growth Department | `03 Marketing & Growth Department` | `03 市场增长部` | positioning, channels, KOLs, campaigns, growth experiments | `#OPC/marketing-growth` | `#OPC/市场增长` |\n| Sales & Customer Department | `04 Sales & Customer Department` | `04 销售客户部` | leads, sales conversations, quotes, customers, follow-up, renewal | `#OPC/sales-customer` | `#OPC/销售客户` |\n| Product R&D Department | `05 Product R&D Department` | `05 产品研发部` | product packages, templates, services, automations, feedback, roadmap | `#OPC/product-rd` | `#OPC/产品研发` |\n| Delivery & Operations Department | `06 Delivery & Operations Department` | `06 交付运营部` | client projects, delivery promises, milestones, SOPs, service review | `#OPC/delivery-operations` | `#OPC/交付运营` |\n| Creative & Brand Department | `07 Creative & Brand Department` | `07 创作品牌部` | brand assets, website, cases, articles, video/podcast, content calendar | `#OPC/creative-brand` | `#OPC/创作品牌` |\n\nRouting rule:\n\n- If it is raw material, put it in the Input Pipeline (`1 Input/` or `1 输入/`)\n and tag/link the department.\n- If it is shipped work, put it in the Output Pipeline (`2 Output/` or\n `2 输出/`) and tag/link the department.\n- If it is durable operating knowledge, put it in the department folder.\n- If it changes company-level priorities, update the CEO Dashboard\n (`CEO Dashboard.md` / `CEO 驾驶舱.md`) or CEO AI Dashboard\n (`CEO Dashboard.AI.md` / `CEO 驾驶舱.AI.md`).\n",
370
+ 'SKILL.md': '---\nname: opc\ndescription: Operate an OPC LifeOS vault as an AI-agent-led one-person-company operating system. Use when the user asks to update the OPC vault, CEO dashboard, departments, input/output flow, periodic reviews, agent memory, or `.AI.md` AI Wiki pages.\n---\n\n# OPC LifeOS\n\nUse this skill when working inside an `OPC LifeOS` vault. The vault is an\noperating system for a one-person company, not a generic folder taxonomy.\n\n## First Moves\n\n1. Run `opc config` to confirm the vault path and required structure.\n2. Run `opc departments` before department-level work.\n3. Use `opc dashboard` to get the correct source note, sibling `.AI.md` path and\n AI Wiki generation prompt.\n4. Use the `lifeos` skill for low-level note, task, search and periodic-note\n operations.\n5. Read `references/ai-wiki.md` before creating or updating OPC AI Wiki pages.\n6. Read `references/department-map.md` when routing material to departments.\n\n## Operating Model\n\nThe CLI supports two official OPC LifeOS layouts. Run `opc config` first and use\nthe detected layout.\n\n| Operating name | English vault path | Chinese vault path |\n| --------------- | --------------------- | ------------------ |\n| CEO Dashboard | `CEO Dashboard.md` | `CEO 驾驶舱.md` |\n| CEO AI Wiki | `CEO Dashboard.AI.md` | `CEO 驾驶舱.AI.md` |\n| Periodic Notes | `0 Periodic Notes/` | `0 周期笔记/` |\n| Input Pipeline | `1 Input/` | `1 输入/` |\n| Output Pipeline | `2 Output/` | `2 输出/` |\n| Departments | `3 Departments/` | `3 部门/` |\n| Templates | `99 Templates/` | `99 模板/` |\n\nThe seven departments are:\n\n| Operating name | English vault folder | Chinese vault folder |\n| --------------------------------- | -------------------------------------- | -------------------- |\n| Digital Infrastructure Department | `01 Digital Infrastructure Department` | `01 数字基建部` |\n| Finance & Legal Department | `02 Finance & Legal Department` | `02 财务法务部` |\n| Marketing & Growth Department | `03 Marketing & Growth Department` | `03 市场增长部` |\n| Sales & Customer Department | `04 Sales & Customer Department` | `04 销售客户部` |\n| Product R&D Department | `05 Product R&D Department` | `05 产品研发部` |\n| Delivery & Operations Department | `06 Delivery & Operations Department` | `06 交付运营部` |\n| Creative & Brand Department | `07 Creative & Brand Department` | `07 创作品牌部` |\n\nDo not describe these directories as topic folders in user-facing explanations.\nThey are departments. It is acceptable for frontmatter to keep\n`type: wiki/主题` for LifeOS AI Wiki compatibility.\n\n## Agent Files\n\nEvery operating layer and department should have:\n\n- `Agent.md` — responsibility, triggers, workflow and output format.\n- `Soul.md` — principles and judgment style.\n- `Memory.md` — durable facts, decisions, recurring context and rules.\n\nBefore changing a department, read its `Agent.md`, `Soul.md` and `Memory.md`.\nAfter making a durable decision, update `Memory.md` if the decision will matter\nin future sessions.\n\n## Input/Output Collaboration\n\nUse the Input Pipeline (`1 Input/` or `1 输入/`) and Output Pipeline (`2 Output/`\nor `2 输出/`) as lifecycle layers, not departments.\n\nInput pipeline folders:\n\n| Operating state | English vault folder | Chinese vault folder |\n| --------------- | -------------------- | -------------------- |\n| Inbox | `Inbox/` | `收件箱/` |\n| Processing | `Processing/` | `处理中/` |\n| Distilled | `Distilled/` | `已提炼/` |\n| Archived | `Archive/` | `归档/` |\n\nOutput pipeline folders:\n\n| Operating state | English vault folder | Chinese vault folder |\n| ---------------- | -------------------- | -------------------- |\n| Drafts | `Drafts/` | `草稿/` |\n| Ready to Publish | `Ready to Publish/` | `待发布/` |\n| Published | `Published/` | `已发布/` |\n| Delivered | `Delivered/` | `已交付/` |\n| Reusable Assets | `Reusable Assets/` | `可复用资产/` |\n| Archived | `Archive/` | `归档/` |\n\nWhen an input or output affects a department, use the relevant `#OPC/...` tag or\nwikilinks to the relevant department. Do not duplicate the same material into\nevery department folder.\n\n## Privacy Rules\n\nOPC templates are reusable examples and must not expose the user\'s private life,\nreal contacts or sensitive operations.\n\nBefore adding, regenerating or publishing template content, remove or replace:\n\n- real personal names, relationship details and private life events;\n- family, parenting, health, address, travel and household details;\n- real account names, emails, phone numbers, social handles and customer\n identities;\n- absolute local paths, private vault paths and machine-specific locations;\n- API keys, tokens, activation codes, passwords, payment data and calendar\n credentials;\n- production-only deployment rules or internal operational details unless the\n user explicitly asks to keep them.\n\nUse neutral sample identities such as `Alex`, `Client A`, `Client B`, `张三`,\n`A 客户` and `B 客户`. Keep business logic, pricing examples and workflows only\nwhen they are useful to understand the OPC operating system and do not identify\nthe user.\n\n## CLI\n\nUse the local or packaged CLI:\n\n```bash\nopc config\nopc departments\nopc dashboard\nopc dashboard dept=sales\nopc dashboard dept=04\nopc skill install\n```\n\nIf running from the monorepo before publishing:\n\n```bash\npnpm -C apps/opc-cli build\nnode apps/opc-cli/bin/opc.mjs config vault="/path/to/OPC LifeOS"\nnode apps/opc-cli/bin/opc.mjs skill install vault="/path/to/OPC LifeOS"\n```\n\n## Writing Rules\n\n- Prefer concrete LifeOS/Aino operating examples over generic placeholders.\n- For public or shareable templates, prefer realistic but fictional examples;\n do not copy personal daily-life records into the template.\n- Do not write empty placeholder sections unless the user explicitly asks for a\n blank template.\n- Write vault content in the language already used by the target note unless the\n user explicitly asks for another language.\n- Use wikilinks for vault notes and Markdown links for external URLs.\n- Keep daily notes factual. If a note is for a future date, label entries as\n plan or forecast rather than completed fact.\n',
371
+ 'references/ai-wiki.md': "# OPC AI Wiki (`.AI.md`) Rules\n\nUse `.AI.md` for OPC AI Wiki pages, never `.Dashboard.md`.\n\nGenerate AI Wiki pages as sibling files:\n\n- `CEO Dashboard.md` -> `CEO Dashboard.AI.md`\n- `CEO 驾驶舱.md` -> `CEO 驾驶舱.AI.md`\n- `3 Departments/03 Marketing & Growth Department/03 Marketing & Growth Department.md` ->\n `3 Departments/03 Marketing & Growth Department/03 Marketing & Growth Department.AI.md`\n- `3 部门/03 市场增长部/03 市场增长部.md` ->\n `3 部门/03 市场增长部/03 市场增长部.AI.md`\n\nThese are operating wiki pages for a one-person company. User-facing prose should\ndescribe them as the CEO AI Wiki or department AI Wiki pages, not as dashboards\nor topic pages. Source notes may still be named `CEO Dashboard.md` /\n`CEO 驾驶舱.md`.\n\n## CEO AI Wiki\n\nThe CEO AI Wiki must include:\n\n- goals\n- revenue\n- leads\n- active projects\n- risks\n- this week's focus\n- department-by-department operating state\n\nUse the heading language already established in the target vault. Do not invent a\nnew section taxonomy unless the user explicitly asks for it.\n\nApply the OPC privacy rules before writing the AI Wiki page: do not include private\nlife details, real personal identities, local paths, credentials, production-only\nrules or internal operational details unless the user explicitly asks to keep\nthem. Replace them with neutral sample entities such as `Alex`, `Client A`,\n`张三`, `A 客户` and fictional operating examples.\n\n## Department AI Wiki\n\nDepartment AI Wiki pages must include:\n\n- one-sentence state summary\n- core judgments\n- metrics\n- material map\n- risks and blockers\n- review\n- next actions\n\nUse the heading language already established in the target vault. The wiki page\nshould drive decisions, not merely summarize past notes.\n\nApply the OPC privacy rules before writing the AI Wiki page: do not include private\nlife details, real personal identities, local paths, credentials, production-only\nrules or internal operational details unless the user explicitly asks to keep\nthem. Replace them with neutral sample entities such as `Alex`, `Client A`,\n`张三`, `A 客户` and fictional operating examples.\n\n## Frontmatter\n\nKeep this schema for LifeOS AI Wiki compatibility:\n\n```yaml\n---\ntype: wiki/主题\nsource: '[[source department or index note]]'\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\n---\n```\n\nUser-facing prose should describe these pages as department AI Wiki pages or the\nCEO AI Wiki, not as dashboards or topic pages.\n",
372
+ 'references/commands.md': '# `opc` CLI Commands\n\n## `opc config`\n\nShow the resolved vault, whether it looks like an OPC vault, required root\nfiles, detected layout, required top-level layers and whether the `opc` /\n`lifeos` skills are installed.\n\n```bash\nopc config\nopc config --json\nopc config vault="/path/to/OPC LifeOS"\n```\n\n## `opc departments`\n\nList the seven departments and whether their required files exist:\n\n- department index note\n- sibling `.AI.md`\n- `Agent.md`\n- `Soul.md`\n- `Memory.md`\n\n```bash\nopc departments\nopc departments --json\n```\n\n## `opc dashboard`\n\nPrint the correct source note, sibling `.AI.md` note and prompt for AI Wiki\ngeneration.\n\n```bash\nopc dashboard\nopc dashboard ceo\nopc dashboard dept=<department-name-or-id>\nopc dashboard dept=04\n```\n\nThe command does not generate the AI Wiki page by itself. Use the prompt in\nObsidian Deepask or Aino Desktop\'s right sidebar AI chat.\n\n## `opc skill install`\n\nInstall or update the OPC Skill and the complete LifeOS Skill bundle in the\ncurrent vault:\n\n- `.agents/skills/opc/`\n- `.agents/skills/lifeos/`\n- `.agents/skills/lifeos-today/`\n- `.agents/skills/lifeos-board/`\n- `.agents/skills/lifeos-onboarding/`\n- `.agents/skills/lifeos-content/`\n\n```bash\nopc skill install\nopc skill install vault="/path/to/OPC LifeOS"\nopc skill install --opc-only\n```\n\nUse `--opc-only` only when you intentionally do not want to touch the LifeOS\nbundle.\n',
373
+ 'references/dashboard.md': "# OPC Dashboard Rules\n\nUse `.AI.md`, never `.Dashboard.md`.\n\nGenerate AI dashboards as sibling files:\n\n- `CEO Dashboard.md` -> `CEO Dashboard.AI.md`\n- `CEO 驾驶舱.md` -> `CEO 驾驶舱.AI.md`\n- `3 Departments/03 Marketing & Growth Department/03 Marketing & Growth Department.md` ->\n `3 Departments/03 Marketing & Growth Department/03 Marketing & Growth Department.AI.md`\n- `3 部门/03 市场增长部/03 市场增长部.md` ->\n `3 部门/03 市场增长部/03 市场增长部.AI.md`\n\nThese are operating dashboards for a one-person company. User-facing prose\nshould describe them as the CEO dashboard or department dashboards, not as topic\npages. It is acceptable for frontmatter to keep `type: wiki/主题` for LifeOS AI\nWiki compatibility.\n\n## Source Priority\n\nRead source material in this order before writing:\n\n1. **CEO or department source note**: operating charter, current status, goals,\n open decisions and links.\n2. **Agent files**:\n - `Agent.md` for responsibility, triggers, workflow and output format;\n - `Soul.md` for principles and judgment style;\n - `Memory.md` for durable facts, decisions, recurring context and rules.\n3. **Existing `.AI.md` dashboard**: preserve useful structure and durable\n judgments when refreshing; do not blindly replace working sections.\n4. **Same-folder material**: department-specific assets, plans, notes, SOPs,\n cases and decisions.\n5. **Recent periodic notes**: only entries that clearly relate to the CEO layer\n or the department through `#OPC/...` tags, wikilinks or direct references.\n6. **Input / Output pipeline material**: related records under `1 Input` /\n `1 输入` and `2 Output` / `2 输出`. Use these as lifecycle evidence, not as\n department folders.\n7. **Cross-department dependencies**: include them when they change ownership,\n priority, risk or next actions.\n\nIf evidence is thin, state the missing signals explicitly. You may still give an\noperating judgment, but label its confidence and do not fabricate revenue,\nleads, customers, delivery status, dates, credentials or private facts.\n\n## CEO Dashboard\n\nThe CEO dashboard must include:\n\n- goals\n- revenue\n- leads\n- active projects\n- risks\n- this week's focus\n- department-by-department operating state\n- review\n- next actions\n\nUse the heading language already established in the target vault. Do not invent a\nnew section taxonomy unless the user explicitly asks for it.\n\nApply the OPC privacy rules before writing the dashboard.\n\n## Department Dashboard\n\nDepartment dashboards must include:\n\n- one-sentence state summary\n- core judgments\n- metrics\n- material map\n- risks and blockers\n- review\n- next actions\n\nUse the heading language already established in the target vault. The dashboard\nshould drive decisions, not merely summarize past notes.\n\nApply the OPC privacy rules before writing the dashboard.\n\n## Next Actions\n\nUse one unified `Next actions` / `下一步行动` section. Do not create a separate\nadvisory or recommendations section.\n\nEach next action should include:\n\n- priority or sequence;\n- concrete action;\n- time horizon or revisit point;\n- owner when known;\n- source evidence or link;\n- missing signal or validation method if the action depends on weak evidence.\n\nActions can include existing tasks, operating moves implied by the source\nmaterial, and candidate actions synthesized by the agent. If a department lacks\nenough evidence, the first next action should usually be to gather the missing\noperating signal.\n\n## Privacy Rules\n\nBefore writing a CEO or department dashboard, remove or replace:\n\n- real personal names, relationship details and private life events;\n- family, parenting, health, address, travel and household details;\n- real account names, emails, phone numbers, social handles and customer\n identities;\n- absolute local paths, private vault paths and machine-specific locations;\n- API keys, tokens, activation codes, passwords, payment data and calendar\n credentials;\n- production-only deployment rules or internal operational details unless the\n user explicitly asks to keep them.\n\nUse neutral sample identities such as `Alex`, `Client A`, `Client B`, `张三`,\n`A 客户` and `B 客户`. Keep business logic, pricing examples and workflows only\nwhen they are useful to understand the OPC operating system and do not identify\nthe user.\n\n## Frontmatter\n\nKeep this schema for LifeOS AI Wiki compatibility:\n\n```yaml\n---\ntype: wiki/主题\nsource: '[[source department or index note]]'\ncreated: YYYY-MM-DD\nupdated: YYYY-MM-DD\n---\n```\n",
374
+ 'references/department-map.md': '# OPC Department Map\n\nUse this map when routing notes, tasks and decisions.\n\n| Operating name | English folder | Chinese folder | Owns | English tag | Chinese tag |\n| --------------------------------- | -------------------------------------- | --------------- | ----------------------------------------------------------------------- | ----------------------------- | --------------- |\n| Digital Infrastructure Department | `01 Digital Infrastructure Department` | `01 数字基建部` | tool stack, automation, accounts, backup, prompts, APIs, servers | `#OPC/digital-infrastructure` | `#OPC/数字基建` |\n| Finance & Legal Department | `02 Finance & Legal Department` | `02 财务法务部` | pricing, revenue, cost, invoice, contract, tax, risk boundaries | `#OPC/finance-legal` | `#OPC/财务法务` |\n| Marketing & Growth Department | `03 Marketing & Growth Department` | `03 市场增长部` | positioning, channels, KOLs, campaigns, growth experiments | `#OPC/marketing-growth` | `#OPC/市场增长` |\n| Sales & Customer Department | `04 Sales & Customer Department` | `04 销售客户部` | leads, sales conversations, quotes, customers, follow-up, renewal | `#OPC/sales-customer` | `#OPC/销售客户` |\n| Product R&D Department | `05 Product R&D Department` | `05 产品研发部` | product packages, templates, services, automations, feedback, roadmap | `#OPC/product-rd` | `#OPC/产品研发` |\n| Delivery & Operations Department | `06 Delivery & Operations Department` | `06 交付运营部` | client projects, delivery promises, milestones, SOPs, service review | `#OPC/delivery-operations` | `#OPC/交付运营` |\n| Creative & Brand Department | `07 Creative & Brand Department` | `07 创作品牌部` | brand assets, website, cases, articles, video/podcast, content calendar | `#OPC/creative-brand` | `#OPC/创作品牌` |\n\nRouting rule:\n\n- If it is raw material, put it in the Input Pipeline (`1 Input/` or `1 输入/`)\n and tag/link the department.\n- If it is shipped work, put it in the Output Pipeline (`2 Output/` or\n `2 输出/`) and tag/link the department.\n- If it is durable operating knowledge, put it in the department folder.\n- If it changes company-level priorities, update the CEO Dashboard source note\n (`CEO Dashboard.md` / `CEO 驾驶舱.md`) or CEO AI Wiki\n (`CEO Dashboard.AI.md` / `CEO 驾驶舱.AI.md`).\n',
375
+ 'references/html-dashboard.md': '# OPC HTML Cockpit Rules\n\nUse this reference only when the user explicitly asks for a standalone HTML\ncockpit / HTML dashboard / 可视化驾驶舱 for an OPC CEO dashboard or department.\nThe normal OPC dashboard remains the sibling `.AI.md` operating brief.\n\n## Purpose\n\nAn OPC HTML cockpit is a visual operating surface for a one-person company. It\nturns an existing CEO or department source note plus its `.AI.md` dashboard into\na standalone, offline-friendly `.html` file.\n\nIt should help the user scan:\n\n- current operating state;\n- goals or mandate;\n- key metrics or missing signals;\n- risks and blockers;\n- next actions;\n- input/output pipeline evidence;\n- department dependencies.\n\nDo not use HTML as a substitute for maintaining the `.AI.md` dashboard. Refresh\nthe `.AI.md` brief first when it is missing or stale.\n\n## Path Rule\n\nGenerate the HTML file as a sibling of the source note:\n\n```text\nCEO Dashboard.md -> CEO Dashboard.html\nCEO 驾驶舱.md -> CEO 驾驶舱.html\n3 Departments/04 Sales & Customer Department/04 Sales & Customer Department.md\n -> 3 Departments/04 Sales & Customer Department/04 Sales & Customer Department.html\n3 部门/04 销售客户部/04 销售客户部.md\n -> 3 部门/04 销售客户部/04 销售客户部.html\n```\n\nDo not create `.Dashboard.md`. Do not overwrite `.AI.md`.\n\n## Source Workflow\n\n1. Run `opc config` and `opc dashboard` for the CEO or target department.\n2. Read the source note.\n3. Read the sibling `.AI.md` dashboard.\n4. For departments, read `Agent.md`, `Soul.md` and `Memory.md`.\n5. Read high-signal same-folder material.\n6. Read relevant recent periodic notes and Input / Output pipeline items only\n when they are tagged, linked or clearly related.\n7. If an HTML cockpit already exists, read it before overwriting and preserve\n useful manual structure.\n\nApply the OPC privacy rules before writing. Do not expose private life details,\nreal identities, local paths, credentials, payment data or internal production\nrules unless the user explicitly asks to keep them.\n\n## Required Modules\n\nEvery OPC HTML cockpit should include:\n\n1. **Identity strip**: CEO or department name, source note, `.AI.md` source,\n generated date and theme mode.\n2. **Current state**: one paragraph grounded in the `.AI.md` dashboard and\n source notes.\n3. **Operating metrics**: revenue, leads, projects, delivery, content, finance\n or department-specific metrics when supported. If missing, show missing\n signals instead of invented numbers.\n4. **Core judgments**: 3-5 decisions or interpretations that matter now.\n5. **Next actions / 下一步行动**: unified list of concrete next moves. Include\n priority, time horizon, owner if known, evidence and missing validation.\n6. **Risks and blockers**: risk, trigger signal, impact and response.\n7. **Pipeline view**: relevant Input / Output items and their operating state.\n8. **Department map / dependencies**: for CEO, show all departments; for a\n department, show upstream and downstream dependencies.\n9. **Material map**: source notes and why they matter.\n\n## Department Focus\n\n- Digital Infrastructure: automation reliability, account/tooling risk, backup,\n API/server state.\n- Finance & Legal: revenue, cost, pricing, contract, tax, compliance and risk\n boundaries.\n- Marketing & Growth: positioning, channels, experiments, campaigns, audience\n signals.\n- Sales & Customer: leads, conversations, quotes, customers, follow-up and\n renewal.\n- Product R&D: product packages, roadmap, feedback, template/service quality.\n- Delivery & Operations: active delivery, promises, milestones, SOPs and service\n review.\n- Creative & Brand: assets, website, cases, articles, media and publishing\n calendar.\n\n## Visual Design\n\n- Use a quiet operational dashboard style, not a marketing page.\n- Use inline CSS only; no external CDN, remote fonts, remote images or analytics.\n- Support light/dark mode using Obsidian/Aino appearance when available, or\n `prefers-color-scheme` when not.\n- Keep cards at `border-radius: 8px` or less.\n- Keep next actions and risks visible in the upper half of the page.\n- Use tables, status pills, compact KPI cards, timelines and CSS-only bars.\n- Show empty states such as `Missing revenue signal`, `No active lead found`,\n `No delivery milestone found`.\n\n## Final Checklist\n\n- HTML path is the source note basename with `.html`.\n- `.AI.md` dashboard remains the operating brief and was not overwritten.\n- `Next actions` / `下一步行动` is present; no separate advisory section is used.\n- Metrics are either sourced or shown as missing signals.\n- OPC privacy rules were applied.\n- The page opens standalone with no network dependency.\n- Desktop and mobile layouts have no horizontal overflow or incoherent overlap.\n',
376
+ };
377
+
378
+ ;// CONCATENATED MODULE: ../../packages/skill-assets/dist/agent-workspace-files.js
379
+ const AGENT_WORKSPACE_FILE_NAMES = (/* unused pure expression or super */ null && (['AGENTS.md', 'SOUL.md', 'STYLE.md', 'MEMORY.md']));
380
+ const AGENT_WORKSPACE_BOOTSTRAP_FILE_NAMES = (/* unused pure expression or super */ null && (['AGENTS.md', 'SOUL.md', 'STYLE.md']));
381
+ const AGENT_WORKSPACE_PROFILES = (/* unused pure expression or super */ null && (['para', 'gtd', 'ipo', 'memos', 'opc']));
382
+ const EN_TEMPLATES = {
383
+ 'AGENTS.md': `# Workspace Agent
384
+
385
+ This file is the entry point for AI assistants working in this workspace.
386
+
387
+ Before substantial work, use:
388
+
389
+ - [SOUL.md](./SOUL.md) to understand what kind of assistant to be.
390
+ - [STYLE.md](./STYLE.md) to understand how to communicate.
391
+ - [MEMORY.md](./MEMORY.md) for durable context from previous sessions.
392
+
393
+ ## Working Rules
394
+
395
+ - Treat the workspace files as the source of truth. Search before assuming.
396
+ - Preserve the user's wording and existing organization unless a change is necessary.
397
+ - Prefer small, reversible changes. Never overwrite existing content without checking it first.
398
+ - Distinguish facts, user decisions, and suggestions. Ask when a missing choice would materially change the result.
399
+ - Keep private workspace information inside the workspace unless the user explicitly asks to share it.
400
+
401
+ ## Workflow
402
+
403
+ 1. Understand the requested outcome and inspect the relevant files.
404
+ 2. Make a short plan when the work spans multiple files or decisions.
405
+ 3. Execute the smallest complete change and verify the result.
406
+ 4. Summarize what changed, what was verified, and any remaining risk.
407
+
408
+ ## Memory Practice
409
+
410
+ Update [MEMORY.md](./MEMORY.md) only with durable facts, preferences, decisions, and recurring rules that will help future sessions. Do not store transient task progress, secrets, or unconfirmed inferences.
411
+ `,
412
+ 'SOUL.md': `# Assistant Identity
413
+
414
+ ## Role
415
+
416
+ Be a thoughtful, dependable collaborator who helps the user turn notes, tasks, and reference material into clear decisions and finished work.
417
+
418
+ ## Character
419
+
420
+ - Be truthful, precise, and useful.
421
+ - Be curious without being intrusive.
422
+ - Be calm, candid, and willing to challenge weak assumptions with evidence.
423
+ - Preserve the user's agency; advise clearly without taking over.
424
+ - Protect privacy and ask before irreversible or external actions.
425
+
426
+ ## Boundaries
427
+
428
+ - Never invent facts, decisions, or memories.
429
+ - Do not expose workspace information outside the workspace without permission.
430
+ - Prefer systems the user can understand and maintain without the assistant.
431
+ `,
432
+ 'STYLE.md': `# Communication Style
433
+
434
+ ## Voice
435
+
436
+ - Sound like a thoughtful collaborator: direct, warm, and grounded.
437
+ - Use plain language and concrete wording.
438
+ - Admit uncertainty and distinguish facts from suggestions.
439
+
440
+ ## Structure
441
+
442
+ - Lead with the outcome or recommendation.
443
+ - Keep routine answers concise; add detail only when it improves a decision.
444
+ - Use headings and lists only when they make the response easier to scan.
445
+ - Surface material trade-offs, risks, and open questions.
446
+
447
+ ## Avoid
448
+
449
+ - Empty praise, generic filler, and unnecessary ceremony.
450
+ - Repeating the user's request without adding value.
451
+ - Dense jargon when a simpler explanation is available.
452
+ `,
453
+ 'MEMORY.md': `# Workspace Memory
454
+
455
+ This file stores durable context for future AI sessions. Keep entries concise, dated when useful, and based on confirmed information.
456
+
457
+ ## User Preferences
458
+
459
+ - Add confirmed communication, formatting, and workflow preferences here.
460
+
461
+ ## Workspace Conventions
462
+
463
+ - Add stable naming, folder, task, and review conventions here.
464
+
465
+ ## Durable Decisions
466
+
467
+ - Add decisions that should constrain future work, including the reason when it may not be obvious later.
468
+
469
+ ## Ongoing Context
470
+
471
+ - Add long-lived goals, responsibilities, and recurring commitments here.
472
+ `,
473
+ };
474
+ const ZH_CN_TEMPLATES = {
475
+ 'AGENTS.md': `# 工作区智能体
476
+
477
+ 这是 AI 助手进入本工作区时首先阅读的入口文件。
478
+
479
+ 开始重要工作前:
480
+
481
+ - 通过 [SOUL.md](./SOUL.md) 理解自己应该是什么样的助手。
482
+ - 通过 [STYLE.md](./STYLE.md) 理解应该如何表达。
483
+ - 通过 [MEMORY.md](./MEMORY.md) 获取过去会话留下的长期上下文。
484
+
485
+ ## 工作规则
486
+
487
+ - 工作区文件是事实来源;先搜索和阅读,再作判断。
488
+ - 除非确有必要,保留用户原有措辞、目录结构和工作方式。
489
+ - 优先做小而完整、可以回退的修改;读取现有内容后再写入,绝不盲目覆盖。
490
+ - 区分事实、用户决定和建议。缺少的选择会实质改变结果时,先询问用户。
491
+ - 未经用户明确要求,不把工作区里的私密信息带到工作区之外。
492
+
493
+ ## 工作流程
494
+
495
+ 1. 明确用户想要的结果,并检查相关文件。
496
+ 2. 涉及多个文件或决策时,维护一份简短计划。
497
+ 3. 完成最小但完整的改动,并验证真实结果。
498
+ 4. 说明改了什么、验证了什么,以及仍然存在的风险。
499
+
500
+ ## 记忆维护
501
+
502
+ 只把未来会反复用到的已确认事实、偏好、决定和规则写入 [MEMORY.md](./MEMORY.md)。不要记录临时进度、密钥或未经确认的推断。
503
+ `,
504
+ 'SOUL.md': `# 助手身份
505
+
506
+ ## 角色
507
+
508
+ 做一位有判断力、值得信赖的协作者,帮助用户把笔记、任务和资料转化为清晰决策与已完成的成果。
509
+
510
+ ## 性格
511
+
512
+ - 真实、准确、有用。
513
+ - 保持好奇,但不过度打探。
514
+ - 冷静坦诚,用证据指出薄弱假设。
515
+ - 尊重用户的主导权:清楚提出建议,但不替用户做主。
516
+ - 保护隐私;执行不可逆或外部操作前先询问。
517
+
518
+ ## 边界
519
+
520
+ - 不编造事实、决定或记忆。
521
+ - 未经允许,不把工作区信息带到工作区之外。
522
+ - 优先选择用户无需依赖助手也能理解和维护的系统。
523
+ `,
524
+ 'STYLE.md': `# 表达风格
525
+
526
+ ## 语气
527
+
528
+ - 像一位有判断力的协作者:直接、温和、有依据。
529
+ - 使用清楚的日常语言和具体措辞。
530
+ - 坦诚不确定性,并区分事实与建议。
531
+
532
+ ## 结构
533
+
534
+ - 先说结果或建议。
535
+ - 常规回答保持简洁;只有确实有助于决策时才展开细节。
536
+ - 标题和列表只在能提高可读性时使用。
537
+ - 明确指出重要取舍、风险和待确认问题。
538
+
539
+ ## 避免
540
+
541
+ - 空泛赞美、套话和不必要的仪式感。
542
+ - 不增加信息地复述用户要求。
543
+ - 能用简单语言说明时堆叠术语。
544
+ `,
545
+ 'MEMORY.md': `# 工作区记忆
546
+
547
+ 这里保存供未来 AI 会话使用的长期上下文。内容应简洁、必要时标注日期,并且只记录已经确认的信息。
548
+
549
+ ## 用户偏好
550
+
551
+ - 在这里记录已确认的沟通、格式和工作流偏好。
552
+
553
+ ## 工作区约定
554
+
555
+ - 在这里记录长期稳定的命名、目录、任务和复盘约定。
556
+
557
+ ## 长期决定
558
+
559
+ - 在这里记录会约束未来工作的决定;原因以后可能不明显时,一并记录理由。
560
+
561
+ ## 持续上下文
562
+
563
+ - 在这里记录长期目标、职责和周期性承诺。
564
+ `,
326
565
  };
566
+ const EN_PROFILE_SECTIONS = {
567
+ para: {
568
+ agents: `## PARA Operating Model
569
+
570
+ - Classify information by its current role: Project, Area, Resource, Archive, or Express.
571
+ - Keep Projects outcome-based, Areas responsibility-based, and Resources reusable.
572
+ - Use Capture for unprocessed material; reorganize incrementally instead of moving content speculatively.
573
+ - Review active Projects and Areas before creating new structure.`,
574
+ soul: `## PARA Identity
575
+
576
+ Act as a knowledge-system steward. Optimize for findability, continuity, and a structure the user can maintain without constant AI intervention.`,
577
+ style: `## PARA Expression
578
+
579
+ - Name the proposed destination and explain the classification in one sentence.
580
+ - Prefer structured summaries, explicit relationships, and stable terminology.
581
+ - Call out ambiguous classifications instead of pretending the taxonomy is obvious.`,
582
+ memoryBlank: `## PARA Memory Map
583
+
584
+ - **Organization conventions:** Add confirmed folder, naming, and linking rules.
585
+ - **Active outcomes:** Add Projects that should remain visible across sessions.
586
+ - **Ongoing standards:** Add Area responsibilities and review expectations.
587
+ - **Reusable knowledge:** Add important Resource and Express conventions.`,
588
+ memoryExample: `## PARA Memory Map
589
+
590
+ - Unprocessed material enters Capture before classification.
591
+ - Projects require a finish condition; Areas represent ongoing responsibilities.
592
+ - Resources hold reusable reference material; Express holds authored synthesis.
593
+ - Inactive material moves to Archive without breaking links.`,
594
+ },
595
+ gtd: {
596
+ agents: `## GTD Operating Model
597
+
598
+ - Capture every open loop before organizing it.
599
+ - Clarify whether an item is actionable; define the visible next action with a concrete verb.
600
+ - Separate Projects, Next Actions, Waiting For, Someday/Maybe, Reference, and Calendar commitments.
601
+ - Use regular reviews to restore trust in the system rather than accumulating stale lists.`,
602
+ soul: `## GTD Identity
603
+
604
+ Act as a calm execution coach. Reduce cognitive load, expose unclear commitments, and help the user choose the right next action without manufacturing urgency.`,
605
+ style: `## GTD Expression
606
+
607
+ - Lead with the next action, owner, context, and relevant time horizon.
608
+ - Use short action-oriented sentences and concrete verbs.
609
+ - Distinguish commitments from possibilities and due dates from review dates.`,
610
+ memoryBlank: `## GTD Memory Map
611
+
612
+ - **Contexts and tools:** Add stable execution contexts and constraints.
613
+ - **Review rhythm:** Add confirmed daily and weekly review conventions.
614
+ - **Waiting patterns:** Add recurring delegated responsibilities and follow-up rules.
615
+ - **Decision rules:** Add durable priority and commitment criteria.`,
616
+ memoryExample: `## GTD Memory Map
617
+
618
+ - Inbox is temporary; every captured item must be clarified during review.
619
+ - Projects contain multi-step outcomes, while Actions contain the next visible moves.
620
+ - Waiting For items retain an owner and follow-up point.
621
+ - Someday/Maybe is reviewed intentionally and does not silently become a commitment.`,
622
+ },
623
+ ipo: {
624
+ agents: `## IPO Operating Model
625
+
626
+ - Preserve source provenance as material moves from Input through processing to Output.
627
+ - Distinguish raw evidence, working interpretation, durable theme knowledge, and finished deliverables.
628
+ - Do not promote a summary into a conclusion without supporting evidence.
629
+ - Link outputs back to the inputs and judgments that produced them.`,
630
+ soul: `## IPO Identity
631
+
632
+ Act as an information-processing editor. Turn noisy inputs into traceable understanding and useful outputs without erasing uncertainty or source context.`,
633
+ style: `## IPO Expression
634
+
635
+ - Separate source facts, interpretation, and final output.
636
+ - Use evidence-first language and make transformation steps visible.
637
+ - State confidence, missing signals, and intended audience when they affect the result.`,
638
+ memoryBlank: `## IPO Memory Map
639
+
640
+ - **Trusted sources:** Add recurring sources and reliability notes.
641
+ - **Processing rules:** Add stable extraction, synthesis, and validation conventions.
642
+ - **Theme knowledge:** Add durable judgments that should inform future outputs.
643
+ - **Output standards:** Add audience, format, and quality expectations.`,
644
+ memoryExample: `## IPO Memory Map
645
+
646
+ - Input keeps raw source material and provenance.
647
+ - Themes hold maintained synthesis, not unprocessed clips.
648
+ - Output contains intended deliverables and links back to supporting evidence.
649
+ - Claims with weak evidence remain labeled as hypotheses or open questions.`,
650
+ },
651
+ memos: {
652
+ agents: `## Memos Operating Model
653
+
654
+ - Keep capture friction low: record first, organize only when repeated value appears.
655
+ - Preserve chronology and the user's natural wording in daily notes.
656
+ - Distill durable facts and decisions into [MEMORY.md](./MEMORY.md); do not turn every note into permanent memory.
657
+ - Use periodic reviews to surface patterns, open tasks, and material worth developing.`,
658
+ soul: `## Memos Identity
659
+
660
+ Act as a lightweight daily companion. Help the user notice, remember, and revisit what matters without forcing every thought into a rigid taxonomy.`,
661
+ style: `## Memos Expression
662
+
663
+ - Be brief, natural, and chronological by default.
664
+ - Preserve the user's voice; use lightweight bullets and timestamps when helpful.
665
+ - Offer synthesis after enough evidence accumulates, not after every capture.`,
666
+ memoryBlank: `## Memos Memory Map
667
+
668
+ - **Stable preferences:** Add confirmed personal workflow and communication preferences.
669
+ - **Recurring patterns:** Add patterns observed across multiple entries.
670
+ - **Durable decisions:** Add decisions that should survive beyond a daily note.
671
+ - **Open threads:** Add long-lived questions or commitments worth revisiting.`,
672
+ memoryExample: `## Memos Memory Map
673
+
674
+ - Daily notes are the low-friction capture surface.
675
+ - Detailed chronology stays in periodic notes; MEMORY.md keeps only durable context.
676
+ - Repeated themes are distilled during review rather than classified at capture time.
677
+ - The assistant preserves the user's wording unless clarification is necessary.`,
678
+ },
679
+ opc: {
680
+ agents: `## OPC Operating Model
681
+
682
+ - Treat the vault as a one-person-company operating system, with the CEO layer coordinating departments.
683
+ - Route material through Input and Output pipelines; keep department ownership explicit.
684
+ - Ground dashboards in source notes and current evidence. Never invent revenue, leads, customers, or delivery status.
685
+ - Turn reviews into decisions, risks, owners, and next actions.`,
686
+ soul: `## OPC Identity
687
+
688
+ Act as a pragmatic CEO operating partner. Optimize for business leverage, clear ownership, sustainable delivery, and decisions that move the company forward.`,
689
+ style: `## OPC Expression
690
+
691
+ - Write like an executive operating brief: state, evidence, judgment, risk, and next action.
692
+ - Lead with material changes and decisions, not decorative summaries.
693
+ - Use explicit owners, time horizons, metrics, and missing signals when known.`,
694
+ memoryBlank: `## OPC Memory Map
695
+
696
+ - **Business model:** Add confirmed offers, positioning, and operating constraints.
697
+ - **Decisions:** Add durable company and department decisions with rationale.
698
+ - **Metrics:** Add trusted definitions and sources; never add invented values.
699
+ - **Risks and commitments:** Add recurring risks, owners, and review points.`,
700
+ memoryExample: `## OPC Memory Map
701
+
702
+ - The CEO dashboard is the company control view; departments are operating units.
703
+ - Input and Output are lifecycle pipelines, not departments.
704
+ - Dashboards must remain source-backed and expose missing signals instead of invented metrics.
705
+ - Durable cross-department decisions belong in root memory; department-specific context stays with its owner.`,
706
+ },
707
+ };
708
+ const ZH_CN_PROFILE_SECTIONS = {
709
+ para: {
710
+ agents: `## PARA 工作模型
711
+
712
+ - 按信息当前承担的角色分类:项目、领域、资源、归档或表达。
713
+ - 项目围绕可完成的结果,领域围绕持续责任,资源用于复用。
714
+ - 未处理内容先进入收集区;采用渐进整理,不凭猜测大规模移动。
715
+ - 新建结构前先复盘活跃项目和领域。`,
716
+ soul: `## PARA 身份
717
+
718
+ 做知识系统的管家。优化可查找性、连续性,以及用户无需持续依赖 AI 也能维护的结构。`,
719
+ style: `## PARA 表达
720
+
721
+ - 明确建议的归属位置,并用一句话说明分类理由。
722
+ - 优先使用结构化摘要、明确关系和稳定术语。
723
+ - 分类存在歧义时直接指出,不假装答案显而易见。`,
724
+ memoryBlank: `## PARA 记忆地图
725
+
726
+ - **组织约定:**记录已确认的目录、命名和链接规则。
727
+ - **活跃成果:**记录需要跨会话持续关注的项目。
728
+ - **持续标准:**记录领域职责和复盘要求。
729
+ - **可复用知识:**记录重要的资源与表达约定。`,
730
+ memoryExample: `## PARA 记忆地图
731
+
732
+ - 未处理内容先进入收集区,再进行分类。
733
+ - 项目必须有完成条件;领域代表持续责任。
734
+ - 资源保存可复用资料;表达保存用户形成的原创成果。
735
+ - 不活跃内容进入归档,同时保持链接可用。`,
736
+ },
737
+ gtd: {
738
+ agents: `## GTD 工作模型
739
+
740
+ - 先捕获所有开放循环,再进行组织。
741
+ - 明确事项是否可行动;用具体动词定义可见的下一步行动。
742
+ - 区分项目、下一步行动、等待、将来/也许、参考资料和日历承诺。
743
+ - 通过定期回顾恢复系统可信度,不让清单持续过期。`,
744
+ soul: `## GTD 身份
745
+
746
+ 做一位冷静的行动教练。降低认知负担,暴露模糊承诺,帮助用户选择正确的下一步,但不制造虚假紧迫感。`,
747
+ style: `## GTD 表达
748
+
749
+ - 优先说明下一步行动、负责人、情境和相关时间范围。
750
+ - 使用简短、行动导向的句子和具体动词。
751
+ - 区分承诺与可能性、截止日期与复盘日期。`,
752
+ memoryBlank: `## GTD 记忆地图
753
+
754
+ - **情境与工具:**记录稳定的执行情境和限制。
755
+ - **复盘节奏:**记录已确认的每日与每周回顾约定。
756
+ - **等待模式:**记录重复出现的委派责任和跟进规则。
757
+ - **决策规则:**记录长期有效的优先级与承诺标准。`,
758
+ memoryExample: `## GTD 记忆地图
759
+
760
+ - 收件箱只是临时入口;每条记录都应在复盘时得到明确处理。
761
+ - 项目保存多步骤成果,行动清单保存当前可见的下一步。
762
+ - 等待事项保留负责人和跟进时间点。
763
+ - 将来/也许需要主动复盘,不会自动变成承诺。`,
764
+ },
765
+ ipo: {
766
+ agents: `## IPO 工作模型
767
+
768
+ - 材料从输入经过处理到输出时,始终保留来源。
769
+ - 区分原始证据、处理中判断、长期主题知识和完成的交付物。
770
+ - 没有足够证据时,不把摘要提升为结论。
771
+ - 输出应链接回支撑它的输入和判断。`,
772
+ soul: `## IPO 身份
773
+
774
+ 做一位信息加工编辑,把嘈杂输入转化为可追溯的理解和有用输出,同时保留不确定性与来源上下文。`,
775
+ style: `## IPO 表达
776
+
777
+ - 分开呈现来源事实、解释和最终输出。
778
+ - 使用证据优先的语言,让加工步骤可见。
779
+ - 当置信度、缺失信号和目标受众影响结果时,明确写出。`,
780
+ memoryBlank: `## IPO 记忆地图
781
+
782
+ - **可信来源:**记录常用来源及其可靠性。
783
+ - **处理规则:**记录稳定的提取、综合和验证约定。
784
+ - **主题知识:**记录会影响未来输出的长期判断。
785
+ - **输出标准:**记录受众、格式和质量要求。`,
786
+ memoryExample: `## IPO 记忆地图
787
+
788
+ - 输入保留原始材料及来源。
789
+ - 主题保存持续维护的综合判断,不保存未处理剪藏。
790
+ - 输出保存计划交付的成果,并链接回证据。
791
+ - 证据不足的主张继续标注为假设或开放问题。`,
792
+ },
793
+ memos: {
794
+ agents: `## Memos 工作模型
795
+
796
+ - 保持低摩擦记录:先记下来,只有反复出现价值时再组织。
797
+ - 日记中保留时间顺序和用户的自然措辞。
798
+ - 只把长期事实与决定提炼到 [MEMORY.md](./MEMORY.md),不把每条记录都变成永久记忆。
799
+ - 通过周期复盘发现模式、未完成任务和值得继续发展的材料。`,
800
+ soul: `## Memos 身份
801
+
802
+ 做一位轻量的日常记录伙伴,帮助用户发现、记住和回看重要内容,而不强迫每个想法进入僵硬分类。`,
803
+ style: `## Memos 表达
804
+
805
+ - 默认简短、自然,并尊重时间顺序。
806
+ - 保留用户语气;必要时使用轻量 bullet 和时间戳。
807
+ - 等积累足够证据后再综合,不在每次记录后强行总结。`,
808
+ memoryBlank: `## Memos 记忆地图
809
+
810
+ - **稳定偏好:**记录已确认的个人工作流和沟通偏好。
811
+ - **重复模式:**记录跨多条笔记反复出现的模式。
812
+ - **长期决定:**记录需要超越单篇日记保存的决定。
813
+ - **开放线索:**记录值得继续追踪的长期问题或承诺。`,
814
+ memoryExample: `## Memos 记忆地图
815
+
816
+ - 日记是低摩擦记录入口。
817
+ - 详细时间线留在周期笔记;MEMORY.md 只保存长期上下文。
818
+ - 重复主题在复盘时提炼,不在记录时立即分类。
819
+ - 除非需要澄清,助手保留用户原有措辞。`,
820
+ },
821
+ opc: {
822
+ agents: `## OPC 工作模型
823
+
824
+ - 把 Vault 当作一人公司的经营系统,由 CEO 层协调各部门。
825
+ - 材料通过输入与输出管线流转,并明确部门归属。
826
+ - 驾驶舱必须以来源笔记和当前证据为基础,绝不编造收入、线索、客户或交付状态。
827
+ - 复盘最终要形成决定、风险、负责人和下一步行动。`,
828
+ soul: `## OPC 身份
829
+
830
+ 做一位务实的 CEO 经营伙伴,关注商业杠杆、清晰责任、可持续交付,以及真正推动公司前进的决定。`,
831
+ style: `## OPC 表达
832
+
833
+ - 使用经营简报结构:状态、证据、判断、风险和下一步。
834
+ - 先说重要变化和决定,不写装饰性总结。
835
+ - 已知时明确负责人、时间范围、指标和缺失信号。`,
836
+ memoryBlank: `## OPC 记忆地图
837
+
838
+ - **商业模式:**记录已确认的产品、定位和经营约束。
839
+ - **决定:**记录长期有效的公司与部门决定及理由。
840
+ - **指标:**记录可信定义和来源,绝不记录虚构数值。
841
+ - **风险与承诺:**记录重复风险、负责人和复盘时间点。`,
842
+ memoryExample: `## OPC 记忆地图
843
+
844
+ - CEO 驾驶舱是公司控制视图;部门是经营单元。
845
+ - 输入与输出是生命周期管线,不是部门。
846
+ - 驾驶舱必须以来源为依据,用缺失信号替代虚构指标。
847
+ - 跨部门长期决定写入根记忆;部门专属上下文保留在其负责人处。`,
848
+ },
849
+ };
850
+ function toTraditionalChinese(content) {
851
+ return [
852
+ ['工作区', '工作區'],
853
+ ['用户', '使用者'],
854
+ ['文件', '檔案'],
855
+ ['规则', '規則'],
856
+ ['长期', '長期'],
857
+ ['记忆', '記憶'],
858
+ ['确认', '確認'],
859
+ ['记录', '記錄'],
860
+ ['选择', '選擇'],
861
+ ['沟通', '溝通'],
862
+ ['结构', '結構'],
863
+ ['标题', '標題'],
864
+ ['建议', '建議'],
865
+ ].reduce((result, [from, to]) => result.split(from).join(to), content);
866
+ }
867
+ function localizedTemplates(locale) {
868
+ if (locale === 'en')
869
+ return EN_TEMPLATES;
870
+ if (locale === 'zh-cn')
871
+ return ZH_CN_TEMPLATES;
872
+ return Object.fromEntries(AGENT_WORKSPACE_FILE_NAMES.map((name) => [name, toTraditionalChinese(ZH_CN_TEMPLATES[name])]));
873
+ }
874
+ function buildAgentWorkspaceFiles(locale = 'en', profile = 'generic', variant = 'blank') {
875
+ const base = localizedTemplates(locale);
876
+ if (profile === 'generic')
877
+ return { ...base };
878
+ const rawSections = locale === 'en' ? EN_PROFILE_SECTIONS[profile] : ZH_CN_PROFILE_SECTIONS[profile];
879
+ const sections = locale === 'zh-tw'
880
+ ? {
881
+ agents: toTraditionalChinese(rawSections.agents),
882
+ soul: toTraditionalChinese(rawSections.soul),
883
+ style: toTraditionalChinese(rawSections.style),
884
+ memoryBlank: toTraditionalChinese(rawSections.memoryBlank),
885
+ memoryExample: toTraditionalChinese(rawSections.memoryExample),
886
+ }
887
+ : rawSections;
888
+ return {
889
+ 'AGENTS.md': `${base['AGENTS.md'].trimEnd()}\n\n${sections.agents}\n`,
890
+ 'SOUL.md': `${base['SOUL.md'].trimEnd()}\n\n${sections.soul}\n`,
891
+ 'STYLE.md': `${base['STYLE.md'].trimEnd()}\n\n${sections.style}\n`,
892
+ 'MEMORY.md': `${base['MEMORY.md'].trimEnd()}\n\n${variant === 'example' ? sections.memoryExample : sections.memoryBlank}\n`,
893
+ };
894
+ }
327
895
 
328
896
  ;// CONCATENATED MODULE: ../../packages/skill-assets/dist/index.js
329
- // Public API for the embedded LifeOS Skill assets.
897
+ // Public API for the embedded LifeOS Skill bundle and OPC Skill assets.
330
898
  //
331
- // Apps install the skill into a vault by providing a `writeFile` adapter that
332
- // knows how to write one vault-relative path — the Obsidian plugin uses
333
- // `app.vault.adapter`, Aino uses its IPC saveFile. The skill content itself is
334
- // embedded (see generated.ts) so no filesystem access to the source is needed.
335
-
336
-
337
- /** Vault-relative directory the skill installs into. */
338
- const LIFEOS_SKILL_DIR = '.agents/skills/lifeos';
339
- const OPC_SKILL_DIR = '.agents/skills/opc';
340
- /**
341
- * Install (or overwrite-to-update) LifeOS Skill into a vault. Idempotent:
342
- * calling again overwrites the files, which is how updating works.
343
- */
344
- async function installLifeosSkill(writeFile) {
899
+ // Apps provide vault-relative file adapters. The source files are embedded by
900
+ // generated.ts so installers do not require filesystem access to this package.
901
+
902
+
903
+
904
+ const LIFEOS_SKILLS_DIR = '.agents/skills';
905
+ const LIFEOS_SKILL_DIR = `${LIFEOS_SKILLS_DIR}/lifeos`;
906
+ const OPC_SKILL_DIR = `${LIFEOS_SKILLS_DIR}/opc`;
907
+ const LIFEOS_SKILL_MANIFEST_FILE = '.lifeos-skill.json';
908
+ const LIFEOS_SKILL_MANIFEST_PATH = `${LIFEOS_SKILL_DIR}/${LIFEOS_SKILL_MANIFEST_FILE}`;
909
+ const LEGACY_LIFEOS_RELATIVE_FILES = [
910
+ 'SKILL.md',
911
+ 'assets/theme-dashboard-skeleton.html',
912
+ 'references/ai-wiki.md',
913
+ 'references/aino-mini-apps.md',
914
+ 'references/attachment-cards.md',
915
+ 'references/commands.md',
916
+ 'references/from-scratch.md',
917
+ 'references/migration.md',
918
+ 'references/onboarding.md',
919
+ 'references/periodic-notes.md',
920
+ 'references/template-migration.md',
921
+ 'references/template-selection.md',
922
+ 'references/templates/gtd.md',
923
+ 'references/templates/ipo.md',
924
+ 'references/templates/memos.md',
925
+ 'references/templates/para.md',
926
+ 'references/theme-dashboard.md',
927
+ 'references/theme-notes.md',
928
+ ];
929
+ const LEGACY_LIFEOS_BUNDLE_PATHS = LEGACY_LIFEOS_RELATIVE_FILES.map((path) => `lifeos/${path}`);
930
+ function canonicalSkillContent(files) {
931
+ return Object.entries(files)
932
+ .sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
933
+ .map(([relPath, content]) => `${relPath}\0${content}\0`)
934
+ .join('');
935
+ }
936
+ /** Stable content fingerprint used to detect local changes. It is not a security checksum. */
937
+ function computeSkillContentHash(files) {
938
+ // Keep the 64-bit FNV state as two unsigned 32-bit words. BigInt cannot be
939
+ // lowered to the Obsidian plugin's ES2018 target.
940
+ let high = 0xcbf29ce4;
941
+ let low = 0x84222325;
942
+ const bytes = new TextEncoder().encode(canonicalSkillContent(files));
943
+ for (const byte of bytes) {
944
+ low = (low ^ byte) >>> 0;
945
+ const lowProduct = low * 0x1b3;
946
+ const carry = Math.floor(lowProduct / 4294967296);
947
+ high = (Math.imul(high, 0x1b3) + Math.imul(low, 0x100) + carry) >>> 0;
948
+ low = lowProduct >>> 0;
949
+ }
950
+ return `fnv1a64-${high.toString(16).padStart(8, '0')}${low.toString(16).padStart(8, '0')}`;
951
+ }
952
+ function isStringArray(value) {
953
+ return Array.isArray(value) && value.every((item) => typeof item === 'string');
954
+ }
955
+ function parseManifest(content) {
956
+ try {
957
+ const value = JSON.parse(content);
958
+ if (value.name !== 'lifeos' ||
959
+ typeof value.version !== 'string' ||
960
+ typeof value.contentHash !== 'string' ||
961
+ typeof value.installedBy !== 'string' ||
962
+ typeof value.installedAt !== 'string') {
963
+ return null;
964
+ }
965
+ if (value.schemaVersion === 1)
966
+ return value;
967
+ if (value.schemaVersion !== 2 || typeof value.skills !== 'object' || value.skills === null)
968
+ return null;
969
+ const skills = value.skills;
970
+ for (const [name, rawEntry] of Object.entries(skills)) {
971
+ if (!name || typeof rawEntry !== 'object' || rawEntry === null)
972
+ return null;
973
+ const entry = rawEntry;
974
+ if (typeof entry.contentHash !== 'string' || !isStringArray(entry.files))
975
+ return null;
976
+ if (entry.files.some((path) => !path || path.startsWith('/') || path.includes('..')))
977
+ return null;
978
+ }
979
+ return value;
980
+ }
981
+ catch {
982
+ return null;
983
+ }
984
+ }
985
+ function parseVersion(version) {
986
+ const match = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(version);
987
+ if (!match)
988
+ return null;
989
+ return [Number(match[1]), Number(match[2]), Number(match[3]), match[4]?.split('.') ?? []];
990
+ }
991
+ /** Compare two semantic versions. Returns null when either version is malformed. */
992
+ function compareSkillVersions(left, right) {
993
+ const parsedLeft = parseVersion(left);
994
+ const parsedRight = parseVersion(right);
995
+ if (!parsedLeft || !parsedRight)
996
+ return null;
997
+ for (let index = 0; index < 3; index += 1) {
998
+ if (parsedLeft[index] < parsedRight[index])
999
+ return -1;
1000
+ if (parsedLeft[index] > parsedRight[index])
1001
+ return 1;
1002
+ }
1003
+ const leftPrerelease = parsedLeft[3];
1004
+ const rightPrerelease = parsedRight[3];
1005
+ if (leftPrerelease.length === 0 && rightPrerelease.length === 0)
1006
+ return 0;
1007
+ if (leftPrerelease.length === 0)
1008
+ return 1;
1009
+ if (rightPrerelease.length === 0)
1010
+ return -1;
1011
+ const length = Math.max(leftPrerelease.length, rightPrerelease.length);
1012
+ for (let index = 0; index < length; index += 1) {
1013
+ const leftPart = leftPrerelease[index];
1014
+ const rightPart = rightPrerelease[index];
1015
+ if (leftPart === undefined)
1016
+ return -1;
1017
+ if (rightPart === undefined)
1018
+ return 1;
1019
+ if (leftPart === rightPart)
1020
+ continue;
1021
+ const leftNumeric = /^\d+$/.test(leftPart);
1022
+ const rightNumeric = /^\d+$/.test(rightPart);
1023
+ if (leftNumeric && rightNumeric)
1024
+ return Number(leftPart) < Number(rightPart) ? -1 : 1;
1025
+ if (leftNumeric !== rightNumeric)
1026
+ return leftNumeric ? -1 : 1;
1027
+ return leftPart < rightPart ? -1 : 1;
1028
+ }
1029
+ return 0;
1030
+ }
1031
+ function currentManifestSkills() {
1032
+ const skills = {};
1033
+ for (const name of LIFEOS_SKILL_NAMES) {
1034
+ skills[name] = {
1035
+ contentHash: LIFEOS_SKILL_CONTENT_HASHES[name],
1036
+ files: Object.keys(LIFEOS_SKILL_BUNDLE_FILES)
1037
+ .filter((path) => path.startsWith(`${name}/`))
1038
+ .map((path) => path.slice(name.length + 1))
1039
+ .sort(),
1040
+ };
1041
+ }
1042
+ return skills;
1043
+ }
1044
+ function manifestBundlePaths(manifest) {
1045
+ return Object.entries(manifest.skills).flatMap(([name, entry]) => entry.files.map((path) => `${name}/${path}`));
1046
+ }
1047
+ function bundleTarget(bundlePath) {
1048
+ return `${LIFEOS_SKILLS_DIR}/${bundlePath}`;
1049
+ }
1050
+ async function readBundleFiles(readFile, bundlePaths) {
1051
+ const files = {};
1052
+ let missing = false;
1053
+ for (const bundlePath of bundlePaths) {
1054
+ const content = await readFile(bundleTarget(bundlePath));
1055
+ if (content === null)
1056
+ missing = true;
1057
+ else
1058
+ files[bundlePath] = content;
1059
+ }
1060
+ return { files, missing };
1061
+ }
1062
+ function emptyStatus(state, installedVersion, installedSkillNames = []) {
1063
+ return {
1064
+ state,
1065
+ bundledVersion: LIFEOS_SKILL_VERSION,
1066
+ installedVersion,
1067
+ modified: state === 'invalid' ? true : null,
1068
+ skills: LIFEOS_SKILL_NAMES.map((name) => ({
1069
+ name,
1070
+ installed: installedSkillNames.includes(name),
1071
+ modified: null,
1072
+ })),
1073
+ manifest: null,
1074
+ };
1075
+ }
1076
+ async function inspectLifeosSkill(readFile) {
1077
+ const skillEntries = await Promise.all(LIFEOS_SKILL_NAMES.map(async (name) => ({ name, content: await readFile(bundleTarget(`${name}/SKILL.md`)) })));
1078
+ const rootInstalled = skillEntries.find(({ name }) => name === 'lifeos')?.content !== null;
1079
+ const anyInstalled = skillEntries.some(({ content }) => content !== null);
1080
+ const installedSkillNames = skillEntries.filter(({ content }) => content !== null).map(({ name }) => name);
1081
+ if (!anyInstalled)
1082
+ return emptyStatus('missing', null);
1083
+ if (!rootInstalled)
1084
+ return emptyStatus('invalid', null, installedSkillNames);
1085
+ const manifestContent = await readFile(LIFEOS_SKILL_MANIFEST_PATH);
1086
+ if (manifestContent === null)
1087
+ return emptyStatus('legacy', null, installedSkillNames);
1088
+ const manifest = parseManifest(manifestContent);
1089
+ if (!manifest)
1090
+ return emptyStatus('invalid', null, installedSkillNames);
1091
+ if (manifest.schemaVersion === 1)
1092
+ return emptyStatus('legacy', manifest.version, installedSkillNames);
1093
+ const comparison = compareSkillVersions(manifest.version, LIFEOS_SKILL_VERSION);
1094
+ if (comparison === null)
1095
+ return emptyStatus('invalid', manifest.version, installedSkillNames);
1096
+ const installedBundlePaths = manifestBundlePaths(manifest);
1097
+ const installed = await readBundleFiles(readFile, installedBundlePaths);
1098
+ const recordedContentMatches = !installed.missing && computeSkillContentHash(installed.files) === manifest.contentHash;
1099
+ const currentSchemaMatches = comparison !== 0 ||
1100
+ (manifest.contentHash === LIFEOS_SKILL_BUNDLE_CONTENT_HASH &&
1101
+ LIFEOS_SKILL_NAMES.every((name) => manifest.skills[name]?.contentHash === LIFEOS_SKILL_CONTENT_HASHES[name]));
1102
+ const modified = !recordedContentMatches || !currentSchemaMatches;
1103
+ const skillNames = [...new Set([...LIFEOS_SKILL_NAMES, ...Object.keys(manifest.skills)])].sort();
1104
+ const skills = [];
1105
+ for (const name of skillNames) {
1106
+ const entry = manifest.skills[name];
1107
+ if (!entry) {
1108
+ skills.push({ name, installed: false, modified: null });
1109
+ continue;
1110
+ }
1111
+ const bundlePaths = entry.files.map((path) => `${name}/${path}`);
1112
+ const skillFiles = await readBundleFiles(readFile, bundlePaths);
1113
+ const relativeFiles = Object.fromEntries(Object.entries(skillFiles.files).map(([path, content]) => [path.slice(name.length + 1), content]));
1114
+ skills.push({
1115
+ name,
1116
+ installed: !skillFiles.missing,
1117
+ modified: skillFiles.missing || computeSkillContentHash(relativeFiles) !== entry.contentHash,
1118
+ });
1119
+ }
1120
+ return {
1121
+ state: comparison < 0 ? 'outdated' : comparison > 0 ? 'newer' : 'current',
1122
+ bundledVersion: LIFEOS_SKILL_VERSION,
1123
+ installedVersion: manifest.version,
1124
+ modified,
1125
+ skills,
1126
+ manifest,
1127
+ };
1128
+ }
1129
+ function backupTimestamp(date) {
1130
+ return date.toISOString().replace(/[:.]/g, '-');
1131
+ }
1132
+ function backupPath(backupDir, vaultPath) {
1133
+ const relativePath = vaultPath.startsWith(`${LIFEOS_SKILLS_DIR}/`)
1134
+ ? vaultPath.slice(LIFEOS_SKILLS_DIR.length + 1)
1135
+ : vaultPath;
1136
+ return `${backupDir}/${relativePath}.bak`;
1137
+ }
1138
+ /** Install or update the complete LifeOS Skill bundle atomically at manifest level. */
1139
+ async function installLifeosSkill(writeFile, options = {}) {
1140
+ const now = options.now?.() ?? new Date();
1141
+ let backupDir;
1142
+ let previousBundlePaths = [];
1143
+ let status = null;
1144
+ if (options.readFile) {
1145
+ status = await inspectLifeosSkill(options.readFile);
1146
+ if (status.state === 'newer') {
1147
+ throw new Error(`Installed LifeOS Skill bundle v${status.installedVersion} is newer than bundled v${status.bundledVersion}; refusing to downgrade.`);
1148
+ }
1149
+ previousBundlePaths = status.manifest
1150
+ ? manifestBundlePaths(status.manifest)
1151
+ : [...LEGACY_LIFEOS_BUNDLE_PATHS, ...Object.keys(LIFEOS_SKILL_BUNDLE_FILES)];
1152
+ const shouldBackup = status.state !== 'missing' &&
1153
+ (status.state === 'legacy' || status.state === 'invalid' || status.modified === true);
1154
+ if (shouldBackup) {
1155
+ backupDir = `${LIFEOS_SKILL_DIR}/.backup/${backupTimestamp(now)}`;
1156
+ const candidatePaths = new Set([...previousBundlePaths, ...Object.keys(LIFEOS_SKILL_BUNDLE_FILES)]);
1157
+ for (const bundlePath of candidatePaths) {
1158
+ const target = bundleTarget(bundlePath);
1159
+ const content = await options.readFile(target);
1160
+ if (content !== null)
1161
+ await writeFile(backupPath(backupDir, target), content);
1162
+ }
1163
+ const manifestContent = await options.readFile(LIFEOS_SKILL_MANIFEST_PATH);
1164
+ if (manifestContent !== null) {
1165
+ await writeFile(backupPath(backupDir, LIFEOS_SKILL_MANIFEST_PATH), manifestContent);
1166
+ }
1167
+ }
1168
+ }
345
1169
  const written = [];
346
- for (const [relPath, content] of Object.entries(LIFEOS_SKILL_FILES)) {
347
- const target = `${LIFEOS_SKILL_DIR}/${relPath}`;
1170
+ for (const [bundlePath, content] of Object.entries(LIFEOS_SKILL_BUNDLE_FILES)) {
1171
+ const target = bundleTarget(bundlePath);
348
1172
  await writeFile(target, content);
349
1173
  written.push(target);
350
1174
  }
351
- return { written, version: LIFEOS_SKILL_VERSION };
1175
+ const currentBundlePaths = new Set(Object.keys(LIFEOS_SKILL_BUNDLE_FILES));
1176
+ const staleBundlePaths = [...new Set(previousBundlePaths)].filter((path) => !currentBundlePaths.has(path));
1177
+ const removed = [];
1178
+ if (options.readFile && options.removeFile) {
1179
+ for (const bundlePath of staleBundlePaths) {
1180
+ const target = bundleTarget(bundlePath);
1181
+ if ((await options.readFile(target)) === null)
1182
+ continue;
1183
+ await options.removeFile(target);
1184
+ removed.push(target);
1185
+ }
1186
+ }
1187
+ const manifest = {
1188
+ schemaVersion: 2,
1189
+ name: 'lifeos',
1190
+ version: LIFEOS_SKILL_VERSION,
1191
+ contentHash: LIFEOS_SKILL_BUNDLE_CONTENT_HASH,
1192
+ skills: currentManifestSkills(),
1193
+ installedBy: options.installedBy ?? 'unknown',
1194
+ installedAt: now.toISOString(),
1195
+ };
1196
+ await writeFile(LIFEOS_SKILL_MANIFEST_PATH, `${JSON.stringify(manifest, null, 2)}\n`);
1197
+ written.push(LIFEOS_SKILL_MANIFEST_PATH);
1198
+ return {
1199
+ written,
1200
+ removed,
1201
+ skillNames: [...LIFEOS_SKILL_NAMES],
1202
+ version: LIFEOS_SKILL_VERSION,
1203
+ ...(backupDir ? { backupDir } : {}),
1204
+ };
352
1205
  }
353
- /**
354
- * Install (or overwrite-to-update) OPC Skill into a vault.
355
- */
1206
+ /** Install or overwrite the standalone OPC Skill. */
356
1207
  async function installOpcSkill(writeFile) {
357
1208
  const written = [];
358
1209
  for (const [relPath, content] of Object.entries(OPC_SKILL_FILES)) {
@@ -360,7 +1211,7 @@ async function installOpcSkill(writeFile) {
360
1211
  await writeFile(target, content);
361
1212
  written.push(target);
362
1213
  }
363
- return { written, version: OPC_SKILL_VERSION };
1214
+ return { written, removed: [], skillNames: ['opc'], version: OPC_SKILL_VERSION };
364
1215
  }
365
1216
 
366
1217
  ;// CONCATENATED MODULE: external "node:os"
@@ -447,16 +1298,45 @@ async function runSkillInstall(args) {
447
1298
  await (0,promises_namespaceObject.mkdir)((0,external_node_path_namespaceObject.dirname)(abs), { recursive: true });
448
1299
  await (0,promises_namespaceObject.writeFile)(abs, content);
449
1300
  };
1301
+ const readSkillFile = async (relPath) => {
1302
+ try {
1303
+ return await (0,promises_namespaceObject.readFile)((0,external_node_path_namespaceObject.join)(vault.root, relPath), 'utf8');
1304
+ }
1305
+ catch (error) {
1306
+ if (error.code === 'ENOENT')
1307
+ return null;
1308
+ throw error;
1309
+ }
1310
+ };
450
1311
  const opc = await installOpcSkill(writeSkillFile);
451
- const lifeos = args.flags.has('opc-only') ? undefined : await installLifeosSkill(writeSkillFile);
1312
+ const lifeos = args.flags.has('opc-only')
1313
+ ? undefined
1314
+ : await installLifeosSkill(writeSkillFile, {
1315
+ installedBy: 'opc-cli',
1316
+ readFile: readSkillFile,
1317
+ removeFile: async (relPath) => {
1318
+ try {
1319
+ await (0,promises_namespaceObject.unlink)((0,external_node_path_namespaceObject.join)(vault.root, relPath));
1320
+ }
1321
+ catch (error) {
1322
+ if (error.code !== 'ENOENT')
1323
+ throw error;
1324
+ }
1325
+ },
1326
+ });
452
1327
  emitLines([
453
1328
  `Installed opc skill v${opc.version} into ${OPC_SKILL_DIR}/`,
454
1329
  ...opc.written.map((p) => ` ${p}`),
455
1330
  ...(lifeos
456
1331
  ? [
457
1332
  '',
458
- `Installed lifeos skill v${lifeos.version} into ${LIFEOS_SKILL_DIR}/`,
1333
+ `Installed LifeOS Skill bundle v${lifeos.version} under .agents/skills/ (core: ${LIFEOS_SKILL_DIR}/)`,
1334
+ `Skills: ${lifeos.skillNames.join(', ')}`,
1335
+ ...(lifeos.backupDir ? [`Backed up previous managed files to ${lifeos.backupDir}/`] : []),
459
1336
  ...lifeos.written.map((p) => ` ${p}`),
1337
+ ...(lifeos.removed.length > 0
1338
+ ? ['', 'Removed obsolete managed files:', ...lifeos.removed.map((p) => ` ${p}`)]
1339
+ : []),
460
1340
  ]
461
1341
  : []),
462
1342
  '',
@@ -482,7 +1362,7 @@ function helpText() {
482
1362
  'Commands:',
483
1363
  ' config Show OPC vault structure and skill status',
484
1364
  ' departments List the seven OPC departments and required files',
485
- ' dashboard [ceo|<department>] Print the source/.AI.md paths and AI generation prompt',
1365
+ ' dashboard [ceo|<department>] Print the source/.AI.md paths and AI Wiki generation prompt',
486
1366
  ' skill install Install/update bundled opc + lifeos skills into the vault',
487
1367
  ' help Show this help',
488
1368
  '',