From hyperagents
Evolutionary parent selection algorithms for choosing which generation to mutate next. Implements random, best, score-proportional, and novelty-aware selection. Triggers when selecting parents, managing exploration/exploitation tradeoffs, or configuring evolution strategy.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hyperagents:parent-selectionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Parent selection is how HyperAgents balances exploration (trying new directions) with exploitation (refining what works). The choice of selection method significantly affects evolution dynamics.
Parent selection is how HyperAgents balances exploration (trying new directions) with exploitation (refining what works). The choice of selection method significantly affects evolution dynamics.
random — Maximum ExplorationP(parent_i) = 1 / N for all valid parents
latest — Linear ChainAlways select the most recent valid generation
best — Maximum ExploitationAlways select the highest-fitness generation
score_prop — Balanced (Recommended)P(parent_i) = fitness_i / sum(all_fitness)
score_child_prop — Novelty-AwareP(parent_i) = (fitness_i / (1 + children_i)) / Z
Where Z is the normalizing constant and children_i is the number of offspring already created from parent i.
def select_parent(archive, output_dir, domains, method):
# 1. Get candidates (valid parents only)
candidates = {}
for genid in archive:
if not is_valid_parent(output_dir, genid):
continue
# Average fitness across all domains
scores = [get_score(domain, output_dir, genid) for domain in domains]
if all(s is not None for s in scores):
candidates[genid] = mean(scores)
# 2. Apply selection method
if method == "random":
return random.choice(list(candidates.keys()))
elif method == "latest":
return max(candidates.keys())
elif method == "best":
return max(candidates, key=candidates.get)
elif method == "score_prop":
weights = list(candidates.values())
return random.choices(list(candidates.keys()), weights=weights, k=1)[0]
elif method == "score_child_prop":
child_counts = count_children(archive, output_dir)
weights = [
score / (1 + child_counts.get(gid, 0))
for gid, score in candidates.items()
]
return random.choices(list(candidates.keys()), weights=weights, k=1)[0]
A generation is a valid parent if:
valid_parent: true in its metadata| Scenario | Recommended Method |
|---|---|
| Starting evolution, unknown domain | random |
| Refining a known-good approach | best |
| General purpose, most cases | score_prop |
| Open-ended exploration, diversity matters | score_child_prop |
| Ablation study, control condition | latest |
| Many generations complete, seeking novelty | score_child_prop |
Signs of poor parent selection:
score_child_proprandom temporarilybest to stabilizerandom or score_child_propCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub zpankz/hyperagents-plugin