Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/zhenruyan/postgrebase/agents-mdgit clone --depth 1 https://github.com/zhenruyan/postgrebaseWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.04530 | $0.04530 |
| Opus 5 | $0.02265 | $0.02265 |
| Sonnet 5 | $0.00906 | $0.00906 |
| Haiku 4.5 | $0.00453 | $0.00453 |
Grade A, and why
postgrebase AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 294 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreBase — Agent Development Guide
This file provides context for AI coding agents (Cursor, Claude, Windsurf, etc.) working on the PostgreBase codebase. Read this before exploring or modifying code.
Overview
PostgreBase 是 AI 原生的无代码 API 开发平台,基于 PocketBase 重构。内置 MCP (Model Context Protocol) 服务器,让 AI 工具直接操作数据。支持 PostgreSQL、MySQL、SQLite 三种数据库,混合缓存(Redis / 内存),100% 兼容 PocketBase API、Admin UI 和业务逻辑。
Tech Stack
- Language: Go 1.26.2+ (builds with
CGO_ENABLED=0) - HTTP Framework:
github.com/labstack/echo/v5 - CLI:
github.com/spf13/cobra - Database Drivers:
github.com/lib/pq— PostgreSQLgithub.com/go-sql-driver/mysql— MySQLmodernc.org/sqlite— SQLite (pure Go, no CGO)
- Caching:
github.com/redis/go-redis/v9(Redis) / built-in memory store - Frontend: Svelte 3, svelte-spa-router, Vite 4, PocketBase JS SDK
- Vendor:
/vendor/directory must be preserved — all dependencies are vendored for offline builds.
Project Structure
postgrebase/
├── build/ # Server entry point (main.go)
├── postgrebase.go # Root package: CLI setup, Config struct, Bootstrap
├── core/ # Application logic
│ ├── base.go # BaseApp: cache init, app lifecycle
│ ├── db_postgresql.go # connectDB(): DSN parsing and driver detection
│ └── app.go # App interface definition
├── daos/ # Data access objects (CRUD for all models)
│ ├── base.go # Dao struct, ModelQuery, RunInTransaction
│ ├── record.go # Record CRUD
│ ├── record_table_sync.go # Table schema sync (driver-aware DDL)
│ ├── table.go # HasTable, TableColumns, TableInfo, TableIndexes (driver-aware)
│ ├── collection.go # Collection queries
│ ├── admin.go # Admin auth and queries
│ └── view.go # SQL view management
├── models/ # Data models
│ ├── base.go # BaseModel (Id, Created, Updated, RefreshId)
│ ├── record.go # Record model
│ ├── collection.go # Collection model
│ ├── admin.go # Admin model (bcrypt password, JWT token key)
│ └── schema/
│ └── schema_field.go # SchemaField.ColDefinition(driverName) — driver-aware DDL
├── apis/ # HTTP API handlers
│ ├── base.go # InitApi(): route registration, MCP route binding
│ ├── serve.go # HTTP server, migration runner, startup banner
│ ├── record_crud.go # Record CRUD endpoints
│ ├── admin.go # Admin auth endpoints
│ ├── mcp_token.go # MCP token management API (CRUD)
│ └── middlewares.go # Auth middleware (RequireAdminAuth, etc.)
├── mcp/ # MCP (Model Context Protocol) server
│ ├── server.go # JSON-RPC 2.0 core, method routing, tool schemas
│ ├── tools.go # 8 MCP tools (CRUD + search for records/collections)
│ ├── resources.go # 2 MCP resources (collections, settings)
│ ├── auth.go # Token validation (JWT admin tokens + mcp_ prefixed tokens)
│ ├── transport_sse.go # SSE + Streamable HTTP transport
│ └── transport_stdio.go # Stdin/stdout transport
├── migrations/ # Database migrations (driver-aware SQL)
│ ├── 1640988000_init.go # Core tables (admins, collections, params, externalAuths)
│ ├── 1691747914_add_cache_columns.go # Cache columns migration
│ ├── 1704067200_mcp_tokens.go # MCP tokens collection
│ └── 1730000000_agent_runtime.go # Agent sessions/messages/audit/project-config tables
├── agents/ # Embedded agent platform (orchestration over controlled tools)
│ ├── service.go # Service facade (runtime, sessions, tools, run)
│ ├── runtime.go # RunSession: vibecoding agent loop, naming, audit
│ ├── toolkit.go # ToolRegistry + schema.*/data.* executors + ChartHint
│ ├── sdk_tools.go # agent.ExternalTool adapter (project scope + write authz)
│ ├── authz.go # RunOptions, write-approval policy, audit sink
│ ├── project_config.go # per-project overrides (§9.1)
│ ├── files.go # record file ref → image content block (§6.2)
│ └── store_db.go # DB-backed session/message store
├── cmd/ # CLI commands
│ ├── serve.go # `serve` command
│ ├── admin.go # `admin create` command
│ └── mcp.go # `mcp` command (stdio transport)
├── dbx/ # Database query builder (fork of ozzo-dbx)
│ ├── builder.go # BaseBuilder: CreateTable, AddColumn, DropColumn, etc.
│ ├── builder_sqlite.go # SqliteBuilder: SQLite-specific overrides
│ ├── builder_pgsql.go # PgsqlBuilder: PostgreSQL-specific overrides
│ └── builder_mysql.go # MysqlBuilder: MySQL-specific overrides
├── tools/ # Shared utilities
│ ├── security/ # JWT, bcrypt, random string generation
│ ├── types/ # DateTime (custom time type with Scan/MarshalJSON)
│ ├── search/ # Filter/sort/search provider
│ ├── migrate/ # Migration runner
│ └── list/ # Slice/string helpers
├── ui/ # Admin UI (Svelte SPA)
│ ├── src/
│ │ ├── components/settings/PageMCPTokens.svelte # MCP token management page
│ │ └── routes.js # SPA routes (includes /settings/mcp-tokens)
│ └── dist/ # Built frontend (embedded in Go binary)
└── vendor/ # **DO NOT DELETE.** All Go dependencies.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 294 lines · 4,530 tokens per session scan A 99f39855f263
postgrebase AGENTS.md is an instructions file published in the GitHub repository zhenruyan/postgrebase (91 stars, last pushed 1mo ago), licensed MIT. It adds 4,530 tokens to every session, about $0.0226 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
whodb AGENTS.md
AGENTS.md instructions for clidey/whodb, covering whodb development guide, git commits — hard rule, terminology, non-negotiable rules and behavioral guidelines.
graphjin AGENTS.md
AGENTS.md instructions for dosco/graphjin, covering graphjin agent guide, architectural overview, directory structure & responsibilities, build commands and coding guidelines.
databasement CLAUDE.md
Claude Code instructions for David-Crty/databasement, covering claude.md, project overview, development commands, setup and installation and running the application.
whodb CLAUDE.md
Claude Code instructions for clidey/whodb, a project described as: Where data access meets operational intelligence.
Chat2DB AGENTS.md
AGENTS.md instructions for OtterMind/Chat2DB, covering chat2db community agent contract, context, product invariants, repository map and structural code navigation.
Sequel-Ace AGENTS.md
AGENTS.md instructions for Sequel-Ace/Sequel-Ace, covering agents.md — guidance for ai coding agents, language policy — the most important rule, modernization conventions (do / don't), repo layout (abridged) and building and testing.