AI agent guidance for working with the Genonaut recommender systems project - handles environment setup, testing, database migrations, and full-stack development workflows
This skill provides comprehensive guidance for working with Genonaut, a recommender systems project for perpetual generative AI content creation (text, image, video, audio).
Provides AI agents with complete context and procedures for:
**CRITICAL FIRST STEP**: Always activate the virtual environment before any Python work:
```bash
source env/python_venv/bin/activate
```
Read documentation in this order:
1. `README.md` - Project overview
2. `docs/developer.md` - Developer guide
3. `docs/testing.md` - Testing practices
4. `docs/api.md` - API documentation
5. `docs/db.md` - Database details
6. `frontend/AGENTS.md` - Frontend-specific guidance
**Database:**
```bash
make init-demo # Initialize demo database
make api-demo # Start API server (demo DB)
make migrate-demo # Generate and apply DB migration
make api-test-wt2-restart # Restart API server (test DB, worktree 2)
```
**Testing:**
```bash
make test-unit # Unit tests (backend, <10s)
make test-db # Database tests (30-60s)
make test-api # API integration tests (2-5min)
make test-all # All backend tests
make frontend-test # All frontend tests
make frontend-test-unit # Frontend unit tests only
make frontend-test-e2e # Frontend E2E tests (excludes @performance)
```
**Services:**
```bash
make celery-dev # Start Celery worker
make frontend-dev # Start frontend dev server (port 5173)
make beat-status # Check Celery Beat schedule
make redis-flush-dev # Clear Redis data
```
Follow these steps for every feature or major task:
**a) Notes and Task Tracking:**
**b) Testing (Three-Tier Approach):**
1. **Unit tests** (`make test-unit`) - No dependencies, fastest
2. **Database tests** (`make test-db`) - Requires DB, medium speed
3. **API integration tests** (`make test-api`) - Requires API + DB, slowest
For database/API tests, initialize test DB first: `make init-test` and start test server: `make api-test`
**Frontend Testing:**
**CRITICAL - E2E Database Configuration:**
Always verify which database the API is connected to before debugging E2E test failures:
```bash
curl http://localhost:8001/api/v1/health | python -m json.tool
make api-test
make api-demo
```
**c) Frontend Changes - data-testid Attributes:**
Add/update stable `data-testid` attributes on:
Follow conventions in `frontend/AGENTS.md#data-test-ids` (e.g., `page-or-component-element` naming, MUI `inputProps`/`slotProps`).
**d) Browser Verification with MCP Playwright:**
**CRITICAL**: After UI/frontend changes, verify functionality using MCP Playwright tools. Do NOT rely on manual user testing.
Available tools:
**Verification workflow:**
1. Make frontend changes
2. Start dev server: `make frontend-dev`
3. Navigate to http://localhost:5173
4. Use snapshot to see page structure
5. Check console for errors
6. Test interactions with click/type tools
7. Fix issues and re-verify
**e) Documentation:**
**f) Dependencies:**
Add new Python packages (unversioned) to `requirements-unlocked.txt`
**g) Final Verification:**
**CRITICAL**: DO NOT edit existing version files in `genonaut/db/migrations/versions/`. Treat as immutable history.
**Migration procedure:**
1. Modify SQLAlchemy models (no raw SQL)
2. Generate migration: `make migrate-demo`
3. Verify single head: `alembic heads` (should show one revision)
4. Apply to all environments: `make migrate-demo`, `make migrate-dev`, `make migrate-test`
5. Test suite must pass after upgrades
**Important notes:**
Three local databases:
API server runs on port 8001 with demo database by default.
Two-tier configuration (lowest to highest priority):
1. `config/base.json` - Base config
2. `config/{ENV_TARGET}.json` - Environment-specific (e.g., `local-demo`)
3. `env/.env.shared` - Shared secrets
4. `env/.env.{ENV_TARGET}` - Environment secrets
5. Process environment variables
6. `env/.env` - Local overrides (gitignored)
Frontend config: `frontend/src/config/`
See `docs/configuration.md` for details.
**Starting services:**
Use appropriate commands: `make start-db`, `npm run dev`, etc.
**Restarting services:**
**For API servers - ALWAYS use environment-specific commands:**
```bash
make api-demo-stop / make api-demo-restart # Demo database
make api-test-stop / make api-test-restart # Test database (worktree 1)
make api-test-wt2-stop / make api-test-wt2-restart # Worktree 2 test
make api-dev-stop / make api-dev-restart # Development database
```
**Why not use generic pkill:**
**For other services:**
Use `pkill -f <process_name>` or `killall <service>`
See `docs/infra.md#api-server-management-stop-and-restart-commands` for complete list.
During development, keep these running:
**Backend (pytest):**
Use `@pytest.mark.performance` decorator
**Frontend Playwright E2E:**
Add `@performance` tag to test names:
```typescript
test('my test @performance', async ({ page }) => { ... })
```
Run separately: `make frontend-test-e2e-performance`
1. Activate venv: `source env/python_venv/bin/activate`
2. Create task doc in `notes/new-feature.md` with checkboxes
3. Modify SQLAlchemy models if needed
4. Generate migration: `make migrate-demo`
5. Write unit tests, then database tests, then API tests
6. Add frontend data-testids if UI changes involved
7. Verify in browser with MCP Playwright tools
8. Add docstrings and code comments
9. Update `README.md` if needed
10. Run full test suite: `make test-all && make frontend-test`
11. Check off todos in `notes/new-feature.md`
1. Check which database API is connected to: `curl http://localhost:8001/api/v1/health | python -m json.tool`
2. If wrong database, restart with correct env: `make api-test-stop && make api-test`
3. Re-run E2E tests: `make frontend-test-e2e-debug`
4. Use MCP Playwright tools to manually verify behavior in browser
5. Fix issues and verify tests pass
1. Modify SQLAlchemy models (no raw SQL)
2. `make migrate-demo` to generate and apply migration
3. Apply to other environments: `make migrate-dev && make migrate-test`
4. Run full test suite to verify: `make test-all`
5. Check migration file into git
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/genonaut-development-assistant/raw