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

@matsumiko/runbook

v0.33.1

Published

Operational instruction kit for AI coding agents.

Readme

Operational instruction kit for AI coding agents

npm License GitHub

Codex Claude Cursor Copilot Node

Audit first. Implement carefully. Verify honestly.


RunBook helps AI coding agents work with structured project memory, context routing, session recovery, and verification discipline.

It gives a repository:

  • AGENTS.md as the agent operating entry point
  • CONTEXT.md as a routing map so agents read the right files for the task
  • PROJECT.md as durable project memory for commands, architecture, paths, environment, tests, and gotchas
  • SESSION.md plus .runbook/sessions/ for resumable work
  • frontend and backend guardrails
  • native adapters for opencode, Claude, Cursor, Copilot, Gemini, Windsurf, Cline, and Aider

The focus is the core workflow: project memory, context routing, recovery, adapters, and honest verification.

Quick Start

Install the CLI globally first:

npm i -g @matsumiko/runbook
runbook --version

Then initialize RunBook in a project:

cd my-project
runbook init

Pick a profile:

runbook init --profile minimal
runbook init --profile frontend
runbook init --profile backend
runbook init --profile full

Add adapter files:

runbook init --agent claude
runbook init --agent opencode
runbook init --agent cursor,copilot
runbook init --agent all

Preview before writing:

runbook init --dry-run
runbook upgrade --dry-run

Upgrade an existing RunBook install safely:

runbook upgrade
runbook doctor
runbook doctor --strict
runbook doctor --strict-live
runbook doctor --json
runbook finish

One-shot usage is still supported when you do not want a global install:

npx @matsumiko/runbook init

Install Options

| Use case | Command | Run command | | --- | --- | --- | | Recommended CLI | npm i -g @matsumiko/runbook | runbook ... | | One-shot usage | no install needed | npx @matsumiko/runbook ... | | Project-local dependency | npm i -D @matsumiko/runbook | npx runbook ... or an npm script |

Profiles

Default runbook init uses --profile full.

| Profile | Installs | Best for | | --- | --- | --- | | minimal | AGENTS.md, CONTEXT.md, PROJECT.md | Small repos that only need operating rules and project memory. | | frontend | Minimal + FRONTEND.md | UI, visual consistency, interaction, and design-system work. | | backend | Minimal + SECURITY.md | API, auth, data, billing, uploads, webhooks, or migrations. | | full | All RunBook files | Teams that want decisions, bug history, module maps, planning, sessions, backlog, changelog, guardrails, and adapters. |

Core Workflow

  1. Run runbook init in the project root.
  2. Fill PROJECT.md with real commands, architecture, important paths, environment notes, tests, and gotchas.
  3. Have the agent read AGENTS.md.
  4. Have the agent read CONTEXT.md and choose task-specific files.
  5. Before repository-changing work, create a runtime session with runbook session new.
  6. During work, update the session with step, touch, and verify.
  7. Before closing, review durable memory and update the files that gained reusable facts.
  8. Close the session, then run the final RunBook proof gates.
  9. Record meaningful finished work in CHANGELOG.md.

Durable Memory

RunBook separates active task progress from long-term project memory.

| File | Purpose | | --- | --- | | PROJECT.md | Commands, architecture, important paths, environment notes, tests, gotchas, and do-not-touch areas. | | MODULE-MAP.md | Module responsibilities, first files to inspect, related rules, common tasks, and module-specific pitfalls. | | DECISIONS.md | Accepted product, business, architecture, security, data, or UX decisions future agents must not undo accidentally. | | BUG-HISTORY.md | Fixed bugs, causes, fixes, changed files, and regression checks. | | FRONTEND.md | Actual frontend design and interaction decisions. | | SECURITY.md | Security-sensitive rules, auth/authorization constraints, secrets, abuse protection, and sensitive data behavior. |

Before closing repository-changing work, agents must review durable memory:

  • update the relevant memory file when the task created or verified reusable facts
  • preserve the file's structure and add concrete entries under the right section
  • checkpoint every memory update with runbook session touch <file>
  • state in the final report when a relevant memory file was reviewed but did not need changes

Active progress still belongs in .runbook/sessions/*.json, not in durable memory files.

Context Routing

RunBook uses CONTEXT.md so agents do not need to load every file by default.

runbook context list
runbook context frontend
runbook context backend
runbook context architecture
runbook context bugfix
runbook context module-work
runbook context security-audit
runbook context resume
runbook context planning
runbook context inspect

Read more: docs/context-routing.md

Session Recovery

For non-trivial work, RunBook can create project-local runtime sessions:

runbook session pending
runbook session new
runbook session resume
runbook session note "Found failing auth test"
runbook session step "Fix token refresh handling"
runbook session touch src/auth.ts
runbook session verify "npm test passed"
runbook session latest
runbook session show
runbook session close --status completed
runbook session validate

Agents should check session pending before repository-changing task work. If a recoverable session exists, they should wait for the user to type exactly I will fight before resuming.

When the CLI is available, agents must use session CLI commands instead of hand-writing session JSON. Hand-written sessions are only a fallback if both runbook and npx @matsumiko/runbook fail after a real attempt.

Completed/cancelled runtime sessions are kept to the newest 5 by default; recoverable sessions are not auto-deleted.

Finish Gates

Before an agent claims repository-changing work is complete, these commands should pass after the runtime session is closed:

runbook session pending
runbook session validate
runbook doctor --strict-live
runbook finish

doctor --strict-live checks RunBook health plus runtime session validity and confirms no recoverable session remains. finish is the final completion gate over doctor, session validation, pending sessions, and placeholder memory files.

Read more: docs/session-recovery.md

Example: Fixing A Bug With RunBook

  1. runbook init --agent codex
  2. Fill PROJECT.md with project commands and gotchas.
  3. Agent reads AGENTS.md, then CONTEXT.md.
  4. For a frontend bug, agent uses runbook context frontend and reads FRONTEND.md.
  5. For a backend or auth bug, agent uses runbook context backend and reads SECURITY.md.
  6. For a regression, agent uses runbook context bugfix and reads BUG-HISTORY.md.
  7. For module-specific work, agent uses runbook context module-work and reads MODULE-MAP.md.
  8. Agent updates BUG-HISTORY.md after the bug is fixed and verified.
  9. Agent updates MODULE-MAP.md if module ownership, entrypoints, or first files changed.
  10. Agent verifies the fix, closes the session, and runs the finish gates.

Docs

Repository Layout

.
|-- bin/
|   `-- runbook.js
|-- docs/
|-- templates/
|-- variants/
|-- AGENTS.md
|-- CONTEXT.md
|-- PROJECT.md
|-- MODULE-MAP.md
|-- DECISIONS.md
|-- BUG-HISTORY.md
|-- SESSION.md
|-- FRONTEND.md
|-- SECURITY.md
|-- POLICIES.md
`-- package.json

Contributing

Issues and pull requests are welcome.

Changes to the instruction system should be concrete, defensible, and helpful for safer, more consistent, or easier-to-audit agent work.

License

MIT. See LICENSE.