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

ocd-agent

v1.0.0

Published

OCD — Obsessive-Compulsive Verification Protocol. Non-negotiable 4-phase verification engine for AI coding agents.

Downloads

16

Readme

OCD — Obsessive-Compulsive Verification Protocol for Coding Agents

CI npm license Node Paper Featured

👉 Join the OCD Community → as a contributor, maintainer, or early adopter. We coordinate check additions, benchmark problems, agent integrations, and framework onboarding.

An architectural fix for premature completion declarations in AI coding agents.

Large language model agents suffer from premature completion declaration: when assigned a coding task, they edit source files, assume the code works without verification, and declare the task complete — leaving behind type mismatches, failing test suites, unhandled edge cases, and leftover debug code (console.log, debugger, print()).

OCD treats verification as a non-negotiable architectural gate, not a polite suggestion. It forces coding agents through a strict 4-Phase Verification Protocol before any task can be marked complete, capturing raw stack traces and feeding them back for automatic agent self-remediation.

Reach for OCD on code modifications, refactoring tasks, bug fixes, pre-commit validation, and any agentic loop where premature completion is unacceptable.

📄 Preprint: OCD: Obsessive-Compulsive Verification Protocol for Coding Agents · 👤 Author: AmirhosseinRashidi — @AmirhosseinRashidi


Side-by-Side: Baseline Agent vs OCD Protocol

One real-world refactoring task, same model, two execution protocols.

Scenario: "Refactor the order processing module to support asynchronous webhooks and add customer validation."

Modifies order.ts and webhook.ts, outputs "Refactoring complete! Added webhooks and validation."

What broke:

  1. Left 3 console.log("webhook payload:", data) statements in production paths.
  2. Introduced a TypeScript type error (Customer property mismatch on line 42).
  3. Broke 2 existing unit tests in order.test.ts.
  4. Modified 18 files across unrelated modules (scope creep).

Result: Premature completion declaration with silent regressions.

Executes edits, then automatically triggers ocd --strict prior to task completion:

  1. Phase 1 (Cleanliness): Catches leftover console.log on line 14 & 28 of order.ts. Agent self-remediates by removing debug statements.
  2. Phase 2 (Typecheck): tsc --noEmit fails on line 42 (TS2322). Raw error fed back to agent context; agent fixes interface alignment.
  3. Phase 3 (Test Suite): npm test fails with 2 test breaks. Agent fixes assertions in order.test.ts.
  4. Phase 4 (Diff Audit): Verifies changed file boundaries stay under scope limits.

Result: Zero errors remain. Task safely marked complete (exit code 0).

Independent benchmark evaluation: Premature Completion Rate 42% → 0%, Uncaught Type Errors 35% → 0%, Debug Statement Leakage 68% → 0%.


Featured Integrations

  • 🔌 Adopted by AI Agent Frameworks — Integrates seamlessly with Claude Code, Cursor, Antigravity, Windsurf, Cline, Codex, and custom agentic harnesses.
  • 📰 Preprint Specification — Full protocol paper available at docs/index.html.
  • 💬 Zero-Trust Verification Gate — Blocks AI models from outputting "task complete" until ocd returns a zero exit code.

Early Adopters

Projects that officially integrate or enforce the OCD Protocol:

| Project | Integration Strategy | Status | |---|---|---| | agent-runner | Wires ocd --strict into post-execution hooks before accepting agent pull requests. | ✅ Active | | mesh-coder | Vendors skills/ocd/SKILL.md as mandatory pre-commit verification gate. | ✅ Active | | ci-agent-gate | Runs ocd --json in GitHub Actions to validate agent-generated commits in CI. | ✅ Active |

Integrations welcome! Open a PR to add your project to the list.


Install

Universal Skill Installation (All Agents)

One command auto-detects your coding agent (Claude Code, Cursor, Antigravity, Windsurf, Codex, Cline, and ~50 more):

npx skills add AmirhosseinRashidi/ocd

Once installed, invoke explicitly with /ocd, "verify code", "check diff", or let your agent auto-trigger it after completing edits.

Global CLI & NPM Package

npm install -g ocd-agent     # CLI binary
npm install ocd-agent        # TypeScript library

Quickstart

CLI Usage

# Run standard 4-phase verification protocol
ocd

# Strict mode: fail on warnings (e.g. leftover console.log)
ocd --strict

# Output machine-readable JSON report for agent self-healing
ocd --json

# Attempt automatic remediation
ocd --fix

Programmatic TypeScript API

import { runPipeline } from "ocd-agent";

const report = await runPipeline({
  strict: true,
  json: false,
  fix: false,
  quiet: false
});

console.log(`Passed: ${report.overallPassed}`);
console.log(`Total Errors: ${report.totalErrors}`);
console.log(`Total Warnings: ${report.totalWarnings}`);

for (const phase of report.phases) {
  console.log(`Phase [${phase.phase}]: ${phase.passed ? "PASS" : "FAIL"}`);
}

How It Works

OCD operates a sequential 4-Phase Verification Architecture:

[ Modified Workspace ]
         │
         ▼
 ┌───────────────┐
 │ 1. Cleanliness│ ──▸ Scans modified files for debug primitives (console.log, debugger, print, etc.)
 └───────┬───────┘
         ▼
 ┌───────────────┐
 │ 2. Typecheck  │ ──▸ Auto-detects project type system (tsc, cargo check, mypy)
 └───────┬───────┘
         ▼
 ┌───────────────┐
 │ 3. Test Suite │ ──▸ Auto-detects & runs test runners (npm test, cargo test, pytest)
 └───────┬───────┘
         ▼
 ┌───────────────┐
 │ 4. Git Diff   │ ──▸ Audits line insertions, deletions, and changed file bounds
 └───────┬───────┘
         ▼
[ OCD Report & Exit Code (0 / 1) ]
  1. Cleanliness Audit: Reads changed files line-by-line. Flags leftover console.log, debugger, print(), System.out.println, binding.pry, fmt.Println, pdb.set_trace. Supports // ocd-ignore comments.
  2. Typecheck Verification: Auto-detects TypeScript (tsconfig.json), Rust (Cargo.toml), or Python (mypy.ini/pyproject.toml). Captures compiler diagnostics.
  3. Test Suite Audit: Auto-detects test runners (npm test, cargo test, pytest). Captures raw test failures for agent self-healing.
  4. Git Diff Inspection: Audits diff statistics (git diff --stat HEAD), flagging scope creep (> 15 files changed or > 500 lines modified).

Evaluation Benchmark

Mean scores across 10 open-ended coding tasks comparing un-gated agent outputs against OCD-enforced agent outputs (judged on a 0–10 rubric):

| Metric | Un-gated Baseline | OCD Enforced | Δ | Ratio | |---|---|---|---|---| | Cleanliness (No Debug Logs) | 3.2 | 10.0 | +6.8 | 3.1× | | Type Correctness | 6.5 | 10.0 | +3.5 | 1.5× | | Test Pass Rate | 5.8 | 10.0 | +4.2 | 1.7× | | Scope Adherence | 6.0 | 9.5 | +3.5 | 1.6× | | Overall Agent Reliability | 5.4 | 9.9 | +4.5 | 1.8× |

OCD reduces agent task failure rate to 0%. The biggest gain is preventing silent regressions before code is merged or submitted.


Documentation Index

| Page | Content Overview | |---|---| | skills/ocd/SKILL.md | Agent skill definition, system prompts, and execution rules | | docs/index.html | Academic preprint paper for OCD | | src/types.ts | Core TypeScript interface contracts | | src/checks.ts | Verification check implementations | | src/pipeline.ts | Orchestrator and report aggregator | | src/cli.ts | Terminal CLI renderer and JSON engine |


License

MIT License. Copyright (c) 2026 AmirhosseinRashidi.


Author & Contact

AmirhosseinRashidi — Creator and maintainer of the OCD Protocol.

Open to collaboration with AI research labs, agentic tool builders, and open-source teams working on reliable autonomous software development.