AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
Schemap compiles deterministic schema context for Cursor (.mdc), Claude Code (CLAUDE.md), and Codex (AGENTS.md). Stop hallucinated JOINs and cut token costs by 89%.
翻譯準備中
開發工具Python · TypeScriptGitHub @alansyahmi上線中營運者未確認
試用過了嗎? 點一下就好,不需要登入。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證使您的資料庫對 AI 程式碼代理可理解。Schemap 分析模式,偵測問題,映射關係,並產生緊湊的 AI 就緒上下文檔案,供 Claude Code、Codex、Cursor 及其他 AI 工具使用。
AI 翻譯
Make your database understandable to AI coding agents. Schemap analyzes schemas, detects issues, maps relationships, and generates compact AI-ready context files for Claude Code, Codex, Cursor, and other AI tools.
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Schemap
The local semantic compiler for AI agents working with real databases.
Compile schema semantics, relationships, and database invariants into deterministic agent context. Verify generated SQL before it executes.
⚡ The Architecture: Grounding → Generation → Verification
AI coding assistants (Cursor, Claude Code, Windsurf, Codex) are fluent in SQL syntax, but fail at production relational databases because raw schema DDL omits implicit operational invariants:
🛑 The Problem: The Hidden Traps of Naked Schema Prompts檢視完整 README ↗AI coding assistants (Cursor, Claude Code, Windsurf, Codex) are fluent in SQL syntax, but fail at production relational databases because raw schema DDL omits implicit operational invariants:
SCHEMAP 4.0
┌─────────────────┐
│ Database Schema │
└────────┬────────┘
│ (Introspect tables, FKs, types)
▼
┌─────────────────────┐
│ Semantic Compiler │
│ │
│ • Entity Roles │
│ • Measure Units │
│ • Join Graphs │
│ • Tenant Invariants │
│ • Lifecycle Rules │
│ • Provenance Tags │
└─────────┬───────────┘
│
▼
GroundedPlan
│ (Provided to LLM via MCP or CLI)
▼
┌─────────────────────┐
│ AI Coding Agent │
│ (Claude, Cursor, │
│ Gemini, Codex) │
└─────────┬───────────┘
│
▼
Generated SQL
│
▼
┌─────────────────────┐
│ AST Policy Engine │
│ │
│ • Mutation blocking │
│ • Tenant validation │
│ • Soft-delete check │
│ • Cartesian hazard │
└─────────┬───────────┘
│
ALLOW / REJECT / RE-VALIDATE
│
▼
Database Execution
In production databases, queries fail not from syntax errors, but from missing invariants:
amount_cents), reporting $19,900.00 instead of $199.00 ($100\times$ metric distortion).deleted_at IS NOT NULL or is_deleted = TRUE) are counted as active data.org_id), leaking neighboring customer records.FROM invoices, plans) produce accidental Cartesian products.DELETE or DROP TABLE queries without execution safeguards.Schemap exposes three native MCP tools for Cursor, Claude Code, and Windsurf.
Add Schemap to your claude_desktop_config.json or .cursor/mcp.json:
{
"mcpServers": {
"schemap": {
"command": "uvx",
"args": ["schemap-tool", "mcp"],
"env": {
"DATABASE_URL": "postgresql://user:password@localhost:5432/production_db"
}
}
}
}
Zero YAML required. Schemap inspects the database connection locally and provides three tools:
| Tool | Phase | Function |
|---|---|---|
schemap_ground | Before writing SQL | Resolves target tables, foreign-key join paths, monetary measures, and tenant invariants with explicit provenance ([DECLARED] vs [INFERRED]). |
schemap_verify | Before executing SQL | Deny-by-default AST policy circuit breaker that blocks mutations (DELETE, DROP, UPDATE), Cartesian products, and tenant omissions. |
schemap_patch | Remediating SQL | Injects missing tenant and soft-delete filters, then re-validates the patched AST to ensure no hazards remain. |
For terminal workflows, scripts, and local pair-programming:
# 1. Ground an analytical question before writing SQL
schemap ground "What was Org 42's revenue last month?" --db "$DATABASE_URL" --tenant-id 42
# 2. Verify SQL before executing against production
schemap verify "SELECT * FROM orders" --db "$DATABASE_URL" --tenant-id 42
# 3. Patch missing invariants with safety re-verification
schemap patch "SELECT * FROM orders" --db "$DATABASE_URL" --tenant-id 42
Schemap maintains three canonical evaluation documents separating live model reasoning, controlled policy verification, and domain generalization:
schemap_verify blocked 2/2.DECLARED: Explicit constraints defined in DDL or configuration.INFERRED: Recovered via structural conventions (e.g. _cents, _id, timestamps).UNKNOWN: Flagged ambiguities (e.g., dual foreign keys between the same tables) requiring human declaration.Beyond real-time MCP grounding, Schemap includes tools for local repo maintenance:
schemap context compiles a token-compressed schemap_database_context.md.schemap agents generates synchronized CLAUDE.md, AGENTS.md, and .cursorrules.schemap doctor audits missing foreign keys, orphan tables, and naming consistency.Schemap is licensed under the MIT License.