schema-sync-agent-assisted

schema-sync-agent-assisted is a skill for Claude Code, Codex from DSmmartin/skills_talk_agent_camp_2026. It costs 51 tokens per session (734 once invoked), scanned A, original, Apache-2.0.

A guided repair process for an NL2SQL system, which turns natural-language questions into SQL queries, after a database migration. It updates four connected layers: the schema contract, stored search context, and two agent instruction sets.

In plain words
What is it for?
Use it to inspect the live ClickHouse schema, compare it with the YAML contract, update the NL2SQL and retrieval prompts, refresh ChromaDB search chunks, and repair the system step by step.
Why use it?
Keeping only one layer updated can still leave the agent generating queries with old fields or explaining the data incorrectly.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is uv run python scripts/validate_schema.py.

Good fit Use it to inspect the live ClickHouse schema, compare it with the YAML contract, update the NL2SQL and retrieval prompts, refresh ChromaDB search chunks, and repair the system step by step.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/DSmmartin/skills_talk_agent_camp_2026
agentmods
npx agentmods add skills/dsmmartin/skills_talk_agent_camp_2026/02_agent_assisted

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 schema-sync-agent-assisted

README.md
[![agentmods](https://agentmods.dev/badge/skills/dsmmartin/skills_talk_agent_camp_2026/02_agent_assisted/github.svg)](https://agentmods.dev/skills/dsmmartin/skills_talk_agent_camp_2026/02_agent_assisted)
Your own site
<a href="https://agentmods.dev/skills/dsmmartin/skills_talk_agent_camp_2026/02_agent_assisted"><img src="https://agentmods.dev/badge/skills/dsmmartin/skills_talk_agent_camp_2026/02_agent_assisted/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 schema-sync-agent-assisted

Your own site · 80×15
<a href="https://agentmods.dev/skills/dsmmartin/skills_talk_agent_camp_2026/02_agent_assisted"><img src="https://agentmods.dev/badge/skills/dsmmartin/skills_talk_agent_camp_2026/02_agent_assisted.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 734 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.
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.00051 $0.00734
Opus 5 $0.00026 $0.00367
Sonnet 5 $0.00010 $0.00147
Haiku 4.5 $0.00005 $0.00073

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

Security

Grade A, and why

schema-sync-agent-assisted 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.

dev_tools/skill_examples/02_agent_assisted/SKILL.md · 74 lines

How it starts

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

Schema Sync — Agent Assisted

Context

This system has four layers that break simultaneously when the database schema changes:

Layer File / System What breaks
YAML contract agentic_system/schema/github_events.yaml Contract no longer matches live DB
NL2SQL prompt agentic_system/agents_core/nl2sql/prompts/system.md Agent generates SQL with old predicates → 0 rows, no error
RAG prompt agentic_system/agents_core/rag/prompts/system.md Agent describes wrong field semantics to the user
ChromaDB chunks schema_docs, qa_examples collections RAG retrieves stale context with wrong field names

Repair procedure

Step 1 — Introspect live schema

Query ClickHouse to see what the database actually has:

SELECT name, type FROM system.columns WHERE table = 'github_events' ORDER BY position

Use connection settings from agentic_system/config.py (host, port, user, password, database).

Step 2 — Diff against YAML contract

Load agentic_system/schema/github_events.yaml and compare column names and types. Identify: removed columns, added columns, type changes.

Step 3 — Patch YAML contract

Update agentic_system/schema/github_events.yaml:

  • Add entries for new columns with correct type and a clear post-migration description.
  • Update the type field for any column whose type changed.
  • Update descriptions for migration-sensitive columns (especially merge-related fields).

Step 4 — Patch agent prompts

In both system.md prompt files:

  • Replace old field name references with new names.
  • Replace old SQL predicates (e.g. field = 1) with new equivalents (e.g. field IS NOT NULL).
  • Update any type annotations in the schema table within the prompt.
  • Update state labels (pre-migrationpost-migration).

Step 5 — Patch ChromaDB chunks

Connect to ChromaDB at http://localhost:8000 (settings from agentic_system/config.py). For each collection (schema_docs, qa_examples):

  1. Get all items: POST /api/v2/tenants/default_tenant/databases/default_database/collections/{id}/get with {"include": ["documents", "metadatas"]}
  2. Find items where metadata.stale == True.
  3. Apply the same text replacements to the document content.
  4. Re-embed using the deterministic hash function (64 dimensions, same algorithm as db/vectordb/init/seed_vectors.py).
  5. Upsert back: POST .../upsert with updated documents, embeddings, and metadata (stale: false, schema_state: post_migration_synced).

Read the full file on GitHub · 74 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 74 lines · 51 tokens per session scan A a04144254e64

Subscribe to this mod's changes

schema-sync-agent-assisted is a skill published in the GitHub repository DSmmartin/skills_talk_agent_camp_2026 (9 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 51 tokens to every session and 734 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.