wiki-stage-commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Wiki Stage Commit — Staged Write Promotion

Wiki 暂存提交 — 暂存内容推广

You are reviewing LLM-written pages that are waiting in
_staging/
for human approval before they land in the live wiki. This skill is only useful when
WIKI_STAGED_WRITES=true
in the vault config.
你正在审核由LLM生成的页面,这些页面存放在
_staging/
目录中,需经人工批准后才能发布到正式wiki。此功能仅在vault配置中设置
WIKI_STAGED_WRITES=true
时生效。

Before You Start

开始之前

  1. Resolve config — follow the Config Resolution Protocol in
    llm-wiki/SKILL.md
    . This gives
    OBSIDIAN_VAULT_PATH
    and
    WIKI_STAGED_WRITES
    .
  2. If
    WIKI_STAGED_WRITES
    is not set or is
    false
    , tell the user: "Staged writes mode is not enabled. Set
    WIKI_STAGED_WRITES=true
    in your
    .env
    to use this feature." Then stop.
  3. Read the
    _staging/
    directory inventory.
  1. 解析配置 — 遵循
    llm-wiki/SKILL.md
    中的配置解析协议,获取
    OBSIDIAN_VAULT_PATH
    WIKI_STAGED_WRITES
    参数。
  2. WIKI_STAGED_WRITES
    未设置或为
    false
    ,请告知用户:"暂存写入模式未启用。请在
    .env
    文件中设置
    WIKI_STAGED_WRITES=true
    以使用此功能。" 然后终止操作。
  3. 读取
    _staging/
    目录的文件清单。

Invocation Forms

调用形式

/wiki-stage-commit               # interactive review: show each file and ask accept/reject
/wiki-stage-commit --all         # accept all staged files without per-file review
/wiki-stage-commit --reject-all  # reject all staged files (move to _raw/ for manual editing)
/wiki-stage-commit --list        # list staged files with summary, no changes
/wiki-stage-commit               # 交互式审核:逐个展示文件并询问接受/拒绝
/wiki-stage-commit --all         # 无需逐个审核,直接接受所有暂存文件
/wiki-stage-commit --reject-all  # 拒绝所有暂存文件(移至_raw/目录供手动编辑)
/wiki-stage-commit --list        # 列出暂存文件及摘要,不执行任何变更

Step 1: Inventory Staged Files

步骤1:盘点暂存文件

Glob
$OBSIDIAN_VAULT_PATH/_staging/**/*.md
— these are the pending pages.
Also glob
$OBSIDIAN_VAULT_PATH/_staging/**/*.patch.md
— these are pending updates to existing pages (diff-style files showing proposed additions and deletions).
Report the inventory:
Staged files: 4 new pages, 2 updates

New pages:
  _staging/concepts/attention-mechanism.md        (ingested 2 days ago)
  _staging/entities/andrej-karpathy.md            (ingested 2 days ago)
  _staging/skills/fine-tuning-llms.md             (ingested yesterday)
  _staging/references/attention-is-all-you-need.md (ingested 3 hours ago)

Updates (patch files):
  _staging/concepts/transformer-architecture.patch.md  (target: concepts/transformer-architecture.md)
  _staging/skills/prompt-engineering.patch.md          (target: skills/prompt-engineering.md)
If
_staging/
is empty, report: "Nothing staged. All writes have been committed or no staged writes have been produced yet."
匹配
$OBSIDIAN_VAULT_PATH/_staging/**/*.md
—— 这些是待处理的新页面。
同时匹配
$OBSIDIAN_VAULT_PATH/_staging/**/*.patch.md
—— 这些是对现有页面的待处理更新(差异格式文件,展示拟添加和删除的内容)。
报告盘点结果:
暂存文件:4个新页面,2个更新

新页面:
  _staging/concepts/attention-mechanism.md       (2天前导入)
  _staging/entities/andrej-karpathy.md           (2天前导入)
  _staging/skills/fine-tuning-llms.md            (昨天导入)
  _staging/references/attention-is-all-you-need.md(3小时前导入)

更新(补丁文件):
  _staging/concepts/transformer-architecture.patch.md (目标页面:concepts/transformer-architecture.md)
  _staging/skills/prompt-engineering.patch.md         (目标页面:skills/prompt-engineering.md)
_staging/
目录为空,报告:"暂无暂存文件。所有写入已提交,或尚未生成任何暂存内容。"

Step 2: Per-File Review (interactive mode)

步骤2:逐个文件审核(交互式模式)

For each staged file (new pages first, then updates):
针对每个暂存文件(先处理新页面,再处理更新):

For new pages:

新页面处理:

Display a summary:
--- New page: concepts/attention-mechanism.md ---
Title:    Attention Mechanism
Tags:     #ml #architecture
Summary:  Core building block of transformers — computes weighted sum of values based on query-key similarity.
Tier:     supporting
Confidence: 0.72
Sources:  papers/attention.pdf

[Preview first 20 lines of body]
...

Accept [a], Reject [r], Skip [s], Preview full [p]?
展示摘要信息:
--- 新页面:concepts/attention-mechanism.md ---
标题:    Attention Mechanism
标签:     #ml #architecture
摘要:  Transformers的核心构建模块——基于查询-键相似度计算值的加权和。
层级:     supporting
置信度:0.72
来源:  papers/attention.pdf

[预览正文前20行]
...

接受[a],拒绝[r],跳过[s],预览全文[p]?

For patch files:

补丁文件处理:

Display a structured diff:
--- Update: concepts/transformer-architecture.md ---
Source: _staging/concepts/transformer-architecture.patch.md

Proposed additions (+):
+ Transformers outperform RNNs on tasks requiring long-range dependencies. ^[inferred]
+ New source: papers/survey-2026.pdf

Proposed deletions (-):
- The attention mechanism was first described in [Bahdanau 2015].  (to be replaced by updated claim)

⚠️  Conflict check: target page was modified 3 days after staging. Review carefully.

Accept [a], Reject [r], Skip [s], Preview full diff [p]?
If
--all
flag is set, skip prompting and accept every file. If
--reject-all
flag is set, skip prompting and reject every file. If
--list
flag is set, stop after printing the inventory (Step 1).
展示结构化差异:
--- 更新:concepts/transformer-architecture.md ---
来源:_staging/concepts/transformer-architecture.patch.md

拟添加内容(+):
+ Transformers在需要长距离依赖的任务上表现优于RNN。^[推断]
+ 新来源:papers/survey-2026.pdf

拟删除内容(-):
- 注意力机制最初在[Bahdanau 2015]中被描述。(将被更新后的结论替代)

⚠️ 冲突检查:目标页面在暂存后3天被修改,请仔细审核。

接受[a],拒绝[r],跳过[s],预览完整差异[p]?
若设置了
--all
参数,跳过提示直接接受所有文件。 若设置了
--reject-all
参数,跳过提示直接拒绝所有文件。 若设置了
--list
参数,完成步骤1的盘点后即终止操作。

Step 3: Apply Decisions

步骤3:执行决策

Accepting a new page

接受新页面

  1. Move
    _staging/<category>/page.md
    <category>/page.md
    (the final location)
  2. Update
    index.md
    with the new page entry
  3. Remove the staged file
  1. _staging/<category>/page.md
    移动至
    <category>/page.md
    (最终位置)
  2. 更新
    index.md
    ,添加新页面条目
  3. 删除暂存文件

Accepting a patch/update

接受补丁/更新

  1. Read the current page at the target path
  2. Apply the proposed additions and deletions (merge, don't just overwrite)
  3. Update the
    updated
    frontmatter timestamp
  4. Update
    index.md
    if the summary changed
  5. Remove the staged patch file
  1. 读取目标路径下的当前页面
  2. 应用拟添加和删除的内容(合并而非直接覆盖)
  3. 更新frontmatter中的
    updated
    时间戳
  4. 若摘要发生变化,更新
    index.md
  5. 删除暂存补丁文件

Rejecting a file

拒绝文件

Move it to
$OBSIDIAN_VAULT_PATH/_raw/
for manual editing:
  • _staging/concepts/page.md
    _raw/rejected-concepts-page.md
  • _staging/concepts/page.patch.md
    _raw/rejected-patch-concepts-page.md
  • Prefix with
    rejected-
    so the user can identify it
将其移至
$OBSIDIAN_VAULT_PATH/_raw/
目录供手动编辑:
  • _staging/concepts/page.md
    _raw/rejected-concepts-page.md
  • _staging/concepts/page.patch.md
    _raw/rejected-patch-concepts-page.md
  • 添加前缀
    rejected-
    ,方便用户识别

Conflict detection on patch accept

接受补丁时的冲突检测

Before applying a patch, check whether the target page's
updated
frontmatter is newer than the patch file's own
updated
field:
  • If the target was modified AFTER the patch was staged, warn:
    ⚠️ Conflict: target was updated since this patch was staged. Applying may lose recent changes.
  • Give the user a chance to abort:
    Apply anyway [y], Skip [s], Reject [r]?
应用补丁前,检查目标页面frontmatter中的
updated
时间是否晚于补丁文件自身的
updated
字段:
  • 若目标页面在补丁暂存后被修改,提示:
    ⚠️ 冲突:目标页面在该补丁暂存后已更新。应用补丁可能会丢失近期变更。
  • 给予用户中止机会:
    仍要应用[y],跳过[s],拒绝[r]?

Step 4: Update Tracking Files

步骤4:更新跟踪文件

After processing all staged files:
  1. hot.md
    — update the Recent Activity section: "Committed N staged pages; rejected M."
  2. log.md
    — append:
    - [TIMESTAMP] STAGE_COMMIT accepted=N rejected=M skipped=K
处理完所有暂存文件后:
  1. hot.md
    —— 更新“近期活动”部分:“已提交N个暂存页面;拒绝M个。”
  2. log.md
    —— 添加记录:
    - [TIMESTAMP] STAGE_COMMIT accepted=N rejected=M skipped=K

Step 5: Report

步骤5:生成报告

Stage commit complete.

✅  Accepted (N):
  concepts/attention-mechanism.md     → now live
  entities/andrej-karpathy.md         → now live
  concepts/transformer-architecture.md → updated (patch applied)

❌  Rejected (M):
  skills/fine-tuning-llms.md          → moved to _raw/rejected-skills-fine-tuning-llms.md

⏭️  Skipped (K):
  references/attention-is-all-you-need.md → still in _staging/

Staging queue: K files remaining
暂存提交完成。

✅ 已接受(N):
  concepts/attention-mechanism.md     → 已上线
  entities/andrej-karpathy.md         → 已上线
  concepts/transformer-architecture.md → 已更新(补丁已应用)

❌ 已拒绝(M):
  skills/fine-tuning-llms.md          → 已移至_raw/rejected-skills-fine-tuning-llms.md

⏭️ 已跳过(K):
  references/attention-is-all-you-need.md → 仍在_staging/目录中

暂存队列:剩余K个文件

Notes

注意事项

  • Staged files use the same page template as live pages — they are ready to land, just awaiting approval
  • Patch files use a human-readable diff format: lines starting with
    +
    are additions, lines starting with
    -
    are deletions
  • index.md
    and
    log.md
    are always updated immediately on ingest (they are low-risk tracking files) — only category pages go through staging
  • The
    _staging/
    directory is not tracked by Obsidian's graph view — pages only appear in the wiki after promotion
  • 暂存文件使用与正式页面相同的模板,已准备好上线,仅待批准
  • 补丁文件采用人类可读的差异格式:以
    +
    开头的行是拟添加内容,以
    -
    开头的行是拟删除内容
  • index.md
    log.md
    在导入时会立即更新(它们是低风险的跟踪文件)——只有分类页面需要经过暂存流程
  • _staging/
    目录不会被Obsidian的图谱视图追踪——页面仅在推广后才会出现在wiki中