agentleFS
jnurre64jnurre64/sandbox-pal-action/.claude/skills/setup/SKILL.md

setup

Skill2 starsChanged 3 months agoMITView on GitHub

Configure the Claude agent dispatch system for a new project. Use when setting up for the first time or reconfiguring.

  • Reads credentials

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-slack, add-parallel and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    add-slack

    Add Slack channel integration via Chat SDK.

    Also in 6 projects that use this

  • MicrosoftSkill

    add-parallel

    Also in 5 projects that use this

  • sskarzSkill

    add-telegram-swarm

    Add Agent Swarm (Teams) support to Telegram. Each subagent gets its own bot identity in the group. Requires Telegram channel to be set up first (use /add-telegram). Triggers on "agent swarm", "agent teams telegram", "telegram swarm", "bot pool".

    Also in 5 projects that use this

  • +9 more from microsoft

The file

Show its rules and text

We split this skill into the rules it gives an agent

33 rules. 0 are common, 18 are distinctive, and 15 are very specific to this project.

  • 0

    Common

    Most of the 171 edited versions we read keep these.

  • 18

    Distinctive

    This author's own choices. Worth a look.

  • 15

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before starting, run the prerequisites check:

    line 14
  2. Very specific:

    If any required tools are missing, help the user install them before continuing.

    line 20
  3. Very specific:

    Use the AskUserQuestion tool to ask the user which mode they prefer:

    line 24
  4. Very specific:

    All scripts, prompts, config, and workflows are copied directly into the user's repo under .sandbox-pal-dispatch/

    line 27
  5. Distinctive:

    No upstream dependency — the user owns every file and can modify freely

    line 28
  6. Distinctive:

    No automatic updates — the user manages their own copy

    line 29
  7. Very specific:

    Use the AskUserQuestion tool to collect the following.

    line 40
  8. Very specific:

    Create the .sandbox-pal-dispatch/ directory in the user's target repo.

    line 55
  9. Distinctive:

    Do they want to customize any prompts now, or start with defaults and customize later?

    line 111
  10. Distinctive:

    Run the label creation script against their target repo:

    line 118
  11. Very specific:

    Read each template in this skill's templates/ directory (the caller-*.yml files, NOT the standalone/ subdirectory):

    line 129
  12. Very specific:

    Read each template in templates/standalone/:

    line 133
  13. Very specific:

    Write it to the user's target repo at .github/workflows/

    line 139
  14. Distinctive:

    Ask the user where their target repo is cloned locally so you can write the files there.

    line 141
  15. Very specific:

    If any automation will trigger the agent while authenticated as the bot account -- the Discord bot (see docs/notifications.md), an …

    line 145
  16. Distinctive:

    If the user hasn't created a bot account or PAT yet, walk them through:

    line 168
  17. Distinctive:

    Create a new GitHub account for the bot

    line 169
  18. Distinctive:

    Create a fine-grained PAT with scopes: Contents (rw), Issues (rw), Pull requests (rw), Metadata (r)

    line 170
  19. Distinctive:

    Add the bot as a collaborator on their target repo

    line 171
  20. Distinctive:

    Ask the user if they already have a self-hosted runner configured for this repo.

    line 185
  21. Distinctive:

    Ask: Is the target repo under a personal account or an organization?

    line 189
  22. Very specific:

    Personal account repo: Only repo-level registration is available (GitHub does not support user-level runners).

    line 192
  23. Distinctive:

    Check if the user already has runner directories on the machine:

    line 206
  24. Distinctive:

    If found, offer to reuse the binary — they only need a new directory and registration.

    line 210
  25. Very specific:

    If the user chose a method that uses environment variables, the runner's .env file (in the runner installation directory, not ~/.bashrc — …

    line 233
  26. Very specific:

    Verification: After the runner service is restarted in Step 9f, have the user run claude /status on the runner (as the runner user).

    line 235
  27. Distinctive:

    Check that the required tools are available:

    line 252
  28. Distinctive:

    If any are missing, help the user install them.

    line 258
  29. Distinctive:

    Reference mode: Commit and push the workflow files to the target repo

    line 291
  30. Very specific:

    Standalone mode: Commit and push .sandbox-pal-dispatch/ and .github/workflows/ to the target repo

    line 292
  31. Very specific:

    Create a test issue on the target repo and add the agent label.

    line 296
  32. Distinctive:

    If any step was skipped, list it with instructions for completing it later.

    line 309
  33. Very specific:

    Do not copy the example over an active agent-profiles.json, replace saved .agent-profile selection, or enable AGENT_ENGINE_PROFILES during …

    line 315

“Common” is measured: kept by at least 6 in 10 of the 171 edited versions of this file we could read. “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

Setup: Configure Agent Dispatch for a Project

Walk the user through configuring the agent dispatch system for their GitHub repository.

Prerequisites

Before starting, run the prerequisites check:

bash ${CLAUDE_SKILL_DIR}/../../scripts/check-prereqs.sh

If any required tools are missing, help the user install them before continuing. If config.env doesn't exist yet, that's expected — we'll create it in this flow.

Step 1: Choose Setup Mode

Use the AskUserQuestion tool to ask the user which mode they prefer:

Standalone mode (recommended):

  • All scripts, prompts, config, and workflows are copied directly into the user's repo under .sandbox-pal-dispatch/
  • No upstream dependency — the user owns every file and can modify freely
  • No automatic updates — the user manages their own copy
  • Best for: most users, full control, easy to customize, no external dependencies

Reference mode:

  • Thin workflow files in the user's repo call back to this upstream repo via uses: jnurre64/sandbox-pal-action/...@v1
  • Scripts run from a clone of this repo on the runner (~/agent-infra/)
  • Updates come automatically via version tags and git pull
  • Best for: users who want automatic updates and minimal files in their repo

Step 2: Gather Project Information

Use the AskUserQuestion tool to collect the following. If the user provided an owner/repo argument, use that instead of asking.

  1. Target repository (owner/repo format) — the repo where the agent will work on issues
  2. Bot account username — the GitHub account that will comment, push, and create PRs (recommend a dedicated bot account, not their personal account)
  3. Default branch — usually main, but confirm
  4. Test command (optional) — command to run before creating PRs (e.g., npm test, pytest, cargo test). If not set, the pre-PR test gate is skipped.
  5. Extra tools (optional) — project-specific tools the agent needs (e.g., Bash(npm:*) for Node.js, Bash(cargo:*) for Rust, Bash(Godot:*) for Godot)
  6. Local clone path (standalone mode only) — where the target repo is cloned on this machine

Step 3: Generate Configuration

Reference mode

Read the template at config.defaults.env.example (in the repo root). Fill in the user's answers and write to config.env in the repo root (reference mode uses a single file since it's not committed to a repo). Show the user the generated config and ask if they want to adjust anything.

Standalone mode

Create the .sandbox-pal-dispatch/ directory in the user's target repo. Copy:

  • scripts/sandbox-pal-dispatch.sh and scripts/cleanup.sh → .sandbox-pal-dispatch/scripts/
  • scripts/lib/*.sh → .sandbox-pal-dispatch/scripts/lib/
  • scripts/check-prereqs.sh and scripts/create-labels.sh → .sandbox-pal-dispatch/scripts/
  • prompts/*.md → .sandbox-pal-dispatch/prompts/
  • labels.txt → .sandbox-pal-dispatch/
  • Generated config.defaults.env → .sandbox-pal-dispatch/config.defaults.env (non-sensitive project config, committed)

Important: Configuration uses a layered approach:

  • config.defaults.env — committed to the repo. Contains non-sensitive project config (bot username, timeouts, tool permissions, test commands). This file MUST NOT contain secrets, tokens, or credentials.
  • config.env — gitignored, optional. Contains sensitive overrides (Discord tokens, webhook URLs, GitHub tokens). Values here override config.defaults.env.
  • Environment variables — highest precedence, override both files.

Critical: emit every assignment using the ${VAR:-default} form. The dispatch script sources config.defaults.env after the workflow's env: block has already set variables, so plain assignments (AGENT_NOTIFY_BACKEND="bot") silently overwrite workflow overrides. The conditional-assign pattern preserves them:

# ✗ wrong — overwrites workflow env: and config.env
AGENT_NOTIFY_BACKEND="bot"

# ✓ right — defers to any pre-set value
AGENT_NOTIFY_BACKEND="${AGENT_NOTIFY_BACKEND:-bot}"

Copy values from the config.defaults.env.example template (which already uses this pattern) and substitute the user's answers into the default slot only.

Migration note for existing consumers: a consumer repo that was generated by an older version of /setup may still have plain assignments. It's safe to rewrite each assignment into the ${VAR:-…} form — there is no behavior change when no workflow override is set. Offer this rewrite only if the user is running /setup against a pre-existing .sandbox-pal-dispatch/config.defaults.env; leave other customizations untouched.

Make all scripts executable after copying.

Gitignore check: Many .gitignore templates (e.g., VisualStudio, Node) include *.env which will block config.defaults.env from being committed. After copying files, check if the target repo's .gitignore excludes *.env. If so, add an exception:

!.sandbox-pal-dispatch/config.defaults.env

Warn the user about this and make the change for them.

Step 4: Review Default Prompts

Show the user the default prompts in prompts/ (repo root). Explain what each one does:

  • triage.md — How the agent investigates issues and writes plans
  • implement.md — How the agent implements approved plans with TDD
  • reply.md — How the agent evaluates human replies to its questions
  • review.md — How the agent addresses PR review feedback

Ask the user:

  • What test framework does their project use? The implement and review prompts reference $AGENT_TEST_COMMAND which they set in Step 2.
  • Does their project have a CLAUDE.md? The prompts instruct the agent to read it. If not, recommend creating one with coding conventions and architecture overview.
  • Do they want to customize any prompts now, or start with defaults and customize later?

For standalone mode: customizations are made directly in .sandbox-pal-dispatch/prompts/. For reference mode: customizations go in separate files pointed to by AGENT_PROMPT_* in config.env.

Step 5: Create Labels

Run the label creation script against their target repo:

bash ${CLAUDE_SKILL_DIR}/../../scripts/create-labels.sh OWNER/REPO

Replace OWNER/REPO with the actual value from Step 2. Confirm the labels were created successfully.

Step 6: Generate Workflows

Reference mode

Read each template in this skill's templates/ directory (the caller-*.yml files, NOT the standalone/ subdirectory):

  • caller-triage.yml, caller-implement.yml, caller-reply.yml, caller-review.yml, caller-cleanup.yml

Standalone mode

Read each template in templates/standalone/:

  • sandbox-pal-triage.yml, sandbox-pal-implement.yml, sandbox-pal-reply.yml, sandbox-pal-review.yml, sandbox-pal-cleanup.yml

For each template:

  1. Replace {{BOT_USER}} with the bot username from Step 2
  2. Show the user the generated workflow
  3. Write it to the user's target repo at .github/workflows/

Ask the user where their target repo is cloned locally so you can write the files there. For standalone mode, this was already collected in Step 2.

Programmatic dispatch (optional)

If any automation will trigger the agent while authenticated as the bot account -- the Discord bot (see docs/notifications.md), an orchestrator session, or scripts using the bot PAT -- also deploy the dispatch template:

  • Reference mode: caller-dispatch.yml
  • Standalone mode: sandbox-pal-dispatch.yml (from templates/standalone/)

This "Agent Dispatch (programmatic)" workflow is the official programmatic on-ramp: repository_dispatch with event types agent-triage, agent-implement, and agent-reply. Label events applied by the bot account are filtered by the anti-self-trigger guard, so bot-driven automation must use this path. The Discord bot's Approve, Retry, Comment, and Request Changes actions are one caller of it. See docs/architecture.md, "Programmatic Triggering (repository_dispatch)".

Step 7: Guide Secret Setup

The target repo needs these GitHub Actions secrets:

  • AGENT_PAT — Fine-grained PAT for the bot account (required)
  • AGENT_GIST_PAT — Classic PAT with gist scope for the cleanup workflow (optional)

Walk the user through setting them:

# Set the bot's PAT (this will prompt securely)
gh secret set AGENT_PAT --repo OWNER/REPO

# Optional: set gist PAT for cleanup
gh secret set AGENT_GIST_PAT --repo OWNER/REPO

If the user hasn't created a bot account or PAT yet, walk them through:

  1. Create a new GitHub account for the bot
  2. Create a fine-grained PAT with scopes: Contents (rw), Issues (rw), Pull requests (rw), Metadata (r)
  3. Add the bot as a collaborator on their target repo

Step 8: Validate

Summarize everything that was set up:

  • Setup mode chosen (reference vs standalone)
  • Config file location
  • Labels created
  • Workflow files generated and where they were written
  • Secrets that need to be set (if not done in Step 7)
  • For standalone: list of files copied to .sandbox-pal-dispatch/

Step 9: Self-Hosted Runner Setup

Ask the user if they already have a self-hosted runner configured for this repo. If yes, skip to Step 9e (verify prerequisites). If no, walk them through the full setup.

Step 9a: Determine runner scope

Ask: Is the target repo under a personal account or an organization?

  • Organization repo: Recommend org-level runner registration. One runner serves all org repos. Token source: https://github.com/organizations/<org>/settings/actions/runners/new
  • Personal account repo: Only repo-level registration is available (GitHub does not support user-level runners). Token source: https://github.com/<owner>/<repo>/settings/actions/runners/new

If the repo is public, display this warning:

⚠️ Security risk: GitHub warns against using self-hosted runners on public repositories. Anyone who forks the repo and opens a PR can potentially execute code on your runner, accessing environment variables, API keys, and the filesystem. Consider making the repo private, or review the hardening steps in docs/security.md.

Step 9b: Download and extract the runner

Direct the user to the GitHub UI page for their scope (org or repo). The page shows the correct download URL and checksum for their platform. Tell them to follow the download and extraction steps shown there.

Suggest a directory naming convention:

  • ~/actions-runner-<repo-name>/ for single-repo setups
  • ~/actions-runner-<org>-agent/ for org-level setups

Check if the user already has runner directories on the machine:

ls -d ~/actions-runner-* 2>/dev/null

If found, offer to reuse the binary — they only need a new directory and registration.

Step 9c: Register the runner

The user must get a registration token from the GitHub UI (it expires in 1 hour). Tell them to navigate to the URL from Step 9a, copy the token, and then run:

./config.sh \
  --url https://github.com/<owner-or-org> \
  --token <TOKEN_FROM_GITHUB_UI> \
  --name <descriptive-name> \
  --labels self-hosted,agent \
  --work _work

The --labels self-hosted,agent is required — the dispatch workflows use runs-on: [self-hosted, agent].

Since this requires a token the user must paste, tell them to run the command themselves. In Claude Code, they can use ! ./config.sh ... to run it in the session.

Step 9d: Configure credentials

The Claude Code CLI needs to be authenticated on the runner. The dispatch scripts do not prescribe a method — point the user to Anthropic's Claude Code authentication docs for the available options, or authentication.md for the project's summary and Terms-of-Service pointers.

If the user chose a method that uses environment variables, the runner's .env file (in the runner installation directory, not ~/.bashrc — systemd services do not source shell profiles) is the right place to set them. Any .env holding credentials must be chmod 600.

Verification: After the runner service is restarted in Step 9f, have the user run claude /status on the runner (as the runner user). It should report that the runner is authenticated with the expected account.

Node/Claude path — If using nvm, the claude binary won't be in PATH for systemd services. Add the path to .env:

echo "PATH=$HOME/.nvm/versions/node/$(node -v)/bin:$PATH" >> .env

Git identity — Configure git for the bot account:

git config --global user.name "<bot-username>"
git config --global user.email "<bot-username>@users.noreply.github.com"

Step 9e: Verify prerequisites

Check that the required tools are available:

claude --version && gh --version && git --version && jq --version && echo "All tools found"

If any are missing, help the user install them. See docs/runners.md for the full list.

Step 9f: Install systemd service

sudo ./svc.sh install $(whoami)
sudo ./svc.sh start
sudo ./svc.sh status

The service name follows the pattern actions.runner.<org-or-owner>.<runner-name>.service.

Step 9g: Verify in GitHub UI

Direct the user to check that the runner appears in the GitHub UI:

  • Org: https://github.com/organizations/<org>/settings/actions/runners
  • Repo: https://github.com/<owner>/<repo>/settings/actions/runners

It should show as Idle with the labels self-hosted and agent.

Step 9h: Reference mode only — clone upstream and copy config

For reference mode, the dispatch scripts run from a clone of this repo on the runner:

git clone https://github.com/jnurre64/sandbox-pal-action.git ~/agent-infra
cp <path-to-config.env> ~/agent-infra/config.env

Step 10: Test and Finish

Commit and push

  • Reference mode: Commit and push the workflow files to the target repo
  • Standalone mode: Commit and push .sandbox-pal-dispatch/ and .github/workflows/ to the target repo

Dry run

Create a test issue on the target repo and add the agent label. Watch the agent triage it, write a plan, and wait for approval.

Summary

Summarize everything that was set up:

  • Setup mode (reference or standalone)
  • Config file locations
  • Labels created
  • Workflows generated
  • Secrets configured
  • Runner registered and running
  • For standalone: list of files in .sandbox-pal-dispatch/

If any step was skipped, list it with instructions for completing it later. Reference docs/runners.md for the full runner documentation.

Named dispatch profile assets

The shared installation inventory delivers and checksums agent-profiles.example.json, scripts/agent-profile.sh and its library modules. Do not copy the example over an active agent-profiles.json, replace saved .agent-profile selection, or enable AGENT_ENGINE_PROFILES during setup/update. Preserve existing project configuration on repeated setup. Add .agent-profile (or the configured selection path) and the catalog capture lock directory to the consuming project's ignore rules. For explicit adoption, follow docs/configuration.md → “Named dispatch profiles”: migrate legacy Codex settings, capture actual legacy routing, preview, then select a profile.

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.