Rule sharing & privacy
This guide helps you control three independent aspects of your rules: who sees them, whether they need approval, and where they sync.
Quick decision table
Not sure how to configure your rules? Find your use case below:
| What you want | Go to |
|---|---|
| Keep a rule private to just this machine (no sync) | Scenario 1 |
| Sync personal rules across all my machines | Scenario 2 |
| Share team standards normally (approval required) | Scenario 3 |
| Publish rules for others to use as a pack | Scenario 4 |
New to packs? See Align packs for manifest fields, limits, and examples.
Publishing rules (for maintainers)
Setting up a shared rules repository
Create a repository to publish your rules:
-
Create a repository on GitHub, GitLab, or your preferred git host:
- For public sharing: Create a public repository
- For team/private sharing: Create a private repository with appropriate access
-
Configure remotes in
.aligntrue/config.yaml:
remotes:
shared: git@github.com:username/shared-rules.git- Push your rules (auto by default):
# Default: pushes on every sync unless you set auto: false on the remote
aligntrue sync
# If you set auto: false (or want an explicit push)
aligntrue remotes push- Share the repository URL with others. They can consume your rules as a source:
# Their config
sources:
- type: git
url: https://github.com/username/shared-rules.git
ref: mainYour rules repository structure
As a rules maintainer:
- Edit rules locally - Make changes in
.aligntrue/rules/ - Test changes - Run
aligntrue syncto verify exports - Push to remote - Happens on
aligntrue syncby default; setauto: falseif you prefer to push manually withaligntrue remotes push
Your rules repository structure:
your-rules-repo/
typescript.md
testing.md
guides/
react.md
vue.mdConsumers receive these files when they sync from your repository.
Separating public and private rules
You may want to share some rules publicly while keeping others private. Use multiple remotes:
remotes:
shared:
url: git@github.com:username/public-rules.git
personal:
url: git@github.com:username/private-rules.gitThen use scope in rule frontmatter to control routing.
Privacy controls
The three dimensions of rule privacy:
| Dimension | Setting | What it controls | Values |
|---|---|---|---|
| Git visibility | gitignore: true/false | Are the rule’s exported files committed? | false (committed) or true (exports gitignored; source file unchanged) |
| Approval scope | scope: team/personal/shared | Does it require team approval? (team mode only) | team (requires approval), personal (bypass approval), shared (tracked, routed to shared remote) |
| Remote routing | remotes config | Where are rules synced? | Personal remote, shared remote, or custom remotes |
These dimensions are largely independent. A rule can be:
- Gitignored but tracked in lockfile
- Personal-scope but committed to the repo
- Gitignored and personal-scope (fully private)
- Shared-scope for publishing
Mode-based routing and auto defaults
- Auto default: Remotes push during
aligntrue syncunless you setauto: falseon a remote. Usealigntrue remotes pushwhen you want explicit/manual pushes. - Solo mode routing (default): All rules route to
remotes.personal(unless a rule isscope: sharedand a shared remote exists). Scope is ignored for personal routing in solo mode. - Team/enterprise routing: Scope-based:
scope: personal→remotes.personalscope: shared→remotes.sharedscope: team→ stays in repo
- Custom remotes: Additive in all modes; matched files also go to those remotes.
How data flows: Sources vs Remotes
Understanding the difference between sources and remotes is key to setting up your workflow:
Consumer vs Maintainer roles
| Role | What you do | Config | Example |
|---|---|---|---|
| Consumer | Pull rules from others | sources | Pull TypeScript rules from a shared repo |
| Maintainer | Create and push rules | remotes | Maintain personal rules, push to personal remote |
| Both | Both pull and push | Both | Pull team rules, maintain personal customizations |
You can have multiple roles simultaneously with different rules. For example:
- Pull team standards via
sources - Maintain personal preferences locally
- Push personal rules to
remotes.personal - Push curated rules to
remotes.sharedfor your team
Common scenarios
Scenario 1: Keep a rule private to my machine
Use this when the rule is machine-specific or sensitive.
---
title: My SSH Configuration
gitignore: true
scope: personal
---Result:
- Not committed to git
- Not in lockfile
- Not synced anywhere
Scenario 2: Sync personal rules across my machines
Use this to access the same personal preferences on all your machines.
---
title: My Editor Shortcuts
scope: personal
---Plus configure .aligntrue/config.yaml:
# Pull personal rules from remote
sources:
- type: git
url: git@github.com:yourusername/personal-rules.git
personal: true
# Push personal rules to the same remote
remotes:
personal: git@github.com:yourusername/personal-rules.gitResult:
- Rules committed to your repo
- Not in team lockfile (won’t trigger drift)
- Pulled from and pushed to your personal remote (auto on by default; set
auto: falseto requirealigntrue remotes push) - Accessible on all your machines
Scenario 3: Share team rules normally
Use this for shared team standards.
---
title: Team Security Standards
---No special config needed.
Result:
- Committed to git
- Tracked in lockfile (requires team approval to change)
- Stays in main repo only
Scenario 4: Publish rules for others to use
Use this when you want to share a curated set of rules with your team or the community.
---
title: React Best Practices
scope: shared
---Plus configure .aligntrue/config.yaml:
remotes:
shared: git@github.com:yourusername/react-rules-pack.gitResult:
- Committed and tracked in lockfile
- Synced to the shared remote for publishing
- Others can consume via
sources
Setting git visibility
Use gitignore: true in rule frontmatter to exclude the rule’s exported files from git (source stays tracked unless you gitignore it or run with git.mode: ignore):
---
title: My Private Notes
gitignore: true
---
# Exported files like `.cursor/rules/my-private-notes.mdc` are auto-added to a managed block in `.gitignore`.
# The source `.aligntrue/rules/my-private-notes.md` remains tracked unless you gitignore it separately.Git visibility table
| Setting | Behavior | Use case |
|---|---|---|
gitignore: false (default) | Rule source and exports committed | Team standards, shared guidelines |
gitignore: true | Rule exports gitignored; source file unaffected unless you gitignore it | Sensitive exports or local-only exports |
Setting approval scope
Use scope in rule frontmatter to control lockfile tracking and remote routing:
---
title: My Preferences
scope: personal
---
# This rule won't trigger lockfile changesScope values and behavior
| Scope | Lockfile | Remote routing | Use case |
|---|---|---|---|
team (default) | Tracked | Stays in main repo | Shared team standards |
personal | Excluded | Routes to remotes.personal | Individual preferences |
shared | Tracked | Routes to remotes.shared | Published rules for others |
Team-scope rules:
- Tracked in lockfile (changes require approval)
- Stay in main repo only
- Good for shared standards
Personal-scope rules:
- Excluded from lockfile
- Can change freely
- Automatically synced to
remotes.personalif configured - Good for individual preferences
Shared-scope rules:
- Tracked in lockfile (require team approval)
- Synced to
remotes.sharedfor publishing - Good for rule packs you want to share
Remote routing with sources and remotes
Pulling rules from a remote source
Add a git source using the CLI or config:
CLI:
# Add as a connected source (pulls on sync)
aligntrue add source git@github.com:yourusername/personal-rules.git --personalConfig:
# .aligntrue/config.yaml
sources:
- type: local
path: .aligntrue/rules
- type: git
url: git@github.com:yourusername/personal-rules.git
personal: trueThe personal: true flag on a source:
- Marks all rules from that source as
scope: personal - Auto-applies
gitignore: true - SSH URLs (
git@...) automatically getgitignore: true
Pushing rules to remote repositories
Configure remotes using the CLI or config:
CLI:
# Add personal remote (for scope: personal rules)
aligntrue add remote git@github.com:yourusername/personal-rules.git --personal
# Add shared remote (for scope: shared rules)
aligntrue add remote git@github.com:yourusername/shared-rules.git --sharedConfig:
# .aligntrue/config.yaml
remotes:
# Personal-scope rules go here
personal: git@github.com:yourusername/personal-rules.git
# Shared-scope rules go here (for publishing)
shared: git@github.com:yourusername/shared-rules.git
# Optional: fine-grained pattern-based routing
custom:
- id: typescript
url: git@github.com:yourusername/typescript-rules.git
include: ["typescript*.md", "eslint*.md"]How routing works
-
Scope-based routing (primary): Rules are routed based on their
scopefrontmatterscope: personalrules →remotes.personalscope: sharedrules →remotes.sharedscope: teamrules → stay in main repo only
-
Custom pattern routing (additive): Use
customfor fine-grained control- Files matching patterns go to those remotes in addition to scope-based routing
- A rule can go to multiple destinations
- Useful for creating thematic groups (e.g., all TypeScript rules)
Routing recap (team mode):
| Scope | Default push | Lockfile | Typical config file |
|---|---|---|---|
team | Stays in main repo | Included | Team |
shared | remotes.shared | Included | Team (or personal if you publish) |
personal | remotes.personal | Excluded | Personal |
FAQs:
- Can one rule be both personal and shared? No. Each rule has one
scope. Useremotes.custom[]for extra destinations. - Where should remotes live?
remotes.sharedusually inconfig.team.yaml;remotes.personalin your personalconfig.yaml. Both files can addremotes.customand they concatenate. - Do custom remotes replace scope routing? No. Custom remotes are additive; scope routing still happens.
Using shared rules (for consumers)
Option 1: Link as a source (get updates)
Add the repository as a source to get ongoing updates:
aligntrue add source https://github.com/username/shared-rules.gitOr manually add to config:
sources:
- type: git
url: https://github.com/username/shared-rules.git
ref: main # Or a specific tag/commit for stabilityRun aligntrue sync to pull updates.
Option 2: One-time import (copy)
Copy rules to your local .aligntrue/rules/:
aligntrue add https://github.com/username/shared-rules.gitThis copies the rules locally. You won’t get updates unless you run add again.
Version pinning
For stability, consumers can pin to a specific version:
sources:
- type: git
url: https://github.com/username/shared-rules.git
ref: v1.2.0 # Pin to tagOr a specific commit:
sources:
- type: git
url: https://github.com/username/shared-rules.git
ref: abc123def # Pin to commit SHAPersonal rules across machines
Use remotes to sync your personal rules across multiple machines (push from one, pull as a source on another):
Machine A (primary)
remotes:
personal:
url: git@github.com:username/my-rules.gitMachine B (secondary)
Option 1: Use as source (pull only):
sources:
- type: git
url: git@github.com:username/my-rules.git
personal: true # Skip team approvalOption 2: Also backup from Machine B:
sources:
- type: git
url: git@github.com:username/my-rules.git
personal: true
remotes:
personal:
url: git@github.com:username/my-rules.gitWith Option 2, edits on either machine will push to the remote. Be careful of conflicts.
Best practices
For maintainers
- Use semantic versioning tags for releases
- Document breaking changes in your repository
- Keep rules focused and well-documented
- Consider separating stable rules from experimental ones
For consumers
- Pin to tags or commits for production use
- Review updates before merging in team mode
- Fork repositories for critical dependencies
General do’s
- Use
gitignore: truefor rules with sensitive content - Use
scope: personalfor individual preferences in team mode - Use
scope: sharedfor rules you want to publish to others - Use
sourceswithpersonal: trueto pull personal rules from remote - Configure
remotes.personalto sync personal rules across machines - Use
remotes.sharedto publish curated rule packs
General don’ts
- Use
scope: personalto bypass team review for shared standards - Assume gitignored rules are backed up (configure
remotes.personalfor that) - Configure the same URL as both a source and a remote (creates conflicts)
Complete workflow example
Setting up personal rules that sync across machines:
Step 1: Create a private repo
# On GitHub, create: aligntrue-personal-rules (private)Step 2: Configure AlignTrue
Using CLI commands:
# Import existing rules from your personal repo (one-time copy)
aligntrue add git@github.com:yourusername/aligntrue-personal-rules.git
# OR add as connected source (pulls updates on sync)
aligntrue add source git@github.com:yourusername/aligntrue-personal-rules.git --personal
# Add as push destination
aligntrue add remote git@github.com:yourusername/aligntrue-personal-rules.git --personalOr configure directly in YAML:
# .aligntrue/config.yaml
sources:
- type: local
path: .aligntrue/rules
- type: git
url: git@github.com:yourusername/aligntrue-personal-rules.git
personal: true
remotes:
personal: git@github.com:yourusername/aligntrue-personal-rules.git
exporters:
- cursor
- agentsStep 3: Create a personal rule
---
title: My Shortcuts
scope: personal
---
## VS Code shortcuts
- Cmd+Shift+L: Format document
- Cmd+Shift+U: Convert to uppercaseStep 4: Sync
aligntrue syncNow your personal rules are:
- Pulled from your personal repo on every sync
- Available locally in
.aligntrue/rules/ - Exported to your agents
- Pushed back to your personal repo
On another machine, just clone the project and run aligntrue sync—your personal rules sync automatically!
Troubleshooting
Rule still showing in git status after marking gitignore
Run sync again to update .gitignore:
aligntrue sync
git statusIf still showing, manually remove from git cache:
git rm --cached .aligntrue/rules/rulename.md
git status # Should now be gitignoredPersonal-scope rules still in lockfile
Make sure scope: personal is in the rule’s frontmatter:
---
title: My Rule
scope: personal
---Then sync and verify:
aligntrue sync
cat .aligntrue/lock.json | grep rulename # Should NOT appearRules not syncing to remotes
Check your configuration:
- Is
remotesconfigured? - Do your rules have the correct
scope? - Is the remote URL accessible? Try:
git ls-remote <url> - Check for conflicts: same URL as a source? (not allowed)
Run verbose sync to see details:
aligntrue sync --verboseRelated
- Team Mode - How approval scopes work in team workflows
- Working with external sources - Adding and customizing external rules
- Personal Repository Setup - SSH and HTTPS configuration
- Source and remote issues - Resolving connection issues