dsh-pre-push-checks
Skill1 starsChanged 15 days agoMITView on GitHub
Use before pushing, force-pushing, marking ready for review, or claiming checks pass on a deepseek-harness branch, and immediately after gh stack sync publishes rewritten branches, to select the smallest tests and checks that cover the outgoing or just-published diff without reflexively running the full repository suite.
12 other projects use a version of this, 9 of them edited.
Adopted by
Most recently taken up by
- qufei1993/skills-hubtheir own version, first seen Nov 1, 2026
- ZeroOnehub/aipm-workbenchword for word, first seen Nov 1, 2026
- See-Sol-Lab/DeepSeekGUIedited, first seen Oct 18, 2026
- Haifai-AI/baby-whaleedited, first seen Oct 13, 2026
- pawaca/dsh-edgetheir own version, first seen Oct 11, 2026
- xinyuquan985-coder/deepseek-harness-neonedited, first seen Sep 26, 2026
Used with
Projects with it also use dsh-doc-site-sync and dsh-doc-standards.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
lucaslusSkilldsh-doc-site-sync
Use when publishing, updating, moving, or removing DeepSeek Harness documentation website pages; editing website/docs.ts mappings or navigation; diagnosing a page missing from the VitePress site; fixing projected documentation links; or running the docs:dev, docs:check, and doc-sync workflow after website-content changes.
Also in 5 projects that use this
lucaslusSkilldsh-doc-standards
Use when writing, moving, reviewing, or auditing documentation in the deepseek-harness repo — choosing hierarchy and detail, separating tutorials from references, checking tutorial progression, trimming doc slop, responding to a verify-doc-budgets failure, or requests like "improve the docs", "audit the docs", "where should this be documented", or "this doc is too long".
Also in 5 projects that use this
Other versions12 projects use a version of this.
Word for word · 1
- ZeroOnehub/aipm-workbench★ 2100% same
Edited · 9
- deepseek-ai/deepseek-harness★ 282k92% same
- See-Sol-Lab/DeepSeekGUI★ 27497% same
- SuperJJ007/papermachine★ 5999% same
- xinyuquan985-coder/deepseek-harness-neon★ 1798% same
- Haifai-AI/baby-whale★ 199% same
- lucaslus/dsh-desktop★ 199% same
- SparkElf/deepseek-harness-plus★ 199% same
- SuperMate-Ai/SuperMate-Harness-System★ 198% same
- Ydjin1984/DeepSeek_Kibborg_Harness★ 194% same
Wrote their own version · 2
- qufei1993/skills-hub★ 1.9ksame name
- pawaca/dsh-edge★ 30same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/notes/AGENTS.mdAGENTS.md
- .agents/notes/archived/AGENTS.mdAGENTS.md
- .agents/notes/implemented/AGENTS.mdAGENTS.md
- benchmarks/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- packages/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- snapshots/AGENTS.mdAGENTS.md
- vendor/AGENTS.mdAGENTS.md
- website/AGENTS.mdAGENTS.md
- agent-experienceSkill
- dsh-archive-agent-notesSkill
- dsh-ci-test-reliabilitySkill
- dsh-client-ui-uxSkill
- dsh-code-reviewSkill
- dsh-docSkill
- dsh-find-simplificationsSkill
- dsh-merging-stacked-prsSkill
- dsh-prose-standardSkill
- dsh-speed-up-perfSkill
- dsh-translate-docsSkill
- dsh-trim-cot-leakageSkill
- record-browser-gifSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 14 are common, 1 is distinctive, and 4 are very specific to this project.
14
Common
Most of the 10 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Common: line 19
Verify the live PR base or stack parent, fetch that ref, and inspect the complete scope against it.
- Distinctive: line 31
When the outgoing change adds or changes a resource-owning or asynchronous test, fixture, helper, or CI execution path, use …
- Common: line 33
Package or script behavior: run the owning Vitest file or focused test name.
- Common: line 36
Model-, editor-, CLI-, or terminal-visible output: run the focused keyless snapshot or real runnable-example scenario that owns the output.
- Very specific: line 40
Real provider or agent behavior: run the relevant pnpm run test:e2e target when credentials are available.
- Common: line 42
Do not manually repeat a passing check merely because commit or push follows.
- Very specific: line 62
Use an exact source file when the behavior is truly confined to one module.
- Common: line 64
When the owning tests are unclear, use Vitest's dependency graph to discover a candidate set, then inspect the selected tests before …
- Common: line 83
After any rewritten push, fetch the live heads again and re-audit unresolved review threads, approvals, mergeability, and checks.
- Common: line 91
Run the relevant evidence selected by this skill for each affected layer.
- Common: line 92
Keep every PR unmerged and report validation as pending until all selected checks pass.
- Common: line 94
If post-sync evidence fails, leave the lease-protected published heads in place, repair the failure, validate the repair, and publish the …
- Common: line 98
If a relevant check fails before an ordinary push, stop and fix or explain the blocker.
- Common: line 100
If a failure looks environment-specific, prove it:
- Common: line 104
Prefer fixing cross-platform nondeterminism when the check is required.
- Common: line 111
Run the selected relevant checks once.
- Common: line 112
Commit normally and inspect any files changed by the pre-commit fixer before continuing.
- Very specific: line 114
Verify the remote ref matches local HEAD.
- Very specific: line 128
When gh pr checks reports "no checks reported" and /actions/runs?head_sha=<sha> returns total_count: 0, read mergeability before suspecting …
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DSH Pre-Push Checks
Use this skill to run relevant local evidence once before a deepseek-harness push. The sole ordering exception is gh stack sync, which may publish a cascading rebase before the rewritten layers can be validated; validate them immediately afterward and do not merge until the evidence passes. Git hooks are intentionally narrow: pre-commit fixes staged lint, checks staged whitespace, and guards vendored-source metadata; pre-push runs only the incremental repository typecheck. CI owns exhaustive coverage and the platform matrix.
Inspect the outgoing change
- Confirm the checkout and branch.
git status --short --branch
git rev-parse --show-toplevel- Verify the live PR base or stack parent, fetch that ref, and inspect the complete scope against it.
pnpm --silent run change-scope --base <verified-base-ref>The command never guesses or fetches a base. Supply the ref verified from current remote or stack state; use --head <ref> when inspecting a commit other than HEAD. Its versioned JSON records committed paths relative to the resolved merge base, while staged, unstaged, and untracked paths describe the current worktree. After merging a changed base, rerun the report, reassess which behavior the combined scope can affect, and rerun only checks invalidated by the merge.
Select relevant evidence
There is no universal local baseline beyond the hooks. Every behavior change needs the narrowest available test or purpose-built check that would fail for its regression; add broader checks only for surfaces the diff actually reaches.
When the outgoing change adds or changes a resource-owning or asynchronous test, fixture, helper, or CI execution path, use dsh-ci-test-reliability first to decide whether restoration, negative-control, quiescent-teardown, or concurrent-process evidence applies. This skill still selects the commands and avoids repeating evidence that already passed.
- Package or script behavior: run the owning Vitest file or focused test name. Add adjacent package tests when a shared contract changes; leave repository-wide coverage to CI unless the change is genuinely cross-cutting or the user requests it.
- Remote mock typing: unbuilt
anyis an explicit local fallback, not strict evidence. Runpnpm run typecheckbefore handing off Remote/mock changes; rebuild missing, stale, or partial generated declarations before diagnosing remaining errors. Keep the exception in the test proxy, never in production Remote types, ambient flags, or copied signatures. - Documentation, Agent Notes, catalogs, or doc-linked comments: run
pnpm run doc-sync; run full lint when the documentation workflow requires it. - Model-, editor-, CLI-, or terminal-visible output: run the focused keyless snapshot or real runnable-example scenario that owns the output.
- Expected-output placement: a test whose selected recorded Session generation is replay input and expected persisted output belongs under top-level
snapshots/, withsnapshot.ymlnaming its shippeddshprofile and composition/header pin. Canonical parent files aresession[.vN].jsonl, children aresession.<ordinal>[.vN].jsonl, and the harness selects the highest generation per role. ARIA, geometry, generator, CLI, and unit expectations without that Session round trip stay beside their owning test undertests/expected/; do not place them insnapshots/or give them a*.snapshot.tsowner. Use the owningtest:expected,test:web, ortestlane. - Profile and configuration placement: cross-package behavior of a shipped
dshprofile belongs underapps/cli/tests/profiles/; a package-specific Loader composition belongs under that package'stests/fixtures/. User-facing optional overlays live underapps/cli/config/examples/and pair with a guide underdocs/user/. - Package manifests, public exports, build configuration, worker/bin entries, or built runtime paths: run
pnpm run build, the relevant hygiene checks, and the owning built-artifact smoke. - Real provider or agent behavior: run the relevant
pnpm run test:e2etarget when credentials are available; never print secrets.
Do not manually repeat a passing check merely because commit or push follows. In particular, do not run typecheck immediately before pushing solely to duplicate the pre-push hook.
Pass Vitest file and name filters directly after the script name with pnpm run; do not insert a standalone --, which reaches Vitest and can disable -t filtering. For example, this command runs one headless snapshot scenario:
pnpm run test:snapshot snapshots/session/headless.snapshot.ts -t 'cordis-inspect-jsdoc'This applies to these pnpm scripts; npm and other launchers retain their own argument-forwarding syntax. Check the reported selected test count before treating a filtered run as focused evidence.
Focus unit coverage on the affected source
Test selection and coverage selection are separate. A Vitest file filter chooses which tests run, while the repository configuration otherwise measures every packages/*/*/src/**/*.ts file. When unit coverage is relevant, name both the owning tests and the source files or package whose coverage those tests must prove:
pnpm exec vitest run packages/<group>/<package>/tests/<behavior>.spec.ts \
--coverage \
--coverage.include='packages/<group>/<package>/src/**/*.ts'Use an exact source file when the behavior is truly confined to one module. Repeat --coverage.include for multiple affected files or packages, and pass every owning test file needed to exercise that scope. The configured per-file 100% thresholds still apply inside the selected source scope.
When the owning tests are unclear, use Vitest's dependency graph to discover a candidate set, then inspect the selected tests before treating the run as evidence:
pnpm exec vitest related packages/<group>/<package>/src/<changed>.ts \
--run \
--coverage \
--coverage.include='packages/<group>/<package>/src/<changed>.ts'vitest related cannot discover behavior reached only through configuration, dynamic loading, subprocesses, workers, built artifacts, or external providers; select those owning tests explicitly. Do not use --passWithNoTests, lower coverage thresholds, or narrow --coverage.include merely to hide an uncovered affected file. If a selected package scope fails because one focused test does not cover it, add its other relevant owning tests or narrow the source scope only when the excluded modules cannot be affected by the change.
Full local rehearsal
Run the complete local approximation only when the user explicitly requests it, while diagnosing a CI failure, or when the change spans the repository so broadly that no narrower set is credible. Use the current workflow and package scripts as the inventory; do not recreate the removed check:pre-push aggregate.
Protect history-rewriting pushes
Rebase is allowed for standalone and stacked PR branches, including after review. Before a standalone history rewrite, fetch the current remote branch and record its exact OID; publish with --force-with-lease=<branch>:<observed-oid> so a concurrent update aborts the push. gh stack push and gh stack sync supply lease protection for their managed branches. Raw --force is never allowed.
After any rewritten push, fetch the live heads again and re-audit unresolved review threads, approvals, mergeability, and checks. Commit hashes and inline-comment anchors from before the rewrite are not current evidence.
Post-sync validation
gh stack sync fetches, cascade-rebases, and pushes as one operation, so it cannot place local validation between rewrite and publication. Before running it, require a clean worktree and record the official stack order and exact remote heads. After it returns:
- Re-query every branch head and the official GitHub stack order.
- Inspect the changed scope of every rewritten layer against its live PR base.
- Run the relevant evidence selected by this skill for each affected layer.
- Keep every PR unmerged and report validation as pending until all selected checks pass.
If post-sync evidence fails, leave the lease-protected published heads in place, repair the failure, validate the repair, and publish the correction. Do not claim the sync made the stack ready merely because the command succeeded.
Handle failures
If a relevant check fails before an ordinary push, stop and fix or explain the blocker. Do not push and hope CI differs. For the post-sync exception, block the merge and follow the repair procedure above.
If a failure looks environment-specific, prove it:
- Record the exact command, failing test, and platform-specific mismatch.
- Confirm the relevant non-platform evidence.
- Prefer fixing cross-platform nondeterminism when the check is required.
- Bypass a local hook only when the user explicitly asks or agrees, and report exactly what failed and why CI is expected to differ.
Push procedure
For ordinary and standalone rebase pushes:
- Run the selected relevant checks once.
- Commit normally and inspect any files changed by the pre-commit fixer before continuing.
- Push normally, or use the exact lease for an authorized rewritten branch, so the incremental typecheck hook runs.
- Verify the remote ref matches local
HEAD.
git rev-parse HEAD origin/$(git branch --show-current)For GitHub PRs, inspect remote CI after the push:
gh pr checksReport pending checks as pending. Inspect failures before attributing them to the branch or the environment.
When gh pr checks reports "no checks reported" and /actions/runs?head_sha=<sha> returns total_count: 0, read mergeability before suspecting the push or a dropped GitHub event:
gh pr view <number> --json mergeable,mergeStateStatusGitHub creates no pull_request workflow runs while a PR is CONFLICTING/DIRTY, so the absent signal is the conflict, not infrastructure. Resolving the conflict is the only fix; empty commits, --allow-empty pushes, draft/ready toggles, and revert-and-restore bounces all leave total_count at zero and add junk history. Confirm the conflicting paths with git merge-tree --write-tree HEAD origin/<base> when the branch cannot be merged locally yet.
For gh stack sync, use the post-sync validation sequence instead of pretending the ordinary order was possible.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

