hkust-knowcomp/deeprefine-skill/deeprefine
Claude Code and agent skill by hkust-knowcomp/deeprefine-skill
- community
Checking that the SKILL.md file is still in the repository.
Agent-native DeepRefine refinement loop — same control flow as DeepRefine.refine(), graphify search instead of FAISS, session LLM, dry-run review before approved graph writes.
Install
npx vskill@latest install hkust-knowcomp/deeprefine-skill/deeprefineSKILL.md
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:
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”).
If validation fails, fix the trace and re-run the missing step — do not bypass with --skip-trace-check.
Constants (match refine_runner.py / DeepRefine)
Mandatory artifact
For each query, maintain:
graphify-out/.deeprefine/loop_trace_<query_id>.json
Create template:
Append each hop to interaction_history before starting the next hop. Run deeprefine loop validate --trace-file ... after abduction and before review / approved apply.
Query queue selection (default behavior of /deeprefine)
/deeprefine must process all unrefined history queries first, not just the latest one.
- Sync graphify query memory into DeepRefine history:
- run:
deeprefine history sync-memory - source dir:
graphify-out/memory/query_*.md - target file:
graphify-out/.deeprefine/history.jsonl
- Read pending queue from
graphify-out/.deeprefine/history.jsonl:
- include rows where
refined != true - dedupe by
id(first occurrence) - preserve file order
- If pending queue is non-empty: set
target_queries = pending_queue. - If pending queue is empty: set
target_queries = [current session question]. - Run the full refinement loop for each query in
target_queries, one by one. - For early-exit queries, finish immediately. For refinement-path queries, generate review output and wait for user approval before
apply+loop finish.
Control flow (must match DeepRefine.refine())
Pseudocode — follow exactly:
Critical refinement rule: refinement runs when len(interaction_history) > 1, not only when all judgements are No.
Safe-review rule: a refinement path is dry-run by default. Generating <refinement> actions is not approval to write graph.json, and a normal /deeprefine turn must end after deeprefine review.
Evidence-aware review rules
Before any graph write, run:
The review must label every action:
HIGH: direct graph or code evidence exists.MEDIUM: k-hop context supports the action, but direct code or exact-edge evidence is missing.LOW: endpoint nodes are ambiguous, too broad, cross-community, or cannot be grounded ingraph.json.
Bare names such as main(), run(), train(), test(), and setup() are ambiguous even if they match only one node. Prefer file-qualified labels such as trainer_Brain_CLS.py::train_epoch().
deeprefine apply refuses LOW-confidence actions by default. Use --allow-low-confidence only when the user explicitly approves the risk.
LLM prompts (verbatim — do not paraphrase)
Judgement (_answerable_judgement)
System:
User:
{triples_string} = one triple per line: subject | relation | object
Error abduction (_error_abduction) — only if len(interaction_history) > 1
System:
User:
{interaction_history} format (same as DeepRefine):
KG refinement actions (_kg_refinement_action) — only if len(interaction_history) > 1
System:
User:
Use last hop’s retrieved_subgraph as {triples_string} (JSON list is OK in trace; string form for the prompt).
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/deeprefine/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hkust-knowcomp/deeprefine-skill/deeprefine)