wiki-struct

A skill for keeping the structure of an Obsidian knowledge base up to date. It regenerates marked sections such as the home page tree, directory lists, and index pages.

In plain words
What is it for?
Checking, initializing, or applying updates to wiki navigation and directory listings, then producing a structure report.
Why use it?
It replaces repetitive manual maintenance while leaving the notes' unmarked text unchanged.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/qxbyte/pluginhub/wiki-struct
Any agent
npx skills add qxbyte/pluginhub --skill wiki-struct
Clone the repo
git clone --depth 1 https://github.com/qxbyte/pluginhub

Made for: Claude Code, Codex.

Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,710 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00111 $0.01710
Opus 5 $0.00056 $0.00855
Sonnet 5 $0.00022 $0.00342
Haiku 4.5 $0.00011 $0.00171

Measured yesterday against content hash 2cca09c1ee9d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

wiki-struct scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/struct_gen.py, scripts/test_struct_gen.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/obsidian-wiki/skills/wiki-struct/SKILL.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Wiki Struct

Host-tool convention 🔧: tool names in this skill — AskUserQuestion (structured multiple-choice question) — are written for Claude-family hosts (Claude Code / CodeBuddy), where naming them directly is the most reliable. On a host that lacks one, use its nearest equivalent (a structured-question tool); with no equivalent, fall back to a plain-text question. The described behavior is what matters, not the exact tool name.

配置说明:vault 的结构配置存在家目录注册表 ~/.config/obsidian-wiki/configs/<库名>.json(按 active 库解析;未注册则回退库内 <vault>/.wiki/config.json)。schema 见本插件根 config.example.json。脚本仍通过 --vault "<vault 根路径>" 指定 vault,结构由注册表/回退提供。

脚本定位:脚本装在本 skill 的 scripts/ 目录下。用本 skill 的 base directory 把相对路径 scripts/<脚本名>.py 拼成绝对路径来跑(不解析环境变量、不 find 缓存)。

把"结构层"从手工维护变成可重跑、确定性、内容安全的再生成。设计与约定见本插件根 DESIGN.md(位于 skills/wiki-orchestrate/ 旁的套件文档)。

受管块

结构文件里自动内容放在 marker 之间,本 skill 只重写 marker 之间,marker 外人工内容一字不动:

<!-- wiki-struct:tree start -->
…(自动生成的树 / 文件清单)…
<!-- wiki-struct:tree end -->

三类结构文件:00-Index/Home.md(全库 callout 树)、15 个一级目录 README.md(本目录文件清单)、15 个 00-Index/<目录>.md 分区页(本目录文档清单树)。详见 references/managed-blocks.md

命令

命令 行为
/wiki-struct(= check) python3 scripts/struct_gen.py check,读 00-Index/_system/struct-report.md,汇报概览 + 最该处理项。不写结构文件
/wiki-struct apply [--scope home|readmes|partitions|all] 备份 → struct_gen.py apply → 坏链复核 → 写 wiki-log。改前确认
/wiki-struct init 为缺 marker 的结构文件插入受管区(逐文件 AskUserQuestion 确认位置),见下
/wiki-struct help 显示本表

未给子命令按 check 处理。

执行流程

check

  1. 运行 python3 scripts/struct_gen.py check --vault "<vault>".
  2. Read 00-Index/_system/struct-report.md
  3. 汇报:需更新数 / 缺 marker 数 / 缺文件数 / 坏链数 + 最该处理的 3 项。等用户指令。

init(首次接入,逐文件)

原则:受管块只新插入、绝不包裹/替换人工策展清单。

对报告里"缺 marker"的每个结构文件:

  1. Read 该文件。判定两种情况:
    • Home.md:现有 ## 目录树 下的 callout 树本就是上轮自动生成、无人工策展 → 可就地包裹这段(marker 包到 callout 树两端)。
    • README / 分区页:现有清单可能是人工策展的主题分组/项目表(如 07-Ideas/README 的项目表、01-Concepts 分区页的 ### 架构设计 分组)→ 不碰它们,改为新插入一个受管块小节 ## 目录树(自动维护),位置默认在文件末尾的"关联"段之前、或 ## 用途 之后。
  2. AskUserQuestion 逐文件确认:「就地包裹现有自动树(仅 Home)/ 在〈位置〉新插入受管块 / 跳过本文件」。
  3. 用 Edit 插入 <!-- wiki-struct:tree start --> 空行 <!-- wiki-struct:tree end -->(新插入时块内先留空,由 apply 填充;就地包裹时不改段内内容)。
  4. 全部插完后跑一次 apply 填充。

Read the full file on GitHub · 87 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 87 lines · 111 tokens per session scan A 2cca09c1ee9d

Subscribe to this mod's changes

wiki-struct is a skill published in the GitHub repository qxbyte/pluginhub (3 stars, last pushed 27d ago), licensed MIT. It adds 111 tokens to every session and 1,710 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

douyin-favorites-to-knowledge

将用户已授权账号中的抖音视频收藏或用户明确指定的喜欢列表配置并同步到本地 Markdown 或 Obsidian 知识库;默认收藏,只有用户明确说喜欢/点赞才切换来源。首次明确选择推荐的 SiliconFlow转录、本地 Whisper 或不转录。不得绕过登录、访问他人账号或泄露 Cookie 与私密数据。.

tars1230/douyin-favorites-to-knowledge · 92 tokens

knowledge-extractor

Entrevista a un experto de dominio (SME) para extraer su conocimiento técnico tácito y sintetizarlo en una Skill reutilizable. Se activa PROACTIVAMENTE ante 3 situaciones: (1) Frustración — el usuario se queja de código, arquitectura o falta de estándares; (2) Ambigüedad sin Reglas — se pide un refactor profundo pero…

Vasallo94/obsidian-mcp-server · 156 tokens

MCP Developer

Skill para desarrollar, mantener y extender el servidor MCP de Obsidian. Incluye patrones de código, arquitectura, testing y gestión de paquetes.

Vasallo94/obsidian-mcp-server · 33 tokens

Python Patterns

Buenas prácticas y patrones de desarrollo Python para el proyecto MCP. Incluye estándares de código, patrones arquitectónicos, y convenciones.

Vasallo94/obsidian-mcp-server · 29 tokens

Refactoring

Guía para refactorizar código Python de forma segura y efectiva. Incluye técnicas de refactoring, detección de code smells, y mejoras.

Vasallo94/obsidian-mcp-server · 33 tokens

Test Runner

Skill para ejecutar y gestionar tests. Incluye patrones de testing, fixtures comunes, y estrategias de debugging de tests fallidos.

Vasallo94/obsidian-mcp-server · 28 tokens