Autoresearch skill
This skill should be used when the user asks to "improve a skill", "create an autoresearch loop", "iteratively improve", "optimize a skill", "run an improvement loop on skill X", "autoresearch skill", "autonomously improve", "evaluate and improve a skill", "benchmark a skill", or wants to set up an autonomous agent loop that iteratively experiments with and improves a Claude Code skill against user-defined criteria.From its SKILL.md
npx -y skills add dannycoates/cc-ar --skill autoresearch-skillAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.4 KB, as published. Nobody here has run it
Autoresearch Skill Improvement Loop
Generate a self-contained shell script that autonomously improves a Claude Code
skill through iterative cycles. Each iteration: improve the skill, actually
execute it against test prompts, evaluate the execution output, keep or discard.
Deterministic steps (git, scoring, cleanup) run as plain bash. Subjective steps
(improving, executing, evaluating) run via claude -p calls with generated
prompts.
Workflow
Step 1: Analyze the Target Skill
Read all files in the target skill directory. Build two things:
File inventory -- what files exist and can be modified:
Skill: mermaid-svg
Files:
- SKILL.md (2,100 words)
- references/layout-patterns.md (3,200 words)
- references/style-guide.md (1,800 words)
Execution profile -- how the skill behaves when used:
- Purpose: What the skill does when triggered (e.g., "converts Mermaid diagram syntax into hand-crafted SVG markup")
- Required tools: What tools a
claude -pcall needs to execute the skill (e.g.,Read,Write,Globfor a skill that reads input and writes files;Read,Edit,Write,Glob,Bashfor a skill that runs scripts;Read,WebSearch, WebFetchfor a research skill) - Artifacts: What files or output the skill produces when executed
(e.g.,
*.svgfiles,*.tsfiles, text-only output to stdout) - Cleanup commands: Bash commands to remove artifacts between executions
(e.g.,
rm -f *.svg,rm -rf output/). Empty if the skill produces only text output.
Step 2: Gather Criteria
If the user has not provided optimization criteria, ask for them. Criteria are specific, measurable aspects of the skill to improve. Examples:
- "SVG output should use logical coordinate-based layout, not magic numbers"
- "Research responses should include source quality evaluation"
- "TypeScript guidance should cover monorepo project patterns"
Also ask whether the user wants to provide test prompts -- concrete user queries that exercise the skill. If not provided, generate 3-5 from the criteria. Test prompts should be realistic requests a user would make that trigger the skill.
Step 3: Build the Evaluation Rubric
Convert each criterion into a 1-5 scoring rubric with observable level
descriptions. See references/prompt-templates.md for rubric construction
guidance. Each level describes concrete, observable qualities of the
execution output (not the skill files themselves).
Step 4: Compose the Prompts
Build three system prompts embedded in the script:
-
Improver prompt -- Instructs
claude -pto read the skill files, analyze past results, propose and apply ONE improvement. Includes: the rubric, improvement strategies (fromreferences/improvement-strategies.md), file constraints, and requiredHYPOTHESIS:output line. -
Executor prompt -- Instructs
claude -pto act as Claude with the skill loaded. The skill content is injected dynamically at runtime (the script reads the current SKILL.md + references each iteration). The executor receives a test prompt and responds as Claude would, following the skill's guidance. -
Evaluator prompt -- Instructs
claude -pto judge the execution outputs against the rubric. Receives: the collected execution outputs from all test prompts, the rubric, and outputs a structured score withAGGREGATE:line.
See references/prompt-templates.md for the full templates.
Step 5: Generate the Script
Generate a bash script following references/script-structure.md. Sections:
- Configuration -- skill dir, branch, TSV path, test prompts array, cleanup commands, all system prompts as heredocs
- Helper functions --
read_skill(reads current skill content at runtime),execute_skill(runs all test prompts, collects outputs),cleanup_artifacts(removes execution artifacts),summary(exit trap) - Setup -- create branch, initialize TSV
- Baseline -- execute skill as-is against test prompts, evaluate outputs, record baseline score
- Main loop -- improve, commit, execute, evaluate, decide, cleanup, log
- Summary -- print results table on exit
Key design rules:
- The executor
claude -pcall receives the current skill content (read at runtime viaread_skill), not a fixed heredoc -- the skill changes each iteration - The executor gets tools from the execution profile (Step 1)
- After each execution+evaluation cycle,
cleanup_artifactsremoves any files the skill created, so the next iteration starts clean - The evaluator judges execution output quality, not skill file content
- Score extraction:
grep -oP 'AGGREGATE:\s*\K[0-9.]+' - Keep/discard:
score > best_scoreviabc -l - Plateau: 3 consecutive discards triggers exit
- Trap EXIT for summary on Ctrl+C
Step 6: Write and Confirm
Write the script to improve-<skill-name>.sh in the repo root. Make it
executable. Show the user:
- The execution profile (tools, artifacts, cleanup)
- The generated rubric
- The test prompts
- How to run:
bash improve-<skill-name>.sh - How to stop: Ctrl+C (prints summary)
- How to review:
cat improvements.tsvandgit log skill-improve/<tag>
Constraints
- The generated script must be self-contained -- prompts baked in as
heredocs, no external dependencies beyond
claude,git,bc,grep - The executor must load the current skill content each iteration (not a stale copy from generation time)
- Cleanup must remove all execution artifacts between iterations
- The evaluator prompt and test prompts are fixed for the run
improvements.tsvstays untracked by git
Additional Resources
Reference Files
references/prompt-templates.md-- System prompt templates for all threeclaude -pcalls (improve, execute, evaluate), rubric guidereferences/script-structure.md-- Complete bash script structure with execute step, cleanup, and dynamic skill loadingreferences/improvement-strategies.md-- Catalog of skill improvement strategies, embedded in the improver system prompt