بنقرة واحدة
notion-context
// Gather business context from Notion before dbt builds. Searches all configured integrations, extracts definitions/decisions/constraints, writes structured context for the build agent and notion-verify subagent.
// Gather business context from Notion before dbt builds. Searches all configured integrations, extracts definitions/decisions/constraints, writes structured context for the build agent and notion-verify subagent.
BLOCKING REQUIREMENT: If the user's message mentions dbt, SQL, database, or data pipeline — invoke this skill as your FIRST tool call, BEFORE Read, Glob, Grep, Bash, or Agent. Covers: SignalPilot MCP tools, available skills, and the governed workflow for dbt projects, SQL queries, schema discovery, and database access.
Load FIRST before any dbt project work. Covers the full 5-step dbt workflow: project scanning, mapping, validation, contract understanding, SQL writing, and verification. Also covers output shape inference, incremental model handling, and what to trust in YML.
Fix current_date/now() hazards in dbt date spine models. Replaces nondeterministic date references with data-driven boundaries from get_date_boundaries.
| name | notion-context |
| description | Gather business context from Notion before dbt builds. Searches all configured integrations, extracts definitions/decisions/constraints, writes structured context for the build agent and notion-verify subagent. |
Gather business context from Notion using SignalPilot's governed Notion tools.
Call list_notion_integrations. If none exist, skip — Notion context is
optional. Do not block the workflow.
Note which integration has a report destination configured — the verify agent will write there. If multiple have report destinations, use the first. If none have one, the verify agent will fall back to a local file.
Extract keywords from the task instruction — table names, metric names, business terms not defined in YML.
For each integration, search:
notion_search
integration_name: "<name>"
query: "<keywords>"
Merge results from all integrations. Track which integration each result came from — you'll need it for fetch calls.
No results across any integration? Try in order:
If still nothing -> write the context file with No relevant Notion context found. and return.
For each matching page (up to 5 total across all integrations):
notion_fetch_page
integration_name: "<integration that owns this page>"
page_id: "<id>"
If the page lists child pages but has no content — it's a container page. Fetch the child pages that look relevant to the task (by title). Meeting notes and transcripts are typically one level down from the container.
If the page has content — extract from it directly.
Scan page content for three categories:
| Category | Signal phrases | Example |
|---|---|---|
| DEFINITION | "X means Y", "X is defined as", "X = Y" | "active customer = 1+ orders in 90 days" |
| DECISION | "we decided", "agreed to", "going with" | "grain is (shop_id, date)" |
| CONSTRAINT | "exclude", "only include", "must filter" | "exclude test orders where source = 'internal'" |
For each item, tag its relevance to the current task:
| Tag | Criteria |
|---|---|
| DIRECT | Names a table, column, metric, or filter in the current task |
| RELATED | Same domain but doesn't name specific objects in the task |
Discard items with no connection to the task.
For each kept item record:
Check for contradictions between items. If two sources disagree, flag both
with CONFLICT:. Do NOT silently pick one.
Write notion_context.md in the working directory:
# NOTION CONTEXT
# Report Integration: <integration with report destination configured>
# Task: <task summary>
# Sources: <N> pages searched across <M> integrations, <K> items extracted
## DEFINITIONS
- [DEF-1] [DIRECT] "<term>" = <definition>
Source: <page_title> — https://notion.so/<page_id> (via <integration_name>)
## DECISIONS
- [DEC-1] [DIRECT] <decision statement>
Source: <page_title> — https://notion.so/<page_id> (via <integration_name>)
- [DEC-2] [RELATED] <decision statement>
Source: <page_title> — https://notion.so/<page_id> (via <integration_name>)
## CONSTRAINTS
- [CON-1] [DIRECT] <constraint>
Source: <page_title> — https://notion.so/<page_id> (via <integration_name>)
## CONFLICTS
- <item A> (from <page_A> via <integration_A>) vs <item B> (from <page_B> via <integration_B>)
## SOURCES CONSULTED
- <integration_name>: <page_title> — https://notion.so/<page_id> — <N> items
The # Report Integration: line tells the verify agent where to write the
report. Each item tracks which integration it came from.
Return DEFINITIONS, DECISIONS, and CONSTRAINTS to the calling agent. The agent MUST:
-- NOTION: [DEF-1] <brief reason> comments in SQL for every decision
influenced by Notion context. Use the item ID from the context file.