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.
npx agentmods add skills/hkust-knowcomp/deeprefine-skill/deeprefine_skillnpx skills add HKUST-KnowComp/DeepRefine-Skill --skill deeprefine_skillgit clone --depth 1 https://github.com/HKUST-KnowComp/DeepRefine-SkillWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00042 | $0.04737 |
| Opus 5 | $0.00021 | $0.02368 |
| Sonnet 5 | $0.00008 | $0.00947 |
| Haiku 4.5 | $0.00004 | $0.00474 |
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 yesterday.
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.
Copies of this mod
1 near-identical copy found in the catalogue:
- deeprefine — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 477 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DeepRefine — Agent refinement loop (strict)
Default safety policy: dry-run only
A normal /deeprefine invocation MUST NEVER call deeprefine apply.
The default /deeprefine workflow must stop after:
deeprefine loop validatedeeprefine review- showing the proposed actions and HIGH/MEDIUM/LOW review report to the user
Then ask the user for explicit approval.
Only if the user's next message explicitly says to approve/apply/write the graph may you run:
deeprefine apply --refresh-wiki --trace-file ... --refinement-file ...
deeprefine loop finish --trace-file ... --refinement-file ...
Do not treat generation of <refinement> actions as approval. Do not treat a valid trace as approval. Do not apply in the same /deeprefine turn.
You MUST implement the same control flow as DeepRefine.refine() in DeepRefine (autorefiner/src/deeprefine.py).
| Component | Agent mode | CLI deeprefine refine |
|---|---|---|
| Retrieval | graphify query + k-hop from graph.json |
FAISS retriever |
| LLM | Your session model | External API / vLLM |
| Graph writes | Dry-run proposal + deeprefine review; deeprefine apply only after user approval |
Dry-run by default; --apply persists |
FORBIDDEN (hard stop)
Do NOT:
- Run
deeprefine refine(unless the user explicitly asks for CLI/FAISS mode). - Call
deeprefine applywithout a validloop_trace_<query_id>.json(CLI will reject). - Call
deeprefine applybefore runningdeeprefine reviewand receiving explicit user approval. - Ignore LOW-confidence review warnings unless the user explicitly requests
--allow-low-confidence. - Skip any hop’s
<judge>Yes</judge>/<judge>No</judge>judgement. - Skip error abduction when
len(interaction_history) > 1. - Write
<refinement>before abduction when refinement is required. - Hand-edit
graph.jsonwith Python or ad-hoc JSON patches. - Ignore pending history and refine only one latest query when unrefined queries already exist.
- Invent a shorter pipeline (“read file → write refinement → apply”).
What ships with it
40 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.
- __init__.py 105 B runs code
- action_review.py 14 KB runs code
- adapter_graphify.py 6.7 KB runs code
- agent_graph.py 7.2 KB runs code
- agent_loop.py 8.6 KB runs code
- agent_prompts.py 2.9 KB runs code
- claude_skill/references/deeprefine-workflow.md 5.4 KB
- claude_skill/references/llm-prompts.md 3.3 KB
- claude_skill/references/trace-and-commands.md 4.2 KB
- claude_skill/SKILL.md 5.5 KB
- cli.py 48 KB runs code
- codex_skill/agents/openai.yaml 275 B
- codex_skill/references/deeprefine-workflow.md 5.5 KB
- codex_skill/references/llm-prompts.md 3.3 KB
- codex_skill/references/trace-and-commands.md 5.1 KB
- codex_skill/SKILL.md 5.5 KB
- commands/opencode/deeprefine-apply.md 1.1 KB
- commands/opencode/deeprefine-review.md 892 B
- commands/opencode/deeprefine.md 757 B
- dsh_skill/references/deeprefine-workflow.md 5.5 KB
- dsh_skill/references/llm-prompts.md 3.3 KB
- dsh_skill/references/trace-and-commands.md 4.2 KB
- dsh_skill/SKILL.md 6.3 KB
- gemini_extension/commands/deeprefine.toml 1.7 KB
- gemini_extension/commands/deeprefine/apply.toml 1.2 KB
- gemini_extension/commands/deeprefine/review.toml 1.3 KB
- gemini_extension/gemini-extension.json 252 B
- gemini_extension/GEMINI.md 1.6 KB
- gemini_extension/skills/deeprefine/SKILL.md 19 KB
- history.py 6.2 KB runs code
- installers.py 23 KB runs code
- obsidian_refresh.py 614 B runs code
- paths.py 6.7 KB runs code
- refine_runner.py 9.2 KB runs code
- SKILL_COPILOT.md 22 KB
- SKILL_OPENCODE.md 33 KB
- wiki_importer.py 12 KB runs code
- wiki_refresh.py 12 KB runs code
- wiki_retrieval.py 6.4 KB runs code
- wiki_update.py 15 KB runs code
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.
- yesterday First seen · 477 lines · 42 tokens per session scan A 2d3bf1019872
deeprefine is a skill published in the GitHub repository HKUST-KnowComp/DeepRefine-Skill (93 stars, last pushed 9d ago), licensed MIT. It adds 42 tokens to every session and 4,737 once invoked, about $0.0002 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-30.
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…
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…
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…
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…
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…
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…