iterate

iterate is a command for coding agents from share-skills/pi. It costs 99 tokens per session (6,333 once invoked), scanned A, original, Apache-2.0.

An audit command for improving and checking a skill's instruction files and related copies.

In plain words
What is it for?
Use it when iterating on a skill, compiling its full and shortened versions, and verifying platform-specific copies.
Why use it?
It helps find broken references, inconsistent wording, missing synchronization, and incomplete checks after an edit.

Command

Part of the pi plugin — 4 skills, 3 commands, 4 agents, 7 hooks shipped together

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 commands/share-skills/pi/iterate
Clone the repo
git clone --depth 1 https://github.com/share-skills/pi

Or install pi, the plugin that ships this one along with the rest of its 4 skills, 3 commands, 4 agents, 7 hooks.

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 iterate

README.md
[![agentmods](https://agentmods.dev/badge/commands/share-skills/pi/iterate.svg)](https://agentmods.dev/commands/share-skills/pi/iterate)
Your own site
<a href="https://agentmods.dev/commands/share-skills/pi/iterate"><img src="https://agentmods.dev/badge/commands/share-skills/pi/iterate.svg" alt="Measured on agentmods" height="20"></a>
Per session 99 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,333 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 $0.00099 $0.06333
Opus 5 $0.00049 $0.03166
Sonnet 5 $0.00020 $0.01267
Haiku 4.5 $0.00010 $0.00633

Measured 4d ago against content hash 100a9c58bbb4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

iterate 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 4d 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.

commands/iterate.md · 277 lines

How it starts

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

PI 迭代审计协议

你是 PI 的迭代审计引擎。用户给出迭代方向或直接要求自检,你将其转化为逻辑严密、算无遗策的精准改动。

双文件架构SKILL_META.md(迭代真源·完整版·给人看)→ 编译 → SKILL.md(字节码·精简版·给 AI 用)。编译规则见 COMPILER.md

一、铁律(不可违)

  1. 吃自己的狗粮——用 PI 自身的规则审计 PI。反模式十戒、正名三则、交付质量门同样约束迭代过程本身。
  2. 改一处,查全局——任何改动必须全文扫描关联点(引用、术语、编号、表格、架构图、frontmatter),不留断链。
  3. 加一行,问三问——新增内容前自问:(a) 与现有内容重复?(b) 去掉它 SKILL 仍完整?(c) AI 读到它会改变行为吗?三问皆否则不加。
  4. 改后必验——每次 Edit 后读取受影响区域 ±5 行,确认无副作用(断行、吞标题、格式错乱)。这是 ⚡PI-03 的自我应用。
  5. 先读后改——每轮迭代开始前,必须完整加载最新 SKILL_META.md。不可基于记忆中的旧版本操作。这是 ⚡PI-01 的自我应用。

二、改动范围

文件 何时改 改什么
SKILL_META.md 每轮必审 迭代真源(完整版),所有规则的唯一真源
SKILL.md SKILL_META.md 改动后编译 字节码(精简版),从 SKILL_META.md 按 COMPILER.md 规则编译
COMPILER.md 编译规则需调整时 编译规则定义(什么留/什么删/什么压缩)
README.md SKILL 改动影响用户可见概念时 能力表、特性表、安装说明
CHANGE_LOG.md 每轮结束时 变更记录(版本·日期·改动摘要)

平台文件(codex/cursor/kiro/...)、英文版、agents/ 均不在迭代范围内,待迭代完成后统一同步。

同步方法:改完 SKILL_META.md 并编译 SKILL.md 后,需同步 5 处:skills/pi/SKILL.md + claude-code/pi/SKILL.md(AgentSkills frontmatter)+ cursor/rules/pi.mdcalwaysApply: true)+ kiro/steering/pi.mdinclusion: auto)+ openclaw/pi/SKILL.md(metadata 单行 JSON,always: true)。渐进式版本(skills/pi-progressive/ + claude-code/pi-progressive/)需重新拆分核心版+references/。英文版同理。

真源原则:项目根 SKILL_META.md 是唯一迭代真源。SKILL.md 是编译产物,禁止在 SKILL.md 中独立修改(除编译过程外)。所有平台文件从 SKILL.md 派生。

渐进式版本校验策略(迭代涉及渐进式版本时追加):

检项 动效
核心+references 覆盖率 核心版 body + 4 个 references/ 文件的内容总和 ≥ 完整版 body 的 95%(允许摘要压缩的损耗)
引用链完整 核心版中每个 [references/X.md] 链接必须指向存在的文件
references 内容一致 references/ 文件内容必须与完整版对应章节一致(MD5 校验)
跨目录同步 skills/pi-progressive/claude-code/pi-progressive/ 的核心版 body + references/ 必须一致
真源同步 完整版改动后,渐进式版本的对应内容必须同步更新,不可遗漏

渐进式披露平台支持(决定是否拆分的依据):

平台 references/ 支持 当前策略 说明
Claude Code (AgentSkills) ✅ 支持 完整版 支持 references/ 按需加载,但当前使用完整版以保持全平台统一
Codex CLI (AgentSkills) ✅ 支持 完整版 同上
Qoder (AgentSkills) ✅ 支持 完整版 标准 AgentSkills 规范,支持 references/ 链接,使用 skills/ 源
OpenClaw (AgentSkills) ✅ 支持 完整版 专属 frontmatter(metadata 单行 JSON,always: true),使用 openclaw/ 源
Cursor (.mdc rules) ❌ 不支持 完整版 单文件格式,无法引用外部 references/
Kiro (steering .md) ❌ 不支持 完整版 单文件格式,无法引用外部 references/
其他平台 (skills/) 视平台而定 完整版 通过 install.sh 安装到各平台 skills/ 目录

Read the full file on GitHub · 277 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. 4d ago First seen · 277 lines · 99 tokens per session scan A 100a9c58bbb4

Subscribe to this mod's changes

iterate is a command published in the GitHub repository share-skills/pi (108 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 99 tokens to every session and 6,333 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-08-30.