/dataspoke:dataspoke-access [set | status]from dataspoke
Connects Claude to a deployed DataSpoke service by configuring API base URL and token, verifying access via /ready and /auth/me endpoints, and reporting deployment status, account identity, and role. Run this first before using other dataspoke-* skills.
Ships in dataspoke. 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.
None: SKILL.md is the whole skill.
Establish and inspect this plugin's access to a deployed DataSpoke service. All other
dataspoke-* skills read the access config this skill writes. It touches only the public API
(/ready, /api/v1/auth/*) — never cluster internals.
Access lives in ~/.dataspoke/config.json (chmod 600):
{
"api_base_url": "https://api.dataspoke.example.com/api/v1",
"token": "dsk_…",
"redoc_url": "https://api.dataspoke.example.com/redoc",
"ui_url": "https://app.dataspoke.example.com",
"datahub_gms_url": "https://datahub-gms.example.com",
"datahub_token": "…"
}
The URLs may sit on different hosts: api_base_url and redoc_url are the API origin (every
DataSpoke call the plugin makes goes there), ui_url is the browsable Web UI.
datahub_gms_url and datahub_token are optional — they are only needed for the validation
skill's DataHub URN search (the datahub-graphql helper), not for basic DataSpoke access.
datahub_gms_url is the GMS origin only (scheme + host[:port], no path) — the helper appends
/api/graphql itself.
Environment variables override the file when present: DATASPOKE_API_URL, DATASPOKE_API_TOKEN
(and, for the DataHub URN search, DATAHUB_GMS_URL, DATAHUB_TOKEN).
Resolve the mode from the argument (set / status); if absent, run status when access is
already resolvable — a config file exists, or both DATASPOKE_API_URL and
DATASPOKE_API_TOKEN are set in the environment (the env-only path step 4 below describes) —
otherwise set.
status — verify current accessdataspoke-api GET /ready — deployment reachable. Read the body, not just the status: it
never returns 503, so status: "degraded" with a false entry in checks (datahub,
postgres, redis) still arrives as 200. Name the degraded dependency in the report.dataspoke-api GET /auth/me — confirm identity and the account's current role. This is
not the token's effective privilege (see the role_snapshot note below) — it's the account
row, so it can read Admin while the token in use still only acts as a Reader./auth/me returns 401, tell the user to run set.set — configure accessBoth first-time setup and re-configuration (rotating the dsk_ token, adding DataHub access
later) go through this mode — dataspoke-validation and datahub-graphql both send users here
to add DataHub credentials, and the Notes below make re-running set the token-rotation path.
A re-run must only change what the user actually wants to change, not silently drop the rest —
dsk_ tokens cannot be listed back out (minted once, never retrievable) and are capped at 10
active per account (409 TOKEN_LIMIT_EXCEEDED), so a user rotating the DataSpoke token but
declining step 3 must keep their existing datahub_gms_url/datahub_token.
This has to be done value-blind — never by reading the stored config into the agent's
context. A run that only wants to add DataHub credentials touches neither the password nor
the dsk_/DataHub tokens in that run; reading the existing file to "carry forward" what it
already holds would pull both secrets into the conversation and this session's transcript for
no reason, defeating the whole point of step 2's out-of-band mint recipe. Instead, check what's
already configured by key presence only, never by value. Keep this (and every embedded
python3 -c command below) as a single logical line — a multi-line quoted Python body picks up
this list's own indentation as literal leading whitespace on each line, which is a Python
IndentationError waiting to happen the moment it's actually run:
python3 -c "import json,os; p=os.path.expanduser('~/.dataspoke/config.json'); cfg=json.load(open(p)) if os.path.exists(p) else {}; print(json.dumps({k: bool(cfg.get(k)) for k in ('api_base_url','token','redoc_url','ui_url','datahub_gms_url','datahub_token')}))"
Use this to decide which of steps 1-3 to ask about (e.g. offer "keep existing" for a token that's
already present, and mention DataHub is already configured rather than re-asking blind) — never
to fetch the values themselves. Step 5's write is a merge performed entirely inside python3,
which is the only thing that ever touches the old values; they're never printed, logged, or
handed back to the agent.
Collect the base URL. A deployment publishes two roles: the API (/ready, /api/v1,
/redoc, /openapi.json) and the Web UI (the browsable app). Ask the user for the API
origin (e.g. https://api.dataspoke.example.com, or the dev
http://api.<INGRESS_IP>.nip.io). Ask for the UI origin only if the user says the UI is
served elsewhere. Derive api_base_url = <api-origin>/api/v1, redoc_url =
<api-origin>/redoc, and ui_url = the UI origin — when one origin serves both, all three
derive from it. Every DataSpoke call the plugin makes goes to the API origin: pointing
api_base_url at the UI host makes even /ready fail.
Then probe the API origin before collecting any credential, so a typo or an unreachable
deployment surfaces as a clear message rather than a confusing failure mid-mint. /ready
is public — no token needed:
curl -sS --max-time 10 -w '\n%{http_code}\n' "<api-origin>/ready"
A 200 with a {"status": …, "checks": {…}} body confirms a reachable DataSpoke. On a
connection failure or a non-200 code, report what was tried and ask the user to correct the
origin — do not proceed to step 2. If the origin is reachable and TLS-valid but /ready
fails, it may be the UI host: ask for the API origin instead of retyping the same host or
declaring the deployment unhealthy. /ready reports state and never returns 503, so read the
body too: status: "degraded" (any false entry in checks — datahub, postgres,
redis) still arrives as 200. Surface which dependency is down as a warning and let the user
decide whether to continue; minting works while DataHub is degraded, but feature skills that
need it will fail later.
Obtain a token. If the presence check above shows a token already configured and this
run isn't specifically about rotating it, ask whether to keep the token already configured,
paste a different existing dsk_… token, or mint a new one from credentials.
Keep existing: simplest case — collect nothing here. Leave the token field out of
what step 5 sets, and its merge leaves the stored value untouched without ever reading it.
Paste: take the dsk_… value directly. Never type or echo it into a command line —
write it straight into config.json (step 5) rather than passing it through a shell
argument first.
Mint. The account password must never be typed into a message to the agent, and never
land in a command line the agent runs: an agent's Bash tool call is non-interactive (a
password prompt has no terminal to read from — it would either hang or silently read empty
input and mint against an empty password), and anything the user types into the
conversation itself becomes part of the transcript the model provider holds, which is
exactly the exposure this recipe exists to avoid. The agent does not run this step.
Hand the user the two-command recipe below and have them run it themselves, in a bash
shell specifically — it relies on read -rs's -s (silent) flag, which is not POSIX;
under /bin/sh/dash it would be rejected or ignored, either echoing the password or
reading empty input and minting against an empty password — then report back only the
resulting dsk_… token:
# 1) login -> short-lived access token. Prompts for the password (not echoed) and
# never places it on a command line, in shell history, or in the process table.
printf 'DataSpoke account password: ' >&2; read -rs DS_PASSWORD; echo
DS_EMAIL="<email>" DS_PASSWORD="$DS_PASSWORD" python3 -c "import json,os; print(json.dumps({'email': os.environ['DS_EMAIL'], 'password': os.environ['DS_PASSWORD']}))" \
| curl -sS -X POST "<api-origin>/api/v1/auth/token" \
-H "Content-Type: application/json" -d @-
unset DS_PASSWORD
# → {"access_token":"…","expires_in":…}
# 2) mint a long-lived dsk_ token. The access token from step 1 is itself a bearer
# credential (it can mint dsk_ tokens), so acquire it the same way as the password —
# never as a literal shell assignment, which would land in shell history — and send it
# to curl the same way too, via stdin config rather than a -H argv literal:
printf 'access_token from step 1 (paste, not echoed): ' >&2; read -rs DS_ACCESS; echo
printf 'header = "Authorization: Bearer %s"\n' "$DS_ACCESS" \
| curl -sS -K - -X POST "<api-origin>/api/v1/auth/api-tokens" \
-H "Content-Type: application/json" -d '{"name":"claude-code-plugin"}'
unset DS_ACCESS
# → {"token":"dsk_…","id":…,"name":…,"role_snapshot":…} (token shown ONCE)
The user reports back the token value from the second response — never the password,
never the access token — and only that value ever reaches the conversation. Once captured,
treat the dsk_… token the same way going forward: pass it to config-writing code through
a variable or file, never as a literal in a command line.
role_snapshot (returned verbatim by this call and by GET /auth/api-tokens) records the
role the account held at mint time and never changes afterward. The token's actual
privilege — its effective role — is the lower of role_snapshot and the account's
current role: promoting the account never upgrades an already-minted token (only a fresh
mint picks up the higher role), while demoting the account immediately lowers what existing
tokens can do. No route returns the effective role directly — GET /auth/me reports only
the account's current role (see status above), not this intersection — so the only signal
available is behavioral: a 403 on a write despite /auth/me showing Editor/Admin means
the token itself is stale, and retrying will not help; mint a fresh one.
Optionally collect DataHub access. Ask whether the user wants to enable the validation
skill's DataHub URN search. If yes, collect the DataHub GMS origin (no path;
e.g. https://datahub-gms.example.com) and a DataHub personal access token, to be written as
datahub_gms_url and datahub_token. These are optional — skip them for basic DataSpoke
access. Treat the DataHub token exactly like the dsk_ token: never echo it back, never store
it anywhere but the mode-600 config (or the env override).
Disclose what the config file means, before writing it. ~/.dataspoke/config.json is the
right mechanism available to a skill — there is no keychain facility here — but the user
should hear what that implies before the first write, not discover it later:
chmod 600).~/.dataspoke/config.json only stops this machine from using the token — the token
itself stays valid until explicitly revoked server-side
(dataspoke-api --confirm DELETE /auth/api-tokens/{id}, see Notes below). If the file may
have been copied off this machine (a cloud sync, a backup), revocation is the only thing
that actually invalidates it — deleting the local copy alone is not enough.DATASPOKE_API_URL and DATASPOKE_API_TOKEN instead of writing this config —
dataspoke-api needs both to resolve a base URL (TOKEN alone with no config file is not
enough), and this skill's own status mode won't have a redoc_url/ui_url to report
without the config file, since there's no env override for those.Write the config — a value-blind merge, not an overwrite. python3 loads the existing
file (or starts from {}), sets only the keys this run actually collected — passed in via
environment variables, never argv, and only for fields this run touched — and writes the
result back. A key with no DS_SET_* variable set this run is left byte-for-byte as it was;
the agent never reads the old value to "carry it forward", so datahub_gms_url/
datahub_token — and a kept-existing token — survive untouched without ever entering
context. Restrict the directory before writing, so the file is never briefly readable by
other local users during the write:
mkdir -p ~/.dataspoke && chmod 700 ~/.dataspoke
# Set ONLY the DS_SET_* vars for fields this run actually collected — e.g. skip
# DS_SET_TOKEN entirely on "keep existing", skip the DATAHUB ones if step 3 wasn't run.
DS_SET_API_BASE_URL="<from step 1>" \
DS_SET_REDOC_URL="<from step 1>" \
DS_SET_UI_URL="<from step 1>" \
python3 -c "import json,os; p=os.path.expanduser('~/.dataspoke/config.json'); cfg=json.load(open(p)) if os.path.exists(p) else {}; pairs=[('api_base_url','DS_SET_API_BASE_URL'),('token','DS_SET_TOKEN'),('redoc_url','DS_SET_REDOC_URL'),('ui_url','DS_SET_UI_URL'),('datahub_gms_url','DS_SET_DATAHUB_GMS_URL'),('datahub_token','DS_SET_DATAHUB_TOKEN')]; cfg.update({k: os.environ[e] for k,e in pairs if e in os.environ}); json.dump(cfg, open(p,'w'))"
chmod 600 ~/.dataspoke/config.json
Add DS_SET_TOKEN=... to the env-var prefix only when this run pasted or minted a token;
add DS_SET_DATAHUB_GMS_URL=.../DS_SET_DATAHUB_TOKEN=... only when step 3 collected them.
Verify with dataspoke-api GET /auth/me and report the account's current role (not the
token's effective role — see the role_snapshot note above). Remind the user that write
operations (ingestion source CRUD, validation conf/result writes) require an Editor or
Admin role; a Reader token returns 403 READ_ONLY_ROLE.
redoc_url is stored so skills can hand a human a browsable API reference. It renders in a
browser and is not readable by fetching it — skills that need the contract themselves call
dataspoke-schema <path-fragment>, which reads the same document as JSON.dsk_ prefix marks the token for leak detection — treat it like a password; it belongs
only in ~/.dataspoke/config.json (mode 600) or the env override, never in committed files.set) and revoke old ones via
dataspoke-api --confirm DELETE /auth/api-tokens/{id} (list them with GET /auth/api-tokens).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
6 skills in this plugin
/dataspoke-governanceGuide DataSpoke Governance metric configuration and operation (UC5) on a deployed instance. Use for "how do I set up a governance metric", "track validation coverage for my team", "is this data documented", creating/updating/deleting/enabling/running metrics, and interpreting results, dataset scope/verdicts, freshness, unresolved URNs, or events. Supports ingestion-freshness, validation-score, and doc-health through the public REST API. Also triggers on the equivalent phrasing in the user's own working language./dataspoke-ingestionManage DataSpoke ingestion sources (UC1) on a deployed instance — list and inspect sources, create or edit ACTIVE_CUSTOM_MANAGED and PASSIVE sources, trigger dry-run and real extractor runs, and review run history, emitted datasets, and the unmanaged bucket. Triggers on "register/check ingestion", "is this dataset ingested", "how do I add a new data source", "why isn't this table showing up in DataSpoke", "run this ingestion source", and the equivalent phrasing in the user's own working language. Answers questions and, on request, writes and fires the API calls./dataspoke-metagenOperate DataSpoke Metadata Generation (UC4) on a deployed instance: manage named generation configurations and per-dataset boundaries, dry-run and run generation, inspect coverage and candidates, and review documentation proposals. Triggers on AI documentation proposals, metadata generation, description candidates, metadata review, 'generate descriptions for this dataset', 'review AI-written descriptions', and the equivalent phrasing in the user's own working language./dataspoke-ontogenOperate DataSpoke Ontology Generation (UC3) on a deployed instance: configure the singleton, curate Markdown seeds, dry-run and run inference, inspect events and ontology results, and review nodes, edges, then eligible triples. Triggers on ontology inference, business concepts, relationships, ontology seeds, ontology review, 'how do I generate the business ontology', 'review pending ontology proposals', and the equivalent phrasing in the user's own working language./dataspoke-validationWrite data-quality validation into a data pipeline, backed by DataSpoke as the result store (UC2). Use whenever the user is authoring or editing pipeline code that builds a partition and writes it to a destination table — PySpark, awswrangler/pandas, dbt, SQL, Airflow tasks — and wants checks on what it just wrote, with history and trend tracked across runs. Designs the judging method from the dataset's own measured history, generates the metric computation, baseline fetch, and scoring, and wires the DataSpoke calls that register the validation slot and post the score. Also manages validation slots directly — register/edit a conf, post or query results, browse the cross-dataset list. Triggers on "how do I write validation code for this dataset", "add validation to this pipeline", "register validation for this table", "what validation results exist", "validate the partition I just wrote", "row count check for this table", "is this dataset validated", and the equivalent phrasing in the user's own working language.npx claudepluginhub selhorys/dataspoke-baseline --plugin dataspokeOther plugins' skills for the same job