narraitor-diagnostics-and-tooling
How to MEASURE instead of eyeball in Narraitor - curl smokes for the AI/API routes, inspecting persisted Zustand state in IndexedDB, DOM/computed-style checks…
от jerseycheese★ 32 звезды на GitHub
Установить narraitor-diagnostics-and-tooling в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Diagnostics & tooling
1. Purpose
Every claim needs a measurement. This is the toolbox: the exact command per question, and what each diagnostic can and cannot conclude.
2. When to use
Producing evidence for any claim; investigating runtime state; verifying a fix live.
3. When not to use
- Choosing WHAT to verify →
narraitor-validation-and-qa/narraitor-debugging-playbook; this skill is the HOW.
4. Inputs required
A running dev server on the correct port for YOUR checkout (lsof -nP -iTCP:3000 -sTCP:LISTEN — worktrees use derived ports).
5. Procedure — the toolbox
AI/API route smokes (curl):
# Route wiring, NO key needed — expect HTTP 400 {"error":"...prompt is required..."}:
curl -s -X POST localhost:3000/api/narrative/generate -H 'Content-Type: application/json' -d '{}' -w '\nHTTP %{http_code}\n'
# Live generation smoke (burns tokens; needs a key — GEMINI_API_KEY in .env.local for the
# server fallback, or pass the BYO header: -H 'x-provider-api-key: <key>'):
curl -s -X POST localhost:3000/api/narrative/generate -H 'Content-Type: application/json' \
-d '{"prompt":"One sentence of neutral test narration."}' -w '\nHTTP %{http_code}\n'
# Provider key validity vs upstream outage discrimination.
# This route reads the candidate key ONLY from the x-provider-api-key header (no env
# fallback) and returns {"valid":false,"error":"NO_KEY"} immediately if it's absent —
# so you MUST pass the header, or you learn nothing but "the route is wired".
curl -s -X POST localhost:3000/api/ai/validate-provider \
-H 'Content-Type: application/json' -H 'x-provider-api-key: <candidate-key>' \
-d '{}' -w '\nHTTP %{http_code}\n'
Interpretation: on narrative/generate — 400 on empty body = route up, handler wired; 200 with generated text = full path live; 5xx/timeout on a valid body = key, upstream, or timeout (generate/choices: 30s server-side via makeGeminiRequest, no retries; the 120s figure is the CLIENT-side aiFetch ceiling and doesn't apply to direct curls). On validate-provider WITH a key header, the JSON error field splits the causes: INVALID_KEY = bad/rejected key, RATE_LIMITED = quota, NETWORK/VALIDATION_FAILED = upstream/other, valid:true = key good. A keyless call returns NO_KEY and proves only that the route responds. NOTE: the {prompt} 400-contract applies to narrative/generate and narrative/choices only; other routes have their own body shapes — read the handler before smoking them.
Persisted store state (ground truth of app data): Browser devtools → Application → IndexedDB → db narraitor-state → object store narraitor-store → the persist key (e.g. narraitor-narrative-store). This is what hydration will produce — when UI and expectation disagree, read this first. (Provider keys sit encrypted in db narraitor-secure; there is nothing useful to eyeball there.)
In-app DevTools panel: dev builds render a DevTools surface (src/components/devtools/ — decision console, AI mock controls, token budget panel); suppressed under automation (ClientOnlyDevTools). Use it for live narrative/decision state during manual play.
DOM / computed styles (layout + theming truth — screenshots lie about color/size): with the Claude preview tools use preview_inspect (specific CSS properties) over preview_screenshot; in a plain terminal session use browser devtools or the owner's bdg CLI (personal tooling — available locally, not a repo dependency). Check the resolved token: getComputedStyle(el).getPropertyValue('--color-…') at the element, per theme.
Visual tooling: npm run test:visual (needs server); failure artifacts → test-results/ (diffs, traces) and playwright-report/; CI report via scripts/download-playwright-report.sh; prune orphaned baselines with npm run test:visual:prune.
Static analysis on demand: npm run deps:validate:strict (ALL boundary violations incl. baselined), npm run skott:circular (list cycles), npm run knip (dead exports), npm run audit:css (unused selectors — advisory, ~dozens of known-kept findings), npm run validate:routes (dangling Link/router.push targets).
Logs: app logging goes through the Logger utility (no-console is an ESLint error in product code); dev-visible output must be warn+ — don't conclude "code path never runs" from a silent logger.debug.
6. Evidence required
Paste the command AND its output. A diagnostic you ran but can't show didn't happen.
7. Output artifact
Command transcripts, screenshots/DOM excerpts, or report paths — attached to the claim they support.
8. Common traps
- Bad behavior this prevents: declaring "the AI routes are healthy" after
curl localhost:3000returns HTML — that proves the dev server, not one of the 20 API routes; smoke the actual route with the 400-contract check. - A diagnostic is insufficient when it can't distinguish your hypotheses: one green generation ≠ prompt reliability (ai-quality-discipline); route-up ≠ k
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- evals/trigger_eval.json
FAQ
Что делает скилл narraitor-diagnostics-and-tooling?
How to MEASURE instead of eyeball in Narraitor - curl smokes for the AI/API routes, inspecting persisted Zustand state in IndexedDB, DOM/computed-style checks for layout and theming, visual tooling, and where reports land. Use when you need proof of runtime behavior - "is the route up", "what's actually in the store", "what computed style applies", "where is the playwright report" - or when a claim needs an artifact.
Как установить скилл narraitor-diagnostics-and-tooling?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл narraitor-diagnostics-and-tooling запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…