Tools: How I Manage AI Coding Rules Across Claude Code, Cursor, and Codex With One CLI

Tools: How I Manage AI Coding Rules Across Claude Code, Cursor, and Codex With One CLI

If you use more than one AI coding assistant, you already know this pain: I had the same commit conventions, security policies, and React patterns written in 3 different formats. Every time I updated one, the others fell out of sync. On top of that, Claude Code loads every rule on every prompt -- 30 rules installed means 30 rules injected, even when you're just writing a commit message. I built https://github.com/JSK9999/ai-nexus -- a CLI that solves both problems: Write rules once in simple markdown: description: "Git commit message conventions and best practices" ai-nexus distributes them: Semantic Routing (Claude Code) A hook runs on every prompt and picks only the rules you actually need: $ npx ai-nexus test "write a commit message" Selected files (2): • rules/commit.md • commands/commit.md $ npx ai-nexus test "review this React component" Selected files (3): • rules/essential.md • skills/react.md • skills/review.md 30+ rules installed, but only 2-3 loaded per prompt. Cursor: Auto-Conversion ai-nexus converts .md rules to .mdc format, adding description and alwaysApply metadata automatically. After that, Cursor's built-in semantic search handles the filtering. Codex: Aggregated Rules Individual rule files are aggregated into a single AGENTS.md file, loaded at session start. Community Marketplace You don't have to write everything from scratch: npx ai-nexus search react npx ai-nexus get react.md npx ai-nexus browse https://raw.githubusercontent.com/JSK9999/ai-nexus/main/docs/nexus-marketplace.pn g Share rules across your team via Git: npx ai-nexus install --rules github.com/your-org/team-rules npx ai-nexus update Existing files are never overwritten. Only new rules are added. https://raw.githubusercontent.com/JSK9999/ai-nexus/main/docs/nexus-demo.gif Apache 2.0 licensed. Contributions welcome -- each rule is just a markdown file. If you have questions or feedback, drop a comment! Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to ? It will become hidden in your post, but will still be visible via the comment's permalink. as well , this person and/or - Claude Code wants rules in .claude/rules/*.md
- Cursor wants .cursor/rules/*.mdc with frontmatter
- Codex wants a single .codex/AGENTS.md - Write rules once, deploy to all three tools
- Smart rule loading so only relevant rules are used per prompt - Only relevant rules loaded -- 30+ rules installed, only 2-3 per prompt.
Semantic Router picks just the rules you need.
- Write once, deploy everywhere -- One .md file auto-converts to .mdc for Cursor
and AGENTS.md for Codex.
- AI-powered rule selection -- GPT-4o-mini or Claude Haiku picks rules
(~$0.50/month). Falls back to keyword matching for free.
- Team-wide consistency -- Everyone installs from the same Git repo. One command
to sync.
- Your edits are safe -- Install and update never overwrite local customizations.
- Community marketplace -- Browse, install, remove rules from a local web UI. - Title under 50 chars
- Body explains changes and reasons - Claude Code → .claude/rules/*.md with a semantic router hook
- Cursor → .cursor/rules/*.mdc with auto-converted frontmatter
- Codex → .codex/AGENTS.md aggregated into one file - AI routing -- GPT-4o-mini or Claude Haiku analyzes your prompt (~$0.50/month)
- Keyword matching -- zero cost fallback - GitHub: https://github.com/JSK9999/ai-nexus
- npm: https://www.npmjs.com/package/ai-nexus
- Docs: https://jsk9999.github.io/ai-nexus/