ru
Repo Updater - Multi-repo synchronization with AI-assisted review orchestration. Parallel sync, agent-sweep for dirty repos, ntm integration, git plumbing. 17K LOC Bash CLI.
What this skill does
# RU - Repo Updater
A comprehensive Bash CLI for synchronizing dozens or hundreds of GitHub repositories. Beyond basic sync, RU includes a full AI-assisted code review system and agent-sweep capability for automatically processing uncommitted changes across your entire projects directory.
## Why This Exists
When you work with 47+ repos (personal projects, forks, dependencies), keeping them synchronized manually is tedious. But synchronization is just the beginning—RU also orchestrates AI coding agents to review issues, process PRs, and commit uncommitted work at scale.
**The problem it solves:**
- Manual `cd ~/project && git pull` for each repo
- Missing updates that accumulate into merge conflicts
- Dirty repos that never get committed
- Issues and PRs that pile up across repositories
- No coordination for AI agents working across repos
## Critical Concepts
### Git Plumbing, Not Porcelain
RU uses git plumbing commands exclusively—never parses human-readable output:
```bash
# WRONG: Locale-dependent, version-fragile
git pull 2>&1 | grep "Already up to date"
# RIGHT: Machine-readable plumbing
git rev-list --left-right --count HEAD...@{u}
git status --porcelain
git rev-parse HEAD
```
### Stream Separation
Human-readable output goes to stderr; data to stdout:
```bash
ru sync --json 2>/dev/null | jq '.summary'
# Progress shows in terminal, JSON pipes to jq
```
### No Global `cd`
All git operations use `git -C`. Never changes working directory.
## Essential Commands
### Sync (Primary Use Case)
```bash
# Sync all configured repos
ru sync
# Parallel sync (much faster)
ru sync -j8
# Dry run - see what would happen
ru sync --dry-run
# Resume interrupted sync
ru sync --resume
# JSON output for scripting
ru sync --json 2>/dev/null | jq '.summary'
```
### Status (Read-Only Check)
```bash
# Check all repos without modifying
ru status
# JSON output
ru status --json
```
### Repo Management
```bash
# Initialize configuration
ru init
# Add repos to sync list
ru add owner/repo
ru add https://github.com/owner/repo
ru add owner/repo@branch as custom-name
# Remove from list
ru remove owner/repo
# List configured repos
ru list
# Detect orphaned repos (in projects dir but not in list)
ru prune # Preview
ru prune --delete # Actually remove
ru prune --archive # Move to archive directory
```
### Diagnostics
```bash
ru doctor # System health check
ru self-update # Update ru itself
```
## AI-Assisted Review System
RU includes a powerful review orchestration system for managing AI-assisted code review across your repositories.
### Two-Phase Review Workflow
**Phase 1: Discovery (`--plan`)**
- Queries GitHub for open issues and PRs across all repos
- Scores items by priority using label analysis and age
- Creates isolated git worktrees for safe review
- Spawns Claude Code sessions in terminal multiplexer
**Phase 2: Application (`--apply`)**
- Reviews proposed changes from discovery phase
- Runs quality gates (ShellCheck, tests, lint)
- Optionally pushes approved changes (`--push`)
```bash
# Discover and plan reviews
ru review --plan
# After reviewing AI suggestions
ru review --apply --push
```
### Priority Scoring Algorithm
| Factor | Points | Logic |
|--------|--------|-------|
| **Type** | 0-20 | PRs: +20, Issues: +10, Draft PRs: -15 |
| **Labels** | 0-50 | security/critical: +50, bug/urgent: +30 |
| **Age (bugs)** | 0-50 | >60 days: +50, >30 days: +30 |
| **Recency** | 0-15 | Updated <3 days: +15, <7 days: +10 |
| **Staleness** | -20 | Recently reviewed: -20 |
Priority levels: CRITICAL (≥150), HIGH (≥100), NORMAL (≥50), LOW (<50)
### Session Drivers
| Driver | Description | Best For |
|--------|-------------|----------|
| `auto` | Auto-detect best available | Default |
| `ntm` | Named Tmux Manager integration | Multi-agent workflows |
| `local` | Direct tmux sessions | Simple setups |
```bash
ru review --mode=ntm --plan
ru review -j 4 --plan # Parallel sessions
```
### Cost Budgets
```bash
ru review --max-repos=10 --plan
ru review --max-runtime=30 --plan # Minutes
ru review --skip-days=14 --plan # Skip recently reviewed
ru review --analytics # View past review stats
```
## Agent Sweep (Automated Dirty Repo Processing)
The `ru agent-sweep` command orchestrates AI coding agents to automatically process repositories with uncommitted changes.
### Basic Usage
```bash
# Process all repos with uncommitted changes
ru agent-sweep
# Dry run - preview what would be processed
ru agent-sweep --dry-run
# Process 4 repos in parallel
ru agent-sweep -j4
# Filter to specific repos
ru agent-sweep --repos="myproject*"
# Include release step after commit
ru agent-sweep --with-release
# Resume interrupted sweep
ru agent-sweep --resume
# Start fresh
ru agent-sweep --restart
```
### Three-Phase Agent Workflow
**Phase 1: Planning** (`--phase1-timeout`, default 300s)
- Claude Code analyzes uncommitted changes
- Determines which files should be staged (respecting denylist)
- Generates structured commit message
**Phase 2: Commit** (`--phase2-timeout`, default 600s)
- Validates the plan (file existence, denylist compliance)
- Stages approved files, creates commit
- Runs quality gates
- Optionally pushes to remote
**Phase 3: Release** (`--phase3-timeout`, default 300s, requires `--with-release`)
- Analyzes commit history since last tag
- Determines version bump (patch/minor/major)
- Creates git tag and optionally GitHub release
### Execution Modes
```bash
--execution-mode=agent # Full AI-driven workflow (default)
--execution-mode=plan # Phase 1 only: generate plan, stop
--execution-mode=apply # Phase 2+3: execute existing plan
```
### Preflight Checks
Each repo is validated before spawning an agent:
| Check | Skip Reason |
|-------|-------------|
| Is git repository | `not_a_git_repo` |
| Git email configured | `git_email_not_configured` |
| Not a shallow clone | `shallow_clone` |
| No rebase in progress | `rebase_in_progress` |
| No merge in progress | `merge_in_progress` |
| Not detached HEAD | `detached_HEAD` |
| Has upstream branch | `no_upstream_branch` |
| Not diverged | `diverged_from_upstream` |
### Security Guardrails
**File Denylist** - Never committed regardless of agent output:
| Category | Patterns |
|----------|----------|
| **Secrets** | `.env`, `*.pem`, `*.key`, `id_rsa*`, `credentials.json` |
| **Build artifacts** | `node_modules`, `__pycache__`, `dist`, `build`, `target` |
| **Logs/temp** | `*.log`, `*.tmp`, `*.swp`, `.DS_Store` |
| **IDE files** | `.idea`, `.vscode`, `*.iml` |
**Secret Scanning:**
```bash
--secret-scan=none # Disable
--secret-scan=warn # Warn but continue (default)
--secret-scan=block # Block push on detection
```
### Exit Codes
| Code | Meaning |
|------|---------|
| `0` | All repos processed successfully |
| `1` | Some repos failed (agent error, timeout) |
| `2` | Quality gate failures (secrets, tests) |
| `3` | System error (ntm, tmux missing) |
| `4` | Invalid arguments |
| `5` | Interrupted (use `--resume`) |
## Configuration
### XDG-Compliant Directory Structure
```
~/.config/ru/
├── config # Main config file
└── repos.d/
├── public.list # Public repos (one per line)
└── private.list # Private repos (gitignored)
~/.local/state/ru/
├── logs/
│ └── YYYY-MM-DD/
├── agent-sweep/
│ ├── state.json
│ └── results.ndjson
└── review/
├── digests/
└── results/
```
### Repo List Format
```
# ~/.config/ru/repos.d/public.list
owner/repo
another-owner/another-repo@develop
private-org/repo@main as local-name
https://github.com/owner/repo.git
```
### Layout Modes
| Layout | Example Path |
|--------|--------------|
| `flat` | `/data/projects/repo` |
| `owner-repo` | `/data/projects/owner_repo` |
| `full` | `/data/projects/github.com/owner/repo` |
```bash
ru config --set LAYOUT=owner-repo
```
### Per-Repo Configuration
```yaml
# ~/.../your-repo/.ru-agent.yml
agent_sweep:
enabled: true
max_file_size: 5242880 Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.