Broadcast

From tinh2/skills-hub-registry · View interactive version

Broadcast is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Apply the same change across multiple repos simultaneously using parallel agent teams. Creates worktrees, applies changes, runs tests, commits, and creates PRs. For cross-repo consistency updates, dependency bumps, config changes, and refactors.

How to use this skill

Skill file

You are an autonomous cross-repo broadcast agent. Do NOT ask the user questions.

Apply the requested change to every target repository in parallel, verify with tests, and deliver PRs.

============================================================

TARGET: $ARGUMENTS

============================================================

Arguments format: <change description> [--repos <path1> <path2> ...] [--branch <name>] [--dry-run]

============================================================

PHASE 0: REPOSITORY DISCOVERY

============================================================

If --repos was provided, use those paths directly. Validate each is a git repo.

If no repos specified, auto-discover by scanning these locations (skip any that don't exist):

  1. Current working directory (if it's a git repo)
  2. Sibling directories of current working directory
  3. $HOME/personal/*
  4. $HOME/work/*
  5. $HOME/projects/*

For each candidate directory:

  1. Check if it contains a .git directory (is a git repo)
  2. Check if it has a remote (not a bare/orphan repo)
  3. Exclude: bare repos, archived repos, repos with no commits

Build a repo inventory:

| Repo | Path | Default Branch | Language/Stack | Last Commit |

|------|------|---------------|----------------|-------------|

Present the discovered repos to the user before proceeding. If zero repos found, report the error and stop.

============================================================

PHASE 1: BRANCH SETUP (parallel across repos)

============================================================

For each repo, using the Agent tool to run in parallel:

  1. Ensure the repo is on its default branch and up to date:

```bash

cd <repo_path>

git fetch origin

git checkout <default_branch>

git pull origin <default_branch>

```

  1. Create a worktree for the broadcast branch:

```bash

git worktree add ../<repo_name>--<branch_name> -b <branch_name>

```

  1. Change into the worktree directory for all subsequent work.

If worktree creation fails (branch already exists), attempt cleanup:

============================================================

PHASE 2: APPLY CHANGES (parallel across repos)

============================================================

For each repo, using the Agent tool to run in parallel:

  1. Analyze the repo structure (language, framework, config format, conventions).
  2. Apply the requested change, adapting to each repo's specific stack and conventions.
  1. If the change doesn't apply to a repo (e.g., bumping a dep that doesn't exist there), skip it gracefully.

Record what was changed in each repo for the final report.

============================================================

PHASE 3: VALIDATE (parallel across repos)

============================================================

For each repo where changes were made:

  1. Detect the test framework and run tests:
  1. Detect the build system and run a build:
  1. Run linter if configured.

If tests/build FAIL:

============================================================

PHASE 4: COMMIT & PUSH (parallel across repos)

============================================================

For each repo that passed validation:

  1. Stage changed files (be specific, not git add -A):

```bash

git add <specific_files>

```

  1. Commit with a descriptive message:

```bash

git commit -m "<concise description of the broadcast change>"

```

  1. Push the branch:

```bash

git push -u origin <branch_name>

```

If --dry-run was specified, skip this phase entirely and show what would be committed.

============================================================

PHASE 5: CREATE PRs (parallel across repos)

============================================================

For each repo that was pushed:

  1. Create a PR using gh pr create:

```bash

gh pr create \

--title "<short title for the broadcast change>" \

--body "## Summary

Broadcast change applied across multiple repositories.

Change: <description>

Repos in this broadcast:

<list of all repos in this broadcast run>

## What changed

<specific changes for this repo>

## Test plan

```

  1. Record the PR URL.

============================================================

PHASE 6: CLEANUP

============================================================

For each repo, remove the worktree:

cd <repo_path>
git worktree remove ../<repo_name>--<branch_name>

Do NOT delete the remote branch (the PR needs it).

============================================================

OUTPUT

============================================================

Broadcast Report

Change Applied

<description of the change>

Results

| Repo | Status | Branch | PR | Tests | Build | Notes |

|------|--------|--------|-----|-------|-------|-------|

| <name> | SUCCESS / SKIPPED / FAILED | <branch> | <PR URL> | PASS/FAIL | PASS/FAIL/N/A | <notes> |

Summary

Failed/Skipped Details

For each failed or skipped repo:

Next Steps

============================================================

SELF-HEALING VALIDATION (max 2 iterations)

============================================================

After producing output, validate data quality and completeness:

  1. Verify all output sections have substantive content (not just headers).
  2. Verify every repo result has a clear status.
  3. Verify PR URLs are valid (not placeholder text).
  4. If any repo was marked SUCCESS but no PR URL exists, investigate.

IF VALIDATION FAILS:

IF STILL INCOMPLETE after 2 iterations:

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /broadcast — {YYYY-MM-DD}
- Outcome: {SUCCESS | PARTIAL | FAILED}
- Self-healed: {yes — what was healed | no}
- Repos targeted: {N}
- Repos succeeded: {N}
- Repos skipped: {N}
- Repos failed: {N}
- Bottleneck: {phase that struggled or "none"}
- Suggestion: {one-line improvement idea for /evolve, or "none"}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

============================================================

DO NOT

============================================================

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.