Code Quality & Validation Standards
This skill defines the multi-tier code quality, formatting, linting, and type checking standards across the GitHub Backup Automation System monorepo.
1. Branch-First Development
[!IMPORTANT] CREATE A LOCAL BRANCH FIRST: Always start by creating a local branch from
main:git switch -c MishraShardendu22/main/<feature-name>Never develop code or run refactors directly on
main.
2. Tooling Matrix by Language
| Language | Subsystem | Formatter | Linter | Static Type Checker |
|---|---|---|---|---|
| Go | Backend & CLI | gofmt |
go vet ./... |
Go Compiler (go build ./...) |
| Python | Agentic Observatory | Ruff / Black compatible | Ruff check / Pyright | Pyright (uv run --with pyright pyright) |
| TypeScript | Next.js Frontend | Biome (pnpm run format) |
Biome (biome check) |
TypeScript Compiler (tsc --noEmit) |
2. Code Quality Rules
1. Go Guidelines
- Always format code using standard
gofmtbefore committing. - Zero compiler warnings or
go vetissues allowed. - Prefer structured logging via
util.Logger()in CLI andlogger.Log(slog) inbackend/. - Clean up goroutines and database connection handles using
defer.
2. Python Observatory Guidelines
- Python 3.12+ type annotations required on all function arguments, return types, and Pydantic models.
- Zero errors in Pyright type checking (
agentic-observatory/pyrightconfig.json). - Ensure all async functions and SQLAlchemy sessions are properly awaited and closed.
3. Frontend TypeScript Guidelines
- Strict TypeScript checks with zero
anytypes wherever possible. - Use Biome for combined linting and code formatting (
frontend/package.json). - Ensure components render cleanly in Next.js Turbopack production builds.
3. Developer CLI Runbook
# Auto-format all Go and TypeScript files
make format
# Run all linters across Go, Python, and Frontend
make lint
# Run static type checkers across Python and Frontend
make typecheck
# Full pre-commit validation pass
make pre-commit