# AI Coding Agent Instructions for Filemanager ## Architecture Essentials ### Language & Copy - User-facing website copy must be in British English. - New or modified UI text (buttons, labels, dialogs, errors, tooltips, share pages) must be in British English. ### Technical Specifications - For every file and implementation, log the file and all of its classes and functions in `.github/technical-reference.md` - When functionality is modified or added, update that file. - Reference the file before making changes to ensure no duplicate functionality is made - the file serves as an index and reference for the code architecture, as well as individual classes and methods. - Keep it short and specific; no paragraphs of explanation, only a simple notation of a file, class or method and a one-line description of what it does, what it should be used for, and what to keep into account when using it. - `.github/tests.md` is an index of every test file and every test name inside it. Keep it up to date whenever tests are added, removed, or renamed. Reference it to understand existing coverage before deciding whether to add a new test. ## Developer Workflows ### Git authoring - When starting work on something, create a feature or fix branch - When concrete, complete steps are made, create a commit in that branch as you work. There is no such thing as 'too many commits' - Don't wait until everything is finished before you commit, just commit as soon as you complete a step before moving on to the next step - Keep commit subjects short and to the point (what changed) - Include a longer commit description body that explains the change in user-facing terms (what users will notice), not implementation detail - Try to commit frequently, chunking work into individual steps - When making commits, ensure you're not accidentally reverting newer code with an old snapshot. - When all work is done, merge the branch into master using a non-fast-forward merge commit (`git merge --no-ff`), and then delete it so only master remains - Ensure you don't leave old branches you've made in git and that everything is merged neatly. - Always run the full test suite and fix any issues (including unrelated to your work) before merging to master. ## Testing Expectations - **Default rule:** every new feature should receive a test that verifies it behaves as requested. - If a very similar test already exists, expand or adapt that test instead of creating duplicate coverage. - When a change affects an area that existing tests are meant to cover, update those tests so the new behavior is validated too. - After modifying any function or module, check `tests.md` for tests that exercise that code path — directly or indirectly — and verify those tests still reflect the current behavior. If they no longer do, update them before finishing. - When encountering existing functionality that is not covered by tests, automatically add coverage for it unless it is extremely simple; for extremely simple cases, ask the user first before skipping the test. - Only skip adding a test, or ask the user first, when the change is truly tiny or not behaviorally meaningful (for example: wording-only copy edits, comments, or other negligible changes). - Prefer reusing production helpers and real code paths in tests rather than duplicating business logic in test-only code.