@contentrain/rules
v0.2.0
Published
AI agent rules for Contentrain — quality standards, architecture conventions, IDE integration
Downloads
108
Maintainers
Readme
@contentrain/rules
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.mdseo-rules.mdi18n-quality.mdaccessibility-rules.mdsecurity-rules.mdmedia-rules.mdcontent-conventions.mdschema-rules.mdmcp-usage.mdworkflow-rules.mdnormalize-rules.md
Prompt layers
Published under prompts/*:
common.mdgenerate-mode.mdnormalize-mode.mdreview-mode.md
Context bridge
Published under context/*:
context-bridge.md
IDE bundles
Published under ide/*:
ide/claude-code/contentrain.mdide/cursor/contentrain.cursorruleside/windsurf/contentrain.windsurfruleside/generic/contentrain.md
🧰 Public Exports
The package root exports constants that can be used by tooling:
FIELD_TYPESMODEL_KINDSMCP_TOOLSCONTENT_QUALITY_RULESARCHITECTURE_RULESALL_SHARED_RULESIDE_RULE_FILESSTACKS
🧪 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/mcpenforces file, validation, and git behavior@contentrain/skillsprovides step-by-step workflow playbookscontentrainexposes CLI and serve UX@contentrain/queryis the generated runtime consumption layer
Rule of thumb:
rules= policy and constraintsskills= procedures and playbooks
🛠 Build
The build does two things:
- builds the typed JS entry from
src/index.ts - 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
