agentleFS
OpenRouterTeamOpenRouterTeam/spawn/.claude/skills/update-team/SKILL.md

update-team

Skill251 starsChanged 5 months agoApache-2.0View on GitHub

Update agent team services with latest configuration from setup-agent-team and restart them

  • Sends data out

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 1

    1. OpenRouterLabs/spawn★ 251100% same

    Edited · 0

    None found.

    Wrote their own version · 1

    1. BerriAI/litellm-skills★ 84same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository9 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Update the trigger server and wrapper scripts with the latest configuration from .claude/skills/setup-agent-team/SKILL.md, then restart the …

    line 10
  2. Very specific:

    Read the SKILL.md to check for:

    line 59
  3. Very specific:

    If --check-only is NOT passed and issues were found:

    line 162
  4. Distinctive:

    If systemd service files need updates:

    line 200
  5. Very specific:

    If changes were made (and not --check-only):

    line 227
  6. Distinctive:

    If health check fails:

    line 251
  7. Distinctive:

    If all services are healthy:

    line 275
  8. Distinctive:

    If there were issues:

    line 281
  9. Very specific:

    Test the trigger endpoint: after restart: curl -X POST http://localhost:8080/trigger -H "Authorization: Bearer $SECRET"

    line 303
  10. Distinctive:

    Check all services without making changes:

    line 308
  11. Distinctive:

    Update a specific service:

    line 314

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Update Agent Team Services

Update the trigger server and wrapper scripts with the latest configuration from .claude/skills/setup-agent-team/SKILL.md, then restart the services to apply changes.

Arguments

  • service-name (optional) — Update only this service (e.g., discovery, refactor, security, qa). If omitted, updates all services.
  • --check-only — Show what would be updated without making changes or restarting services.

$ARGUMENTS

Overview

This skill:

  1. Reads the latest setup-agent-team SKILL.md for current best practices
  2. Identifies all deployed services by scanning for start-*.sh wrappers
  3. Updates wrapper scripts with correct env vars and paths
  4. Restarts systemd services to apply changes
  5. Verifies services are running and healthy

Step 1: Determine repository path

Detect the current repository path:

REPO_ROOT="$(cd /root/spawn 2>/dev/null && pwd || cd /home/sprite/spawn 2>/dev/null && pwd)"
echo "Repository root: $REPO_ROOT"

Determine home directory:

if [[ "$REPO_ROOT" == "/root/spawn" ]]; then
    HOME_DIR="/root"
    SERVICE_USER="root"
    SERVICE_GROUP="root"
elif [[ "$REPO_ROOT" == "/home/sprite/spawn" ]]; then
    HOME_DIR="/home/sprite"
    SERVICE_USER="sprite"
    SERVICE_GROUP="sprite"
else
    echo "ERROR: Unknown repository path: $REPO_ROOT"
    exit 1
fi

echo "Home directory: $HOME_DIR"
echo "Service user/group: $SERVICE_USER/$SERVICE_GROUP"

Step 2: Read latest setup-agent-team instructions

Read the SKILL.md to check for:

  • Latest env var requirements
  • Recommended timeout values
  • New mandatory settings
  • Path patterns
cat "$REPO_ROOT/.claude/skills/setup-agent-team/SKILL.md"

Key things to extract from SKILL.md:

  • Required env vars: TRIGGER_SECRET, TARGET_SCRIPT, REPO_ROOT, CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS, MAX_CONCURRENT, RUN_TIMEOUT_MS
  • Recommended RUN_TIMEOUT_MS values per service
  • Path templates for systemd service files

Step 3: Identify deployed services

Find all wrapper scripts:

ls -1 "$REPO_ROOT/.claude/skills/setup-agent-team/start-"*.sh 2>/dev/null | while read -r wrapper; do
    basename "$wrapper" | sed 's/^start-//;s/\.sh$//'
done

For each service found, check if it has a corresponding systemd unit:

systemctl list-units --all --type=service --plain --no-legend | grep -E 'discovery-trigger|refactor|spawn-security|spawn-qa' | awk '{print $1}'

Match wrappers to systemd units:

  • start-discovery.sh → discovery-trigger.service
  • start-refactor.sh → refactor.service
  • start-security.sh → spawn-security.service
  • start-qa.sh → spawn-qa.service (if exists)

Step 4: Check wrapper script compliance

For each wrapper script, verify it has:

Required env vars

# Check if wrapper has all required env vars
grep -q 'export TRIGGER_SECRET=' "$wrapper_path" || echo "MISSING: TRIGGER_SECRET"
grep -q 'export TARGET_SCRIPT=' "$wrapper_path" || echo "MISSING: TARGET_SCRIPT"
grep -q 'export REPO_ROOT=' "$wrapper_path" || echo "MISSING: REPO_ROOT"
grep -q 'export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1' "$wrapper_path" || echo "MISSING: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS"
grep -q 'export MAX_CONCURRENT=' "$wrapper_path" || echo "MISSING: MAX_CONCURRENT"
grep -q 'export RUN_TIMEOUT_MS=' "$wrapper_path" || echo "MISSING: RUN_TIMEOUT_MS"

Correct paths

# Extract SCRIPT_DIR from wrapper
SCRIPT_DIR=$(grep '^SCRIPT_DIR=' "$wrapper_path" | cut -d'"' -f2)

# Verify it matches REPO_ROOT
if [[ "$SCRIPT_DIR" != "$REPO_ROOT/.claude/skills/setup-agent-team" ]]; then
    echo "WARNING: SCRIPT_DIR mismatch"
    echo "  Found: $SCRIPT_DIR"
    echo "  Expected: $REPO_ROOT/.claude/skills/setup-agent-team"
fi

Exec pattern

# Verify it uses exec bun run
grep -q 'exec bun run "${SCRIPT_DIR}/trigger-server.ts"' "$wrapper_path" || echo "WARNING: Non-standard exec pattern"

Step 5: Check systemd service compliance

For each systemd service file at /etc/systemd/system/<service-name>.service:

Required fields

# Check critical fields
grep -q "^User=$SERVICE_USER$" "$service_file" || echo "MISSING/WRONG: User"
grep -q "^Group=$SERVICE_GROUP$" "$service_file" || echo "MISSING/WRONG: Group"
grep -q "^WorkingDirectory=$REPO_ROOT/.claude/skills/setup-agent-team$" "$service_file" || echo "MISSING/WRONG: WorkingDirectory"
grep -q "^ExecStart=/bin/bash $REPO_ROOT/.claude/skills/setup-agent-team/start-" "$service_file" || echo "MISSING/WRONG: ExecStart"

Environment variables

# Check PATH includes correct home directory
grep "^Environment=\"PATH=$HOME_DIR/.bun/bin:$HOME_DIR/.local/bin:" "$service_file" || echo "WARNING: PATH may be incorrect"

# Check HOME is set
grep "^Environment=\"HOME=$HOME_DIR\"$" "$service_file" || echo "MISSING/WRONG: HOME"

# Check IS_SANDBOX
grep -q '^Environment="IS_SANDBOX=1"' "$service_file" || echo "MISSING: IS_SANDBOX"

Step 6: Update wrapper scripts (if needed)

If --check-only is NOT passed and issues were found:

For path mismatches, update SCRIPT_DIR:

# This requires preserving the TRIGGER_SECRET value
# Read current secret
CURRENT_SECRET=$(grep '^export TRIGGER_SECRET=' "$wrapper_path" | cut -d'"' -f2)

# Update SCRIPT_DIR line
sed -i "s|^SCRIPT_DIR=.*|SCRIPT_DIR=\"$REPO_ROOT/.claude/skills/setup-agent-team\"|" "$wrapper_path"

# Update REPO_ROOT line
sed -i "s|^export REPO_ROOT=.*|export REPO_ROOT=\"$REPO_ROOT\"|" "$wrapper_path"

For missing env vars, add them:

# Add CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS if missing
if ! grep -q 'CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS' "$wrapper_path"; then
    # Insert before exec line
    sed -i '/^exec bun run/i export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1' "$wrapper_path"
fi

# Add MAX_CONCURRENT if missing (default: 5)
if ! grep -q 'MAX_CONCURRENT' "$wrapper_path"; then
    sed -i '/^exec bun run/i export MAX_CONCURRENT=5' "$wrapper_path"
fi

# Add RUN_TIMEOUT_MS if missing (default: 4 hours)
if ! grep -q 'RUN_TIMEOUT_MS' "$wrapper_path"; then
    sed -i '/^exec bun run/i export RUN_TIMEOUT_MS=14400000' "$wrapper_path"
fi

Step 7: Update systemd service files (if needed)

If systemd service files need updates:

IMPORTANT: Changes to systemd service files require sudo and a daemon-reload.

# Update User/Group
sudo sed -i "s/^User=.*/User=$SERVICE_USER/" "$service_file"
sudo sed -i "s/^Group=.*/Group=$SERVICE_GROUP/" "$service_file"

# Update WorkingDirectory
sudo sed -i "s|^WorkingDirectory=.*|WorkingDirectory=$REPO_ROOT/.claude/skills/setup-agent-team|" "$service_file"

# Update ExecStart
sudo sed -i "s|^ExecStart=.*|ExecStart=/bin/bash $REPO_ROOT/.claude/skills/setup-agent-team/start-$service_name.sh|" "$service_file"

# Update PATH
sudo sed -i "s|^Environment=\"PATH=.*|Environment=\"PATH=$HOME_DIR/.bun/bin:$HOME_DIR/.local/bin:$HOME_DIR/.claude/local/bin:/usr/local/bin:/usr/bin:/bin\"|" "$service_file"

# Update HOME
sudo sed -i "s|^Environment=\"HOME=.*|Environment=\"HOME=$HOME_DIR\"|" "$service_file"

# Reload systemd
sudo systemctl daemon-reload

Step 8: Restart services

If changes were made (and not --check-only):

# Restart each updated service
sudo systemctl restart "$service_name"

# Wait a moment for startup
sleep 2

# Check status
sudo systemctl status "$service_name" --no-pager

Step 9: Verify health

For each service, test the health endpoint:

# Test health endpoint (should return 200 OK)
curl -sf http://localhost:8080/health || echo "ERROR: Health check failed for $service_name"

# Expected output: {"status":"ok","running":N,"max":N,...}

If health check fails:

# Check recent logs
sudo journalctl -u "$service_name" -n 20 --no-pager

Step 10: Summary

Print a summary:

echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Update Summary"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Repository: $REPO_ROOT"
echo "Home: $HOME_DIR"
echo "Services checked: $total_services"
echo "Services updated: $updated_count"
echo "Services restarted: $restarted_count"
echo "Services healthy: $healthy_count"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

If all services are healthy:

✅ All services are up to date and running

If there were issues:

⚠️  Some services may need attention - check logs above

Common Issues

IssueFix
EADDRINUSE on restartAnother service already using port 8080 — check with fuser -k 8080/tcp
Permission deniedSystemd files need sudo: sudo systemctl restart <service>
Health check failsCheck logs: sudo journalctl -u <service> -n 50
Wrapper not executablechmod +x .claude/skills/setup-agent-team/start-*.sh
PATH incorrectUpdate systemd service Environment="PATH=..." to match home dir
Service won't start after updateCheck systemctl status <service> for detailed error

Best Practices

  • Always run with --check-only first to see what would change before applying updates
  • Restart services during low-activity periods to avoid interrupting ongoing cycles
  • Check logs after restart to ensure services started cleanly
  • Test the trigger endpoint after restart: curl -X POST http://localhost:8080/trigger -H "Authorization: Bearer $SECRET"
  • Never commit wrapper scripts — they contain secrets and are in .gitignore

Example Usage

Check all services without making changes:

claude /update-team --check-only

Update a specific service:

claude /update-team discovery

Update all services:

claude /update-team

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.