world-query

world-query is a skill for Claude Code, Codex from LiPu-jpg/Openwrite. It costs 48 tokens per session (642 once invoked), scanned A, original, Apache-2.0.

A shared query and editing system for the people, places, and other entities in a novel, plus the relationships between them. It treats the files under each novel’s source folder as the one authoritative record.

In plain words
What is it for?
Use it to find world entities, inspect their connections, search nearby relationships, and add, update, or remove a confirmed relationship in the source files.
Why use it?
It prevents the writing tools and Studio relationship view from using different or outdated relationship data. It also requires a preview and user confirmation before a relationship is changed.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to find world entities, inspect their connections, search nearby relationships, and add, update, or remove a confirmed relationship in the source files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lipu-jpg/openwrite/world-query
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.

Any agent
npx skills add LiPu-jpg/Openwrite --skill world-query
Clone the repo
git clone --depth 1 https://github.com/LiPu-jpg/Openwrite

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for world-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/lipu-jpg/openwrite/world-query/github.svg)](https://agentmods.dev/skills/lipu-jpg/openwrite/world-query)
Your own site
<a href="https://agentmods.dev/skills/lipu-jpg/openwrite/world-query"><img src="https://agentmods.dev/badge/skills/lipu-jpg/openwrite/world-query/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for world-query

Your own site · 80×15
<a href="https://agentmods.dev/skills/lipu-jpg/openwrite/world-query"><img src="https://agentmods.dev/badge/skills/lipu-jpg/openwrite/world-query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 642 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00048 $0.00642
Opus 5.5 $0.00019 $0.00257
Sonnet 5.5 $0.00010 $0.00128
Haiku 4.5 $0.00005 $0.00064

Measured 1mo ago against content hash b5d21715c3c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

world-query 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 1mo ago.

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.

presets/goethe/skills/world-query/SKILL.md · 45 lines

What it actually says

世界查询系统

把 data/novels/{novel_id}/src/ 下的人物与世界实体文件作为唯一关系真源。Studio 拓扑和 ReAct 的 get_world_relations 必须调用同一个拓扑查询,不维护 graph.yaml 或第二套关系数据库。

查询

  • 用 query_world 查询实体列表或详情。
  • 用 get_world_relations 读取与 Studio 连续性页面同源的节点和边。
  • Studio 关系拓扑支持按节点名称、ID、类型、摘要和关系文字搜索;命中节点会保留一跳相邻节点和连线作为上下文。
  • ReAct 没有第二套拓扑搜索索引;需要搜索时读取 get_world_relations 后在同一份节点/边结果中按上述字段过滤。
  • 先用 ID 定位;用户只提供名称时允许按 front matter 名称或 Markdown H1 定位。

兼容读取以下关系来源:

  1. TOML front matter 中的 [[related]]。
  2. 世界实体的 ## 关联 列表。
  3. 人物卡的 ## 关系网络、## 人物关系、## 与主角的关系、## 与某人的关系/羁绊。

把“主角”解析为 role = "主角" 或 tier = "主角" 的人物。读取关系目标时清理末尾括号别名,例如 周策(老周) 定位到 周策。未找到目标时保留 unresolved 节点,不静默丢边。

增量修改关系

新建、更新或删除正式关系时使用 edit_world_relation,并固定执行两阶段确认:

  1. 先以 confirm=false 调用,保存返回的 base_revision,向用户展示 diff。此步不得写文件。
  2. 只有用户明确确认后,才传回同一个 base_revision 并设置 confirm=true。
  3. 若返回 relation_revision_conflict,重新预览;不得复用旧 revision 或整文件重写。
  4. 用户拒绝、犹豫或只是讨论关系时,不得确认写入。

正式修改统一写入源文件 TOML front matter:

[[related]]
target = "partner_id"
kind = "related"
note = "共同调查旧案"

使用 action="upsert" 新增或更新,使用 action="remove" 删除。源和目标必须是已有实体,禁止自关系。旧 Markdown 关系段落继续作为兼容只读来源;不要为了修改一条边而覆盖人物卡正文。

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. 1mo ago First seen · 45 lines · 48 tokens per session scan A b5d21715c3c2

Subscribe to this mod's changes

world-query is a skill published in the GitHub repository LiPu-jpg/Openwrite (872 stars, last pushed yesterday), licensed Apache-2.0. It adds 48 tokens to every session and 642 once invoked, about $0.0002 per session on Opus 5.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-30.