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

v1.23.0

Published

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

Readme

@directive-run/knowledge

The source of truth for all Directive coding knowledge – used by Claude Code skills, Cursor / Copilot / Windsurf / Cline / Codex rules files, the website's /llms.txt route, and the programmatic API for downstream tooling.

If you want your AI assistant to write idiomatic Directive code, you do not install this package directly – you install one of its consumers below.

Using the knowledge

Claude Code

Two commands in a Claude Code session:

/plugin marketplace add directive-run/directive
/plugin install directive@directive-plugins

Ships 12 skills bundled from this package. Skills are model-invoked – Claude reads each skill's description and auto-loads the relevant one when your task matches.

Cursor, Copilot, Windsurf, Cline, OpenAI Codex

Run @directive-run/cli from your project root:

npx directive ai-rules init

Generates .cursorrules / .clinerules / copilot-instructions.md / windsurf.md / AGENTS.md / CLAUDE.md tuned to each assistant's ingestion convention.

LLM agents crawling docs at runtime

Point your agent at https://directive.run/llms.txt. The route bundles a comparison framing + the full sitemap so an agent doing one-shot retrieval gets a coherent picture.

Full decision tree

See /docs/ide-integration for the full path-per-editor decision tree and verification commands.

Programmatic API

For tool builders who consume Directive knowledge in their own code (custom AI integrations, doc renderers, etc.):

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();

If you're just trying to write code with AI help, you don't need this – install the Claude plugin or run directive ai-rules above.

What's in the package

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

Contributing

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.