/dogma:ignore:sync-allfrom dogma
Syncs AI/tool ignore patterns from sync.md to selected local repos, updating both .gitignore and .git/info/exclude. Groups patterns by tool and offers fallback help for non-marketplace repos.
Ships in dogma. Installing the plugin adds it to Claude Code.
You are executing the /dogma:ignore:sync-all command. Your task is to sync all AI/tool patterns from sync.md to selected local repositories.
This command is ONLY available in the marketplace repository where sync.md exists.
# Script directory for token-safe utilities
SCRIPT_DIR="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "$(realpath "$0")")")}/scripts"
# Check if this is the marketplace repo
MARKETPLACE_DETECTED="false"
# Method 1: Check git remote (token-safe)
if "$SCRIPT_DIR/git-remote-safe.sh" url 2>/dev/null | grep -q "marcel-bich-claude-marketplace"; then
MARKETPLACE_DETECTED="true"
fi
# Method 2: Check for sync.md in plugins/dogma/commands/
if [ -f "plugins/dogma/commands/sync.md" ]; then
MARKETPLACE_DETECTED="true"
fi
If MARKETPLACE_DETECTED is "false":
Do NOT just show an error. Instead, explain and offer to help:
/dogma:ignore:sync-all is designed for central pattern management in the
marcel-bich-claude-marketplace repo. All AI-tool patterns are maintained
in sync.md there and distributed to other repos from that location.
For adding individual patterns to this repo, use:
/dogma:ignore .aider* .continue*
This adds patterns to multiple locations at once:
- .gitignore (versioned, shared with team)
- .git/info/exclude (local only, not versioned)
To audit which patterns are missing where:
/dogma:ignore:audit
Then use AskUserQuestion:
What were you trying to achieve?
1. Add patterns to .gitignore AND .git/info/exclude -> /dogma:ignore
2. Audit which patterns are missing where -> /dogma:ignore:audit
3. Something else (please describe)
Based on user response:
/dogma:ignore [patterns]/dogma:ignore:audit for themOnly stop if user explicitly cancels.
Read the file plugins/dogma/commands/sync.md and extract all patterns from the section:
"Build comprehensive AI-file patterns list" (Step 4.5.3)
Look for the code block that contains patterns like:
[Dd][Oo][Gg][Mm][Aa]-[Pp][Ee][Rr][Mm][Ii][Ss][Ss][Ii][Oo][Nn][Ss].[Mm][Dd].[Aa][Ii][Dd][Ee][Rr]*Extract all patterns (lines that are not comments and not empty) from the patterns section.
Group patterns by category for better overview:
Sync of X patterns from sync.md
Categories:
- Dogma-specific: X patterns
- Claude Code: X patterns
- Cursor: X patterns
- ...
# Get current directory name
CURRENT_DIR=$(basename "$PWD")
# Find git repos in parent directory
PARENT_DIR=$(dirname "$PWD")
SIBLING_REPOS=""
for dir in "$PARENT_DIR"/*/; do
if [ -d "${dir}.git" ] && [ "$(basename "$dir")" != "$CURRENT_DIR" ]; then
SIBLING_REPOS="$SIBLING_REPOS$(basename "$dir")\n"
fi
done
Which repos to apply to?
Found repos in ../:
1. ../marcel-bich-claude-ideas
2. ../web-selecta-7850
3. ../another-project
Options:
A. All repos listed above
C. Current repo (this one)
P. Enter a custom path
S. Selection (comma-separated numbers, e.g., "1,3")
Your choice:
For custom path:
Enter path (absolute or relative):
> ~/projects/my-repo
Validating...
# Validate custom path
CUSTOM_PATH="${CUSTOM_PATH/#\~/$HOME}"
if [ ! -d "$CUSTOM_PATH/.git" ]; then
echo "Error: $CUSTOM_PATH is not a Git repository"
# Ask again or abort
fi
For each selected repository:
cd "$REPO_PATH"
GITIGNORE_PATH=".gitignore"
if [ -f "$GITIGNORE_PATH" ]; then
EXISTING_CONTENT=$(cat "$GITIGNORE_PATH")
else
EXISTING_CONTENT=""
fi
For each pattern:
# Check if pattern exists
pattern_exists() {
grep -qF "$1" "$GITIGNORE_PATH" 2>/dev/null
}
Only add patterns that don't already exist.
Important: Add a section header if adding patterns for the first time:
# ======================================
# AI/Agent Files (managed by dogma:ignore:sync-all)
# ======================================
../marcel-bich-claude-ideas:
+ .aider* (.gitignore)
+ .continue* (.gitignore)
= 2 added
Or if no changes needed:
../marcel-bich-claude-ideas:
= All patterns already present
Sync of 12 patterns from sync.md
../marcel-bich-claude-ideas:
+ .aider* (.gitignore)
+ .continue* (.gitignore)
= 2 added
../web-selecta-7850:
+ .aider* (.gitignore)
+ .codeium* (.gitignore)
= 2 added
../already-configured-repo:
= All patterns already present
Total: 4 patterns added to 2 repos
The patterns to sync are maintained in plugins/dogma/commands/sync.md in the section "Build comprehensive AI-file patterns list".
These include patterns for:
What the command file sets; muted values are Claude Code's defaults
ignore-patterns, gitignore, git-exclude, sync, pattern-management
7-day visitors to each command page
npx claudepluginhub marcel-bich/marcel-bich-claude-marketplace --plugin dogma13 commands in this plugin
/cleanupClaude-Dogma: Cleanup AI Tracesdogma - Find and fix AI-typical patterns in code (reactive cleanup)/docs-updateClaude-Dogma: Documentation Updatedogma - Sync documentation across README files and wiki articles/forceDogma Force: Collect Rules, Summarize, Then Applydogma - Interactively collect and apply CLAUDE rules to the project/ignoreDogma: Ignore Pattern Managerdogma - Add ignore patterns to multiple locations at once/ignore:auditDogma Ignore Audit: Show Missing Patterns Overviewdogma - Show which patterns are missing where/lintClaude-Dogma: Lint & Formatdogma - Run project-specific linting and formatting on staged files (non-interactive)Other plugins' commands for the same job