Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ›οΈ DSpark Universal Dual-Engine Agent Configuration Kit

License: MIT MCP DSpark Core

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.


πŸ”¬ Scientific & Empirical Foundation: Why Dual-Engine?

Why do single-model AI coding setups consistently fail on subtle bugs and edge cases?

1. The Self-Correction Fallacy (Huang et al., 2023)

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.

2. Cross-Family Inductive Bias Diversity

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.

3. CEGAR (Counterexample-Guided Abstraction Refinement) & I/O Contracts

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])
Loading

🌟 Tangible Developer Benefits

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

πŸ“ Repository Structure

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

πŸš€ Setup Guides by Agent / Tool

1. Google Antigravity CLI (AGY)

  1. Run the automated installer:
    .\scripts\install.ps1 -Target antigravity
    (Or copy configs/antigravity/ to ~/.gemini/config/plugins/dspark/)
  2. Ensure your DeepSeek API key is configured:
    export DEEPSEEK_API_KEY="sk-..."
  3. Dual-engine curation is now active automatically on code creation and refinement.

2. Claude Code (CLI) & Claude Desktop

  1. Repository Policy: Copy configs/claude-code/CLAUDE.md to the root of your project repository.
  2. MCP Configuration: Add the DSpark server to your claude_desktop_config.json or project MCP config:
    {
      "mcpServers": {
        "dspark": {
          "command": "python",
          "args": ["-m", "dspark.mcp.server"],
          "env": {
            "DEEPSEEK_API_KEY": "sk-..."
          }
        }
      }
    }

3. Cursor IDE

  1. Copy configs/cursor/.cursorrules to your project root.
  2. Open Cursor Settings $\rightarrow$ Features $\rightarrow$ MCP Servers $\rightarrow$ Add New MCP Server:
    • Name: dspark
    • Type: command
    • Command: dspark mcp

4. Windsurf (Codeium Cascade)

  1. Copy configs/windsurf/.windsurfrules to your project root.
  2. Add the DSpark MCP server from configs/windsurf/mcp_config.json into your Windsurf MCP settings.

5. Roo Code / Cline (VS Code Extension)

  1. Copy configs/roo-code/custom_instructions.md into your Custom Instructions tab.
  2. Import configs/roo-code/mcp_settings.json into your MCP Server settings in Roo Code.

6. Grok Build CLI (xAI)

Grok Build auto-discovers repository instructions and MCP servers:

  1. Repository Policy: Place configs/grok/GROK.md in your project root.
  2. 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-..." }

πŸ”Œ Universal Curator: Plug ANY Model or API

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"

πŸ“œ Attribution & Academic Lineage

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


πŸ“„ License

MIT License. Feel free to use, modify, and distribute across all your coding environments.

About

Universal Dual-Engine & Speculative Curation Configuration Kit for Antigravity, Cursor, Claude Code, Windsurf & Grok (FastMCP)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages