This is the single reference for anyone writing code on ARKOS — whether you are using an AI coding tool or writing it yourself. The rules here are short on purpose. Fewer rules followed consistently beat many rules ignored.
Write for the next person reading the code, not the machine running it. If a reviewer needs more than 10 seconds to understand a function, rewrite it.
Functions should stay under 40 lines. If a function is getting long, it is doing more than one thing — split it into named helpers. The name of each helper should describe what it does clearly enough that the calling function reads like plain English.
The same principle applies to PRs. Target under 400 lines changed. If a task genuinely requires more, split it: one PR for the interface, a second for the implementation.
Pick names that make the code self-explanatory. completion_signal is better than sig. user_id is better than uid. A well-named variable or function rarely needs a comment.
When you do write a comment, explain why — not what. The code already shows what it does.
# Good — explains a non-obvious constraint
# Tokens expire in 1 hour; refresh before every agent init to avoid mid-task auth failure
token = await refresh_token_if_needed(user_id)
# Bad — just restates the code
# Get the token for the user
token = await get_token(user_id)
Every function signature needs type annotations — parameters and return type, no exceptions. Do not use Any unless truly unavoidable, and if you do, leave a comment explaining why.
Never catch bare except: — always catch a specific exception type. Never use magic numbers — name your constants. Never import * from a module. Never leave a TODO in a PR — either fix it now or open a separate issue.
Every PR runs four checks in parallel. All four must pass before the Docker build runs, and the Docker build must pass before anything merges.