Sharing Config Across Repositories
Use extends to maintain shared AI tool config in one organizational repository and inherit it across all your projects.
Setup
Step 1: Create a shared config repo
Create a repository (e.g., my-org/ai-config) with canonical AgentsMesh files:
ai-config/ .agentsmesh/ rules/ _root.md # Org-wide root rule security.md # Org-wide security rule typescript.md # Org-wide TypeScript standards commands/ commit.md # Shared commit command review.md # Shared review command permissions.yaml # Org-wide permissions baseline agentsmesh.yamlTag releases:
git tag v1.0.0git push origin v1.0.0Step 2: Reference from each project
In each project’s agentsmesh.yaml:
extends: - name: org-standards source: github:my-org/ai-config@v1.0.0 features: [rules, commands, permissions]Step 3: Generate
agentsmesh generateAgentsMesh fetches my-org/ai-config@v1.0.0 (cached in ~/.agentsmesh/cache/), merges the shared rules/commands/permissions with the project’s local canonical config, and generates output for all targets.
Merge precedence
Local canonical config always wins over extended sources:
Priority (highest to lowest):1. .agentsmesh/ (project-local)2. .agentsmesh/packs/ (installed packs)3. extends sources (shared org config)If your project defines a security.md rule and the shared repo also defines one, your local version takes precedence.
Upgrading shared config
When my-org/ai-config releases v2.0.0:
# Bump the version in each projectextends: - name: org-standards source: github:my-org/ai-config@v2.0.0 features: [rules, commands, permissions]# Refresh cache and regenerateagentsmesh generate --refresh-cacheMonorepo setup
For monorepos with a shared config directory:
extends: - name: workspace-rules source: ../shared-ai-config features: [rules, commands, permissions]Local path sources don’t cache — they’re read directly every time.
Cherry-picking from shared config
If the shared repo has many rules but you only want some:
extends: - name: org-standards source: github:my-org/ai-config@v1.0.0 features: [rules] pick: rules: [security, typescript] # only inherit these two rulesDelegating all config to shared
For projects that want to inherit everything from the org:
version: 1targets: - claude-code - cursor
extends: - name: org-standards source: github:my-org/ai-config@v1.0.0 # no features filter — inherit everythingThe project has no local canonical config of its own. All rules, commands, etc. come from the shared repo.