mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-28 17:52:39 +00:00
chore: Add development guidelines documentation for AI Agents (#11243)
Added `AGENTS.md` containing development guidelines, build commands, code style conventions, and project-specific instructions for easier onboarding and consistent development practices. Additionally symlink for `CLAUDE.md` and `windsurf`
This commit is contained in:
10
.gitignore
vendored
10
.gitignore
vendored
@@ -71,9 +71,6 @@ test/cypress/videos/*
|
||||
/config/master.key
|
||||
/config/*.enc
|
||||
|
||||
#ignore files under .vscode directory
|
||||
.vscode
|
||||
.cursor
|
||||
|
||||
# yalc for local testing
|
||||
.yalc
|
||||
@@ -92,5 +89,8 @@ yarn-debug.log*
|
||||
# https://vitejs.dev/guide/env-and-mode.html#env-files
|
||||
*.local
|
||||
|
||||
# Claude.ai config file
|
||||
CLAUDE.md
|
||||
|
||||
# TextEditors & AI Agents config files
|
||||
.vscode
|
||||
.claude/settings.local.json
|
||||
.cursor
|
||||
|
||||
1
.windsurf/rules/chatwoot.md
Symbolic link
1
.windsurf/rules/chatwoot.md
Symbolic link
@@ -0,0 +1 @@
|
||||
../../AGENTS.md
|
||||
58
AGENTS.md
Normal file
58
AGENTS.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# Chatwoot Development Guidelines
|
||||
|
||||
## Build / Test / Lint
|
||||
|
||||
- **Setup**: `bundle install && pnpm install`
|
||||
- **Run Dev**: `pnpm dev` or `overmind start -f ./Procfile.dev`
|
||||
- **Lint JS/Vue**: `pnpm eslint` / `pnpm eslint:fix`
|
||||
- **Lint Ruby**: `bundle exec rubocop -a`
|
||||
- **Test JS**: `pnpm test` or `pnpm test:watch`
|
||||
- **Test Ruby**: `bundle exec rspec spec/path/to/file_spec.rb`
|
||||
- **Single Test**: `bundle exec rspec spec/path/to/file_spec.rb:LINE_NUMBER`
|
||||
- **Run Project**: `overmind start -f Procfile.dev`
|
||||
|
||||
## Code Style
|
||||
|
||||
- **Ruby**: Follow RuboCop rules (150 character max line length)
|
||||
- **Vue/JS**: Use ESLint (Airbnb base + Vue 3 recommended)
|
||||
- **Vue Components**: Use PascalCase
|
||||
- **Events**: Use camelCase
|
||||
- **I18n**: No bare strings in templates; use i18n
|
||||
- **Error Handling**: Use custom exceptions (`lib/custom_exceptions/`)
|
||||
- **Models**: Validate presence/uniqueness, add proper indexes
|
||||
- **Type Safety**: Use PropTypes in Vue, strong params in Rails
|
||||
- **Naming**: Use clear, descriptive names with consistent casing
|
||||
- **Vue API**: Always use Composition API with `<script setup>` at the top
|
||||
|
||||
## Styling
|
||||
|
||||
- **Tailwind Only**:
|
||||
- Do not write custom CSS
|
||||
- Do not use scoped CSS
|
||||
- Do not use inline styles
|
||||
- Always use Tailwind utility classes
|
||||
- **Colors**: Refer to `tailwind.config.js` for color definitions
|
||||
|
||||
## General Guidelines
|
||||
|
||||
- MVP focus: Least code change, happy-path only
|
||||
- No unnecessary defensive programming
|
||||
- Break down complex tasks into small, testable units
|
||||
- Iterate after confirmation
|
||||
- Avoid writing specs unless explicitly asked
|
||||
- Remove dead/unreachable/unused code
|
||||
- Don’t write multiple versions or backups for the same logic — pick the best approach and implement it
|
||||
- Don't reference Claude in commit messages
|
||||
|
||||
## Project-Specific
|
||||
|
||||
- **Translations**:
|
||||
- Only update `en.yml` and `en.json`
|
||||
- Other languages are handled by the community
|
||||
- Backend i18n → `en.yml`, Frontend i18n → `en.json`
|
||||
- **Frontend**:
|
||||
- Use `components-next/` for message bubbles (the rest is being deprecated)
|
||||
|
||||
## Ruby Best Practices
|
||||
|
||||
- Use compact `module/class` definitions; avoid nested styles
|
||||
Reference in New Issue
Block a user