dbs-save
Save key states of the current diagnosis locally, and view or configure the archive location. Used when users request saving conclusions, resuming across sessions, or modifying the archive path.
1How It Works & Mechanism
A pure prompt-orchestrated 'writer' that persists conversation state into recoverable markdown using fixed file formats and path rules; responsibilities are strictly separated—record only, do not diagnose.
**你不做诊断。** 诊断是别的 skill 的事,你只做记录。
The archive root directory is determined by the project's .dbs/config.json with three modes (default ~/.dbs/, project current dir .dbs/, and custom designated dir), serving as the single source of truth for configuration (dbs-restore/dbs-report resolve following the same rules).
没有配置文件时,继续使用默认位置,不创建配置文件。
Fail fast on configuration anomalies: unparseable / unsupported mode / empty root / path pointing to /, home dir, or project root → abort and explain the issue; silently falling back to the default location is prohibited.
配置无法解析、`mode` 不受支持、`root` 为空,或路径指向 `/`、用户家目录、当前项目根目录时,停止操作并说明配置问题。不要静默退回默认位置。
Writing configurations requires secondary confirmation: only written when the user explicitly uses the location subcommand, and the resolved absolute path must be shown and confirmed beforehand.
写入前说明最终解析出的绝对路径,并要求用户确认;用户确认后再创建或更新 `.dbs/config.json`。
Determine if there is 'anything worth saving' before writing: refuse to save empty files if there is no diagnostic process, and provide the correct path prompt.
- 切换位置不会自动搬动旧存档。需要迁移时,先展示来源与目标,得到用户确认后复制;保留原文件。 `/dbs-save location` 只显示当前模式、配置文件位置和解析后的存档根目录,不写文件。 --- ## 工作流程 ### Step 1:判断现在能不能存 存之前先看对话里有没有真正可记的东西。如果用户刚说了一句「保存」但前面没做过任何诊断,你应该说: > 现在没有可存的结论。输入 `/dbs` 开始处理一个真实任务;形成结论后,再明确告诉我需要保存。 不要存空文件。 ### Step 2:自动提取或确认标题 从对话里提取一句话作为标题(不超过 20 字,名词性短语)。例如: - 「卖什么没想清楚」 - 「找到了对标但学不来」 - 「定价偏低,需要拉到 10 倍价差」 如果用户用 `/dbs-save <title>` 显式指定了,用用户的。 ### Step
Project isolation relies on slug: defaults to sanitized basename $(pwd), falls back to default in home directories or non-project scenarios, and allows explicit user specification via --slug.
**默认项目名**:取自 `basename $(pwd)`,把所有非 `[a-z0-9-]` 字符替换成 `-`。
Privacy notice is a one-time alert upon first entering project/custom mode, covering 'local unencrypted plaintext', 'recommending adding .dbs/ to .gitignore (requires confirmation before modification)', and 'changing locations does not automatically migrate existing archives'.
如果当前项目使用 Git,建议把 `.dbs/` 加入 `.gitignore`。修改 `.gitignore` 前必须得到用户确认。
The next_skill field enforces a 'leave empty rather than guess' discipline to avoid feeding wrong directions for dbs-restore automatic resumption.
不要瞎猜——这个字段是给 dbs-restore 自动接续用的,错了比空更糟。
2Core Capabilities
4Recommended Governance & Evidence
- 本地工作目录: File I/O and artifact output: {archive_root}/sessions/{slug}/{YYYYMMDD-HHMMSS}-{title-slug}.md (diagnostic archive containing chief complaint, conclusions, discarded directions...)
5Second-Pass Verification
- [ok] 外部资源/工具:是否存在未声明的依赖 — 无 URL、无包、无 CLI;目录内仅 SKILL.md + agents/openai.yaml。external_deps 空数组成立(文中出现的 python3 datetime 命令只是 timestamp 生成建议,不构成依赖)。
- [ok] 安全结论:写入是否可能落到危险位置 — 配置解析显式拒绝 path 指向 /、家目录、项目根的场景并停机(「不要静默退回默认位置」);config 写入有绝对路径确认;存档写入固定在 {存档根目录}/sessions/ 下,无删除操作。除用户自定义 root 外,默认落点为 ~/.dbs/。
- [ok] 实现原理是否成立:跨会话可恢复是否真由本 skill 保证 — 四要素齐备:确定路径规则、含时间戳文件名(供 dbs-restore 排序)、固定 frontmatter 字段(供解析)、固定 body 六段(供报告搬运),并规定 source_skill/next_skill 的填写纪律。恢复端(dbs-restore)的读取假设与本端写入格式逐条对应。
- [ok] 功能声明 vs 实际能力:description 声称的「查看或设置存档位置」 — 对应 location 子命令三态(查看 / default / project / custom <路径>)与「只读显示不写文件」的区分,实现与声明相符。
- [unlocatable] 证据定位:仓库级元数据(stars/last_push)与 installs — stars=10121、last_push=2026-09-07 来自站点池 data/pool.json(GitHub API 采集),pin 源码内无法逐字定位;installs 未采集记 null。license 可在仓库根 LICENSE 逐字命中。
6Verdict & Scenarios
b6062f2bb252be4a…