deepseek-provider-contract
Validate a proposed DeepSeek API integration before any key or project context is sent: check thinking-mode tool-call history, strict-schema assumptions, bounded output, and provider data boundaries. Use when integrating DeepSeek, adding DeepSeek tool calls or streaming, debugging DeepSeek 400 after a tool call, or evaluating a DeepSeek harness/MCP. Do NOT use for a generic model comparison, ordinary local coding, or to send a repository transcript to a provider by default.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 214
- Forks
- 32
01 前言 Front Matter
- name
- deepseek-provider-contract
- description
- Validate a proposed DeepSeek API integration before any key or project context is sent: check thinking-mode tool-call history, strict-schema assumptions, bounded output, and provider data boundaries. Use when integrating DeepSeek, adding DeepSeek tool calls or streaming, debugging DeepSeek 400 after a tool call, or evaluating a DeepSeek harness/MCP. Do NOT use for a generic model comparison, ordinary local coding, or to send a repository transcript to a provider by default.
02 资源文件 2
03 SKILL.md 正文
DeepSeek Provider Contract
This is a local, offline contract check. It neither reads DEEPSEEK_API_KEY nor
sends code, transcripts, or secrets. A third-party harness is an implementation
candidate, not a trusted route.
Use It In This Order
-
Classify the proposed prompt/data. Private archive, credentials, customer data, and whole transcripts stay local unless the user explicitly authorizes that provider and scope.
-
Freeze the provider model, endpoint, request budget, and fallback in the integration plan. Do not inherit defaults from a community wrapper.
-
Save a redacted request-history fixture that explicitly declares whether the outbound request carries tools, then run:
The fixture shape is
{"outbound_request":{"tools":[...]},"messages":[...]}; use"tools": []only for an outbound tools-free request.python skills/operational/deepseek-provider-contract/scripts/validate_deepseek_history.py fixture.json -
Run the provider only in a bounded, opt-in experiment. Record model, endpoint, max output, cache-usage fields, request digest, and observed result.
-
Compare against the incumbent on the same frozen task before adding any route to a workflow. A passing history fixture proves message lifecycle only; it does not prove quality, price, availability, or data handling.
Required Invariants
- In thinking mode with tools, preserve the provider's complete assistant
message, including
reasoning_contentandtool_calls. Do not rebuild a reduced assistant message fromcontentalone. - Each tool result has the exact prior
tool_call_id. - While a request carries
tools, retain the documentedreasoning_contentfrom prior assistant turns in its history. Do not reduce this to only the most recent tool-call turn; check the current provider documentation because model and endpoint semantics change. - Use strict schema only with the beta endpoint and only after validating the supported JSON Schema subset. Never call a schema "strict" merely because it looks valid locally.
- Set output bounds explicitly and make cache hits/misses observability, not a correctness promise.
Adoption Decision
Adopt a DeepSeek route only when all are true:
- The offline history validator and its regression tests pass.
- A redacted live canary succeeds with the exact frozen integration.
- The frozen benchmark beats or materially supplements the current route.
- Provider data scope and failure fallback are written down.
Otherwise keep this skill and the fixture only; do not install a global MCP.
Gotchas
- For a tools-bearing request, the current DeepSeek documentation requires the
prior assistant
reasoning_content; a tools-free request has different context semantics. Treat the offline validator as a narrow fixture check, not a substitute for the live API contract. - A response can say cache-hit while quality or latency still changes; measure those separately.
- A history normalizer that strips
reasoning_contentcan make the next tools-bearing request request fail with HTTP 400 even if the first request succeeded. - Model names, limits, pricing, and beta semantics are provider facts: re-check the official documentation at the integration date.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| HTTP 400 after a tool result | Assistant reasoning was discarded | Preserve the complete assistant tool-call message and rerun the validator |
| Tool JSON is rejected in strict mode | Wrong endpoint or unsupported schema | Use the beta endpoint, validate the schema subset, or turn strict mode off |
| Wrapper works once then loses context | History was normalized too aggressively | Compare its persisted fixture with the provider contract |
| Temptation to add global MCP | Scope and data boundary were skipped | Keep it opt-in until a frozen canary and benchmark pass |
Sources
04 同仓库更多 Skills
owner-voice
暂无简介
humanize-russian
Редактировать русский текст для ясности и естественного звучания, сохраняя факты, термины, источники и жанр. Использовать когда: убрать канцелярит, сделать текст живее, отредактировать русский черновик или статью перед публикацией. Не определяет авторство и не обещает обход детекторов. Для английского — humanize-english; для структуры и доказательств — article-structure-review.
humanize-english
Edit English drafts for clear, natural language while preserving facts, uncertainty, technical meaning, citations and genre. Use when: humanize this text, remove AI-style filler, improve English prose, or edit an English article before publication. Not an authorship detector or a promise to bypass one. For Russian use humanize-russian; for thesis/evidence and structure use article-structure-review.
caveman
Ultra-compressed reply mode. Cuts output tokens ~65-75% by answering in terse "caveman" style while keeping full technical accuracy, and shapes what survives: action first, state restated every turn, concrete time estimates, visible wins. Intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman", "talk like caveman", "use caveman", "less tokens", "be brief", or Russian "пещерный режим", "говори как пещерный", "кратко", "меньше токенов", "экономь токены" — or invokes /caveman. Preserves the user's language (Russian in → Russian caveman out). Off only: "stop caveman" / "normal mode" / "обычный режим". Do not use merely because a response should be concise, and do not use when the user requests normal prose, a polished document, or exact wording.
article-structure-review
Проверить структуру технической статьи после черновика: задача читателя, жанр, опора значимых утверждений на доказательства и честные ограничения. Use after the first draft, before publication. Исправлять структуру, когда это входит в запрос; не создавать обязательный конвейер из других навыков. Для локальной языковой редактуры — humanize-english или humanize-russian.
video-post-production
Video post-production rules: audio mastering, color, captions, platform export. Use when: 'add music', 'add voiceover', 'export for tiktok', 'add captions', 'color grade', 'audio levels', 'master audio', 'export settings', 'platform requirements'. Covers FFmpeg patterns, audio chain, subtitle standards, and platform-specific export configs. Do NOT use to generate or animate the video frames/scenes in code (use remotion-production-guide), to write the script (use video-narrative-arc), or to evaluate script quality (use script-evaluator); this is the finishing stage applied to an already-rendered video.