-
-
Notifications
You must be signed in to change notification settings - Fork 6
[WIP]: Create AGENTS.md repository guidelines document with comprehensive development rules and context #1898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,86 @@ | ||||||
| <general_rules> | ||||||
| - **Service Organization**: When creating new backend services, place them in `backend/LexBoxApi/Services/` and follow the namespace pattern `LexBoxApi.Services`. Always check if a similar service already exists before creating a new one. | ||||||
| - **Controller Organization**: When creating new API controllers, place them in `backend/LexBoxApi/Controllers/` and follow the namespace pattern `LexBoxApi.Controllers`. Controllers should be thin and delegate business logic to services. | ||||||
| - **Frontend Components**: When creating new UI components, place them in `frontend/src/lib/components/` organized by feature or functionality. Always check existing components before creating duplicates. | ||||||
| - **Task Automation**: Use Taskfile commands for all development workflows: | ||||||
| - `task up` - Start full development environment with Tilt | ||||||
| - `task api` - Backend-only development | ||||||
| - `task ui` - Frontend-only development | ||||||
| - `task test:unit` - Run backend unit tests | ||||||
| - `task fw-lite-web` - Run FwLite web application | ||||||
| - **Code Formatting**: | ||||||
| - Backend: Follow .NET conventions defined in `.editorconfig` (4-space indentation for C#) | ||||||
| - Frontend: Use ESLint and Prettier (2-space indentation, single quotes, 120 char line width) | ||||||
| - Run `pnpm run lint` and `pnpm run format` for frontend code quality | ||||||
| - **Namespace Conventions**: Follow established patterns: | ||||||
| - Backend services: `LexBoxApi.Services`, `FwHeadless.Services`, `LexCore.*` | ||||||
| - Backend controllers: `LexBoxApi.Controllers`, `FwHeadless.Controllers` | ||||||
| - Test namespaces: `Testing.*`, `*.Tests` | ||||||
| - **Database Migrations**: Use Entity Framework migrations via `task api:add-migration -- "MigrationName"` and `task api:db-update` | ||||||
| </general_rules> | ||||||
|
|
||||||
| <repository_structure> | ||||||
| - **Multi-Service Architecture**: LexBox is a complex linguistic application with multiple interconnected services: | ||||||
| - `backend/LexBoxApi/` - Main .NET 9.0 API (GraphQL, REST, authentication) | ||||||
| - `backend/FwHeadless/` - FieldWorks headless service for linguistic data processing | ||||||
| - `backend/SyncReverseProxy/` - Proxy service for Mercurial sync operations | ||||||
| - `backend/LexCore/` - Shared core library (entities, interfaces, utilities) | ||||||
| - `backend/LexData/` - Data access layer with Entity Framework | ||||||
| - `backend/FwLite/` - FieldWorks Lite application (Maui + Web) | ||||||
| - **Frontend Structure**: | ||||||
| - `frontend/src/routes/` - SvelteKit file-based routing with authenticated/unauthenticated route groups | ||||||
| - `frontend/src/lib/components/` - Reusable UI components organized by feature | ||||||
| - `frontend/viewer/` - Separate FwLite viewer application with its own build system | ||||||
| - **Infrastructure**: | ||||||
| - `deployment/` - Kubernetes configurations for local, staging, and production environments | ||||||
| - `Tiltfile` - Local development orchestration with Docker and Kubernetes | ||||||
| - `hgweb/` - Mercurial web interface configuration | ||||||
| - `otel/` - OpenTelemetry collector configuration for monitoring | ||||||
| - **Additional Services**: | ||||||
| - `platform.bible-extension/` - Platform.Bible extension for integration | ||||||
| - `docs/` - Platform-specific developer setup guides | ||||||
| </repository_structure> | ||||||
|
|
||||||
| <dependencies_and_installation> | ||||||
| - **Prerequisites**: | ||||||
| - .NET SDK 9.0 for backend development | ||||||
| - Node.js >=20 and PNPM >=9 for frontend development | ||||||
| - Docker Desktop with Kubernetes enabled for local development | ||||||
| - Taskfile for task automation | ||||||
| - Tilt for development orchestration | ||||||
| - **Backend Dependencies**: Use `dotnet restore` in backend projects or `task api:dotnet -- restore` | ||||||
| - **Frontend Dependencies**: Use `pnpm install` in frontend directory or `task ui:install` | ||||||
| - **Initial Setup**: Run `task setup` to configure the development environment, including: | ||||||
| - Git configuration and submodule initialization | ||||||
| - Kubernetes namespace setup | ||||||
| - Test data download | ||||||
| - Local environment file creation | ||||||
| - **Development Environment**: | ||||||
| - `task up` starts the full stack with Tilt orchestration | ||||||
| - Docker Desktop manages containers and Kubernetes cluster | ||||||
| - Local services run on localhost with port forwarding for API access | ||||||
| </dependencies_and_installation> | ||||||
|
|
||||||
| <testing_instructions> | ||||||
| - **Backend Testing**: | ||||||
| - Framework: xUnit with categorized tests (Unit, Integration, FlakyIntegration) | ||||||
| - Run unit tests: `task test:unit` (excludes database and integration tests) | ||||||
| - Run integration tests: `task test:integration` | ||||||
| - Test organization: `backend/Testing/` with subdirectories by service/component | ||||||
| - Database tests require running infrastructure via `task test:unit-with-db` | ||||||
|
Comment on lines
+66
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test categories list is incomplete and inaccurate. The PR's automated review identified that the actual test categories in the repository differ from what's documented here. The repository uses Apply this diff to correct the test categories: - **Backend Testing**:
- Framework: xUnit with categorized tests (Unit, Integration, FlakyIntegration)
+ **Backend Testing**:
+ - Framework: xUnit with categorized tests
+ - No category attribute: Unit tests (run by default with `task test:unit`)
+ - `Integration`: Integration tests (run with `task test:integration`)
+ - `FlakyIntegration`: Flaky integration tests
+ - `RequiresDb`: Tests requiring database (run with `task test:unit-with-db`)
+ - `Slow`: Slow-running tests
🤖 Prompt for AI Agents |
||||||
| - **Frontend Testing**: | ||||||
|
Comment on lines
+70
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify the distinction between unit, unit-with-db, and integration test commands. The current text mentions Apply this diff to clarify the test command usage: - **Backend Testing**:
- Framework: xUnit with categorized tests (Unit, Integration, FlakyIntegration)
- - Run unit tests: `task test:unit` (excludes database and integration tests)
+ - Run unit tests: `task test:unit` (excludes database, integration, and slow tests)
+ - Run database-dependent tests: `task test:unit-with-db` (runs tests marked with `RequiresDb`)
🤖 Prompt for AI Agents |
||||||
| - E2E Testing: Playwright for end-to-end browser tests | ||||||
| - Run: `pnpm run test` or `task ui:playwright-tests` | ||||||
| - Configuration: `playwright.config.ts` | ||||||
| - Unit Testing: Vitest for component and utility testing | ||||||
| - Run: `pnpm run test:unit` | ||||||
| - Test files located in `frontend/tests/` and `frontend/viewer/tests/` | ||||||
|
Comment on lines
+75
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify Vitest scope and location in the frontend architecture. The current documentation implies that Vitest is used for general frontend unit testing, but the automated review found that Vitest exists only in Apply this diff to clarify the Vitest and testing split: - **Frontend Testing**:
- E2E Testing: Playwright for end-to-end browser tests
- Run: `pnpm run test` or `task ui:playwright-tests`
- Configuration: `playwright.config.ts`
- - Unit Testing: Vitest for component and utility testing
+ - Unit Testing: Vitest for FwLite viewer component and utility testing
- Run: `pnpm run test:unit`
+ - Note: Vitest is configured in `frontend/viewer/` for the separate viewer application
+ - Main frontend components use Playwright for E2E testing; no dedicated unit test framework for general components
🤖 Prompt for AI Agents |
||||||
| - **FwLite Testing**: | ||||||
| - .NET tests: `dotnet test FwLiteOnly.slnf` for FwLite-specific tests | ||||||
| - Separate test projects: `*.Tests` projects within `backend/FwLite/` | ||||||
| - **Test Categories**: Backend tests use attributes like `[Trait("Category", "Integration")]` to organize test execution | ||||||
| - **Browser Testing**: Playwright tests can be run with `--ui` flag for interactive debugging | ||||||
| </testing_instructions> | ||||||
|
|
||||||
| <pull_request_formatting> | ||||||
| </pull_request_formatting> | ||||||
|
Comment on lines
+85
to
+86
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove or fill the empty The section is empty and provides no guidance to developers. Either add content describing pull request formatting conventions or remove the section entirely. Consider either:
-<pull_request_formatting>
-</pull_request_formatting>or fill with appropriate content about PR conventions. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjust frontend indentation documentation to match actual Prettier configuration.
The documentation claims 2-space indentation is explicitly configured, but the PR's automated review noted that 2-space indentation is actually the Prettier default for TypeScript/Svelte files, not an explicit
.prettierrcsetting. The.prettierrconly explicitly setssingleQuoteandprintWidth(120 char).Apply this diff to correct the indentation claim:
- **Code Formatting**: - Backend: Follow .NET conventions defined in `.editorconfig` (4-space indentation for C#) - - Frontend: Use ESLint and Prettier (2-space indentation, single quotes, 120 char line width) + - Frontend: Use ESLint and Prettier (single quotes, 120 char line width, default 2-space indentation for TypeScript/Svelte)🤖 Prompt for AI Agents