setup-context
Original:🇺🇸 English
Translated
Bootstrap a nao agent for a project — gather warehouse + scope + extra-context info in one round, look up the warehouse-specific config from nao docs, write nao_config.yaml, run nao init + nao sync, set up the LLM key, and generate the first RULES.md. Use when the user has just decided to use nao on a new project. Only for first-time setup; for editing rules, generating tests, or reviewing an existing context, use write-context-rules / create-context-tests / audit-context.
9installs
Sourcegetnao/nao
Added on
NPX Install
npx skill4agent add getnao/nao setup-contextTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →setup-context
Take the user from to a synced project with a starter .
pip install nao-coreRULES.mdBe brief. One batch of questions, then act. Don't ping-pong.
Scope ceiling: ≤100 tables. Above that, sync gets slow and per-table context budget gets thin. 20 is a great target.
Step 1 — Ask everything in one round
Send a single message asking for:
- Warehouse + auth — type (BigQuery / Snowflake / Postgres / Redshift / DuckDB / Databricks / Athena / ClickHouse / Fabric / MSSQL / MySQL / Trino), and the auth credentials they have on hand. Tell them you'll fetch the exact field names from the nao docs once they pick a type.
- Scope — which tables. Two valid shapes:
- Broad — gold/marts across multiple domains (exec / cross-functional agents).
- Deep — silver + gold for one domain (team-specific agents).
- Extra context — dbt / ETL / BI repos, Notion, internal docs. Ask for the SSH git URL of each repo (e.g. ) — sync clones them. No local paths.
git@github.com:org/repo.git - LLM — provider + model. Key comes later (Step 5).
Step 2 — Look up warehouse fields, write nao_config.yaml
, run nao init
nao_config.yamlnao init-
Fetch the warehouse-specific config from docs.getnao.io/nao-agent/context-builder/databases. Each warehouse has its own required and optional fields (e.g. BigQuery needs+
project_id(optional); Snowflake needsdataset_id+account_id+warehouse(optional); Postgres needsschema_name+host+port+database(optional). Ask the user for any required field you don't already have.schema_name -
Writefrom the answers (skeleton in appendix below).
nao_config.yaml -
Run— it detects the existing yaml and offers to update; confirm. Folder scaffold gets created. Say "no" to optional providers (skills / MCPs / Notion / Slack); edit the yaml directly afterwards if needed.
nao init -
Print a summary ofto the user before going further. Format example:
nao_config.yamlnao_config.yaml summary • project: <name> • warehouse: BigQuery (project=<id>, dataset=<id>, auth=service-account) • scope: include=["analytics.fct_*", "analytics.dim_*"], exclude=[] • templates: [columns, preview, description] • repos: company-dbt (git@github.com:org/company-dbt.git) • llm: anthropic / claude-sonnet-4-7 (key via ${ANTHROPIC_API_KEY})Ask the user to confirm before continuing. This is the last cheap chance to catch a wrong project, a misspelled dataset, or a missing repo.
Database templates
field
templatesPer database in the yaml, set:
yaml
templates: [columns, preview, description]That's the set this skill ships. Other values are valid per-warehouse (, , , and for ClickHouse) — see the docs link above — but stick to unless the user specifically asks otherwise.
how_to_useprofilingai_summaryindexes[columns, preview, description]Don't use — deprecated (renamed to ).
accessorstemplatesnao initnao_config.yamlRULES.md.naoignoredatabases/repos/docs/semantics/queries/tests/agent/{tools,mcps,skills}/Step 3 — nao sync
nao syncAfter the user confirms the summary in Step 2:
bash
cd <project> # where nao_config.yaml lives — every nao command runs from here
nao syncCommon failures: auth (fix yaml), tables not found (check schema casing), permission denied (grant read access), repo missing (fix block, confirm SSH key). Don't move on until sync is clean.
repos:Step 4 — Generate RULES.md
(no confirmation)
RULES.mdHand off directly to . Don't ask.
write-context-rulesStep 5 — Wire up the LLM key
The key lives in . Two safe options:
nao_config.yaml- Preferred: env-var ref. Write ; tell the user to export the key in their shell.
api_key: ${ANTHROPIC_API_KEY} - If they insist on a literal: tell them to edit the yaml themselves and add it to . Never ask them to paste a key into chat.
.gitignore
Then to confirm.
nao debugKnown issue — AI_APICallError: Not Found
AI_APICallError: Not FoundIf / / fails with that error and the URL is (no ), the parent agentic CLI (Claude Code, Cursor, Codex) is leaking into the child env. Fix:
nao chatnao debugnao testhttps://api.anthropic.com/messages/v1/ANTHROPIC_BASE_URLbash
unset ANTHROPIC_BASE_URL ANTHROPIC_API_KEY
nao chat # or debug / testRegular human terminals aren't affected.
Step 6 — Recommend next steps
- Smoke test: , ask 3-5 real questions.
nao chat - Review for wrong inferences.
RULES.md - Pick a next skill: (refine),
write-context-rules(benchmark),create-context-tests(anytime),audit-context(only after tests reveal metric-reliability gaps).add-semantic-layer
Guardrails
- into the project directory before any
cdcommand.nao - Cap at ~100 tables.
- One batch of questions. Look up warehouse-specific fields from the docs, don't keep pinging the user.
- Run non-interactively with the yaml pre-written.
nao init - Use . Don't use
templates: [columns, preview, description].accessors - Repos: SSH git URLs only. No local paths in the block.
repos: - Print the summary and get user confirmation before
nao_config.yaml.nao sync - Never have the user paste their LLM key into chat.
- Don't ask before invoking — just hand off.
write-context-rules
Appendix — nao_config.yaml
skeleton (BigQuery example)
nao_config.yamlUse this shape and adapt the block per warehouse — see docs.getnao.io/nao-agent/context-builder/databases for the exact required/optional fields for Snowflake, Postgres, Redshift, Databricks, Athena, ClickHouse, Fabric, MSSQL, MySQL, Trino.
databases:yaml
project_name: <project>
databases:
- type: bigquery
name: <connection-name>
project_id: <gcp-project-id>
dataset_id: <dataset>
credentials_path: /path/to/service-account.json # or `sso: true`
include: ['<dataset_pattern>.<table_pattern>'] # e.g. "analytics.fct_*" - use '*' as multiple patterns
exclude: ['<pattern>']
templates: [columns, preview, description]
llm:
provider: anthropic # openai | bedrock | azure | gemini | mistral | ollama
api_key: ${ANTHROPIC_API_KEY}
repos:
- name: <repo-name>
url: git@github.com:<org>/<repo>.git # SSH only