1How It Works & Mechanism
A pure prompt-orchestrated 'state reader' with minimally scoped responsibilities: read archive → present state → wait for user input, explicitly avoiding diagnosis and proactive routing to other skills.
skills/dbs-restore/SKILL.md**你不做诊断,不主动跳到别的 skill。** 你只负责把记忆拿回来。
Shares the same user-facing phrasing conventions with dbs-save (snapshot → archive, session → conversation, slug → project).
Locates the 'latest' not by file mtime, but by sorting the YYYYMMDD-HHMMSS filename prefix—the rationale being that cloud sync alters mtime.
skills/dbs-restore/SKILL.md「最新」按文件名前缀的 `YYYYMMDD-HHMMSS` 排序,**不依赖文件 mtime**(mtime 不可信,可能被 iCloud 同步改写)。
Designed in tandem with dbs-save naming rules (timestamp prefix); both skills are decoupled through filename conventions.
Resolves the archive root directory using the same rules and failure semantics as dbs-save: if config is unparseable / mode unsupported / root empty / path points to /, home, or project root → stop restoration and explain the issue; do not guess or silently fall back to default locations.
skills/dbs-restore/SKILL.md`dbs-restore` 只读取配置,不修改配置。用户要查看或调整位置时,引导使用 `/dbs-save location`。
Complemented by rules: 'Do not guess other locations, do not silently fall back to default locations' and 'Do not automatically search private files across directories'.
Shows 'recently active projects' instead of throwing an error on empty directories: lists the 3 most recent other projects sorted by timestamp, guiding the user to switch with --slug.
skills/dbs-restore/SKILL.md如果有别的项目 → 列出最近活跃过的 3 个(按各项目下最新存档的时间戳排序),让用户选:
Distinguishes two empty states: project is empty but other projects exist → provide candidates; even sessions/ does not exist → instruct how to start and point to /dbs-save location.
The presentation stage extracts only core fields (project/time/chief complaint/source/status/conclusion/vetoed/hypothesis/next steps), ending with an open question while strictly forbidding routing decisions on the user's behalf.
skills/dbs-restore/SKILL.md末尾的「现在你想从哪儿继续?」是开放性问句,**不要直接帮用户路由到某个 skill**。等用户回应。
Step 5 routes to the next_skill field value only when the user explicitly says 'proceed with the confirmed next step from last time'.
Quality assurance for post-restoration continuity: when routing to next_skill, the core archive content must be passed as context so the user does not need to repeat themselves.
skills/dbs-restore/SKILL.md**调用时把存档的核心内容作为上下文喂给那个 skill**——不要让用户再讲一遍。
Preserves an exit route for users opting not to inherit: 'Do not force the user to inherit the previous state'; hand off new circumstances to /dbs for re-evaluation.
Fault tolerance over formatting perfection: when an archive is manually edited or frontmatter lacks fields, present as much as possible using available information rather than refusing to display.
skills/dbs-restore/SKILL.md尽量用现有信息呈现,不要因为格式错误就拒绝展示。
Consistent with dbs-report handling ('If an archive has formatting omissions, use available fields as much as possible; do not abort report generation').
Interaction discipline extends to repeated invocations and out-of-range indexes: uses fixed scripts for consecutive restore calls and index overflow to avoid unscripted model behaviors.
skills/dbs-restore/SKILL.md用户传的序号超出范围 → 「{项目名} 下只有 {N} 份存档,你给的序号是 {M}。」
Also includes dedicated handling for 'archive file manually deleted by user' and 'current archive location empty but user insists it was saved previously'.
2Core Capabilities
01Locate target archives via index, project, or default
02Cross-project retrieval: switch project via --slug and fetch its latest archive
03Empty state guidance: list top 3 recently active projects for selection
04State presentation template (compact markdown including localized status and 'next step from last time')
05Conditional routing: invoke next_skill with archive context only upon explicit user confirmation to 'proceed with last next step'
06list reuse: /dbs-restore list is equivalent to /dbs-save list with consistent output format
07Non-inheritance exit: hand back to /dbs for reassessment if user states 'the previous one is no longer relevant'
08Fault-tolerant parsing: strive to present content even when frontmatter is missing fields or manually edited
6Verdict & Scenarios
Forms a complete cross-session memory loop with dbs-save: hardcoded trio of naming conventions (timestamp prefix) + sorting rules (bypassing mtime) + context handoff (feeding the next hop), ensuring continuity without model hallucinationExtremely clear role boundaries: does not diagnose, does not proactively route, and does not write files; returns decision power on 'what to do next' to the user to prevent AI from unilaterally driving the agendaComprehensive, humanized failure handling: offers recently active candidates for empty projects, provides startup guidance when sessions/ is missing, and maintains fixed responses for out-of-bounds indexes, deleted files, and repeated callsPrivacy restraint: strictly enforces 'no cross-directory auto-search for private files'; halts and reports config anomalies rather than rummaging through the filesystemFault tolerance first: endeavors to render manually altered formats without barring users from viewing their history due to formatting glitches (matching dbs-report's fault tolerance)Best for: Ideal for users conducting long-term diagnostics on the same project who require cross-session continuity: restores progress, discarded directions, and next steps to an actionable state with a single command. Together with dbs-save and dbs-report, it completes the 'save-resume-export' loop, serving as a critical piece turning dbskill from a 'single consultation' into a 'personal physician'.
Not for: Not suitable for scenarios requiring immediate conclusions on first run (replays only, does not analyze—guides to /dbs if no archive exists); not suitable for recovering archives across disparate locations or machines (reads only configured paths without auto-search); not suitable when data masking is required before display (quotes verbatim); not suitable for users expecting AI to decide for them—explicitly designed not to give routing suggestions.