@.claude/docs/WORKFLOWS.md @.cursorrules @README.md @package.json
| Task | Command | Notes |
|---|---|---|
| Development | ./scripts/develop.sh |
|
| Build | make build |
Fat binaries (includes server) |
| Build Slim | make build-slim |
Slim binaries |
| Test | make test |
Full test suite |
| Test Single | make test RUN=TestName |
Faster than full suite |
| Test Postgres | make test-postgres |
Run tests with Postgres database |
| Test Race | make test-race |
Run tests with Go race detector |
| Lint | make lint |
Always run after changes |
| Generate | make gen |
After database changes |
| Format | make fmt |
Auto-format code |
| Clean | make clean |
Clean build artifacts |
pnpm build- Build frontendpnpm dev- Run development serverpnpm check- Run code checkspnpm format- Format frontend codepnpm lint- Lint frontend codepnpm test- Run frontend tests
pnpm run format-docs- Format markdown tables in docspnpm run lint-docs- Lint and fix markdown filespnpm run storybook- Run Storybook (from site directory)
- Modify
coderd/database/queries/*.sqlfiles - Run
make gen - If audit errors: update
enterprise/audit/table.go - Run
make genagain
- Find definitions:
mcp__go-language-server__definition symbolName - Find references:
mcp__go-language-server__references symbolName - Get type info:
mcp__go-language-server__hover filePath line column - Rename symbol:
mcp__go-language-server__rename_symbol filePath line column newName
- Find definitions:
mcp__typescript-language-server__definition symbolName - Find references:
mcp__typescript-language-server__references symbolName - Get type info:
mcp__typescript-language-server__hover filePath line column - Rename symbol:
mcp__typescript-language-server__rename_symbol filePath line column newName
// OAuth2-compliant error responses
writeOAuth2Error(ctx, rw, http.StatusBadRequest, "invalid_grant", "description")// Public endpoints needing system access
app, err := api.Database.GetOAuth2ProviderAppByClientID(dbauthz.AsSystemRestricted(ctx), clientID)
// Authenticated endpoints with user context
app, err := api.Database.GetOAuth2ProviderAppByClientID(ctx, clientID)- Run
git pullto ensure latest code - Check if feature touches database - you'll need migrations
- Check if feature touches audit logs - update
enterprise/audit/table.go
- coderd: Main API service
- provisionerd: Infrastructure provisioning
- Agents: Workspace services (SSH, port forwarding)
- Database: PostgreSQL with
dbauthzauthorization
- Use unique identifiers:
fmt.Sprintf("test-client-%s-%d", t.Name(), time.Now().UnixNano()) - Never use hardcoded names in concurrent tests
- Full suite:
./scripts/oauth2/test-mcp-oauth2.sh - Manual testing:
./scripts/oauth2/test-manual-flow.sh
NEVER use time.Sleep to mitigate timing issues. If an issue
seems like it should use time.Sleep, read through https://github.com/coder/quartz and specifically the README to better understand how to handle timing issues.
- Follow Uber Go Style Guide
- Commit format:
type(scope): message
@.claude/docs/OAUTH2.md @.claude/docs/TESTING.md @.claude/docs/TROUBLESHOOTING.md @.claude/docs/DATABASE.md
- Audit table errors → Update
enterprise/audit/table.go - OAuth2 errors → Return RFC-compliant format
- Race conditions → Use unique test identifiers
- Missing newlines → Ensure files end with newline
This file stays lean and actionable. Detailed workflows and explanations are imported automatically.