| name | looper-go-dev |
| description | Looper-Go development workflows: build, test, run, debug, and manage the looper-go project. Use when working on looper-go codebase, running tests, building binaries, or debugging issues. |
Looper-Go Development
Overview
Looper-Go is a Go implementation of the autonomous AI loop runner. This skill covers common development workflows.
Project Structure
looper-go/
├── cmd/looper/ # CLI entry point
├── internal/
│ ├── config/ # Configuration loading
│ ├── agents/ # Agent runners
│ ├── loop/ # Main orchestration
│ ├── todo/ # Task file handling
│ ├── prompts/ # Prompt templates
│ ├── logging/ # JSONL logging
│ └── hooks/ # Post-iteration hooks
├── prompts/ # Bundled prompt templates
└── to-do.json # Task file (runtime)
Common Commands
Build
go build ./cmd/looper
go build -o ~/bin/looper ./cmd/looper
go build -o bin/looper-linux ./cmd/looper
GOOS=darwin go build -o bin/looper-macos ./cmd/looper
GOOS=windows go build -o bin/looper.exe ./cmd/looper
Test
go test ./...
go test -cover ./...
go test ./internal/loop
go test -v ./internal/loop
make test
Run
looper run
LOOPER_MAX_ITERATIONS=5 looper run
looper --task-file path/to/tasks.json run
looper tail
looper ls
looper config
looper doctor
Debug
LOOPER_DEBUG=1 looper run
looper tail
looper tail --run <run-id>
looper validate
looper fmt
Development Workflow
1. Make Changes
Edit code in internal/ or cmd/ as needed.
2. Test Changes
go test ./...
make test
~/.codex/skills/looper-live-test/scripts/run-live-test.sh
3. Commit Changes
git status
pre-commit run --all-files
git commit -m "feat: description"
4. Build and Install
go build ./cmd/looper
go install ./cmd/looper
Configuration
Config File Locations (priority order)
.looper/config.json - Project-specific
~/.config/looper/config.json - User config
- Environment variables (
LOOPER_*)
- CLI flags
Example Config
{
"max_iterations": 100,
"agent": {
"type": "claude",
"model": "claude-3-5-sonnet-20241022"
},
"paths": {
"log_dir": "./looper-logs"
}
}
Key Environment Variables
| Variable | Purpose |
|---|
LOOPER_MAX_ITERATIONS | Max loop iterations |
LOOPER_DEBUG | Enable debug logging |
LOOPER_AGENT_TYPE | Agent type (codex, claude) |
LOOPER_TASK_FILE | Path to task file |
CODEX_JSON_LOG | Codex JSON log mode (legacy) |
Troubleshooting
Build Fails
go clean -cache
go mod tidy
go build ./cmd/looper
Tests Fail
go test -v ./...
go test -v ./internal/loop
Agent Not Found
looper config
which codex
which claude
cat .looper/config.json | jq '.agent'
Adding New Features
1. Add Internal Package
mkdir internal/feature
2. Add Tests
go test ./internal/feature
3. Wire Into Loop
Edit internal/loop/loop.go to use new feature.
4. Update Documentation
- Edit
ARCHITECTURE.md if structural change
- Edit
README.md if user-facing
- Add godoc comments
Release Process
Use the release-runbook skill:
~/.codex/skills/release-runbook/scripts/release.sh --version 1.2.3 --test-cmd "make test"
Code Style
- Standard Go formatting (
gofmt)
- Conventional commits for commit messages
- Add tests for new functionality
- Update documentation
Resources
ARCHITECTURE.md - Full architecture documentation
README.md - User documentation
CONTRIBUTING.md - Contribution guidelines
AI_POLICY.md - AI contribution policy