腾讯云 COS + acme.sh:部署实操手册
这是落地篇
本篇是《用对象存储部署 AI 友好的个人知识库》的实操手册。主文讲清楚了为什么这么设计——可检验的 AI 友好标准、一颗 rsync 语法糖、两个写作约定,以及为什么选对象存储而非服务器;本篇把它跑起来:从建 bucket、绑域名,到 HTTPS 自动续期,再到完整代码与一次性安装命令。腾讯云 COS 特有的坑(强制下载、CNAME、证书 hook)都收在这里。
落地
第一步:建 bucket
腾讯云控制台 → 对象存储 → 创建 bucket(其他家对象存储同理):
- 名称:随便起,比如
wiki-1307341066 - 访问权限:公有读私有写
- 地域:这里有个关键选择(详见后面"强制下载"一节):
ap-hongkong、ap-singapore 等 —— 无强制下载、不需备案,最省事。
ap-shanghai、ap-chengdu 等 —— 国内访问快,但默认强制下载,必须绑中国大陆 ICP 备案的域名才能解除。
建好后:
- 基础配置 → 静态网站 → 启用
- 索引文档:
index.html - 错误文档:
404.html
第二步:本地 Zensical 项目
最简 mkdocs.yml(仅用来跑通,真实配置见文末完整版):
构建 + 预览:
第三步:deploy.sh —— 一次构建,两个视图
这一步是"AI 友好"从设计变成现实的地方,值得多说几句。
Zensical 本身没有"把 markdown 源保留进构建产物"的功能 —— 命令只有 build / serve,没有插件钩子,官方 roadmap 未来一年也没这个计划1。所以这一层是 deploy.sh 自己实现的,核心四步:
rm -rf site && uv run zensical build # 1. 干净构建 —— HTML 视图 (1)
rsync -am --include='*/' --include='*.md' --exclude='*' docs/ site/ # 2. md 源镜像进 site/ —— AI 视图 (2)
coscmd upload -rs --delete -y ./ / # 3. site/ 整体镜像到桶根,顺手清掉桶里陈旧文件
coscmd upload -r --include '*.md' \
-H 'Content-Type: text/markdown; charset=utf-8' ./ / # 4. 修 .md 的 Content-Type (3)
- 先
rm -rf site再 build 不能省:第 3 步--delete以site/为准做全量镜像,本地残留的旧文件会"保护"桶里的陈旧内容不被清掉。 .md和.html的 key 不冲突:use_directory_urls下页面渲染成/x/index.html,源是/x.md,天然错开 —— md 源镜像进site/不会覆盖任何 HTML。- 这一步不能省:coscmd 默认把
.md传成application/octet-stream,浏览器会直接下载而不是显示 —— 对"给 AI/人直接读源"这个用途是致命的。
装 coscmd(腾讯云 COS 的命令行;其他家换成对应 CLI,如 aws s3 sync、rclone):
凭证写 .env(记得加进 .gitignore,模板见文末)。完整脚本见文末 deploy.sh snippet —— 引用的就是仓库里真跑的那份。
踩坑:别让 uv run --directory 把整个项目传上去
最早我写的是 cd site && uv run --directory .. coscmd upload -rs ./ /,但 uv run --directory 会把工作目录切回项目根,导致 coscmd 把整个项目(包括 .venv/ 和 .env!)都往对象存储传。绝对不能这样写。正确做法是 cd 进 site/ 后直接用绝对路径调用 venv 里的 coscmd。
AI 友好这层跟 zensical 无关,怎么升级都不怕
复制 md 源、镜像上传、修 Content-Type 这三件事零 zensical 依赖 —— 哪怕以后 Zensical 大改、甚至换回 MkDocs 或别的生成器,这层照常工作。真正依赖 zensical 的只有渲染层(snippets 等 pymdownx 扩展),版本锁在 uv.lock 里不会自动升,升级前本地 build 验证即可。
第四步:踩坑 —— 国内 bucket 的强制下载
第一次访问 bucket 默认域名时,浏览器直接把 HTML 当成文件下载。curl -I 看到响应正常:
但 curl -i(GET)看到 GET 请求多了两行:
这是腾讯云为了响应监管"未备案不能搭网站"的策略:国内区域 bucket 通过 *.myqcloud.com 域名访问 HTML 一律强制下载,跟 bucket 配置无关。解除方式只有:
- 绑定中国大陆 ICP 备案过的自定义域名,通过那个域名访问就豁免
- 或换到海外区域 bucket
我选了"绑备案域名"。
换别家对象存储就没这道坎
这条是国内对象存储特有的监管策略。用 Cloudflare R2 / AWS S3 这类海外服务直接绑自定义域名就没有强制下载问题 —— 但国内访问速度和备案是另一笔账。
第五步:绑定自定义域名
前提:liuhetian.work 已经 ICP 备案。注意备案对象是主域 liuhetian.work,不是 www.liuhetian.work,所有子域(wiki、api 等)自动覆盖。
绑定要做两件事,缺一不可 —— 这是我反复踩坑的关键:
其一,在控制台添加自定义源站域名。控制台 → bucket → 域名与传输管理 → 自定义源站域名 → 添加:
- 域名:
wiki.liuhetian.work - 源站类型:必须选 静态网站源站(不是默认源站!否则访问
/会触发 ListBucket API,返回AccessDenied) - 是否启用 HTTPS:先关,证书后面再补
保存后,控制台会展示一个 CNAME 目标:
其二,在 DNSPod 加一条 CNAME 记录:
| 主机 | 类型 | 值 |
|---|---|---|
wiki | CNAME | wiki-1307341066.cos.ap-chengdu.myqcloud.com |
等 5-30 分钟节点同步,访问 http://wiki.liuhetian.work/ 不会再有强制下载头。
容易绕进去的几个概念:
CNAME 目标 和 源站类型 是独立的两件事
CNAME 目标始终是 <bucket>.cos.<region>.myqcloud.com 这一个值,不管"源站类型"选什么,腾讯云给的 CNAME 目标都不变。
"源站类型"是后台的逻辑配置,决定 COS 接到请求后按什么模式处理:
- 默认源站:API 模式,访问
/等于 ListBucket,匿名 → 403 AccessDenied - 静态网站源站:把请求映射到
index.html,访问/直接出首页
两个开关分别在两个地方配,都要对才行。我最早只改了 DNS 没改"源站类型",结果一直 AccessDenied。
为什么 CNAME 不能指 cos-website.* 域名
<bucket>.cos.<region>.myqcloud.com 是 COS 主入口,所有 bucket 路由都从这里进;<bucket>.cos-website.<region>.myqcloud.com 是辅助域名,只在你直接用这个域名访问时走静态网站模式,后台不接受作为自定义 CNAME 目标。腾讯云在主入口查 Host 头 → 查后台"该域名绑了哪个 bucket、什么模式" → 按那个模式处理。
push 上传走的根本不是自定义域名
coscmd / SDK 推内容时,URL 永远是 <bucket>.cos.<region>.myqcloud.com(API 域名 + SigV4 签名),跟 wiki.liuhetian.work 无关。push 走 API 域名,访问走自定义域名,两条独立链路。试图用自定义域名做 PUT 会被拒(自定义域名走静态网站模式,不接受写鉴权)。
第六步:HTTPS 自动化(重头戏)
证书有两种来源:
| 方案 | 有效期 | 续期方式 |
|---|---|---|
| 腾讯云免费 DV 证书 | 3 个月(不是 1 年) | 控制台手动点"快速续期" + 手动重新绑定 |
| Let's Encrypt + acme.sh | 45 天(2026 年 5 月起;此前是 90 天2) | acme.sh 自带 cron,全自动 |
我选 Let's Encrypt + acme.sh。但有个意外:
acme.sh 没有内置腾讯云 hook
acme.sh 的 80 个 deploy hook 里有阿里云 CDN、七牛云,但没有任何腾讯云产品。意味着"签证书"是自动的,但"把证书推到 COS"要自己写脚本。换成有内置 hook 的服务商(如 Cloudflare)这一步能省掉。
acme.sh + DNS-01 挑战。首次配置全部封装在 deploy-cert/install.sh(见文末 snippet),核心是这两条 —— 切 CA + 用 DNSPod 插件做 DNS-01(其他 DNS 服务商对应换插件名3):
~/.acme.sh/acme.sh --set-default-ca --server letsencrypt
# DP_Id / DP_Key 来自 .env;其他 DNS 服务商对应换插件名
~/.acme.sh/acme.sh --issue --dns dns_dp -d wiki.liuhetian.work --keylength ec-256
DNS-01 挑战是什么:
sequenceDiagram
participant 你 as acme.sh
participant LE as Let's Encrypt
participant DP as DNSPod
你->>LE: 我要 wiki.liuhetian.work 的证书
LE->>你: 在 _acme-challenge.wiki.liuhetian.work 的 TXT 里写 xyz789
你->>DP: 调 DNSPod API 加 TXT 记录
LE->>DP: 查 _acme-challenge.wiki.liuhetian.work
DP-->>LE: xyz789
LE->>你: 验证通过,发证书
你->>DP: 删除 TXT 验证记录 实质上是临时在 liuhetian.work 下创建一个四级子域名 _acme-challenge.wiki.liuhetian.work 的 TXT 记录,记录值就是 Let's Encrypt 出的题。验证完立刻删。
为什么必须 DNS-01 不能 HTTP-01:HTTP-01 要求域名指向的 80 端口能放挑战文件,但 wiki.liuhetian.work 指向的是对象存储,不是我们能控制的 web 服务器。
自己写 hook 推证书到 COS。完整脚本见文末 deploy-cert/deploy_cert_to_cos.py snippet。它从 acme.sh 注入的环境变量读证书路径,调一个 API 把证书绑到自定义域名,关键就是这个调用:
client.put_bucket_domain_certificate(
Bucket=os.environ["COS_BUCKET"],
DomainCertificateConfiguration={
"CertificateInfo": { # (1)
"CertType": "CustomCert",
"CustomCert": {"Cert": cert, "PrivateKey": key},
},
"DomainList": [{"DomainName": os.environ["COS_DOMAIN"]}],
},
)
- 重要:
CertificateInfo这一层包装绝对不能漏。我第一版按 Python SDK 测试文件示例写少了这层,腾讯云返回InvalidArgument。真正的 XML 结构以 Go SDK 测试代码为准4。
注册 acme.sh reloadcmd。install.sh 最后把"读 .env → 设环境变量 → 跑 Python 推证书"这串命令注册成 acme.sh 的 --reloadcmd。acme.sh 把它存到 ~/.acme.sh/wiki.liuhetian.work_ecc/wiki.liuhetian.work.conf,每次续期成功后自动跑。
第七步:从此不用管 —— 自动续期循环
acme.sh 装的时候自动加了 cron:
每天 16:07 跑一次:
flowchart LR
Cron[每天 16:07 cron] --> Check{证书进入<br>续期窗口?}
Check -- 否 --> Sleep[继续睡到明天]
Check -- 是 --> Issue[acme.sh 发起<br>DNS-01 挑战]
Issue --> Hook[reloadcmd 触发<br>Python 脚本]
Hook --> Push[推到对象存储绑定]
Push --> Sleep 45 天证书约每 30 天自动续一次。你不需要做任何事 —— 2026 年 5 月 Let's Encrypt 把默认有效期从 90 天缩到 45 天2,acme.sh 不用改任何配置,自己跟着缩短了续期间隔。
日常写作流:主机部署,副机搭车
发布链路闭环之后,还剩一个日常问题:写作不一定总发生在这台配好部署环境的机器上 —— 可能在别的服务器上让 AI 直接生成文字稿。而部署环境(.env 凭证、uv、vendor)只想配一处,也不想每台写作机都惦记"怎么触发部署"。
解法是承认机器有主副之分,然后整个协同只花两行:
主机 = 主写作机 + 部署机。deploy.sh 的第 0 步是 git pull --ff-only,再构建上传 —— GitHub 上有什么新内容,每次部署自动捎带上线,主机自己该怎么写还怎么写。
副机 = 轻量写作端(AI 生成的文字稿为主)。clone 同一个 GitHub 仓库,写完 push。不急的什么都不用做,等主机下次部署搭车;急着上线就一条 alias:
push 完远程执行主机的部署脚本,脚本第 0 步的 pull 正好接住刚 push 的内容,部署日志实时回显在副机终端。前提只有一个:副机到主机免密 ssh(ssh-copy-id 配一次)。
图片跟文字一起走 Git(git-lfs)
文字和图片现在都走 Git。 二进制媒体经 git-lfs 入库(机制详见资源备份):commit 时文件在 git 里变成几十字节的指针,push 时真身由自制 agent 自动传进备份 COS 桶。副机加图不再需要 rsync 对路径、不需要手动跑备份 —— 一次 git push,文章和图片全部到位:
git add . && git commit && git push # 图片 blob 自动上备份桶
ssh <主机> /path/to/wiki/deploy.sh # 急件才需要;不急就等主机下次部署搭车
主机 deploy.sh 第 0 步的 git pull 拉到新指针时,smudge filter 经同一个 agent 把真身从桶里取回,构建看到的已是真图 —— 全程无人碰媒体文件。
副机首次接入(一次性):
GIT_LFS_SKIP_SMUDGE=1 git clone git@github.com:liuhetian/wiki.git && cd wiki
uv sync # 装出 .venv(qcloud_cos 随 coscmd 进来)
# 放一份 .env:只需 COS_SECRET_ID/KEY、COS_REGION、COS_BACKUP_BUCKET 四项;
# 建议用 CAM 子账号密钥、只授权备份桶,主密钥不出主机
bash scripts/setup-lfs.sh # 把 agent 注册进本 clone 的 git config
git lfs pull # 还原全部媒体真身
只写文字、不碰图的副机可以零密钥:GIT_LFS_SKIP_SMUDGE=1 clone 后直接写 —— 工作区里图片是指针文本,md 照常编辑、push 照常走,只是本地看不了图。
新部署机重建同理:上面五行就是完整恢复流程,不再有单独的"媒体恢复"步骤。
flowchart LR
B[副机写作<br>文字 + 图片] -->|git push:指针| GH[GitHub<br>文本 + LFS 指针]
B -->|git push:blob| BK[备份桶 lfs/<br>内容寻址档案]
A[主机写作] --> R[主机仓库]
GH -->|deploy.sh 第 0 步 pull| R
BK -->|smudge 自动取回真身| R
R -->|构建 + 上传| O[对象存储]
B -.->|急件:ssh 主机跑 deploy.sh| R 为什么不用更'自动'的方案
GitHub Actions 直传对象存储、webhook 回调、cron 轮询拉取 —— 这些都是为"部署机上无人写作"设计的。这里主写作机就是部署机,"提醒部署"的问题在主链路上根本不存在,只剩副机偶尔要触发,一句 ssh 就够:凭证不出主机、没有轮询延迟、也不用把 COS 密钥交给 CI。将来图片等重资产变多,这条链路也不受 GitHub 仓库体积的限制。
--ff-only 的取舍值得单独一句:本地与远端分叉、或未提交的改动跟拉下来的内容相撞时,pull 会直接报错,set -e 让整个部署停住。看似严苛,实则是保护 —— 部署是"出门见人"的动作,宁可停下来让人先处理,也不要静默合并出意外内容再发布出去。代价是一条纪律:主机写完要及时 commit + push。
资源备份:自制 mini LFS,备份桶即媒体档案馆
wiki 里图片、视频、字体只会越攒越多,它们的备份方案迭代过三代:
| 代 | 方案 | 毛病 |
|---|---|---|
| 1 | 什么都塞 git | 二进制无 diff 价值,历史体积只增不减,GitHub 仓库很快臃肿 |
| 2 | .gitignore 全屏蔽 + backup-media.sh 手动镜像到备份桶 | 手动跑、无版本(同名覆盖)、git 状态和媒体状态各走各的会漂移 |
| 3 | git-lfs + 自制 COS 后端(现行) | —— |
原理:一个 git 拉起的静态脚本,不是服务
git-lfs 的存储后端是可插拔的:除了标准的 HTTP 服务,它还支持 standalone custom transfer agent —— 一个本地程序,git-lfs 在 push/pull 需要搬 blob 时把它作为子进程拉起,stdin/stdout 上用 JSON-lines 对话(init / upload / download / terminate 四种事件),用完即退。没有常驻进程、不监听端口、不需要域名证书。
本站的 agent 是 ~140 行 Python(scripts/lfs-cos-agent.py),收到 upload/download 事件就用 qcloud_cos SDK 在备份桶里存取。并发、本地缓存(.git/lfs/objects)、sha256 完整性校验、增量判断全由 git-lfs 客户端自带,agent 只是个哑搬运工。
分工与数据流:
| 存放处 | 内容 |
|---|---|
| GitHub | markdown、代码、svg 等文本 + 每个媒体文件几十字节的 LFS 指针(不占 GitHub LFS 配额) |
备份桶 lfs/ 前缀 | 媒体真身,按内容寻址存 lfs/ab/cd/<sha256> |
| 工作区 | smudge 后的真身,供构建、部署直接用 |
内容寻址带来三个免费性质:去重(同一张图无论出现在几篇文章、几个历史版本里,桶里只存一份)、幂等(agent 上传前先 HEAD,重复 push 秒过)、全历史可还原(桶只增不减,git checkout 任意旧 commit,当时的图原样回来)。
什么进 git,什么进 LFS
分界线不是"大小",是文本性:
- git 文本:md、svg、代码、自己写的
vendor/*-init.js—— diff 有意义的东西; - LFS:位图 / 视频 / 音频 / 3D / pdf / 字体(woff2 等)/ 第三方 vendor 真身(MathJax、ECharts、three.js、react 这些 min.js —— 压缩产物 diff 无意义,每次升级还会往历史里灌一遍全量)。规则都在
.gitattributes,加新文件零操作,git add自动接管。
scripts/fetch-vendor.sh 从"恢复工具"降级为"升级工具":vendor 真身日常跟着 git 走(LFS 后端是自己的桶,不再依赖 jsdelivr 的可达性),只在想升级版本时改脚本里的版本号跑一次、commit。
密钥与信任边界
agent 从项目 .env 读凭证,所以碰媒体的机器才需要密钥(上传下载都要),纯文字机零密钥(见副机接入)。多机分发建议 CAM 子账号:只授权备份桶读写,主密钥永不离开主机。哪天要开放协作(让不持钥的人 clone),再把 agent 的存储层原样搬进一个签发预签名 URL 的 Batch API 服务即可,升级路径是平滑的。
两个已知的小事实:备份桶根下还留着第 2 代方案的路径镜像(历史存量,backup-media.sh 保留但不再日常使用);push 时进度条显示 0 B/s 是 standalone agent 不回报进度事件的正常现象,不影响传输。
认知:值得单独记下来的几件事
DNS 记录"值"是什么
DNS 不是"动作",是个 key-value 表,查表得到值:
| 记录类型 | 值 |
|---|---|
| A | IPv4 地址(43.134.81.54) |
| AAAA | IPv6 地址 |
| CNAME | 另一个域名(xxx.cos.ap-chengdu.myqcloud.com) |
| TXT | 任意字符串(ACME 挑战值 PpWCFq...、SPF、DMARC 等用这个) |
| MX | 邮件服务器 |
| NS | 权威 DNS 服务器 |
ACME 挑战必须用 TXT,因为挑战值是随机字符串 —— 既不是 IP 也不是域名。
服务器只是 runner,不参与流量
这个方案里我的服务器(43.134.81.54)从头到尾不在用户请求链路上。它只是个"定时跑续期脚本的机器",跟 GitHub Actions runner 完全等价。未来想换成 GitHub Actions,Python 脚本能直接复用,只是触发方式从 cron 换成 workflow。
Content-Disposition 头是 GET 才加
腾讯云的 x-cos-force-download 只在 GET 请求时追加,HEAD 请求看不到。所以验证 bucket 是否被国内强制下载策略影响,必须 curl -i(发 GET),不能只 curl -I(HEAD)。
未来展望
未来如果延伸到更复杂的情况,比如协助用户真的安装一些东西(比如一个skill),这种复杂脚本,可能需要借助本仓库的github地址,脚本里进行clone,从而拿到一些目录并执行。
总成本
| 项 | 成本 |
|---|---|
| 对象存储存储 + 流量 | 个人知识库流量基本免费 |
| 域名 | 已有,不算 |
| 证书 | Let's Encrypt 免费 |
| acme.sh | 开源 |
| 服务器 | 已有,且只跑 cron |
| 配置时间 | 第一次约 1 小时(含踩坑) |
后续维护:0。证书进入续期窗口后 acme.sh 自动续 + 自动推到对象存储。一年之内不需要登录控制台。
完整代码
下面用 --8<-- 折叠展示各文件原文 —— 引用的是本文 assets/ 里的真身(assets/ 里是指向仓库根的 symlink,源文件只一处、不双写;build 时把真身内容注入 HTML,也拷一份到 assets/ 供直接下载)。
对 AI 友好
真身都在仓库根(含 deploy-cert/)。如果你是直接读 git 仓库的 AI,无需展开本节 —— 打开仓库根对应文件即最新版。
唯一例外:mkdocs.yml 无法软链进 docs
实测 Zensical 对 docs/ 里出现的 .yml / .yaml 极其敏感 —— 哪怕改名软链进去都会搅乱路由、让文章"消失"(build 报 page does not exist)。所以 mkdocs.yml 只能靠 snippets 从项目根引用:HTML 视图完整可见、跟真身不脱节,但线上没有它的独立 URL —— 本 wiki 唯一的例外,已接受。.toml / .py / .sh / .gitignore 软链都正常。
项目结构(一览)
zensical-wiki/
├── docs/ ← 唯一内容源,连同 .md 全部随线上发布
│ ├── index.md
│ ├── posts/
│ │ ├── index.md ← 文章栏目着陆页
│ │ ├── wiki/ ← wiki 介绍:目标、用法、技术一项一页
│ │ │ └── cos-deploy/ ← 本文(index.md 概览 + reference/ 手册 + 共享 assets/)
│ │ │ ├── index.md ← 概览:标准 / 背景 / 设计 / 选型
│ │ │ ├── reference/
│ │ │ │ └── deploy.md ← 落地实操手册(本页)
│ │ │ └── assets/ ← 运行文件放软链(真身在仓库根,不双写)
│ │ │ ├── deploy.sh → ../../../../../deploy.sh
│ │ │ ├── install.sh → ../../../../../deploy-cert/install.sh
│ │ │ ├── deploy_cert_to_cos.py → ../../../../../deploy-cert/deploy_cert_to_cos.py
│ │ │ ├── pyproject.toml → ../../../../../pyproject.toml
│ │ │ ├── llm-wiki.md ← 外部资料存档(真身,非软链)
│ │ │ └── llms-txt.md ← 外部资料存档(真身,非软链)
│ └── skills/<skill>/ ← 同样 index.md + reference/ + assets/
├── deploy-cert/ ← SSL 证书续期(真身)
│ ├── deploy_cert_to_cos.py
│ └── install.sh
├── scripts/ ← 运维脚本(真身)
│ ├── lfs-cos-agent.py ← mini LFS:媒体 blob ↔ 备份桶
│ ├── setup-lfs.sh ← 每个 clone 一次性接入 LFS
│ └── fetch-vendor.sh ← vendor 版本升级工具
├── mkdocs.yml · deploy.sh · pyproject.toml · .gitignore ← 仓库根真身
└── .env ← 凭证(不入版本控制)
mkdocs.yml — Zensical 站点配置
site_name: 牛合天's wiki
site_url: https://wiki.liuhetian.work/
# 不是给人看的仓库地址:只为让 page.edit_url 拼出每页 .md 源文件的地址(edit_uri 是绝对地址时,
# edit_url = edit_uri + 源文件路径),overrides/main.html 拿它写页头的发现链接,vendor/md-copy.js 的复制按钮读它。
# 设了 repo_url 主题会在顶栏放一个仓库入口,由空的 overrides/partials/source.html 关掉;
# 编辑按钮要开 content.action.edit 才出现,本站不开。
repo_url: https://wiki.liuhetian.work/
edit_uri: https://wiki.liuhetian.work/
copyright: >
Copyright © 2026 Liu Hetian ·
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">蜀ICP备2021023978号-2</a>
theme:
name: material
custom_dir: overrides # 首页开屏模板 home.html 所在目录
language: zh
font: false # 关掉 Google Fonts 远程引用(渲染阻塞,境内常超时);字体本地化见 extra_css
features:
- navigation.tabs
- navigation.indexes
- navigation.sections # 跟 tabs 合用时,每个板块的第二层在侧栏渲染成不折叠的组标题、下面全部展开(宽于 1220px 才生效)。
# 所以每个板块的第二层只放组名(不对应页面,网址不变),真正的目录在第三层、照常折叠;
# 新目录要挂进某个组,直接挂在第二层会被强制展开,单页夹在两组之间会像上一组的成员
- navigation.prune # 每页只渲染看得见的导航项。不开时整棵导航(800+ 篇)嵌进每页,占页面 94%:
# 改一个 nav 标题就有 1024 个 HTML 变化、部署重传约 400 MB;开了只变 18 个,
# HTML 总量 447 MB → 65 MB(2026-10-10 实测)。代价是侧栏别的分区不能就地展开,点了跳分区首页
- content.code.copy
- content.code.annotate
extra_css:
- vendor/fonts/fonts.css # 本地 Maple Mono(拉丁官方 woff2 + 自建中文子集),替代 fonts.googleapis.com;只出 --md-text-font/--md-code-font
- stylesheets/zx-tokens.css # 全站令牌层:Atelier Zero 令牌 + --md-*/--color-* 映射(首页 home.css 也用它)
- stylesheets/zx-theme.css # 全站皮肤层:只写选择器,消费上一层的变量
extra_javascript:
- vendor/mathjax-init.js # MathJax 配置 + 按需加载器;真身(vendor/mathjax/tex-svg.js,3.2.2,
# SVG 输出免字体文件)2MB,只有含 .arithmatex 的页面才拉,不出外网
- vendor/echarts-init.js # ```echarts 代码块渲染器;真身按需动态加载,无图页面零开销
- vendor/js-runner.js # ```{.js .run} 代码块的运行器:Worker 沙箱执行 + 输出面板;零依赖,无可运行块的页面直接返回
- vendor/conflict-init.js # ```conflict 代码块(笔记里给自己出的题)染成上问下答两半;无此类块的页面直接返回
- vendor/md-copy.js # 「复制本页 Markdown 源」按钮:复制 .md 源文件,相对链接和 --8<-- 改成绝对地址;页头没有发现链接就不出按钮
- vendor/age-init.js # 打码:`age:…` 小字和 ```age 块显示成马赛克,解锁后还原;有密文才按需加载 vendor/age-core.js
markdown_extensions:
- admonition
- attr_list
- footnotes
- md_in_html
- pymdownx.arithmatex:
generic: true
- pymdownx.details
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets:
base_path:
- docs # docs 内引用去掉 docs/ 前缀(如 skills/.../x.md),避免 AI 把 docs/ 当 URL
- . # 回退到项目根:mkdocs.yml / deploy.sh 等真实文件仍可被 --8<-- 引用
check_paths: true
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- name: echarts # 声明式图表:fence 里写 ECharts option JSON,vendor/echarts-init.js 渲染
class: echarts
format: !!python/name:pymdownx.superfences.fence_code_format
- name: conflict # 提问块:fence 里写 git 冲突标记,上半是问、下半是答(见 skills/wiki-guide/course.md)
class: conflict
format: !!python/name:pymdownx.superfences.fence_code_format
- name: age # 打码大段内容:fence 里放 age -a 的 armor 密文,vendor/age-init.js 显示成马赛克
class: age
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed:
alternate_style: true
# MkDocs 插件。zensical 0.0.58 起把这几个插件用 Rust 重写进了本体,不用额外装 pip 包,
# 写上名字即可。显式声明 plugins 不会关掉搜索 —— 实测 site/search.json 照常产出。
plugins:
# 压掉 HTML 里的空白。navigation.prune 剪掉的导航项在模板里仍留下空格换行,增删一个 nav 条目,
# 全站每页的空白都挪位、字节都变:挪一个 skill 实测 1047 页变化、重传 67 MB;开了只剩真正显示
# 那个条目的分区(532 页、28 MB),HTML 总量 70 MB → 50 MB(2026-10-17 实测)。
# pre / code / textarea 里的原文不动,mermaid、echarts、打码、可运行代码块都靠它们
- minify:
minify_html: true
# 目录级 frontmatter 默认值:某目录放一个 .meta.yml,里面的键给该目录**及其子目录**下
# 所有页面当默认,页面自己的 frontmatter 优先。用来给两类不能动的文件补 description:
# 上游原文照录的存档(改了就不是原文),和被 --8<-- 当 snippet 引用的真身(加 frontmatter
# 会把 --- 和 description: 漏进引用它的正文里)。.meta.yml 不进 site/,也不会被
# deploy.sh 那行只捞 *.md 的 rsync 带上桶。
- meta
# 点图片弹出遮罩放大,左右翻同页的其他图,Esc 关掉。Zensical 内置,把正文里没套链接的图包成
# a.glightbox;套了链接的图点了照旧跳转。灯箱的 JS 和 CSS 由 overrides/main.html 从 vendor/glightbox/ 引入,不走 CDN
- glightbox
# 挪文件时留重定向,替代旧地址存根页。左旧右新,都写 docs/ 内的相对路径;
# 支持 old.md#anchor 形式的锚点级重定向(0.0.61+),改标题不炸别人的书签。
# 注意它只修好人那一半:产物是 site/<旧路径>/index.html 里一条 meta refresh,
# 而 .md 那一半是 deploy.sh 从 docs/ 实镜像出来的,旧的 /<旧路径>.md 仍然 404。
# 所以挪文件依旧要把站内引用一并改掉,redirects 兜的是站外链接和别人的书签。
- redirects:
redirect_maps:
# 2026-09-29 手绘风格库的版式、主题色单独成区:gallery/layouts/、gallery/colors/
gallery/images/handdraw-style/layouts-social-cards.md: gallery/layouts/social-cards.md
gallery/images/handdraw-style/layouts-infographics.md: gallery/layouts/infographics.md
gallery/images/handdraw-style/layouts-comic-storyboards.md: gallery/layouts/comic-storyboards.md
gallery/images/handdraw-style/colors.md: gallery/colors/classic.md
# 例:posts/old-name.md: posts/new-name.md
# 2026-10-01 本 wiki 的技术归成一个系列 posts/wiki-tech/,建站手记删掉
posts/cos-wiki-deploy/index.md: projects/wiki/cos-deploy/index.md
posts/cos-wiki-deploy/reference/deploy.md: projects/wiki/cos-deploy/reference/deploy.md
posts/cos-wiki-deploy/reference/wiki-build-log.md: projects/wiki/index.md#timeline # 2026-10-14 改指能力时间线
# 2026-10-14 能力时间线并进 wiki-tech 索引页,单独那页只活了一天
posts/wiki-tech/timeline.md: projects/wiki/index.md#timeline
posts/git-lfs-cos.md: projects/wiki/git-lfs.md
# 2026-10-01 新机器配开发环境挪进「搭建 AI 助手」当第一篇
posts/dev-env.md: projects/ai-assistant/dev-env.md
# 2026-10-01 存 key 那篇和打码合成一篇,key 本身改成打码写进 API 中转
posts/ai-assistant/key-storage.md: projects/wiki/age-mosaic.md
# 2026-10-17 wiki-tech、目标与计划、远程 skill 三篇合成一个目录 posts/wiki/(wiki 介绍)
posts/wiki-tech/index.md: projects/wiki/index.md
posts/wiki-tech/cos-deploy/index.md: projects/wiki/cos-deploy/index.md
posts/wiki-tech/cos-deploy/reference/deploy.md: projects/wiki/cos-deploy/reference/deploy.md
posts/wiki-tech/git-lfs.md: projects/wiki/git-lfs.md
posts/wiki-tech/age-mosaic.md: projects/wiki/age-mosaic.md
posts/wiki-tech/md-copy.md: projects/wiki/md-copy.md
posts/wiki-tech/zensical-upgrade/index.md: maintenance/zensical-upgrade/index.md
posts/wiki-roadmap.md: projects/wiki/roadmap.md
posts/everything-skill.md: projects/wiki/everything-skill.md
# 2026-10-15 吸纳记录从 skill 目录里的 MIRROR.md 挪进维护目录
skills/collab/grilling/MIRROR.md: maintenance/skills/grilling.md
# posts/guide.md#installation: posts/guide.md#getting-started
# 2026-09-29 本 wiki 自己的写作规范从「写作口味」拆出,单开 skills/wiki-guide/
skills/writing/mkdocs-wiki/index.md: skills/wiki-guide/index.md
skills/writing/mkdocs-wiki/reference/course-page.md: skills/wiki-guide/course.md
# 2026-10-16 写作规范改成抽象 skill:页面规矩提进入口,组件和配图进 reference/,课程页、skill、精简检查成子 skill
skills/wiki-guide/mkdocs-wiki/index.md: skills/wiki-guide/index.md
skills/wiki-guide/mkdocs-wiki/index.md#iframe-demo: skills/wiki-guide/reference/components.md#iframe-demo
skills/wiki-guide/mkdocs-wiki/index.md#js-run: skills/wiki-guide/reference/components.md#js-run
skills/wiki-guide/mkdocs-wiki/index.md#age-mosaic: skills/wiki-guide/reference/components.md#age-mosaic
skills/wiki-guide/mkdocs-wiki/index.md#timeline: skills/wiki-guide/reference/components.md#timeline
skills/wiki-guide/mkdocs-wiki/index.md#no-copy: skills/wiki-guide/reference/components.md#no-copy
skills/wiki-guide/mkdocs-wiki/index.md#marker-doodle-images: skills/wiki-guide/reference/infographic.md
skills/wiki-guide/reference/marker-doodle.md: skills/wiki-guide/reference/infographic.md
skills/wiki-guide/mkdocs-wiki/index.md#absorbed-skill: skills/collect/skill.md#principles
skills/wiki-guide/course-page.md: skills/wiki-guide/course.md
skills/wiki-guide/remote-skill.md: skills/wiki-guide/skill.md
# 2026-10-16 skill 怎么写和收纳合成一页「收纳 skill」,skill/index.md 与 skill.md 同一个网页地址,不用跳
skills/wiki-guide/skill/reference/absorb.md: skills/collect/skill.md#principles
skills/wiki-guide/trim-ai-knowledge.md: skills/wiki-guide/trim.md
# 2026-10-16 CLAUDE.md 初始化模板删除,Karpathy 四条原则改为整页中译吸纳成「初始化项目」
skills/collab/claude-md-template/index.md: skills/init-project.md
# 2026-10-16 带文档盘问改为整页中译重新吸纳:来源进维护目录,domain-modeling 的两份格式挪进 reference/
skills/collab/grill-with-docs/MIRROR.md: maintenance/skills/grill-with-docs.md
skills/collab/grill-with-docs/domain-modeling/SKILL.md: skills/grill-with-docs/domain-modeling/index.md
skills/collab/grill-with-docs/domain-modeling/CONTEXT-FORMAT.md: skills/grill-with-docs/domain-modeling/reference/glossary-format.md
skills/collab/grill-with-docs/domain-modeling/ADR-FORMAT.md: skills/grill-with-docs/domain-modeling/reference/adr-format.md
# 2026-10-16 两个图片反推 skill 合并成抽象能力「图片提示词反推」:七维拆解是简化版,get-prompt-from-image 是完整版,来源进维护目录
skills/collab/analysis_image/index.md: skills/image-prompt-reverse/seven-dimensions/index.md
skills/collab/analysis_image/assets/linux-do-2729491/MIRROR.md: maintenance/skills/seven-dimensions.md
skills/collab/analysis_image/assets/linux-do-2729491/post.md: skills/image-prompt-reverse/seven-dimensions/assets/linux-do-2729491/post.md
skills/collab/get-prompt-from-image/index.md: skills/image-prompt-reverse/get-prompt-from-image/index.md
skills/collab/get-prompt-from-image/MIRROR.md: maintenance/skills/get-prompt-from-image.md
skills/collab/get-prompt-from-image/references/analysis-framework.md: skills/image-prompt-reverse/get-prompt-from-image/references/analysis-framework.md
skills/collab/get-prompt-from-image/references/category-guides.md: skills/image-prompt-reverse/get-prompt-from-image/references/category-guides.md
skills/collab/get-prompt-from-image/references/illustration-style.md: skills/image-prompt-reverse/get-prompt-from-image/references/illustration-style.md
# 2026-10-16 提示词卡牌去掉卡牌包装重新收纳成「对话提示词」:一段 prompt 一个子 skill,来源进维护目录,生图卡来源挪进 Gallery
skills/collab/prompt-cards/index.md: skills/chat-prompts/index.md
skills/collab/prompt-cards/MIRROR.md: maintenance/skills/chat-prompts.md
skills/collab/prompt-cards/reference/persona.md: skills/chat-prompts/index.md
skills/collab/prompt-cards/reference/persona.md#role-architect: skills/chat-prompts/architect.md
skills/collab/prompt-cards/reference/persona.md#role-talent-miner: skills/chat-prompts/talent-miner.md
skills/collab/prompt-cards/reference/persona.md#role-life-designer: skills/chat-prompts/life-designer.md
skills/collab/prompt-cards/reference/persona.md#role-critic: skills/chat-prompts/critic.md
skills/collab/prompt-cards/reference/playbook.md: skills/chat-prompts/index.md
skills/collab/prompt-cards/reference/playbook.md#flow-refine: skills/chat-prompts/prompt-refine.md
skills/collab/prompt-cards/reference/playbook.md#flow-socratic: skills/chat-prompts/socratic.md
skills/collab/prompt-cards/reference/playbook.md#flow-dual-explain: skills/chat-prompts/dual-explain.md
skills/collab/prompt-cards/reference/playbook.md#flow-cross-axis: skills/chat-prompts/cross-axis.md
skills/collab/prompt-cards/reference/playbook.md#flow-fact-check: skills/chat-prompts/fact-check.md
skills/collab/prompt-cards/reference/playbook.md#flow-expert-panel: skills/chat-prompts/expert-panel.md
skills/collab/prompt-cards/reference/playbook.md#flow-first-principles: skills/chat-prompts/first-principles.md
skills/collab/prompt-cards/reference/playbook.md#flow-cross-domain: skills/chat-prompts/cross-domain.md
skills/collab/prompt-cards/reference/playbook.md#flow-steelman: skills/chat-prompts/steelman.md
skills/collab/prompt-cards/reference/playbook.md#flow-debug: skills/chat-prompts/root-cause.md
skills/collab/prompt-cards/reference/guard.md: skills/chat-prompts/index.md
skills/collab/prompt-cards/reference/guard.md#trap-scope: skills/chat-prompts/scope-lock.md
skills/collab/prompt-cards/reference/guard.md#trap-plain: skills/chat-prompts/plain-talk.md
skills/collab/prompt-cards/reference/guard.md#trap-facts: skills/chat-prompts/seek-truth.md
# 2026-10-16 B站视频笔记按新规范重新吸纳:来源进维护目录,下载和转写改走 agent-io
skills/bili-note/MIRROR.md: maintenance/skills/video-note.md
# 2026-10-17 B站视频笔记改成通用的视频笔记,目录 bili-note 改 video-note
skills/bili-note/index.md: skills/video-note/index.md
skills/bili-note/references/bilibili-api-notes.md: skills/agent-io/reference/share-link/bilibili.md
maintenance/skills/bili-note.md: maintenance/skills/video-note.md
# 2026-10-17 视频制作 skill 并进 Gallery:花卉动态生长海报的做法直接写在成品页
skills/video-production/index.md: gallery/video/index.md
skills/video-production/flower-growth-poster/index.md: gallery/video/flower-growth-poster.md
# 2026-10-19 取消视频笔记板块:魔术题进 notes 智力题,花卉笔记并进 Gallery 成品页
posts/video-notes/five-card-trick.md: notes/probability/five-card-trick.md
posts/video-notes/flower-growth-poster.md: gallery/video/flower-growth-poster.md
# 2026-10-20 粗讲项目、细讲项目从对话提示词挪出来,单独成顶层 skill「调研项目」
skills/collab/chat-prompts/project-gist.md: skills/project-research/gist.md
skills/collab/chat-prompts/project-dissect.md: skills/project-research/dissect.md
# 2026-10-20 AI 调研写手册退役,调研仓库改用「调研项目」;SillyTavern 调研计划的成品在项目拆解
skills/book-writer/index.md: skills/project-research/index.md
skills/book-writer/reference/goal-st.md: projects/sillytavern/index.md
posts/video-notes/index.md: posts/index.md
# 2026-10-17 视频笔记改名整理视频为笔记、拆成下载分析输出三段,B站接口笔记并进 agent-io
skills/video-note/references/bilibili-api-notes.md: skills/agent-io/reference/share-link/bilibili.md
# 2026-10-17 测试skill是实测流水线用的 mock,从 Skills 挪进维护
skills/mock-bundle/index.md: maintenance/mock-bundle/index.md
skills/mock-bundle/greet/index.md: maintenance/mock-bundle/greet/index.md
skills/mock-bundle/count/index.md: maintenance/mock-bundle/count/index.md
# 2026-10-16 维护目录从「搭建 AI 助手」里挪出来,成为和 Skills、Gallery 平级的顶层板块「维护」
posts/ai-assistant/maintenance/assets/decision-models-research.md: maintenance/assets/decision-models-research.md
posts/ai-assistant/maintenance/image.md: maintenance/image.md
posts/ai-assistant/maintenance/index.md: maintenance/index.md
posts/ai-assistant/maintenance/jev.md: maintenance/jev.md
posts/ai-assistant/maintenance/music.md: maintenance/music.md
posts/ai-assistant/maintenance/pdf-reading.md: maintenance/pdf-reading.md
posts/ai-assistant/maintenance/share-link.md: maintenance/share-link.md
posts/ai-assistant/maintenance/skills/chat-prompts.md: maintenance/skills/chat-prompts.md
posts/ai-assistant/maintenance/skills/get-prompt-from-image.md: maintenance/skills/get-prompt-from-image.md
posts/ai-assistant/maintenance/skills/grill-with-docs.md: maintenance/skills/grill-with-docs.md
posts/ai-assistant/maintenance/skills/grilling.md: maintenance/skills/grilling.md
posts/ai-assistant/maintenance/skills/init-project.md: maintenance/skills/init-project.md
posts/ai-assistant/maintenance/skills/seven-dimensions.md: maintenance/skills/seven-dimensions.md
posts/ai-assistant/maintenance/transcribe.md: maintenance/transcribe.md
posts/ai-assistant/maintenance/tts.md: maintenance/tts.md
posts/ai-assistant/maintenance/video.md: maintenance/video.md
posts/ai-assistant/maintenance/web-search.md: maintenance/web-search.md
# 2026-09-29 前端风格收集从 skills/ 挪进 gallery/web/(Gallery 分图片/视频/音频/网页四区)
skills/frontend-styles/haoqi/01-opening.md: gallery/web/frontend-styles/haoqi/01-opening.md
skills/frontend-styles/haoqi/index.md: gallery/web/frontend-styles/haoqi/index.md
skills/frontend-styles/index.md: gallery/web/frontend-styles/index.md
skills/frontend-styles/open-design/blur-text.md: gallery/web/frontend-styles/open-design/blur-text.md
skills/frontend-styles/open-design/drag-sticker.md: gallery/web/frontend-styles/open-design/drag-sticker.md
skills/frontend-styles/open-design/falling-chips.md: gallery/web/frontend-styles/open-design/falling-chips.md
skills/frontend-styles/open-design/globe-orbit.md: gallery/web/frontend-styles/open-design/globe-orbit.md
skills/frontend-styles/open-design/gradual-blur.md: gallery/web/frontend-styles/open-design/gradual-blur.md
skills/frontend-styles/open-design/headroom-nav.md: gallery/web/frontend-styles/open-design/headroom-nav.md
skills/frontend-styles/open-design/index.md: gallery/web/frontend-styles/open-design/index.md
skills/frontend-styles/open-design/magnetic-dock.md: gallery/web/frontend-styles/open-design/magnetic-dock.md
skills/frontend-styles/open-design/scroll-reveal.md: gallery/web/frontend-styles/open-design/scroll-reveal.md
skills/frontend-styles/open-design/scrolly-steps.md: gallery/web/frontend-styles/open-design/scrolly-steps.md
skills/frontend-styles/open-design/stat-cards.md: gallery/web/frontend-styles/open-design/stat-cards.md
skills/frontend-styles/open-design/statement-reveal.md: gallery/web/frontend-styles/open-design/statement-reveal.md
skills/frontend-styles/oryzo/blueprint-intro.md: gallery/web/frontend-styles/oryzo/blueprint-intro.md
skills/frontend-styles/oryzo/index.md: gallery/web/frontend-styles/oryzo/index.md
skills/frontend-styles/oryzo/rgb-glow-border.md: gallery/web/frontend-styles/oryzo/rgb-glow-border.md
skills/frontend-styles/oryzo/scene-morph.md: gallery/web/frontend-styles/oryzo/scene-morph.md
skills/frontend-styles/oryzo/splat-system.md: gallery/web/frontend-styles/oryzo/splat-system.md
skills/frontend-styles/oryzo/wearable-scene.md: gallery/web/frontend-styles/oryzo/wearable-scene.md
skills/frontend-styles/reference/atelier-kinetic.md: gallery/web/frontend-styles/reference/atelier-kinetic.md
skills/frontend-styles/reference/celestia-collection.md: gallery/web/frontend-styles/reference/celestia-collection.md
skills/frontend-styles/reference/nexus-2030.md: gallery/web/frontend-styles/reference/nexus-2030.md
skills/frontend-styles/reference/onehub-berry-admin.md: gallery/web/frontend-styles/reference/onehub-berry-admin.md
skills/frontend-styles/reference/pip-boy-terminal.md: gallery/web/frontend-styles/reference/pip-boy-terminal.md
skills/frontend-styles/reference/syzygy-astral.md: gallery/web/frontend-styles/reference/syzygy-astral.md
skills/frontend-styles/reference/task1-platter.md: gallery/web/frontend-styles/reference/task1-platter.md
skills/frontend-styles/reference/task2-parallax-archive.md: gallery/web/frontend-styles/reference/task2-parallax-archive.md
skills/frontend-styles/reference/task3-line-system.md: gallery/web/frontend-styles/reference/task3-line-system.md
skills/frontend-styles/reference/task4-world-files.md: gallery/web/frontend-styles/reference/task4-world-files.md
skills/frontend-styles/reference/task5-pixel-bloom.md: gallery/web/frontend-styles/reference/task5-pixel-bloom.md
skills/frontend-styles/reference/task6-tintory.md: gallery/web/frontend-styles/reference/task6-tintory.md
skills/frontend-styles/reference/task7-neat-annotations.md: gallery/web/frontend-styles/reference/task7-neat-annotations.md
skills/frontend-styles/reference/vercel-lanyard.md: gallery/web/frontend-styles/reference/vercel-lanyard.md
skills/frontend-styles/reference/verdant-glass.md: gallery/web/frontend-styles/reference/verdant-glass.md
# 2026-09-29 图库从 skills/collab/ 挪到顶层 gallery/;gpt-image2-skill 里没收的页面(CHANGELOG、gpt-image 手册等)不跳,诚实 404
skills/collab/analysis_image/reference/style-extraction.md: gallery/images/linux-do-style/gallery-anime-graphic-design.md
gallery/gpt-image2/index.md: gallery/images/index.md
gallery/linux-do-style/index.md: gallery/images/linux-do-style/gallery-anime-graphic-design.md
gallery/gpt-image2/sunburst-samples.md: gallery/images/index.md
skills/collab/gpt-image2-skill/README.md: gallery/images/index.md
skills/collab/gpt-image2-skill/README.zh.md: gallery/images/index.md
skills/collab/gpt-image2-skill/MIRROR.md: maintenance/gallery/gpt-image2.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery.md: gallery/images/index.md
skills/collab/gpt-image2-skill/docs/sunburst-samples.md: gallery/images/index.md
skills/collab/gpt-image2-skill/skills/get-prompt-from-image/SKILL.md: skills/image-prompt-reverse/get-prompt-from-image/index.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-anime-and-manga.md: gallery/images/gpt-image2/gallery-anime-and-manga.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-gaming.md: gallery/images/gpt-image2/gallery-gaming.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-retro-and-cyberpunk.md: gallery/images/gpt-image2/gallery-retro-and-cyberpunk.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-cinematic-and-animation.md: gallery/images/gpt-image2/gallery-cinematic-and-animation.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-character-design.md: gallery/images/gpt-image2/gallery-character-design.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-typography-and-posters.md: gallery/images/gpt-image2/gallery-typography-and-posters.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-illustration.md: gallery/images/gpt-image2/gallery-illustration.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-watercolor.md: gallery/images/gpt-image2/gallery-watercolor.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-ink-and-chinese.md: gallery/images/gpt-image2/gallery-ink-and-chinese.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-pixel-art.md: gallery/images/gpt-image2/gallery-pixel-art.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-isometric.md: gallery/images/gpt-image2/gallery-isometric.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-product-and-food.md: gallery/images/gpt-image2/gallery-product-and-food.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-brand-systems-and-identity.md: gallery/images/gpt-image2/gallery-brand-systems-and-identity.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-photography.md: gallery/images/gpt-image2/gallery-photography.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-infographics-and-field-guides.md: gallery/images/gpt-image2/gallery-infographics-and-field-guides.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-research-paper-figures.md: gallery/images/gpt-image2/gallery-research-paper-figures.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-official-openai-cookbook-examples.md: gallery/images/gpt-image2/gallery-official-openai-cookbook-examples.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-edit-endpoint-showcase.md: gallery/images/gpt-image2/gallery-edit-endpoint-showcase.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-ui-ux-mockups.md: gallery/images/gpt-image2/gallery-ui-ux-mockups.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-data-visualization.md: gallery/images/gpt-image2/gallery-data-visualization.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-technical-illustration.md: gallery/images/gpt-image2/gallery-technical-illustration.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-architecture-and-interior.md: gallery/images/gpt-image2/gallery-architecture-and-interior.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-scientific-and-educational.md: gallery/images/gpt-image2/gallery-scientific-and-educational.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-fashion-editorial.md: gallery/images/gpt-image2/gallery-fashion-editorial.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-fine-art-painting.md: gallery/images/gpt-image2/gallery-fine-art-painting.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-more-illustration-styles.md: gallery/images/gpt-image2/gallery-more-illustration-styles.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-cinematic-film-references.md: gallery/images/gpt-image2/gallery-cinematic-film-references.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-beauty-and-lifestyle.md: gallery/images/gpt-image2/gallery-beauty-and-lifestyle.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-events-and-experience.md: gallery/images/gpt-image2/gallery-events-and-experience.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-tattoo-design.md: gallery/images/gpt-image2/gallery-tattoo-design.md
skills/collab/gpt-image2-skill/skills/gpt-image/references/gallery-screen-photography.md: gallery/images/gpt-image2/gallery-screen-photography.md
skills/collab/gpt-image2-skill/skills/get-prompt-from-image/references/analysis-framework.md: skills/image-prompt-reverse/get-prompt-from-image/references/analysis-framework.md
skills/collab/gpt-image2-skill/skills/get-prompt-from-image/references/category-guides.md: skills/image-prompt-reverse/get-prompt-from-image/references/category-guides.md
skills/collab/gpt-image2-skill/skills/get-prompt-from-image/references/illustration-style.md: skills/image-prompt-reverse/get-prompt-from-image/references/illustration-style.md
# 2026-10-19 剩下的吸纳记录也从 skill 目录里的 MIRROR.md 挪进维护目录
skills/writing/qu-ai-wei/MIRROR.md: maintenance/skills/qu-ai-wei.md
skills/writing/xi-wen/MIRROR.md: maintenance/skills/xi-wen.md
# 2026-10-19 Gallery 和 skill assets/ 里的 MIRROR.md 也挪进维护目录
gallery/images/handdraw-style/MIRROR.md: maintenance/skills/handdraw.md
gallery/images/gpt-image2/MIRROR.md: maintenance/gallery/gpt-image2.md
gallery/images/prompt-cards/MIRROR.md: maintenance/gallery/prompt-cards.md
gallery/images/linux-do-style/assets/MIRROR.md: maintenance/gallery/linux-do-style.md
gallery/images/collected/MIRROR.md: maintenance/gallery/images-collected.md
gallery/colors/collected/MIRROR.md: maintenance/gallery/colors-collected.md
gallery/video/collected/MIRROR.md: maintenance/gallery/video-collected.md
skills/collab/chat-prompts/assets/xhs-6abf6887/MIRROR.md: maintenance/skills/chat-prompts.md#xhs-ste
skills/collab/image-prompt-reverse/seven-dimensions/assets/linux-do-2729491/MIRROR.md: maintenance/skills/seven-dimensions.md
# 2026-10-23 和 AI 协作拆开:五个子 skill 上提到 skills/ 下,同属「写作与协作」组
skills/collab/index.md: skills/index.md#collab
skills/collab/chat-prompts/architect.md: skills/chat-prompts/architect.md
skills/collab/chat-prompts/assets/xhs-6abf6887/post.md: skills/chat-prompts/assets/xhs-6abf6887/post.md
skills/collab/chat-prompts/critic.md: skills/chat-prompts/critic.md
skills/collab/chat-prompts/cross-axis.md: skills/chat-prompts/cross-axis.md
skills/collab/chat-prompts/cross-domain.md: skills/chat-prompts/cross-domain.md
skills/collab/chat-prompts/dual-explain.md: skills/chat-prompts/dual-explain.md
skills/collab/chat-prompts/expert-panel.md: skills/chat-prompts/expert-panel.md
skills/collab/chat-prompts/fact-check.md: skills/chat-prompts/fact-check.md
skills/collab/chat-prompts/first-principles.md: skills/chat-prompts/first-principles.md
skills/collab/chat-prompts/index.md: skills/chat-prompts/index.md
skills/collab/chat-prompts/life-designer.md: skills/chat-prompts/life-designer.md
skills/collab/chat-prompts/plain-talk.md: skills/chat-prompts/plain-talk.md
skills/collab/chat-prompts/prompt-refine.md: skills/chat-prompts/prompt-refine.md
skills/collab/chat-prompts/root-cause.md: skills/chat-prompts/root-cause.md
skills/collab/chat-prompts/scope-lock.md: skills/chat-prompts/scope-lock.md
skills/collab/chat-prompts/seek-truth.md: skills/chat-prompts/seek-truth.md
skills/collab/chat-prompts/socratic.md: skills/chat-prompts/socratic.md
skills/collab/chat-prompts/ste-plain.md: skills/chat-prompts/ste-plain.md
skills/collab/chat-prompts/steelman.md: skills/chat-prompts/steelman.md
skills/collab/chat-prompts/talent-miner.md: skills/chat-prompts/talent-miner.md
skills/collab/grill-with-docs/domain-modeling/index.md: skills/grill-with-docs/domain-modeling/index.md
skills/collab/grill-with-docs/domain-modeling/reference/adr-format.md: skills/grill-with-docs/domain-modeling/reference/adr-format.md
skills/collab/grill-with-docs/domain-modeling/reference/glossary-format.md: skills/grill-with-docs/domain-modeling/reference/glossary-format.md
skills/collab/grill-with-docs/index.md: skills/grill-with-docs/index.md
skills/collab/grilling.md: skills/grilling.md
skills/collab/image-prompt-reverse/get-prompt-from-image/index.md: skills/image-prompt-reverse/get-prompt-from-image/index.md
skills/collab/image-prompt-reverse/get-prompt-from-image/references/analysis-framework.md: skills/image-prompt-reverse/get-prompt-from-image/references/analysis-framework.md
skills/collab/image-prompt-reverse/get-prompt-from-image/references/category-guides.md: skills/image-prompt-reverse/get-prompt-from-image/references/category-guides.md
skills/collab/image-prompt-reverse/get-prompt-from-image/references/illustration-style.md: skills/image-prompt-reverse/get-prompt-from-image/references/illustration-style.md
skills/collab/image-prompt-reverse/index.md: skills/image-prompt-reverse/index.md
skills/collab/image-prompt-reverse/seven-dimensions/assets/linux-do-2729491/post.md: skills/image-prompt-reverse/seven-dimensions/assets/linux-do-2729491/post.md
skills/collab/image-prompt-reverse/seven-dimensions/index.md: skills/image-prompt-reverse/seven-dimensions/index.md
skills/collab/init-project.md: skills/init-project.md
# 2026-10-23 ppt-master 的风格目录按分组拆页,入口放进目录的 index.md;版型页挪进 deck-image-types/ 后网页地址不变,不用跳转
gallery/images/ppt-master/gallery-deck-visual-styles.md: gallery/images/ppt-master/index.md#visual-styles
gallery/images/ppt-master/gallery-deck-renderings.md: gallery/images/ppt-master/index.md#renderings
# 2026-10-26 板块重排:自己做的四个项目搬进 projects/,如何分析数据搬进 notes/statistics/
posts/wiki/age-mosaic.md: projects/wiki/age-mosaic.md
posts/wiki/cos-deploy/assets/llm-wiki.md: projects/wiki/cos-deploy/assets/llm-wiki.md
posts/wiki/cos-deploy/assets/llms-txt.md: projects/wiki/cos-deploy/assets/llms-txt.md
posts/wiki/cos-deploy/index.md: projects/wiki/cos-deploy/index.md
posts/wiki/cos-deploy/reference/deploy.md: projects/wiki/cos-deploy/reference/deploy.md
posts/wiki/everything-skill.md: projects/wiki/everything-skill.md
posts/wiki/git-lfs.md: projects/wiki/git-lfs.md
posts/wiki/index.md: projects/wiki/index.md
posts/wiki/init-check.md: projects/wiki/init-check.md
posts/wiki/md-copy.md: projects/wiki/md-copy.md
posts/wiki/roadmap.md: projects/wiki/roadmap.md
posts/wiki/sections.md: projects/wiki/sections.md
posts/wiki/zensical-upgrade/assets/releases.md: maintenance/zensical-upgrade/assets/releases.md
posts/wiki/zensical-upgrade/index.md: maintenance/zensical-upgrade/index.md
posts/kindle-dashboard/index.md: projects/kindle-dashboard/index.md
posts/kindle-dashboard/reference/decision-log.md: projects/kindle-dashboard/reference/decision-log.md
posts/kindle-dashboard/reference/jailbreak.md: projects/kindle-dashboard/reference/jailbreak.md
posts/kindle-dashboard/reference/report-api.md: projects/kindle-dashboard/reference/report-api.md
posts/ai-assistant/api-gateway.md: projects/ai-assistant/api-gateway.md
posts/ai-assistant/dev-env.md: projects/ai-assistant/dev-env.md
posts/ai-assistant/index.md: projects/ai-assistant/index.md
posts/ai-assistant/mail-intake.md: projects/ai-assistant/mail-intake.md
posts/animated-ppt/assets/prompt-v0.md: projects/animated-ppt/assets/prompt-v0.md
posts/animated-ppt/index.md: projects/animated-ppt/index.md
posts/data-analysis/cross-analysis.md: notes/statistics/data-analysis/cross-analysis.md
posts/data-analysis/distribution.md: notes/statistics/data-analysis/distribution.md
posts/data-analysis/index.md: notes/statistics/data-analysis/index.md
# 2026-10-27 收纳的规矩合成抽象 skill「收纳」:导诊挪进 collect/,收纳步骤和各源头类型从写 skill 挪出
skills/collect-triage.md: skills/collect/triage.md
# 2026-10-28 收藏夹成了轴外的顶层板块,网站那页按来源的形态拆成几页,旧地址落到入口
bookmarks/websites.md: bookmarks/index.md
# 2026-10-28 Zensical 升级评估是本站依赖的版本记录,从 wiki 介绍挪进维护
projects/wiki/zensical-upgrade/index.md: maintenance/zensical-upgrade/index.md
projects/wiki/zensical-upgrade/assets/releases.md: maintenance/zensical-upgrade/assets/releases.md
# 链接校验。0.0.53 及更早版本有并行竞态:同一份内容偶发(约 1/15 次构建)误报大量
# "page does not exist",产物 HTML 实测无差异,只能关掉。0.0.62 上复现不出来了 ——
# 8 次 clean + 12 次增量构建零误报,并用一个故意的死链探针确认校验本身仍在工作,故重新打开。
# 用 warn 不用 fail:阻断部署的职责仍归 scripts/check-links.py(它还管另外四项 zensical
# 不看的事——父级索引挂载、nav 注册、笔记未答题、资源死链)。zensical 的价值是报错带
# 文件:行:列 定位,serve 时改错一个链接当场就能看见。竞态若复发,改回 false 即可,不丢保障。
# invalid_link_anchors(锚点校验)check-links.py 不覆盖,保持默认开启。
validation:
invalid_links: warn
nav:
- 首页:
- index.md
- 文章:
- posts/index.md
- 产品开发:
- 预测项目闭环: posts/prediction-loop.md
- AI 时代的产品经理: posts/ai-pm.md
- 超级轻量的自用AI编程Harness框架:
- posts/ai-code-skeleton/index.md
- 上线前的三层验收: posts/release-acceptance.md
- 项目:
- projects/index.md
- 知识库:
- Wiki:
- projects/wiki/index.md
- 本 wiki 的目标与计划: projects/wiki/roadmap.md
- 板块怎么分: projects/wiki/sections.md
- 把 wiki 当远程 skill: projects/wiki/everything-skill.md
- 对象存储部署: projects/wiki/cos-deploy/index.md
- 部署实操手册: projects/wiki/cos-deploy/reference/deploy.md
- 自建 git-lfs 后端: projects/wiki/git-lfs.md
- 打码:key 和小字: projects/wiki/age-mosaic.md
- 复制本页 Markdown 源: projects/wiki/md-copy.md
- 新机器初始化自检: projects/wiki/init-check.md
- Docmost:
- projects/docmost/index.md
- TiddlyWiki:
- projects/tiddlywiki/index.md
- AI 角色扮演:
- 梨园 Liyuan:
- projects/liyuan/index.md
- 设定从哪来: projects/liyuan/setting.md
- 状态别漂移: projects/liyuan/state.md
- 聊久了: projects/liyuan/memory.md
- 重来和回档: projects/liyuan/branch.md
- 正文怎么产出: projects/liyuan/prose.md
- 谁来定制,能改到哪: projects/liyuan/custom.md
- 酒馆 SillyTavern:
- projects/sillytavern/index.md
- 角色卡: projects/sillytavern/card.md
- 世界书: projects/sillytavern/lorebook.md
- 每轮现拼 prompt: projects/sillytavern/assembly.md
- 一份内容喂各种模型: projects/sillytavern/adapt.md
- 重来、分叉、改历史: projects/sillytavern/branch.md
- 聊久了: projects/sillytavern/memory.md
- 多角色同场: projects/sillytavern/group.md
- 用户自己加规则: projects/sillytavern/rules.md
- PawzoChat:
- projects/pawzochat/index.md
- Agent 与评测:
- DeepSeek Harness:
- projects/deepseek-harness/index.md
- 插件: projects/deepseek-harness/plugin.md
- 会话日志: projects/deepseek-harness/log.md
- 拼 prompt: projects/deepseek-harness/prompt.md
- 压缩与补丁文本: projects/deepseek-harness/compaction.md
- 工具与安全边界: projects/deepseek-harness/tools.md
- 多 agent 与长时工作: projects/deepseek-harness/agents.md
- OpenAI Evals:
- projects/openai-evals/index.md
- 登记: projects/openai-evals/registry.md
- 判分: projects/openai-evals/grading.md
- 被测对象: projects/openai-evals/solver.md
- 多轮: projects/openai-evals/multiturn.md
- 跑和记: projects/openai-evals/record.md
- DeepSeek 视频问答:
- projects/deepseek-video-rag/index.md
- AI 助手:
- projects/ai-assistant/index.md
- 新机器配开发环境: projects/ai-assistant/dev-env.md
- API 中转:Caddy 换 key: projects/ai-assistant/api-gateway.md
- 邮件采集:自己说 SMTP: projects/ai-assistant/mail-intake.md
- 开发工具:
- Teable:
- projects/teable/index.md
- Coolify:
- projects/coolify/index.md
- Pyodide:
- projects/pyodide/index.md
- Frappe Gantt:
- projects/frappe-gantt/index.md
- 硬件:
- Kindle 常显信息屏:
- projects/kindle-dashboard/index.md
- 越狱与显示通道: projects/kindle-dashboard/reference/jailbreak.md
- 上报接口交接: projects/kindle-dashboard/reference/report-api.md
- 决策日志: projects/kindle-dashboard/reference/decision-log.md
- 演示:
- 动画网页 PPT:
- projects/animated-ppt/index.md
- 笔记:
- notes/index.md
- 数学与统计:
- 概率与算法:
- notes/probability/index.md
- 对称性:
- "12 枚硬币的奇偶性": notes/probability/coin-parity.md
- "飞机上的最后一个座位": notes/probability/airplane-seat.md
- "断棍成三角形": notes/probability/broken-stick-triangle.md
- "圆上 n 点落在同一半圆": notes/probability/semicircle-points.md
- "100 个囚徒的红蓝帽": notes/probability/hat-parity.md
- "两个孩子问题": notes/probability/two-children.md
- "三门问题": notes/probability/monty-hall.md
- 期望:
- "100 次抛硬币的最长连正": notes/probability/longest-head-run.md
- "等 HH 与等 HT": notes/probability/hh-vs-ht.md
- "集卡问题:骰子掷几次六面全出": notes/probability/coupon-collector.md
- "随机排列的不动点": notes/probability/fixed-points.md
- "均匀随机数累加超过 1": notes/probability/uniform-sum-exceeds-one.md
- "面条打结成圈": notes/probability/noodle-loops.md
- "掷到 6、全程偶数的期望次数": notes/probability/dice-until-six-even.md
- "赌徒破产": notes/probability/gamblers-ruin.md
- 最优停止:
- "骰子最多掷 3 次": notes/probability/dice-reroll.md
- "秘书问题": notes/probability/secretary-problem.md
- "两个鸡蛋 100 层楼": notes/probability/two-eggs.md
- 几何概率:
- "约会问题:等 15 分钟": notes/probability/meeting-problem.md
- "Buffon 投针": notes/probability/buffon-needle.md
- 智力题:
- "3 根绳子烧出 7 分钟": notes/probability/rope-timing.md
- "1000 瓶酒找毒酒": notes/probability/poison-wine.md
- "五张牌魔术:24 种排列怎么猜中 48 张底牌": notes/probability/five-card-trick.md
- "100 个囚徒开 100 个盒子": notes/probability/prisoners-boxes.md
- "25 匹马找前 3 名": notes/probability/horse-race.md
- "12 个球找假球": notes/probability/twelve-balls.md
- "100 盏灯的开关": notes/probability/light-switches.md
- "杆上蚂蚁相撞掉头": notes/probability/ants-on-pole.md
- "过桥问题:1、2、5、10 分钟": notes/probability/bridge-crossing.md
- "5 个海盗分 100 枚金币": notes/probability/pirate-gold.md
- 估算与做市:
- "Fermi 估算:上海有多少加油站": notes/probability/fermi-estimation.md
- "做市游戏:10 枚骰子的和": notes/probability/market-making.md
- "Kelly 公式:每次押多少": notes/probability/kelly-criterion.md
- 统计学:
- notes/statistics/index.md
- 基础:
- 描述统计: notes/statistics/data-description/index.md
- 如何分析数据:
- notes/statistics/data-analysis/index.md
- 单维度分布: notes/statistics/data-analysis/distribution.md
- 联合分析: notes/statistics/data-analysis/cross-analysis.md
- 概率模型: notes/statistics/probability-models/index.md
- 常见分布: notes/statistics/distributions/index.md
- 抽样: notes/statistics/sampling/index.md
- 抽样分布: notes/statistics/sampling-distributions/index.md
- 统计推断:
- 点估计: notes/statistics/estimation/index.md
- 置信区间: notes/statistics/confidence-intervals/index.md
- 假设检验: notes/statistics/hypothesis-testing/index.md
- 组间比较: notes/statistics/group-comparisons/index.md
- 功效与样本量: notes/statistics/power-sample-size/index.md
- 分类数据: notes/statistics/categorical-data/index.md
- 非参数方法: notes/statistics/nonparametric/index.md
- 重抽样: notes/statistics/resampling/index.md
- 统计模型:
- 简单线性回归: notes/statistics/linear-regression/index.md
- 多元回归: notes/statistics/multiple-regression/index.md
- 方差分析: notes/statistics/anova/index.md
- 时间序列: notes/statistics/time-series/index.md
- 设计与实务:
- 实验设计: notes/statistics/experimental-design/index.md
- 因果推断: notes/statistics/causal-inference/index.md
- 缺失数据: notes/statistics/missing-data/index.md
- 贝叶斯统计: notes/statistics/bayesian/index.md
- 统计分析工作流: notes/statistics/statistical-workflow/index.md
- 机器学习:
- notes/machine-learning/index.md
- 准确率、精确率与召回率: notes/machine-learning/classification-metrics/index.md
- 编程:
- LeetCode 热题 100:
- notes/leetcode/index.md
- 哈希:
- 1. 两数之和: notes/leetcode/0001-two-sum.md
- 49. 字母异位词分组: notes/leetcode/0049-group-anagrams.md
- 128. 最长连续序列: notes/leetcode/0128-longest-consecutive-sequence.md
- 双指针:
- 283. 移动零: notes/leetcode/0283-move-zeroes.md
- 11. 盛最多水的容器: notes/leetcode/0011-container-with-most-water.md
- 15. 三数之和: notes/leetcode/0015-3sum.md
- 42. 接雨水: notes/leetcode/0042-trapping-rain-water.md
- 滑动窗口:
- 3. 无重复字符的最长子串: notes/leetcode/0003-longest-substring-without-repeating-characters.md
- 438. 找到字符串中所有字母异位词: notes/leetcode/0438-find-all-anagrams-in-a-string.md
- 子串:
- 560. 和为 K 的子数组: notes/leetcode/0560-subarray-sum-equals-k.md
- 239. 滑动窗口最大值: notes/leetcode/0239-sliding-window-maximum.md
- 76. 最小覆盖子串: notes/leetcode/0076-minimum-window-substring.md
- 普通数组:
- 53. 最大子数组和: notes/leetcode/0053-maximum-subarray.md
- 56. 合并区间: notes/leetcode/0056-merge-intervals.md
- 189. 轮转数组: notes/leetcode/0189-rotate-array.md
- 238. 除了自身以外数组的乘积: notes/leetcode/0238-product-of-array-except-self.md
- 41. 缺失的第一个正数: notes/leetcode/0041-first-missing-positive.md
- 矩阵:
- 73. 矩阵置零: notes/leetcode/0073-set-matrix-zeroes.md
- 54. 螺旋矩阵: notes/leetcode/0054-spiral-matrix.md
- 48. 旋转图像: notes/leetcode/0048-rotate-image.md
- 240. 搜索二维矩阵 II: notes/leetcode/0240-search-a-2d-matrix-ii.md
- 链表:
- 160. 相交链表: notes/leetcode/0160-intersection-of-two-linked-lists.md
- 206. 反转链表: notes/leetcode/0206-reverse-linked-list.md
- 234. 回文链表: notes/leetcode/0234-palindrome-linked-list.md
- 141. 环形链表: notes/leetcode/0141-linked-list-cycle.md
- 142. 环形链表 II: notes/leetcode/0142-linked-list-cycle-ii.md
- 21. 合并两个有序链表: notes/leetcode/0021-merge-two-sorted-lists.md
- 2. 两数相加: notes/leetcode/0002-add-two-numbers.md
- 19. 删除链表的倒数第 N 个结点: notes/leetcode/0019-remove-nth-node-from-end-of-list.md
- 24. 两两交换链表中的节点: notes/leetcode/0024-swap-nodes-in-pairs.md
- 25. K 个一组翻转链表: notes/leetcode/0025-reverse-nodes-in-k-group.md
- 138. 随机链表的复制: notes/leetcode/0138-copy-list-with-random-pointer.md
- 148. 排序链表: notes/leetcode/0148-sort-list.md
- 23. 合并 K 个升序链表: notes/leetcode/0023-merge-k-sorted-lists.md
- 146. LRU 缓存: notes/leetcode/0146-lru-cache.md
- 二叉树:
- 94. 二叉树的中序遍历: notes/leetcode/0094-binary-tree-inorder-traversal.md
- 104. 二叉树的最大深度: notes/leetcode/0104-maximum-depth-of-binary-tree.md
- 226. 翻转二叉树: notes/leetcode/0226-invert-binary-tree.md
- 101. 对称二叉树: notes/leetcode/0101-symmetric-tree.md
- 543. 二叉树的直径: notes/leetcode/0543-diameter-of-binary-tree.md
- 102. 二叉树的层序遍历: notes/leetcode/0102-binary-tree-level-order-traversal.md
- 108. 将有序数组转换为二叉搜索树: notes/leetcode/0108-convert-sorted-array-to-binary-search-tree.md
- 98. 验证二叉搜索树: notes/leetcode/0098-validate-binary-search-tree.md
- 230. 二叉搜索树中第 K 小的元素: notes/leetcode/0230-kth-smallest-element-in-a-bst.md
- 199. 二叉树的右视图: notes/leetcode/0199-binary-tree-right-side-view.md
- 114. 二叉树展开为链表: notes/leetcode/0114-flatten-binary-tree-to-linked-list.md
- 105. 从前序与中序遍历序列构造二叉树: notes/leetcode/0105-construct-binary-tree-from-preorder-and-inorder-traversal.md
- 437. 路径总和 III: notes/leetcode/0437-path-sum-iii.md
- 236. 二叉树的最近公共祖先: notes/leetcode/0236-lowest-common-ancestor-of-a-binary-tree.md
- 124. 二叉树中的最大路径和: notes/leetcode/0124-binary-tree-maximum-path-sum.md
- 图论:
- 200. 岛屿数量: notes/leetcode/0200-number-of-islands.md
- 994. 腐烂的橘子: notes/leetcode/0994-rotting-oranges.md
- 207. 课程表: notes/leetcode/0207-course-schedule.md
- 208. 实现 Trie (前缀树): notes/leetcode/0208-implement-trie-prefix-tree.md
- 回溯:
- 46. 全排列: notes/leetcode/0046-permutations.md
- 78. 子集: notes/leetcode/0078-subsets.md
- 17. 电话号码的字母组合: notes/leetcode/0017-letter-combinations-of-a-phone-number.md
- 39. 组合总和: notes/leetcode/0039-combination-sum.md
- 22. 括号生成: notes/leetcode/0022-generate-parentheses.md
- 79. 单词搜索: notes/leetcode/0079-word-search.md
- 131. 分割回文串: notes/leetcode/0131-palindrome-partitioning.md
- 51. N 皇后: notes/leetcode/0051-n-queens.md
- 二分查找:
- 35. 搜索插入位置: notes/leetcode/0035-search-insert-position.md
- 74. 搜索二维矩阵: notes/leetcode/0074-search-a-2d-matrix.md
- 34. 在排序数组中查找元素的第一个和最后一个位置: notes/leetcode/0034-find-first-and-last-position-of-element-in-sorted-array.md
- 33. 搜索旋转排序数组: notes/leetcode/0033-search-in-rotated-sorted-array.md
- 153. 寻找旋转排序数组中的最小值: notes/leetcode/0153-find-minimum-in-rotated-sorted-array.md
- 4. 寻找两个正序数组的中位数: notes/leetcode/0004-median-of-two-sorted-arrays.md
- 栈:
- 20. 有效的括号: notes/leetcode/0020-valid-parentheses.md
- 155. 最小栈: notes/leetcode/0155-min-stack.md
- 394. 字符串解码: notes/leetcode/0394-decode-string.md
- 739. 每日温度: notes/leetcode/0739-daily-temperatures.md
- 84. 柱状图中最大的矩形: notes/leetcode/0084-largest-rectangle-in-histogram.md
- 堆:
- 215. 数组中的第K个最大元素: notes/leetcode/0215-kth-largest-element-in-an-array.md
- 347. 前 K 个高频元素: notes/leetcode/0347-top-k-frequent-elements.md
- 295. 数据流的中位数: notes/leetcode/0295-find-median-from-data-stream.md
- 贪心算法:
- 121. 买卖股票的最佳时机: notes/leetcode/0121-best-time-to-buy-and-sell-stock.md
- 55. 跳跃游戏: notes/leetcode/0055-jump-game.md
- 45. 跳跃游戏 II: notes/leetcode/0045-jump-game-ii.md
- 763. 划分字母区间: notes/leetcode/0763-partition-labels.md
- 动态规划:
- 70. 爬楼梯: notes/leetcode/0070-climbing-stairs.md
- 118. 杨辉三角: notes/leetcode/0118-pascals-triangle.md
- 198. 打家劫舍: notes/leetcode/0198-house-robber.md
- 279. 完全平方数: notes/leetcode/0279-perfect-squares.md
- 322. 零钱兑换: notes/leetcode/0322-coin-change.md
- 139. 单词拆分: notes/leetcode/0139-word-break.md
- 300. 最长递增子序列: notes/leetcode/0300-longest-increasing-subsequence.md
- 152. 乘积最大子数组: notes/leetcode/0152-maximum-product-subarray.md
- 416. 分割等和子集: notes/leetcode/0416-partition-equal-subset-sum.md
- 32. 最长有效括号: notes/leetcode/0032-longest-valid-parentheses.md
- 多维动态规划:
- 62. 不同路径: notes/leetcode/0062-unique-paths.md
- 64. 最小路径和: notes/leetcode/0064-minimum-path-sum.md
- 5. 最长回文子串: notes/leetcode/0005-longest-palindromic-substring.md
- 1143. 最长公共子序列: notes/leetcode/1143-longest-common-subsequence.md
- 72. 编辑距离: notes/leetcode/0072-edit-distance.md
- 技巧:
- 136. 只出现一次的数字: notes/leetcode/0136-single-number.md
- 169. 多数元素: notes/leetcode/0169-majority-element.md
- 75. 颜色分类: notes/leetcode/0075-sort-colors.md
- 31. 下一个排列: notes/leetcode/0031-next-permutation.md
- 287. 寻找重复数: notes/leetcode/0287-find-the-duplicate-number.md
- JavaScript:
- notes/javascript/index.md
- 事件循环与输出顺序: notes/javascript/event-loop.md
- Python 转 TS 语法对照表: notes/javascript/js-ts-for-python-devs.md
- Git:
- notes/git/index.md
- fork 后吸收上游: notes/git/fork-upstream-sync.md
- stash 的心智模型: notes/git/stash.md
- worktree 的心智模型: notes/git/worktree.md
- Gallery:
- gallery/index.md
- 按媒介:
- 图片:
- gallery/images/index.md
- 动漫、角色与游戏:
- gallery/images/gpt-image2/gallery-anime-and-manga.md
- gallery/images/gpt-image2/gallery-character-design.md
- gallery/images/gpt-image2/gallery-gaming.md
- gallery/images/gpt-image2/gallery-retro-and-cyberpunk.md
- 插画与绘画:
- gallery/images/gpt-image2/gallery-illustration.md
- gallery/images/gpt-image2/gallery-more-illustration-styles.md
- gallery/images/gpt-image2/gallery-watercolor.md
- gallery/images/gpt-image2/gallery-ink-and-chinese.md
- gallery/images/gpt-image2/gallery-pixel-art.md
- gallery/images/gpt-image2/gallery-fine-art-painting.md
- gallery/images/gpt-image2/gallery-tattoo-design.md
- gallery/images/linux-do-style/gallery-anime-graphic-design.md
- 海报、字体与品牌:
- gallery/images/gpt-image2/gallery-typography-and-posters.md
- gallery/images/gpt-image2/gallery-brand-systems-and-identity.md
- gallery/images/gpt-image2/gallery-events-and-experience.md
- gallery/images/collected/gallery-brand-posters.md
- gallery/images/collected/gallery-pulp-posters.md
- 摄影与电影感:
- gallery/images/gpt-image2/gallery-photography.md
- gallery/images/gpt-image2/gallery-fashion-editorial.md
- gallery/images/gpt-image2/gallery-beauty-and-lifestyle.md
- gallery/images/gpt-image2/gallery-screen-photography.md
- gallery/images/gpt-image2/gallery-cinematic-and-animation.md
- gallery/images/gpt-image2/gallery-cinematic-film-references.md
- gallery/images/collected/gallery-portrait-templates.md
- 拍照姿势:
- gallery/images/xhs-poses/gallery-ins-poses.md
- gallery/images/xhs-poses/gallery-faceless-poses.md
- gallery/images/xhs-poses/gallery-lifestyle-poses.md
- 产品与空间:
- gallery/images/gpt-image2/gallery-product-and-food.md
- gallery/images/gpt-image2/gallery-architecture-and-interior.md
- gallery/images/gpt-image2/gallery-isometric.md
- 信息与知识:
- gallery/images/gpt-image2/gallery-infographics-and-field-guides.md
- gallery/images/gpt-image2/gallery-scientific-and-educational.md
- gallery/images/gpt-image2/gallery-data-visualization.md
- gallery/images/gpt-image2/gallery-research-paper-figures.md
- gallery/images/gpt-image2/gallery-technical-illustration.md
- gallery/images/gpt-image2/gallery-ui-ux-mockups.md
- 官方示例:
- gallery/images/gpt-image2/gallery-official-openai-cookbook-examples.md
- gallery/images/gpt-image2/gallery-edit-endpoint-showcase.md
- 手绘风格库:
- gallery/images/handdraw-style/index.md
- gallery/images/handdraw-style/styles-a.md
- gallery/images/handdraw-style/styles-b.md
- gallery/images/handdraw-style/styles-c.md
- gallery/images/handdraw-style/styles-d.md
- gallery/images/handdraw-style/styles-e.md
- gallery/images/handdraw-style/styles-f.md
- gallery/images/handdraw-style/styles-g.md
- gallery/images/handdraw-style/styles-h.md
- gallery/images/handdraw-style/styles-i.md
- PPT 风格库:
- gallery/images/ppt-master/index.md
- gallery/images/ppt-master/gallery-visual-styles-corporate.md
- gallery/images/ppt-master/gallery-visual-styles-editorial.md
- gallery/images/ppt-master/gallery-visual-styles-expressive.md
- gallery/images/ppt-master/gallery-visual-styles-hand-drawn.md
- gallery/images/ppt-master/gallery-visual-styles-specialty.md
- gallery/images/ppt-master/gallery-renderings-modern.md
- gallery/images/ppt-master/gallery-renderings-hand-drawn.md
- gallery/images/ppt-master/gallery-renderings-narrative.md
- gallery/images/ppt-master/gallery-renderings-specialty.md
- 排版:
- gallery/layouts/index.md
- gallery/layouts/social-cards.md
- gallery/layouts/infographics.md
- gallery/layouts/comic-storyboards.md
- gallery/layouts/ip-characters.md
- gallery/layouts/ecommerce.md
- PPT 配图版型:
- gallery/layouts/deck-image-types/index.md
- gallery/layouts/deck-image-types/sequence.md
- gallery/layouts/deck-image-types/hierarchy.md
- gallery/layouts/deck-image-types/comparison.md
- gallery/layouts/deck-image-types/spatial.md
- 色彩:
- gallery/colors/index.md
- gallery/colors/classic.md
- gallery/colors/collected/gallery-imagery-gradients.md
- 视频:
- gallery/video/index.md
- 花卉动态生长海报: gallery/video/flower-growth-poster.md
- 彩色手绘三维穿梭视频: gallery/video/collected/gallery-parallax-ink.md
- 音频:
- gallery/audio/index.md
- 前端特效:
- gallery/web/index.md
- 前端风格收集:
- gallery/web/frontend-styles/index.md
- PIP-BOY 琥珀终端: gallery/web/frontend-styles/reference/pip-boy-terminal.md
- Celestia 主题收藏卡: gallery/web/frontend-styles/reference/celestia-collection.md
- Verdant Glass 苔光用量台: gallery/web/frontend-styles/reference/verdant-glass.md
- Syzygy 克莱因蓝星穹: gallery/web/frontend-styles/reference/syzygy-astral.md
- NEXUS 2030 酸绿深空首屏: gallery/web/frontend-styles/reference/nexus-2030.md
- ATELIER 纸白动力学: gallery/web/frontend-styles/reference/atelier-kinetic.md
- PLATTER 平面音乐档案: gallery/web/frontend-styles/reference/task1-platter.md
- PARALLAX 三态作品档案: gallery/web/frontend-styles/reference/task2-parallax-archive.md
- LINE//SYSTEM 线性工业图形: gallery/web/frontend-styles/reference/task3-line-system.md
- WORLD FILES 档案袋叙事: gallery/web/frontend-styles/reference/task4-world-files.md
- PIXEL BLOOM 网格揭示: gallery/web/frontend-styles/reference/task5-pixel-bloom.md
- TINTORY 视觉考古编辑部: gallery/web/frontend-styles/reference/task6-tintory.md
- NEAT ANNOTATIONS 手绘标注标本: gallery/web/frontend-styles/reference/task7-neat-annotations.md
- One Hub 翡翠管理台: gallery/web/frontend-styles/reference/onehub-berry-admin.md
- Vercel Lanyard 可拖拽 3D 工牌: gallery/web/frontend-styles/reference/vercel-lanyard.md
- Open Design 官网拆解:
- gallery/web/frontend-styles/open-design/index.md
- 滚动感知吸顶导航: gallery/web/frontend-styles/open-design/headroom-nav.md
- 标题逐词模糊入场: gallery/web/frontend-styles/open-design/blur-text.md
- 滚动入场编排: gallery/web/frontend-styles/open-design/scroll-reveal.md
- 宣言逐字点亮: gallery/web/frontend-styles/open-design/statement-reveal.md
- 滚动锁定步骤联动: gallery/web/frontend-styles/open-design/scrolly-steps.md
- 可拖拽贴纸: gallery/web/frontend-styles/open-design/drag-sticker.md
- 磁性 Dock 预览切换: gallery/web/frontend-styles/open-design/magnetic-dock.md
- 图标物理掉落: gallery/web/frontend-styles/open-design/falling-chips.md
- 点阵地球与贡献者轨道: gallery/web/frontend-styles/open-design/globe-orbit.md
- 贴纸统计卡与数字滚动: gallery/web/frontend-styles/open-design/stat-cards.md
- 页底渐进高斯模糊: gallery/web/frontend-styles/open-design/gradual-blur.md
- HAOQI 3D 官网拆解:
- gallery/web/frontend-styles/haoqi/index.md
- 3D 开场专题: gallery/web/frontend-styles/haoqi/01-opening.md
- ORYZO 官网拆解:
- gallery/web/frontend-styles/oryzo/index.md
- 蓝图开场动画: gallery/web/frontend-styles/oryzo/blueprint-intro.md
- 高斯泼溅渲染系统: gallery/web/frontend-styles/oryzo/splat-system.md
- 滚动叙事与场景切换: gallery/web/frontend-styles/oryzo/scene-morph.md
- Wearable 一幕: gallery/web/frontend-styles/oryzo/wearable-scene.md
- RGB 呼吸光边: gallery/web/frontend-styles/oryzo/rgb-glow-border.md
- Sandboard WebGPU 沙盘: gallery/web/sandboard/index.md
- 角色:
- 人设:
- gallery/personas/index.md
- gallery/personas/seoa.md
- Skills:
- skills/index.md
- 基础:
- 本 wiki 写作规范:
- skills/wiki-guide/index.md
- 自研组件: skills/wiki-guide/reference/components.md
- 分支: skills/wiki-guide/reference/branch.md
- 配图: skills/wiki-guide/reference/infographic.md
- 课程页怎么写: skills/wiki-guide/course.md
- 写 skill: skills/wiki-guide/skill.md
- 精简检查(按需引用): skills/wiki-guide/trim.md
- Agent 基础能力:
- skills/agent-io/index.md
- 阅读 PDF: skills/agent-io/reference/pdf.md
- 转录音频: skills/agent-io/reference/transcribe.md
- 阅读视频: skills/agent-io/reference/read-video.md
- 网络搜索: skills/agent-io/reference/web-search.md
- 读取网页: skills/agent-io/reference/web-fetch.md
- 解析分享链接:
- skills/agent-io/reference/share-link/index.md
- 小红书: skills/agent-io/reference/share-link/xiaohongshu.md
- 抖音: skills/agent-io/reference/share-link/douyin.md
- B 站: skills/agent-io/reference/share-link/bilibili.md
- 微信公众号: skills/agent-io/reference/share-link/wechat-mp.md
- 读取邮箱: skills/agent-io/reference/mail.md
- 生成语音: skills/agent-io/reference/tts.md
- 生成音乐: skills/agent-io/reference/music.md
- 生成、编辑图片: skills/agent-io/reference/image.md
- 生成视频:
- skills/agent-io/reference/video/index.md
- 文生视频: skills/agent-io/reference/video/text-to-video.md
- 首尾帧: skills/agent-io/reference/video/first-last-frame.md
- 对口型: skills/agent-io/reference/video/lip-sync.md
- 动作迁移: skills/agent-io/reference/video/motion-transfer.md
- 调用 DeepSeek: skills/agent-io/reference/deepseek.md
- 结构化判断: skills/agent-io/reference/jev.md
- 调研与收集:
- 收纳:
- skills/collect/index.md
- 收纳导诊: skills/collect/triage.md
- 收纳 skill: skills/collect/skill.md
- 收进 Gallery: skills/collect/gallery.md
- 调研项目:
- skills/project-research/index.md
- 粗讲项目: skills/project-research/gist.md
- 细讲项目: skills/project-research/dissect.md
- 写书: skills/project-research/book.md
- 整理视频为笔记:
- skills/video-note/index.md
- 获取热点:
- skills/hot-topics/index.md
- AIHOT: skills/hot-topics/reference/aihot.md
- linux.do 日报: skills/hot-topics/reference/linuxdo-daily.md
- 写作与协作:
- 写作口味:
- skills/writing/index.md
- 报纸版 HTML: skills/writing/newspaper/index.md
- 滚动 deck 工程手册: skills/writing/deck.md
- 去 AI 味:
- skills/writing/qu-ai-wei/index.md
- 51 条 AI 腔模式: skills/writing/qu-ai-wei/references/patterns.md
- 平台场景规则: skills/writing/qu-ai-wei/references/platform-patterns.md
- 品牌文案语体: skills/writing/qu-ai-wei/references/brand-voice.md
- 白名单: skills/writing/qu-ai-wei/references/whitelists.md
- 标点规范: skills/writing/qu-ai-wei/references/punctuation.md
- 语序诊断: skills/writing/qu-ai-wei/references/syntax.md
- 完整示例: skills/writing/qu-ai-wei/references/examples.md
- 正面参考模型: skills/writing/qu-ai-wei/references/reference-models.md
- 参考来源: skills/writing/qu-ai-wei/references/sources.md
- 檄文:
- skills/writing/xi-wen/index.md
- 逐篇精读: skills/writing/xi-wen/references/逐篇精读.md
- 骈句声律: skills/writing/xi-wen/references/骈句声律.md
- 用典骂法库: skills/writing/xi-wen/references/用典骂法库.md
- 戏仿范例: skills/writing/xi-wen/references/戏仿范例.md
- 底本·为袁绍檄豫州文: skills/writing/xi-wen/references/originals/为袁绍檄豫州文.md
- 底本·为李密檄洛州文: skills/writing/xi-wen/references/originals/为李密檄洛州文.md
- 底本·为徐敬业讨武曌檄: skills/writing/xi-wen/references/originals/为徐敬业讨武曌檄.md
- 底本·谕中原檄: skills/writing/xi-wen/references/originals/谕中原檄.md
- 底本·讨粤匪檄: skills/writing/xi-wen/references/originals/讨粤匪檄.md
- 初始化项目: skills/init-project.md
- 盘问我: skills/grilling.md
- 带文档盘问:
- skills/grill-with-docs/index.md
- 领域建模:
- skills/grill-with-docs/domain-modeling/index.md
- GLOSSARY.md 格式: skills/grill-with-docs/domain-modeling/reference/glossary-format.md
- ADR 格式: skills/grill-with-docs/domain-modeling/reference/adr-format.md
- 对话提示词:
- skills/chat-prompts/index.md
- 理清问题、做决定:
- 苏格拉底式提问: skills/chat-prompts/socratic.md
- 第一性原理: skills/chat-prompts/first-principles.md
- 跨领域借解: skills/chat-prompts/cross-domain.md
- 双向钢人论证: skills/chat-prompts/steelman.md
- 专家会诊: skills/chat-prompts/expert-panel.md
- 查证与研究:
- 事实核查: skills/chat-prompts/fact-check.md
- 纵横分析法: skills/chat-prompts/cross-axis.md
- 根因追踪: skills/chat-prompts/root-cause.md
- 实事求是: skills/chat-prompts/seek-truth.md
- 学概念:
- 双层解释法: skills/chat-prompts/dual-explain.md
- 人话翻译: skills/chat-prompts/plain-talk.md
- 写作与方案:
- 提示炼金: skills/chat-prompts/prompt-refine.md
- 毒舌审稿: skills/chat-prompts/critic.md
- 架构先知: skills/chat-prompts/architect.md
- 范围铁闸: skills/chat-prompts/scope-lock.md
- 说人话(80% STE): skills/chat-prompts/ste-plain.md
- 职业与人生:
- 深度天赋挖掘机: skills/chat-prompts/talent-miner.md
- 人生设计师: skills/chat-prompts/life-designer.md
- 演示文稿:
- PPT Master:
- skills/ppt-master/index.md
- 规划 deck: skills/ppt-master/strategist.md
- 沟通模式:
- skills/ppt-master/modes/index.md
- 金字塔: skills/ppt-master/modes/reference/pyramid.md
- 叙事: skills/ppt-master/modes/reference/narrative.md
- 教学: skills/ppt-master/modes/reference/instructional.md
- 展演: skills/ppt-master/modes/reference/showcase.md
- 简报: skills/ppt-master/modes/reference/briefing.md
- 生成配图: skills/ppt-master/image-generator.md
- 出图与视频:
- 手绘风格出图:
- skills/handdraw/index.md
- 出图提示词: skills/handdraw/prompter.md
- 海报: skills/handdraw/poster.md
- 文章与视频封面: skills/handdraw/cover.md
- 长文配图: skills/handdraw/illustration/index.md
- 风格融合: skills/handdraw/fusion.md
- IP 形象设计: skills/handdraw/ip.md
- 写真拍摄企划:
- skills/photo-shoot/index.md
- 交互模式: skills/photo-shoot/reference/interaction-modes.md
- 质量下限: skills/photo-shoot/reference/quality-contract.md
- 地点: skills/photo-shoot/reference/location.md
- 真人身份参考: skills/photo-shoot/reference/identity-reference.md
- 改一个变量: skills/photo-shoot/reference/remix.md
- 出图: skills/photo-shoot/reference/image-generation.md
- 发送前自检: skills/photo-shoot/reference/qa-checklist.md
- 需求与造型规划:
- skills/photo-shoot/requirements/index.md
- 时空方向: skills/photo-shoot/requirements/reference/directions.md
- 方向卡: skills/photo-shoot/requirements/reference/direction-cards.md
- 完整 Look: skills/photo-shoot/requirements/reference/look-plan.md
- 交接文件: skills/photo-shoot/requirements/reference/handoff-schema.md
- 影视与流行文化联想: skills/photo-shoot/requirements/reference/media-association.md
- 需求示例: skills/photo-shoot/requirements/reference/examples.md
- 发型师: skills/photo-shoot/hairstyle.md
- 化妆师: skills/photo-shoot/makeup.md
- 参考图美化: skills/photo-shoot/beauty-prep.md
- 换装六宫格: skills/photo-shoot/wardrobe/index.md
- 拍摄与八宫格:
- skills/photo-shoot/shooting/index.md
- 姿势与情绪: skills/photo-shoot/shooting/reference/pose-emotion.md
- Shot List: skills/photo-shoot/shooting/reference/shot-list.md
- 分享文案: skills/photo-shoot/shooting/reference/share-card.md
- 情侣写真骨架: skills/photo-shoot/shooting/reference/couple-prompt.md
- 婚纱骨架: skills/photo-shoot/shooting/reference/wedding-prompt.md
- 单人与群像骨架: skills/photo-shoot/shooting/reference/group-prompt.md
- 旧刊物海报: skills/pulp-poster.md
- 图片提示词反推:
- skills/image-prompt-reverse/index.md
- 七维拆解: skills/image-prompt-reverse/seven-dimensions/index.md
- 从图反推 prompt:
- skills/image-prompt-reverse/get-prompt-from-image/index.md
- 分析框架: skills/image-prompt-reverse/get-prompt-from-image/references/analysis-framework.md
- 题材与媒介: skills/image-prompt-reverse/get-prompt-from-image/references/category-guides.md
- 插画风格: skills/image-prompt-reverse/get-prompt-from-image/references/illustration-style.md
- anidoodle 代码手绘:
- skills/anidoodle/index.md
- 工作流:
- "从这里开始": skills/anidoodle/references/workflows/start-here.md
- "自己画出来的画": skills/anidoodle/references/workflows/drawing-process.md
- "任意长度的影片": skills/anidoodle/references/workflows/long-film.md
- "讲解片和信息图": skills/anidoodle/references/workflows/explainer.md
- "机械讲解": skills/anidoodle/references/workflows/machines.md
- "发布片": skills/anidoodle/references/workflows/launch-video.md
- "发布套件": skills/anidoodle/references/workflows/launch-video-kit.md
- "网站配图": skills/anidoodle/references/workflows/site-art.md
- "交互式网页动画": skills/anidoodle/references/workflows/interactive.md
- "教绘画": skills/anidoodle/references/workflows/teach-drawing.md
- "角色保持一致": skills/anidoodle/references/workflows/character-consistency.md
- "照图改编画风": skills/anidoodle/references/workflows/adapt-a-style.md
- "审片": skills/anidoodle/references/workflows/review.md
- 手艺与契约:
- "故事": skills/anidoodle/references/storytelling.md
- "写实与手艺": skills/anidoodle/references/realism-and-craft.md
- "解剖": skills/anidoodle/references/anatomy.md
- "画风与工具包": skills/anidoodle/references/style-guide.md
- "手艺及格线": skills/anidoodle/references/craft-bar.md
- "工作方法": skills/anidoodle/references/working-method.md
- "确定性与契约": skills/anidoodle/references/determinism-and-contract.md
- "格式": skills/anidoodle/references/formats.md
- "镜头": skills/anidoodle/references/camera.md
- "运动语法": skills/anidoodle/references/motion-grammar.md
- "后端与适配器": skills/anidoodle/references/backends-and-adapters.md
- 画风:
- skills/anidoodle/references/styles/index.md
- "蓝晒蓝图": skills/anidoodle/references/styles/blueprint.md
- "破色": skills/anidoodle/references/styles/brokenColour.md
- "炭笔,擦掉再画": skills/anidoodle/references/styles/charcoalErasure.md
- "彩色铅笔": skills/anidoodle/references/styles/colouredPencil.md
- "梦境罩染": skills/anidoodle/references/styles/dreamGlaze.md
- "手工刺绣": skills/anidoodle/references/styles/embroidery.md
- "扁平矢量": skills/anidoodle/references/styles/flatVector.md
- "民间故事绘本": skills/anidoodle/references/styles/folkTale.md
- "剪纸拼贴": skills/anidoodle/references/styles/foxDraw.md
- "新闻纸半色调": skills/anidoodle/references/styles/halftone.md
- "等轴剖视": skills/anidoodle/references/styles/isometric.md
- "马克笔漫画": skills/anidoodle/references/styles/koiDraw.md
- "孔版印刷": skills/anidoodle/references/styles/lighthouseDraw.md
- "低多边形": skills/anidoodle/references/styles/lowPoly.md
- "世纪中期水粉": skills/anidoodle/references/styles/midCentury.md
- "黑板粉笔": skills/anidoodle/references/styles/moonPhasesDraw.md
- "布面油画": skills/anidoodle/references/styles/paintedOil.md
- "玩具剧场纸拼贴": skills/anidoodle/references/styles/paperCraft.md
- "像素画": skills/anidoodle/references/styles/pixelArt.md
- "圆珠笔速写": skills/anidoodle/references/styles/pocketWatchDraw.md
- "铅笔水彩": skills/anidoodle/references/styles/ranunculusDraw.md
- "橡皮管动画": skills/anidoodle/references/styles/rubberHose.md
- "档案剪贴簿": skills/anidoodle/references/styles/scrapbook.md
- "刮画板": skills/anidoodle/references/styles/scratchboard.md
- "钢笔点画": skills/anidoodle/references/styles/stipple.md
- "绘本铅笔 + 水彩": skills/anidoodle/references/styles/storybookDraw.md
- "水墨画": skills/anidoodle/references/styles/sumiE.md
- "玩具积木": skills/anidoodle/references/styles/toyBrick.md
- "浮世绘套色木版": skills/anidoodle/references/styles/woodcut.md
- "钢笔淡彩": skills/anidoodle/references/styles/wrenDraw.md
- 配乐:
- skills/anidoodle/references/music/index.md
- "作曲": skills/anidoodle/references/music/compose.md
- "音效设计": skills/anidoodle/references/music/sound-design.md
- "音源包许可证": skills/anidoodle/references/music/sounds-licenses.md
- 音乐风格:
- "风格词汇": skills/anidoodle/references/music/styles/vocabularies.md
- "lo-fi 电子": skills/anidoodle/references/music/styles/lofi-electronic.md
- "八音盒": skills/anidoodle/references/music/styles/music-box.md
- 乐理:
- skills/anidoodle/references/music/theory/index.md
- "曲式与配器": skills/anidoodle/references/music/theory/form.md
- "和声": skills/anidoodle/references/music/theory/harmony.md
- "旋律": skills/anidoodle/references/music/theory/melody.md
- "节奏与律动": skills/anidoodle/references/music/theory/rhythm.md
- "情绪映射": skills/anidoodle/references/music/theory/mood.md
- "声音理论": skills/anidoodle/references/music/theory/sound.md
- 范例:
- skills/anidoodle/example/index.md
- "影片规格书": skills/anidoodle/example/butterfly-film-spec.md
- "渲染适配器": skills/anidoodle/engine/tools/adapters/index.md
- HyperFrames: skills/hyperframes.md
- 视频生成:
- skills/video-gen/index.md
- 东方仙侠视觉导演:
- skills/video-gen/xianxia-visual-director/index.md
- 视觉 DNA: skills/video-gen/xianxia-visual-director/reference/visual-dna.md
- 仙侠总则: skills/video-gen/xianxia-visual-director/reference/xianxia-master-rules.md
- 画幅: skills/video-gen/xianxia-visual-director/reference/aspect-ratios.md
- 构图、色彩与光线库: skills/video-gen/xianxia-visual-director/reference/composition-color-light.md
- 东方苍穹巨构: skills/video-gen/xianxia-visual-director/reference/eastern-sky-megastructure-style.md
- 神域聚居地: skills/video-gen/xianxia-visual-director/reference/celestial-realm-route.md
- 仙界大境原典: skills/video-gen/xianxia-visual-director/reference/celestial-grand-realm-canon.md
- 提示词示例: skills/video-gen/xianxia-visual-director/reference/prompt-examples.md
- 写代码:
- FastAPI 后端:
- skills/fastapi/index.md
- 项目布局: skills/fastapi/reference/项目布局.md
- 数据库: skills/fastapi/reference/数据库.md
- RAG: skills/fastapi/reference/rag.md
- MCP: skills/fastapi/reference/mcp.md
- 优雅终止: skills/fastapi/reference/优雅终止.md
- 定时任务: skills/fastapi/reference/定时任务.md
- 配置管理: skills/fastapi/reference/配置管理.md
- 对话前端: skills/fastapi/reference/对话前端.md
- 运行时补丁: skills/fastapi/reference/运行时补丁.md
- 日志管理: skills/fastapi/reference/日志管理.md
- 测试: skills/fastapi/reference/测试.md
- 部署: skills/fastapi/reference/部署.md
- 监控: skills/fastapi/reference/监控.md
- 事后检查: skills/fastapi/reference/事后检查.md
- Dashboard 后台:
- skills/dashboard/index.md
- 表单:
- 表单: skills/dashboard/reference/表单/表单.md
- 向导表单: skills/dashboard/reference/表单/向导表单.md
- 搜索下拉: skills/dashboard/reference/表单/搜索下拉.md
- 文件上传: skills/dashboard/reference/表单/文件上传.md
- 行内编辑: skills/dashboard/reference/表单/行内编辑.md
- 列表与表格:
- 表格: skills/dashboard/reference/列表与表格/表格.md
- 卡片列表: skills/dashboard/reference/列表与表格/卡片列表.md
- 紧凑列表: skills/dashboard/reference/列表与表格/紧凑列表.md
- 无限滚动: skills/dashboard/reference/列表与表格/无限滚动.md
- 虚拟表格: skills/dashboard/reference/列表与表格/虚拟表格.md
- 列控制: skills/dashboard/reference/列表与表格/列控制.md
- 筛选面板: skills/dashboard/reference/列表与表格/筛选面板.md
- 保存视图: skills/dashboard/reference/列表与表格/保存视图.md
- CSV 导入导出: skills/dashboard/reference/列表与表格/CSV导入导出.md
- 富视图:
- 看板: skills/dashboard/reference/富视图/看板.md
- 日历: skills/dashboard/reference/富视图/日历.md
- 树形: skills/dashboard/reference/富视图/树形.md
- 时间线: skills/dashboard/reference/富视图/时间线.md
- 主从视图: skills/dashboard/reference/富视图/主从视图.md
- 详情与页面:
- 详情页: skills/dashboard/reference/详情与页面/详情页.md
- 记录选项卡: skills/dashboard/reference/详情与页面/记录选项卡.md
- 关联记录: skills/dashboard/reference/详情与页面/关联记录.md
- 多栏布局: skills/dashboard/reference/详情与页面/多栏布局.md
- 设置页: skills/dashboard/reference/详情与页面/设置页.md
- 图表页: skills/dashboard/reference/详情与页面/图表页.md
- 展示与反馈:
- 数据展示件: skills/dashboard/reference/展示与反馈/数据展示件.md
- 反馈状态: skills/dashboard/reference/展示与反馈/反馈状态.md
- 通知中心: skills/dashboard/reference/展示与反馈/通知中心.md
- 审计日志: skills/dashboard/reference/展示与反馈/审计日志.md
- 平台能力:
- 权限门控: skills/dashboard/reference/平台能力/权限门控.md
- 登录方式: skills/dashboard/reference/平台能力/登录方式.md
- 全局搜索: skills/dashboard/reference/平台能力/全局搜索.md
- i18n: skills/dashboard/reference/平台能力/i18n.md
- 计费: skills/dashboard/reference/平台能力/计费.md
- 实时刷新: skills/dashboard/reference/平台能力/实时刷新.md
- 数据可视化:
- skills/data-visualization/index.md
- Lieflat Charts:
- skills/data-visualization/lieflat-charts/index.md
- 基础型 · Lupi Basics:
- F1 · 梯级柱状图: skills/data-visualization/lieflat-charts/reference/f1-rung-bars.md
- F2 · 发丝折线图: skills/data-visualization/lieflat-charts/reference/f2-hairline-line.md
- F3 · 发丝面积图: skills/data-visualization/lieflat-charts/reference/f3-hairline-area.md
- F4 · 刻线环形图: skills/data-visualization/lieflat-charts/reference/f4-tick-donut.md
- F5 · 刻线横条图: skills/data-visualization/lieflat-charts/reference/f5-tick-rows.md
- F6 · 并列梯级柱: skills/data-visualization/lieflat-charts/reference/f6-paired-rungs.md
- F7 · 堆叠梯级柱: skills/data-visualization/lieflat-charts/reference/f7-stacked-rungs.md
- F8 · 铅垂散点图: skills/data-visualization/lieflat-charts/reference/f8-plumb-scatter.md
- F9 · 梯级瀑布图: skills/data-visualization/lieflat-charts/reference/f9-rung-waterfall.md
- F10 · 点阵热力图: skills/data-visualization/lieflat-charts/reference/f10-dot-heat.md
- F11 · 刻线进度表: skills/data-visualization/lieflat-charts/reference/f11-tick-gauge.md
- F12 · 串珠哑铃图: skills/data-visualization/lieflat-charts/reference/f12-dumbbell-queue.md
- 编辑型 · Lupi Editorial:
- L1 · 上线扇形图: skills/data-visualization/lieflat-charts/reference/l1-launch-fan.md
- L2 · 点阵级联图: skills/data-visualization/lieflat-charts/reference/l2-dot-cascade.md
- L3 · 条码棒棒糖图: skills/data-visualization/lieflat-charts/reference/l3-barcode-lollipop.md
- L4 · 弧形矩阵: skills/data-visualization/lieflat-charts/reference/l4-arc-matrix.md
- L5 · 径向汇聚图: skills/data-visualization/lieflat-charts/reference/l5-radial-convergence.md
- L6 · 贡献者星群: skills/data-visualization/lieflat-charts/reference/l6-cluster-field.md
- L7 · 品牌光谱: skills/data-visualization/lieflat-charts/reference/l7-brand-spectrum.md
- L8 · 点阵空间矩阵: skills/data-visualization/lieflat-charts/reference/l8-dotty-matrix.md
- L9 · 气泡年鉴: skills/data-visualization/lieflat-charts/reference/l9-bubble-almanac.md
- L10 · 径向拼布图: skills/data-visualization/lieflat-charts/reference/l10-radial-patchwork.md
- L11 · 趋势谱系图: skills/data-visualization/lieflat-charts/reference/l11-trend-lineage.md
- L12 · 归属柱廊图: skills/data-visualization/lieflat-charts/reference/l12-type-colonnade.md
- L13 · 沙漏流图: skills/data-visualization/lieflat-charts/reference/l13-hourglass-stream.md
- L14 · 百人点阵: skills/data-visualization/lieflat-charts/reference/l14-hundred-field.md
- L15 · 选票刻线图: skills/data-visualization/lieflat-charts/reference/l15-ballot-tally.md
- 快读型 · Glance:
- G1 · 区间胶囊图: skills/data-visualization/lieflat-charts/reference/g1-range-capsules.md
- G2 · 花瓣玫瑰图: skills/data-visualization/lieflat-charts/reference/g2-petal-rose.md
- G3 · 粗体柱状图: skills/data-visualization/lieflat-charts/reference/g3-chunky-bars.md
- G4 · 点阵华夫图: skills/data-visualization/lieflat-charts/reference/g4-dot-waffle.md
- G5 · 象形柱状图: skills/data-visualization/lieflat-charts/reference/g5-pictorial-bar.md
- G6 · 小型环形关系图: skills/data-visualization/lieflat-charts/reference/g6-circular-graph.md
- G7 · 左右树状图: skills/data-visualization/lieflat-charts/reference/g7-tree-lr.md
- G8 · 雨幕双面积图: skills/data-visualization/lieflat-charts/reference/g8-rainfall-dual-area.md
- G9 · 散点变形图: skills/data-visualization/lieflat-charts/reference/g9-scatter-morph.md
- G10 · 发散条形图: skills/data-visualization/lieflat-charts/reference/g10-diverging-bar.md
- G11 · 小型力导向图: skills/data-visualization/lieflat-charts/reference/g11-force-graph.md
- G12 · 错落波形图: skills/data-visualization/lieflat-charts/reference/g12-stagger-wave.md
- G13 · 大切片图: skills/data-visualization/lieflat-charts/reference/g13-big-slice.md
- G14 · 单轴图: skills/data-visualization/lieflat-charts/reference/g14-single-axis.md
- G15 · 抖动条带图: skills/data-visualization/lieflat-charts/reference/g15-jitter-strip.md
- G16 · 动态条形竞赛: skills/data-visualization/lieflat-charts/reference/g16-bar-race.md
- G17 · 动态流图: skills/data-visualization/lieflat-charts/reference/g17-dynamic-stream.md
- G18 · 一笔绘制与计数器: skills/data-visualization/lieflat-charts/reference/g18-draw-in-plus-counter.md
- 独立交互大图:
- B1 · 密集环形关系图: skills/data-visualization/lieflat-charts/reference/b1-circular-graph-dense.md
- B2 · 密集力导向图: skills/data-visualization/lieflat-charts/reference/b2-force-graph-dense.md
- B3 · 三段丝线图: skills/data-visualization/lieflat-charts/reference/b3-thread-triptych.md
- 前端画布:
- skills/canvas/index.md
- L1 · 原生无限画布: skills/canvas/reference/l1-vanilla.md
- L2 · React 手写画布: skills/canvas/reference/l2-react.md
- L3 · 数据驱动节点图: skills/canvas/reference/l3-nodegraph.md
- L4 · 白板: skills/canvas/reference/l4-whiteboard.md
- 让布局说话: skills/ui-no-labels.md
- 逆向与安全:
- Windows 软件逆向: skills/exe-reverse.md
- 收藏夹:
- bookmarks/index.md
- 社区和论坛: bookmarks/community.md
- 人: bookmarks/people.md
- 合集和导航站: bookmarks/collections.md
- 工具和服务: bookmarks/tools.md
- 维护:
- maintenance/index.md
- 能力与 skill:
- Agent 能力:
- 读 PDF 脚本: maintenance/pdf-reading.md
- 网络搜索和读取网页: maintenance/web-search.md
- 语音合成: maintenance/tts.md
- 图片生成: maintenance/image.md
- 视频生成: maintenance/video.md
- 音乐生成: maintenance/music.md
- 音频转录: maintenance/transcribe.md
- 阅读视频: maintenance/read-video.md
- 解析分享链接: maintenance/share-link.md
- 结构化判断: maintenance/jev.md
- Skill 吸纳:
- 盘问我: maintenance/skills/grilling.md
- 带文档盘问: maintenance/skills/grill-with-docs.md
- 初始化项目: maintenance/skills/init-project.md
- 从图反推 prompt: maintenance/skills/get-prompt-from-image.md
- 七维拆解: maintenance/skills/seven-dimensions.md
- 对话提示词: maintenance/skills/chat-prompts.md
- 调研项目: maintenance/skills/project-research.md
- 整理视频为笔记: maintenance/skills/video-note.md
- 花卉动态生长海报: maintenance/skills/flower-growth-poster.md
- anidoodle 代码手绘: maintenance/skills/anidoodle.md
- 去 AI 味: maintenance/skills/qu-ai-wei.md
- 檄文: maintenance/skills/xi-wen.md
- Dashboard: maintenance/skills/dashboard.md
- Lieflat Charts: maintenance/skills/lieflat-charts.md
- 手绘风格出图: maintenance/skills/handdraw.md
- 写真拍摄企划: maintenance/skills/photo-shoot.md
- 东方仙侠视觉导演: maintenance/skills/xianxia-visual-director.md
- 配图:手绘信息图: maintenance/skills/infographic.md
- 获取热点: maintenance/skills/hot-topics.md
- 让布局说话: maintenance/skills/ui-no-labels.md
- PPT Master: maintenance/skills/ppt-master.md
- Windows 软件逆向: maintenance/skills/exe-reverse.md
- HyperFrames: maintenance/skills/hyperframes.md
- 实测用的示例:
- 测试skill:
- maintenance/mock-bundle/index.md
- 打招呼: maintenance/mock-bundle/greet/index.md
- 数字数: maintenance/mock-bundle/count/index.md
- 内容收录:
- Gallery 收录:
- GPT Image 2 图库: maintenance/gallery/gpt-image2.md
- prompt-cards 生图条目: maintenance/gallery/prompt-cards.md
- 二次元平面设计风格: maintenance/gallery/linux-do-style.md
- 小红书拍照姿势: maintenance/gallery/xhs-poses.md
- 图片区零散收集: maintenance/gallery/images-collected.md
- 色彩区零散收集: maintenance/gallery/colors-collected.md
- 视频区零散收集: maintenance/gallery/video-collected.md
- 项目:
- 梨园 Liyuan: maintenance/projects/liyuan.md
- 酒馆 SillyTavern: maintenance/projects/sillytavern.md
- DeepSeek Harness: maintenance/projects/deepseek-harness.md
- OpenAI Evals: maintenance/projects/openai-evals.md
- 本站:
- Zensical 升级评估:
- maintenance/zensical-upgrade/index.md
.gitignore — 关键排除项
# Python-generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info
# Virtual environments
.venv
# Zensical / MkDocs build output
site/
.cache/
# Secrets
.env
.env.*
# 二进制媒体与第三方 vendor 真身经 git-lfs 入库:.gitattributes 定规则,
# blob 存备份桶 lfs/ 前缀(agent:scripts/lfs-cos-agent.py;
# 新机器跑 scripts/setup-lfs.sh 接入;备份桶根下的路径镜像为历史双轨:scripts/backup-media.sh)
.claude/
.agents/
tmp/
deploy.sh — 构建 + 同步两个视图到对象存储
#!/usr/bin/env bash
# 构建 + 同步到腾讯云 COS:site/ 的 .html 给人看,docs/ 的 .md 源给 AI 读
set -euo pipefail
PROJECT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$PROJECT_DIR"
# 0. 收编副机 push 到 GitHub 的内容;--ff-only:本地有未推提交或冲突时报错停住(set -e 拦下),
# 逼人先处理再部署,不会静默合并出意外内容
git pull --ff-only
# 0.5 链路校验:本 wiki 的 AI 入口是相对链接、不是 nav,所以漏挂链接的文章对 AI 等于
# 不存在。这道闸门要求每篇 .md 都能被某个祖先索引页直接链到,另查死链与 nav 注册。
# 放在读凭证和构建之前 —— 失败得越早,浪费越少(set -e 拦下非零退出码)
python3 "$PROJECT_DIR/scripts/check-links.py"
# 1. 读凭证、写 coscmd 配置
set -a; source .env; set +a
COSCMD="$PROJECT_DIR/.venv/bin/coscmd"
"$COSCMD" config -a "$COS_SECRET_ID" -s "$COS_SECRET_KEY" -b "$COS_BUCKET" -r "$COS_REGION"
# 2. 构建(先清 site/:第 4 步 --delete 以 site/ 为准,残留会"保护"桶里陈旧不被清掉)
rm -rf "$PROJECT_DIR/site"
uv run zensical build
# 3. 复制 docs/ 的 .md 源进 site/(保留目录结构)→ site/ 成为桶的单一镜像;
# .md 与 .html 的 key 不冲突(use_directory_urls:页面在 /x/index.html,源在 /x.md)
# --exclude='.*/' 必须排在最前(rsync 首个匹配的规则生效):有人在 docs/ 里某个
# assets 目录跑过一次 uv,就地留下 .venv,里面依赖包自带的 LICENSE.md 会被
# --include='*.md' 一路捞进产物、跟着上桶。zensical build 自己会跳过点开头目录,
# 这条镜像不跳,就成了 .venv 上桶的唯一漏口(同一个坑的另一种形状见
# reference/deploy.md 里 uv run --directory 那段)。
rsync -am --exclude='.*/' --include='*/' --include='*.md' --exclude='*' "$PROJECT_DIR/docs/" "$PROJECT_DIR/site/"
# 3.5 llms.txt = index.md 的构建期副本(同一份内容双 URL:/index.md 给源、/llms.txt 给 llms.txt 协议爬虫)
# 写作时只维护 docs/index.md 一份即可;index.md 正文按 llms.txt 规范写(H1+blockquote+H2),
# 但头部带首页开屏的 frontmatter(template: home.html)和同步提示注释 —— llms.txt 要求
# H1 开头,这里剥掉 frontmatter 块和正文前的 HTML 注释再落盘
awk 'NR==1 && /^---$/ {fm=1; next} fm && /^---$/ {fm=0; next} fm {next} {print}' \
"$PROJECT_DIR/site/index.md" \
| perl -0pe 's/\A\s*(<!--.*?-->\s*)*//s' > "$PROJECT_DIR/site/llms.txt"
# 3.6 skill 整包:页面写了「如果要调用 2 次以上本 skill 中的脚本,直接将[本 skill](<目录>/<目录名>.tar.gz)
# 下载到本地。」这一行,就把链接指向的目录原样打成这个包放进 site/(入口 index.md 打自己的目录,
# Gallery 单页打自己的工程目录);链接了全站没人声明的包就报错停住。
# 远程逐个取文件的用法照旧,两种用法共用一套相对路径。
# 包只在 site/ 和桶里,不进 git;字节级可复现,内容不变 MD5 就不变,第 4 步的 -s 会跳过重传
python3 "$PROJECT_DIR/scripts/build-skill-bundles.py"
# 4. 同步 site/ 到 bucket 根(cd 进 site/ 用绝对路径 coscmd;不能用 uv run --directory,
# 它会把 CWD 切回项目根、把 .venv/.env 一起传上去)
# .md 必须先传:coscmd 默认给 .md 配 octet-stream,所以新增/变动的 .md 要由这条带
# Content-Type 的命令落桶;随后的全量同步见 MD5 一致会跳过,不会用错类型覆盖回去。
# 两条递归都带 -s(MD5 一致跳过),没变化的文件两步都不动。
cd "$PROJECT_DIR/site"
"$COSCMD" upload -rs --include '*.md' -H 'Content-Type: text/markdown; charset=utf-8' ./ /
# 代码源文件(demo 的 source/、文章附的脚本)同理要钉类型:COS 按扩展名猜,
# .ts 会猜成 video/mp2t(MPEG 视频流)、.tsx/.jsx/.mjs/.py 猜成 octet-stream——
# AI 抓取工具按 content-type 过滤文本时直接拒收,「完整实现」的链接摆得再对也读不回内容。
# .csv 同理进来(课程页的数据表):AI 要能直接 GET 到表内容才做得了题。
# .caddy / .conf 同理(API 中转篇附的 Caddy 站点配置和 systemd drop-in),钉成文本,不留给 COS 去猜。
# .cjs 同理(CommonJS 脚本),与 .mjs 同等待遇。
# 带 -s:-s 只比对 MD5 不看类型,新增/内容变动的文件会带着正确类型上传,没变的跳过。
# (桶里错类型的历史对象已在 2026-08 前的部署里全量重传修正过,此后无需再无条件重传;
# 若哪天又混入错类型对象,临时去掉 -s 跑一次即可自愈)
"$COSCMD" upload -rs --include '*.ts,*.tsx,*.jsx,*.mjs,*.cjs,*.py,*.sh,*.csv,*.caddy,*.conf' -H 'Content-Type: text/plain; charset=utf-8' ./ /
# skill 整包(第 3.6 步)同理钉成 application/gzip,不留给 COS 按扩展名去猜
"$COSCMD" upload -rs --include '*.tar.gz' -H 'Content-Type: application/gzip' ./ /
# llms.txt 不带 -s:coscmd 单文件 upload -s 命中"MD5 一致跳过"时退出码是 254(且静默),
# 会被 set -e 误杀、后面的全量镜像不再执行;2KB 每次直传换脚本必然走完。
"$COSCMD" upload -H 'Content-Type: text/plain; charset=utf-8' llms.txt /llms.txt # 内容是 markdown,扩展名按 llms.txt 规范用 .txt,浏览器直读用 text/plain
"$COSCMD" upload -rs --delete -y ./ / # 全量镜像+清桶里陈旧;-y 免确认(set -e 保证 build 失败不会拿空 site 清空桶)
echo
echo "✅ 部署完成 — https://${COS_DOMAIN}/"
scripts/lfs-cos-agent.py — mini LFS:COS 后端 standalone transfer agent
#!/usr/bin/env python3
"""git-lfs standalone custom transfer agent,后端为腾讯云 COS 备份桶。
由 git-lfs 在 push/pull 时按需拉起(scripts/setup-lfs.sh 负责注册到 git config),
stdin/stdout 走 JSON-lines 协议;每个进程串行处理,git-lfs 靠多开进程实现并发。
协议:https://github.com/git-lfs/git-lfs/blob/main/docs/custom-transfers.md
用法(由 lfs.customtransfer.cos.args 传入):
lfs-cos-agent.py [前缀] # blob 存 cos://$COS_BACKUP_BUCKET/<前缀>/ab/cd/<oid>,默认 lfs
凭证复用项目 .env(COS_SECRET_ID/KEY、COS_REGION、COS_BACKUP_BUCKET)。
"""
import json
import os
import subprocess
import sys
import tempfile
from pathlib import Path
PROJECT_DIR = Path(__file__).resolve().parent.parent
def load_env():
env = {}
for line in (PROJECT_DIR / ".env").read_text().splitlines():
line = line.strip()
if not line or line.startswith("#") or "=" not in line:
continue
k, _, v = line.partition("=")
env[k.strip()] = v.strip().strip("'\"")
return env
def reply(obj):
sys.stdout.write(json.dumps(obj) + "\n")
sys.stdout.flush()
def log(msg):
print(f"[lfs-cos-agent] {msg}", file=sys.stderr, flush=True)
class Agent:
def __init__(self, prefix):
self.prefix = prefix.strip("/")
self.client = None
self.bucket = None
self.tmpdir = None
def key(self, oid):
# 内容寻址:sha256 前两级做目录,避免单层百万对象
return f"{self.prefix}/{oid[:2]}/{oid[2:4]}/{oid}"
def handle_init(self, msg):
try:
from qcloud_cos import CosConfig, CosS3Client
env = load_env()
self.bucket = env["COS_BACKUP_BUCKET"]
self.client = CosS3Client(
CosConfig(
Region=env["COS_REGION"],
SecretId=env["COS_SECRET_ID"],
SecretKey=env["COS_SECRET_KEY"],
)
)
# 下载先落 .git/lfs/tmp:与仓库同文件系统,git-lfs 移走时 rename 不跨设备
try:
gitdir = subprocess.check_output(
["git", "rev-parse", "--absolute-git-dir"], text=True
).strip()
self.tmpdir = Path(gitdir) / "lfs" / "tmp"
self.tmpdir.mkdir(parents=True, exist_ok=True)
except Exception:
self.tmpdir = Path(tempfile.mkdtemp(prefix="lfs-cos-"))
reply({})
except Exception as e:
reply({"error": {"code": 1, "message": f"init 失败: {e}"}})
def handle_upload(self, msg):
oid = msg["oid"]
try:
key = self.key(oid)
if self.client.object_exists(Bucket=self.bucket, Key=key):
log(f"跳过(桶里已有){oid[:12]}")
else:
self.client.upload_file(
Bucket=self.bucket, Key=key, LocalFilePath=msg["path"]
)
log(f"上传 {msg.get('size', '?')}B {oid[:12]}")
reply({"event": "complete", "oid": oid})
except Exception as e:
reply(
{
"event": "complete",
"oid": oid,
"error": {"code": 2, "message": f"上传 {self.key(oid)} 失败: {e}"},
}
)
def handle_download(self, msg):
oid = msg["oid"]
try:
fd, tmp = tempfile.mkstemp(dir=self.tmpdir, prefix=oid[:12] + "-")
os.close(fd)
self.client.download_file(
Bucket=self.bucket, Key=self.key(oid), DestFilePath=tmp
)
log(f"下载 {msg.get('size', '?')}B {oid[:12]}")
reply({"event": "complete", "oid": oid, "path": tmp})
except Exception as e:
reply(
{
"event": "complete",
"oid": oid,
"error": {"code": 2, "message": f"下载 {self.key(oid)} 失败: {e}"},
}
)
def main():
agent = Agent(sys.argv[1] if len(sys.argv) > 1 else "lfs")
handlers = {
"init": agent.handle_init,
"upload": agent.handle_upload,
"download": agent.handle_download,
}
for line in sys.stdin:
line = line.strip()
if not line:
continue
msg = json.loads(line)
event = msg.get("event")
if event == "terminate":
break
if event in handlers:
handlers[event](msg)
else:
log(f"忽略未知事件: {event}")
if __name__ == "__main__":
main()
scripts/setup-lfs.sh — 每个 clone 一次性接入 LFS
#!/usr/bin/env bash
# 把"当前所在的 git 仓库"接上 COS 后端的 git-lfs(scripts/lfs-cos-agent.py)。
#
# 每台机器 / 每个 clone 跑一次(agent 路径出于安全不能写进仓库内 .lfsconfig,
# 只能落在本地 git config)。在目标仓库目录里执行:
# bash /path/to/wiki/scripts/setup-lfs.sh # 前缀默认 lfs
# bash /path/to/wiki/scripts/setup-lfs.sh lfs-test # 测试仓用独立前缀
#
# 依赖:本机装有 git-lfs;wiki 项目的 .venv(qcloud_cos)与 .env(COS 凭证)。
set -euo pipefail
PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
PREFIX="${1:-lfs}"
git rev-parse --is-inside-work-tree >/dev/null || { echo "请在目标 git 仓库里执行" >&2; exit 1; }
[ -x "$PROJECT_DIR/.venv/bin/python" ] || { echo "缺 $PROJECT_DIR/.venv,先 uv sync" >&2; exit 1; }
[ -f "$PROJECT_DIR/.env" ] || { echo "缺 $PROJECT_DIR/.env(COS 凭证)" >&2; exit 1; }
git lfs install --local
git config lfs.customtransfer.cos.path "$PROJECT_DIR/.venv/bin/python"
git config lfs.customtransfer.cos.args "$PROJECT_DIR/scripts/lfs-cos-agent.py $PREFIX"
git config lfs.standalonetransferagent cos
echo "✅ 已接入 COS-LFS:blob → cos://\$COS_BACKUP_BUCKET/$PREFIX/(凭证读 $PROJECT_DIR/.env)"
deploy-cert/install.sh — 首次配置 acme.sh + 注册 hook
#!/usr/bin/env bash
# 首次配置:装 acme.sh、申请证书、注册自动续期 hook
# 之后续期由 acme.sh 内置 cron 触发,无需再跑此脚本
set -euo pipefail
PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$PROJECT_DIR"
set -a
# shellcheck disable=SC1091
source .env
set +a
# 必填项
need() {
if [ -z "${!1:-}" ]; then
echo "ERROR: .env 缺少 $1" >&2
exit 1
fi
}
need DP_Id
need DP_Key
need ACME_EMAIL
need COS_SECRET_ID
need COS_SECRET_KEY
need COS_BUCKET
need COS_REGION
need COS_DOMAIN
ACME="$HOME/.acme.sh/acme.sh"
PYTHON="$PROJECT_DIR/.venv/bin/python"
DEPLOY_SCRIPT="$PROJECT_DIR/deploy-cert/deploy_cert_to_cos.py"
# 1. 装 acme.sh(如果还没装)
if [ ! -x "$ACME" ]; then
echo ">>> 安装 acme.sh ..."
curl -fsSL https://get.acme.sh | sh -s email="$ACME_EMAIL"
fi
# 2. 切到 Let's Encrypt 作为默认 CA(acme.sh 0.6 起默认 ZeroSSL)
"$ACME" --set-default-ca --server letsencrypt
# 3. 申请证书(DNS-01)—— DP_Id/DP_Key 已经在环境里
echo ">>> 申请证书 for $COS_DOMAIN ..."
"$ACME" --issue --dns dns_dp -d "$COS_DOMAIN" --keylength ec-256
# 4. 注册 reloadcmd:续期成功后自动调 Python 脚本,把新证书推到 COS
RELOADCMD="set -a; . '$PROJECT_DIR/.env'; set +a; \
export TENCENT_SECRET_ID=\"\$COS_SECRET_ID\" TENCENT_SECRET_KEY=\"\$COS_SECRET_KEY\"; \
'$PYTHON' '$DEPLOY_SCRIPT'"
"$ACME" --install-cert -d "$COS_DOMAIN" --ecc --reloadcmd "$RELOADCMD"
# 5. 首次也手动跑一次 reloadcmd,把刚拿到的证书推到 COS
echo ">>> 首次部署证书到 COS ..."
"$ACME" --renew -d "$COS_DOMAIN" --ecc --force
echo
echo "✅ 完成"
echo
echo "已注册的 cron 任务(acme.sh 自动加的,每天 0 点检查):"
crontab -l 2>/dev/null | grep -i acme || echo "(看不到?运行 ~/.acme.sh/acme.sh --install-cronjob)"
echo
echo "常用命令:"
echo " 查看证书状态: ~/.acme.sh/acme.sh --list"
echo " 强制立即续期: ~/.acme.sh/acme.sh --renew -d $COS_DOMAIN --ecc --force"
echo " 查看续期日志: tail -f ~/.acme.sh/acme.sh.log"
deploy-cert/deploy_cert_to_cos.py — acme.sh 调用的证书推送脚本
#!/usr/bin/env python3
"""
acme.sh 续期后调用此脚本,把新证书绑定到 COS 自定义域名。
acme.sh 通过 reloadcmd 调用时会注入:
CERT_FULLCHAIN_PATH / CERT_KEY_PATH / Le_Domain 等
本脚本额外要求的环境变量(由 .env 提供):
TENCENT_SECRET_ID / TENCENT_SECRET_KEY
COS_REGION / COS_BUCKET / COS_DOMAIN
"""
import os
import sys
from pathlib import Path
from qcloud_cos import CosConfig, CosS3Client
def must_env(name: str) -> str:
v = os.environ.get(name)
if not v:
sys.exit(f"ERROR: missing required env var: {name}")
return v
def main() -> None:
secret_id = must_env("TENCENT_SECRET_ID")
secret_key = must_env("TENCENT_SECRET_KEY")
region = must_env("COS_REGION")
bucket = must_env("COS_BUCKET")
domain = must_env("COS_DOMAIN")
cert_path = os.environ.get("CERT_FULLCHAIN_PATH") or os.environ.get("CERT_PATH")
key_path = os.environ.get("CERT_KEY_PATH")
if not cert_path or not key_path:
sys.exit(
"ERROR: CERT_FULLCHAIN_PATH and CERT_KEY_PATH must be set "
"(acme.sh injects them automatically via --reloadcmd)"
)
cert = Path(cert_path).read_text()
key = Path(key_path).read_text()
client = CosS3Client(CosConfig(
Region=region,
SecretId=secret_id,
SecretKey=secret_key,
Scheme="https",
))
client.put_bucket_domain_certificate(
Bucket=bucket,
DomainCertificateConfiguration={
"CertificateInfo": {
"CertType": "CustomCert",
"CustomCert": {"Cert": cert, "PrivateKey": key},
},
"DomainList": [{"DomainName": domain}],
},
)
print(f"OK: bound new cert to {domain} on bucket {bucket}")
if __name__ == "__main__":
main()
pyproject.toml — uv 依赖清单
[project]
name = "zensical-wiki"
version = "0.1.0"
description = "Add your description here"
requires-python = ">=3.13"
dependencies = [
"zensical>=0.0.62",
]
[dependency-groups]
dev = [
"coscmd>=1.9.0.6",
]
其中 coscmd 会带来 cos-python-sdk-v5 作为传递依赖,deploy_cert_to_cos.py 和 lfs-cos-agent.py 都用它。
.env 模板 — 凭证占位(绝对不要 commit)
# ----- 对象存储(腾讯云 COS):部署内容 + 给证书 hook 用 -----
COS_BUCKET=wiki-1307341066
COS_APPID=1307341066
COS_REGION=ap-chengdu
COS_SECRET_ID=AKID...你的 SecretId
COS_SECRET_KEY=你的 SecretKey
COS_DOMAIN=wiki.liuhetian.work
# ----- acme.sh:自动 SSL 证书 -----
ACME_EMAIL=you@example.com
# DNSPod API Token:去 https://console.dnspod.cn/account/token 创建后填
DP_Id=...
DP_Key=...
一次性安装命令(拷下来直接跑)
# 1. 项目初始化
mkdir wiki && cd wiki
uv init --no-readme
uv add zensical
uv add --dev coscmd
# 2. 把上面所有文件写好 + 填好 .env
# 3. 接入 git-lfs(媒体 blob 走备份桶,见「资源备份」一节)
bash scripts/setup-lfs.sh
# 4. 首次部署内容
./deploy.sh
# 5. 首次配置 SSL 自动化
./deploy-cert/install.sh
之后每次写完文章只跑 ./deploy.sh 一行,两个视图(HTML + md 源)同时更新,证书永久无需操心;在别的机器写的内容会被脚本第 0 步的 pull 自动捎带上线(见日常写作流)。
-
Zensical roadmap —— 未来 12 个月聚焦模块系统(2026 初开放)、组件系统、CommonMark、搜索等,未涉及 markdown 源输出 / llms.txt。 ↩
-
Let's Encrypt - Decreasing Certificate Lifetimes to 45 Days —— 官方公告,2026 年 5 月 13 日起默认证书有效期从 90 天缩短到 45 天。 ↩↩
-
acme.sh DNS API 列表 —— 各家 DNS 服务商对应的 acme.sh 插件名(Cloudflare/阿里云/AWS Route53 等都有)。 ↩
-
腾讯云 COS Go SDK 测试代码 ——
BucketPutDomainCertificateOptions的标准结构体定义,明确给出了CertificateInfo→CertType+CustomCert的嵌套层级。 ↩