docs/agent/coding-standards.md
Frontend and backend coding conventions.
All UI changes MUST follow the Swiss International Style in style-guide.md:
font-serif for headers, font-mono for metadata, font-sans for body text#F0F0E8 (Canvas), #000000 (Ink), #1D4ED8 (Hyper Blue), #15803D (Signal Green), #F97316 (Alert Orange), #DC2626 (Alert Red), #4B5563 (Steel Grey)rounded-none with 1px black borders and hard shadowsAll textareas in forms should include onKeyDown with e.stopPropagation() for Enter key to ensure newlines work correctly:
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (e.key === 'Enter') e.stopPropagation();
};
npm run formatnpm run lintapp/prompts/templates.pyLog detailed errors server-side, return generic messages to clients:
except Exception as e:
logger.error(f"Operation failed: {e}")
raise HTTPException(status_code=500, detail="Operation failed. Please try again.")
Use asyncio.Lock() for shared resource initialization (see app/pdf.py for example).
Always use copy.deepcopy() when assigning mutable default values to avoid shared state bugs:
# Correct
import copy
data = copy.deepcopy(DEFAULT_DATA)
# Incorrect - shared state bug
data = DEFAULT_DATA
Mirror patterns in app/services/improver.py for new services.