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

pi-red-green

v0.2.2

Published

A Pi extension that enforces Test-Driven Development (RED-GREEN-REFACTOR) discipline during agent coding sessions.

Readme

pi-red-green

TDD enforcement for Pi coding agent sessions. Forces agents to follow the RED-GREEN-REFACTOR cycle: write failing tests first, implement minimally, then refactor.

Installation

pi install npm:pi-red-green

Usage

Start a TDD session

/tdd Add user authentication

This enters RED phase. The agent's system prompt is modified to enforce writing failing tests first.

Check status

/tdd-status

Shows current phase, task, file history, test results, and staleness.

End a TDD session

/tdd off

Phase cycle

  1. RED: Write failing tests. Agent is blocked from writing implementation.
  2. GREEN: Tests are failing as expected. Write the simplest code to pass.
  3. REFACTOR: Tests pass. Clean up without adding behavior.
  4. COMPLETE: Cycle done. Start a new task or deactivate.

Phase transitions happen automatically when test runner output is detected (vitest, jest, pytest, go test, cargo test, etc).

LLM Tools

The extension registers three tools the agent can call:

| Tool | Description | |------|-------------| | tdd_status | Returns current phase, task, file history, test results | | tdd_advance | Manually advance to next phase (escape hatch) | | tdd_reset | Reset TDD state to idle |

Configuration

Create ~/.pi/red-green/config.json to override defaults:

{
  "injection_mode": "active-only",
  "ordering_enforcement": "warn",
  "auto_advance": true,
  "coverage_threshold": 80,
  "coverage_enabled": false,
  "test_file_patterns": {
    "typescript": ["**/*.test.ts", "**/*.spec.ts"],
    "python": ["**/test_*.py", "**/*_test.py"],
    "go": ["**/*_test.go"],
    "rust": ["**/tests/**/*.rs"],
    "java": ["**/*Test.java", "**/*Spec.java"],
    "php": ["**/*Test.php"]
  },
  "test_runner_patterns": [
    "vitest", "jest", "pytest", "go test", "cargo test",
    "phpunit", "mix test", "npm test"
  ]
}

Injection modes

  • active-only (default): Only inject TDD prompts when /tdd is active
  • always: Inject TDD guidance on every turn, nudge when idle
  • nudge: Inject gentle "consider writing tests first" reminders
  • off: No injection

Ordering enforcement

  • warn (default): Warn when implementation files are edited before test files
  • strict: Instruct the agent to delete implementation and start over with tests
  • off: No enforcement

Storage

Runtime data lives under ~/.pi/red-green/:

~/.pi/red-green/
  config.json     # User config overrides
  state.json      # Current TDD state (survives session restarts)
  history.jsonl   # Completed TDD cycles

License

MIT