CommonAutoRearsh/scripts/mutate_skill_task.py

43 lines
1.1 KiB
Python

from __future__ import annotations
import argparse
from pathlib import Path
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument("--task-dir", required=True)
parser.add_argument("--artifact", required=True)
return parser.parse_args()
def main() -> int:
args = parse_args()
task_dir = Path(args.task_dir).resolve()
artifact_path = (task_dir / args.artifact).resolve()
artifact_path.write_text(
"\n".join(
[
"# Deterministic Sample Skill",
"",
"## Sandbox Marker",
"Candidate emitted by sandbox mutator.",
"",
"## When to Use",
"Use this skill when you need a deterministic artifact for end-to-end testing.",
"",
"## Steps",
"1. Read the task instructions.",
"2. Compare the skill against the rubric.",
"3. Return the computed score.",
]
)
+ "\n",
encoding="utf-8",
)
return 0
if __name__ == "__main__":
raise SystemExit(main())