Skills Generator · CHION.md
CHION.md — your SQL Analytics Agent file. Drop it into Claude Code, Codex, or Cursor.
A Markdown instruction file for your database, interchangeable with CLAUDE.md, AGENTS.md, and SKILLS.md. Auto-generated from your real queries; fully editable and exportable.
What is CHION.md?
A SQL Analytics Agent file for your database — auto-written from your real queries.
CHION is Chion.ai's SQL Analytics Agent file format. The .md suffix follows the CLAUDE.md / AGENTS.md / SKILLS.md convention; the four filenames are interchangeable mirrors with byte-identical content — pick whichever your agent (Claude Code, Codex, Cursor) reads natively.
CHION.md is a SQL Analytics Agent file for your database — a portable, version-controlled instruction file an AI reads before doing any work. The difference vs. hand-written agent files: yours is auto-written from your real analytics conversations, fully editable, and re-exportable on every refresh. Every verified SQL query teaches it; every PII column closes off; every business rule is cited back to the row that proved it.
The export ships as one folder any AI tool can read — CHION.md at the root + a three-tier .claude/skills/ cascade beneath it (workspace catalog → department catalog → role SKILL.md with verified scripts). Sister-paired roles within each department cover complementary axes — recognized vs. forecast, between-warehouse vs. inside-warehouse, acquisition vs. in-product — so cross-axis questions resolve without the agent inventing a join.
How the SQL Analytics Agent file gets built
Three steps: upload, ask, export. Deterministic, not generated-on-the-fly.
①
Upload queries
Connect Postgres or upload your existing query log. Chion ingests verified queries as evidence for the agent file.
②
Ask & chart
Ask analytics questions in plain English. Chion generates SQL, runs it read-only, and returns interactive charts — every answer enriches the skill.
③
Export your skill
Download the validated skill file. CHION.md, CLAUDE.md, AGENTS.md, SKILLS.md mirrors plus skills/ folders. Drop into Claude Code, Codex, or Cursor.
One compile per workspace. Same input → same agent file. Deterministic, not generated-on-the-fly.
Anatomy of a SQL Analytics Agent file
Frontmatter contract, persona, curated rule pack, evidence-grounded slots.
A real Northwind Logistics agent file. Every Layer 2 line cites [src=…] back to the row that proved it — no hallucinated columns.
Key facts — frontmatter contract: 11 fields. Framework version: 7. Layer 2: 11–13 density-gated slots, every line [src=…]-cited. Three Opus 4.7 compile passes (Persona → Curated SQL Rule Pack → Dense Layer 2). Fully editable; export as CHION.md / CLAUDE.md / AGENTS.md / SKILLS.md.
---
artifact_type: domain_sql_sme_prompt
artifact_version: 2.5.0
framework_version: 7
archetype: logistics_supply_chain
chosen_primitives: [pre_aggregate_grain, snapshot_latest,
ratio_reconstruction, period_over_period_lag]
refreshed_at: 2026-04-30T18:22:11Z
---
# Analyst Persona
You are Northwind Logistics' supply-chain analyst. Your day is
shipments, lanes, carriers, and SLA breaches. You reason in
on-time-delivery rates and cost-per-mile. You refuse avg_of_ratios;
you reconstruct ratios from numerator + denominator at lane-grain.
# Curated SQL Rule Pack
### snapshot_latest
use-when: balance-style metrics (inventory_on_hand)
sql-shape: SELECT … ORDER BY ts DESC LIMIT 1 per entity
guards: never SUM across snapshots
### ratio_reconstruction
use-when: on_time_rate, fill_rate, defect_rate
guards: SUM(numerator) / NULLIF(SUM(denominator),0)
# Layer 2 — Domain Profile
## 2.1 Questions You Compute
- on_time_rate = SUM(delivered_on_time) / NULLIF(SUM(shipments),0)
[src=column_profiles:shipments.delivered_on_time, kpi_metrics:otd]
- avg_cost_per_mile = SUM(total_cost) / NULLIF(SUM(miles),0)
[src=metric_concepts:cpm_lane]
## 2.6 Stop Signals
- never SUM(inventory_on_hand) across days
[src=donts:snapshot_sum, decision_record:wh_audit_2026q1]
- never AVG(rates) — reconstruct from numerator + denominator
[src=donts:avg_of_ratios, decision_record:metric_audit_2026q1]Workspace cascade, indexes, and frontmatter
Three tiers — workspace → department → role SKILL.md with verified scripts under each.
Department is the top-level axis; role is the brain. Each department contains two sister-paired roles — finance (finance-analyst ↔ fp-and-a-analyst), operations (ops-supply-chain ↔ warehouse-operations), growth (growth-marketing ↔ product-analytics). Verified queries land under the role that owns the data shape; cross-axis questions route to both sister roles.
After two instances of the same query pattern under a role, Chion promotes it to that role's scripts/ folder as a verified {README.md, query.sql} pair the agent wraps as a CTE rather than rewriting.
chion-skills-workspace/
├── CHION.md ← root agent file (canonical)
├── README.md
├── LICENSE
└── .claude/skills/
├── _INDEX.md ← workspace catalog · vocabulary · routing
│
├── finance/ ← department · 2 sister-paired roles
│ ├── _INDEX.md ← department catalog · sister-pair logic
│ ├── finance-analyst/ ← recognized revenue · ARR/MRR · margin
│ │ ├── SKILL.md ← persona brain · rule pack · scripts index
│ │ └── scripts/
│ │ ├── arr-by-segment/{README.md, query.sql}
│ │ ├── mrr-trend-12mo/{README.md, query.sql}
│ │ └── …
│ └── fp-and-a-analyst/ ← forecast · variance · runway · burn
│ ├── SKILL.md
│ └── scripts/…
│
├── operations/ (between-warehouse + inside-warehouse)
│ ├── _INDEX.md
│ ├── ops-supply-chain/{SKILL.md, scripts/}
│ └── warehouse-operations/{SKILL.md, scripts/}
│
└── growth/ (acquisition + in-product)
├── _INDEX.md
├── growth-marketing/{SKILL.md, scripts/}
└── product-analytics/{SKILL.md, scripts/}A typical SKILL.md frontmatter — name + description drive native AI-tool skill discovery; trigger-keywords + department/role drive the CHION.md cascade:
---
name: finance-analyst
description: |
The default analyst role for the finance department.
Owns recognized-revenue P&L, segment-margin reconstruction,
ARR/MRR roll-ups, and renewal recognition.
must-read: [_INDEX.md, ../_INDEX.md]
trigger-keywords: [revenue, recognized revenue, ARR, MRR,
GAAP, gross margin, segment margin, renewal]
department: finance
role: finance-analyst
archetype: saas_finance
chosen_primitives: [pre_aggregate_grain,
period_over_period_lag,
ratio_reconstruction]
status: verified
---Bottom of every SKILL.md carries a deterministic Scripts Index — trigger phrases mapped to verified scripts/ folders. No LLM judgment between trigger match and SQL execution.
Use it anywhere
One SQL Analytics Agent file. Four idiomatic mirrors: CHION.md, CLAUDE.md, AGENTS.md, SKILLS.md.
Claude Code
CLAUDE.md
Drop CHION.md (or its CLAUDE.md mirror) at the repo root. Claude Code reads it on every conversation. Fully editable. Re-export anytime.
Codex
AGENTS.md
Drop AGENTS.md. Same content, Codex contract. Identical compile, identical schema. Fully editable. Re-export anytime.
Cursor / your IDE
.cursor/rules
Import as Cursor rules or drop at repo root. Your agent inherits the workspace SQL Analytics Agent file. Fully editable. Re-export anytime.
See a real CHION.md in the wild
Chion's open-source skills workspace — a published mock you can read end-to-end.

jonfdag-dot / postgres-claude-skills-generator
The Chion Skills Workspace — six analyst personas, 15 verified Postgres scripts, three sister-role pairings — published as the exact folder shape Chion exports. Drop into Claude Code, Codex, or Cursor; every answer cites the verified script that produced it.
Per-query, per-employee — full enterprise control, no migrations
Connect, use, skills auto-generate. No data pipeline migrations required.
Per-query skill capture
Every verified query becomes a candidate skill. After two instances of the same pattern, Chion promotes it from private/ to skills/<name>/SKILL.md with auto-generated frontmatter, trigger keywords, and reference docs. Your team's analytical instincts compound into a reusable skill library.
Per-employee scoping
Database permissions already scope data; CHION.md scopes knowledge, organized by persona. Finance gets personas/finance-analyst/skills/revenue-recognition/; Ops gets personas/ops-supply-chain/skills/lane-comparisons/; Growth gets personas/growth-marketing/skills/cohort-retention/. Same database, different agent files.
Indexable, navigable, version-controlled. Diff your brain file across releases the same way you diff code.
Frequently asked questions
8 answers about CHION.md and the SQL Analytics Agent file pattern.
What is a SQL Analytics Agent file (CHION.md)?+
CHION.md is a SQL Analytics Agent file — a Markdown instruction file for your database, in the same family as CLAUDE.md, AGENTS.md, and SKILLS.md. Chion auto-generates it from your verified queries; you can edit it, export it, and drop it into Claude Code, Codex, or Cursor as the agent's primary context.
How is CHION.md different from CLAUDE.md or AGENTS.md?+
CLAUDE.md and AGENTS.md are conventions Anthropic and OpenAI use to ground an agent in repo context. CHION.md follows the same pattern but is auto-generated from your verified SQL queries, schema profile, and decision history — so it's grounded in your actual database, not your repo's prose.
Is CHION.md a replacement for CLAUDE.md or AGENTS.md?+
No. CHION.md is a superset. Chion exports CLAUDE.md, AGENTS.md, and SKILLS.md mirrors with byte-identical content alongside the root CHION.md. Use whichever filename your agent prefers — same brain, four idiomatic addresses.
Does Chion auto-generate the file, or do I write it?+
Chion auto-generates it, and you can edit it. Three sequential Opus 4.7 compile passes — Persona, Curated SQL Rule Pack, and Dense Layer 2 — produce one per-account agent file. The output is plain Markdown, fully editable, and re-exportable on every refresh.
Can I use the same agent file in Claude Code, Codex, and Cursor?+
Yes. Chion exports CHION.md, CLAUDE.md, AGENTS.md, and SKILLS.md mirrors with identical content. Drop any of them at the root of your repo and the agent reads it on every conversation. Claude Code reads CLAUDE.md, Codex reads AGENTS.md, Cursor reads either — pick your filename, same brain.
How are SKILL folders generated and indexed?+
Every verified query is a candidate skill. After two instances of the same pattern, Chion promotes it under the matching persona at personas/<persona>/skills/<name>/SKILL.md with frontmatter (name, persona, description, triggers, must-read). An auto-generated _INDEX.md catalogs every persona so agents route by persona vocabulary first, then by description keywords.
Can different employees get different agent files?+
Yes. Every skill belongs to a persona — finance-analyst, ops-supply-chain, growth-marketing — and each employee maps to one or more personas. Finance gets revenue-recognition skills; Ops gets lane-comparisons; Growth gets cohort-retention. Same database, different agent files, no data pipeline migration needed.
How often does the agent file refresh? Is it deterministic?+
The compile is deterministic — same inputs produce the same agent file. You trigger a refresh from the Studio header; the system writes one new domain_agents row, transitions it from in_progress to draft to published, and supersedes the prior version. Diff agent files across releases the same way you diff code.
Generate your SQL Analytics Agent file
Connect Postgres. Ask a few questions. Export CHION.md, CLAUDE.md, AGENTS.md, and SKILLS.md.
