From e6f9cde35e3f68d4ffb0a46a8361ce099a558ac6 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 11 Aug 2025 10:08:41 +1000 Subject: [PATCH] DEV: update various ai agent configurations (#34192) Shortened AI agent file, so we conserve tokens Use symlinks for all agent files where needed to avoid round trips to llm Added config for Open AI Codex / Gemini and Cursor --- .cursor/rules/ai-agents-always.mdc | 7 + .github/instructions/copilot.instructions.md | 1 + AGENTS.md | 1 + AI-AGENTS.md | 198 ++++------ CLAUDE.md | 2 +- GEMINI.md | 1 + bin/lint | 374 +++++++++++++++++++ script/i18n_lint.rb | 9 + 8 files changed, 463 insertions(+), 130 deletions(-) create mode 100644 .cursor/rules/ai-agents-always.mdc create mode 120000 .github/instructions/copilot.instructions.md create mode 120000 AGENTS.md mode change 100644 => 120000 CLAUDE.md create mode 120000 GEMINI.md create mode 100755 bin/lint diff --git a/.cursor/rules/ai-agents-always.mdc b/.cursor/rules/ai-agents-always.mdc new file mode 100644 index 00000000000..1a9ab651d03 --- /dev/null +++ b/.cursor/rules/ai-agents-always.mdc @@ -0,0 +1,7 @@ +--- +description: Always include our AI agents guide +globs: +alwaysApply: true +--- + +@ai-agents.md diff --git a/.github/instructions/copilot.instructions.md b/.github/instructions/copilot.instructions.md new file mode 120000 index 00000000000..ca3222aea6a --- /dev/null +++ b/.github/instructions/copilot.instructions.md @@ -0,0 +1 @@ +AI-AGENTS.md \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 120000 index 00000000000..ca3222aea6a --- /dev/null +++ b/AGENTS.md @@ -0,0 +1 @@ +AI-AGENTS.md \ No newline at end of file diff --git a/AI-AGENTS.md b/AI-AGENTS.md index 835a6acc41b..b5248b3e398 100644 --- a/AI-AGENTS.md +++ b/AI-AGENTS.md @@ -1,156 +1,96 @@ # AI Coding Agent Guide -This file contains project-specific instructions that any AI coding agent should read at the start of each conversation and maintain in memory throughout the entire interaction. IMPORTANT: Once this file has been read or updated, it MUST be loaded at the beginning of any new conversation to ensure awareness of communication requirements, custom tasks, etc. +Project-specific instructions for AI agents. MUST be loaded at conversation start. ## Default Mode +- Architect mode enabled by default: detailed analysis, patterns, trade-offs, architectural guidance +- Stop and ask for context if unable to write code meeting guidelines -- Architect mode should be enabled by default. -- Focus on providing detailed analysis, patterns, trade-offs, and architectural guidance. -- If you're unable to write code that fits these guidelines, stop and ask for additional context from the developer. +## Development Rules +Discourse is large with long history. Understand context before changes. -## Development Environment +### All Files +- Always lint changed files +- Make display strings translatable (use placeholders, not split strings) +- Create subagent to review changes against this file after completing tasks -Discourse is a large project with a long development history. Ensure you understand the context of any changes you're making before you start. - -### General Rules -These rules apply to ALL files being changed. - -- Always lint changed files. -- Always make display strings translatable. -- Avoid splitting display strings into pieces: use translation placeholders, or multiple translatable strings where appropriate. -- After completing a task, create a subagent to review the changes and ensure they conform to the instructions in this file, as well as the prompt(s) given. +### Toolset +- Use `pnpm` for JavaScript, `bundle` for Ruby +- Use helpers in bin over bundle exec (bin/rspec, bin/rake) ### JavaScript -- Don't create empty backing classes for template tag only components, unless specifically asked to. -- Use the FormKit library for creating forms and form inputs. FormKit is documented here: https://meta.discourse.org/t/discourse-toolkit-to-render-forms/326439 and defined in `app/assets/javascripts/discourse/app/form-kit` +- No empty backing classes for template-only components unless requested +- Use FormKit for forms: https://meta.discourse.org/t/discourse-toolkit-to-render-forms/326439 (`app/assets/javascripts/discourse/app/form-kit`) -### JavaScript Documentation -- Always add JSDocs for classes, methods, and members, except for: - - `@service` members - - constructors -- Always use multiline JSDoc format. -- For components: - - Specify the component name with `@component`. - - List the params. These can be found in `this.args` in the JS, or `@paramname` in the `