- task-discipline: require explicit target platform/language before implementation - go-api: bounded context deadline on every outbound network/DB call - controls-selection: visible busy state for any control triggering such a call - import-export: enumerate real format variants before writing a parser - app-binary: embedded assets do not hot-reload; verify rebuild before diagnosing Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1.8 KiB
1.8 KiB
Contract: Application Binary
Version: 1.1
Purpose
Правила сборки, упаковки ресурсов и первого запуска Go-приложений.
See README.md for deployment examples and a sample config template.
Rules
- When the agent deploys or runs commands on a host, the application lives in
/appdata/<appname>/. - Do not suggest alternate default install paths such as
/opt,/usr/local/bin, or~/. - The binary must be self-contained. Templates, static assets, config templates, and DB migrations are embedded with
//go:embedor an equivalent application-owned mechanism. - The application creates its config automatically on first run if it does not exist yet.
- Default config path:
- single-user mode:
~/.config/<appname>/config.yaml - server or multi-user mode:
/etc/<appname>/config.yamlor next to the binary
- single-user mode:
- Config stores application settings and centralized DB credentials only. It must not store user data, cache/state, or SQLite path configuration.
- For local SQLite mode, the database file lives next to the config and its path is derived by the application, not configured separately.
- On first run with no config, the application must create the config, print its path, exit 0, and stop. It must not continue startup with a fresh placeholder config.
- The binary must not depend on the caller's working directory.
- Assets bundled at compile time (
//go:embedand equivalents) do not hot-reload. Before diagnosing a bug reported against a generated or served artifact, confirm the running process was rebuilt and restarted after the last change; use the displayed build version (build-version-display) to check. - Build with
CGO_ENABLED=0when possible. Enable CGO only when the chosen storage/runtime actually requires it, such as SQLite drivers that need CGO.