diff --git a/skills/skill-creator/scripts/generate_report.py b/skills/skill-creator/scripts/generate_report.py index 959e30a0..3f6cb732 100755 --- a/skills/skill-creator/scripts/generate_report.py +++ b/skills/skill-creator/scripts/generate_report.py @@ -316,7 +316,7 @@ def main(): html_output = generate_html(data, skill_name=args.skill_name) if args.output: - Path(args.output).write_text(html_output) + Path(args.output).write_text(html_output, encoding="utf-8") print(f"Report written to {args.output}", file=sys.stderr) else: print(html_output) diff --git a/skills/skill-creator/scripts/run_eval.py b/skills/skill-creator/scripts/run_eval.py index e58c70be..947b2d61 100755 --- a/skills/skill-creator/scripts/run_eval.py +++ b/skills/skill-creator/scripts/run_eval.py @@ -9,6 +9,7 @@ import argparse import json import os import select +import shutil import subprocess import sys import time @@ -65,10 +66,10 @@ def run_single_query( f"# {skill_name}\n\n" f"This skill handles: {skill_description}\n" ) - command_file.write_text(command_content) + command_file.write_text(command_content, encoding="utf-8") cmd = [ - "claude", + shutil.which("claude") or "claude.cmd", "-p", query, "--output-format", "stream-json", "--verbose", diff --git a/skills/skill-creator/scripts/run_loop.py b/skills/skill-creator/scripts/run_loop.py index 30a263d6..00bfeba3 100755 --- a/skills/skill-creator/scripts/run_loop.py +++ b/skills/skill-creator/scripts/run_loop.py @@ -148,7 +148,7 @@ def run_loop( "test_size": len(test_set), "history": history, } - live_report_path.write_text(generate_html(partial_output, auto_refresh=True, skill_name=name)) + live_report_path.write_text(generate_html(partial_output, auto_refresh=True, skill_name=name), encoding="utf-8") if verbose: def print_eval_stats(label, results, elapsed): @@ -275,7 +275,7 @@ def main(): else: live_report_path = Path(args.report) # Open the report immediately so the user can watch - live_report_path.write_text("

Starting optimization loop...

") + live_report_path.write_text("

Starting optimization loop...

", encoding="utf-8") webbrowser.open(str(live_report_path)) else: live_report_path = None @@ -310,15 +310,15 @@ def main(): json_output = json.dumps(output, indent=2) print(json_output) if results_dir: - (results_dir / "results.json").write_text(json_output) + (results_dir / "results.json").write_text(json_output, encoding="utf-8") # Write final HTML report (without auto-refresh) if live_report_path: - live_report_path.write_text(generate_html(output, auto_refresh=False, skill_name=name)) + live_report_path.write_text(generate_html(output, auto_refresh=False, skill_name=name), encoding="utf-8") print(f"\nReport: {live_report_path}", file=sys.stderr) if results_dir and live_report_path: - (results_dir / "report.html").write_text(generate_html(output, auto_refresh=False, skill_name=name)) + (results_dir / "report.html").write_text(generate_html(output, auto_refresh=False, skill_name=name), encoding="utf-8") if results_dir: print(f"Results saved to: {results_dir}", file=sys.stderr)