██████╗ ███████╗███████╗██████╗ ██████╗ ███████╗███████╗██╗███╗ ██╗███████╗ ██╔══██╗██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝██║████╗ ██║██╔════╝ ██║ ██║█████╗ █████╗ ██████╔╝██████╔╝█████╗...
Overview
██████╗ ███████╗███████╗██████╗ ██████╗ ███████╗███████╗██╗███╗ ██╗███████╗ ██╔══██╗██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝██║████╗ ██║██╔════╝ ██║ ██║█████╗ █████╗ ██████╔╝██████╔╝█████╗...
README
DeepRefine-Skill plugs into agent workflows and use a single command /deeprefine in your agent (Cursor, Copilot CLI, Gemini CLI, Codex, OpenCode, Claude Code) to refine and evolve your LLM-Wiki (e.g., graphify) knowledge base.
It refines your graphify knowledge graph for better future retrieval and Q&A quality.
Supported agent frameworks:
News
- [2026/7/10] v0.2.0 - Claude Code and OpenCode adapters:
deeprefine claude install/deeprefine opencode install, bundled skill + command templates. - [2026/7/3] v0.1.9 - Release with Codex, Copilot CLI, and Gemini CLI skills bundled; dry-run-first refinement, evidence-aware action review (HIGH/MEDIUM/LOW), ambiguous-node warnings, and LOW-confidence apply guard.
- [2026/6/24] v0.1.9 - Codex skill supported.
- [2026/6/18] v0.1.9 - Gemini CLI and Copilot CLI supported.
- [2026/6/17] v0.1.9 - Added dry-run-first refinement, evidence-aware action review, ambiguous-node warnings, and LOW-confidence apply guard.
- [2026/6/15] v0.1.8 - Aligned interaction memory with LLM-Wiki (graphify) and fixed the single query refinement issue.
- [2026/6/2] v0.1.7 — Cursor skill +
deeprefine refinewith configurable API. And strict DeepRefine agent loop.
Agent CLI (Recommended)
This is the default mode and the main workflow for this project.
One-time setup
pip install deeprefine-cli graphifyy
cd /path/to/your-kb-project
graphify cursor install
# for Cursor
deeprefine cursor install
# for Copilot CLI
deeprefine copilot install
# for Gemini CLI
deeprefine gemini install # or deeprefine gemini link
# for Codex
deeprefine codex install
# for Claude Code
deeprefine claude install
# for OpenCode
deeprefine opencode install
After upgrading the package, run the command again to refresh local skill files.
Typical session (Agent CLI)
/graphify .
/graphify ./ --wiki
/graphify query "your question 1"
/graphify query "your question 2"
# ..
/deeprefine
What /deeprefine does now (default queue behavior)
Agent artifacts
graphify-out/
├── graph.json # graphify main graph; unchanged until apply approval
├── memory/
│ └── query_*.md # graphify query logs (sync source)
└── .deeprefine/
├── history.jsonl # DeepRefine-maintained history queue
├── graph.json.bak # backup before first apply in this run
├── checkpoints/graph.checkpoint..json # post-state graph after each apply
├── checkpoints.json # checkpoint timeline registry
├── loop_trace_.json # per-query loop audit trace
├── refinement_results_.jsonl # per-day run log
├── refinement_actions_*.txt # optional; only when refinement path is taken
├── proposed_refinement_actions_*.txt # CLI dry-run proposed actions
├── proposed_refinement_review_*.md # evidence-aware review report
└── proposed_refinement_review_*.json # optional structured review report
Agent-related commands
Run from your KB project root.
| Command | Description |
|---|---|
deeprefine cursor install |
Install /deeprefine skill for Cursor (.cursor/skills/deeprefine/) |
deeprefine cursor install --user |
Install Cursor skill for all projects (~/.cursor/skills/) |
deeprefine copilot install |
Install /deeprefine skill for Copilot CLI (.github/skills/deeprefine/) |
deeprefine copilot install --user |
Install Copilot CLI skill for all projects (~/.copilot/skills/) |
deeprefine copilot uninstall |
Remove Copilot CLI skill |
deeprefine codex install |
Install $deeprefine skill for Codex (.agents/skills/deeprefine/) |
deeprefine codex install --user |
Install Codex skill for all projects (~/.codex/skills/deeprefine/) |
deeprefine codex uninstall |
Remove Codex skill |
deeprefine claude install |
Install /deeprefine skill for Claude Code (.claude/skills/deeprefine/) |
deeprefine claude install --user |
Install Claude Code skill for all projects (~/.claude/skills/deeprefine/) |
deeprefine claude uninstall |
Remove the Claude Code skill |
deeprefine opencode install |
Install /deeprefine skill + commands for OpenCode (.opencode/) |
deeprefine opencode install --user |
Install OpenCode skill for all projects (~/.opencode/) |
deeprefine opencode uninstall |
Remove the OpenCode skill and commands |
deeprefine gemini path |
Print the extension root used for Gemini CLI |
deeprefine gemini link |
Link the current source checkout with gemini extensions link |
deeprefine gemini install |
Install the bundled extension with gemini extensions install |
deeprefine gemini install --copy-only |
Manual fallback copy to ~/.gemini/extensions/deeprefine-skill |
deeprefine gemini uninstall |
Remove the extension with Gemini CLI’s manager |
deeprefine history sync-memory |
Import graphify-out/memory/query_*.md into DeepRefine history |
deeprefine history list --pending |
Show unrefined queue |
deeprefine loop init --query "..." |
Create loop_trace_.json template |
deeprefine loop validate --trace-file T |
Validate trace against DeepRefine control flow |
deeprefine review --trace-file T --refinement-file F |
Review proposed actions with HIGH/MEDIUM/LOW evidence labels; no graph write |
deeprefine apply --refresh-wiki --trace-file T --refinement-file F |
Apply actions and regenerate graphify-out/wiki from the refined graph; graph + Wiki are committed together |
deeprefine apply --refresh-wiki --allow-low-confidence --trace-file T --refinement-file F |
Refresh the Wiki while explicitly overriding the LOW-confidence guard |
deeprefine loop finish --trace-file T [--refinement-file F] |
Persist results and mark history refined |
Evidence-aware review and safe apply
/deeprefine should default to dry-run-first behavior. Proposed actions are reviewed before they can modify graphify-out/graph.json. Each action is labeled:
| Label | Meaning |
|---|---|
HIGH |
Direct graph or code evidence exists. |
MEDIUM |
k-hop context supports the action, but direct code or exact-edge evidence is missing. |
LOW |
Node names are ambiguous, too broad, cross-community, or cannot be grounded in graph.json. |
Bare function names such as main(), run(), train(), test(), and setup() are treated as ambiguous. Prefer file-qualified names:
BAD: insert_edge("main()", "calls", "Trainer")
GOOD: insert_edge("pretraining/pretraining_CLIP_fine-grained.py::main()", "calls", "Trainer")
deeprefine apply refuses LOW-confidence actions by default. Use --allow-low-confidence only when the user explicitly accepts the risk.
When the knowledge base was created with Graphify Wiki output, use --refresh-wiki. DeepRefine stages the refined graph, regenerates the Wiki with graphify export wiki, validates wiki/index.md, and only then replaces the production graph and Wiki. If export fails, the existing graph and Wiki remain unchanged.
Codex Integration
Copilot CLI Integration
Gemini CLI Integration
OpenCode Integration
Claude Code Integration
Terminal CLI (FAISS + API/vLLM)
License
MIT — see LICENSE.
Recommended Tools
Try a different keyword or remove a filter.
Install
npx skillfish add hkust-knowcomp/deeprefine-skill