infer-completion-criteria

infer-completion-criteria is a skill for Claude Code, Codex from jmagly/aiwg. It costs 34 tokens per session (4,114 once invoked), scanned A, original, MIT.

A skill that turns an agent-loop task into a measurable pass-or-fail goal when the user has not provided one. An agent loop repeats work until its completion check succeeds.

In plain words
What is it for?
Reading project files and standards to derive a concrete shell command or file check that verifies completion.
Why use it?
It prevents the loop from stopping on a vague judgment such as “finished” or running indefinitely without a clear test.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; mentions Claude Code.

Good fit Reading project files and standards to derive a concrete shell command or file check that verifies completion.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jmagly/aiwg/infer-completion-criteria
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.

Any agent
npx skills add jmagly/aiwg --skill infer-completion-criteria
Clone the repo
git clone --depth 1 https://github.com/jmagly/aiwg

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 infer-completion-criteria

README.md
[![agentmods](https://agentmods.dev/badge/skills/jmagly/aiwg/infer-completion-criteria/github.svg)](https://agentmods.dev/skills/jmagly/aiwg/infer-completion-criteria)
Your own site
<a href="https://agentmods.dev/skills/jmagly/aiwg/infer-completion-criteria"><img src="https://agentmods.dev/badge/skills/jmagly/aiwg/infer-completion-criteria/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for infer-completion-criteria

Your own site · 80×15
<a href="https://agentmods.dev/skills/jmagly/aiwg/infer-completion-criteria"><img src="https://agentmods.dev/badge/skills/jmagly/aiwg/infer-completion-criteria.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,114 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 12 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 69
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 150
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 151
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 155
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 174
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 175
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 197
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 259
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 260
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium Agent Snooping · line 322
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
  • medium Agent Snooping · line 323
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
  • medium Agent Snooping · line 324
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
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.00034 $0.04114
Opus 5 $0.00017 $0.02057
Sonnet 5 $0.00007 $0.00823
Haiku 4.5 $0.00003 $0.00411

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

Security

Grade A, and why

infer-completion-criteria 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 11d 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.

agentic/code/addons/agent-loop/skills/infer-completion-criteria/SKILL.md · 326 lines

How it starts

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

Infer Completion Criteria

Purpose

When a user starts an agent-loop task without supplying --completion, this skill derives a measurable, verifiable completion criterion from project state. The output must satisfy the vague-discretion rule: a concrete shell command or file-inspection check that returns pass/fail unambiguously.

Iteration is only as good as its gate. A loop with a vague gate ("until it's done") runs forever or exits prematurely. This skill is what turns "agent-loop this" into "agent-loop this until <measurable thing>."

The canonical name for the iterative-loop addon is agent-loop. ralph is the legacy name for the executor skill, retained as an alias; al is a short form. The detection/routing skill is agent-loop (which delegates to this skill when criteria are missing); the executor is ralph (canonical name forthcoming). Everywhere this skill says "agent-loop" you can read "ralph" as the legacy equivalent.

When This Skill Runs

This skill is invoked by:

  • The agent-loop detection-and-routing skill when it parses a user request without explicit completion criteria
  • The ralph executor skill during Phase 1 initialization when --completion is omitted
  • The agent-loop-ext external-loop launcher during pre-launch resolution when --completion is omitted
  • Direct invocation via aiwg discover "infer completion"aiwg show skill infer-completion-criteria when a user wants to preview the inferred criterion before committing to a loop

This skill does not run when --completion is explicit. The user's word is authoritative.

Inference Pipeline

The skill is a deterministic walk through five evidence layers, plus one synthesis step. Each layer contributes candidate criteria; the synthesis picks the strongest measurable one and explains the chain of evidence.

Layer 1 — The task verb

Parse the user's task description for an intent verb. Map to a default criterion class:

Verb / phrase Criterion class
"fix tests", "make tests pass", "test failure" Test suite passes (exit 0)
"add tests", "increase coverage", "test coverage" Coverage threshold met
"fix types", "type errors", "migrate to typescript" Type checker exits 0
"fix lint", "clean up warnings", "style" Linter exits 0
"build", "make it compile" Build command exits 0
"refactor", "extract", "rename" Tests still pass AND build still passes (regression gate)
"implement ", "add feature " Tests for the new code exist and pass
"document", "add docs", "JSDoc" Coverage check on docstrings/JSDoc presence
"fix bug", "resolve issue #N" Specific test for that bug passes AND existing suite still green
"migrate", "upgrade" Build + test + lint all green (no regression)

Read the full file on GitHub · 326 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. 11d ago First seen · 326 lines · 34 tokens per session scan A 09fca185ddbd

Subscribe to this mod's changes

infer-completion-criteria is a skill published in the GitHub repository jmagly/aiwg (210 stars, last pushed today), licensed MIT. It adds 34 tokens to every session and 4,114 once invoked, about $0.0002 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.