Refine

From Lambenthan/empiricalwiki · View interactive version

Refine is an AI agent skill from the GitHub repository Lambenthan/empiricalwiki. 通用多轮迭代改进:对任意研究制品反复调用 /review → 解析反馈 → 修复 → 更新 wiki,直到达标

How to use this skill

Skill file

/refine

通用多轮迭代改进循环,适用于任何研究制品(idea、proposal、experiment plan、paper draft)。

每轮调用 /review 获取结构化反馈 → 解析 actionable items → Claude 修复制品 → 更新 wiki 实体 →

重新 /review,直到评分达到目标分数或达到最大轮次。

输出改进历史和最终 review 评分。

Inputs

Outputs

Wiki Interaction

Reads

Writes

Graph edges created

Workflow

前置:确认工作目录为 wiki 项目根(包含 wiki/、raw/、tools/ 的目录)。

Step 1: 初始化

  1. 定位 artifact:
  1. 读取当前内容:加载 artifact 完整文本
  2. 初始化追踪变量:

Step 2: 迭代循环

重复以下步骤,直到满足终止条件:

Round N(N = 1, 2, ..., max-rounds):

2a. 调用 /review
Skill: review
Args: "<artifact-path-or-content>" --difficulty {difficulty} --focus {focus}

解析 review 输出,提取:

2b. 检查终止条件
2c. 分类 actionable items 并修复

对每个 actionable item 进行分类和处理:

Category A — 方法/内容问题(Claude 直接修复):

Category B — wiki 知识缺口(建议外部操作):

Category C — claim 状态更新(Claude 修复 wiki):

Category D — 超出范围(跳过):

2d. 更新追踪
2e. 重建派生数据(若 wiki 有变更)

若本轮有 wiki 变更(Category C):

python3 tools/research_wiki.py rebuild-context-brief wiki/
python3 tools/research_wiki.py rebuild-open-questions wiki/

Step 3: 最终报告

迭代结束后,生成 REFINE_REPORT:

# Refine Loop Report: {artifact title}

## Summary
- **Artifact**: {slug or path}
- **Rounds**: {N} / {max-rounds}
- **Score trajectory**: {score_history, e.g., 5 → 6 → 7 → 8}
- **Final score**: {final_score}/10
- **Final verdict**: {verdict}
- **Termination reason**: {target reached / converged / max rounds / rethink}

## Issues Fixed ({count})

| Round | Issue | Severity | Fix applied |
|-------|-------|----------|-------------|
| 1 | 方法描述不够具体 | major | 补充了具体算法步骤 |
| 1 | claim confidence 过高 | major | 调低 [[claim-slug]] confidence 0.8→0.6 |
| 2 | 缺少 ablation 设计 | minor | 添加了 ablation 计划 |

## Wiki Changes Made

| Page | Change | Round |
|------|--------|-------|
| `wiki/claims/{slug}.md` | confidence 0.8 → 0.6 | 1 |
| `wiki/graph/edges.jsonl` | +1 edge (addresses_gap) | 2 |

## Unresolved Issues ({count})

| Issue | Severity | Suggested action |
|-------|----------|------------------|
| 缺少实验验证 | critical | Run `/exp-design {slug}` |
| 缺少对比论文 | major | Run `/ingest` for {paper-title} |

## Next Steps
- {based on verdict and unresolved issues}

追加日志:

python3 tools/research_wiki.py log wiki/ \
  "refine | {artifact-slug} | {N} rounds | score {initial}→{final} | verdict: {verdict}"

Constraints

Error Handling

Dependencies

Tools(via Bash)

Skills(via Skill tool)

Claude Code Native

Shared References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.