feat: add /understand-knowledge skill for personal knowledge base analysis#80
feat: add /understand-knowledge skill for personal knowledge base analysis#80
Conversation
…se plugin New skill that takes markdown knowledge bases (Obsidian, Logseq, Dendron, Foam, Karpathy-style, Zettelkasten, plain) and produces interactive knowledge graphs with typed nodes/edges, auto-format detection, and dashboard visualization. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Detailed step-by-step plan covering core type extensions, schema validation, dashboard changes (CSS, store, sidebar, reading panel, edge styling, layout), agent definitions, format guides, and skill definition. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move all design docs to docs/superpowers/specs/ and all implementation plans to docs/superpowers/plans/ for consistent organization. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 5 knowledge node types (article, entity, topic, claim, source), 6 knowledge edge types (cites, contradicts, builds_on, exemplifies, categorized_under, authored_by), KnowledgeMeta interface, and kind field on KnowledgeGraph. Update schema validation, dashboard type maps, and filter categories for full compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…comments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… add knowledge schema tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ent type maps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…edge graphs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…wledge-aware ProjectOverview - Use graphKind-aware layout direction for knowledge graphs (TB) - Add KNOWLEDGE_EDGE_STYLES map with distinct visual styles for knowledge edge types (cites, contradicts, builds_on, etc.) - Show knowledge-specific stats (articles, entities, topics, claims, sources) and format badge in ProjectOverview - Hide Languages/Frameworks sections for knowledge graphs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…graphKind selector
…r, and relationship-builder agents Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…pipeline Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…arsing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbc17d6399
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| service: "infra", resource: "infra", pipeline: "infra", | ||
| table: "data", endpoint: "data", schema: "data", | ||
| domain: "domain", flow: "domain", step: "domain", | ||
| article: "knowledge", entity: "knowledge", topic: "knowledge", claim: "knowledge", source: "knowledge", |
There was a problem hiding this comment.
Add knowledge node types to layer visibility whitelist
This adds knowledge node categories here, but useLayerDetailTopology still gates rendering through an allVisibleTypes set that only contains code/domain node names; the subsequent if (!allVisibleTypes.has(n.type)) return false filter drops article/entity/topic/claim/source nodes entirely. In a kind: "knowledge" graph, drilling into a layer can therefore render an empty layer topology even though nodes exist.
Useful? React with 👍 / 👎.
| interacts_with: "cross_domain", | ||
| // Knowledge aliases | ||
| references: "cites", | ||
| cited_by: "cites", |
There was a problem hiding this comment.
Drop
cited_by alias unless direction is reversed
Aliasing cited_by to cites rewrites only the type string and keeps source/target unchanged, so an extracted edge like A cited_by B becomes A cites B, which inverts the relationship semantics. This can silently corrupt knowledge graphs generated from natural-language edge labels, especially because no direction correction is applied during normalization.
Useful? React with 👍 / 👎.
|
|
||
| const graph = { | ||
| version: typeof fixed.version === "string" ? fixed.version : "1.0.0", | ||
| kind: fixed.kind as "codebase" | "knowledge" | undefined, |
There was a problem hiding this comment.
Validate graph kind instead of type-asserting input
validateGraph now copies fixed.kind via a TypeScript cast without runtime validation, so invalid strings can pass through as data.kind. Since the dashboard switches behavior on graph.kind === "knowledge", malformed values silently disable knowledge-specific UI instead of being rejected or corrected.
Useful? React with 👍 / 👎.
Code reviewReviewed by five expert personas: Anthropic Claude Code Plugin Architect, OpenAI Codex Senior Reviewer, Obsidian Core Team Engineer, Anthropic API Platform Engineer, and Senior Knowledge Graph Researcher. Found 7 issues:
Understand-Anything/understand-anything-plugin/packages/core/src/schema.ts Lines 117 to 119 in dbc17d6 Understand-Anything/understand-anything-plugin/packages/core/src/schema.ts Lines 136 to 138 in dbc17d6
Understand-Anything/understand-anything-plugin/agents/article-analyzer.md Lines 107 to 111 in dbc17d6
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…d kind validation Remove cited_by/sourced_from aliases that silently invert edge semantics without swapping source/target. Reclassify paper from entity to source to match other academic aliases (reference, citation, bibliography). Replace bare type-assertion of graph.kind with runtime validation that rejects invalid values and logs an auto-corrected issue. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dge selection guard Add article/entity/topic/claim/source to allVisibleTypes so knowledge nodes are not silently dropped in layer detail view. Replace the strokeDasharray guard with a portal-specific check so knowledge edges using dashed strokes still receive selection highlighting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nd TourStep types Rename edgeType→type and label→description to match GraphEdgeSchema. Replace invalid trivial complexity with simple. Add required description field to layer examples and required complexity to entity/claim/source/ topic node specs. Fix tour step format to use order + nodeIds array instead of singular nodeId. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4878f3e18
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {selectedNodeId && graph?.kind === "knowledge" && <KnowledgeInfo />} | ||
| {selectedNodeId && graph?.kind !== "knowledge" && <NodeInfo />} |
There was a problem hiding this comment.
Use active view to choose the node details sidebar
When a node is selected, this branch renders KnowledgeInfo solely from graph.kind === "knowledge", but KnowledgeInfo resolves nodes from graph only. In the domain view (when domainGraph is present), selected IDs come from the domain graph, so the sidebar can’t resolve the node and shows an empty state instead of details. This breaks node inspection for that view; the sidebar selection should also account for viewMode.
Useful? React with 👍 / 👎.
| .filter((e) => e.type === "categorized_under" && e.target === node.id) | ||
| .map((e) => graph?.nodes.find((n) => n.id === e.source)) | ||
| .filter((n): n is GraphNode => n !== undefined); |
There was a problem hiding this comment.
Filter topic members to article nodes
The Articles section for topic nodes currently includes every categorized_under source node without validating its type. Because categorized_under can connect non-article nodes too, this view can count and display entities/other types as articles, which makes the sidebar labels and counts inaccurate. Restrict this list to n.type === "article" (or relabel it to a generic membership list).
Useful? React with 👍 / 👎.
…ode, filter topic articles - KnowledgeInfo now resolves nodes from activeGraph (respecting viewMode/ domainGraph) instead of graph directly, fixing empty sidebar in domain view - setGraph sets viewMode to "knowledge" when graph.kind is "knowledge" - Topic "Articles" section filters to type === "article" only Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
/understand-knowledgeskill that analyzes markdown knowledge bases (Obsidian, Logseq, Dendron, Foam, Karpathy-style LLM Wiki, Zettelkasten, or plain markdown) and produces interactive knowledge graphsarticle,entity,topic,claim,source) and 6 knowledge edge types (cites,contradicts,builds_on,exemplifies,categorized_under,authored_by)knowledge-scanner→format-detector→article-analyzer→relationship-builder→graph-reviewer--ingest) for adding new sources to an existing knowledge graphDetails
Core (packages/core)
types.ts: 5 new node types, 6 new edge types,KnowledgeMetainterface,kindfield onKnowledgeGraphschema.ts: Zod validation for knowledge types,KnowledgeMetaSchema, 30+ LLM-friendly aliases,kindpreserved throughvalidateGraphDashboard (packages/dashboard)
KnowledgeInfo.tsx: Knowledge-specific sidebar with 5 node-type-specific views (backlinks, confidence bars, frontmatter display)ReadingPanel.tsx: Slide-up article reader with backlinks sidebar (45vh/70vh toggle)ProjectOverview.tsx: Knowledge stats (articles/entities/topics/claims/sources), detected format badgeGraphView.tsx: Knowledge edge styling (dashed for cites, red for contradicts, etc.)CustomNode.tsx+NodeInfo.tsx: Colors, badges, and edge labels for all knowledge typesstore.ts: Knowledge node/edge categories, view mode, filter stateindex.css: 5 new CSS color variablesAgents (4 new)
knowledge-scanner.md: Finds all.mdfiles, detects directory signaturesformat-detector.md: Identifies PKM format with priority-based detectionarticle-analyzer.md: Extracts nodes (article/entity/claim/source) and explicit edges per batchrelationship-builder.md: Discovers implicit cross-file relationships, builds topic clusters, layers, toursSkill
SKILL.md: 8-phase pipeline (scan → detect → analyze → relationships → assemble → review → save → dashboard)Test plan
/understand-knowledgeon an Obsidian vault to verify end-to-end/understand-knowledgeon a plain markdown folder--ingestincremental mode🤖 Generated with Claude Code