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

@workspacejson/spec

v0.4.1

Published

JSON Schema and TypeScript types for workspace.json

Readme

@workspacejson/spec

JSON Schema and TypeScript types for workspace.json v0.4.

This package is published from the agents-audit workspace and is the canonical specification package for the workspace metadata format.

Install

pnpm add @workspacejson/spec

API

Validation

import { validate, validateV4, validateLegacy, version } from '@workspacejson/spec';

console.log(version); // '0.4.1'

validate(doc);        // true if doc is a valid v0.3 or v0.4 document
validateV4(doc);      // true if doc is a valid v0.4 document (requires coChange + fragility arrays)
validateLegacy(doc);  // true if doc is a valid v0.1/v0.2 document

Schema object

import { workspaceJsonSchema } from '@workspacejson/spec';

// workspaceJsonSchema.$id === 'https://www.workspacejson.dev/schema/v1.json'
// workspaceJsonSchema.title === 'workspace.json'

TypeScript types

import type {
  WorkspaceJsonV3,
  WorkspaceJsonV4,
  CoChangeEntry,
  FragilityEntry,
  FrameworkEntry,
  FileIndexEntry,
  IntelligenceState,
} from '@workspacejson/spec';

WorkspaceJsonV3 describes the v0.3 four-property shape:

const doc: WorkspaceJsonV3 = {
  manual: {},
  generated: {
    specVersion: '0.3',
    generatedAt: new Date().toISOString(),
    by: { name: 'my-tool', version: '1.0.0' },
    frameworkManifest: [],
    fileIndex: {},
  },
  agents: {},
  health: { intelligenceState: 'INSUFFICIENT_DATA', observationCount: 0, confidence: 0 },
};

WorkspaceJsonV4 extends v0.3 with formally typed co-change and fragility arrays:

const doc: WorkspaceJsonV4 = {
  manual: {},
  generated: {
    specVersion: '0.4',
    generatedAt: new Date().toISOString(),
    by: { name: 'my-tool', version: '1.0.0' },
    frameworkManifest: [],
    fileIndex: {},
    coChange: [
      { files: ['src/auth.ts', 'src/session.ts'], rate: 0.9, occurrences: 12, generated: false },
      { files: ['pnpm-lock.yaml', 'package.json'], rate: 0.98, occurrences: 200, generated: true },
    ],
    fragility: [
      { file: 'src/auth.ts', changeCount: 34, revertCount: 8, revertRate: 0.24, fragilityScore: 0.82, excluded: false },
    ],
  },
  agents: {},
  health: {
    intelligenceState: 'CONFIDENT',
    observationCount: 1247,
    confidence: 0.87,
    workflowFragility: 0.5,
    codebaseHealth: 0.7,
    changeVolatility: 0.4,
  },
};

Consumer guidance for coChange: filter on generated: true to skip tooling-coupled pairs (lockfiles, package manifests) and surface only real source couplings.

Consumer guidance for fragility: filter excluded: false before ranking. Entries with excluded: true are generated or lock files with fragilityScore: 0.

JSON Schema file

The raw JSON Schema is available via the ./schema export:

import schema from '@workspacejson/spec/schema';
// or: import the file directly at packages/spec/schema/v1.json

Served at: https://www.workspacejson.dev/schema/v1.json

Contents

  • schema/v1.json — published JSON Schema (draft-2020-12)
  • src/schema.ts — TypeScript const mirroring the schema
  • src/types.ts — TypeScript types for v0.3, v0.4, and legacy v0.1/v0.2
  • src/index.tsvalidate(), validateV4(), validateLegacy(), version, type re-exports

Migration from v0.3 to v0.4

v0.4 adds two always-present arrays to generated and formally types three health fields. v0.3 documents remain valid — v0.4 is a strict superset.

{
  "generated": {
    "specVersion": "0.4",
    "coChange": [],
    "fragility": []
  },
  "health": {
    "workflowFragility": 0.5,
    "codebaseHealth": 0.7,
    "changeVolatility": 0.4
  }
}

Check generated.specVersion === "0.4" or use validateV4(doc) before accessing these fields.

Migration from v0.1/v0.2

v0.3 replaces the flat top-level shape with four required sections:

{
  "manual": {},
  "generated": {
    "specVersion": "0.3",
    "generatedAt": "...",
    "by": { "name": "...", "version": "..." }
  },
  "agents": {},
  "health": {}
}

Use validateLegacy(doc) to detect v0.1/v0.2 documents; use validate(doc) for v0.3/v0.4.