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

@xenonbyte/constraint-generator

v1.3.7

Published

Generate and manage AI programming assistant constraint files (CLAUDE.md, AGENTS.md, GEMINI.md)

Readme

Constraint Generator

npm version License: MIT

Generate and maintain AI assistant constraint files (CLAUDE.md, AGENTS.md, GEMINI.md) from one shared model.

中文文档

Current version: 1.3.7

Platform Mapping

| Platform | Constraint File | In-Tool Prefix | |----------|------------------|----------------| | Claude Code | CLAUDE.md | /cg:<command> | | Codex | AGENTS.md | /prompts:cg-<command> | | Gemini | GEMINI.md | /cg:<command> |

Command Channels

Constraint Generator has two explicit command channels:

  1. In-tool skills (/cg:*, /prompts:cg-*)
  2. Local CLI (cg ...)

In-Tool Skill Commands (Quick Reference)

| Command | Key Parameters | |---------|----------------| | /cg:generate | --tier <mvp\|full>, --platforms, --dry-run, --rules, --quality | | /cg:guided | --resume | | /cg:update | --strategy, --platforms, --dry-run, --no-backup, --force | | /cg:drift | --platforms, --exit-code | | /cg:refs | actions: check, list | | /cg:status | no parameters | | /cg:monorepo | --platforms, --package, --exclude, --dry-run | | /cg:help | no parameters |

Codex equivalents use /prompts:cg-... (for example /prompts:cg-help).

Local CLI Commands (Quick Reference)

cg ... are local terminal commands. Constraint generation is skill-only (use /cg:generate or /prompts:cg-generate). cg claude ... remain Claude-only local settings workflows (not in-tool /cg: skill commands).

| Command | Key Parameters | |---------|----------------| | cg install | --platform/--platforms, --workspace, --dry-run, --force, --no-seed | | cg uninstall | --platform/--platforms or --all, --workspace, --remove-seed, --dry-run | | cg claude protect | --pattern (required, repeatable), --scope, --level, --strict-sandbox, --dry-run | | cg claude mode | --mode (required), --scope, --yes-dangerous, --dry-run | | cg claude hooks suggest | --scope, --dry-run | | cg claude hooks apply | --scope, --dry-run | | cg --help | no parameters |

Full parameter reference: Command Reference

Core Generation Semantics

Template Tiers

  • mvp includes:
    • role
    • principles
    • tech-stack
    • forbidden
    • verification
    • compact-instructions
  • full includes mvp plus:
    • workflows
    • code-style
    • error-handling
    • references (when reference inputs exist)

output-format and quality are not part of default AI-facing tier composition.

--quality Behavior

--quality remains supported as a generation/runtime policy control (fast, balanced, strict, etc.). It does not require rendering a root quality section.

--rules Boundary (Claude-only mechanism)

--rules is scoped to the Claude adapter:

  • Claude output may split path-scoped sections into .claude/rules/*.md
  • Codex/Gemini outputs keep full single-file content
  • If Claude is not in targets, no .claude/rules/ files are created

Future Codex/Gemini local-rule layering requires dedicated platform-native adapters and is not implemented in this release.

AI-Facing Output Language

Generated governance artifacts intended for model/runtime consumption are always English, including:

  • CLAUDE.md / AGENTS.md / GEMINI.md
  • .claude/rules/*.md
  • Claude hooks proposal/config snippets generated by cg

Metadata Sidecar (Token Optimization)

Generated constraint files keep model-facing content lean and store generator metadata in sidecar files:

  • .cg/metadata/CLAUDE.md.meta.json
  • .cg/metadata/AGENTS.md.meta.json
  • .cg/metadata/GEMINI.md.meta.json

cg uses sidecars for round-trip parsing and drift/consistency workflows.
Root .gitignore is auto-updated to include .cg/.

Claude Project Settings Workflows

Protect Sensitive Paths

cg claude protect --pattern '**/.env' --level sealed --scope project
  • Writes to .claude/settings.json (or .claude/settings.local.json for --scope local)
  • Merges non-destructively and deduplicates rules
  • Protect commands only append/tighten rules (no silent weakening)

Configure Default Mode

cg claude mode --mode plan --scope project

For dangerous mode:

cg claude mode --mode bypassPermissions --yes-dangerous
  • bypassPermissions requires explicit dangerous confirmation
  • deny-based protections still apply
  • governance setting permissions.disableBypassPermissionsMode=true blocks bypass mode

Claude Hooks Suggest/Apply Workflow

cg claude hooks suggest --scope project
# review .claude/hooks.proposed.jsonc
# remove review marker
cg claude hooks apply --scope project
  • suggest only creates a review-gated proposal file
  • apply requires marker removal, merges hooks non-destructively, and deletes consumed proposal file

Install

One-time setup (recommended):

npx -y @xenonbyte/constraint-generator@latest install --platforms claude,codex,gemini

Note: npx is ephemeral and does not install persistent cg to PATH.

Global CLI install (optional):

npm i -g @xenonbyte/constraint-generator
cg install --platforms claude,codex,gemini

Git clone + script (fallback):

git clone https://github.com/xenonbyte/constraint-generator.git
cd constraint-generator
./install.sh --platforms claude,codex,gemini

Uninstall:

cg uninstall --all --remove-seed --workspace .

Development

npm install
npm run build
npm test -- --runInBand

Docs

License

MIT