/dpf-platform:dpf-verify-substrate-firstfrom dpf-platform
Before proposing new DPF substrate concepts (tables, types, enums, epics, MCP tools, agent roles), greps the live codebase, backlog, and git history to verify the concept doesn't already exist.
Ships in dpf-platform. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Before proposing any new substrate concept — table, type, enum value, capability, epic, MCP tool, agent role — grep the live codebase, query the live backlog, and sweep origin/main for the noun. DPF's architecture is denser than first reads suggest; the most common reflex of "we'll need a new X" is wrong because X already exists, or because X is in-flight on a sibling worktree that hasn't merged yet, or because the spec frontmatter saying "not implemented" is 3 days stale.
This skill carries forward the substrate-sweep discipline added by PR #1104 into a DPF-pack skill (audit delta D1 from BI-98BDFA75) so it survives the retirement of the manual superpowers snapshot.
mcp__dpf__create_epic.| Source | Path | What to extract |
|---|---|---|
| Code graph | mcp__dpf__search_code_graph({ query: "<noun>", limit: 10 }) | Curated subgraph of code matching the noun — fastest first sweep |
| Prisma schema | packages/db/prisma/schema/*.prisma (26 domain files — there is no monolithic schema.prisma) | Many candidate "new tables" turn out to be columns or relations on existing models |
| Type unions / enums | apps/web/lib/, packages/db/src/ | Some "new states" are already values in existing string-union types (per AGENTS.md §3) |
| Live backlog | mcp__dpf__list_epics, mcp__dpf__list_backlog_items, mcp__dpf__query_backlog | Active epics + open BIs may already cover the work |
| Main-branch history | git log origin/main --oneline -- <topic-path> | Worktrees can be 100+ PRs behind; verify the spec's "not implemented" claim against origin/main |
| Specs and plans | mcp__dpf__search_specs_and_plans, or docs/superpowers/specs/ and docs/superpowers/plans/ directly | An approved design may already exist. The tool fails with spec_plan_corpus_unavailable on installs that ship no docs/superpowers tree (consumer and runtime-host images exclude it); that is not a no-match, so sweep a source checkout before concluding nothing exists |
| Canonical UI primitives | apps/web/lib/canonical-primitives.ts, apps/web/components/ui/report-kit/README.md; read_codebase_manifest().canonicalPrimitives; analyze_reusability surfaces matches | Reporting/data-display UI (status badges, tables, KPI cards, filters, charts) is a solved palette — compose report-kit, don't hand-roll (principle compose-report-kit-for-reporting-ux) |
kernel/principles/verify-substrate-before-proposing-new — this skill IS that principle, operationalized.kernel/principles/sweep-main-before-trusting-worktree-specs — the "spec says not implemented" trap; main may have shipped the substrate.kernel/principles/single-source-of-truth — duplicate substrate is the SSoT violation the principle was created to prevent.State the candidate noun. Be precise: "new model FeatureBuildArtifact" or "new enum value pending-review on BacklogItem.status" — not "new artifact tracking."
First sweep — Prisma schema, read from the merge target. The schema is SPLIT across packages/db/prisma/schema/*.prisma; a grep against the old monolithic packages/db/prisma/schema.prisma matches nothing and exits 0, which is indistinguishable from a real absence.
# confirm the path exists BEFORE trusting any null result (see "Null results" below)
ls packages/db/prisma/schema/*.prisma
# sweep the worktree
grep -rn "model <NameOfThing>" packages/db/prisma/schema/
grep -rn "<thing>" packages/db/prisma/schema/
# sweep the MERGE TARGET — the worktree may be many PRs behind main
git fetch origin main -q
git grep -n "model <NameOfThing>" origin/main -- packages/db/prisma/schema/
Prefer the origin/main sweep as authoritative: it answers "does this exist on the branch I will merge into", which is the question that matters. Check for: existing model with the same name; existing model with a column that would carry your concept; existing relation that already expresses the linkage.
Second sweep — code graph (currently degraded; corroborate, never conclude). Run mcp__dpf__search_code_graph({ query: "<noun>", limit: 10 }). A HIT is useful evidence. An EMPTY RESULT IS NOT EVIDENCE OF ABSENCE and must never be reported as one.
Per BI-86EF5900 the platform code graph is indexed from a non-default branch with 0/5 structural relationship types populated and a low trust tier, so it returns an empty array for models that are demonstrably on main. Confirm its state with mcp__dpf__get_code_graph_freshness and read the trust vector: if trust.tier is low or trust.action is qualify, treat every empty result from this graph as NO EVIDENCE and rely on the grep sweep above.
Restore this to the first sweep only once get_code_graph_freshness reports all five relationship types populated and lastIndexedBranch equal to the default branch.
Third sweep — type unions and enums.
grep -rn "type <NameOfThing>\\|enum <NameOfThing>" packages/db/src/ apps/web/lib/
Many candidate "new states" turn out to be values that should be added to an existing EPIC_STATUSES / BacklogItem.status / similar union (per AGENTS.md §3 strongly-typed string enums rule).
Fourth sweep — live backlog.
mcp__dpf__list_epics({ status: "open", hasOpenItems: true })
mcp__dpf__list_backlog_items({ /* relevant filters */ })
mcp__dpf__query_backlog({ /* keyword */ })
Active epics + open BIs covering the same noun mean the work is in-flight; coordinate, don't duplicate. Per feedback_pr_overlap_check_before_pushing, also sweep open PRs:
gh pr list --state open --limit 50
Fifth sweep — main-branch history.
git log origin/main --oneline -- <topic-path> --since="2 weeks ago"
If the worktree's spec says "research stub — not implemented" but origin/main shows commits landing the substrate in the last few days, the spec is stale. Per kernel/principles/sweep-main-before-trusting-worktree-specs, trust main over the worktree.
Decide.
A grep that matches nothing exits 0 whether the thing is genuinely absent or the path you swept is wrong, moved, or deleted. A tool that returns an empty array exits successfully whether the substrate is absent or the index behind it is stale. In both cases absence reads as evidence, which is the exact failure this skill exists to prevent.
Before recording any "X does not exist" conclusion:
ls the directory or file first. If it does not exist, your null result carries no information — fix the path and re-sweep.mcp__dpf__get_code_graph_freshness and read trust.tier / trust.action. A low tier or a qualify action means an empty result is NO EVIDENCE.git grep ... origin/main answers the question that actually matters.origin/main in packages/db/prisma/schema/" — never a bare "does not exist". The cite is what lets a reviewer catch a bad sweep.grep -v, --exclude, a suppression pattern chosen to cut noise — re-run it with NO exclusions and state the raw count. A filtered-to-zero result is indistinguishable from a real absence, and it reads as more rigorous than a plain grep because it cites a methodology.Worked failure (BI-FA950F74): an agent grepped packages/db/prisma/schema.prisma, a path deleted by the schema split, got silence, and reported PayRun and Payslip as missing. Both were already on main. The sweep was clean; the conclusion was false.
Worked failure (BI-5798BBA3): a brief recorded "Nothing in the repo queries /engines/_configure — confirmed by grep across apps, packages, scripts, docs; every hit is not_configured or user_configured." The path was right and the grep matched 95 times. The exclusion added to cut those two tokens removed every true hit along with them. Six source files queried the endpoint, including a boot-and-interval reconcile that already did the work the brief went on to recommend building. One grep -rc with no exclusions would have caught it.
**Substrate verification for `<noun>`.**
- Code graph sweep: <hits or "no match">
- Prisma schema sweep: <hits or "no match">
- Type/enum sweep: <hits or "no match">
- Live backlog sweep: <related epics/BIs or "no overlap">
- Open PR sweep: <related PRs or "no overlap">
- Main-branch sweep: <recent commits or "no recent activity">
**Verdict:** <substrate exists, extending | substrate exists but insufficient, citing <ref> | substrate truly absent, proceeding>
<If proceeding:> New substrate justified because <one-line gap statement>.
feedback_continuous_overlap_check is explicit: re-sweep before every push, not just session start.Authoring BI-90793048 (DPF skill pack formalization), the agent considered creating a new epic EP-AGENT-RULEBOOK. Verification sweep:
Skill (model), SkillDefinition, SkillAssignment, seed-skills.ts — substrate exists.model SkillDefinition and model SkillAssignment already exist (substrate for Surface B is fully in place).SKILL_LIFECYCLE_STATES enum exists for Hermes axis.EP-SKILL-001 ("AI Coworker Skills Marketplace") and EP-REDUCTION-GEAR-ARCH (priority 2, 67 items, substrate-consolidation framing) both cover adjacent territory.Verdict: substrate exists in adjacent epics; new epic would violate check-epic-overlap-before-creating. Parent chosen: EP-REDUCTION-GEAR-ARCH (operator-ratified in §5 question 1 of the BI memo). Saved one redundant epic and surfaced the right parent — exactly the failure mode this skill prevents.
verify-substrate-before-proposing-newsweep-main-before-trusting-worktree-specsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
88 skills in this plugin
/acquisition-brief-refreshKeep the acquisition brief current./ai-platform-posture-refreshReport AI platform and host health./architecture-alignment-sweepCompare delivered against recorded architecture./asset-inventory-reconciliationReconcile recorded against observed assets./books-period-advanceAdvance the open books period./build-sensitive-domain-requirementsBound sensitive-domain build requirements.npx claudepluginhub opendigitalproductfactory/opendigitalproductfactory --plugin dpf-platformOther plugins' skills for the same job