/metalayer:sql-consensusfrom metalayer
Generates SQL queries through a 5-sub-agent consensus protocol using vault file context. Automatically activates for data questions to ensure accurate SQL generation.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /metalayer:sql-consensus still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
5-sub-agent SQL generation protocol. Do not skip this — every data question goes through consensus.
Assemble all vault files gathered during navigation into a single clean context block. Include:
table frontmatter value for each view).Do NOT include raw search results, navigation metadata, similarity scores, or any intermediate artifacts. The context block must be self-contained — a reader with no vault access should be able to write the query from it alone.
Spawn 5 sub-agents. Each receives an identical prompt containing:
filters frontmatter) whenever using that metric.Each sub-agent returns:
Check all 5 SQL outputs for semantic equivalence. Ignore whitespace, alias naming, and column ordering differences. Two queries are semantically equivalent if they use the same tables, same joins, same aggregation logic, same filters, and same grouping.
If all 5 (or nearly all) agree: done. Take the cleanest version and proceed to output.
If they disagree: go to Step 4.
Do NOT vote, pick a winner, or average the results. Instead, figure out WHY they disagree. Common causes:
For each disagreement, identify:
Based on the diagnosis:
If the user needs to clarify: ask them. Explain the ambiguity concisely — "Some agents interpreted 'revenue' as gross, others as net. Which do you mean?" Once they answer, incorporate their answer into the context block and go back to Step 2.
If the context is missing or conflicting: refine the context block. Fetch additional vault files (get_context calls), resolve the conflict, add clarifying notes to the context block, and go back to Step 2.
If the grain is ambiguous: check the view's one_row_means and dedup_key fields. Add explicit grain instructions to the context block and go back to Step 2.
Each retry is a full 5-agent quorum with the refined context — not a partial fix or a vote on the old results.
Maximum 3 full quorum rounds. Track what changed between rounds:
If after 3 rounds the agents still produce meaningfully different SQL, stop. Do not guess. Tell the user:
"I wasn't able to get a consistent answer after 3 attempts. The disagreement is about [specific issue]. This likely means the question needs to be more specific, or the data model needs more context in this area. Here's what I tried: [brief summary of refinements]."
Note the unresolved disagreement in the scratchpad for the reflection phase — it's a strong signal that the vault needs work in this area.
Return:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
None: SKILL.md is the whole skill.
Generated from the plugin's indexed repository (ryanjanssen/metalayer) — no native marketplace selected
npx claudepluginhub p/ryanjanssen-metalayer9 skills in this plugin
/ask-dataAsk DataMaster workflow for answering data questions. Follow each phase in order./context-auditContext AuditSemantic checks the LLM performs on vault content. Static validation (duplicate filenames, dangling refs, circular extends, missing type) is handled by Python. This skill covers the checks that require understanding meaning./learnYou are a learning subagent. Your only job is to review what just happened in a data query and propose updates to the vault. You cannot skip this — it is your entire task./propose-checklistPropose ChecklistRead this BEFORE drafting any vault change proposal. Answer each question for every proposed file./reflectionPost-execution quality checks. Run these after every execute_sql call./setupInitialization workflow for a new Metalayer vault. Run this when starting from scratch or verifying an existing installation.Other plugins' skills for the same job