ai-discover

ai-discover is a skill for Claude Code, Codex from kirodotdev/KiroCrew. It costs 75 tokens per session (639 once invoked), scanned A, original, Apache-2.0.

A discovery step for an automated code-improvement process. It looks for slow parts of a program and fragile paths where bugs may occur, then proposes one specific improvement or test-and-fix pair for each area.

In plain words
What is it for?
Use it to find behavior-preserving performance fixes, create tests that reproduce bugs, and record findings for a later automated improvement pipeline.
Why use it?
It narrows broad performance and bug investigations into concrete candidates while leaving measurement, code changes, and keep-or-revert decisions to later steps.

Skill for Claude CodeCodex

About the project

Kiro Crew is a persistent development workspace where agents continue multi-step software work across sessions, schedules, and connected interfaces. Developers use it locally or remotely through a desktop app, web dashboard, CLI, Slack, or Discord, with unattended tasks and recurring jobs. The catalogue contains skills and instructions for working with this workspace.

kirodotdev/KiroCrew · 3,646 stars · on GitHub · kiro.dev

Install

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.

agentmods
npx agentmods add skills/kirodotdev/kirocrew/ai-discover
Any agent
npx skills add kirodotdev/KiroCrew --skill ai-discover
Clone the repo
git clone --depth 1 https://github.com/kirodotdev/KiroCrew

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for ai-discover

README.md
[![agentmods](https://agentmods.dev/badge/skills/kirodotdev/kirocrew/ai-discover.svg)](https://agentmods.dev/skills/kirodotdev/kirocrew/ai-discover)
Your own site
<a href="https://agentmods.dev/skills/kirodotdev/kirocrew/ai-discover"><img src="https://agentmods.dev/badge/skills/kirodotdev/kirocrew/ai-discover.svg" alt="Measured on agentmods" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 639 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00075 $0.00639
Opus 5 $0.00037 $0.00319
Sonnet 5 $0.00015 $0.00128
Haiku 4.5 $0.00007 $0.00064

Measured 6d ago against content hash 4eb65ed33cb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

ai-discover 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 6d ago.

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.

src/kiro_crew/apps/builtins/auto_improvement/skills/ai-discover/SKILL.md · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ai-discover — the discovery step of the auto-improvement loop

This skill drives Phase A (discovery) of an auto-improvement cycle. It is discovery only: it never applies a change, never runs the keep-or-revert A/B, and never decides whether a finding is kept or drafted as a pull request. Those are the spine's deterministic Python gate / keeper / pipeline, which no model can argue past. That separation is the point — the measurement is the product.

Perf track

  1. Fan out one subagent per candidate hot-path area.
  2. Each runs the profiler against a realistic workload and finds the single largest behavior-preserving win in its area.
  3. Each returns exactly ONE candidate: {target locus, signature, hypothesis, expected stage win, scenario}.
  4. Write all candidates to the discovery artifact the spine reads. The spine dedups by content fingerprint, implements, and verifies with a serial pinned A/B measurement. Discovery does none of that.

Bug track (kind="bug")

  1. Fan out one subagent per failure surface — a risky or known-fragile path.
  2. Each writes a minimal deterministic reproducing test that FAILS on the base commit (RED) and a fix that makes it PASS (GREEN) without regressing the rest of the suite.
  3. Each returns {target locus, reproducing test id + path, fix diff, blast radius, severity note}. The spine's RED → GREEN → STAYGREEN gate is the verdict; there is no A/B or noise band for bug findings.

Reporting a candidate honestly

State the expected win as a hypothesis, not a result. The spine measures it; if your estimate was wrong the candidate is reverted and that is a normal, useful outcome. A guess presented as a measurement is the failure mode this whole app exists to prevent.

What this skill never does

  • Never edits the ruler, the measurement harness, the tests-of-record, or anything outside the active target profile's edit allowlist. Those paths are mechanically rejected, so an edit there wastes the whole cycle.
  • Never publishes or merges a pull request. Survivors are drafted as GitHub draft PRs by the spine, and a human publishes them.
  • Never fabricates a measured number. A fabricated win is the worst possible reward-hack, because it corrupts the record the loop reasons from.

Read the full file on GitHub · 53 lines

Changes

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.

  1. 6d ago First seen · 53 lines · 75 tokens per session scan A 4eb65ed33cb0

Subscribe to this mod's changes

ai-discover is a skill published in the GitHub repository kirodotdev/KiroCrew (3,646 stars, last pushed today), licensed Apache-2.0. It adds 75 tokens to every session and 639 once invoked, about $0.0004 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-08-30.