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

@contentrain/rules

v0.2.0

Published

AI agent rules for Contentrain — quality standards, architecture conventions, IDE integration

Downloads

108

Readme

@contentrain/rules

npm version GitHub source

Shared AI-agent rules for Contentrain.

This package is the policy layer of the Contentrain ecosystem. It defines how agents should behave when they work with:

  • Contentrain MCP tools
  • schema and model design
  • content quality
  • normalize workflows
  • git-backed review flows
  • IDE rule distribution

If @contentrain/mcp is the deterministic execution layer, @contentrain/rules is the behavioral contract.

🚀 Install

pnpm add @contentrain/rules

📦 What It Contains

Shared rule sets

Published under shared/*:

  • content-quality.md
  • seo-rules.md
  • i18n-quality.md
  • accessibility-rules.md
  • security-rules.md
  • media-rules.md
  • content-conventions.md
  • schema-rules.md
  • mcp-usage.md
  • workflow-rules.md
  • normalize-rules.md

Prompt layers

Published under prompts/*:

  • common.md
  • generate-mode.md
  • normalize-mode.md
  • review-mode.md

Context bridge

Published under context/*:

  • context-bridge.md

IDE bundles

Published under ide/*:

  • ide/claude-code/contentrain.md
  • ide/cursor/contentrain.cursorrules
  • ide/windsurf/contentrain.windsurfrules
  • ide/generic/contentrain.md

🧰 Public Exports

The package root exports constants that can be used by tooling:

  • FIELD_TYPES
  • MODEL_KINDS
  • MCP_TOOLS
  • CONTENT_QUALITY_RULES
  • ARCHITECTURE_RULES
  • ALL_SHARED_RULES
  • IDE_RULE_FILES
  • STACKS

🧪 Example

import { IDE_RULE_FILES, MCP_TOOLS, ALL_SHARED_RULES } from '@contentrain/rules'

console.log(MCP_TOOLS.includes('contentrain_validate'))
console.log(IDE_RULE_FILES['claude-code'])
console.log(ALL_SHARED_RULES)

🧠 Design Role

@contentrain/rules exists to keep agent behavior aligned across tools and environments.

It should answer questions like:

  • What is acceptable content quality?
  • How should an agent use MCP tools?
  • What is the normalize contract?
  • What workflow and review constraints exist?
  • How should rules be packaged for Claude Code, Cursor, Windsurf, and generic agents?

🔗 Relationship To Other Packages

  • @contentrain/mcp enforces file, validation, and git behavior
  • @contentrain/skills provides step-by-step workflow playbooks
  • contentrain exposes CLI and serve UX
  • @contentrain/query is the generated runtime consumption layer

Rule of thumb:

  • rules = policy and constraints
  • skills = procedures and playbooks

🛠 Build

The build does two things:

  1. builds the typed JS entry from src/index.ts
  2. generates IDE bundle files from the shared markdown rules

From the monorepo root:

pnpm --filter @contentrain/rules build
pnpm --filter @contentrain/rules test
pnpm --filter @contentrain/rules typecheck

📄 License

MIT