From gastown-rig-setup
Sets up a new Git repository as a Gas Town rig with Dolt-native beads by seeding .beads/ directory, cloning repo, committing changes, adding via gt CLI, and initializing Dolt database.
npx claudepluginhub xexr/marketplace --plugin gastown-rig-setupThis skill uses the workspace's default tool permissions.
Add a Git repository as a Gas Town rig with Dolt-native beads integration. The process requires seeding `.beads/` in the upstream repo first, then adding the rig, initializing Dolt, and configuring remotes.
Orchestrates multi-agent AI teams for coding projects via gt/bd CLI, managing workspaces, work tracking with beads/convoys, slinging tasks, agent lifecycles, and crash recovery.
Initializes Flow in repos: detects root, sets up .agents/, checks/installs Beads (bd), configures local-only sync policy, creates context files, validates setup.
Creates fix/feature branches from upstream/main for beads/gastown forks: selects bead via bd, implements changes, submits upstream PR, cherry-picks to fork.
Share bugs, ideas, or general feedback.
Add a Git repository as a Gas Town rig with Dolt-native beads integration. The process requires seeding .beads/ in the upstream repo first, then adding the rig, initializing Dolt, and configuring remotes.
Why seed .beads/ first? gt rig add behaves differently depending on whether the cloned repo has a tracked .beads/ directory. Seeding ensures the correct code path runs. See "Why Seeding Matters" below for the technical details.
beads-setup skill)Before starting, confirm with the user:
toolkit not gt-toolkit.tk. Must not conflict with existing prefixes in ~/gt/.beads/routes.jsonl.git@github.com:Org/repo.git) or HTTPS (https://github.com/Org/repo.git). Both work with gt rig add.Check existing prefixes:
cat ~/gt/.beads/routes.jsonl
cd ~/projects && git clone <SSH_URL> <repo-dir-name>
Create four files using an existing rig as template (e.g., ~/projects/onyx/.beads/):
.beads/.gitignore — Copy from template rig verbatim.
.beads/config.yaml:
sync.mode: "dolt-native"
.beads/metadata.json — Set dolt_database to the rig name:
{
"backend": "dolt",
"database": "dolt",
"dolt_database": "<RIG_NAME>",
"dolt_mode": "server",
"dolt_server_port": 3307
}
.beads/README.md — Copy from template rig verbatim.
cd ~/projects/<repo-dir>
git add .beads/
git commit -m "feat: add minimal .beads/ for Gastown rig integration"
git push
gt rig add <RIG_NAME> <SSH_URL> --prefix <PREFIX>
This creates ~/gt/<RIG_NAME>/ with the full rig structure (mayor/rig, crew/, refinery/, witness/, polecats/).
gt dolt init-rig <RIG_NAME>
Creates ~/gt/.dolt-data/<RIG_NAME>/.
gt dolt stop && gt dolt start
Verify the new database appears:
gt dolt list
STOP if the rig database doesn't appear. Investigate before proceeding.
mkdir -p ~/dolt-remotes/<RIG_NAME>
cd ~/gt/.dolt-data/<RIG_NAME> && dolt remote add origin file:///home/xexr/dolt-remotes/<RIG_NAME>
cd ~/gt/.dolt-data/<RIG_NAME> && dolt push origin main
Check these files have correct values:
| File | Key fields |
|---|---|
~/gt/<RIG_NAME>/config.json | git_url, prefix |
~/gt/<RIG_NAME>/.beads/redirect | Points to mayor/rig/.beads |
~/gt/<RIG_NAME>/mayor/rig/.beads/metadata.json | dolt_database: "<RIG_NAME>", dolt_mode: "server", dolt_server_port: 3307 |
cd ~/gt/<RIG_NAME>/mayor/rig && bd doctor
gt doctor
Investigate and fix any issues before declaring complete.
Known false positive: bd doctor reports ✖ Database: No dolt database found in server mode. This is cosmetic — it checks for a local .beads/dolt/ directory which doesn't exist when using the centralized Dolt server at .dolt-data/. Verify actual connectivity with bd list instead; if that returns results, the database is working.
[ ] gt rig list — shows new rig
[ ] gt dolt list — shows new database
[ ] bd list — returns results (from within rig's mayor/rig/)
[ ] gt doctor — passes (marketplace-related checks)
[ ] ~/dolt-remotes/<RIG_NAME>/ — has data after push
[ ] cat ~/gt/.dolt-data/<RIG_NAME>/.dolt/repo_state.json — shows origin remote
| Mistake | Fix |
|---|---|
Hyphen in rig name (gt-toolkit) | Use single word (toolkit). Hyphens require SQL backtick quoting everywhere. |
Skipping .beads/ seeding | Without seeding, bd init writes dolt_database: "beads_<prefix>" which mismatches the actual database name. See "Why Seeding Matters". |
| Forgetting to restart Dolt | New database won't be visible until gt dolt stop && gt dolt start. |
| Prefix conflicts | Check routes.jsonl before choosing. Conflicts cause routing errors. |
Not pushing .beads/ before gt rig add | The clones created by gt rig add pull from remote. If .beads/ isn't pushed, they won't have it. |
Treating bd doctor "No dolt database found" as real | False positive in server mode — checks for local .beads/dolt/ not the centralized server. Use bd list to verify connectivity instead. |
gt rig add (internal/rig/manager.go:AddRig) takes two different code paths depending on whether the cloned repo has a tracked .beads/ directory. The unseeded path has a database naming bug that breaks Dolt connectivity.
When .beads/ is NOT in the repo, the following sequence creates a name mismatch:
doltserver.InitRig(townRoot, "toolkit") at manager.go:485 creates a Dolt database named toolkitInitBeads at manager.go:765 runs bd init --prefix tk --server (no existing .beads/ to redirect to)bd init at init.go:457 writes dolt_database: "beads_tk" to metadata.json — this is bd's own naming convention ("beads_" + prefix)EnsureMetadata at doltserver.go:1570 checks if dolt_database == nil || == "" — it's "beads_tk", so it does not overridemetadata.json says dolt_database: "beads_tk" but the actual database is "toolkit". bd cannot connect.When .beads/ IS in the repo (with the correct dolt_database: "<RIG_NAME>" in metadata.json):
mayor/rig/, the code detects .beads/ at manager.go:419doltserver.InitRig at manager.go:485 creates database "toolkit" and calls EnsureMetadata — which finds mayor/rig/.beads/metadata.json already has the correct dolt_database: "toolkit" and leaves it aloneInitBeads at manager.go:734 sees mayor/rig/.beads exists → creates a redirect file at <rig>/.beads/redirect → mayor/rig/.beads → returns early without running bd init (so the correct dolt_database is never overwritten)manager.go:644 sets the route path to <name>/mayor/rigEnsureMetadata at manager.go:503 confirms dolt_mode: "server", dolt_database: "toolkit" — all correctResult: mayor/rig/.beads/ is the canonical beads location (tracked in git). The rig-level .beads/redirect points all agents there. The database name matches. Config persists across clones.
Seeding .beads/ with the correct metadata.json is not just a preference — it's a workaround for a bug where bd init --server writes dolt_database: "beads_<prefix>" which conflicts with the centralized Dolt database named <rigName>. Without seeding, bd connects to a non-existent database.
# Full sequence for adding rig "myrig" with prefix "mr" from git@github.com:Org/repo.git
# 1. Clone and seed
cd ~/projects && git clone git@github.com:Org/repo.git repo-dir
# Create .beads/ files (see Step 2 above)
cd ~/projects/repo-dir && git add .beads/ && git commit -m "feat: add .beads/" && git push
# 2. Add rig + init dolt
gt rig add myrig git@github.com:Org/repo.git --prefix mr
gt dolt init-rig myrig
gt dolt stop && gt dolt start
gt dolt list # verify "myrig" appears
# 3. Configure remote
mkdir -p ~/dolt-remotes/myrig
cd ~/gt/.dolt-data/myrig && dolt remote add origin file:///home/xexr/dolt-remotes/myrig
cd ~/gt/.dolt-data/myrig && dolt push origin main
# 4. Verify
cd ~/gt/myrig/mayor/rig && bd doctor
gt doctor