mfd

A Go code generator that reads XML descriptions of a PostgreSQL schema and creates models, repositories, services, and test helpers. It is used through project Makefile commands.

In plain words
What is it for?
Generating database models, repositories, test factories, and selected RPC or UI code after adding or changing PostgreSQL tables and fields.
Why use it?
It avoids repeatedly writing code that mirrors database tables and their relationships. Regenerating code keeps these parts aligned with the schema description.

Skill for Claude CodeCodex

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 skills/vmkteam/claude-plugins/mfd
Any agent
npx skills add vmkteam/claude-plugins --skill mfd
Clone the repo
git clone --depth 1 https://github.com/vmkteam/claude-plugins

Made for: Claude Code, Codex.

Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 810 The whole file, excluding the scripts and references it only reads on demand.
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.00067 $0.00810
Opus 5 $0.00034 $0.00405
Sonnet 5 $0.00013 $0.00162
Haiku 4.5 $0.00007 $0.00081

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

Security

Grade A, and why

mfd 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 2d 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.

plugins/developer/skills/mfd/SKILL.md · 70 lines

How it starts

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

MFD Generator

Upstream: https://github.com/vmkteam/mfd-generator

Генерирует Go-код (модели, репозитории, VT-сервисы) из XML-описания схемы PostgreSQL. Запускай через --help бинарника для полного списка флагов.

Makefile-цели (vmkteam-конвенция)

  • XML из БД: make mfd-xml, make mfd-vt-xml, make mfd-xml-lang
  • Go-код: make mfd-model, make mfd-repo NS=<ns>, make mfd-db-test
  • VT/UI: make mfd-vt-rpc NS=<ns>, make mfd-vt-template NS=<ns>
  • Финал: make generate (zenrpc + colgen)

Новая таблица

make mfd-xml && make mfd-model && make mfd-repo NS=<ns> && make mfd-db-test
make mfd-vt-xml && make mfd-vt-rpc NS=<ns> && make generate

Изменение существующей

make mfd-xml && make mfd-model && make mfd-repo NS=<ns> && make mfd-db-test

Layout

  • docs/model/<project>.mfd — корневой MFD (PackageNames, TableMapping, GoPGVer)
  • docs/model/<namespace>.xml — per-namespace Entities/Attributes/Searches

Entity/Attribute — vmkteam-конвенции

  • Name = Go-поле; PK автоматически переименовывается в ID
  • FK="User" — имя Entity, не таблицы
  • Addable/Updatable — флаги для INSERT/UPDATE
  • Аудит-поля createdAt/modifiedAtAddable="false" Updatable="false"
  • На каждый Attribute автоматически генерируется equals-search; удалённые вручную Searches не восстанавливаются при mfd-xml
  • Переименование Name ломает ссылки из Searches/VT — искать и обновлять вручную

Маппинг типов (нестандартное)

  • json/jsonb → именованный тип <EntityFieldName> (не map[string]any)
  • bigintint64; integer/serialint
  • numeric/doublefloat64

SearchType — полный список

EQUALS, NOT_EQUALS, NULL, NOT_NULL, GE/LE/G/L, ILIKE, ARRAY (IN), NOT_INARRAY, ARRAY_CONTAINS (ANY), JSONB_PATH (@>).

Все с префиксом SEARCHTYPE_.

JSONB-поиск

AttrName использует -> + обязательный GoType:

<Search Name="SmsCount" AttrName="Params->smsCount" SearchType="SEARCHTYPE_EQUALS" GoType="int" />

Read the full file on GitHub · 70 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. 2d ago First seen · 70 lines · 67 tokens per session scan A 5220c82ae41f

Subscribe to this mod's changes

mfd is a skill published in the GitHub repository vmkteam/claude-plugins (7 stars, last pushed 4mo ago), licensed MIT. It adds 67 tokens to every session and 810 once invoked, about $0.0003 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 skills, from other repositories

go-add-migration

Create properly named PostgreSQL migration files for GOB microservices.

JotJunior/cstk · 17 tokens

golang-database-patterns

Go database integration patterns using sqlx, pgx, and migration tools like golang-migrate.

bobmatnyc/claude-mpm-skills · 26 tokens

gorm-query-patterns

Review and edit Go code that uses GORM, especially under internal/plugin/store/postgres and internal/plugin/store/sqlite or any query path where missing rows may be expected. Use this skill when choosing between Take/First/Last and Find, and when you need patterns that avoid noisy record not found logs by treating…

chirino/memory-service · 96 tokens

dbx

Use when working with DBX database schema definitions, generating Go database bindings, creating models, or writing CRUD operations. DBX is a code generation tool that creates Go code for Postgres, CockroachDB, Spanner, and SQLite databases.

storj/claude-plugins · 52 tokens

golang-fullstack-error-handling

Unified Go + GORM + PostgreSQL error handling review. Covers error wrapping, context propagation, PostgreSQL error codes (23505, 40001), errors.Is/As mapping, and retry logic. Ensures proper error chains and robust database failure recovery.

saifoelloh/golang-best-practices-skill · 60 tokens

gorm-sql-postgresql-syntax

PostgreSQL SQL syntax review for Go/GORM projects. Use when writing or reviewing raw SQL used via db.Raw(), db.Exec(), or migrations. Covers placeholder style, reserved keyword quoting, RETURNING, ILIKE, JSONB operators, and type casting. Don't use for MySQL or SQLite.

saifoelloh/golang-best-practices-skill · 68 tokens