Agent skill
system-refiner
Autonomously correct project rules when negative feedback occurs. Use PROACTIVELY when user says 'no', 'wrong', 'wait', 'not that', or 'actually'. Identifies the root cause in commands, agents, skills, or documentation and rewrites the offending instruction to prevent recurrence.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/system-refiner
SKILL.md
<mission_control> Analyze the mistake, find the instruction that caused it, and patch the relevant file. <success_criteria>offending rule identified; atomic patch applied; user informed of the change</success_criteria> </mission_control>
Workflow
- Detect: User correction ("No," "Wait," "Wrong," "Not what I meant")
- Trace: Ask "Which instruction allowed this mistake?"
- Project documentation? → Update the source
- Skill workflow? → Edit the skill
- Command logic? → Fix the command
- Agent prompt? → Refine the agent
- Identify the Gap: Why did the instruction fail? Was it missing, vague, or contradictory?
- Patch: Apply targeted edit to the relevant file
- Report: "I've updated [file] to ensure I [new behavior]."
Root Cause Mapping
| If the mistake reveals... | Target... |
|---|---|
| Missing or wrong project rule | Documentation, CLAUDE.md, .claude/rules/ |
| Wrong procedural pattern | Relevant skill in .claude/skills/ |
| Command logic issue | Command file in .claude/commands/ |
| Agent behavior problem | Agent config in .claude/agents/ |
| Hook or tool mismatch | Hook definition or tool schema |
Patching Principles
- Be specific: Patch the exact instruction that failed, not surrounding content
- Generalize: Extract principle from the specific mistake
- Respect structure: Follow each file's existing conventions (XML tags, tables, etc.)
- Place strategically: Put new constraints where they'll be noticed (file bottoms for recency)
<critical_constraint>
- NEVER create new files for corrections; ALWAYS edit existing rules/skills/commands/agents.
- Use the Delta Standard: Only add rules for things you actually got wrong.
- Keep patches atomic. Change the logic, not the formatting.
- If unsure where the rule belongs, trace from effect to cause before editing. </critical_constraint>
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?