Loading...
Loading...
Compare original and translation side by side
[[Note Name]]> [!type] Title![[file]][[Note Name]]> [!type] Title![[file]].vault-meta/transport.jsonbash scripts/detect-transport.shpreferredobsidian-cli write "$VAULT" "$NOTE" < content.mdappendproperty:setskills/wiki-cli/SKILL.mdmcp__obsidian-vault__write_noteskills/wiki/references/mcp-setup.mdWriteEditwiki/references/transport-fallback.md.vault-meta/transport.jsonbash scripts/detect-transport.shpreferredobsidian-cli write "$VAULT" "$NOTE" < content.mdappendproperty:setskills/wiki-cli/SKILL.mdmcp__obsidian-vault__write_noteskills/wiki/references/mcp-setup.mdWriteEditwiki/references/transport-fallback.mdpython3 scripts/wiki-mode.py route <type> "<name>"SRC_PATH=$(python3 scripts/wiki-mode.py route source "Karpathy 2025 LLM Wiki essay")python3 scripts/wiki-mode.py route <type> "<name>"SRC_PATH=$(python3 scripts/wiki-mode.py route source "Karpathy 2025 LLM Wiki essay")
If `.vault-meta/mode.json` is absent, the router returns mode=generic paths (identical to v1.7 behavior). No special-casing needed in this skill.
Mode-specific follow-up:
- **LYT**: after filing the atomic note, update the relevant MOC (`wiki/mocs/<topic>-moc.md`) to link the new note. If no MOC exists for the topic, create one using `skills/wiki-mode/templates/lyt/moc-template.md`.
- **Zettelkasten**: filename already includes the timestamp ID. Populate the `id:` frontmatter field to match.
- **PARA**: new ingests land in `wiki/resources/incoming/` by default. Do NOT auto-guess the topic; leave in incoming/ for user review.
若`.vault-meta/mode.json`不存在,路由工具会返回generic模式路径(与v1.7版本行为一致),本技能无需特殊处理。
模式特定后续操作:
- **LYT**:在归档原子笔记后,更新相关MOC(`wiki/mocs/<topic>-moc.md`)以链接新笔记。若该主题无MOC,使用`skills/wiki-mode/templates/lyt/moc-template.md`创建。
- **Zettelkasten**:文件名已包含时间戳ID,需在前置元数据中填充`id:`字段以匹配。
- **PARA**:新导入内容默认存放在`wiki/resources/incoming/`,请勿自动猜测主题,保留在incoming目录供用户审核。wiki-lock acquire <path>undefinedwiki-lock acquire <path>undefined
Properties:
- **Per-file granularity.** Locks key on `sha1(<vault-relative-path>)`; concurrent writes to DIFFERENT pages run in parallel.
- **Age-based staleness.** Default `STALE_AFTER_SEC=60`. A crashed holder unblocks in ≤60 seconds without manual intervention. See `scripts/wiki-lock.sh` header for the full semantics.
- **Cross-process release.** Release is `rm -f` (no PID match required). Skill authors are trusted to release locks they acquire; cross-skill release is allowed by design (a janitor running `wiki-lock clear-stale --max-age 0` is the canonical recovery path).
- **The PostToolUse hook now defers `git add` if any locks are currently held**, so the auto-commit doesn't fire mid-ingest and produce torn commits. See `hooks/hooks.json`.
`wiki-lock` is unconditional in v1.7+ — there is no feature gate, no fallback. Skills that don't acquire locks are racing against any other writer. The script is in core, not opt-in.
Sub-agent rule from v1.6 — *"Sub-agents MUST NOT call `scripts/allocate-address.sh`"* — is preserved (orchestrator still backfills addresses to keep the counter monotonic). The NEW rule is: *sub-agents MAY now write pages, but MUST acquire locks first.* See `agents/wiki-ingest.md`.
---
特性:
- **按文件粒度锁定**:锁基于`sha1(<vault-relative-path>)`;不同页面的并发写入可并行执行。
- **基于时长的过期机制**:默认`STALE_AFTER_SEC=60`。崩溃的锁持有者会在≤60秒内自动解锁,无需人工干预。详见`scripts/wiki-lock.sh`头部的完整语义说明。
- **跨进程释放**:释放操作通过`rm -f`实现(无需匹配PID)。信任技能开发者会释放自己获取的锁;设计上允许跨技能释放(执行`wiki-lock clear-stale --max-age 0`的清理工具是标准恢复路径)。
- **PostToolUse钩子现在会在持有锁时延迟执行`git add`**,避免在导入过程中触发自动提交导致不完整的提交记录。详见`hooks/hooks.json`。
`wiki-lock`在v1.7+版本中是强制要求的 — 无功能开关,无兜底方案。未获取锁的技能会与其他写入者产生竞争。该脚本属于核心组件,非可选功能。
保留v1.6版本的子代理规则 — *"子代理不得调用`scripts/allocate-address.sh`"*(协调器仍会回填地址以保持计数器单调递增)。新增规则:*子代理现在可以写入页面,但必须先获取锁*。详见`agents/wiki-ingest.md`。
---.raw/.manifest.jsonundefined.raw/.manifest.jsonundefined
**Manifest format** (create if missing):
```json
{
"sources": {
".raw/articles/article-slug-2026-04-08.md": {
"hash": "abc123",
"ingested_at": "2026-04-08",
"pages_created": ["wiki/sources/article-slug.md", "wiki/entities/Person.md"],
"pages_updated": ["wiki/index.md"]
}
}
}md5sum [file] | cut -d' ' -f1sha256sum.manifest.jsonforce{hash, ingested_at, pages_created, pages_updated}.manifest.json
**清单格式**(若不存在则创建):
```json
{
"sources": {
".raw/articles/article-slug-2026-04-08.md": {
"hash": "abc123",
"ingested_at": "2026-04-08",
"pages_created": ["wiki/sources/article-slug.md", "wiki/entities/Person.md"],
"pages_updated": ["wiki/index.md"]
}
}
}md5sum [file] | cut -d' ' -f1sha256sum.manifest.jsonforce.manifest.json{hash, ingested_at, pages_created, pages_updated}https://defuddlewhich defuddle 2>/dev/nulldefuddle [url].raw/articles/[slug]-[YYYY-MM-DD].md---
source_url: [url]
fetched: [YYYY-MM-DD]
---.raw/https://defuddlewhich defuddle 2>/dev/nulldefuddle [url].raw/articles/[slug]-[YYYY-MM-DD].md---
source_url: [url]
fetched: [YYYY-MM-DD]
---.raw/.png.jpg.jpeg.gif.webp.svg.avif.raw/images/[slug]-[YYYY-MM-DD].md---
source_type: image
original_file: [original path]
fetched: YYYY-MM-DD
---
# Image: [slug]
[Full description of image contents, transcribed text, entities visible, etc.]_attachments/images/[slug].[ext].png.jpg.jpeg.gif.webp.svg.avif.raw/images/[slug]-[YYYY-MM-DD].md---
source_type: image
original_file: [original path]
fetched: YYYY-MM-DD
---
# Image: [slug]
[图片内容的完整描述、转录文本、可见实体等]_attachments/images/[slug].[ext].raw/wiki/sources/references/frontmatter.md_index.mdwiki/overview.mdwiki/index.mdwiki/hot.mdwiki/log.md## [YYYY-MM-DD] ingest | Source Title
- Source: `.raw/articles/filename.md`
- Summary: [[Source Title]]
- Pages created: [[Page 1]], [[Page 2]]
- Pages updated: [[Page 3]], [[Page 4]]
- Key insight: One sentence on what is new.> [!contradiction].raw/wiki/sources/references/frontmatter.md_index.mdwiki/overview.mdwiki/index.mdwiki/hot.mdwiki/log.md## [YYYY-MM-DD] ingest | 来源标题
- 来源:`.raw/articles/filename.md`
- 摘要:[[来源标题]]
- 创建页面:[[页面1]], [[页面2]]
- 更新页面:[[页面3]], [[页面4]]
- 关键见解:一句话说明新增内容> [!contradiction]wiki/hot.mdwiki/index.md/search/simple/wiki/hot.mdwiki/index.md/search/simple/[!note] Custom callout dependency Thecallout type used below is a custom callout defined in[!contradiction](auto-installed by.obsidian/snippets/vault-colors.cssscaffold). It renders with reddish-brown styling and an alert-triangle icon when the snippet is enabled. If the snippet is missing, Obsidian falls back to default callout styling, so the page still works without the visual flourish. See [[skills/wiki/references/css-snippets.md]] for the four custom callouts (/wiki,contradiction,gap,key-insight).stale
> [!contradiction] Conflict with [[New Source]]
> [[Existing Page]] claims X. [[New Source]] says Y.
> Needs resolution. Check dates, context, and primary sources.> [!contradiction] Contradicts [[Existing Page]]
> This source says Y, but existing wiki says X. See [[Existing Page]] for details.[!note] 自定义提示框依赖 以下使用的提示框类型是自定义提示框,定义在[!contradiction]中(由.obsidian/snippets/vault-colors.css脚手架自动安装)。启用该代码片段时,会显示红棕色样式和警告三角图标。若代码片段缺失,Obsidian会回退到默认提示框样式,页面仍可正常显示,仅无视觉增强效果。详见[[skills/wiki/references/css-snippets.md]]中的四个自定义提示框(/wiki、contradiction、gap、key-insight)。stale
> [!contradiction] 与[[新来源]]冲突
> [[现有页面]]主张X,[[新来源]]称Y。
> 需要解决冲突,请检查日期、上下文和原始来源。> [!contradiction] 与[[现有页面]]冲突
> 本来源称Y,但现有wiki内容为X。详情请见[[现有页面]]。.raw/.raw/.manifest.jsonaddress_map.raw/wiki-ingest.raw/.raw/.raw/.manifest.jsonaddress_mapwiki-ingest.raw/.raw/scripts/allocate-address.sh.vault-meta/if [ -x ./scripts/allocate-address.sh ] && [ -d ./.vault-meta ]; then
DRAGONSCALE_ADDRESSES=1
else
DRAGONSCALE_ADDRESSES=0
fiDRAGONSCALE_ADDRESSES=0address:wiki-lintDRAGONSCALE_ADDRESSES=1address: c-000042c-<6-digit-counter>c-created:created:l-NNNNNNscripts/allocate-address.sh.vault-meta/if [ -x ./scripts/allocate-address.sh ] && [ -d ./.vault-meta ]; then
DRAGONSCALE_ADDRESSES=1
else
DRAGONSCALE_ADDRESSES=0
fiDRAGONSCALE_ADDRESSES=0address:wiki-lintDRAGONSCALE_ADDRESSES=1address: c-000042c-<6位计数器>c-created:created:l-NNNNNNscripts/allocate-address.shscripts/allocate-address.shflock.vault-meta/.address.lockADDR=$(./scripts/allocate-address.sh)flock.vault-meta/.address.lockADDR=$(./scripts/allocate-address.sh)
**CRITICAL**: never use the Write or Edit tool on `.vault-meta/address-counter.txt`. That would fire the PostToolUse hook, which runs `git add wiki/ .raw/` and can accidentally commit unrelated pending wiki changes under a generic message. Counter mutation is **only** permitted through the helper script (Bash tool).
**关键注意事项**:切勿使用Write或Edit工具修改`.vault-meta/address-counter.txt`。这会触发PostToolUse钩子,执行`git add wiki/ .raw/`,可能会将未相关的wiki待提交变更意外提交到通用消息下。仅允许通过辅助脚本(Bash工具)修改计数器。./scripts/allocate-address.sh./scripts/allocate-address.sh --peek./scripts/allocate-address.sh --rebuildc-NNNNNN./scripts/allocate-address.sh./scripts/allocate-address.sh --peek./scripts/allocate-address.sh --rebuildc-NNNNNN./scripts/allocate-address.shaddress: c-XXXXXX.raw/.manifest.jsonaddress_map./scripts/allocate-address.shaddress: c-XXXXXX.raw/.manifest.jsonaddress_mapaddress_map.raw/.manifest.json.raw/.manifest.jsonaddress_map{
"sources": { ... },
"address_map": {
"wiki/concepts/Example.md": "c-000042",
"wiki/entities/Another.md": "c-000043"
}
}--forceaddress_mapaddress_map{
"sources": { ... },
"address_map": {
"wiki/concepts/Example.md": "c-000042",
"wiki/entities/Another.md": "c-000043"
}
}--forceaddress_mapaddress_map_index.mdindex.mdlog.mdhot.mdoverview.mddashboard.mddashboard.baseWiki Map.mdgetting-started.mdwiki/folds/fold_idcreated:l-NNNNNN_index.mdindex.mdlog.mdhot.mdoverview.mddashboard.mddashboard.baseWiki Map.mdgetting-started.mdwiki/folds/fold_idcreated:l-NNNNNNaddress:address_mapcreated:address:address_mapcreated:flockflockskills/think/SKILL.md| # | Principle | Application here |
|---|---|---|
| 1 | OBSERVE (ext) | Read the source file completely before extracting anything. No shortcuts on long sources. |
| 2 | OBSERVE (int) | Am I biased toward the source's framing? Where do my disagreements live? Note them as contradiction callouts. |
| 3 | LISTEN | The user's source-selection intent — what made THIS source worth ingesting, and what is the user hoping to extract? |
| 4 | THINK | Which entities deserve pages? Which concepts? What cross-references? What contradictions with existing pages? |
| 5 | CONNECT (lat) | This source's claims vs other sources already in the wiki. Contradictions are the highest-signal finding. |
| 6 | CONNECT (sys) | |
| 7 | FEEL | A page that compounds — useful in 6 months, not just today. Skip filler; favor synthesis over transcription. |
| 8 | ACCEPT | Not every claim is wiki-worthy. Editorial judgment is part of ingest, not a bug to remove. |
| 9 | CREATE | Source + entity + concept pages with full frontmatter; cross-references; contradiction callouts where needed. |
| 10 | GROW | Contradictions found mid-ingest are the most valuable wiki signal. File them as questions for follow-up, not silently. |
skills/think/SKILL.md| # | 原则 | 本技能中的应用 |
|---|---|---|
| 1 | 观察(外部) | 在提取任何内容前完整读取来源文件,长来源内容请勿捷径处理。 |
| 2 | 观察(内部) | 我是否偏向来源的框架?我的分歧点在哪里?将这些标记为冲突提示框。 |
| 3 | 倾听 | 用户选择该来源的意图 — 为什么这个来源值得导入,用户希望提取什么内容? |
| 4 | 思考 | 哪些实体值得创建页面?哪些概念?需要建立哪些交叉引用?与现有页面有哪些冲突? |
| 5 | 关联(潜在) | 本来源的主张与wiki中已有的其他来源对比,冲突是最高信号的发现。 |
| 6 | 关联(系统) | 使用 |
| 7 | 感知 | 创建有长期价值的页面 — 6个月后仍有用,而非仅当下有用。跳过冗余内容,优先合成而非转录。 |
| 8 | 接纳 | 并非所有主张都值得纳入wiki,编辑判断是导入流程的一部分,而非需要消除的缺陷。 |
| 9 | 创建 | 生成包含完整前置元数据的来源+实体+概念页面;建立交叉引用;必要时添加冲突提示框。 |
| 10 | 成长 | 导入过程中发现的冲突是wiki最有价值的信号,将其记录为后续跟进的问题,而非静默忽略。 |