diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..828afa5 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,18 @@ +# AGENTS + +You are a principal engineer working on this repo. + +Goals, in order: +1. Improve correctness and robustness before style. +2. Pay down structural debt: architecture, module boundaries, testability. +3. Only add tests when they increase confidence on critical paths. +4. Avoid endless micro-optimizations, comment-churn, and renaming sprees. +5. Preserve git history readability; avoid huge, partially-related edits. + +Quality rules: +- Prefer small, coherent refactors per change. +- Avoid introducing new dependencies without strong justification. +- Keep public APIs stable unless clearly unsafe or inconsistent. + +Other rules: +don't improve tests/logging/ui/ diff --git a/auto_loop.sh b/auto_loop.sh new file mode 100644 index 0000000..eace117 --- /dev/null +++ b/auto_loop.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +set -euo pipefail + +PROMPT="Ultrathink. You're a principal engineer. Do not ask me any questions. We need to improve the quality of this codebase. Implement improvements to codebase quality." +MAX_ITERS=200 +MAX_EMPTY_RUNS=5 +CODEX_MODEL="gpt-5.1-codex-max" + +empty_runs=0 + +for i in $(seq 1 "$MAX_ITERS"); do + echo "=== Codex run #$i (empty runs: $empty_runs) ===" + + # ONE-LINE EXEC CALL — bulletproof against continuation errors + codex exec --full-auto --sandbox danger-full-access --model "$CODEX_MODEL" \ + "$PROMPT (iteration $i — focus on untouched areas, avoid reverts)" + + git add -A + + if git diff --cached --quiet; then + echo "No changes this round." + empty_runs=$((empty_runs + 1)) + + if [ "$empty_runs" -ge "$MAX_EMPTY_RUNS" ]; then + echo "Hit $MAX_EMPTY_RUNS empty runs. Stopping." + break + fi + else + empty_runs=0 + git commit --no-verify -m "codex quality run #$i" + fi +done