refine
Skill1 starsChanged 3 months agoMITView on GitHub
Continual-harness refinement. Use when a session produced a durable lesson worth keeping - a repeated failure, a reusable tactic, a delegation role, a behavior policy, or a project fact - and it should be persisted as a small evidence-backed edit to the rig instead of being lost with the context. Triggers - "/refine", "retiens ca", "apprends de cette session", "ameliore le rig", "persiste cette lecon", before a compaction that would erase the trajectory, at the end of a long debugging or build session. Also use to review refinement history or roll back a bad refinement.
47 other projects use a version of this.
Adopted by
Most recently taken up by
- ryanportfolio/Harness-Firmwaretheir own version, first seen Nov 29, 2026
- softkleenex/open-primeagenttheir own version, first seen Nov 29, 2026
- Uniterra-Solutions/tidy-up-your-thoughtstheir own version, first seen Nov 29, 2026
- discountry/ritmex-skillstheir own version, first seen Nov 29, 2026
- ryanportfolio/HarnessFirmware.comtheir own version, first seen Nov 28, 2026
- MindExtension/personal-workspace-templatetheir own version, first seen Nov 26, 2026
Used with
Projects with it also use daily-arxiv, exp-eval and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
LambenthanSkilldaily-arxiv
每日从 arXiv 拉取新论文,过滤相关性,auto-ingest 高优先级论文,检测 SOTA 更新
Also in 5 projects that use this
LambenthanSkillexp-eval
实验判决门:Review LLM 独立评判实验结果 → 4 种判决路径 → 自动更新 claims confidence、ideas status、graph edges
Also in 5 projects that use this
ryanportfolioSkilladdskill
Create, import, update, or install repo or personal skills: runtime ownership, resources, discovery checks.
Also in 6 projects that use this
ryanportfolioSkillapply-firmware
Bring current folder (plain folder, existing repo, old or partial firmware copy) up to full Harness Firmware in place. Mirror external repo → adopt-repo.
Also in 6 projects that use this
- +5 more from Lambenthan
- +3 more from ryanportfolio
Other versions47 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 47
- PrimeIntellect-ai/prime-agent★ 23ksame name
- windmill-labs/windmill★ 19ksame name
- skyllwt/OmegaWiki★ 1.7ksame name
- DAIR-AutoResearch/AutoSci★ 1.7ksame name
- PKU-DAIR/AutoSci★ 1.7ksame name
- skyllwt/AutoSci★ 1.7ksame name
- rsi-gear/gear★ 556same name
- AlexPEClub/ai-coding-starter-kit★ 382same name
- automagik-dev/genie★ 353same name
- automagik-si/genie★ 353same name
37 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository184 other files it gives its agents.
- skills/gstack/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/gstack/CLAUDE.mdCLAUDE.md
- skills/gstack/model-overlays/claude.mdCLAUDE.md
- affiliate-marketingSkill
- agent-browserSkill
- agent-reachSkill
- aliexpress-source-mappingSkill
- animejsSkill
- antivibeSkill
- autoplanSkill
- brandkitSkill
- browseSkill
- buffettSkill
- canarySkill
- carefulSkill
- codexSkill
- open-gstack-browserSkill
- context-restoreSkill
- context-saveSkill
- copywritingSkill
- seedance-course-promoSkill
- create-viral-contentSkill
- csoSkill
- css-animationsSkill
- demand-validatorSkill
- design-consultationSkill
- design-htmlSkill
- design-reviewSkill
- design-shotgunSkill
- design-taste-frontendSkill
- discord-botSkill
- discord-historySkill
- discord-send-messageSkill
- docxSkill
- email-campaignsSkill
- engineering-figure-agentSkill
- freezeSkill
- frontend-designSkill
- full-output-enforcementSkill
- gmc-passSkill
- google-analyticsSkill
- gpt-tasteSkill
- gsapSkill
- autoplanSkill
- benchmark-modelsSkill
- benchmarkSkill
- browseSkill
- canarySkill
- carefulSkill
- codexSkill
- context-restoreSkill
- context-saveSkill
- csoSkill
- design-consultationSkill
- design-htmlSkill
- design-reviewSkill
- design-shotgunSkill
- devex-reviewSkill
- document-releaseSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 41 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Create or update the smallest component that fits.
- Distinctive: line 63
Read prior refinements. If an earlier refinement caused a problem, fix or supersede that entry instead of stacking a contradictory one.
- Distinctive: line 84
Record the refinement: Write a payload and register it:
- Distinctive: line 117
Every entry states the why (the cost paid), not only the what.
- Distinctive: line 119
Never duplicate what the repo, git history, or CLAUDE.md already records.
- Very specific: line 120
Before citing an existing file/flag/skill in an entry, verify it still exists.
- Distinctive: line 139
When you see it: apply this skill, but keep the bar high.
- Distinctive: line 141
If nothing qualifies, say so in one line and skip - a refinement with zero edits is refused by the engine on purpose.
“Common” is measured: kept by at least 6 in 10 of the 41 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Refine - Continual Harness
Port of PrimeIntellect prime-agent's Continual Harness (/refine, MIT,
https://github.com/PrimeIntellect-ai/prime-agent) onto this rig.
Refinement reads the current trajectory and applies small, evidence-backed edits to durable rig state. It is compaction's sibling: compaction summarizes the conversation, refinement extracts what should outlive it.
The base ~/.claude/CLAUDE.md is IMMUTABLE. Refinement never rewrites it.
The four kinds
| kind | what it is | where it lands on this rig |
prompt | narrow behavioral policy addendum | harness/addendum/PROMPT-NOTES.md, injected at SessionStart |
memory | durable fact, decision, failure, preference, outcome | ~/.claude/projects/<enc>/memory/<slug>.md + MEMORY.md line |
skill | repeatable procedure worth invoking by name | ~/.claude/skills/<name>/SKILL.md |
subagent | reusable delegation role | ~/.claude/agents/<name>.md |
Create or update the smallest component that fits. Repeated delegation role -> subagent. Repeated procedure -> skill. Durable fact or preference -> memory. Narrow behavioral policy -> prompt note. Do not rewrite the whole harness when a focused entry is enough.
Scope
--scope global(default): stable cross-session lessons, durable user preferences, reusable skills/subagents, tool or environment facts. Store:~/.claude/harness/.--scope local: session/project-specific progress, active task state, temporary blockers, project facts that must not leak into other sessions. Store:<project>/.claude/harness/.
A project-specific lesson may go global only when its title or content explicitly names the project and it will be reused in future sessions for that project. Otherwise: local.
Hard rule on this rig - no removal
The operator's standing rule (the no-removal rule) overrides the upstream design:
action: "create"andaction: "update"are free.action: "delete"is REFUSED by the engine unless--allow-deleteis passed, and that flag is only passed after an explicit per-item GO from the operator. Never ask for a blanket GO. Never propose a removal on your own.rollbackreverts files. Dry-run first (default), show the exact file list, get the GO, then--go.
Procedure
- Check state
Read prior refinements. If an earlier refinement caused a problem, fix or supersede that entry instead of stacking a contradictory one.python ~/.claude/scripts/harness-refine.py status python ~/.claude/scripts/harness-refine.py list -n 5 - Find the evidence. Scan the trajectory for: a failure that happened more than once, a tactic that worked and will be needed again, a correction the operator made, an environment fact paid for in wasted time. No evidence in this trajectory = no edit. Do not persist hypotheses, one-off noise, or transient tool output.
- Snapshot before touching anything
This is what makes rollback possible. Skipping it is a bug.python ~/.claude/scripts/harness-refine.py snapshot --id ref-YYYYMMDD-HHMM \ --files <every file the edits will write> - Write the real files. Apply each edit to its destination store
(memory file +
MEMORY.mdline,skills/<name>/SKILL.md,agents/<name>.md). Prompt notes need no manual file - the engine rendersPROMPT-NOTES.mdfrom the entry content. - Record the refinement. Write a payload and register it:
{ "id": "ref-YYYYMMDD-HHMM", "summary": "one sentence", "rationale": "why these edits are justified by trajectory evidence", "evidence": "the concrete thing observed - quote it", "expectedOutcome": "what should improve and how to validate it", "edits": [ { "action": "create", "kind": "memory", "id": "stable-slug", "title": "short title", "content": "the entry body as written to disk", "path": "optional destination path", "metadata": {"scope": "global"}, "reason": "why this edit is useful" } ] }python ~/.claude/scripts/harness-refine.py record --json-file <payload>.json --trigger manual - Report in one block: what was persisted, where, and how to validate it. Name the ledger id so it can be rolled back.
Anti-slop gates
- Max 3 edits per refinement unless the operator asks for more. A refinement that wants to rewrite ten things is a refinement that understood nothing.
- Every entry states the why (the cost paid), not only the what.
- Convert relative dates to absolute at write time.
- Never duplicate what the repo, git history, or
CLAUDE.mdalready records. - Before citing an existing file/flag/skill in an entry, verify it still exists.
- A memory entry follows the rig's existing memory format (frontmatter
name/description/metadata.type,**Why:**+**How to apply:**for feedback and project types,[[links]]to related memories).
Review and rollback
python ~/.claude/scripts/harness-refine.py list -n 20
python ~/.claude/scripts/harness-refine.py show <id>
python ~/.claude/scripts/harness-refine.py entries
python ~/.claude/scripts/harness-refine.py rollback <id> # dry run
python ~/.claude/scripts/harness-refine.py rollback <id> --go # after explicit GOWhen the harness fires on its own
The PreCompact hook injects a refine checkpoint right before the trajectory is
summarized away - that is the upstream auto_refine(reason="compact") gate.
When you see it: apply this skill, but keep the bar high. Approve an edit only
when the trajectory holds evidence useful to future turns. Reject one-off noise.
If nothing qualifies, say so in one line and skip - a refinement with zero edits
is refused by the engine on purpose.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

