db_tools: Instructions file for Codex

AGENTS.md

db_tools AGENTS.md is an instructions file for Codex, OpenCode from muqeetmughal/db_tools. It costs 3,025 tokens per session, scanned A, original, MIT.

Instructions for a Frappe app that provides eighteen read-only database inspection tools as web pages under /db_tools. Each tool combines a whitelisted API with a Jinja-rendered page.

In plain words
What is it for?
Use it to add or modify database inspection tools, understand their backend and page layout, register tools in the hub, and follow shared access and rendering helpers.
Why use it?
It explains the app's structure and non-negotiable read-only behavior before changes are made. The shared registry and frontend engine keep the tools organized consistently.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is muqeetmughal/db_tools's own configuration. It tells Codex and OpenCode how to work on db_tools itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything db_tools configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is cd sites && ../env/bin/python -c ".

Reuse

Borrowing it

Nothing to install: this file belongs to muqeetmughal/db_tools. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/muqeetmughal/db_tools/develop/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/muqeetmughal/db_tools

Made for: Codex, OpenCode.

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 db_tools AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/muqeetmughal/db_tools/agents-md.svg)](https://agentmods.dev/instructions/muqeetmughal/db_tools/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/muqeetmughal/db_tools/agents-md"><img src="https://agentmods.dev/badge/instructions/muqeetmughal/db_tools/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,025 This file is loaded in full into every session.
When invoked 3,025 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03025 $0.03025
Opus 5 $0.01512 $0.01512
Sonnet 5 $0.00605 $0.00605
Haiku 4.5 $0.00302 $0.00302

Measured 6d ago against content hash 1bbb273c3832, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

db_tools 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 6d 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.

AGENTS.md · 232 lines

How it starts

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

AGENTS.md — db_tools

Guidance for agents working in this app. Read this before adding or changing a tool.

What this app is

A Frappe app that ships a suite of read-only database inspection tools, served as website pages under /db_tools. There are no DocTypes and no desk pages — every tool is a whitelisted API plus a Jinja page.

All eighteen tools are implemented and working. Nothing is stubbed.

Layout

db_tools/
├── backend/
│   ├── __init__.py                 # TOOLS registry — drives the /db_tools hub page
│   ├── common.py                   # shared helpers: guard(), coercion, renderers
│   └── <tool_key>/
│       ├── __init__.py             # module docstring explaining the tool
│       └── api.py                  # pure logic + @frappe.whitelist() endpoint
├── templates/
│   └── db_tools_base.html          # shared CSS + the DBTool frontend engine
└── www/db_tools/
    ├── index.py / index.html       # the hub page
    └── <tool_key>/
        ├── index.py                # get_context — blocks Guest
        └── index.html              # extends the base template, supplies a config

broken_link_detector is the one tool split across several modules (scanner.py, validator.py, queries.py, models.py, report.py) because it is substantially more complex. Every other tool fits in a single api.py.

database_tools/api.py is a backwards-compatible shim re-exporting backend.schema_comparison.api. Leave it alone unless removing it deliberately.

The eighteen tools

Every endpoint is prefixed db_tools.backend.. category on each registry entry drives the hub page's filter chips.

# Key Category Endpoint (<key>.api.…)
01 schema_comparison Schema get_extra_db_columns_report
02 broken_link_detector Integrity get_broken_links_report
03 orphan_child_detector Integrity get_orphan_children_report
04 orphan_table_finder Schema get_orphan_tables_report
05 largest_tables_analyzer Storage get_largest_tables_report
06 duplicate_index_detector Performance get_duplicate_indexes_report
07 missing_index_advisor Performance get_missing_indexes_report
08 database_health_report Operations get_health_report
09 migration_sql_generator Operations get_migration_sql
10 site_schema_comparison Operations get_site_schema_comparison, get_sites
11 schema_drift_detector Schema get_schema_drift_report
12 empty_column_analyzer Storage get_empty_columns_report
13 log_table_analyzer Storage get_log_tables_report
14 customization_auditor Integrity get_customization_report
15 collation_auditor Schema get_collation_report
16 fragmentation_analyzer Performance get_fragmentation_report
17 row_size_auditor Schema get_row_size_report
18 mariadb_limits_auditor Schema get_limits_report

Read the full file on GitHub · 232 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. 6d ago First seen · 232 lines · 3,025 tokens per session scan A 1bbb273c3832

Subscribe to this mod's changes

db_tools AGENTS.md is an instructions file published in the GitHub repository muqeetmughal/db_tools (3 stars, last pushed 10d ago), licensed MIT. It adds 3,025 tokens to every session, about $0.0151 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.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens