pg-dash CLAUDE.md

pg-dash CLAUDE.md is an instructions file for coding agents from indiekitai/pg-dash. It costs 1,547 tokens per session, scanned A, original, MIT.

Project-specific instructions for pg-dash, a PostgreSQL monitoring tool with a web dashboard, command-line interface, and MCP server. PostgreSQL is a database system.

In plain words
What is it for?
Working on database queries, health checks, migration safety, pgvector checks, the React dashboard, and release preparation.
Why use it?
They explain the project structure, build and test commands, and the checks required before publishing a package.

Instructions file

Install

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.

agentmods
npx agentmods add instructions/indiekitai/pg-dash/claude-md
Clone the repo
git clone --depth 1 https://github.com/indiekitai/pg-dash

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pg-dash CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/indiekitai/pg-dash/claude-md.svg)](https://agentmods.dev/instructions/indiekitai/pg-dash/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/indiekitai/pg-dash/claude-md"><img src="https://agentmods.dev/badge/instructions/indiekitai/pg-dash/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,547 This file is loaded in full into every session.
When invoked 1,547 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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

ModelPer sessionOnce invoked
Fable 5 $0.01547 $0.01547
Opus 5 $0.00773 $0.00773
Sonnet 5 $0.00309 $0.00309
Haiku 4.5 $0.00155 $0.00155

Measured 4d ago against content hash 049bcc8860a6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pg-dash CLAUDE.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 4d 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.

CLAUDE.md · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pg-dash CLAUDE.md

@indiekitai/pg-dash — 轻量 PostgreSQL 监控工具(Web Dashboard + CLI + MCP Server)。 npm 包名 @indiekitai/pg-dash,GitHub indiekitai/pg-dash


项目结构

src/
├── cli.ts            # CLI 入口(pg-dash 命令)
├── mcp.ts            # MCP Server 入口(pg-dash-mcp 命令)
├── server/           # 共享的查询/分析逻辑
│   ├── queries/      # PG 查询(overview, tables, schema, activity, slow-queries...)
│   ├── advisor.ts    # 健康检查 + 建议
│   ├── migration-checker.ts  # Migration 安全分析
│   ├── pgvector.ts   # pgvector 扩展健康检查
│   └── ...
└── ui/               # Web Dashboard 前端(React + Recharts + Tailwind)

构建产物:

  • dist/cli.js + dist/mcp.js — tsup 打包的后端
  • dist/ui/ — vite 打包的前端静态资源

构建与测试

pnpm build              # 完整构建(后端 + 前端)
pnpm build:backend      # 仅 tsup 打包 cli.ts + mcp.ts
pnpm build:frontend     # 仅 vite 打包 Web Dashboard
pnpm test               # vitest 跑测试

发版纪律(强制)

2026-06-09 教训:npm publish 后不 push,导致本地/远端分叉、版本线混乱、0.12.2 带 bug 发到 latest。

发版检查清单(每次 npm publish 前必须按序执行)

1. git pull origin master          ← 先拉远端,防分叉
2. 改 package.json 版本号
3. 更新 CHANGELOG.md
4. pnpm build                      ← 必须完整 build,不能只 build:backend
5. 验证 dist/ 内容完整:
   - dist/cli.js ✓
   - dist/mcp.js ✓
   - dist/ui/index.html ✓          ← 漏了这个 = Web Dashboard 坏了
   - dist/ui/assets/*.js ✓
6. npm publish --dry-run            ← 先 dry-run 检查 tarball 内容
7. npm publish --tag latest
8. git add -A && git commit
9. git tag v{版本号}
10. git push origin master --tags   ← 不 push = 没发版

禁止

  • ❌ npm publish 后不 push(这是今天所有问题的根因)
  • ❌ 只跑 build:backend 就发版(会漏掉 Web Dashboard)
  • ❌ 在不同机器/环境上各自发版不合并(会产生并行版本线)
  • ❌ 发完版不验证就走(至少 npx @indiekitai/pg-dash@{version} --version 跑一下)

版本号规则

  • 线性递增,不开并行版本线
  • latest tag 必须指向最新的稳定版
  • 如果发错了,用 npm deprecate 标记错误版本,不要试图在旧版本线上打补丁

MCP Server 约束(强制)

2026-06-09 教训:启动时 pool.connect() 探活输出干扰 MCP stdio 协议握手。

stdio 模式下的铁律

MCP stdio 协议用 stdin/stdout 通信。server.connect(transport) 之前和之外

  • ❌ 禁止 console.log()(会写 stdout,破坏协议)
  • ⚠️ console.error() 写 stderr,协议上安全但 Claude Code 可能显示为噪音
  • ❌ 禁止启动时的 pool.connect() 探活——pool 是懒连接,第一次 tool call 时才连
  • ❌ 禁止任何会向 stdout 写数据的副作用(uncaught promise rejection 的默认 handler 等)

Read the full file on GitHub · 147 lines

Changes

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.

  1. 4d ago First seen · 147 lines · 1,547 tokens per session scan A 049bcc8860a6

Subscribe to this mod's changes

pg-dash CLAUDE.md is an instructions file published in the GitHub repository indiekitai/pg-dash (1 stars, last pushed 2mo ago), licensed MIT. It adds 1,547 tokens to every session, about $0.0077 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-31.