IA Vibe Coding

The Goal of this page is to centralize Idea, Practices or Return of experience when using IA agents for coding Dolibarr.

Setup

Most important setup for AI is stored into .agents/AGENTS.md and this file is automatically read by all vibe coding clients so you don't have nothing to do for this point, except launching your vib coding client from the root of the repository.

There is also a generic file .agentsignore in the root directory, but coding agents does not take it into account by default. So you must first create a symlinks with the name accepted by your coding agent so it can takeit into account automatically when launched.

  • Example for Claude: ln -fs .agentsignore .claudeignore
  • Example for Mistral: ln -fs .agentsignore .vibeignore

Exemple of prompt for IA Agent Coding

Migration du code legacy conf->global->XXX par getDolGlobalString()

Pour récupérer les valeurs de configuration XXX on faisait $conf->global->XXX, mais maintenant on utilise la fonction getDolGlobalString('XXX'). Peux tu faire la migration des fichiers PHP dans /htdocs/cabinetmed/admin. Ne fais pas un simple remplacement, assure toi que le code résultant a le même comportement après que avant.

Removing a deprecated property

Dans le fichier @htdocs/compta/tva/class/paymentvat.class.php, j'ai la propriété ->lib qui est déprécié. Peux tu analyser le code est la remplacer par ->label la ou elle est utilisé ?

Translation of comments

Can you translate in english all PHP comments that are not in english. Translate comment that are inside /* */ comments but also one line comments after //. Keep mention to variable names unchanged.


Build the API for a businessobject

Peux tu me faire l'api pour le module mymodule (donc un fichier htdocs/mymodule/api_websites.class.php) afin d'offrir un endpoint pour récupérer la liste des objects géré par le module (ID, ref, etc..). Puis un endpoint pour mettre à jour cet object depuis son ID et un autre pour le supprimer. Les permissions doivent être les même que celles utilisées par les écrans (fichiers .php dans @htdocs/mymodule)


Check bug on HTML structure

Est ce que la page receipt.php génère une page HTML valide et qui est équilibré en terme de tag ouvert/fermé.