deepseek-provider-contract
Skill213 starsChanged 3 days agoMITView on GitHub
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.
- Reads credentials
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Run the provider only in a bounded, opt-in experiment.
- Distinctive: line 45
Use strict schema only with the beta endpoint and only after validating the supported JSON Schema subset.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
Other versions1 project uses a version of this.
Word for word · 1
- AnastasiyaW/claude-code-config★ 213100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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 repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-harness-designSkill
- agents-best-practicesSkill
- diffusion-engineeringSkill
- flux2-klein-promptingSkill
- flux2-lora-trainingSkill
- forensic-prompt-compilerSkill
- ml-research-labSkill
- notebooklm-grounded-researchSkill
- vlm-segmentationSkill
- feature-newSkill
- harness-designSkill
- layer-newSkill
- plan-swarm-reviewSkill
- pixel-art-storyboardSkill
- pixel-art-studioSkill
- architecture-firstSkill
- architecture-qualitySkill
- bug-reproducerSkill
- code-complexitySkill
- control-cliSkill
- control-uiSkill
- deep-reviewSkill
- deslopSkill
- distill-feedbackSkill
- harness-feedbackSkill
- proof-verifySkill
- refactoring-safelySkill
- repo-mapSkill
- root-cause-deliverySkill
- system-and-data-designSkill
- testing-strategySkill
- thermo-nuclear-code-quality-reviewSkill
- verify-thisSkill
- workflow-orchestrationSkill
- frontend-designSkill
- motion-framerSkill
- ui-designSkill
- ui-ux-pro-maxSkill
- ios-developmentSkill
- lean-codeSkill
- cross-harness-continuationSkill
- desktop-sessions-discoverySkill
- epistemic-challengeSkill
- gemini-delegateSkill
- harness-auditSkill
- observability-monitoringSkill
- remote-compute-opsSkill
- plan-to-ticketsSkill
- product-meaning-extractorSkill
- remotion-production-guideSkill
- script-evaluatorSkill
- video-narrative-arcSkill
- video-post-productionSkill
- article-structure-reviewSkill
- cavemanSkill
- humanize-englishSkill
- humanize-russianSkill
- owner-voiceSkill
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.

