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

@directive-run/knowledge

v0.8.4

Published

Knowledge files, examples, and validation for Directive — the constraint-driven TypeScript runtime.

Readme

@directive-run/knowledge

Knowledge files, examples, and validation scripts for the Directive runtime.

This package is the source of truth for all Directive coding knowledge used by:

  • @directive-run/cli – generates AI rules files (.cursorrules, CLAUDE.md, etc.)
  • @directive-run/claude-plugin – builds Claude Code plugin skills
  • directive.run/llms.txt – website LLM reference

Contents

| Directory | Count | Description | |-----------|-------|-------------| | core/ | 13 | Core Directive knowledge (modules, constraints, resolvers, etc.) | | ai/ | 12 | AI orchestrator knowledge (agents, streaming, guardrails, etc.) | | examples/ | 32 | Extracted examples (auto-generated, DOM wiring stripped) | | api-skeleton.md | 1 | Auto-generated API reference skeleton |

Programmatic API

import {
  getKnowledge,
  getAllKnowledge,
  getExample,
  getAllExamples,
  getKnowledgeFiles,
  getExampleFiles,
  clearCache,
} from "@directive-run/knowledge";

// Get a single knowledge file
const patterns = getKnowledge("core-patterns");

// Get multiple files joined with --- separator
const combined = getKnowledgeFiles(["constraints", "resolvers"]);

// Get all examples as a Map<name, content>
const examples = getAllExamples();

// Clear cached knowledge and examples (useful for dev/watch mode)
clearCache();

Scripts

pnpm --filter @directive-run/knowledge generate          # Regenerate api-skeleton.md
pnpm --filter @directive-run/knowledge extract-examples  # Re-extract examples
pnpm --filter @directive-run/knowledge validate          # Validate symbol references
pnpm --filter @directive-run/knowledge test              # Run all tests
pnpm --filter @directive-run/knowledge build             # Full build (generate + extract + tsup)

Adding Examples

Examples are auto-discovered from examples/*/ in the repo root. The extract-examples.ts script:

  1. Scans all example directories
  2. Finds the best source file (prefers <name>.ts > module.ts > main.ts)
  3. Strips DOM wiring code
  4. Outputs clean TypeScript

To exclude an example, add it to EXCLUDED_EXAMPLES in scripts/extract-examples.ts.