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

@codmir/governor

v0.1.1

Published

Governor system for auditing code changes with AI reasoning, conversation history, and execution logs

Readme

@codmir/governor

Governor system for auditing code changes with full AI context.

Concept

Governor is different from a traditional PR review:

| Traditional PR | Governor Audit | |----------------|----------------| | Code changes only | Code + AI reasoning + conversation + logs | | Reviewer guesses intent | Intent is documented | | Post-hoc review | Present during development | | Manual review | AI-assisted analysis |

Governor = Present during each process (proactive) Overseer = Reviews after completion (reactive)

Features

  • Audit Changes: Analyze code changes between any two commits
  • Full Context: Include conversation history, AI reasoning, execution logs
  • AI Analysis: Claude-powered review finding security, performance, logic issues
  • Session Tracking: Monitor work as it happens, not just after
  • CLI Support: Quick audits from command line
  • Tool Integration: Register audit tools with AI agents

Installation

pnpm add @codmir/governor

Quick Start

CLI Audit

# Audit recent changes
codmir-agent audit

# Audit specific range
codmir-agent audit --from v1.0.0 --to HEAD

# Audit with context file
codmir-agent audit --context-file conversation.json

Programmatic Usage

import { createAuditService, createGovernorSession } from '@codmir/governor';

// Create audit service
const auditService = createAuditService({
  repoPath: '/path/to/repo',
  apiKey: process.env.ANTHROPIC_API_KEY,
});

// Quick audit
const audit = await auditService.quickAudit({
  from: 'HEAD~10',
  to: 'HEAD',
});

console.log('Findings:', audit.findings.length);
console.log('Recommendation:', audit.summary?.recommendation);

Governor Session (Track Work in Progress)

import { createGovernorSession, getGovernorSessionManager } from '@codmir/governor';

// Start session when agent begins work
const session = createGovernorSession({
  taskId: 'task-123',
  baseCommit: 'abc123',
});

// Track conversation
const manager = getGovernorSessionManager();
manager.addConversationTurn(session.id, 'user', 'Please fix the login bug');
manager.addConversationTurn(session.id, 'assistant', 'I will fix the authentication issue...');

// Track reasoning
manager.addReasoning(session.id, {
  target: { file: 'src/auth.ts', startLine: 42 },
  intent: 'Fix null check on user token',
  approach: 'Added optional chaining to prevent crash',
  tradeoffs: ['Slightly less strict typing'],
});

// Track execution
manager.addLog(session.id, 'file_write', 'Modified src/auth.ts');
manager.addLog(session.id, 'command', 'npm test - all tests passing');

// Get context for audit
const context = manager.getContext(session.id);

AI Agent Tools

import { AUDIT_TOOL_DEFINITIONS, createAuditToolExecutor } from '@codmir/governor';

// Register tools with Claude
const tools = AUDIT_TOOL_DEFINITIONS;

// Execute tool calls
const executor = createAuditToolExecutor(auditService, {
  agentId: 'agent-123',
  agentName: 'Code Assistant',
});

const result = await executor.execute('audit_changes', {
  from_commit: 'HEAD~5',
  to_commit: 'HEAD',
  min_severity: 'medium',
});

Audit Lifecycle

Created → Analyzing → Reviewing → Approved/Rejected → Merged
  1. Created: Audit record created with target commits
  2. Analyzing: AI is analyzing changes
  3. Reviewing: Analysis complete, awaiting human/agent review
  4. Approved/Rejected: Decision made
  5. Merged: Changes merged (optional tracking)

Finding Categories

  • security - Security vulnerabilities
  • performance - Performance issues
  • logic - Logic errors or bugs
  • style - Code style issues
  • documentation - Missing/incorrect docs
  • testing - Test coverage issues
  • architecture - Architectural concerns
  • dependency - Dependency issues
  • compatibility - Compatibility problems
  • accessibility - Accessibility issues

Finding Severities

  • critical - Must fix immediately
  • high - Should fix before merge
  • medium - Should fix soon
  • low - Nice to fix
  • info - Informational note

Events

Subscribe to governor events:

// governor.audit.created
// governor.audit.started
// governor.audit.completed
// governor.audit.failed
// governor.audit.approved
// governor.audit.rejected
// governor.audit.merged
// governor.finding.added
// governor.finding.resolved
// governor.context.updated
// governor.reasoning.added

License

MIT