halpradio is designed to be fully AI-agent-friendly. Whether you are using Google Antigravity or Claude Code, this document explains how AI agents interact with the repository, discover rules, execute commands, and contribute safely.
AI agents automatically discover configuration files at the root of the workspace:
flowchart TD
RepoRoot([halpradio Repository Root]) --> AGENTS["AGENTS.md (Antigravity & Generic Agents)"]
RepoRoot --> CLAUDE["CLAUDE.md (Claude Code CLI)"]
RepoRoot --> Rules[".agents/rules/ (Antigravity Rules Engine)"]
RepoRoot --> TechnicalDocs["docs/AGENTS.md (Comprehensive Guide)"]
| Agent Platform | Entry Configuration File | Primary Discovery Location | Special Capabilities |
|---|---|---|---|
| Google Antigravity | AGENTS.md / .agents/rules/ |
Root AGENTS.md & .agents/ directory |
Subagents (research, self), Slash commands (/plan, /goal), Artifact generation, Task scheduling |
| Claude Code | CLAUDE.md |
Root CLAUDE.md |
Context-compact CLI commands, test execution loops, file edits |
Antigravity automatically discovers instructions from:
- Root
AGENTS.md - Workspace customizations root:
.agents/rules/ - Built-in skills (
agy-customizations,antigravity-guide)
When working on large refactors or complex investigations:
researchsubagent: Delegate codebase exploration, API research, or dependency analysis toresearchso context history remains clean.selfsubagent: Delegate isolated build, test, or scratch file generation tasks.
Agents working with users in Antigravity should suggest slash commands when applicable:
/plan: Use when planning complex structural changes (e.g. adding new audio backends or modifying the Elm update loop)./goal: Use when executing background autonomous tasks./grill-me: Use when aligning with the developer on UI/UX preferences or modal design decisions./learn: Use when saving custom workflow preferences for future runs.
Antigravity stores artifacts, scratch scripts, and transcripts in <appDataDir>/brain/<conversation-id>/. Architectural proposals or complex test output reports should be saved as markdown artifacts.
Claude Code reads CLAUDE.md on launch to understand the build and test toolchain.
# Build binary
go build -o halpradio main.go
# Execute tests
go test ./...
# Format and vet
gofmt -s -w .
go vet ./...Claude Code agents must execute go test ./... after every code modification to verify zero regression across pkg/player, pkg/radio, and pkg/ui.
-
Mutex Concurrency Safety:
pkg/player/player.gohandles real-time HTTP streaming and audio process lifecycle.- Always acquire
m.mu.Lock()when modifying player manager state. - Dispatch async events back to Bubble Tea using
program.Send()ortea.Cmd.
-
Pure UI Component Rendering:
- Files under
pkg/ui/components/must be side-effect-free renderers. - All state mutations must occur in
pkg/ui/update.go.
- Files under
-
Theme Token Compliance:
- Never write hardcoded HEX colors in UI files.
- Always reference active theme tokens (
m.theme.Primary,m.theme.Border,m.theme.Playing, etc.) frompkg/theme/theme.go.
-
Resilient Error Handling:
- Do not swallow errors or return dummy fallbacks silently.
- Set status to
StatusErroror output informative error messages in the status bar. Never callpanic().
-
Empirical Verification:
- Never claim a bug fix or feature is complete without running
go test ./...andgo build main.go.
- Never claim a bug fix or feature is complete without running