debugging
БесплатноБез исполняемых скриптовНе проверенDebug issues in the Second Brain Nuxt 4 + @nuxt/content v3 project. Use for any bug, test failure, or unexpected behavior.
от alexanderop★ 15 звёзд на GitHubОб этом скилле
Second Brain Debugging
Overview
This skill adapts systematic debugging for the Second Brain stack:
- Nuxt 4 with Vue 3 Composition API
- @nuxt/content v3 with SQLite and minimark format
- @nuxt/ui v4 components
- D3.js for knowledge graph visualization
Core principle: ALWAYS trace data flow before attempting fixes.
Stack-Specific Gotchas
Before debugging, internalize these common pitfalls:
| Issue | Symptom | Cause |
|---|---|---|
| Empty graph edges | Nodes show, no connections | Missing .select('body') in query |
| Links not extracted | Backlinks/graph empty | Minimark parsed as object, not array |
| 404 on content page | Page not found | Slug mismatch (/slug vs slug) |
| Stale backlinks | Old connections shown | useAsyncData cache not invalidated |
| Silent API failure | Empty response, no error | try-catch returns {} or [] |
| Wrong mentions | Unrelated content matched | Title regex too broad |
| Graph crashes on filter | D3 error after filtering | Edge source/target type mismatch |
The Four Phases
Phase 1: Identify the Layer
Data flows through these layers:
Content File (Markdown)
↓ Parsed by Nuxt Content
Minimark AST (body.value array)
↓ Queried via queryCollection
API Endpoint (server/api/*.ts)
↓ Returned as JSON
Vue Composable (useBacklinks, useMentions)
↓ Rendered in component
User Interface
First question: Which layer is broken?
- Content layer - Check frontmatter, markdown syntax
- AST layer - Check minimark structure:
[tag, props, ...children] - Query layer - Check
.select('body'), path matching - API layer - Check response structure, error handling
- Client layer - Check composable logic, reactivity
Quick diagnostic:
# Check if content is queryable
pnpm nuxi dev
# Visit http://localhost:3000/api/graph
# Empty edges? → Layer 2-3 issue
# Empty nodes? → Layer 1 issue
# Correct data but UI wrong? → Layer 4-5 issue
Phase 2: Trace Data Flow
For content/link issues:
Check raw content file:
- Frontmatter has
titleandtype? - Wiki-links use correct format
slug? - File in
/content/directory?
- Frontmatter has
Check minimark extraction:
// In server/api/graph.get.ts, temporarily add: console.log("Body structure:", JSON.stringify(item.body, null, 2)); // Verify: { type: 'minimark', value: ...arrays... } // NOT: { type: 'minimark', value: [{...objects...}] }Check query selection:
// Must explicitly select body: queryCollection(event, "content") .select("path", "stem", "title", "type", "body") // ← body required! .all();Check API response:
curl http://localhost:3000/api/graph | jq '.edges | length' curl http://localhost:3000/api/backlinks | jq 'keys | length'
For graph visualization issues:
- Check nodes exist before filtering
- Check edge source/target types (string vs object after D3)
- Check filter state in URL query params
Phase 3: Hypothesis Testing
Form ONE hypothesis:
- "The body isn't being selected because..."
- "Links aren't extracted because minimark format is..."
- "The cache is stale because..."
Test minimally:
# Run relevant tests first
vp test --project unit -- minimark # For link extraction
vp test -- graph # For API issues
Add targeted logging:
// In extractLinksFromBody (server/utils/minimark.ts)
console.log("Body type:", body?.type);
console.log("Body value is array?", Array.isArray(body?.value));
console.log("First node:", JSON.stringify(body?.value?.[0]));
Phase 4: Fix and Verify
Create failing test first:
// tests/unit/utils/minimark.test.ts it("extracts links from nested minimark", () => { const body = { type: "minimark", value: "a", { href: "/target" }, "Link text", }; expect(extractLinksFromBody(body)).toContain("target"); });Implement fix in ONE place
Verify with full test suite:
vp test vp check && pnpm typecheckIf fix doesn't work after 3 attempts:
- Question the architecture
- Is the data model fundamentally sound?
- Should slug normalization be centralized?
Quick Debugging Commands
# Run all tests
vp test
# Run specific test file
vp test --project unit -- minimark
vp test -- graph.nuxt
# Type check
pnpm typecheck
# Start dev server for manual testing
pnpm dev
# Check API responses
curl -s http://localhost:3000/api/graph | jq '.nodes | length'
curl -s http://localhost:3000/api/graph | jq '.edges | length'
curl -s h
Установить debugging в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл debugging?
Debug issues in the Second Brain Nuxt 4 + @nuxt/content v3 project. Use for any bug, test failure, or unexpected behavior.
Как установить скилл debugging?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл debugging запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic