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 skills add williamzujkowski/standards --skill advanced-optimizationgit clone --depth 1 https://github.com/williamzujkowski/standardsWrote 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.
[](https://agentmods.dev/skills/williamzujkowski/standards/advanced-optimization)<a href="https://agentmods.dev/skills/williamzujkowski/standards/advanced-optimization"><img src="https://agentmods.dev/badge/skills/williamzujkowski/standards/advanced-optimization/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/williamzujkowski/standards/advanced-optimization"><img src="https://agentmods.dev/badge/skills/williamzujkowski/standards/advanced-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00015 | $0.04105 |
| Opus 5.5 | $0.00006 | $0.01642 |
| Sonnet 5.5 | $0.00003 | $0.00821 |
| Haiku 4.5 | $0.00002 | $0.00411 |
Grade A, and why
database-advanced-optimization 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 2mo 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.
This is a copy
94% identical to graphql-api-design — 680 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 743 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Advanced Optimization
Level 1: Quick Reference (5 minutes)
Database Selection Guide
Use SQL (PostgreSQL) when:
- ACID compliance is critical
- Complex joins and transactions required
- Data has clear relational structure
- Strong consistency needed
- Rich query capabilities required
Use NoSQL (MongoDB) when:
- Flexible schema needed
- Horizontal scaling is priority
- Document-oriented data model fits
- High write throughput required
- Eventual consistency acceptable
Use In-Memory (Redis) when:
- Sub-millisecond latency required
- Caching layer needed
- Real-time features (pub/sub, streams)
- Session management
- Rate limiting or counters
Common Optimization Patterns
-- PostgreSQL: Create covering index
CREATE INDEX idx_orders_user_date ON orders(user_id, created_at)
INCLUDE (status, total_amount);
-- PostgreSQL: Analyze query plan
EXPLAIN (ANALYZE, BUFFERS)
SELECT * FROM orders WHERE user_id = 123;
// MongoDB: Create compound index
db.orders.createIndex({ userId: 1, createdAt: -1 }, { background: true });
// MongoDB: Use aggregation pipeline efficiently
db.orders.aggregate([
{ $match: { status: "pending" } },
{ $sort: { createdAt: -1 } },
{ $limit: 100 }
]);
# Redis: Implement cache-aside pattern
def get_user(user_id):
cache_key = f"user:{user_id}"
user = redis.get(cache_key)
if user is None:
user = db.query("SELECT * FROM users WHERE id = %s", user_id)
redis.setex(cache_key, 3600, json.dumps(user))
return json.loads(user)
Essential Optimization Checklist
PostgreSQL
- Create appropriate indexes (B-tree, GIN, GiST)
- Analyze query plans with EXPLAIN ANALYZE
- Configure autovacuum appropriately
- Set up connection pooling (PgBouncer)
- Monitor with pg_stat_statements
- Optimize shared_buffers and work_mem
- Configure appropriate WAL settings
MongoDB
- Design effective shard keys
- Create compound indexes for common queries
- Enable profiler for slow queries
- Configure replica sets for read scaling
- Optimize aggregation pipelines
- Set appropriate write concerns
- Monitor with MongoDB Compass/Atlas
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 2mo ago First seen · 743 lines · 15 tokens per session scan A e7429a9a4238
database-advanced-optimization is a skill published in the GitHub repository williamzujkowski/standards (22 stars, last pushed 3mo ago), licensed MIT. It adds 15 tokens to every session and 4,105 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 94% identical to graphql-api-design, differing in 680 lines, and is treated as a copy.
database-advanced-optimization compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| database-advanced-optimizationwilliamzujkowski/standards | Skill | 22 | 3mo ago | MIT | A | 15 | Claude Code, Codex |
| database-engineerbuiphucminhtam/forgewright | Skill | 49 | 2d ago | none | A | 45 | Claude Code |
| database-management-patternsmanutej/luxor-claude-marketplace | Skill | 64 | 5mo ago | none | A | 31 | Claude Code |
| PostgreSQL Performance Optimizationbobmatnyc/mcp-skillset | Skill | 19 | 8mo ago | MIT | A | 47 | Claude Code, Codex |
| architecture-postgresql-internalsj4flmao/agent-skills | Skill | 46 | 13d ago | MIT | A | 91 | Claude Code, Codex |
| ecommerce-cachingfinsilabs/awesome-ecommerce-skills | Skill | 69 | 1mo ago | MIT | A | 28 | Claude Code, Codex |
| postgresql-expertpersonamanagmentlayer/pcl | Skill | 46 | 1mo ago | Apache-2.0 | A | 56 | Claude Code |