Loading...
Loading...
Compare original and translation side by side
publishnpm installpublishnpm installpublishCONTEXT.mddocs/adr/CLAUDE.mdpublishCONTEXT.mddocs/adr/CLAUDE.mdinitupdateauditpublishdocs/wiki/auditinitpublishupdateinitupdateauditpublishdocs/wiki/auditinitpublishupdatepublish**/.wikimap.yamlpnpm-workspace.yamlpackage.jsonworkspacesgo.work.gitignore**/.wikimap.yamlpnpm-workspace.yamlpackage.jsonworkspacesgo.work.gitignore| # | Rung | Where docs go |
|---|---|---|
| 1 | A configured docs engine — | that engine's configured content directory, with its nav/sidebar updated in the same pass |
| 2 | An existing reader-doc tree — a populated | adopt it as-is; do not migrate |
| 3 | Fallback | |
docs/wiki/docs/packages/<x>/docs/| # | 层级 | 文档存储位置 |
|---|---|---|
| 1 | 已配置的文档引擎 —— | 该引擎配置的内容目录,同时更新其导航/侧边栏 |
| 2 | 已存在的读者文档树 —— 已填充内容的 | 直接沿用现有结构,不进行迁移 |
| 3 | ** fallback 方案** | |
docs/wiki/docs/packages/<x>/docs/documents:home:initinitupdateauditgit mvdocuments:home:initinitupdateauditgit mv<doc home>/.wikimap.yamlhome: docs/wiki
engine: none # or mkdocs | docusaurus | vitepress | starlight | sphinx | nextra
pages:
- path: getting-started.md
mode: tutorial
documents: [package.json, src/index.ts, .env.example]
- path: how-to/deploy-to-staging.md
mode: how-to
documents: [.github/workflows/deploy.yml, infra/**]
- path: architecture.md
mode: explanation
adopted: true # a human wrote it; wikikit maps it, never claims it
documents: [src/**]documents:updateaudit<doc home>/.wikimap.yamlhome: docs/wiki
engine: none # 或 mkdocs | docusaurus | vitepress | starlight | sphinx | nextra
pages:
- path: getting-started.md
mode: tutorial
documents: [package.json, src/index.ts, .env.example]
- path: how-to/deploy-to-staging.md
mode: how-to
documents: [.github/workflows/deploy.yml, infra/**]
- path: architecture.md
mode: explanation
adopted: true # 人工编写的页面;wikikit仅进行映射,不声称拥有其所有权
documents: [src/**]documents:updateaudit| Page | Diátaxis mode | Documents |
|---|---|---|
| — | entry point and table of contents |
| tutorial | install → run → first successful thing |
| how-to | one task per page, goal-shaped |
| how-to | the derivable half of contributor docs |
| how-to | release steps that actually exist in the repo |
| explanation | components, boundaries, data flow, links to ADRs |
| how-to (operator) | deploy, rollback, incident response, backup/restore |
| reference | declared surface only — commands, flags, env vars, config keys |
reference.mdCONTRIBUTING.mdindex.mdreference.md| 页面 | Diátaxis模式 | 文档化内容 |
|---|---|---|
| — | 入口点和目录 |
| tutorial(教程) | 安装 → 运行 → 首次成功操作 |
| how-to(操作指南) | 每页一个任务,以目标为导向 |
| how-to(操作指南) | 贡献者文档中可推导的部分 |
| how-to(操作指南) | 仓库中实际存在的发布步骤 |
| explanation(说明) | 组件、边界、数据流、ADR链接 |
| how-to(运维指南) | 部署、回滚、事件响应、备份/恢复 |
| reference(参考) | 仅包含已声明的内容——命令、标志、环境变量、配置键 |
reference.mdCONTRIBUTING.mdindex.mdreference.md_Verified against `main`@`a1b2c3d` on 2026-08-06._auditdocuments:adopted: true_Verified against `main`@`a1b2c3d` on 2026-08-06._auditdocuments:adopted: truepackage.jsonMakefilepyproject.tomljustfile| Allowed | Never |
|---|---|
| anything that installs ( |
| anything that builds, compiles, or bundles |
| anything that migrates a database or seeds data |
bare script listings — | anything that deploys, publishes, or pushes |
read-only git — | anything that writes outside the doc set, or calls a live service |
auditpackage.jsonMakefilepyproject.tomljustfile| 允许执行 | 禁止执行 |
|---|---|
| 任何安装操作( |
| 任何构建、编译或打包操作 |
| 任何数据库迁移或数据填充操作 |
裸脚本列表 —— | 任何部署、发布或推送操作 |
只读git操作 —— | 任何向文档集外写入内容或调用实时服务的操作 |
auditinitinitDockerfileCONTEXT.mddocs/adr/getting-started.mdDockerfileCONTEXT.mddocs/adr/getting-started.mddocuments:adopted: truedocuments:adopted: true<ref>@<sha><!-- wikikit:front-door:start -->
...
<!-- wikikit:front-door:end --><!-- wikikit:front-door:start -->
...
<!-- wikikit:front-door:end --><doc home>/.wikimap.yaml<doc home>/.wikimap.yamlgit addgit addupdateupdategit status --porcelaingit diff HEADgit diffgh repo view --json defaultBranchRefmaingit status --porcelaingit diff HEADgit diffgh repo view --json defaultBranchRefmaindocuments:documents:git commitgh pr creategit commitgh pr createauditauditupdateinitcurrent| Verdict | Means |
|---|---|
| claims check out against the code |
| a described behavior changed |
| a command, path, or var on the page no longer exists |
| an adopted page wikikit has never claim-checked — distinct from stale |
| documentable surface with no page |
Recency: 312/312 · Claims verified: 40/312 (highest-risk first) · Not claim-checked: 272 (listed below)audit how-to/current| 结论 | 含义 |
|---|---|
| 声明与代码一致 |
| 描述的行为已变更 |
| 页面上的命令、路径或变量已不存在 |
| wikikit从未验证过的已采用页面——与过时不同 |
| 有文档化价值但无对应页面的内容 |
时效性检查:312/312 · 声明验证:40/312(高风险优先) · 未验证声明:272(如下所列)audit how-to/auditpublishpublishinithow-to/deploy.mdrunbooks/deploy.md/wiki/deployghinithow-to/deploy.mdrunbooks/deploy.md/wiki/deployghgh repo view --json nameWithOwner,visibility,hasWikiEnabled
git ls-remote "$(gh repo view --json url -q .url).wiki.git" 2>&1 | head -1| State | Do this |
|---|---|
| Wiki feature disabled | Stop. It's a repo setting (Settings → Features → Wikis); name the path and let the user flip it. |
Wiki enabled but never initialized — | Stop before writing the workflow. Tell the user to open the wiki tab and save any page (the action's own docs call this the "dummy page"), then re-run. Do not install a workflow that is guaranteed to fail. |
| Wiki already has pages wikikit didn't write | This is the dangerous case. Those pages will be destroyed by the first sync. Offer the rescue below before anything else, and get an explicit yes on the destruction. |
No | Print the workflow for the user to add by hand, and name the preflight checks they should run themselves. Never claim a wiki state you couldn't read. |
git clone "$(gh repo view --json url -q .url).wiki.git" /tmp/wiki-rescueadopted: truegh repo view --json nameWithOwner,visibility,hasWikiEnabled
git ls-remote "$(gh repo view --json url -q .url).wiki.git" 2>&1 | head -1| 状态 | 处理方式 |
|---|---|
| Wiki功能已禁用 | 停止操作。这是仓库设置(Settings → Features → Wikis);告知用户路径,让用户自行开启。 |
Wiki已启用但未初始化—— | 在编写工作流前停止操作。告知用户打开Wiki标签页并保存任意页面(工作流文档称其为“占位页面”),然后重新运行。切勿安装必然失败的工作流。 |
| Wiki已有wikikit未编写的页面 | 这是危险场景。这些页面会在首次同步时被销毁。在执行任何操作前提供以下补救方案,并获得用户明确同意销毁这些页面。 |
无 | 打印工作流内容供用户手动添加,并告知用户应自行执行的预检检查。切勿声称无法确认的Wiki状态。 |
git clone "$(gh repo view --json url -q .url).wiki.git" /tmp/wiki-rescueadopted: true-index.mdHomedocs/wiki/index.md → Home
docs/wiki/getting-started.md → getting-started
docs/wiki/how-to/deploy-to-staging.md → how-to-deploy-to-staging
docs/wiki/runbooks/rollback.md → runbooks-rollbackhow-to/deploy.mdhow/to-deploy.mdhow-to-deploy-index.mdHomedocs/wiki/index.md → Home
docs/wiki/getting-started.md → getting-started
docs/wiki/how-to/deploy-to-staging.md → how-to-deploy-to-staging
docs/wiki/runbooks/rollback.md → runbooks-rollbackhow-to/deploy.mdhow/to-deploy.mdhow-to-deploy.github/workflows/publish-wiki.ymldocs/wikiname: Publish wiki
on:
push:
branches: [main]
paths:
- 'docs/wiki/**'
- '.github/workflows/publish-wiki.yml'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: publish-wiki
cancel-in-progress: false
jobs:
publish-wiki:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# The wiki page namespace is flat: docs/wiki/how-to/deploy.md and
# docs/wiki/runbooks/deploy.md would both land on /wiki/deploy. Flatten
# each path into a unique page name and rewrite in-repo links to match.
- name: Flatten the doc set into wiki page names
run: |
set -euo pipefail
src=docs/wiki
out=.wiki-build
mkdir -p "$out"
find "$out" -mindepth 1 -delete # scoped to the staging dir only
find "$src" -name '*.md' -type f | while read -r f; do
rel="${f#"$src"/}"
page="${rel%.md}"
flat="${page//\//-}"
if [ "$page" = "index" ]; then flat="Home"; fi
dir="$(dirname "$rel")"
if [ "$dir" = "." ]; then dir=""; fi
# [Deploy](how-to/deploy.md) -> [Deploy](how-to-deploy), resolving
# ../ against the page's own directory first. Anchors are kept;
# absolute URLs and links to non-page files are left alone.
WIKI_DIR="$dir" perl -pe '
s{\]\(([^):#]+?)\.md(#[^)]*)?\)}{
my ($p, $anchor) = ($1, $2 // "");
$p = "$ENV{WIKI_DIR}/$p" if $ENV{WIKI_DIR} ne "";
$p =~ s{^\./}{};
$p =~ s{/\./}{/}g;
1 while $p =~ s{[^/]+/\.\./}{};
$p = ($p eq "index") ? "Home" : do { $p =~ s{/}{-}g; $p };
"]($p$anchor)"
}ge
' "$f" > "$out/$flat.md"
done
- uses: Andrew-Chen-Wang/github-wiki-action@v5
with:
path: .wiki-build
# The flatten step above owns page naming and link rewriting, so the
# action's own preprocessing would fight it.
preprocess: false
disable-empty-commits: true
# Start safe: prints what it would push without touching the wiki.
# Flip to false once the first run's output looks right.
dry-run: truedry-run: truepreprocess: falseconcurrencycancel-in-progresspermissions: contents: writeGITHUB_TOKEN@v5.github/workflows/publish-wiki.ymldocs/wikiname: Publish wiki
on:
push:
branches: [main]
paths:
- 'docs/wiki/**'
- '.github/workflows/publish-wiki.yml'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: publish-wiki
cancel-in-progress: false
jobs:
publish-wiki:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# The wiki page namespace is flat: docs/wiki/how-to/deploy.md and
# docs/wiki/runbooks/deploy.md would both land on /wiki/deploy. Flatten
# each path into a unique page name and rewrite in-repo links to match.
- name: Flatten the doc set into wiki page names
run: |
set -euo pipefail
src=docs/wiki
out=.wiki-build
mkdir -p "$out"
find "$out" -mindepth 1 -delete # scoped to the staging dir only
find "$src" -name '*.md' -type f | while read -r f; do
rel="${f#"$src"/}"
page="${rel%.md}"
flat="${page//\//-}"
if [ "$page" = "index" ]; then flat="Home"; fi
dir="$(dirname "$rel")"
if [ "$dir" = "." ]; then dir=""; fi
# [Deploy](how-to/deploy.md) -> [Deploy](how-to-deploy), resolving
# ../ against the page's own directory first. Anchors are kept;
# absolute URLs and links to non-page files are left alone.
WIKI_DIR="$dir" perl -pe '
s{\]\(([^):#]+?)\.md(#[^)]*)?\)}{
my ($p, $anchor) = ($1, $2 // "");
$p = "$ENV{WIKI_DIR}/$p" if $ENV{WIKI_DIR} ne "";
$p =~ s{^\./}{};
$p =~ s{/\./}{/}g;
1 while $p =~ s{[^/]+/\.\./}{};
$p = ($p eq "index") ? "Home" : do { $p =~ s{/}{-}g; $p };
"]($p$anchor)"
}ge
' "$f" > "$out/$flat.md"
done
- uses: Andrew-Chen-Wang/github-wiki-action@v5
with:
path: .wiki-build
# The flatten step above owns page naming and link rewriting, so the
# action's own preprocessing would fight it.
preprocess: false
disable-empty-commits: true
# Start safe: prints what it would push without touching the wiki.
# Flip to false once the first run's output looks right.
dry-run: truedry-run: truefalsepreprocess: falseconcurrencycancel-in-progresspermissions: contents: writeGITHUB_TOKEN@v5workflow_dispatchdry-runfalsegit addworkflow_dispatchdry-runfalsegit addpublishdocs/wiki/auditinitupdateauditpublishdocs/wiki/auditinitupdateaudit