Package Exports
- ruleshare
- ruleshare/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ruleshare) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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/security.md@v2.0.0
# With version pinning
ruleshare add api-design company:backend/api.md@v1.0.0Sync 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:react.md@v1.0.0",
"security": "company:security.md"
}
}Source Formats
| Format | Example |
|---|---|
| GitHub | github:owner/repo/path/file.md |
| GitHub + version | github:owner/repo/path/file.md@v1.0.0 |
| 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