Agent skill
self-evolving-heuristics
Analyze the codebase to find hard-coded thresholds, defaults, and timing constants, then convert them into self-evolving heuristics backed by a persistent registry that updates on each execution. Use when asked to replace fixed decision logic with adaptive parameters, build a heuristic registry, or generate a patch plan for heuristic rewrites.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/self-evolving-heuristics
SKILL.md
Self Evolving Heuristics
Overview
Identify static decision points in the codebase and rewrite them as registry-backed heuristics that evolve via runtime observations.
Workflow
- Scan for bottlenecks
python scripts/scan_bottlenecks.py --root . --output runs/heuristics_bottlenecks.json
- Build the heuristic registry
python scripts/build_registry.py --input runs/heuristics_bottlenecks.json --output memory/agent_state_v1/heuristics.json
- Install the registry module for runtime use
python scripts/install_registry.py --repo .
- Emit a patch plan
python scripts/emit_patch_plan.py --input runs/heuristics_bottlenecks.json --output runs/heuristics_patch_plan.md
- Apply the plan manually
- Replace constants with
heuristics_registry.get_value("key", default=<literal>). - Add
heuristics_registry.observe("key", observed_value)after each execution to evolve the value.
- Replace constants with
Update Pattern
from core.sovereignty_v2 import heuristics_registry
threshold = heuristics_registry.get_value("core_worker.cpu_threshold", default=0.85)
if cpu_usage > threshold:
...
heuristics_registry.observe("core_worker.cpu_threshold", cpu_usage)
Notes
- Keep bounds conservative and only update from reliable signals.
- Re-run the scan after patching to confirm remaining constants are intentional.
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?