6.3 KiB
Approach
- Read existing files before writing. Don't re-read unless changed.
- Thorough in reasoning, concise in output.
- Skip files over 100KB unless required.
- No sycophantic openers or closing fluff.
- No emojis or em-dashes.
- Do not guess APIs, versions, flags, commit SHAs, or package names. Verify by reading code or docs before asserting.
Global
- Utilise Docker & Docker-Compose pour la base de données (MariaDB)
- On développe tout en NodeJS notamment avec : NextJS & Prisma pour la partie backend et React pour la partie frontend
- Utilise Tailwind pour le CSS
- L'application est toujours multilangue (EN + FR)
Application : Ombrora-YTDLP
- Interface web publique permettant de soumettre des URLs de videos a telecharger via yt-dlp.
- Les telechargements sont geres via une file d'attente (queue) executee par Passenger en arriere-plan avec support du multithreading.
- Chaque telechargement est stocke en base de donnees (MariaDB via Prisma). Aucune entree n'est jamais supprimee : la DB conserve l'historique complet de tous les telechargements (statuts, erreurs, metadata).
- Le worker Passenger est responsable de dequeuer et d'executer yt-dlp en parallele selon la capacite configuree.
Deployment (o2switch)
- o2switch is shared hosting: no compiler toolchain, no root access. Any dependency with a native/binary component must ship as a precompiled binary — it cannot be built from source on the server.
- Before adding any new dependency with native bindings, confirm it publishes prebuilt binaries for o2switch's platform/arch — otherwise it will fail to install or run there.
- The o2switch nodevenv/Passenger setup ("Setup Node.js App" in cPanel) only supports a single
package.json/node_modulesfor the whole registered app — not one per subfolder. Verified by directly debugging a failedfrontend/build:npm install --prefix frontend --include=dev(root's ownbuildscript) and even a plainnpm installrun withcd frontendfirst (confirmed viapwdto genuinely be insidefrontend/) both completed "successfully" (correct, unmodifiedfrontend/package-lock.json, realresolvedentries for every package) yet never created afrontend/node_modulesdirectory on the server at all. Meanwhilevite/@vitejs/plugin-react(already present as root devDependencies) resolved fine during the build — only packages that exist exclusively infrontend/package.json(react-router-dom,react-i18next,i18next,@phosphor-icons/react) failed to resolve, with Vite/Rolldown erroringRolldown failed to resolve import "react-router-dom".- Fix (applied): every runtime package
frontend/src/**imports must also be listed in the rootpackage.json'sdependencies(not justfrontend/package.json's) —react/react-domalready were;react-router-dom,react-i18next,i18next,@phosphor-icons/reactwere added there too. Root's singlenode_modulesis an ancestor directory offrontend/src/, so Node/Vite's normal upwardnode_modulesresolution walk finds them there even with nofrontend/node_moduleson the server. frontend/package.jsonstill declares the same packages in its owndependencies— that's intentional, not stale duplication. It's what makes local dev (npm run devinsidefrontend/, which gets a real, normalfrontend/node_moduleson a dev machine) work independently of this server-only constraint. When adding a new frontend runtime dependency, add it to bothpackage.jsonfiles (frontend's own, for local dev; root's, for the o2switch build) and runnpm installin both places to keep both lockfiles in sync.frontend/package.json'sdevDependencies(vite,@vitejs/plugin-react,oxlint,@types/react*) do not need mirroring to root — only the ones already there (vite,@vitejs/plugin-react) are actually required for the production build to run at all;oxlint/@types/*are dev-only tooling never invoked duringnpm run build.
- Fix (applied): every runtime package
This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in node_modules/next/dist/docs/ (resolved from this file's directory; in monorepos the next package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by next dev — verify at node_modules/next/dist/server/lib/generate-agent-files.js. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
MCP Tools: code-review-graph
IMPORTANT: This project has a knowledge graph. ALWAYS use the code-review-graph MCP tools BEFORE using Grep/Glob/Read to explore the codebase. The graph is faster, cheaper (fewer tokens), and gives you structural context (callers, dependents, test coverage) that file scanning cannot.
When to use graph tools FIRST
- Exploring code:
semantic_search_nodesorquery_graphinstead of Grep - Understanding impact:
get_impact_radiusinstead of manually tracing imports - Code review:
detect_changes+get_review_contextinstead of reading entire files - Finding relationships:
query_graphwith callers_of/callees_of/imports_of/tests_for - Architecture questions:
get_architecture_overview+list_communities
Fall back to Grep/Glob/Read only when the graph doesn't cover what you need.
Key Tools
| Tool | Use when |
|---|---|
detect_changes |
Reviewing code changes — gives risk-scored analysis |
get_review_context |
Need source snippets for review — token-efficient |
get_impact_radius |
Understanding blast radius of a change |
get_affected_flows |
Finding which execution paths are impacted |
query_graph |
Tracing callers, callees, imports, tests, dependencies |
semantic_search_nodes |
Finding functions/classes by name or keyword |
get_architecture_overview |
Understanding high-level codebase structure |
refactor_tool |
Planning renames, finding dead code |
Workflow
- The graph auto-updates on file changes (via hooks).
- Use
detect_changesfor code review. - Use
get_affected_flowsto understand impact. - Use
query_graphpattern="tests_for" to check coverage.