Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/ronronner02/codepilot-agent/spec-optimizenpx skills add ronronner02/codepilot-agent --skill spec-optimizegit clone --depth 1 https://github.com/ronronner02/codepilot-agentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ronronner02/codepilot-agent/spec-optimize)<a href="https://agentmods.dev/skills/ronronner02/codepilot-agent/spec-optimize"><img src="https://agentmods.dev/badge/skills/ronronner02/codepilot-agent/spec-optimize.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00100 | $0.10860 |
| Opus 5 | $0.00050 | $0.05430 |
| Sonnet 5 | $0.00020 | $0.02172 |
| Haiku 4.5 | $0.00010 | $0.01086 |
Grade A, and why
spec-optimize scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 774 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Iterative Optimization Loop
Run metric-driven iterative optimization. Define a goal, build measurement scaffolding, then run parallel experiments that converge toward the best solution.
Workflow Contract Summary
When To Use
Use when a measurable outcome can improve through iterative experiments, hard gates, and/or LLM-as-judge scoring.
When Not To Use
Do not use for ordinary implementation, vague improvement requests without a metric, debugging without a feedback loop, or unbounded spend/concurrency.
Inputs
An optimization spec or goal, mutable/immutable scope, measurement command or scaffold plan, budget limits, experiment settings, repository instructions, and baseline evidence.
Outputs
A measurement scaffold and experiment log, scored experiment results, kept/rejected variants, final integrated changes when appropriate, and post-run recommendations.
Artifacts
Run state under .spec-first/workflows/spec-optimize/<spec-name>/, experiment worktrees/results, strategy digests, and no hidden workflow state outside the documented log.
Failure Modes
Missing metric, missing measurement command, unsafe scope, excessive or uncapped budget, failed baseline, write verification failure, or unavailable dispatch/worktree backend.
Workflow
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.
Downstream Consumers
Code review、benchmark maintainer、在性能/相关性变更时参与的 release reviewer,以及检查 experiment logs 的人工审查者。
Scenario Capability
Follows docs/contracts/workflows/scenario-capability-matrix.md (default).
Overrides: none
Interaction Method
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.
What ships with it
14 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/agents/learnings-researcher.md 16 KB
- references/agents/repo-research-analyst.md 15 KB
- references/example-hard-spec.yaml 1.3 KB
- references/example-judge-spec.yaml 1.8 KB
- references/experiment-log-schema.yaml 11 KB
- references/experiment-prompt-template.md 4.0 KB
- references/judge-prompt-template.md 4.6 KB
- references/measurement-only-calibration.md 3.5 KB
- references/optimize-spec-schema.yaml 19 KB
- references/usage-guide.md 4.4 KB
- scripts/experiment-worktree.sh 19 KB runs code
- scripts/measure.sh 2.7 KB runs code
- scripts/measurement-admission.cjs 9.6 KB runs code
- scripts/parallel-probe.sh 5.4 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 774 lines · 100 tokens per session scan A 0d5f22f19d52
spec-optimize is a skill published in the GitHub repository ronronner02/codepilot-agent (0 stars, last pushed 3d ago), licensed MIT. It adds 100 tokens to every session and 10,860 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
agent-orchestration
Agent orchestration patterns for agentic loops, multi-agent coordination, alternative frameworks, and multi-scenario workflows. Use when building autonomous agent loops, coordinating multiple agents, evaluating CrewAI/AutoGen/Swarm, or orchestrating complex multi-step scenarios.
generate-ai-rules
Generate AI assistant configuration files for a repository — CLAUDE.md, AGENTS.md, and Cursor rules (.cursor/rules/.mdc) — from codebase analysis. Use whenever the user wants to create or update CLAUDE.md, AGENTS.md, agent rules, Cursor rules, AI coding assistant configuration, or "onboard AI tools" to a project, even…
generate-readme
Generate or refresh a comprehensive, professional README.md for a repository, with architecture overview, mermaid and optional C4 diagrams, repository structure, dependencies, and API documentation. Use whenever the user asks to create, write, update, improve, or regenerate a README, project documentation, or a…
analyze-codebase
Run a multi-agent deep analysis of a codebase, producing AI-readable analysis documents in .ai/docs/ covering structure, dependencies, data flow, request flow, and APIs. Use whenever the user asks to analyze a repository, generate codebase analysis, understand an unfamiliar codebase in depth, or before generating…
langgraph-orchestration
Build or modify LangGraph StateGraph agents in vpeetla-ai repos: typed state, nodes, conditional edges, MemorySaver, interruptbefore HITL. Use when adding orchestrators, coding loops, or multi-agent graphs.
aegis-gateway
Integrate AegisAI gateway before tool side effects (notify, publish, deploy). Use when adding Slack/Telegram/WhatsApp notify, content publish, or any irreversible external action in VAP, AegisLoop, or ai-content-factory.