deeprefine

A Codex guide for using DeepRefine, a tool that reviews and improves Graphify or LLM-Wiki knowledge graphs. It describes how to inspect the graph and prepare changes for review.

In plain words
What is it for?
Use it when refining, diagnosing, repairing, inspecting, or reviewing a knowledge graph, or when applying an already approved refinement.
Why use it?
It gives the agent the required DeepRefine procedure instead of making it recreate the workflow from memory.

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/hkust-knowcomp/deeprefine-skill/codex_skill
Any agent
npx skills add HKUST-KnowComp/DeepRefine-Skill --skill codex_skill
Clone the repo
git clone --depth 1 https://github.com/HKUST-KnowComp/DeepRefine-Skill

Made for: Claude Code, Codex.

Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,323 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 92% copy Near-identical to another mod 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.00073 $0.01323
Opus 5 $0.00036 $0.00661
Sonnet 5 $0.00015 $0.00265
Haiku 4.5 $0.00007 $0.00132

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

Security

Grade A, and why

deeprefine 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 2d 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.

Origin

This is a copy

92% identical to deeprefine — 34 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

deeprefine_skill/codex_skill/SKILL.md · 169 lines

How it starts

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

DeepRefine - Codex Adapter

This file is the Codex-specific entrypoint. It keeps the platform rules small and loads longer DeepRefine procedure details only when needed:

Do not reimplement or shorten the algorithm from memory. Load the relevant reference file before executing that part of the workflow.

Codex Invocation

Trigger this skill when the user:

  • explicitly invokes $deeprefine or /deeprefine;
  • asks to refine, improve, diagnose, repair, inspect, or review a Graphify knowledge graph;
  • asks to apply a previously reviewed DeepRefine refinement.

Run from the knowledge-base project root, where graphify-out/graph.json exists. If the user is planning or asking how DeepRefine works, explain the workflow and do not mutate files.

If deeprefine is unavailable, tell the user to install it:

pip install deeprefine-cli

For source development:

pip install -e /path/to/DeepRefine-Skill

Hard Safety Policy

A normal $deeprefine or /deeprefine invocation is dry-run only and MUST NEVER call deeprefine apply.

The default workflow must stop after:

  1. deeprefine loop validate
  2. deeprefine review
  3. showing the proposed actions and HIGH/MEDIUM/LOW review report to the user

Then ask for explicit approval.

Only if the user's next message explicitly says to approve/apply/write the graph may you run:

deeprefine apply --trace-file ... --refinement-file ...
deeprefine loop finish --trace-file ... --refinement-file ...

Do not treat any of these as approval:

  • generation of a <refinement> block;
  • a valid loop_trace_<query_id>.json;
  • a prior user message;
  • a successful deeprefine review.

Read the full file on GitHub · 169 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. 2d ago First seen · 169 lines · 73 tokens per session scan A a24551535a0b

Subscribe to this mod's changes

deeprefine is a skill published in the GitHub repository HKUST-KnowComp/DeepRefine-Skill (93 stars, last pushed 10d ago), licensed MIT. It adds 73 tokens to every session and 1,323 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to deeprefine, differing in 34 lines, and is treated as a copy.

Related

Other skills, from other repositories

llm-wiki

The foundational knowledge distillation pattern for building and maintaining an AI-powered Obsidian wiki. Based on Andrej Karpathy's LLM Wiki architecture. Use this skill whenever the user wants to understand the wiki pattern, set up a new knowledge base, or needs guidance on the three-layer architecture (raw sources…

Ar9av/obsidian-wiki · 113 tokens

wiki-lint

Audit and maintain the health of the Obsidian wiki. Use this skill when the user wants to check their wiki for issues, find orphaned pages, detect contradictions, identify stale content, fix broken wikilinks, or perform general maintenance on their knowledge base. Also triggers on "clean up the wiki", "what needs…

Ar9av/obsidian-wiki · 152 tokens

wiki-status

Show the current state of the wiki — what's been ingested, what's pending, and the delta between sources and wiki content. Use this skill when the user asks "what's the status", "how much is ingested", "what's left to process", "show me the delta", "what changed since last ingest", "wiki dashboard", or wants an…

Ar9av/obsidian-wiki · 210 tokens

wiki-export

Export the Obsidian wiki's knowledge graph to structured formats for use in external tools. Use this skill when the user says "export wiki", "export graph", "export to JSON", "export to Gephi", "export to Neo4j", "export to Postgres", "export to SQL", "graphml", "visualize wiki", "knowledge graph export", "export to…

Ar9av/obsidian-wiki · 172 tokens

wiki-query

Answer questions by searching the compiled Obsidian wiki. Use this skill when the user asks a question about their knowledge base, wants to find information across their wiki, asks "what do I know about X", "find everything related to Y", or wants synthesized answers with citations from their wiki pages. Also use when…

Ar9av/obsidian-wiki · 200 tokens

copilot-history-ingest

Ingest GitHub Copilot CLI session history into an Obsidian wiki as distilled knowledge pages. Use this skill when the user wants to capture their Copilot CLI sessions into a personal wiki — extracting architecture decisions, debug notes, and patterns into searchable Obsidian pages. Triggers on phrases like "ingest my…

Ar9av/obsidian-wiki · 181 tokens