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

@biroai/agentdocs

v2026.513.0

Published

Schema definitions and validators for the AgentDocs format — brief.md, tasks.yaml, and composable playbooks.

Readme

@biroai/agentdocs

Schema definitions and validators for the AgentDocs format — the three-file convention (brief.md + tasks.yaml + playbooks/) that AI agents use to discover, understand, and orchestrate tools.

This package is the interface layer between:

  • Biro — the reference orchestration platform that consumes and publishes AgentDocs
  • Tool authors — anyone publishing docs for an API, CLI, SDK, or internal process
  • Agent frameworks — Claude Code, Cursor, LangChain, MCP, and any other consumer

Framework-agnostic, transport-agnostic, MIT-licensed.

What's new in 0.2.0

Three additive, fully backward-compatible changes:

  • tasks.yaml can now declare an empty actions: []. Useful for scaffolds and drafts. validateTasksDocument emits a warning (not an error) on empty catalogs.
  • New optional category field on tasks.yaml — parallel "discipline" axis (process / tool / reference / policy) alongside the existing type "surface kind" (api / cli / sdk / internal / process). Lets platforms round-trip both classifications losslessly.
  • parsePlaybookMarkdown(raw) — convenience helper that splits a playbook .md into typed frontmatter + body, validating the frontmatter against playbookMarkdownFrontmatterSchema.

Under the hood, zod-inferred schema shapes are replaced with hand-written interface types — dist/schemas/tasks.d.ts drops from ~1100 lines to ~140. See CHANGELOG.md for details.

Install

pnpm add @biroai/agentdocs
# or npm install / yarn add

Usage

Validate a tasks.yaml document

import { validateTasksDocument } from "@biroai/agentdocs";

const result = validateTasksDocument({
  tool: "stripe",
  type: "api",
  actions: [
    {
      name: "create-charge",
      method: "POST",
      path: "/v1/charges",
      solves: ["payment-processing"],
    },
  ],
});

if (!result.ok) {
  for (const err of result.errors) {
    console.error(`${err.path}: ${err.message}`);
  }
}

Validate a brief.md against a custom token budget

import { validateBriefContent } from "@biroai/agentdocs";

const result = validateBriefContent(briefMarkdown, {
  maxTokens: 1000, // custom — default is 500 per the spec
  maxBytes: 4000,
  maxLines: 40,
  estimateTokens: (s) => Math.ceil(s.length / 4),
});

console.log(result.metrics); // { byteLength, estimatedTokens, lineCount }

Validate a composable playbook DAG

import { validatePlaybookDag } from "@biroai/agentdocs";

const result = validatePlaybookDag({
  playbook: "deploy-to-production",
  inputs: { service: { type: "string", required: true } },
  steps: [
    { name: "build", run: "npm run build" },
    {
      name: "deploy",
      playbook: "deploy-service",
      inputs: {
        service: "{{ inputs.service }}",
        artifact: "{{ steps.build.outputs.artifact }}",
      },
      gate: "must_pass",
    },
  ],
});

if (!result.ok) {
  // Errors cover: duplicate step names, undeclared input refs,
  // unknown step refs, forward-reference ordering violations
  console.error(result.errors);
}

Schemas directly

Need the raw Zod schemas? Import from the schemas subpath:

import {
  tasksDocumentSchema,
  briefContentSchema,
  playbookDagSchema,
} from "@biroai/agentdocs/schemas";

// Use with zod-to-openapi, zod-to-json-schema, or anywhere else

Exports

| Export | Purpose | |---|---| | tasksDocumentSchema | Zod schema for tasks.yaml document root | | briefContentSchema / buildBriefContentSchema(budget) | Token-budgeted schema for brief.md content | | playbookDagSchema | Phase-3 composable DAG playbook | | playbookMarkdownFrontmatterSchema | Phase-1/2 markdown frontmatter | | validateTasksDocument(input) | Cross-field validator with warnings + errors | | validateBriefContent(input, budget?) | Validator with byte/token/line metrics | | validatePlaybookDag(input) | DAG validator with reference-integrity checks | | parsePlaybookMarkdown(raw) | Split a playbook .md into { frontmatter?, body, errors } (new in 0.2.0) |

Full type exports for every schema via TypeScript inference (TasksDocument, Action, Param, PlaybookDag, PlaybookStep, etc.).

Spec principles

  1. Static files, not an API — zero latency, works offline, no vendor lock-in
  2. Convention over configuration — agents find docs by looking in .agentdocs/
  3. Hierarchical retrieval — brief in prompt, catalog on demand, playbook when needed
  4. Format over platform — this package is the product; platforms are implementations
  5. Build-vs-reusesolves + alternatives fields make existing tools discoverable
  6. Domain-agnostic — format works for code, legal, finance, ops — any domain where agents need to discover and use tools

Evolution path

This package currently ships schemas for:

  • Phase 1 — flat markdown playbooks (shipping today)
  • Phase 2 — markdown with YAML frontmatter for typed inputs/outputs
  • Phase 3 — composable YAML DAG playbooks with gates, conditionals, error handlers, cross-playbook composition

Phase 4 (marketplace) and Phase 5 (execution-trace-driven evolution) are properties of implementations consuming the spec, not of the spec itself.

License

MIT. Fork freely; the spec wins when many implementations compete on quality of the consumer experience.