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

@reynsu/reactlens-diagnosis-prompts

v0.2.0

Published

Canonical diagnosis prompts + Zod Diagnosis schema + pure eval-metrics for the reactlens / nativelens AI failure-diagnosis loop. Pure helpers only — no LLM SDK dep.

Readme

@reynsu/reactlens-diagnosis-prompts

Diagnosis prompts + Diagnosis Zod schema + pure eval-metrics helpers for the reactlens / nativelens AI failure-diagnosis loop.

Published under @reynsu/ because the @reactlens npm scope is unclaimed. Inside the reactlens monorepo this package is still referenced via local imports; a follow-up swap PR will switch reactlens to consume the published version (mirroring the @reynsu/nativelens-event-protocol migration).

What's in the box

  • DIAGNOSE_SYSTEM_PROMPT — the system message that primes the agent on its job, the schema, and the confidence calibration.
  • CLASSIFY_BUG_RUBRIC — the long-form classification rubric (real-bug / test-bug / flaky / env-issue), including the test-bug vs flaky disambiguation that traps overconfident classifiers.
  • DiagnosisSchema + Diagnosis type — the canonical structured output. Schema-first; consumers parse agent output with DiagnosisSchema.safeParse(...).
  • buildUserMessage(failure) — pure user-message builder (title, spec, error fence, component snapshot, truncation). Golden-testable.
  • degradedDiagnosis(gitCtx?) — fallback when the agent exhausts retries. Deliberately emits env-issue / low so the operator notices.
  • TruthSchema, parseTruth, compareToTruth, aggregateMetrics — pure scoring helpers for the eval harness. falseConfidenceRate is surfaced explicitly as the primary regression signal.

What's NOT in the box (kept per-host)

  • Agent runner implementations (Anthropic SDK, OpenAI, etc.) — consumers provide their own.
  • Sandboxing logic for the eval pipeline (loading component.tsx / spec.ts from disk).
  • Git context gathering (host-specific paths + tooling).
  • The eval cases themselves (reactlens ships its under tests/diagnostic-eval/cases/; nativelens will ship its own).

Usage

import {
  DIAGNOSE_SYSTEM_PROMPT,
  CLASSIFY_BUG_RUBRIC,
  DiagnosisSchema,
  buildUserMessage,
  degradedDiagnosis,
  type FailedTest,
  type Diagnosis,
} from '@reynsu/reactlens-diagnosis-prompts';

const failure: FailedTest = {
  testId: 'cart-flow:tap-add',
  testTitle: 'cart shows declined banner',
  specFile: '/abs/path/cart.spec.ts',
  errorMessage: 'Timed out waiting for [data-testid="declined-banner"]',
  componentSnapshot: { /* host-shaped tree */ },
};

const userMessage = buildUserMessage(failure);
// Feed [DIAGNOSE_SYSTEM_PROMPT, CLASSIFY_BUG_RUBRIC] as system messages and
// `userMessage` as the user turn to whichever LLM-runner your host wires up.
// Parse the agent's final message with DiagnosisSchema.

Versioning

Pre-1.0: minor bumps may include breaking schema changes; pin to the exact minor in dependents. The prompts themselves change without bumps (they're tuned against the eval set); only Diagnosis schema changes are semver-meaningful.

Development

pnpm install
pnpm test
pnpm typecheck
pnpm build