From fb041145ab6fbd98eda8ea18b1858c917cbc52a4 Mon Sep 17 00:00:00 2001 From: gastown/polecats/dag Date: Tue, 30 Dec 2025 22:33:55 -0800 Subject: [PATCH] feat: Add role shortcuts to gt nudge (mayor, witness, refinery) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gt nudge now accepts role shortcuts that expand to session names: - mayor → gt-mayor - witness → gt--witness (uses current rig) - refinery → gt--refinery (uses current rig) This makes it easier to nudge common targets without needing to remember the full session naming conventions. (gt-w1te9) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/nudge.go | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/internal/cmd/nudge.go b/internal/cmd/nudge.go index 925c873d..91beebc2 100644 --- a/internal/cmd/nudge.go +++ b/internal/cmd/nudge.go @@ -6,6 +6,7 @@ import ( "github.com/spf13/cobra" "github.com/steveyegge/gastown/internal/events" + "github.com/steveyegge/gastown/internal/session" "github.com/steveyegge/gastown/internal/style" "github.com/steveyegge/gastown/internal/tmux" "github.com/steveyegge/gastown/internal/workspace" @@ -32,12 +33,17 @@ Uses a reliable delivery pattern: This is the ONLY way to send messages to Claude sessions. Do not use raw tmux send-keys elsewhere. -Special targets: - deacon Maps to the Deacon session (gt-deacon) +Role shortcuts (expand to session names): + mayor Maps to gt-mayor + deacon Maps to gt-deacon + witness Maps to gt--witness (uses current rig) + refinery Maps to gt--refinery (uses current rig) Examples: gt nudge greenplace/furiosa "Check your mail and start working" gt nudge greenplace/alpha -m "What's your status?" + gt nudge mayor "Status update requested" + gt nudge witness "Check polecat health" gt nudge deacon session-started`, Args: cobra.RangeArgs(1, 2), RunE: runNudge, @@ -82,6 +88,27 @@ func runNudge(cmd *cobra.Command, args []string) error { t := tmux.NewTmux() + // Expand role shortcuts to session names + // These shortcuts let users type "mayor" instead of "gt-mayor" + switch target { + case "mayor": + target = session.MayorSessionName() + case "witness", "refinery": + // These need the current rig + roleInfo, err := GetRole() + if err != nil { + return fmt.Errorf("cannot determine rig for %s shortcut: %w", target, err) + } + if roleInfo.Rig == "" { + return fmt.Errorf("cannot determine rig for %s shortcut (not in a rig context)", target) + } + if target == "witness" { + target = session.WitnessSessionName(roleInfo.Rig) + } else { + target = session.RefinerySessionName(roleInfo.Rig) + } + } + // Special case: "deacon" target maps to the Deacon session if target == "deacon" { // Check if Deacon session exists