with one click
webstatus-backend
// Use when creating or modifying Go backend API endpoints, modifying Spanner database schemas, or working with OpenAPI and Spanner mappers.
// Use when creating or modifying Go backend API endpoints, modifying Spanner database schemas, or working with OpenAPI and Spanner mappers.
Use when working with the webstatus notification pipeline, event producer, push delivery, or push workers (e.g., Email, Webhooks), and Pub/Sub subscribers.
Use when modifying the ANTLR search grammar, adding new search terms, or working with the query parser and builder.
Use when writing, modifying, or debugging Playwright end-to-end (E2E) tests for webstatus.dev.
Use when modifying the frontend SPA, working with TypeScript, Lit web components, Shoelace components, or frontend tests.
Use when working on Go data ingestion workflows, scheduled Cloud Run jobs, or adding new scrapers for BCD, WPT, or other data sources.
Use when upgrading toolchain versions (Go, Node.js, Terraform, Playwright) or updating the DevContainer and Github CI configurations.
| name | webstatus-backend |
| description | Use when creating or modifying Go backend API endpoints, modifying Spanner database schemas, or working with OpenAPI and Spanner mappers. |
This skill provides guidance for developing the Go-based backend API for webstatus.dev.
backend/pkg/httpserver): Handles routing and requests via oapi-codegen stubs.lib/gcpspanner/spanneradapters): Translates API types to database types.lib/gcpspanner): Core logic for Spanner interactions using the Mapper pattern.lib/valkeycache): Isolated via Private Service Connect (PSC) for secure internal access.For a technical deep-dive into the backend implementation patterns, request flows, and auth middleware, see references/architecture.md.
lib/, util/, and the OptionallySet pattern.We use a Hexagonal-style Adapter Pattern to decouple application logic from infrastructure.
pkg/sender).lib/ (e.g., lib/gcpspanner/spanneradapters or lib/valkeycache).lib/backendtypes) to map raw internal errors to safe, static sentinel errors before they cross boundaries. This prevents dynamic context or database details from leaking to presentation layers.v1.QueryError in blobtypes) instead of using internal types directly. This maintain boundary isolation and prevents changes in the backend from breaking saved logs or deliveries.executionData).Load methods). Using structured types allows for future extension and maintains type safety.generic.OptionallySet[[]T] instead of relying on nil or empty slices to distinguish between "empty but validly checked" and "not set/not applicable". This ensures explicit intent and avoids ambiguity.spanneradapters for DB interactions in the API.gcpspanner.Client directly from httpserver handlers.row.ToStruct(&yourStruct) instead of manual column scanning.lib/gcpspanner.lib/workertypes for any data crossing service boundaries (e.g. results sent to Pub/Sub).testcontainers-go for any changes to the lib/gcpspanner layer.backend/pkg/httpserver/cache.go.lib/backendtypes into lib/gcpspanner (prevents circular dependencies).gcpspanner client.Merge functions in mappers copy ALL fields, including UpdatedAt....WithTransaction variants of helpers when inside a ReadWriteTransaction.eventPublisher.PublishSearchConfigurationChanged in handlers that modify user saved searches to trigger immediate notification dispatcher updates.make precommit to execute the full suite of Go tests, formatting, and linting.make go-lint to lint all Go code using golangci-lint.go.work), to run tests quickly for a single package without running the whole suite, execute go test from within the specific module directory, or provide the full module path:
cd backend && go test -v ./pkg/...
# Or
go test -v github.com/GoogleChrome/webstatus.dev/lib/gcpspanner/...
lib/gcpspanner MUST include integration tests using testcontainers-go against the Spanner emulator.When making significant architectural changes, adding new major endpoints, or altering the database schema:
GEMINI.md to ensure I am aware of the changes.docs/ARCHITECTURE.md if the system boundaries change.