autoresearch
Autonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with…
Run metric-driven iterative optimization loops. Define a measurable goal, build measurement scaffolding, then run parallel experiments that try many approaches, measure each against hard gates and/or LLM-as-judge quality scores, keep improvements, and converge toward the best
$ npx -y skills add leo-kuang-ai/spec-first --skill spec-optimize --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/spec-optimizeContext preview
The summary Claude sees to decide when to auto-load this skill.
Run metric-driven iterative optimization loops. Define a measurable goal, build measurement scaffolding, then run parallel experiments that try many approaches, measure each against hard gates and/or LLM-as-judge quality scores, keep improvements, and converge toward the best
name: spec-optimize description: "Run metric-driven iterative optimization loops. Define a measurable goal, build measurement scaffolding, then run parallel experiments that try many approaches, measure each against hard gates and/or LLM-as-judge quality scores, keep improvements, and converge toward the best solution. Use when optimizing clustering quality, search relevance, build performance, prompt quality, or any measurable outcome that benefits from systematic experimentation. Inspired by Karpathy's autoresearch, generalized for multi-file code changes and non-ML domains." argument-hint: "[path to optimization spec YAML, or describe the optimization goal]"
Run metric-driven iterative optimization. Define a goal, build measurement scaffolding, then run parallel experiments that converge toward the best solution.
Use when a measurable outcome can improve through iterative experiments, hard gates, and/or LLM-as-judge scoring.
Do not use for ordinary implementation, vague improvement requests without a metric, debugging without a feedback loop, or unbounded spend/concurrency. Name the destination when routing out: a bug with no stable repro and no measurement loop is `spec-debug`'s work (or `spec-work` for settled implementation) — diagnosing the bug inside this workflow to turn it into an optimization goal is adopting the wrong workflow, not adapting it; route out explicitly instead of drafting a spec around the diagnosis.
An optimization spec or goal, mutable/immutable scope, measurement command or scaffold plan, budget limits, experiment settings, repository instructions, and baseline evidence.
A measurement scaffold and experiment log, scored experiment results, kept/rejected variants, final integrated changes when appropriate, and post-run recommendations.
Run state under `.spec-first/workflows/spec-optimize/<spec-name>/`, experiment worktrees/results, strategy digests, and no hidden workflow state outside the documented log.
Missing metric, missing measurement command, unsafe scope, excessive or uncapped budget, failed baseline, write verification failure, or unavailable dispatch/worktree backend.
Validate the spec and budget, establish the baseline, run bounded experiments, measure and write results immediately, select winners, integrate only verified improvements, and summarize evidence.
Code review、benchmark maintainer、在性能/相关性变更时参与的 release reviewer,以及检查 experiment logs 的人工审查者。
Follows `docs/contracts/workflows/scenario-capability-matrix.md` (default). Overrides: none
Use the platform's blocking question tool: `AskUserQuestion` in Claude Code (call `ToolSearch` with `select:AskUserQuestion` first if its schema isn't loaded) or `request_user_input` in Codex. Fall back to numbered options in chat only when no blocking tool exists in the harness or the call errors (e.g., Codex edit modes) — not because a schema load is required. Never silently skip the question.
<optimization_input> #<invocation arguments supplied by the current host> </optimization_input>
If the input above is empty, ask: "What would you like to optimize? Describe the goal, or provide a path to an optimization spec YAML file."
Reference the spec schema for validation:
`references/optimize-spec-schema.yaml`
Reference the experiment log schema for state management:
`references/experiment-log-schema.yaml`
For a first run, optimize for signal and safety, not maximum throughput:
For a friendly overview of what this skill is for, when to use hard metrics vs LLM-as-judge, and example kickoff prompts, see:
`references/usage-guide.md`
Do not run `spec-optimize` as an expensive substitute for ordinary work. Before Phase 1, confirm the run has all of these:
If any item is missing, stop and help the user create a safe spec or route the work to the current host's plan/work/debug entrypoint instead. Do not continue with an open-ended optimization loop.
When the invocation or approved spec selects `mode:measurement-only`, load `references/measurement-only-calibration.md`. This mode compares an explicitly identified baseline and candidate against the same repeatable task/corpus. It must run an A/A noise floor before A/B, use a pre-registered acceptance threshold, classify broken runs separately from regressions, and produce only a measurement artifact plus stop/defer guidance.
Before the first measurement, materialize the approved frozen inputs as a run-lo
把 AI coding 会话变成可信、由项目拥有的变更。 spec-first 是面向 Claude Code、Codex、Kiro、Qoder、Cursor、OpenCode、ZCode 与 Pi 的仓库原生 AI Coding Harness。它把想法、需求、计划、代码、审查和知识连接成可检查的工程闭环。
Autonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with…
Audit mobile App PRD/Figma/local-source consistency across page routes, KMP/Clean Architecture, components, analytics, i18n,…
Explore vague or ambitious ideas into a right-sized requirements-only unified plan. Use when the user wants to brainstorm, think…
Structured code review for bugs, regressions, tests, and standards. Report-only by default; apply fixes only when the current…
Internal landing helper for public workflows that already hold explicit commit and landing authorization; commits scoped changes,…
Internal commit helper for public workflows that already hold explicit commit authorization; creates scoped, value-communicating…