dr-next-snapshot-replay
Consumer contract for stage snapshots — /dr-next and /dr-orchestrate read datarim/snapshots/{TASK-ID}.snapshot.md first and emit a replay prompt.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Consumer contract for stage snapshots — /dr-next and /dr-orchestrate read datarim/snapshots/{TASK-ID}.snapshot.md first and emit a replay prompt.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Schema and migration semantics for /dr-doctor — thin one-liner contract, 6-pass migration, data-loss safety, conflict resolution. Loaded by self-heal.
Core Datarim rules. Load this entry first, then only the fragment needed for paths, storage, numbering, backlog, routing, or archive behavior.
Post-QA hardening — detects task type (code, docs, research, legal, content, infra) and applies the matching verification checklist before archiving.
Testing pyramid, frameworks, mocking. Load first; then the fragment for the active gate (live smoke, silent failure, bats, legacy triage).
Preserve Datarim task continuity while orchestrated Claude Code or Codex sessions compact or clear context at deterministic pressure thresholds.
Immutability contract for all pipeline stages: artefact freeze, V-AC parity, non-code parity, anti-tautological rule, and return-to-source transition.
| name | dr-next-snapshot-replay |
| description | Consumer contract for stage snapshots — /dr-next and /dr-orchestrate read datarim/snapshots/{TASK-ID}.snapshot.md first and emit a replay prompt. |
| current_aal | 1 |
| target_aal | 2 |
/dr-next and /dr-orchestrate, after Task Resolution, read the snapshot first — before task-description, init-task, activeContext, PRD, or plan. If the snapshot exists and is valid, they assemble a replay prompt in the canonical form and continue autonomously. If the snapshot is missing or malformed, fall back to the legacy behaviour without warning noise.
| Aspect | Value |
|---|---|
| Consumer touchpoints | commands/dr-next.md § Step 2.5, commands/dr-orchestrate.md § Snapshot-First Resume |
| Snapshot path | datarim/snapshots/{TASK-ID}.snapshot.md |
| Validator | "${DATARIM_RUNTIME:-$HOME/.claude}/dev-tools/check-stage-snapshot-on-exit.sh" --validate-frontmatter --task <ID> (exit 0 = ok) |
| Fallback policy | snapshot absent OR validator exit ≠ 0 → legacy Read pipeline, no warning (V-AC-7) |
| Prompt template | see § Replay-prompt template below |
When the snapshot is valid, emit exactly this shape, with no improvisation:
<recommended-CTA>
ищи способ исследовать все проблемы и ответить на все вопросы самостоятельно. выполняй за оператора все необходимые шаги и требования, которые можешь сделать сам. не создавай FU подзадачи, если они уровня 1, а решай их в этом же цикле до полного решения.
Find a way to investigate all problems and answer all questions yourself. Perform on behalf of the operator every step and requirement you can do yourself. Do not spawn FU sub-tasks for Level-1 work — resolve them in the same cycle to completion.
done before:
<snapshot body>
<recommended-CTA> — the recommended_next value from the snapshot frontmatter plus one purpose line, expanded by the CTA heuristic below.done before: header is a literal; the exact snapshot body content follows underneath.The recommended_next value from the snapshot is a hint already emitted correctly by the previous stage per cta-format.md § Authoring Rules. This heuristic documents the rationale for preferring that option; it does not recompute it. If the operator has a reason to pick a different option from options[], the operator types it explicitly — the replay prompt shows the recommended option but does not block an override.
Principle: maximise the marginal quality improvement of the solution. For L3+ tasks with few verification passes so far, prefer verification commands (/dr-verify, /dr-qa, /dr-design) over /dr-do. When verification is saturated, move on to implementation or archiving.
/dr-plan, few verification passes → /dr-verifySnapshot: recommended_next: /dr-verify, options:
/dr-do <TASK-ID> | TDD implementation/dr-design <TASK-ID> | ratify Vault relativePath/dr-qa <TASK-ID> | pre-implementation coverage/dr-verify <TASK-ID> | tri-layer plan verification/dr-status | escape hatchThe heuristic picks /dr-verify — the plan has just been finalised and the security review / threat model have not yet been cross-checked by an independent layer. Verification is cheaper than rolling back /dr-do if drift is found later. Rationale: is an L3 security-critical task with 21 V-AC; the cost of a verification verdict (Layer 1 deterministic + Layer 2 cross-model + Layer 3 native dispatch) is far lower than rolling back a bootstrap on PROD.
/dr-doSnapshot: recommended_next: /dr-do, options:
/dr-do <TASK-ID> | TDD implementation/dr-qa <TASK-ID> | redo coverage check/dr-status | escape hatchThe heuristic picks /dr-do directly. Rationale: accumulated evidence (plan + design + tri-layer verify all green) is enough for a confident implementation pass. Another /dr-qa is diminishing returns; /dr-status is the escape hatch for non-standard operator decisions.
/dr-do → /dr-archiveSnapshot: recommended_next: /dr-archive, options:
/dr-archive <TASK-ID> | finalise + archive doc/dr-qa <TASK-ID> | optional re-check/dr-status | escape hatchThe heuristic picks /dr-archive. Rationale: per cta-format.md § Authoring Rules, the L1/L2 primary after /dr-do is /dr-archive. Implementation is already done; archive captures the outcome and frees activeContext. Override only when /dr-do surfaced open questions that justify a revisit.
1. Resolve TASK-ID per Task Resolution Rule.
2. snapshot_path = "$REPO_ROOT/datarim/snapshots/${TASK_ID}.snapshot.md"
3. if check-stage-snapshot-on-exit.sh --validate-frontmatter --task "$TASK_ID" → exit 0:
read snapshot body + frontmatter
emit replay prompt per § Replay-prompt template
STOP downstream Read pipeline — primary context = snapshot
else:
silent fallback → legacy Read order (task-description / init-task / activeContext)
/dr-orchestrate integrates the snapshot-first read before subagent_resolver.sh; recommended_next is passed to the resolver as --hint <command>. The resolver may still return a different command — the snapshot is a hint, not a constraint.
This section is the single canonical source for the bilingual replay-prompt
template. Both /dr-next (via § Replay-prompt template above) and
/dr-continue (via skills/session-handoff-replay/SKILL.md) cite this section
to stay in lockstep. Do not duplicate the template elsewhere — reference this
section by name.
The renderer contract:
recommended_next value from the artefact frontmatter.done before: header followed by the artefact body content./dr-continue uses this renderer for session-scoped handoff artefacts; the
source artefact is datarim/sessions/{SESSION-ID}.session.md (validated by
dev-tools/check-session-handoff.sh) rather than the per-task snapshot, but
the rendered replay-prompt template is identical.
skills/stage-snapshot-writer/SKILL.md — the producer side (per-task snapshots).skills/session-handoff-writer/SKILL.md — the producer side (session handoff artefacts).skills/session-handoff-replay/SKILL.md — consumer side for session handoff, cites § Shared Replay Renderer.skills/cta-format/SKILL.md — the CTA block (definition) format that fills <recommended-CTA>.dev-tools/check-stage-snapshot-on-exit.sh — the mandatory validator that runs before the per-task prompt is emitted.dev-tools/check-session-handoff.sh — the mandatory validator that runs before the session replay prompt is emitted.commands/dr-next.md § Step 2.5 — consumer touchpoint.commands/dr-continue.md — session-handoff consumer touchpoint.commands/dr-orchestrate.md § Snapshot-First Resume — orchestrator touchpoint.