reflection

Validates SQL query results against plausibility checks and proposes data model updates.

21|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/ryanjanssen/metalayer --skill reflection-ryanjanssen
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: reflection
Source: https://github.com/ryanjanssen/metalayer/tree/main/skills/reflection
Command: npx skills add https://github.com/ryanjanssen/metalayer --skill reflection-ryanjanssen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Query results from a data warehouse can be silently wrong due to bad joins, fanout, overly restrictive filters, or misunderstood business rules, and hard-won context about tables and fields is lost after each session. ## Core Features & Use Cases - Plausibility Checks: Automatically inspects every execute_sql result for row count anomalies, invalid value ranges, out-of-bounds dates, grain mismatches, magnitude drift versus past queries, and high null rates. - Validation Rules: Enforces custom validation rules defined on field files and lore files in the data model vault, catching domain-specific mistakes that generic checks miss. - Self-Learning Proposals: Maintains a scratchpad of unmapped columns, guessed joins, and contradictions, then batches proposals for new or updated vault files after presenting results. - Use Case: After running a monthly revenue query, the skill flags that revenue contains unexpected negative values, retries the query with a corrected join, and then proposes a new relation file documenting the join for future queries. ## Quick Start Ask the agent to check the results of your last SQL query for plausibility issues and propose any missing data model files.

Frequently Asked Questions about reflection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate SQL query results automatically?▼

Run plausibility checks on every result set covering row counts, value ranges, date bounds, grain consistency, magnitude versus past queries, and null rates. Failed checks trigger query adjustment and re-execution, with up to two retries before presenting results with caveats.

What is a semantic layer validation rule for data fields?▼

A validation rule is a `validation` key in a field or lore file's frontmatter stating a domain-specific expectation, such as revenue always being positive. The agent checks query results against these rules and flags violations prominently before presenting.

When should the agent propose new data model files?▼

Proposals are required whenever a query used a join with no relation file, a column with no field file, a table with no view file, or a business rule not captured in the vault. Proposals are batched after results and always require explicit user approval.

Why does my SQL query return zero rows or millions of rows?▼

Zero rows usually means a filter is too restrictive or a join key does not match, while millions of rows typically indicate fanout from a bad join. Both conditions require investigating the query logic before presenting any results.

When should data model changes not be proposed?▼

Do not propose changes when query results are suspicious or unverified, or when the user gave negative feedback on the query. Fix the query first, confirm correctness, and only then capture the learning in the vault.