跳到主要内容

dsh-pre-push-checks 精选

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.

在 GitHub 打开

安装方式

cp -r .agents/skills/dsh-pre-push-checks ~/.claude/skills/dsh-pre-push-checks

把该 skill 目录放进客户端 skills 目录。不同客户端的目录可能不同,Claude Code 默认是 ~/.claude/skills/

整仓一次性获取:git clone --depth 1 https://github.com/deepseek-ai/deepseek-harness.git

依赖与权限

  • 无需 API Key
  • 无需联网
  • 依赖外部命令:git npm pnpm gh
  • 以上为按正文与 frontmatter 自动推断的信号,仅供参考;安装前建议先阅读原文。

SKILL.md 正文

来源 deepseek-ai/deepseek-harness@d743267 · 许可 MIT · 内容未修改

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

  1. Confirm the checkout and branch.
git status --short --branch
git rev-parse --show-toplevel
  1. 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](../dsh-ci-test-reliability/SKILL.md) 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 any is an explicit local fallback, not strict evidence. Run pnpm run typecheck before handing off Remote/mock changes; rebuild missing, stale, or partial generated declarations before diagnosing remaining errors. Keep the exception in the [test proxy](../../../packages/test-support/remote-mock/README.md#remote-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/, with snapshot.yml naming its shipped dsh profile and composition/header pin. Canonical parent files are session[.vN].jsonl, children are session.<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 under tests/expected/; do not place them in snapshots/ or give them a *.snapshot.ts owner. Use the owning test:expected, test:web, or test lane.
  • Profile and configuration placement: cross-package behavior of a shipped dsh profile belongs under apps/cli/tests/profiles/; a package-specific Loader composition belongs under that package's tests/fixtures/. User-facing optional overlays live under apps/cli/config/examples/ and pair with a guide under docs/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:e2e target 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:

  1. Re-query every branch head and the official GitHub stack order.
  2. Inspect the changed scope of every rewritten layer against its live PR base.
  3. Run the relevant evidence selected by this skill for each affected layer.
  4. 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:

  1. Run the selected relevant checks once.
  2. Commit normally and inspect any files changed by the pre-commit fixer before continuing.
  3. Push normally, or use the exact lease for an authorized rewritten branch, so the incremental typecheck hook runs.
  4. 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 checks

Report 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,mergeStateStatus

GitHub 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.

质量与来源

所属仓库
deepseek-ai/deepseek-harness
仓库星标
25 万
最近更新
3 天前
采集时间
今天
commit
d74326738864
内容指纹
sha256:7091f3061de122d
文件路径
.agents/skills/dsh-pre-push-checks/SKILL.md

同仓库其它 Skill

查看全部 28 个
agent-experience
Use when writing or changing a model-facing tool definition (name, description, parameter schema, or its system-prompt section), and when designing skills, context loading, or multi-step workflows, to make information discoverable and use context efficiently.
精选 deepseek-ai/deepseek-harness 25 万 原文
Claude CodeCodex CLIMCP 客户端
dsh-archive-agent-notes
Use when adding, auditing, pruning, archiving, restoring, or reviewing Agent Notes in deepseek-harness; checks every new note for superseded active records, deletes small UI and purely mechanical records, classifies other implemented notes by future decision value, deletes rejected notes that no longer prevent a tempting fallacy, and applies the frozen archived/{kind} triplet and manifest rules.
精选 deepseek-ai/deepseek-harness 25 万 原文
Claude CodeCodex CLIMCP 客户端
dsh-ci-test-reliability
Design, review, and diagnose DeepSeek Harness tests and fixtures that can fail nondeterministically under CI concurrency, shared host resources, clocks, process-global state, subprocesses, network listeners, or asynchronous teardown. Use when adding or changing tests with those risks, investigating flaky CI, or reviewing test isolation; use dsh-pre-push-checks separately to select outgoing commands.
精选 deepseek-ai/deepseek-harness 25 万 原文
Claude CodeCodex CLIMCP 客户端
dsh-client-ui-ux
Design and review DeepSeek Harness client UI changes — visual token discipline, reuse-before-adding, feedback surfaces (toast vs in-place notice vs empty state), overlay and menu safety, platform window adaptation, loading states, and error copy placement. Use when adding or changing product-user-visible GUI behavior in packages/client, or when reviewing such a PR.
精选 deepseek-ai/deepseek-harness 25 万 原文
Claude CodeCodex CLIMCP 客户端
dsh-code-review
Use when reviewing a pull request in the deepseek-harness repo — orients the reviewer to this codebase's standards (AGENTS.md conventions, defensive patterns, ADRs, quality gates) and the review-specific checks that code alone can't show
精选 deepseek-ai/deepseek-harness 25 万 原文
Claude CodeCodex CLIMCP 客户端
dsh-create-upgrade-guide
Use when a deepseek-harness change breaks an externally perceptible surface (CLI, profiles, cordis.yml or settings keys, persisted user data, SDK or wire APIs, published package entry points), or when changing a surface that an unreleased upgrade guide already covers, to write or update docs/upgrade-guide/v<version>/<item>/guide.md.
精选 deepseek-ai/deepseek-harness 25 万 原文
Claude CodeCodex CLIMCP 客户端

相似 Skill

更多「写作」
interview-prep
Prepares the user for a specific interview from their real experience. Builds a story bank in Situation/Task/Action/Result/Reflection form mapped to the competencies the role and company test (such as Amazon's Leadership Principles), writes a cited company and role brief from public sources, predicts questions per round, drafts opener, why-us, weakness and salary answers, prepares questions to ask and a logistics checklist, and runs a post-interview debrief. Use when the user says "help me prepare for my interview", "I have an interview tomorrow" or "in 2 hours", "build my story bank", "STAR stories", "interviewing as a career changer", "what will they ask me", "how do I answer tell me about yourself", "questions to ask the interviewer", "research the company" or "debrief my interview". Uses Reactive Resume MCP tools when connected. For scored role-play practice, mock-interview; for thank-you notes and tracking, job-application-manager; for a salary number, offers or negotiation, offer-negotiation.
精选 reactive-resume/reactive-resume 4.4 万 原文
Claude CodeCodex CLIGemini CLI
job-application-manager
Runs the job-search pipeline. Adds jobs from a link or pasted posting, keeps stages and dates accurate, sets follow-ups, runs a weekly review (stale applications, next actions, funnel stats), records the exact resume version sent, and drafts networking, LinkedIn, referral, recruiter-reply, follow-up, thank-you, status-check, expedite and withdrawal messages without sending them. Use when the user says "add this job to my tracker", "I applied", "log my interview", "I got rejected", "I was ghosted", "log my offer", "track my applications", "do my weekly review", "what should I follow up on", "write a thank-you note", "message this recruiter", "ask for a referral", "withdraw my application", or wants a job-search spreadsheet. Works with a Markdown/CSV tracker or Reactive Resume MCP tools. Not for resume work (resume-tailor, resume-bullet-writer, resume-content-guide), interview prep or practice (interview-prep, mock-interview), or judging, negotiating, accepting or declining an offer (offer-negotiation).
精选 reactive-resume/reactive-resume 4.4 万 原文
Claude CodeCodex CLIGemini CLI
mock-interview
Runs a mock interview for a specific job description. Plays the interviewer in a chosen round (recruiter screen, hiring manager, behavioral, coding, system design, case, product sense, panel), persona and difficulty; asks one question at a time, probes vague answers, and gives quote-backed rubric scores after each answer (coach mode) or at the end (realistic). Model answers use only the user's real experience. Use when the user says "mock interview me", "interview me for this job", "practice interview", "pretend you're the interviewer", "grill me for this role", "run a behavioral round", "quick recruiter screen", "hiring-manager mock", "system design mock" or "case interview practice". With Reactive Resume MCP it reads the application and stories and logs the session. For a story bank, company brief, questions to ask or a real-interview debrief, interview-prep; for scheduling or thank-you notes, job-application-manager; for fixing the resume, resume-tailor; for negotiation practice, offer-negotiation.
精选 reactive-resume/reactive-resume 4.4 万 原文
Claude CodeCodex CLIGemini CLI
offer-negotiation
Evaluates and negotiates job offers. Decodes base, bonus, equity, sign-on, level and terms with unknowns kept unknown and each offer in its own currency, benchmarks against checkable pay data, finds true leverage, drafts one counter as email and call script, role-plays the recruiter, and handles the salary-expectations number, deadlines and extensions, "best and final", competing offers, counteroffers and written acceptance or decline. Country-aware (India CTC, 13th-month pay, public-sector scales). Use when the user says "I got an offer of...", "is this offer good", "should I negotiate", "how do I counter", "compare my offers", "what is my equity worth", "they asked my salary expectations", "they want an answer by Friday", "can I ask for more time", "should I accept" or "practice the negotiation call". Uses Reactive Resume MCP tools when connected. For logging the offer, its deadline and withdrawal notes, job-application-manager; for other interview answers, interview-prep.
精选 reactive-resume/reactive-resume 4.4 万 原文
Claude CodeCodex CLIGemini CLI
resume-builder
Builds a complete resume from scratch as Reactive Resume JSON that conforms to the schema and imports at https://rxresu.me. Asks for each missing detail instead of inventing it, then produces valid JSON (UUIDs, HTML descriptions, template and layout). Use when the user wants to create, build or generate a new resume, turn their work history into Reactive Resume JSON, or asks about the Reactive Resume schema, sections, templates or layout. For what belongs on a resume or a resume audit use resume-content-guide; for rewriting bullets, resume-bullet-writer; for fitting one job posting, resume-tailor; for tracking applications, job-application-manager; for interviews, interview-prep or mock-interview.
精选 reactive-resume/reactive-resume 4.4 万 原文
Claude CodeCodex CLIGemini CLI
resume-bullet-writer
Turns resume duties into truthful impact bullets. Questions the user role by role to dig out achievements, asks for real numbers or honest ranges (never invents them), and writes concise bullets in XYZ, CAR, scope or qualitative form. Use when the user says "rewrite my bullets", "make this bullet stronger", "quantify my resume", "turn my duties into achievements", "improve my experience section", "my resume sounds boring", "I don't have any numbers", pastes resume lines for feedback, or works in a low-number job (nursing, teaching, care, trades, admin, creative). With the Reactive Resume MCP server connected, it edits experience, project, volunteer and education descriptions with apply_resume_patch after the user approves. Use resume-content-guide instead for which sections or details belong and for summaries or headlines, resume-tailor to fit one job posting, interview-prep or mock-interview for interview stories and practice, and resume-builder to build a resume from scratch.
精选 reactive-resume/reactive-resume 4.4 万 原文
Claude CodeCodex CLIGemini CLI