/nodal-analytics:context-interviewfrom nodal-analytics
Interviews analysts to build or improve an ACF analytics-context repo with metrics, entities, caveats, eval seeds, and a five-question test drive. Use for context-layer creation or correction, not for dbt code or eval-harness operation.
Ships in nodal-analytics. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Approval contract: new and changed context stays on a named working branch and has no authored approval status. Human-reviewed protected merge grants definition approval; consult the live authority through the runtime for the exact revision and freshness. Missing/expired authority evidence prevents governance certification; it does not by itself prohibit an explicitly approved, unverified read-only analysis. Known revoked definitions or materially stale dependencies still require resolution. Explicit branch-test mode is proposed context only. Query/notebook result verification is separate from definition approval; retain source and review evidence. See the context-interview SPEC approval-through-merge contract.
Never add status: draft or status: confirmed to YAML, Markdown frontmatter,
HTML comments or ownership tables. Track interview progress in conversation and
unresolved questions in review notes/open decisions. Runtime eligibility is not
authored metadata. Preserve existing legacy fields only for explicit migration.
You are conducting a structured interview with a data analyst to build their analytics context layer. You are not auto-generating it from their warehouse. The analyst owns every definition; you draft, they confirm. Your job is to ask the questions a sharp new senior analyst would ask on their first week, and to write down the answers in a format an agent can query and a team can review.
Two outputs, always produced together:
references/SPEC.md defines it until
the scaffold creates the repo-local SPEC.md).evals/seeds/. This is not optional; it's how the value gets measured.Re-estimating questions remaining; see references/session-progress.md.client_id vs client_uuid, competing
grain readings in the schema, gross vs net columns that both exist, a dbt
description that disagrees with what dashboards actually run, two teams'
definitions) → present them as a forced choice. Each option is a distinct
substantive reading with its evidence cited ("SUM(net_revenue) — 365
Tableau runs"); the analyst can always reject them all in their own words.
Never invent a foil — an alternative with no evidence behind it is a quiz,
not a question.expression: read-back,
references/interview-flow.md §4), or when the confirm is anchored to a
number from a dashboard the analyst trusts (Stage 5) — read aloud by the
analyst, or captured by dashboard-verify and reviewed by the analyst with
its extraction tier and filter state visible.
A bare Confirmed/Needs-fixing option pair is the tell that you skipped the
ladder. Rejected options are harvested, not discarded — see
references/eval-seed-harvesting.md.references/interview-flow.md.In both the full interview and test drive, show a compact text indicator above
each question: current domain/stage, answered count (or test-drive core topics
complete), and estimated questions remaining. Read references/session-progress.md
at session start for counting, scope changes, verification, and resume behavior.
Before Stage 0, look for the nearest .nodal.local.json from the user's current
directory upward, stopping at its git root. Accept only version: 1. Treat it as
a hint, never as proof: use enabled local context_sources to locate ACF, KTX,
dbt, or documentation candidates, then re-probe live source, warehouse, metadata,
query-history, and browser capabilities before relying on them, especially when
verified_at is stale. If the file is absent, invalid, or a probe fails, report
the degraded path and continue normally. Never write or repair this file; only
the explicitly invoked setup-nodal skill may do that. Never expose raw
authentication errors or secrets in context files or reports.
Run them in order, but let the analyst jump around. Each stage has its own reference file — read it when you enter the stage. Don't load all of them up front.
| Stage | Goal | Reference |
|---|---|---|
| 0. Setup | Lay down the repo, auto-extract a draft (dbt + query history), report every source's disposition | references/repo-scaffold.md, references/dbt-extraction.md, references/query-history-extraction.md |
| 1. Company | What the business does, the cross-domain glossary | references/interview-flow.md |
| 2. Domains | Discover domains from dashboards, capture each | references/interview-flow.md |
| 3. Entities | Disambiguate the terms that map to data values | references/interview-flow.md |
| 4. Caveats | The wrong-answer modes a senior analyst warns about | references/interview-flow.md |
| 5. Verify | Answer live, compare with dashboard or independently rerun notebook, harvest seeds | references/live-verification.md, references/notebook-verification.md |
| 6. Observed demand | Review queued questions, resolve gaps, retain equivalent phrasings, and import methods from notebooks on request | references/observed-demand.md |
At every stage from 1 onward, emit eval seeds per
references/eval-seed-harvesting.md. Stage 5 runs at each domain's close (see
"Closing each domain") — it's where the analyst sees the context pay off.
Stage 6 is also a resumable entry point for an existing repo. Queue presence
does not authorize edits: present interpretation choices and a concrete preview
before applying the corresponding reviewed changes. Derived definitions and
new seeds remain draft until the normal human confirmation process completes.
The stages above are the full interview. There is one other traversal — the
test drive (references/test-drive.md): the same state machine at a hard
~30-minute, five-question budget for ONE domain, ending with a small live check
and everything unasked left as proposed working-branch content stubs. It's the fastest way to
see the whole loop work on the analyst's own data — interview, context, live
delta — before they commit real time. Offer the choice right after Stage 0
setup: "Full interview for this domain, or a 30-minute test drive — five core
questions, a live check, and the rest drafted for later?" Enter it whenever
the analyst signals time pressure or wants a demo first ("take it for a test
drive", "show me how it works", "I've got half an hour", "quick version") —
including mid-session: a full interview running out of time converts by jumping
to the test-drive close-out ritual. A test drive is a stopping point, not a
different product: its close-out depth-stamps the domain ("five questions deep,
N drafts open") so speed never masquerades as coverage, and resuming later is
the normal Stage-0 resume from the stubs. Read references/test-drive.md when
you enter it.
.sim-analyst.json at the
current project/context repo root. Keep its location across directory changes.
If it exists, you're in simulated-analyst mode — read
references/simulated-analyst.md and follow it for every question in all stages (a
subagent answers from a brief; you escalate to the human only when it's not
confident; non-interactive runs record the pending question and pause).
Simulator-only objects always remain draft with no invented approval metadata.
If the marker is absent, ignore this and run the normal human interview.SKILL.md; do not assume an environment variable or repository checkout.
Read its bundled references/SPEC.md. After scaffolding, switch to the
generated repo's own SPEC.md, schemas, scripts, and harness.context.config.yaml at its root
(default target: ../analytics-context/, resolved relative to the user's
project root). Always show the resolved destination and get confirmation
before writing. An empty default path is
not evidence of a fresh build: the analyst's repo may live elsewhere, or
only on GitHub.
context.config.yaml in the common places — everything within a few
levels of the current directory and its 2–3 nearest ancestors. Exact
tested recipe in "Locating an existing context repo" in
references/repo-scaffold.md; don't improvise a wider one. For each hit,
read its identity: company, domain roster, open-draft count, last commit
author + date.~/work/shorelane-analytics-context — Shorelane, 3 domains,
4 drafts open, last commit 2 days ago by Priya. Continue that one, continue
a different one (give me a path or a GitHub URL to clone), or start fresh?"
Found none: "Starting a brand-new context repo, or continuing an existing
one — yours or a teammate's? For an existing one, give me a local path or
the GitHub URL and I'll clone it." Cloning from GitHub is a first-class
continuation entry point — the remote is a context repo's durable home.context.config.yaml
parses, read back the identity summary, and get an explicit yes.
Continuing a teammate's repo is a supported handoff, but it must happen
knowingly, never because a glob matched.context.config.yaml (which domains are wired),
company/org-structure.md (the Domain | Owner | Team roster), and count
the remaining proposed working-branch content stubs. Open with a status summary and a
choice instead of restarting Stage 1: "Captured so far: billing
(confirmed), scheduling (4 drafts open). Continue scheduling, or start a
new domain?" Follow "Updating an existing repo" in
references/repo-scaffold.md. In resume mode, run step 4's dbt extraction
only when drafting a new domain — and derive the clone command from
the repo: already recorded in context.config.yaml ("git clone github.com/acme/acme-dbt, then dbt parse") rather than asking where
the project lives.context.config.yaml:
resolve scripts/scaffold.py from this loaded skill directory and run it
with the confirmed target. In simulated mode, also pass
--sim-marker /absolute/path/.sim-analyst.json so the marker follows the
interview into its generated repo. The script copies the template (end-user
README.md, consumption-first CLAUDE.md, and AGENTS.md) plus the CI support set
(.github/workflows/, .ci/, schemas/, SPEC.md, context-repo-local
scripts, acf_runtime/ and eval_harness/) and self-checks the result. Confirm the self-check
passes before continuing. Initialize a fresh repo with git init -b main;
commit only when requested — see
references/repo-scaffold.md for details.warehouse: default. For a multi-platform shop, leave
the non-default sources' warehouse: to be filled in lazily as domains are reached
(Stage 2, Q4) — don't enumerate every source now. More than one warehouse
connection or warehouse MCP server is itself the signal to ask this rather than
assume one platform.git clone your dbt repo into a sibling directory and
point me at it — I'll draft your tables, grain, and metrics from it so you correct
real definitions instead of describing them from scratch." It's the single
highest-leverage input to a fast, accurate interview; wait for it if they're
willing to grab it. If they don't use dbt or can't share it, proceed without —
don't block. Then run the extractor per
references/dbt-extraction.md: have the analyst dbt parse (no warehouse
needed) and read target/manifest.json, or fall back to parsing dbt source
files. It yields grain evidence (uniqueness tests), real table names, value sets
(accepted_values), join paths (relationships), dashboards (exposures), and
the model dependency graph — each drafted as proposed working-branch content tagged
# dbt-derived. It also reports what dbt did not provide, so you elicit those
by hand instead of faking them. The local clone path is for extraction only —
never persist it into context.config.yaml: derive the durable repo: from
git -C <local-dbt> remote get-url origin and confirm it with the analyst; if
the clone has no remote, omit repo: and flag it for wrap-up (see
references/repo-scaffold.md).SELECT 1 or a dataset listing). If it fails on auth, tell the analyst the
reauth fix immediately (e.g. gcloud auth application-default login for
BigQuery ADC) and keep interviewing without the warehouse — reauth can run in
the background, and nothing before Stage 5 requires a live connection. Note
any warehouse checks you skip for connectivity (schema pulls, empirical grain
checks) and re-run them at Stage 5 pre-flight;references/query-history-extraction.md — the script emits the extraction
SQL, you execute it read-only via the warehouse MCP, and the script clusters
the rows into .query-findings.json. Recurring BI-service clusters become
Stage-2 dashboard-catalog candidates; conflicting calculations over the same
tables are interview questions, never answers. Everything drafted from it
is proposed working-branch content, tagged # query-history-derived. The step ends in
exactly one of four outcomes, each recorded in the step-6 disposition
report:
--emit-sql anyway so the script itself confirms it loudly, tell the
analyst mining is unavailable on their platform, and continue.
A probe that was down when you first read this bullet does not retire it —
the condition gets re-checked, not the step skipped.context.config.yaml (lineage sources) and as proposed working-branch content
stubs. Tell the analyst: "I pulled a rough draft from your dbt project and schema.
We'll correct it together — don't trust any of it yet." Never auto-assign a
source's warehouse: from connection metadata without the analyst confirming it.references/repo-scaffold.md for exactly which files to create and how to
wire context.config.yaml's domain↔lineage map.extracted / no project / deferred: <why>ok / deferred: auth (fix handed over)mined (<N> clusters) / deferred: auth /
deferred: privileges (grant note handed over) / unsupported: <platform>
A source you can't write a disposition line for is a source you skipped — go
back and run it before proceeding. Every deferred: line is the
deferred-checks list; carry it forward and re-probe it at the §2 domain
passes and Stage-5 pre-flight.Start from the company's public web page if given a URL: read it, draft
company/overview.md, and ask the analyst to correct it. Then build
company/terminology.md by asking for the 5–10 terms a new hire always
misunderstands. See references/interview-flow.md §1.
A domain is how the company already thinks about a slice of the business. The
best proxy is the dashboard catalog. Ask: "What are the dashboards your team
maintains, and who owns each?" Cluster them. Each coherent cluster is a domain.
When drafting metric expressions, use ACF 0.3 any_of/all_of for filter
alternatives, entity_filters for conditions on entity groups, and metric(name)
for domain-local metric arithmetic. Read back and confirm every component; edits
remain proposed on a working branch until reviewed merge; do not write status fields. Require grain, inherit lineage for reference-only
arithmetic, and check dimension subsets and acyclic references. Keep placeholders
under parameters; use context.config.yaml: version: "0.3"; legacy layouts require explicit migration first.
Write each metric to domains/<domain>/metrics/<name>.yaml, with name matching
the filename. Share repeated domain-local lineage, filters and parameters through
_shared.yaml; consumers expand these before validation/matching. Use
metric(domain.name) for explicit cross-domain composition. Ratios declare
zero_denominator and a rationale. Inexpressible components name the unsupported
construct and point to a confirmed anchored pattern or root method. Resolve
family/alias choices and explicit open decisions with the human; never infer an
approval from metadata or silently choose a family default.
For composed analyses, author methods/<slug>.md with an owning domain, resolved
metrics, parameters, decisions/without_this, output and qualitative checks.
Review every decision and override, including stock/flow alignment where needed.
Give each parameter a note and explain optional output columns in decisions.
Governed entity references are dependencies; their unresolved decisions or live blocks also block the method.
Declare referenced metrics explicitly and keep runtime literals in parameters,
including in procedure steps. Illustrative worked examples may show bound values.
Methods contain no runnable SQL/Python. Metrics, methods and seeds become approved only through protected human-reviewed
merge. Keep changed interpretations on working branches and retain prior attribution
as review history. Missing or stale authority evidence blocks governed use.
For each domain capture domain.yaml (tables, grain, dashboards, lineage
pointer, owner), a narrative context.md, and — the important one — a
reference.md written for the agent using the skeleton in
references/reference-doc-skeleton.md. When you confirm a domain's owner, record it
in both domain.yaml: owner and a row in company/org-structure.md (the routing
roster) — keep the two in sync. See references/interview-flow.md §2.
For each domain, find the terms that map to specific data values and are ambiguous:
the "active client", the "provider" that could mean two things, the payer that's
really state-specific. Write subject entities (business nouns — customer,
channel, geography) to entities/<group>.yaml and single-fact-table status/type
values to domains/*/entities.yaml, per the placement rule in SPEC.md. Even
in a single-domain repo, subject entities go top-level.
Each ambiguity confirmed → an eval seed. See references/interview-flow.md §3.
Ask the question that surfaces silent failures: "If I handed a new analyst this
data and they wrote the obvious query, where would they get a plausible but wrong
answer?" Capture these in known-issues.md and as routing triggers in the domain's
reference.md (IF … DO NOT …). These are the highest-value eval seeds because
they're the failures users won't notice. See references/interview-flow.md §4.
Prove the context works before asking for more. Answer a handful of the domain's
questions against the live warehouse twice — context off and on — using
parallel in-session subagents, then have the analyst confirm the on-answer against a
dashboard they trust. When a browser MCP binding is available, the dashboard-verify
skill reads the dashboard (tier-tagged capture + filter state) and the analyst
blesses the capture instead of reading numbers aloud; the reconciliation report it
yields is the shareable proof. A match becomes a value_at_snapshot / dashboard seed; the
blessed SQL is captured and encrypted in the same operation via
scripts/verified.py capture (references/verified-sql.md). The seed's
verified_query_file points at ignored plaintext evals/verified/<name>.sql;
only .sql.age/.sql.sops ciphertext is eligible for commit. Report local-only
mode or encryption failure explicitly. A mismatch is harvested back
into the context (a caveat + a correction seed). Print the off→on→truth delta so the
analyst sees the payoff. This is the free "see the aha once" runner — not the
formal/continuous harness. See references/live-verification.md.
For a notebook-derived method, use references/notebook-verification.md: statically
import a draft with scripts/import_notebook.py, review its decisions with the
analyst, then rerun the source notebook and independently generate and execute a
method-based answer against identical pinned inputs. Use fresh answer context
without the notebook implementation, reference output or expected seed values.
Compare keyed results, disclosures and method checks. Only a real human-confirmed
match promotes a notebook snapshot seed. Missing execution is blocked/skipped;
static import and simulated-analyst answers never count as execution evidence.
Return here after Stage 6 method review without restarting the interview. If the
analyst defers verification, retain a local candidate case with the source pointer,
question, known bindings and missing prerequisites; do not invent snapshot values.
The reusable method retains its decisions and checks. Numerical expectations live
in a separate method-targeted snapshot seed, graded on both numbers and behavior.
When a domain's reference.md, metrics/*.yaml, seeds, and entity coverage
(subject entities in entities/<group>.yaml, domain statuses in the domain's
entities.yaml) exist:
schemas/*.json; fix
anything that fails.draft. Confirm the domain's owner
is recorded in both domain.yaml and company/org-structure.md (they must agree).references/live-verification.md) or a notebook-derived method
(references/notebook-verification.md). Dashboard verification uses the
in-session off/on/truth pass; notebook verification compares a fresh reference
run with an independent method answer. The formal/continuous delta at scale, drift,
and historical measurement remain separate harness/service concerns
(eval_harness/INTERFACE.md). Missing evidence never becomes a perfect score.Use references/observed-demand.md to review the local queue in priority order,
present semantic choices, and prepare/apply resumable edits. Equivalent questions
may become reviewed variants; new slices or definitions stay draft pending their
own confirmation. Correct declines use negative seeds. Dismissed observations
do not create seeds. Keep queues and history local. Notebook import is static
drafting; its independent result check remains Stage 5, even when discovered here.
Stage 6 can be entered directly on an existing repo. It does not expand the
five-question test drive or silently ingest every observed question.
When the analyst wants to stop — mid-domain is fine — leave the repo in a state a future session (or a teammate) can pick up cold:
wip: scheduling domain — 4 entity drafts open. Otherwise leave
a reviewable working-tree diff. Never include raw queues, briefs or run evidence.references/repo-scaffold.md).Once the analyst is done for the session, offer to put the repo on GitHub so the team can review by PR and the CI workflows run. Publishing requires their instruction; preserve explicit authorization already given in this session.
gh auth status. If it succeeds, offer: "Want me to create the GitHub repo
and push? I'll run gh repo create <name> --private --source . --push." Run it
only on an explicit yes.gh is missing or unauthenticated, don't fail — print the manual commands for
them to run:
git remote add origin [email protected]:<your-org>/<repo>.git
git push -u origin main
README.md for how their team then uses it with Claude Code, then move
straight into the sharing offer below — with the actual links pasted, not just a
pointer to SHARING.md.context.config.yaml
lineage source has no cloneable repo: (a local-only dbt project, flagged in
Stage 0), tell the analyst: "drift monitoring for <source_id> stays off until
that dbt project is on GitHub — when it is, set repo: to its github.com/org/repo
path." If the remote exists by now, offer to fill it in before pushing.Sharing the context with the team is the point of building it. Once the repo is pushed, present the options and encourage them to stand it up now — self-hosting is always free and their files stay open, so this is an offer, not a lock-in.
Paste the URLs verbatim in your message — "see the Launch link in SHARING.md" is
not enough; the analyst should be able to click, not go hunting. Give all three:
SHARING.md for the full details (tool surface, the 3-step setup,
contact links).Do not end a completed full interview on repository mechanics, sharing, or a punch list. Offer immediate use of the context with the same two-path handoff as the test drive:
Try it now — ask your first question.
- Ask directly (fastest): in Claude Code or Codex, ask a business question in plain English. From the context repo, the
CLAUDE.mdorAGENTS.mdinstructions route the answer through the confirmed context and read-only warehouse connection.- Use self-service analytics (reviewable): invoke
analytics-plan(/nodal-analytics:analytics-planin Claude Code;$analytics-planin Codex) for an explicit interpretation and plan, approval before read-only SQL, and post-query verification.Other available workflows:
verify-resultaudits SQL and results against the approved plan;challenge-resultgives a completed answer an independent second review;dashboard-verifyreconciles an answer with a trusted dashboard; andcontext-interviewrecords a newly resolved definition or caveat back into context.Which path do you want, and what's your first question?
Keep the skill list this short and action-oriented. setup-nodal and
analyst-handoff remain available, but they are setup/transition workflows, not
ways to answer the analyst's next business question. This is the last
user-facing block in the full-interview close.
reference.md "Common query patterns"
— references/reference-doc-skeleton.md draws the line.)_To be confirmed by [owner]._ and mark proposed working-branch content.The loop has two failure modes, and both void the premise that a human owns the definition:
The entire premise — and the reason this beats auto-generation — is that a human owns the definition. Either failure mode has failed the interview even if the files look complete.
payload/acf_runtime/__init__.py (opens in a new tab)payload/acf_runtime/columns.py (opens in a new tab)payload/acf_runtime/drift.py (opens in a new tab)payload/acf_runtime/expressions.py (opens in a new tab)payload/acf_runtime/fragments.py (opens in a new tab)payload/acf_runtime/governance.py (opens in a new tab)payload/acf_runtime/impact.py (opens in a new tab)payload/acf_runtime/loader.py (opens in a new tab)payload/acf_runtime/markdown.py (opens in a new tab)payload/acf_runtime/matching.py (opens in a new tab)payload/acf_runtime/methods.py (opens in a new tab)payload/acf_runtime/notebook_verification.py (opens in a new tab)payload/acf_runtime/notebooks.py (opens in a new tab)payload/acf_runtime/observed.py (opens in a new tab)payload/acf_runtime/observed_review.py (opens in a new tab)payload/acf_runtime/registry.py (opens in a new tab)payload/acf_runtime/regrade.py (opens in a new tab)payload/acf_runtime/regression.py (opens in a new tab)payload/acf_runtime/semantic_lint.py (opens in a new tab)payload/acf_runtime/simulation.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
analytics-context, acf, context-layer, analyst-interview, eval-seeds
7 skills in this plugin
/analyst-handoffCapture analytics knowledge from an analyst who is changing roles, leaving, or transferring domain ownership, producing governed ACF context and eval seeds through context-interview. Use only for an intentional knowledge-transfer or analyst-transition request./analytics-planPlan and answer business analytics questions against read-only data, grounding interpretations in available ACF, KTX, dbt, documentation, and warehouse evidence. Use for metrics, reports, trends, comparisons, or warehouse questions. Do not use to author context, modify data, or write dbt models./challenge-resultChallenge a completed analytics answer when the user disputes it or requests a second opinion, testing alternative interpretations and failure hypotheses before upholding it, escalating uncertainty, or handing a correction to analytics-plan. Do not use for routine first-pass verification.npx claudepluginhub nodal-data/nodal-context --plugin nodal-analyticsOther plugins' skills for the same job