Production-ready configuration presets, system rules, metacognitive prompts, and Model Context Protocol (MCP) definitions to apply the DSpark Dual-Engine & Speculative Curation framework to any external project across any AI coding assistant or IDE (Antigravity, Claude Code, Cursor, Windsurf, Roo Code, Grok).
Tip
What is this repository?
This kit is the lightweight configuration layer designed to be dropped directly into your existing repositories or AI tools. It applies the dual-engine methodology (Creator + Curator) without needing to clone or modify the core DSpark engine repository.
Why do single-model AI coding setups consistently fail on subtle bugs and edge cases?
Academic research has rigorously proven that LLMs cannot reliably self-correct reasoning in the same autoregressive context ("Large Language Models Cannot Self-Correct Reasoning Yet", Huang et al., 2023; Stechly et al., 2024).
- When a model generates code and is subsequently asked "Are you sure this code is correct?", it suffers from confirmation bias. It rationalizes its own hallucinations and reaffirms flawed assumptions because both generation and review share the exact same attention context and token probability distribution.
DSpark breaks this echo chamber by pairing two completely distinct model families:
- Creator (e.g., Google Gemini / Anthropic Claude / OpenAI): Optimized for broad repository context, high throughput, and AST manipulation.
- Curator (e.g., DeepSeek v4 Pro / DeepSeek v4 Flash / OpenAI o-series / Local LLMs): Optimized for deep chain-of-thought mathematical reasoning and rigorous logical falsification.
- What lies in the pretraining and attention blind spots of Family A is easily caught by Family B.
Rather than asking for vague "code reviews", DSpark adapts formal verification methods:
- The Curator audits code against strict Input/Output (I/O) contracts, invariants, and boundary conditions.
- If a contract fails, the Curator synthesizes a deterministic counter-example (
failure_tail) which serves as ground-truth feedback for the Refiner engine.
graph TD
Developer([User / Developer]) -->|Task Specification| Creator[Creator: Gemini / Claude / GPT]
Creator -->|Drafts Code| CodeFile[Implementation File]
CodeFile -->|FastMCP Call / Hook| MCP[DSpark MCP Server]
MCP -->|Epistemically Isolated Audit| Verifier[Curator: DeepSeek v4 Pro / Flash]
Verifier -->|Traceback & Counterexamples| Refiner[DSpark CEGAR Refiner]
Refiner -->|1-Shot Surgical Patch| Creator
Verifier -->|Verdict: APPROVED| Success([Production Verified Code])
| Benefit | Single-Model Setup | DSpark Dual-Engine Setup |
|---|---|---|
| Edge-Case Bug Detection | β Misses subtle boundary conditions and off-by-one errors | β Caught deterministically via cross-family I/O arbitration |
| Hallucination Loops | β Model repeatedly generates similar failing code | β Broken immediately by concrete verifier counter-examples |
| Token & Cost Efficiency | β Expensive reasoning models used for simple boilerplates | β Fast/cheap creator + targeted reasoning verifier |
| Verification Autonomy | β Requires manual user code review and test writing | β Automated via MCP background hooks (No human fatigue) |
| Vendor Portability | β Locked to a single AI vendor | β Universal: Works across Google, Anthropic, DeepSeek, and Local LLMs |
dspark-agent-config/
βββ configs/
β βββ antigravity/ # Google Antigravity CLI / AGY plugin & hooks
β βββ claude-code/ # Claude Code & Desktop CLAUDE.md and MCP settings
β βββ cursor/ # Cursor .cursorrules and MCP configuration
β βββ grok/ # Grok Build CLI rules & MCP settings
β βββ windsurf/ # Windsurf Cascade .windsurfrules & MCP config
β βββ roo-code/ # Roo Code / Cline custom instructions & MCP
βββ scripts/
β βββ install.ps1 # 1-Click Windows installer
β βββ install.sh # 1-Click Linux / macOS installer
βββ README.md
- Run the automated installer:
(Or copy
.\scripts\install.ps1 -Target antigravityconfigs/antigravity/to~/.gemini/config/plugins/dspark/) - Ensure your DeepSeek API key is configured:
export DEEPSEEK_API_KEY="sk-..."
- Dual-engine curation is now active automatically on code creation and refinement.
- Repository Policy: Copy
configs/claude-code/CLAUDE.mdto the root of your project repository. - MCP Configuration: Add the DSpark server to your
claude_desktop_config.jsonor project MCP config:{ "mcpServers": { "dspark": { "command": "python", "args": ["-m", "dspark.mcp.server"], "env": { "DEEPSEEK_API_KEY": "sk-..." } } } }
- Copy
configs/cursor/.cursorrulesto your project root. - Open Cursor Settings
$\rightarrow$ Features$\rightarrow$ MCP Servers$\rightarrow$ Add New MCP Server:-
Name:
dspark -
Type:
command -
Command:
dspark mcp
-
Name:
- Copy
configs/windsurf/.windsurfrulesto your project root. - Add the DSpark MCP server from
configs/windsurf/mcp_config.jsoninto your Windsurf MCP settings.
- Copy
configs/roo-code/custom_instructions.mdinto your Custom Instructions tab. - Import
configs/roo-code/mcp_settings.jsoninto your MCP Server settings in Roo Code.
Grok Build auto-discovers repository instructions and MCP servers:
- Repository Policy: Place
configs/grok/GROK.mdin your project root. - MCP Configuration: Add DSpark MCP to
~/.grok/config.toml(or.grok/config.toml):[mcp_servers.dspark] command = "python" args = ["-m", "dspark.mcp.server"] env = { DEEPSEEK_API_KEY = "sk-..." }
DSpark's Curator engine is 100% model-agnostic:
| Model / Provider | Required Variables |
|---|---|
| DeepSeek v4 Pro (Recommended) | DSPARK_CURATOR="deepseek-v4-pro"DEEPSEEK_API_KEY="sk-..." |
| DeepSeek v4 Flash (Fast/High-Throughput) | DSPARK_CURATOR="deepseek-v4-flash"DEEPSEEK_API_KEY="sk-..." |
| OpenAI (o3-mini / GPT-4o) | DSPARK_CURATOR="o3-mini"OPENAI_API_KEY="sk-..." |
| Anthropic (Claude 3.7 Sonnet) | DSPARK_CURATOR="claude-3-7-sonnet-20250219"ANTHROPIC_API_KEY="sk-ant-..." |
| Local LLMs (LM Studio / Ollama / vLLM) | DSPARK_CURATOR="qwen2.5-coder-32b"OPENAI_API_BASE="http://localhost:1234/v1"OPENAI_API_KEY="lm-studio" |
Note
This repository is the companion configuration kit for DSpark. The underlying dual-engine architecture is inspired by the seminal speculative decoding research from DeepSeek-AI & Peking University (DSpark, 2026) and Kwok et al. (LLM-as-a-Verifier, 2026), elevated to multi-agent software engineering and extended with Kimi Linear / Kimi Delta Attention (KDA)-inspired agent memory (delta-rule, per-channel decay, key-bound rank-1 updates).
MIT License. Feel free to use, modify, and distribute across all your coding environments.