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 komluk/scaffolding --skill database-optimizationgit clone --depth 1 https://github.com/komluk/scaffoldingWrote 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/komluk/scaffolding/database-optimization)<a href="https://agentmods.dev/skills/komluk/scaffolding/database-optimization"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/database-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/komluk/scaffolding/database-optimization"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/database-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.00058 | $0.01704 |
| Opus 5.5 | $0.00023 | $0.00682 |
| Sonnet 5.5 | $0.00012 | $0.00341 |
| Haiku 4.5 | $0.00006 | $0.00170 |
Grade A, and why
database-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 3mo 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 — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Schema Design Principles
| Form | Use When |
|---|---|
| 1NF | Always (atomic values) |
| 2NF | Most tables |
| 3NF | Transactional data |
| Denormalized | Read-heavy, reporting |
Index Strategy
| Type | Use Case |
|---|---|
| B-Tree | Default, range queries |
| Hash | Exact match only |
| GIN (Postgres) | Full-text, JSONB, arrays |
| Partial | Subset of rows |
| Composite | Multi-column queries |
Index type names vary by engine (e.g. GIN/GiST/BRIN are Postgres-specific; MySQL/SQLite expose a different set). Treat engine-specific rows as examples.
When to Index
- Primary keys (automatic)
- Foreign keys
- WHERE clause columns
- ORDER BY columns
- JOIN columns
When NOT to Index
- Low cardinality columns
- Frequently updated columns
- Small tables (< 1000 rows)
Migration Safety
Safe Operations
- ADD COLUMN (nullable)
- ADD INDEX CONCURRENTLY
- CREATE TABLE
- ADD CONSTRAINT (with validation)
Dangerous Operations
- DROP COLUMN
- RENAME COLUMN
- ALTER COLUMN TYPE
- DROP TABLE
Migration Checklist
- Tested on production-like data
- Rollback script ready
- Estimated execution time
- Lock impact assessed
- Application compatibility verified
Query Analysis
Common Issues
| Issue | Symptom | Solution |
|---|---|---|
| Missing index | Sequential scan | Add index |
| N+1 queries | Many similar queries | Eager loading |
| Over-fetching | SELECT * | Select specific columns |
| No pagination | Large result sets | Add LIMIT/OFFSET |
| Cartesian join | Exploding rows | Fix JOIN conditions |
Analysis Commands
Frontend
npm run build -- --analyze- Bundle analysislighthouse- Performance audit- Browser DevTools Performance tab
Backend (Python)
py-spy- CPU profilingmemory_profiler- Memory analysisEXPLAIN ANALYZE- Query analysis
Best Practices
DO
- Measure before optimizing
- Design database for future scale
- Document schema decisions
- Use foreign keys and index them
- Plan migrations carefully
- Test with production-like data
- Focus on user-impacting metrics
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.
- 3mo ago First seen · 215 lines · 58 tokens per session scan A 378e0f2d8a76
database-optimization is a skill published in the GitHub repository komluk/scaffolding (16 stars, last pushed 7d ago), licensed MIT. It adds 58 tokens to every session and 1,704 once invoked, about $0.0002 per session on Opus 5.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.
database-optimization compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| database-optimizationkomluk/scaffolding | Skill | 16 | 7d ago | MIT | A | 58 | Claude Code |
| data-modelingcbrock84/headcount | Skill | 2.6k | today | MIT | A | 77 | Claude Code |
| data-migrationcbrock84/headcount | Skill | 2.6k | today | MIT | A | 102 | Claude Code |
| domain-modelingrsmdt/the-startup | Skill | 588 | 1mo ago | MIT | A | 42 | Claude Code |
| consistency-coordinationproyecto26/system-design-skills | Skill | 148 | 1mo ago | MIT | A | 141 | Claude Code |
| data-storageproyecto26/system-design-skills | Skill | 148 | 1mo ago | MIT | A | 132 | Claude Code |
| distributed-searchproyecto26/system-design-skills | Skill | 148 | 1mo ago | MIT | A | 117 | Claude Code |