pn-loop

pn-loop is a skill for Cursor from perniemann/pnCore. It costs 46 tokens per session (798 once invoked), scanned A, original, MIT.

A workflow that repeats a task and its verification command until the command succeeds. Verification might be a test, build, migration check, or other clearly defined pass condition.

In plain words
What is it for?
Use it to fix CI, get tests passing, complete migrations, or build a project until the chosen check exits successfully.
Why use it?
It keeps work going through failures instead of stopping after the first unsuccessful attempt or assuming the result is correct.

Skill for Cursor

Written for Cursor: shipped in a Cursor plugin.

Part of the pn-core plugin — 133 skills, 19 commands, 9 agents, 1 MCP server shipped together

Good fit Use it to fix CI, get tests passing, complete migrations, or build a project until the chosen check exits successfully.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/perniemann/pncore/pn-loop
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 perniemann/pnCore --skill pn-loop
Clone the repo
git clone --depth 1 https://github.com/perniemann/pnCore

Made for: Cursor.

Or install pn-core, the plugin that ships this one along with the rest of its 133 skills, 19 commands, 9 agents, 1 MCP server.

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 pn-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/perniemann/pncore/pn-loop/github.svg)](https://agentmods.dev/skills/perniemann/pncore/pn-loop)
Your own site
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-loop"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-loop/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 pn-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-loop"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 798 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.
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.00046 $0.00798
Opus 5.5 $0.00018 $0.00319
Sonnet 5.5 $0.00009 $0.00160
Haiku 4.5 $0.00005 $0.00080

Measured 1mo ago against content hash 6cd288969c63, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pn-loop 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 1mo 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.

packages/pn-core-mcp/content/skills/ci/pn-loop/SKILL.md · 68 lines

How it starts

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

Loop

Overview

pn-loop runs an autonomous fix-until-pass cycle: work on the task, run verification, if it fails then fix and repeat. Completion is determined by verification command output, not by self-declared phrases. This aligns with pn-verification-before-completion: evidence before claims.

Inspired by the Ralph Wiggum technique but uses pnCore's verification-first approach: the loop ends when the verification command succeeds, not when the agent says "done."

When to use

  • Fix CI until green — Run CI/tests each turn; fix failures; repeat until pass.
  • Get tests passing — Run test command; fix failures; repeat until 0 failures.
  • Complete a migration — Run migration verification; fix issues; repeat until clean.
  • Build until success — Run build; fix errors; repeat until exit 0.
  • Any task with clear, runnable verification and a known success condition.

Not a good fit: Tasks needing human judgment, ambiguous goals, or no single verification command.

Workflow

  1. Define verification — Identify the command that proves success (e.g. npm test, npm run build, npx playwright test). State the expected output (e.g. "0 failures", "exit 0").

  2. Work — Implement or fix the task using relevant skills (pn-ci-fix, pn-tdd, pn-systematic-debugging, etc.).

  3. Verify — Run the verification command. Read full output and exit code.

  4. Decide

    • Pass: Verification output confirms success → task complete. Use pn-verification-before-completion: state the evidence, then claim done.
    • Fail: Verification shows failures → fix the issues, then go to step 3. Do not claim done.
  5. Safety limit — If a max iteration count is specified (e.g. 10), stop after that many verification attempts and report remaining issues. Do not loop indefinitely without a cap when the user expects one.

Key principles

  • Verification is the gate — The loop ends when the verification command succeeds. No shortcuts.
  • Re-run verification each turn — Fresh run, full output. No "should pass" or extrapolation.
  • Fix, then verify again — After each fix, run the verification command again before claiming anything.
  • Evidence before completion — Follow pn-verification-before-completion: run the command, read output, then state result.

Read the full file on GitHub · 68 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. 1mo ago First seen · 68 lines · 46 tokens per session scan A 6cd288969c63

Subscribe to this mod's changes

pn-loop is a skill published in the GitHub repository perniemann/pnCore (0 stars, last pushed 2d ago), licensed MIT. It adds 46 tokens to every session and 798 once invoked, about $0.0002 per session on Opus 5.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.