| name | template-broadcast |
| description | Apply template-downstream to all registered downstream projects in bulk, one project at a time. Use when you want to push the latest .claude/, .mcp.json, or .pre-commit-config.yaml to every project at once. Triggers on: "์ผ๊ด ๋ฐฐํฌ", "์ ์ฒด ํ๋ก์ ํธ์ ๋ด๋ ค๋ณด๋ด๊ธฐ", "๋ชจ๋ ํ๋ก์ ํธ ์
๋ฐ์ดํธ", "broadcast template", "bulk sync". |
template-broadcast
Apply template-downstream logic to every registered downstream project sequentially.
The project registry is in references/projects.md โ read it first.
Strategy
Same merge-aware update as template-downstream:
- NEW files โ copy as-is
- CHANGED files โ merge, not overwrite (see
template-downstream Merge Rules)
- Project-only files are preserved
- No auto-delete
Each project is treated independently. A failure in one project does not stop the others โ report and continue.
Steps
1. Read project registry
Read references/projects.md to get the list of active downstream projects and their local paths.
2. Pre-flight check for each project
Check each project with separate Bash calls (not a for loop) to avoid shell environment issues:
git -C "<local_path>" status --porcelain
Classify each project:
| Result | Status | Meaning |
|---|
| directory missing | MISSING | skip |
| staged or unstaged tracked changes | DIRTY | skip by default |
only untracked files (?? lines only) | WARN | proceed, but note untracked files |
| clean | OK | proceed |
DIRTY vs WARN distinction matters: untracked files don't risk conflicts, so WARN projects can proceed safely. Only truly modified/staged files warrant a skip.
Report pre-flight results before proceeding:
Pre-flight:
real-estate-mcp OK
that-night-sky WARN โ untracked files only (safe to proceed)
claude-usage-menubar DIRTY โ modified: src/foo.py, will skip
open-chat-playground MISSING โ directory not found, will skip
claude-real-estate-openapi OK
Skills conflict detection
For each OK/WARN project, also check if any skill exists in both skills/ and skills.nouse/:
comm -12 \
<(ls "<project>/.claude/skills/" 2>/dev/null | sort) \
<(ls "<project>/.claude/skills.nouse/" 2>/dev/null | sort)
If any conflicts are found, report them and ask the user to decide before proceeding:
Conflict detected in real-estate-mcp โ skill exists in both skills/ and skills.nouse/:
- skill-creator
- template-broadcast
How should these be handled?
A) skills/ wins โ keep active, delete nouse copy
B) skills.nouse/ wins โ update nouse copy, delete active
C) Decide individually โ list each one
Wait for the user's answer before applying any changes to that project.
Ask the user to confirm before applying:
Proceed with OK/WARN projects? (Y/N)
3. Resolve TEMPLATE_ROOT once
Resolve the template source once and reuse for all projects. Priority:
- Current working directory if it is
python-template (most common case when running from template repo)
/Users/bachtaeyeong/10_SrcHub/python-template if it exists
- Shallow clone as fallback:
TMPDIR=$(mktemp -d)
git clone --depth 1 https://github.com/tae0y/python-project-template.git "$TMPDIR/template"
TEMPLATE_ROOT="$TMPDIR/template"
Verify $TEMPLATE_ROOT/.claude/ exists. Abort all if not.
4. Apply to each OK project
For each project that passed pre-flight, apply the diff-aware update:
PROJECT_ROOT="<local_path>"
find "$TEMPLATE_ROOT/.claude" -type f | while read src; do
rel="${src#$TEMPLATE_ROOT/}"
dst="$PROJECT_ROOT/$rel"
nouse_dst=""
if [[ "$rel" == .claude/skills/* ]]; then
nouse_rel="${rel/.claude\/skills\//.claude\/skills.nouse\/}"
nouse_dst="$PROJECT_ROOT/$nouse_rel"
fi
if [ -n "$nouse_dst" ] && [ -f "$nouse_dst" ]; then
if ! diff -q "$src" "$nouse_dst" > /dev/null 2>&1; then
echo "CHANGED (nouse): $nouse_rel"
fi
elif [ ! -f "$dst" ]; then
echo "NEW: $rel"
elif ! diff -q "$src" "$dst" > /dev/null 2>&1; then
echo "CHANGED: $rel"
fi
done
Report per-project result immediately after each:
[1/3] real-estate-mcp
CHANGED: .claude/rules/coding-guidelines.md
NEW: .claude/skills/template-downstream/SKILL.md
CHANGED (nouse): .claude/skills.nouse/tdd/SKILL.md โ disabled by project, updating nouse copy
unchanged: 13 files
Done.
[2/3] claude-usage-menubar
Already up to date.
[3/3] claude-real-estate-openapi
CHANGED: .pre-commit-config.yaml
Done.
5. Cleanup
If a temp clone was created:
rm -rf "$TMPDIR"
6. Final summary
Broadcast complete.
applied: 3 projects
skipped: 2 projects (dirty or missing)
Projects with .pre-commit-config.yaml changes:
claude-real-estate-openapi โ run: pre-commit install --hook-type commit-msg
Review changes in each project before committing.
Do not commit in any project. Leave all changes unstaged for per-project review.
Error Handling
| Situation | Action |
|---|
| Project directory missing | Skip, report MISSING, continue |
| Only untracked files in project | Proceed, report WARN, continue |
| Tracked modifications or staged changes | Skip, report DIRTY, continue |
| skills/ and skills.nouse/ conflict | Pause, ask user for resolution before applying |
| File copy fails | Report error for that file, continue with remaining files |
| TEMPLATE_ROOT not resolvable | Abort entire broadcast |