design-vector-schema

design-vector-schema is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 41 tokens per session (549 once invoked), scanned A, original, MIT.

Design a pgvector migration SQL file. Captures model + dimension + distance metric + row count → generates reversible Flyway/Alembic migration with correct index type, metadata columns, and null guards.

Command for Claude Code

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 commands/kumaran-is/claude-code-onboarding/design-vector-schema
Clone the repo
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboarding

Made for: Claude Code.

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 design-vector-schema

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/design-vector-schema.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/design-vector-schema)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/design-vector-schema"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/design-vector-schema.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 549 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00041 $0.00549
Opus 5 $0.00020 $0.00275
Sonnet 5 $0.00008 $0.00110
Haiku 4.5 $0.00004 $0.00055

Measured today against content hash 6b3e2d1faa45, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

design-vector-schema 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 today.

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.

.claude/commands/design-vector-schema.md · 47 lines

What it actually says

Design Vector Schema

Generate a production-ready pgvector migration for the following:

Input: $ARGUMENTS

Steps

  1. Load the vector-database skill — read SKILL.md and references/pgvector-migration-template.md for templates and operator-index alignment rules.

  2. Gather requirements — Extract from $ARGUMENTS or ask:

    • Table name (existing or new)
    • Embedding model (from skill's model table — text-embedding-3-small, text-embedding-3-large, embed-english-v3.0, voyage-3-large, nomic-embed-text)
    • Estimated row count (determines HNSW vs IVFFlat)
    • Distance metric (cosine / L2 / inner product)
    • Migration format (Flyway V{N}__*.sql or Alembic {revision}_.py)
  3. Select index type based on row count:

    • < 100K rows: IVFFlat (with ANALYZE reminder)
    • ≥ 100K rows: HNSW
    • Always default to HNSW if count is unknown
  4. Generate migration file with:

    • CREATE EXTENSION IF NOT EXISTS vector; at top of up()
    • vector({dims}) column — dimension from model table
    • embedding_model varchar(100) DEFAULT '{model}'
    • embedded_at timestamptz
    • Correct index with matching ops class
    • Null guard partial index (WHERE embedding IS NOT NULL) for tables > 50K rows
    • Reversible down() section
    • Comment block: model, dims, distance metric, index params reasoning
  5. Run pgvector-schema-reviewer agent on the generated file before presenting to user.

  6. Save file to src/main/resources/db/migration/ (Flyway) or alembic/versions/ (Alembic) depending on project structure. If neither exists, save to current directory with correct naming convention.

  7. Report what was generated and any reviewer findings.

$ARGUMENTS

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. today First seen · 47 lines · 41 tokens per session scan A 6b3e2d1faa45

Subscribe to this mod's changes

design-vector-schema is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 41 tokens to every session and 549 once invoked, about $0.0002 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-09-03.