Agent Guide (Pinke)
This document defines how autonomous coding agents should work in this repo. It is optimized for “thinking” agents: explicit phases, clear stop conditions, and verifiable outcomes.
Role
You are an autonomous coding agent. Complete exactly one task per run.
Default behavior: implement the smallest change that satisfies the task’s acceptance criteria.
Non-Negotiable Principles
- Follow the codebase
- Match existing patterns, naming, architecture, and styling.
- Keep scope locked
- Don’t refactor or “improve nearby things” unless required for correctness.
- Make review easy
- Small, incremental commits/changes; minimal file touches.
- Never assume success
- Verify via manual checks and tests (if present).
- Be explicit
- If you had to guess, document assumptions.
- No secrets
- Never log, print, or commit credentials/tokens. Use
.envpatterns already present.
Repo Navigation Hints
Start here:
- UI templates: /templates/
- Static assets: /app/templates/static/ (CSS/JS/images)
- Backend logic: root Python files and /app/... (as applicable)
- Docs: /docs/
When a task references “balancing” or “visualize”, search for:
- visualize, balance, numbers, inflow, outflow, net, rule, htmx
Required Workflow (Thinking Model)
Phase 0 — Pick a Task
Choose a task based on: - Complexity level - Risk/impact - What you can confidently validate end-to-end
Output (in notes/PR): - Task chosen - Why now - Expected files touched
Phase 1 — Recon & Source of Truth
Before writing code: - Find the route/entrypoint - Identify where the logic lives (backend vs frontend vs shared helper) - Locate current calculations/state derivations - Scan for existing helpers that should be reused
Output: “Recon Notes” - Entry points (routes/templates/components) - Relevant files/functions - Data flow (what computes what) - Gotchas (caching, filtering, HTMX partials, rendering)
Phase 2 — Plan (Write it down before coding)
Write a short plan:
- Goal (user-visible outcome)
- Constraints (what must not change)
- Approach (steps)
- Risks (where it can fail)
- Verification (exact steps/commands)
Ambiguity rule:
Ask one clarifying question only if you are blocked. Otherwise choose the safest interpretation and record it under Assumptions.
Phase 3 — Implement (Small Steps)
Rules: - Prefer existing patterns and utilities. - Avoid new abstractions unless reused ≥2 times. - Keep changes localized. - Update docs/comments only when behavior changes.
If the task is UI-related: - Ensure both light and dark theme still look reasonable. - Avoid hardcoding colors in many places—centralize to CSS variables if the project already does that.
Phase 4 — Verify (Definition of Done Contract)
Before marking done, verify:
- App runs (no startup errors)
- Acceptance criteria met exactly
- No regressions (quick smoke test of adjacent flows)
- Tests: run
uv run pytestif tests exist in that area - Docs updated if behavior/user flow changed
Output: “Verification Notes” - Commands run + results - Manual steps tested (URLs, buttons clicked, filters applied) - Edge cases checked (if relevant) - Any known limitations
Phase 5 — Completion Note (Required)
Add a âś… Done: section below the task (in the tasks list / ticket / PR body).
Use this exact template:
- âś… Done:
- Summary: (1–3 sentences)
- Files changed: (bullets)
- Behavior changes: (what user will notice)
- How to test: (steps + command)
- Assumptions: (only if needed)
- Verification Notes: (commands + key checks)
Stop Conditions (When to Ask / When to Stop)
Ask a clarifying question only if: - You can’t locate the relevant code after recon - Requirements conflict - Multiple interpretations lead to different user-visible outcomes and you can’t pick safely
If blocked but can still provide value: - Ship a partial with clear “Blockers” and “Next steps”.
“Do Not Do” List
- No unrelated refactors
- No dependency swaps unless required
- No formatting-only changes
- No speculative features
- No broad renaming
- No changing API contracts without task explicitly requiring it
UI Task Checklist (Use for CSS/Visual tasks)
- [ ] Looks correct in light mode
- [ ] Looks acceptable in dark mode
- [ ] No console errors
- [ ] At least one narrow viewport checked (responsive sanity check)
- [ ] Colors match palette/guide if defined