-
Notifications
You must be signed in to change notification settings - Fork 894
feat: add Claude.md initial draft #17785
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Claude.md initial draft
- Loading branch information
commit 1803449aacb44d87b14725f7d640b7922e5f85ea
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# Coder Development Guidelines | ||
|
||
## Build/Test/Lint Commands | ||
|
||
### Main Commands | ||
|
||
- `make build` or `make build-fat` - Build all "fat" binaries (includes "server" functionality) | ||
- `make build-slim` - Build "slim" binaries | ||
- `make test` - Run Go tests | ||
- `make test RUN=TestFunctionName` or `go test -v ./path/to/package -run TestFunctionName` - Test single | ||
- `make test-postgres` - Run tests with Postgres database | ||
- `make test-race` - Run tests with Go race detector | ||
- `make test-e2e` - Run end-to-end tests | ||
- `make lint` - Run all linters | ||
- `make fmt` - Format all code | ||
- `make gen` - Generates mocks, database queries and other auto-generated files | ||
|
||
### Frontend Commands (site directory) | ||
|
||
- `pnpm build` - Build frontend | ||
- `pnpm dev` - Run development server | ||
- `pnpm check` - Run code checks | ||
- `pnpm format` - Format frontend code | ||
- `pnpm lint` - Lint frontend code | ||
- `pnpm test` - Run frontend tests | ||
|
||
## Code Style Guidelines | ||
|
||
### Go | ||
|
||
- Follow [Effective Go](https://go.dev/doc/effective_go) and [Go's Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments) | ||
- Use `gofumpt` for formatting | ||
- Create packages when used during implementation | ||
- Validate abstractions against implementations | ||
|
||
### TypeScript/React | ||
|
||
- Use TypeScript for all frontend code | ||
- Follow ESLint and Prettier configurations | ||
ibetitsmike marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Components should be atomic, reusable, and free of business logic | ||
ibetitsmike marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Modules can contain Coder-specific business logic | ||
ibetitsmike marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Error Handling | ||
|
||
- Use descriptive error messages | ||
- Wrap errors with context | ||
- Propagate errors appropriately | ||
- Use proper error types | ||
- (`xerrors.Errorf("failed to X: %w", err)`) | ||
|
||
### Naming | ||
|
||
- Use clear, descriptive names | ||
- Abbreviate only when obvious | ||
- Follow Go and TypeScript naming conventions | ||
|
||
### Comments | ||
|
||
- Document exported functions, types, and non-obvious logic | ||
- Follow JSDoc format for TypeScript | ||
- Use godoc format for Go code | ||
|
||
## Commit Style | ||
|
||
- Follow [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) | ||
- Format: `type(scope): message` | ||
- Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore` | ||
- Keep message titles concise (~70 characters) | ||
- Use imperative, present tense in commit titles | ||
|
||
## Database queries | ||
|
||
- MUST DO! Any changes to database - adding queries, modifying queries should be done in the `coderd\database\queries\*.sql` files. | ||
- MUST DO! Queries are grouped in files relating to context - e.g. `prebuilds.sql`, `users.sql`, `provisionerjobs.sql`. | ||
- After making changes to any `coderd\database\queries\*.sql` files you must run `make gen` to generate respective ORM changes. | ||
|
||
## Architecture | ||
|
||
### Core Components | ||
|
||
- **coderd**: Main API service connecting workspaces, provisioners, and users | ||
- **provisionerd**: Execution context for infrastructure-modifying providers | ||
- **Agents**: Services in remote workspaces providing features like SSH and port forwarding | ||
- **Workspaces**: Cloud resources defined by Terraform | ||
|
||
## Sub-modules | ||
|
||
### Template System | ||
|
||
- Templates define infrastructure for workspaces using Terraform | ||
- Environment variables pass context between Coder and templates | ||
- Official modules extend development environments | ||
|
||
### RBAC System | ||
|
||
- Permissions defined at site, organization, and user levels | ||
- Object-Action model protects resources | ||
- Built-in roles: owner, member, auditor, templateAdmin | ||
- Permission format: `<sign>?<level>.<object>.<id>.<action>` | ||
|
||
### Database | ||
|
||
- PostgreSQL 13+ recommended for production | ||
- Migrations managed with `migrate` | ||
- Database authorization through `dbauthz` package | ||
|
||
## Frontend | ||
|
||
### Tech Stack | ||
|
||
- React with TypeScript | ||
- Material UI v5 for components | ||
ibetitsmike marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- TanStack Query v4 for data fetching | ||
- Emotion for styling | ||
- Formik with Yup for forms and validation | ||
|
||
### Structure | ||
|
||
- `/site/` directory contains all UI code | ||
- Components in `/site/src/components` | ||
- Feature modules in `/site/src/modules` | ||
- Pages in `/site/src/pages` | ||
|
||
### State Management | ||
|
||
- React Query for API data fetching and caching | ||
- Context-based state with providers | ||
ibetitsmike marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- React Router for navigation | ||
|
||
### Accessibility | ||
|
||
- Color contrast meets WCAG AA compliance (4.5:1 ratio) | ||
- Proper labeling for input elements | ||
- Include descriptive text for images | ||
|
||
### Testing | ||
|
||
- End-to-end testing with Playwright | ||
- Integration testing with Jest and react-testing-library | ||
ibetitsmike marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Visual testing with Storybook and Chromatic |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.