plan-path-validator
Exists-check for file/script/path references in /dr-plan output — flags missing or deprecated tooling and file references before they reach /dr-do.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Exists-check for file/script/path references in /dr-plan output — flags missing or deprecated tooling and file references before they reach /dr-do.
用 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 | plan-path-validator |
| description | Exists-check for file/script/path references in /dr-plan output — flags missing or deprecated tooling and file references before they reach /dr-do. |
| allowed-tools | Bash, Grep, Read |
An implementation plan often names concrete file paths, scripts, tools, and
directories as edit targets, rollback mechanisms, or supporting evidence
(e.g. scripts/deploy.sh, documentation/runbooks/, dev-tools/append-init-task-qa.sh).
When a plan is drafted from memory or from a stale reflection, some of those
references point at paths that were renamed, moved, or deleted since the memory
was formed. A plan built on a phantom path surfaces the defect only at /dr-do
implementation time — after a full pipeline stage has been spent — and forces a
mid-build re-plan.
This Reference skill provides the deterministic exists-check contract for the
path references a /dr-plan output carries. It is the path-oriented companion
to the Symbol Existence Check already prescribed inline in
dr-plan § 6.5: symbol-existence greps the code for a
named function / flag / env var; path-existence probes the filesystem (and git
index) for a named file / script / directory, and additionally flags paths
that resolve but are marked deprecated.
Load THIS skill when a /dr-plan output (or a plan-shaped section of a PRD)
names any of:
path/to/file.ext);scripts/foo.sh, dev-tools/bar.sh, a CLI binary path);NOT for: purely conceptual plans with no concrete filesystem references; symbol-only references already covered by dr-plan § 6.5 (function / flag / env var lookups inside source — those are grep-the-code, not test-the-path).
For every path reference the plan carries, apply the following ladder. Each rung is a deterministic shell probe — no LLM judgement, no fabrication.
Extract the path-shaped tokens from the plan text. A path-shaped token is a
slash-bearing string in backticks, a code fence, or a Validation-row command
(e.g. `scripts/check-doc-refs.sh`, dev-tools/append-init-task-qa.sh).
Deduplicate. Untrusted-input hygiene (Security Mandate S1/S5): every path is
planner-emitted text — always quote it and terminate option parsing with --
before passing it to a shell tool.
First disambiguate whether the path lives inside a git working tree, then probe:
# $p is one collected path; $dir is dirname($p) or the repo root
if git -C "$dir" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
# Inside a working tree: prefer the git index for tracked targets,
# fall back to the filesystem for untracked-but-present paths.
if git -C "$dir" cat-file -e "HEAD:$p" 2>/dev/null \
|| git -C "$dir" ls-files --error-unmatch -- "$p" >/dev/null 2>&1 \
|| test -e "$p"; then
: # PRESENT
else
echo "MISSING: $p" # phantom / renamed / deleted
fi
else
# Non-git path (gitignored web root, deploy-synced dist, sibling submodule):
test -e "$p" && : || echo "MISSING: $p"
fi
git cat-file -e "HEAD:$p" confirms the path exists at the current commit
(tracked); ls-files --error-unmatch covers staged-but-uncommitted; test -e
covers untracked-but-present and non-git trees. A token failing all three is a
phantom path — the plan names it but it does not exist.A path existing is not the same as a path being the current one. Flag a resolved path as deprecated when any of:
deprecated /
retired / obsolete / superseded / do NOT use marker
(grep -rIl -e deprecated -e retired -e obsolete -- "$p" against the file or
its directory index);For each deprecated hit, emit DEPRECATED: <path> → use <replacement> (per <source:line>).
Emit a compact block the planner folds into the plan (or the reviewer folds into the QA report):
PATH VALIDATION
checked: <N> path references
present: <N>
MISSING: <path> [, ...] # phantom — fix the plan or create+justify the path
DEPRECATED: <path> → <replacement> [, ...]
[to-be-created] in the plan with a one-sentence
justification (mirrors dr-plan § 6.5 "intentionally to be created" rule).present / no-DEPRECATED result is a clean pass — no plan change.scripts/check-doc-refs.sh) — a CI linter that
resolves markdown *.md links across the docs tree. It runs post-hoc on
committed markdown; this skill runs at plan-draft time on the plan's own path
tokens (any extension, including scripts and directories), before /dr-do.test -e unquoted or without -- on a planner-emitted path — paths
with whitespace, backticks, or $(...) are untrusted input.