Commit Graph

1712 Commits

Author SHA1 Message Date
Steve Yegge
29e4436891 fix: code review fixes from gt-2tp and gt-y0t
- Replace custom contains() with strings.Contains in init.go
- Make session stop --force flag actually work
- Update session.Manager.Stop() to accept force parameter

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:56:32 -08:00
Steve Yegge
eef28f3ee5 feat: add CLI session commands (start, stop, at, list, capture, inject)
- start: Create tmux session and launch claude for polecat
- stop: Graceful shutdown with optional --force
- at: Attach to running session
- list: Show all active sessions with --json support
- capture: Get recent terminal output
- inject: Send message to session via tmux send-keys

Closes gt-u1j.11

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:51:37 -08:00
Steve Yegge
a5023c633b feat: add CLI core commands (status, prime, init)
- status: Show town status with rig/polecat/witness counts (--json supported)
- prime: Output role context based on current directory
- init: Initialize a git repo as a Gas Town rig

Closes gt-u1j.10

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:49:48 -08:00
Steve Yegge
452c649ce7 feat: add polecat lifecycle management
Types:
- Polecat: worker agent with state, clone, branch, issue
- State: idle/active/working/done/stuck
- Summary: concise status view

Manager operations:
- Add: clone rig, create branch, init state
- Remove: delete polecat (checks for uncommitted changes)
- List: enumerate all polecats
- Get: retrieve specific polecat

State management:
- SetState: update lifecycle state
- AssignIssue: assign work (sets StateWorking)
- ClearIssue: remove assignment (sets StateIdle)
- Wake: idle → active
- Sleep: active → idle

State persisted to polecats/<name>/state.json

Closes gt-u1j.8

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:37:34 -08:00
Steve Yegge
29ae7762a6 feat: add session management for polecat lifecycle
Manager operations:
- Start: create tmux session with optional issue assignment
- Stop: graceful shutdown with Ctrl+C then kill
- IsRunning: check if session exists
- List: enumerate all sessions for rig
- Attach: attach to session
- Capture: get recent output
- Inject: send message to session
- StopAll: terminate all sessions

Session naming: gt-<rig>-<polecat>

StartOptions:
- WorkDir: override working directory
- Issue: initial issue to work on
- Command: override default "claude" command

Environment variables set on start:
- GT_RIG: rig name
- GT_POLECAT: polecat name

Closes gt-u1j.7

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:35:22 -08:00
Steve Yegge
a0ecc051b8 feat: add rig management package
Types:
- Rig: managed repository with polecats, witness, refinery, mayor
- RigSummary: concise rig overview
- Manager: rig discovery, loading, creation

Manager operations:
- DiscoverRigs: load all registered rigs
- GetRig: get specific rig by name
- RigExists, ListRigNames: query helpers
- AddRig: clone and register new rig
- RemoveRig: unregister rig (keeps files)

Rig structure follows docs/architecture.md:
- polecats/, refinery/rig/, witness/rig/, mayor/rig/

Closes gt-u1j.5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:33:52 -08:00
Steve Yegge
355759be15 feat: add swarm package with core types
Types:
- Swarm: coordinated multi-agent work unit
- SwarmTask: single task assigned to worker
- SwarmState: lifecycle states (created/active/merging/landed/failed/cancelled)
- TaskState: task states (pending/assigned/in_progress/review/merged/failed)
- SwarmSummary: high-level progress overview

Methods:
- SwarmState.IsTerminal(), IsActive()
- TaskState.IsComplete()
- Swarm.Summary(), Progress()

Closes gt-kmn.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:31:56 -08:00
Steve Yegge
8bd1a353db feat: add workspace detection by walking up directory tree
Detection:
- Find() walks up from given directory looking for markers
- Primary marker: config/town.json
- Secondary marker: mayor/ directory
- Follows symlinks using filepath.EvalSymlinks

Functions:
- Find, FindOrError: from given directory
- FindFromCwd, FindFromCwdOrError: from current directory
- IsWorkspace: check if directory is workspace root

Closes gt-f9x.2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:30:25 -08:00
Steve Yegge
5a4e861a85 feat: add tmux wrapper package for session operations
Session lifecycle:
- NewSession, KillSession, HasSession, ListSessions, RenameSession

Session interaction:
- SendKeys, SendKeysRaw, CapturePane, CapturePaneAll, AttachSession

Environment and windows:
- SetEnvironment, GetEnvironment, SelectWindow, GetSessionInfo

Error handling:
- Detects ErrNoServer, ErrSessionExists, ErrSessionNotFound
- Graceful handling when no tmux server running

Closes gt-u1j.4

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:28:35 -08:00
Steve Yegge
f46a1e6eab feat: add git wrapper package for subprocess operations
Operations:
- Clone, Checkout, Fetch, Pull, Push
- Add, Commit, CommitAll
- Status, CurrentBranch, HasUncommittedChanges, RemoteURL
- Merge, Rebase, AbortMerge, AbortRebase
- CreateBranch, DeleteBranch, Rev, IsAncestor

Error handling:
- Detects ErrNotARepo, ErrMergeConflict, ErrAuthFailure, ErrRebaseConflict
- Wraps git stderr in error messages

Closes gt-u1j.3

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:27:03 -08:00
Steve Yegge
e16931b304 feat: add config package with types and JSON serialization
Types:
- TownConfig: main town configuration (config/town.json)
- RigsConfig: rigs registry with BeadsConfig per rig
- AgentState: agent state with role, session, extras

Features:
- Load/Save functions for all types
- Version compatibility checks
- Required field validation
- Creates parent directories on save

Closes gt-f9x.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:24:28 -08:00
Steve Yegge
7217b34a90 feat: add Cobra CLI scaffolding with Lipgloss styles
- cmd/gt/main.go: Entry point using Cobra
- internal/cmd/root.go: Root command with description
- internal/cmd/version.go: Version command with build info
- internal/style/style.go: Lipgloss styles for terminal output

Closes gt-u1j.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:19:27 -08:00