npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

loop-library

v0.1.1

Published

npm CLI for AI agents to recommend published loops from the Loop Library — fast JSON shortlist, offline catalog, zero dependencies.

Readme

Loop Library

npm version GitHub

Loop Library is a collection of reusable, bounded AI agent workflows. Each loop tells an agent what to do, how to check its work, what to try next, and when to stop.

You can use Loop Library in three ways:

  • npm CLInpx loop-library for fast, JSON-first loop recommendations from the terminal (ideal for AI agents with shell access)
  • Agent skill — installable guidance for finding, adapting, and designing loops in chat
  • Web catalog — browse, copy, and contribute published loops

Tell an agent what you want to get done and it can shortlist a published loop, adapt one to your situation, or help you design a new one through a short conversation.

Browse the Loop Library · npm package · GitHub repository

Benefits of the npm CLI

The loop-library package gives agents and developers a small, install-free way to match user goals to published loops:

  • Fast shortlistrecommend narrows 31+ published loops to the top 3 candidates in one command, without loading the full catalog into context
  • Structured JSON output — machine-readable results (slug, useWhen, prompt, matchedFields, scores) that agents can parse and act on
  • Works offline — bundles the catalog; add --online when you need the latest published loops from the live site
  • Deterministic first pass — field-weighted scoring on outcomes, keywords, and verification text complements LLM judgment instead of replacing it
  • Zero dependencies — Node 20+ only; safe to run via npx in CI, sandboxes, and agent shells
  • Adapt and inspectshow returns full loop details; adapt extracts wizard fields for customizing a published loop to your stack
  • Pairs with the skill — use the CLI to shortlist, then apply the Loop Library skill for verification fit, authority, and stopping-condition judgment
npx loop-library recommend "keep documentation current" --json

What is a loop?

Most prompts ask an agent to do something once. A loop gives the agent a way to learn from the result and take the next useful step.

For example, a one-shot prompt might say:

Make this website faster.

A loop adds the feedback that makes the work repeatable:

Find the slowest page, make one focused improvement, and measure it again. Keep the change only if it helps. Repeat until every page meets the target or another pass stops producing a meaningful improvement.

Think of a loop as a playbook with feedback built in. It is useful when the first attempt probably will not be the final answer, such as fixing production errors, improving test coverage, reviewing a product, or keeping documentation current.

A good loop answers four simple questions:

  • What is the agent trying to accomplish?
  • How will it know whether the latest attempt worked?
  • What should it do with what it learned?
  • When should it finish or ask for help?

Why loops are powerful

AI agents can move quickly, but an open-ended instruction like "keep improving this" leaves too much room for guessing. A loop gives the work a clear finish line and a consistent way to judge progress.

That makes the work easier to trust and easier to repeat. The agent can compare results instead of relying on confidence, keep improvements instead of merely making changes, and stop when it succeeds or stops making progress. The same loop can also be reused by another person or agent without rebuilding the workflow from scratch.

Loops are not permission for an agent to run forever. The best ones are deliberately bounded. They include a real check, a clear stopping point, and a moment to hand control back to a person when judgment or approval is needed.

What the Loop Library skill does

The Loop Library skill gives your agent direct access to the ideas in the library. You can use it to:

  • Find a published loop that fits what you are trying to get done.
  • Adapt a useful loop to your tools, limits, and definition of success.
  • Design a new loop through a short, plain-language conversation.
  • Turn the result into a compact prompt you can use right away.

The skill checks the live catalog when it recommends a published loop. It does not quietly start schedules, change production, or send messages on your behalf. Those actions still require the normal permissions and approvals.

Install the skill

The agent skill lives in this GitHub repository. Run this command in your terminal:

npx skills add khoantd/loop-library --skill loop-library -g

Or, if you use the Forward Future upstream:

npx skills add Forward-Future/loop-library --skill loop-library -g

The -g flag makes the skill available across your projects.

Once it is installed, try asking your agent:

Use $loop-library to find a loop for keeping our documentation current.

Or start with an outcome and let the skill help shape it:

Use $loop-library to help me design a loop that turns customer feedback into verified fixes.

You do not need to know the right loop vocabulary before you begin. Describe what you want to get done, and the skill will ask only for the decisions it needs.

CLI for agents

Published on npm as loop-library. Agents with shell access can shortlist published loops without loading the full catalog into context:

npx loop-library recommend "turn customer feedback into verified fixes" --json

Other commands:

npx loop-library search documentation --json
npx loop-library show overnight-docs-sweep --json
npx loop-library list --category engineering --json
npx loop-library adapt overnight-docs-sweep --json

Add --online to fetch the live catalog (with bundled fallback). Add --text for human-readable output instead of JSON.

The CLI complements the skill above: use recommend for a fast shortlist, then apply the skill's judgment on verification fit, authority, and stopping conditions before recommending a loop to the user.

Explore or contribute

Visit the Loop Library to browse published loops, copy one into your own workflow, or submit a loop that has worked well for you.

Loop Library is a Forward Future project and is available under the MIT License.

Preview locally

python3 -m http.server 4173 --directory site

Then open http://localhost:4173.

Validate a change

npm ci --prefix worker
node scripts/build-skill-catalog.mjs
node scripts/sync-cli-lib.mjs
cp site/catalog.json data/catalog.json
node scripts/build-loop-pages.mjs
node scripts/build-social-images.mjs
node --check scripts/audit-seo-geo.mjs
node --check scripts/build-social-images.mjs
node --check site/script.js
node --check scripts/build-loop-pages.mjs
node --check scripts/loop-data.mjs
node scripts/audit-seo-geo.mjs
npm run check
npm --prefix worker run check
python3 -m json.tool site/.herenow/data.json >/dev/null
python3 -m json.tool scripts/seo-geo-query-benchmark.json >/dev/null
git diff --check

Publish the CLI package

npm run check
npm pack
npm publish --access public

Read AGENTS.md before editing loops or publishing the site. It contains the source-of-truth rules for generated files, form security, and clean-main deployments.