/dpf-platform:dpf-local-merge-ci-before-pushfrom dpf-platform
Runs a local merged-code verification gate before pushing or opening a DPF PR. Routes platform failures to recovery and classifies harness limitations vs gate failures.
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.
Run a local merged-code gate before pushing work that Build Studio or reviewers might treat as ready.
For a broken upgrade, unavailable MCP/portal/CI, permission denial or occupied break-fix lane, read recovery routing before the normal steps below. A recovery route preserves authorization and reports unrun gates honestly. Ordinary queue contention still waits.
The thread worktree is source-control isolation, not a runtime. The "isolated merge path" below is a merge workspace (clean checkout of origin/main + branch tip in a scratch directory so the merge result is reproducible) — it is NOT a second full DPF runtime stood up inside the worktree.
Run this skill's gates per AGENTS.md §5 "Where each gate runs":
tsc --noEmit, targeted unit specs, lint.If a gate cannot run in the worktree because pnpm/corepack is missing, workspace links point outside the worktree, the Prisma client wasn't generated there, or Next rejects symlinked node_modules — classify as harness limitation, not gate failure (worktree-is-source-control-not-runtime). Route the gate to the shared local-CI convergence sandbox via claim_nonprod_environment_lease(environmentKey="local-integration-ci") — one shared runtime that all worktrees lease sequentially — and capture that run's evidence in the PR. Per-worktree runnable runtimes don't scale at DPF's expected 1k–10k concurrent worktrees; the sandbox is the only tenable verification substrate.
kernel/principles/build-gate-mandatorykernel/principles/all-changes-land-via-prpnpm run pregate. Produce exact-tree gate evidence before semantic review; that reviewer resolves the gate record as its failure-analysis evidence. It does this whole skill mechanically — claims the local-integration-ci lease, runs the checked-in non-mutating runner (scripts/local-ci-runner.sh → the local-integration plan in a dedicated scratch worktree; DPF_LOCAL_CI_COMMAND overrides), records the MCP evidence, releases the lease, and writes the gate record the default-on pre-push hook checks. Only fall through to the manual steps below when pregate itself cannot run.main and is not detached.origin/main.pnpm-lock.yaml — node scripts/sandbox-freshness-preflight.mjs --converge (already part of the local-integration plan). Exit 3/4 means SANDBOX DRIFT / NOT READY: the sandbox is stale, the run is NOT product evidence, and the only repair is the preflight's own single governed pnpm install --frozen-lockfile convergence — never a manual or per-worktree install.passed, failed, conflict, or blocked_sandbox_drift (stale sandbox; carries the freshness verdict and resolved next/react/react-dom versions in evidence).pregate first waits for admission to the shared local-integration-ci lease. While it waits it prints local-CI admission queued at position N. The current wrapper returns exit code 7 for abandoned admission or a zero runner exit without a corroborating PASS at HEAD. A queued claim is pending evidence; resume its durable task rather than making repeated claims.
Confirm a real pass by the artifacts, not the exit code:
gate passed..git/worktrees/<name>/dpf-local-ci-metadata.json (path is echoed as [local-integration-ci] metadata …), and in that record candidateSha is the commit you are about to push and baseSha is the origin/main it merged against. Read execution.vitestCoverage for completed local coverage; missing or incomplete receipts remain unknown. evidencePlan describes planned policy, not tests executed.grep -v "admission queued" — if nothing but queue polling remains, nothing ran.Then push normally: with a valid record for the head SHA the pre-push hook admits the push, and DPF_SKIP_PREPUSH_GATE is not needed.
pnpm run pregate:status is the one read of where a gate stands, and its exit code is enough:
PASS — a pass is recorded for HEAD; push.PREFLIGHT / QUEUED / ADMITTED / RUNNING — a pregate for HEAD is still working; the output names its pid, stage and queue position. Wait and read again. It is not a failure, not a blocker, and not a reason to start another pregate (a second one in the same worktree is refused).FAIL is a recorded failing verdict about the diff; INCONCLUSIVE, STALE and NO-RECORD mean the gate did not grade this HEAD — follow the next line.If a foreground pregate's console stops updating, read pregate:status before concluding anything: the gate keeps running when the console you watched does not.
pregate in timeout. Interrupting it can abandon the local observer while its durable claim remains pending. Run it in the foreground, unpiped; use pnpm gate:wait for bounded observation without mistaking a queued exit for a verdict.DPF_SKIP_PREPUSH_GATE is for a verified-clean push the gate structurally cannot cover, and it is recorded either way.The gate records WHICH CLIENT and WHICH CLIENT THREAD ran it. It does not
default the provider — it used to default to codex, so every client of every
kind was recorded as Codex — and it does not derive the session from a pid,
which changed on every invocation and made one thread look like many
contributors.
Identity is detected from the calling client's own environment where possible. When it cannot be, pass it:
node scripts/gate-worktree.mjs --owner-provider claude --owner-session-id "$CLAUDE_CODE_SESSION_ID"
or set DPF_GATE_OWNER_PROVIDER / DPF_GATE_OWNER_SESSION_ID. An unresolvable
provider stops the run at the admission boundary, because the lease and the
evidence record share a closed vocabulary (build-studio | claude | codex | grok | antigravity | coworker) with no honest fallback. --dry-run needs no
identity and prints what it resolved, so it answers "will this be attributable,
and to whom?" before a lease is taken. An unresolvable thread does not stop
the run; it records unattributed-<pid> so the gap is visible rather than
invented.
Carry qualified publication evidence. pr:ready requires the PR body's
Local-CI-Evidence: reference to match a current qualified gate record, or an
existing authorized and truthful Local-CI-Override:. Carry the existing record
identifier; a missing trailer does not require another full gate. Keep lease and
session identifiers, worktree paths and detailed source/base identities in the
install's audit record. The detail remains queryable by PR number:
pnpm pr:origin 3748
That resolves the PR to every commit it contains and matches those against this install's own gate records — by SHA, not branch, because branch names are reused across threads and deleted on merge while commits are permanent. A PR this install never gated reports no origin rather than a guess, which is the correct answer for an outside contribution.
pregate:status (backed by gate passed plus a metadata record whose candidateSha matches your commit); its exit 75 means still working, never failed.blocked_sandbox_drift and converge first.dpf project.A feature branch passes focused Vitest tests but origin/main changed Build Studio actions. This skill runs the merge gate, catches the conflict before push, records "Merged-code gate failed: conflict with origin/main", and leaves the branch local until the conflict is resolved.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
88 skills in this plugin
/asset-inventory-reconciliationReconcile recorded against observed assets.npx claudepluginhub opendigitalproductfactory/opendigitalproductfactory --plugin dpf-platformOther plugins' skills for the same job