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

@aligntrue/plugin-contracts

v0.9.3

Published

**Plugin interface definitions for the AlignTrue ecosystem.**

Readme

@aligntrue/plugin-contracts

Plugin interface definitions for the AlignTrue ecosystem.

This package contains TypeScript interfaces and type definitions for all AlignTrue plugins. It contains no implementations—only contracts that plugins must implement.

Purpose

AlignTrue uses a plugin architecture to support multiple AI agents and development workflows. Plugin contracts define the interface between the core orchestration engine and plugin implementations.

By keeping contracts separate from implementations:

  • Clear boundaries: Plugins depend on contracts, not on each other
  • Scalability: New plugin types can be added without circular dependencies
  • Versioning: Contract changes are explicit and can be versioned independently
  • Testing: Mock implementations can implement contracts for testing

Architecture

@aligntrue/schema (data structures)
   ↓
@aligntrue/plugin-contracts (interfaces)  ← This package
   ↓
@aligntrue/core (orchestration) + Plugin implementations (exporters, etc.)

Plugin Types

Exporters (Core exporters)

Exporters convert AlignTrue IR (Intermediate Representation) to agent-specific formats.

Interface: ExporterPlugin

import type {
  ExporterPlugin,
  ScopedExportRequest,
  ExportOptions,
} from "@aligntrue/plugin-contracts";

export class MyExporter implements ExporterPlugin {
  name = "my-exporter";
  version = "1.0.0";

  async export(request: ScopedExportRequest, options: ExportOptions) {
    // Convert request.align.sections to agent format
    // Write to options.outputDir
    return {
      success: true,
      filesWritten: [".myagent/rules.txt"],
      contentHash: "sha256...",
      fidelityNotes: ["field X not supported"],
    };
  }
}

Key types:

  • ExporterPlugin - Main plugin interface
  • ScopedExportRequest - Rules + scope information
  • ExportOptions - Output directory and flags
  • ExportResult - Files written, hash, fidelity notes
  • ExporterManifest - Declarative manifest.json metadata

Supported Plugin Types

  • Exporters: Convert IR to agent-ready formats
  • MCP Servers: Model Context Protocol integrations
  • Scopes/overlays helpers: Shared contracts used by core/CLI

Usage

For Plugin Implementers

import type {
  ExporterPlugin,
  ScopedExportRequest,
  ExportOptions,
} from "@aligntrue/plugin-contracts";

export class MyExporter implements ExporterPlugin {
  // Implementation
}

For Core/Orchestration

import type { ExporterPlugin } from "@aligntrue/plugin-contracts";

function runExporter(plugin: ExporterPlugin, request: ScopedExportRequest) {
  return plugin.export(request, { outputDir: ".myagent" });
}

Scoped Exports

Exporters are called once per scope with pre-merged rules:

// Default scope
await exporter.export(
  {
    scope: { path: ".", normalizedPath: ".", isDefault: true },
    rules: [rule1, rule2],
    outputPath: ".cursor/rules/testing.mdc",
  },
  options,
);

// Named scope (monorepo)
await exporter.export(
  {
    scope: { path: "apps/web", normalizedPath: "apps/web", isDefault: false },
    rules: [rule3, rule4],
    outputPath: ".cursor/rules/apps-web/testing.mdc",
  },
  options,
);

Philosophy

Why separate contracts from implementations?

  1. Dependency Management: Prevents circular dependencies between core and plugins
  2. Semantic Clarity: Interfaces represent abstract contracts, not concrete behavior
  3. Versioning: Contract changes can be versioned independently from implementations
  4. Testing: Easy to create mocks and stubs for testing
  5. Scalability: New plugin types can be added without refactoring existing code

Why not put contracts in @aligntrue/schema?

Schema defines data structures (IR format, validation rules). Plugin contracts define behavioral interfaces. These are different concerns and should live in separate packages.

Why not put contracts in @aligntrue/core?

Core orchestrates plugins but shouldn't define their contracts. Plugins depend on contracts, not on the orchestration engine. This keeps the dependency graph clean:

Correct:   Plugin → Contracts
Incorrect: Plugin → Core (creates coupling)

API Reference

See TypeScript definitions in src/exporter.ts for detailed documentation.

Contributing

When adding new plugin types:

  1. Create a new file: src/<plugin-type>.ts
  2. Export types from src/index.ts
  3. Document usage in this README
  4. Update packages/core to use new contracts
  5. Create example implementation

License

MIT