datit309/supergraph ↗★ 22

supergraph

为AI编程智能体提供工程工作流与工具 适合需要强制执行规划、TDD测试及代码分析等规范化工程流程的开发任务。

套件
supergraph
相容性
待驗證
版本
2.2.15
授權
MIT
最近更新
2026年9月24日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:datit309/supergraph

Supergraph for AI Coding Agents

Tiếng Việt

Turn AI coding agents from code generators into engineering workflow systems.

SuperGraph doesn't make your coding agent smarter. It makes your coding agent behave like a disciplined engineer.

SuperGraph enforces planning, TDD, verification, review, and architecture-aware decision making through mandatory workflows, graph intelligence, and LSP-powered code analysis.

What the plugin does

Supergraph is a workflow system for AI coding agents, not just a collection of prompts. Every non-trivial change follows:

scan → analyze → plan → TDD → execute → fix → verify → review

The graph layer is powered by Codebase Memory MCP (>= 0.10.8,=0.10.8,=0.10.8,=0.10.8,=0.10.8,=0.10.8, (global), copies OPENCODE.md to ~/.config/opencode/, and creates/prints ~/.config/opencode/opencode.json:

{
  "instructions": ["OPENCODE.md"],
  "mcp": {
    "codebase-memory-mcp": { "type": "stdio", "command": "codebase-memory-mcp", "args": [] },
    "serena": { "type": "stdio", "command": "serena", "args": ["start-mcp-server", "--context=opencode", "--project-from-cwd"] }
  }
}

OpenCode uses OPENCODE.md for project instructions. Skills and MCP work out of the box. Hooks (SessionStart, caveman, etc.) are not available on OpenCode — the platform uses a JS/TS plugin model instead of bash hooks.

Invoking skills on OpenCode: use /skills, then choose scan, plan, tdd, etc. Do not use /supergraph:* in OpenCode.

Option 5 — DeepSeek Harness (DSH)

Supergraph supports standard Cordis Plugin & Bundle integration for DeepSeek Harness:

Option A: Install as a Plugin Bundle (Recommended)

Via DSH Plugin Manager CLI:

# Add Supergraph bundle to your active profile (e.g. web, headless):
dsh plugin --profile web add github:datit309/supergraph

# Or from a local checkout:
dsh plugin --profile web add /path/to/supergraph

Or via the DSH Web GUI (http://127.0.0.1:3080):

  1. Open Settings → Plugins (or open the Plugins drawer in the sidebar).
  2. Under Install Bundle, enter github:datit309/supergraph (or your local path).
  3. Click Install. The plugin activates immediately via HMR without requiring a restart.

The Plugin Bundle automatically:

  • Registers all 38 skills via ctx.skills.registerProvider().
  • Configures codebase-memory and serena MCP servers via @deepseek-ai/dsh-mcp-client.
  • Injects workflow rules from AGENTS.md into ctx.systemPrompt.
Option B: Install via Symlink CLI Script
git clone https://github.com/datit309/supergraph.git
cd supergraph

# Symlink skills to ~/.dsh/skills + configure MCP in ~/.dsh/cordis.patch.yml
plugins/supergraph/install.sh --platform dsh

# Or via one-liner:
curl -fsSL https://raw.githubusercontent.com/datit309/supergraph/master/install.sh | sh -s -- --platform dsh

Invoking skills on DSH: Skills are registered with bare kebab-case names according to DSH standards (/^[a-z0-9]+(?:-[a-z0-9]+)*$/).

  • Slash commands: /scan, /plan, /tdd, /verify, /review, etc. Do not use /supergraph:* in DSH.
  • Tool call: skill(name="scan"), skill(name="plan"), etc.
  • Agent Preset: Bundles dedicated Supergraph Engineer Agent Preset with graph-first navigation, TDD rules, and strict tool-result log pruning. Select directly from DSH Web preset menu.

MCP Setup

Codebase Memory MCP >= 0.10.8,=0.10.8,<0.11.0'

codebase-memory-mcp --version codebase-memory-mcp cli index_repository --repo-path "$(pwd)" --name supergraph --mode moderate


`/supergraph:scan` registers or builds the graph on first run and records `CBM_PROJECT` in `.supergraph-env`. Codebase Memory `auto_watch=true` keeps the local index fresh asynchronously; quality gates explicitly check index status and reindex before impact analysis.

### Serena Setup

Serena adds LSP-level intelligence: find all callers, safe codebase-wide rename, type diagnostics. Optional but recommended.

```bash
# 1. Install uv (if not already installed)
brew install uv   # macOS
# or: curl -LsSf https://astral.sh/uv/install.sh | sh

# 2. Install Serena
uv tool install -p 3.13 serena-agent

The plugin's .mcp.json already registers Serena with Claude Code — no extra setup needed.

Verify: run /mcp in Claude Code and confirm serena appears.

All supergraph skills use Serena automatically when available.


Quick Start

# 1. Start a session — always run scan first
/supergraph:scan

# 2. Analyze — frames the problem, scores risk, proposes approach
#    (includes ambiguity grilling + 5-persona debate → GO/CAUTION/STOP)
/supergraph:analyze

# 3. Plan before any non-trivial change
/supergraph:plan

# 4. Implement with TDD
/supergraph:tdd

# 5. Auto-fix after coding
/supergraph:fix

# 6. Verify before claiming done
/supergraph:verify

# 7. Review before merge
/supergraph:review

Small change (1-2 files, <10 lines)? /supergraph:tdd → /supergraph:fix → /supergraph:review

Ambiguous requirements or touching hub/bridge nodes? Start with /supergraph:analyze — it handles grilling, risk scoring, and approach selection before you plan.


Workflow

SESSION START
  → /supergraph:scan
  → Load graph, detect language, save .supergraph-env
         │
         ▼
PLANNING PHASE
  → /supergraph:analyze   (ambiguous scope, hub/bridge nodes)
  → /supergraph:plan      (blast radius, task breakdown, user approval)
  → Save to docs/supergraph/plans/YYYY-MM-DD-*.md
         │
    ┌────┴────────────────────┐
    ▼                         ▼
SMALL CHANGE              LARGE CHANGE
1-2 files, <10 lines      Multi-file, complex
/supergraph:tdd           /supergraph:execute
    │                         │ (parallel tasks)
    └────────┬────────────────┘
             ▼
  Per task: RED → GREEN → REFACTOR → commit
             │
             ▼
  /supergraph:fix
  Tests + lint + format + graph (max 3 iterations)
             │
             ▼
  /supergraph:integration   (if e2e configured)
             │
             ▼
  /supergraph:verify        (evidence gate)
             │
             ▼
  /supergraph:review        (graph-aware, independent agent)
  → APPROVED / NEEDS_CHANGES / BLOCKED

Skills

All skills use the /supergraph: prefix to avoid conflicts with built-in commands.

Core Workflow

SkillPurposeWhen to use
/supergraph:scanLoad graph, detect project language, save envFirst thing every session
/supergraph:analyzeRisk analysis + structured grill + approach selectionAmbiguous scope, hub/bridge nodes involved
/supergraph:planGraph scan, blast radius, task breakdown with TDD mappingBefore writing any non-trivial code
/supergraph:executeDispatch saved plan, orchestrate parallel/sequential tasksPlan is saved and approved
/supergraph:tddRED → GREEN → REFACTOR per taskImplementing any feature or fix
/supergraph:fixAuto-fix loop: test + lint + format + graph checkAfter all coding, before claiming done
/supergraph:integrationRun integration and e