$ show openclaw/caclawphony
Caclawphony is an Elixir/OTP application that automates pull request triage, review, and merging by orchestrating AI agents (Codex). It polls a Linear project board for issues in configured states, creates isolated workspaces per issue, and runs phase-specific agent prompts (triage, review, prepare, merge, closure). A real-time terminal dashboard and optional Phoenix LiveView web UI provide observability into running agents, token usage, and rate limits. The system is driven by a single WORKFLOW.md file that serves as both configuration (YAML front matter) and per-issue prompt template. The architecture follows OTP GenServer patterns: an orchestration loop polls the tracker, dispatches to AgentRunner instances that manage Codex subprocesses via stdin/stdout JSON-RPC, and reconciles state transitions. External integrations include the Linear GraphQL API, GitHub CLI for PR operations, and Telegram for notifications. The repository includes extensive test coverage, CI/CD workflows, and reusable patterns such as a tracker behaviour, snapshot testing support, and a spec coverage linting mix task. While designed for the openclaw/openclaw repository with hardcoded Linear identifiers and defaults, the plugin architecture (tracker adapters, workspace hooks, prompt templates) supports customization. The codebase is actively maintained with modern Elixir tooling (Phoenix, Bandit, NimbleOptions) and demonstrates solid software engineering practices, though its tight coupling to specific Linear states and the prototype nature noted in README limit immediate reuse outside the originating project.
The LLM identified 3 files worth highlighting for reuse:
Manages a Codex app-server subprocess via stdin/stdout JSON-RPC. Handles session lifecycle, token accounting, and message parsing. The pattern of managing an AI agent as a long-running child process with structured communication is reusable for any project that needs to integrate with AI code generation tools.
A Mix task that checks for missing @spec declarations in a project by analyzing compiler traces. It enforces specification coverage without a separate tool and can be extracted as a standalone linting package for any Elixir project that wants to mandate explicit type specifications.
Provides helper functions for snapshot-based testing of CLI output and text representations. Uses evidence files to record expected output and snapshot files for inline comparison. This pattern is directly adaptable to any Elixir project that needs golden file or snapshot testing, similar to Jest snapshots in the JavaScript ecosystem.