ruleshare
v0.3.6
Published
Sync shared Claude Code rules from remote sources
Maintainers
Readme
ruleshare
Sync shared Claude Code rules from remote sources.
Installation
npm install -g ruleshare
# or
npx ruleshareUsage
Initialize
Create a shared.json config file in .claude/rules/:
ruleshare initAdd Sources
Define source aliases to avoid repeating full GitHub paths:
ruleshare add source anthropic github:anthropic/claude-rules
ruleshare add source company github:mycompany/team-rules/rulesAdd Rules
Add rules using source aliases or full paths:
# Using alias
ruleshare add typescript anthropic:typescript.md
ruleshare add react anthropic:react.md
# Using full path
ruleshare add security github:company/rules/[email protected]
# With version pinning
ruleshare add api-design company:backend/[email protected]Sync Rules
Download all rules to .claude/rules/shared/:
ruleshare syncCheck Status
See which rules are outdated:
ruleshare statusUpdate Rules
Force re-download all rules:
ruleshare updateList Configuration
Show configured sources and rules:
ruleshare listRemove Rules
ruleshare remove typescriptFile Structure
.claude/
└── rules/
├── your-team-rules.md # Your own rules (not managed)
├── shared.json # Config file (commit this)
├── shared.lock # Lock file (commit this)
└── shared/ # Synced rules
├── typescript.md
└── react.mdConfig Format
.claude/rules/shared.json:
{
"sources": {
"anthropic": "github:anthropic/claude-rules",
"company": "github:mycompany/team-rules/rules"
},
"rules": {
"typescript": "anthropic:typescript.md",
"react": "anthropic:[email protected]",
"security": "company:security.md"
}
}Source Formats
| Format | Example |
|--------|---------|
| GitHub | github:owner/repo/path/file.md |
| GitHub + version | github:owner/repo/path/[email protected] |
| Alias | alias:path/file.md |
| URL | https://example.com/rules.md |
Private Repos
Private GitHub repos work automatically if you have the GitHub CLI authenticated:
gh auth loginNo additional configuration needed. Ruleshare tries unauthenticated access first, then falls back to gh for private repos.
License
MIT
