db-infra-mocks

db-infra-mocks is a skill for Claude Code, Codex from pilinux/gorest. It costs 27 tokens per session (400 once invoked), scanned A, original, MIT.

A testing aid for replacing real databases and other data services with local substitutes. RDBMS means a traditional relational database, while Redis and MongoDB are other kinds of data stores.

In plain words
What is it for?
Use it to find where database connections are created, suggest small interfaces for replacing them, and outline mock or in-memory test setups.
Why use it?
It helps tests and local development run without requiring live database services or network connections. This makes tests safer and more repeatable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to find where database connections are created, suggest small interfaces for replacing them, and outline mock or in-memory test setups.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pilinux/gorest/db-infra-mocks
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.

Any agent
npx skills add pilinux/gorest --skill db-infra-mocks
Clone the repo
git clone --depth 1 https://github.com/pilinux/gorest

Made for: Claude Code, Codex.

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-infra-mocks

README.md
[![agentmods](https://agentmods.dev/badge/skills/pilinux/gorest/db-infra-mocks/github.svg)](https://agentmods.dev/skills/pilinux/gorest/db-infra-mocks)
Your own site
<a href="https://agentmods.dev/skills/pilinux/gorest/db-infra-mocks"><img src="https://agentmods.dev/badge/skills/pilinux/gorest/db-infra-mocks/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.

agentmods 80×15 button for db-infra-mocks

Your own site · 80×15
<a href="https://agentmods.dev/skills/pilinux/gorest/db-infra-mocks"><img src="https://agentmods.dev/badge/skills/pilinux/gorest/db-infra-mocks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 400 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00027 $0.00400
Opus 5 $0.00014 $0.00200
Sonnet 5 $0.00005 $0.00080
Haiku 4.5 $0.00003 $0.00040

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

Security

Grade A, and why

db-infra-mocks 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 12d 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/skills/db-infra-mocks/SKILL.md · 50 lines

What it actually says

DB Infrastructure Mocks

When to Use

  • Integration dependencies (RDBMS, Redis, MongoDB) prevent running tests or local development and you need safe, testable alternatives.

Responsibilities

  • Locate where clients and connections are constructed and consumed (database/ package).
  • Propose interface-based seams and minimal mock implementations.
  • Provide migration path and verification steps so production behavior remains unchanged.

Rules

  • Prefer small interfaces and constructor injection over large refactors.
  • Make tests deterministic and avoid network calls.
  • Provide unit and integration verification steps for any change.

Project-Specific Details

  • RDBMS connections: gdb.InitDB() / gdb.GetDB() (GORM *gorm.DB).
  • Redis connections: gdb.InitRedis() / gdb.GetRedis() (radix v4 radix.Client).
  • MongoDB connections: gdb.InitMongo() / gdb.GetMongo() (*mongo.Client from official driver v2).
  • Close all: gdb.CloseAllDB().
  • RDBMS: Use SQLite in-memory (driver: "sqlite3") for simple GORM-backed tests.
  • Redis: Use a radix v4 compatible mock or inject an interface wrapper around radix.Client.
  • MongoDB: Inject a mock repository interface or use a local test MongoDB instance.

Output

  • Dependency map with path:line of client construction and usage.
  • Recommended seam (interface signature) and where to inject it.
  • Example mock/test code snippet and verification commands.
  • test-runner, patch-applier, migration-helper
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. 12d ago First seen · 50 lines · 27 tokens per session scan A ae1220d03c31

Subscribe to this mod's changes

db-infra-mocks is a skill published in the GitHub repository pilinux/gorest (504 stars, last pushed 2d ago), licensed MIT. It adds 27 tokens to every session and 400 once invoked, about $0.0001 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.

Related

Other skills, from other repositories

sq

Guides use of the sq CLI to query SQL databases and tabular files with SLQ (sq's jq-like query language) or native SQL, manage sources, choose output formats, and run inspect, diff, and table commands. Use when the user mentions sq, SLQ, wrangling CSV/Excel/JSON/DB data, cross-source joins, or command-line data…

neilotoole/sq · 89 tokens

voiden

Create and edit Voiden .void files for API testing. Covers the .void file format and all enabled extension block types.

VoidenHQ/voiden · 28 tokens

code-guidelines-go

Go 1.24–1.27 coding guidelines for the dimetron/pi-go AI agent runtime. Use this skill whenever writing, reviewing, or refactoring ANY Go code in pi-go. This covers idiomatic style, error handling, concurrency, project layout, testing (table-driven, fuzz, benchmarks, synctest), new stdlib usage, golangci-lint v2…

dimetron/pi-go · 124 tokens

go-127

What changed in Go 1.27 (released August 2026) and how it changes the way Go is written in pi-go. Use this skill when writing or reviewing Go that could use a 1.27 feature, when bumping the go directive in go.mod, when a build or test behaves differently after a toolchain upgrade, or when code-guidelines-go points…

dimetron/pi-go · 177 tokens

bubbletea-testing

Use this skill whenever writing tests for Bubble Tea (charmbracelet/bubbletea) TUI applications in Go. Triggers include any mention of testing Bubble Tea models, teatest, golden file testing for TUIs, testing tea.Cmd or tea.Msg, snapshot testing terminal output, or writing tests for any Go CLI/TUI that uses the Elm…

dimetron/pi-go · 139 tokens

vhs-e2e-gif

Record a test run, a TUI session, or any terminal command as a GIF with VHS and attach it to a GitHub PR as a release-hosted asset, never a repo commit. Use when asked to record an e2e run, demo a fix on a PR, attach a GIF or screen recording to a pull request, show a test passing visually, or produce a terminal…

dimetron/pi-go · 106 tokens