Code style
These rules apply to people and coding agents alike.
Files and folders
- About 300 lines per file, at most 500. Do not add behaviour to a file that is already over the target: create the focused module the code belongs in and wire it in with a small edit.
- Group by responsibility. One module for transport, one for business logic, one for policies and constants; in the web app one for state and one for presentation.
- No catch-all helper files and no folders full of single-use files without a real boundary.
- Keep route handlers thin. Business logic lives in services, runtime mechanics in the agent layer, tool capabilities with the tools.
Language and names
- English only in code, comments, log messages and anything an agent reads.
- Clear names that say what a thing is or does. No abbreviations a newcomer has to guess.
Decisions are explicit
Octryx AI is built to be deterministic and governable. Execution decisions come from explicit profiles, policies and configuration, never from guessing intent with keywords or from silent fallbacks. An unclear decision becomes an explicit state: denied, needs approval, needs configuration or needs clarification.
Forbidden patterns
Unless the task requires it and the reason is written down:
- new oversized files, and catch-all helpers for unrelated logic;
- silent changes to an API or data contract;
- hard-coded secrets or insecure defaults;
- broad
except Exceptionwithout a clear boundary; - cleanup mixed into feature work;
- tool risk, approvals or write behaviour inferred only from a tool's name;
- connector tools visible when the connector is not active for the Workspace;
- credentials, tokens or credentialed clone URLs passed through generic tool or runtime paths;
- SQL written by a model and executed as a database tool.
Refactoring a big file
Extract one responsibility at a time, in this order: pure helpers, state, side effects and integrations, then rendering or transport glue. Verify behaviour after each step. Do not mix feature work, renaming, formatting and moves in one change.
