3.2 KiB
3.2 KiB
AGENTS.md
Scope
- This repository contains the Belki calculator/VK bot plus legacy CatWar userscript assets.
- Key files:
app/,web/calculator.html,Dockerfile, anddeploy/k8s/.
Working Rules
- Keep the calculation domain independent from HTTP, VK, and Kubernetes.
- Keep VK tokens and group IDs out of the repository; use environment variables or Kubernetes Secrets.
- Production manifests are already applied in namespace
belki; CI deploys them frommainusing the namespace-scoped RBAC indeploy/k8s/rbac.yaml. - The production build uses the GitLab runner tag
fast, a privileged Docker executor, and an explicitdocker:29.6.1-dindservice alias over TCP. - Production images and Kubernetes workloads are amd64-only. Preserve
linux/amd64in Dockerfiles, CI build commands, and workload node selectors; do not reintroduce the arm64-only Python base tag. - When adding, removing, or updating a runtime dependency, rebuild and push the matching immutable base image to
reg.nyan404.ru, then update its tag in the final Dockerfile before running CI.requirements.txtmaps toDockerfile.base;nginx.confmaps toDockerfile.gateway-base. - Use Context7 for current official documentation when implementing or changing an external API, framework, or library integration.
- Before adding or updating any dependency, use
prevent-eolto check lifecycle support; do not treat its results as a vulnerability assessment. - For web UI work, use the project-local
.codex/skills/frontend-craft,.codex/skills/frontend-design, and.codex/skills/ui-ux-pro-maxinstructions: establish a deliberate visual direction, preserve accessibility and interaction quality, then inspect the rendered result.
Validation
- For CI-only changes, prefer a targeted YAML parse and a diff review.
- For image/runtime changes, check the
Dockerfile, Python entrypoint, static asset serving, and CI job together. - For k3s changes, validate YAML and current cluster inventory first; keep
KUBE_CONFIG_B64masked/protected in GitLab. - Do not add unnecessary local build artifacts or temporary files to the repository.
Notes
- VK scheduler lives in
app/belki/vk_scheduler.py; useBELKI_DATABASE_URLin production andBELKI_HISTORY_DBfor local SQLite checks. Keep mailing disabled until an administrator explicitly enables a conversation and schedule. - The build job waits for the DinD daemon and runs
docker infobefore building. - Never commit
.envor.gitlab.variables.env; the latter contains the GitLab Variable handoff and a namespace-scoped kubeconfig. - Private image storage is the separate Kubernetes Secret
belki-image-store, not the CI-recreatedbelki-runtime. It contains only the internal MinIO endpoints and bucket-scoped credentials; keep MinIO private and preserve the/api/images/<id>Belki proxy when changing upload flows.
Agent Rules
- Zod
.describe()on optional fields: always append.optional()— e.g.zod.string().describe("…").optional()— to avoid validation failures when the field is absent. - After completing a task, create one or more focused, logical Git commits; do not push unless the user explicitly asks.