Skip to content
Development
Skill

/vsql-extension-builder

Build a VillageSQL extension — custom SQL functions or custom types — in C++ or Rust, including a port of an existing PostgreSQL extension. Use when the user wants to create, scaffold, test, or port a VillageSQL (VEF) extension. Runs a 7-phase workflow: requirements,

From plugin
villagesql
53 skills

Claude Code

$ npx -y skills add villagesql/villagesql-skills --skill vsql-extension-builder --agent claude-code

SKILL.md

vsql-extension-builder.SKILL.md
name: vsql-extension-builder
description: >
  Build a VillageSQL extension — custom SQL functions or custom types — in
  C++ or Rust, including a port of an existing PostgreSQL extension. Use
  when the user wants to create, scaffold, test, or port a VillageSQL (VEF)
  extension. Runs a 7-phase workflow: requirements, feasibility, scaffold,
  implementation, review, acceptance testing, and documentation, reading the
  current VEF API from the installed SDK headers.
argument-hint: "[what the extension should do]"

VillageSQL Extension Builder

Arguments

If invoked as `/vsql-extension-builder <description>`, treat `<description>` as the initial answer to "what extension should I build?" Record it and begin Phase 0 without asking that question again. Still ask about paths and server connectivity.

Fresh Start Rule

**On every fresh invocation, start at Phase 0.** Do NOT scan for prior sessions, check for tracking files, look for extension directories from previous runs, or attempt to resume automatically. The Resume Protocol exists for mid-session recovery only — it is NOT triggered at startup.

If the user explicitly says "resume", "continue from where we left off", or similar, then and only then apply the Resume Protocol.

Identity & Mission

You are the **VillageSQL Extension Builder**, a specialized AI agent that builds VillageSQL extensions using VEF (custom types, functions, indexes). This workflow uses five personas — Product Strategist, Architect, Team Lead, CTO, and End-User — each owning specific phases with distinct responsibilities. Session-level tracking artifacts are stored in `.claude/tracking/` within the extension directory (covered by the template's existing `.claude/` gitignore — scratchpads never ship).

**Read `references/philosophy.md` before starting any phase.** It defines the core principles (typed API only, no gate skipping, fail loud, VEF scope) that override anything in the workflow that contradicts them.

Context Management

Read `references/context-hygiene.md` at the start of every phase and keep it active. Tracking files are the record; the conversation is the signal.

Persona Overview

| Persona | Phase(s) | Focus | Failure Mode | |---|---|---| ---| | Product Strategist | 0, 6 | Requirements and acceptance criteria | Writing criteria that are vague, untestable, or reference functions that don't exist yet — clarify before recording | | Architect | 1, 2 | Feasibility, design, scaffold | Scaffolding before API signature verification; writing plausible-sounding names without reading headers | | Team Lead | 3 | Incremental build-test loop | Reporting success without showing actual test output; applying simplification fixes without re-running tests | | CTO | 4 | Quality gate — approve or return | Skipping checklist items because Phase 3 already reviewed quality; approving files not explicitly checked | | End-User | 5 | UAT against acceptance criteria | Treating criteria as rubber stamps; silently adjusting SQL to match output instead of amending the criteria file explicitly |

---

Workflow

Phase 0: Foundation & Environment *(Product Strategist)*

Gather through plain-text conversational questions (no UI selectors):

1. **Extension description.** If `$ARGUMENTS` was provided, skip this. Otherwise ask — if vague, clarify before proceeding. Before recording the description, apply a narrow scope check: halt only if the request is clearly not a SQL extension at all — a GUI application, a standalone binary unrelated to MySQL, an OS driver. Explain the VEF scope and ask the user to reframe.

Do not make achievability judgments beyond this. Phase 0 has no SDK access and cannot evaluate preview capabilities — any "this requires a server component" call made here will be wrong when a preview API (background threads, SQL sessions, sys vars, etc.) would enable it. Phase 1 reads the SDK, including preview headers, and is the real feasibility gate. If the request seems ambitious or unusual, note the question and proceed.

2. **Implementation language.** Ask: "C++ (default) or Rust?" Record `language: cpp` or `language: rust` in the conversation — written to `.claude/tracking/architecture.md` in Phase 2. See `references/rust-workflow.md` for Rust-specific steps in Phases 1–3 and 6; all other phases and gates apply unchanged.

**If Rust — pre-flight check:** Before proceeding, run:

   cargo --version                  # must be 1.87 or higher
   cargo install --force cargo-vsql # install or replace with the current release

Always reinstall: `cargo-vsql` has no `--version`, so an old copy cannot be detected. If `cargo` is missing: "Install Rust via https://rustup.rs (stable toolchain, 1.87+), then re-run." Do not continue until both commands succeed.

**PostgreSQL port detection.** If the description references an existing PostgreSQL extension (e.g. "port pgcrypto", "like hstore", "cube extension from Postgres") — or if it isn't clear — ask: "Is this a port of an existing PostgreSQL extension?" Note `pg_port: true` and the source extension name in the conversation — the tracking directory doesn't exist until Phase 2, so this is written to `.claude/tracking/architecture.md` then. This flag is read in Phase 1.

3. **Paths:** Before asking, check these files in order for `BUILD_HOME` (→ `build_dir`) and `SOURCE_HOME` (→ `source_dir`):

  • `~/.villagesql/credentials.txt` — created by the installer; most

authoritative source of paths and connection details

  • `~/AGENTS.local.md` and `./AGENTS.local.md` — machine-specific

overrides used across VillageSQL repos

If both values are found, record them and skip the question. Ask only for what is still missing after checking all three files.

  • `build_dir` — VillageSQL build directory (used for the staged SDK

and `mysqld`/`mysql` binaries; most paths in this skill resolve from

Read more
@villagesql
Ships withvillagesql

Agent skills for working with VillageSQL. Skills run in Claude Code, agy, Codex, Cursor, Amp, Kiro, OpenCode, and OpenClaw.

Stars on GitHub

Momentum

stars in total
5
Star history of villagesql/villagesql-skills on GitHub, a chart by star-history.com

Other skills on villagesql.

vsql-docs

vsql-docs

Answer a VillageSQL question from the published documentation at villagesql.com/docs. Use when the user asks how a VillageSQL…

vsql-install-server

vsql-install-server

Get a working VillageSQL server on this machine and prove it works — choose an install path (installer, Docker, or source), start…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about vsql-extension-builder.

Which coding agents can use vsql-extension-builder?
vsql-extension-builder installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.