getnao/nao

create-context-tests

Generate a test suite of natural-language → SQL pairs that becomes the quality benchmark for a nao agent, then run it via nao test.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/getnao/nao --skill create-context-tests

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

create-context-tests

nao test runs each natural-language prompt through the agent, executes both the agent's SQL and the test's expected SQL against the warehouse, and diffs the result data row-by-row. A test passes only if the actual data matches — same rows, same values. The suite is the reliability benchmark; every change to RULES.md is measured against it. Reference: docs.getnao.io/nao-agent/context-engineering/evaluation.

How many tests

One test per key metric in `## Key Metrics Reference` is the floor. Then add tests for: time scoping (especially "last 8 weeks" / "last 30 days"), CTE / multi-step queries, edge cases (NULLs, empty windows), and ambiguous wording ("our users", "active") to validate naming-convention rules.

Two authoring rules — apply to every test

Rule 1 — Prompts read like real chat. Vague, short, no table/column/method hints. The test verifies the agent reaches the right answer from a real-user input.

BadGood
"What was the churn rate from fct_subscriptions in Q1?""How's churn looking this quarter?"
"Compute MRR as SUM(mrr_amount) where status='active'""What's our MRR?"

Rule 2 — Output column names encode format / unit, not source. A column name communicates how to interpret the value.

BadGood
churn_rate_from_fct_subscriptionschurn_rate_float_0_1
mrr_amount_fct_stripe_mrrmrr_usd_dollars
signup_at_dim_userssignup_date_yyyy_mm_dd

Naming patterns: <metric>_float_0_1 or <metric>_percentage_0_100 for rates; <metric>_<currency>_<unit> for money; <thing>_count; <thing>_date_yyyy_mm_dd. See templates/test.yaml.

Steps

  1. Ask once: does the user have trusted source-of-truth queries (Looker, dashboards, prior benchmarks)? If yes, transform each into a test (rewrite SELECT to apply Rule 2; reverse-engineer a Rule 1 prompt). For metrics without a trusted query, draft new tests one per metric.
  1. Save flat under `tests/` (no subfolders), one YAML file per test. Use templates/test.yaml.
  1. Have the user validate — confirm prompts match their team's phrasing and SQL matches their definition of truth.
  1. Run `nao test`. Prerequisites:
  • cd into the project directory (where nao_config.yaml lives).
  • Start nao chat & in the background (the test runner reuses the chat server).
  • LLM configured in nao_config.yaml.
  • First run prompts for login credentials — let the user type them; don't script around it.
  • If you see AI_APICallError: Not Found at https://api.anthropic.com/messages (no /v1/), run unset ANTHROPIC_BASE_URL ANTHROPIC_API_KEY first (parent agent CLI is leaking env vars). See setup-context for the full note.
bash
    nao test -m <model_id> -t 10   # -t = parallelism
  1. Recap results: pass rate, token cost, wall-clock time. Cite this as the baseline.
  1. Diagnose failures (optional): read tests/outputs/ for each failure, identify the rule gap, propose the smallest fix, then route to write-context-rules (or audit-context for systemic issues). Re-run between fixes so impact is attributable.

Guardrails

  • Tests' SQL must execute as-is — no <placeholder> in FROM. Use real table / column names.
  • Never leak the answer in prompt or output column names (Rules 1 + 2).
  • One test per metric is the floor; coverage tests come after.
  • Apply one context fix at a time between runs.
  • If a test contradicts RULES.md, stop and ask which is correct — it's a bug in one or the other.

Templates

  • templates/test.yaml — single-test format.

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills
getnao
커뮤니티

add-semantic-layer

Wire a semantic layer into a nao agent so that metric queries are routed through a single source of truth. Supports dbt MetricFlow (dbt Cloud with Semantic Layer), Snowflake (views or semantic views via MCP), an in-house nao YAML semantic layer, or other tools (via MCP discovery). Installs the right MCP server, updates RULES.md to route metric queries through the semantic layer, and (for the nao YAML option) generates starter metric files. Use after a first round of tests has shown the agent str

설치 수
2
GitHub Stars
1.9천
업데이트
10월 20일
getnao
커뮤니티

audit-context

Diagnose the health of a nao context at any stage of its lifecycle. Use when the user wants a structured review of what's been synced, how RULES.md compares to the target structure, whether every table is documented, whether the data model is MECE, whether tests exist and what their failures reveal, and whether context files are bloated. Outputs a structured audit report with ranked recommendations. Do not use for first-time setup (setup-context) or routine rule writing (write-context-rules).

설치 수
2
GitHub Stars
1.9천
업데이트
10월 20일
getnao
커뮤니티

build-custom-charts

Create or update browser-rendered custom nao chart modules in agent/charts.

설치 수
2
GitHub Stars
1.9천
업데이트
10월 20일
getnao
커뮤니티

deploy-context

Wire a nao project's context folder to a remote nao instance (Cloud or self-hosted) so every push to main automatically runs nao deploy via GitHub Actions. Use when the user has a working local nao project versioned in Git and wants their team's deployed instance to always reflect the latest committed context. Covers nao deploy usage, the GitHub Actions workflow, organization API keys, GitHub Secrets, .naoignore, environment-variable references in naoconfig.yaml, and create-vs-update behavior. D

설치 수
2
GitHub Stars
1.9천
업데이트
10월 20일