agent linting and formatting

This commit is contained in:
Echo 2025-06-25 11:39:20 -04:00
parent 1adf277809
commit 92457cdec4
No known key found for this signature in database

View file

@ -1,6 +1,7 @@
# AGENT.md - Rails Hackatime/Harbor Project
## Commands (via Docker Compose)
- **Tests**: `docker compose run web rails test` (all), `docker compose run web rails test test/models/user_test.rb` (single file), `docker compose run web rails test test/models/user_test.rb -n test_method_name` (single test) - Note: Limited test coverage
- **Lint**: `docker compose run web bundle exec rubocop` (check), `docker compose run web bundle exec rubocop -A` (auto-fix)
- **Console**: `docker compose run web rails c` (interactive console)
@ -11,7 +12,9 @@
- **Zeitwerk**: `docker compose run web bin/rails zeitwerk:check` (autoloader check)
## CI/Testing Requirements
**Before marking any task complete, run ALL CI checks locally:**
1. `docker compose run web bundle exec rubocop` (lint check)
2. `docker compose run web bundle exec brakeman` (security scan)
3. `docker compose run web bin/importmap audit` (JS security)
@ -19,16 +22,19 @@
5. `docker compose run web rails test` (full test suite)
## Docker Development
- **Interactive shell**: `docker compose run --service-ports web /bin/bash`
- **Initial setup**: `docker compose run web bin/rails db:create db:schema:load db:seed`
- **Cleanup**: Run commands with the `--remove-orphans` flag to remove unused containers and images
## Git Practices
- **NEVER commit `config/database.yml`** unless explicitly asked to - contains sensitive local/production database credentials
- **NEVER use `git add .`** - always add files individually to avoid accidentally committing unwanted files
- Use `git add <specific-file>` or `git add <directory>/` for targeted commits
## Code Style (rubocop-rails-omakase)
- **Naming**: snake_case files/methods/vars, PascalCase classes, 2-space indent
- **Controllers**: Inherit `ApplicationController`, use `before_action`, strong params with `.permit()`
- **Models**: Inherit `ApplicationRecord`, extensive use of concerns/enums/scopes
@ -37,4 +43,4 @@
- **API**: Namespace under `api/v1/`, structured JSON responses with status codes
- **Jobs**: GoodJob with 4 priority queues, inherit from `ApplicationJob`, concurrency control for cache jobs
- **Auth**: `ensure_authenticated!` for APIs, token via `Authorization` header or `?api_key=`
- **CSS**: Pico CSS framework + Uchu colors, component-specific CSS files, no Tailwind
- **CSS**: Using Tailwind CSS, no inline styles, use utility classes. We define some custom classes in `config/tailwind.config.js` and `app/assets/tailwind/application.css`.