This skill guides the conversion of an existing project into a sidecar Shinka task while preserving the original source unless in-place conversion is requested. It covers choosing a minimal runnable snapshot, marking evolvable code, generating the evaluator and configuration, and smoke-testing the required metrics and correctness outputs. It also provides Python and non-Python templates and explains the evaluator contract.
87%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Use this skill to turn an existing project into a Shinka-ready task.
This is the alternative starting point to shinka-setup:
shinka-setup: new task from natural-language task descriptionshinka-convert: existing codebase to Shinka task conversionAfter conversion, the user should still be able to use shinka-run.
Invoke this skill when the user:
metrics.json, correct.json, or EVOLVE-BLOCK markersDo not use this skill when:
evaluate.py and initial.<ext> already exist and the user only wants to launch evolution; use shinka-runStart from freeform instructions, then ask follow-ups only if high-impact details are missing.
Collect:
Generate a sidecar task directory at ./shinka_task/ unless the user requests another path.
The task directory should contain:
evaluate.pyrun_evo.pyshinka.yamlinitial.<ext>Do not edit the original source tree unless the user explicitly requests in-place conversion.
./shinka_task/initial.<ext> so shinka-run can detect it.EVOLVE-BLOCK-START / EVOLVE-BLOCK-END markers.run_experiment(...) and use run_shinka_eval.subprocess and write metrics.json plus correct.json.run_evo.py and shinka.yaml.
init_program_path and language match the candidate file.shinka-run.python evaluate.py --program_path <initial file> --results_dir /tmp/shinka_convert_smokeshinka-run skillrun_experiment(...) in the snapshot and evaluate via run_shinka_evalevaluate.py as the Shinka entrypointmetrics.json and correct.json in results_dirMetrics must include:
combined_scorepublicprivateextra_datatext_feedbackCorrectness must include:
correcterrorShinka checks these outputs before it stores a program:
correct must be a JSON boolean, not "true" or 1combined_score must be a finite number (no NaN or infinity); public and private must be JSON objectsWrite metrics.json before correct.json, as run_shinka_eval does: correct.json marks the result as complete. Shinka does not check the order.
Higher combined_score values indicate better performance unless the user explicitly defines an inverted metric that you transform during aggregation.
Prefer shaping the copied program like this:
from __future__ import annotations
# EVOLVE-BLOCK-START
def optimize_me(...):
...
# EVOLVE-BLOCK-END
def run_experiment(random_seed: int | None = None, **kwargs):
...
return score, text_feedbackAnd the evaluator:
from shinka.core import run_shinka_eval
def main(program_path: str, results_dir: str):
metrics, correct, err = run_shinka_eval(
program_path=program_path,
results_dir=results_dir,
experiment_fn_name="run_experiment",
num_runs=3,
get_experiment_kwargs=get_kwargs,
aggregate_metrics_fn=aggregate_fn,
validate_fn=validate_fn,
)
if not correct:
raise RuntimeError(err or "Evaluation failed")The raise makes the evaluator exit non-zero for an incorrect program. Later generations are still stored as reported. An incorrect seed is stored as a failed evaluation instead: its score, metrics and text_feedback are replaced by a diagnostic, and only the stderr log keeps what the evaluator said. Remove the raise if the seed's feedback matters.
Use evaluate.py to run the candidate and write outputs:
import json
import os
from pathlib import Path
def main(program_path: str, results_dir: str):
os.makedirs(results_dir, exist_ok=True)
metrics = {
"combined_score": 0.0,
"public": {},
"private": {},
"extra_data": {},
"text_feedback": "",
}
correct = {"correct": False, "error": ""}
(Path(results_dir) / "metrics.json").write_text(json.dumps(metrics, indent=2))
(Path(results_dir) / "correct.json").write_text(json.dumps(correct, indent=2))scripts/run_evo.py as the starting runner templatescripts/shinka.yaml as the starting config templateshinka-runSakanaAI/ShinkaEvolve
91b6e8c
pythonIf you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.