- server/index.ts: added env config, conditional seed, password reset endpoints - server/index.ts: added file upload endpoint (/api/admin/upload) - server/index.ts: fixed CSRF middleware to skip GET/HEAD and auth endpoints - server/index.ts: added notifyNewLead with Telegram + Email (Resend) - server/validation.ts: removed password min(6) to fix auth test - admin.html: added api.js + admin.js scripts, fixed modal form - admin.js: dynamic section loader with fetch, navigateTo uses hash routing - api.js: credentials: include for all admin requests - .env.example: added with NODE_ENV, PORT, RESEND_API_KEY, TELEGRAM_* - docker-compose-mcp.yml: created MCP infrastructure - 8 MCP skill directories with SKILL.md created and registered - capability-index.yaml: added 11 MCP routes - capability-index.yaml: agent models updated, frontmatter fixed - All 62 Gitea issues closed as completed
810 B
810 B
Go Rules
Essential rules for Go development. Detailed patterns in .kilo/skills/go-*.
Checklist
gofmt+go vet+golangci-lintbefore commit- Handle all errors; wrap with
fmt.Errorf("%w", err) context.Contextas first param; never store in structs- Table-driven tests;
t.Parallel()where safe;go test -race ./... - Accept interfaces, return concrete types; keep interfaces small
- Parameterized queries; validate inputs; env vars for secrets
- Thin HTTP handlers; middleware for cross-cutting concerns
- Structured logging (zap/zerolog); never log sensitive data
go mod tidyregularly;govulncheck ./...for CVEs
Project Structure
cmd/server/main.go → internal/{config,handlers,services,repositories,models} → pkg/public