Installation lifecycle

Baseline skill. Read references/specification.md, references/installation-scripts.md and references/engineering-contract.md before implementing installation. New-project bootstrap has already installed scripts/install.sh, upgrade.sh, uninstall.sh, install.py, version constants and new-release.sh from approved BMForge templates. Do not create a second installer or release script without a named requirement.

  1. Ask or infer from explicit requirements which topology is actually needed: library/CLI-only, single-machine service, or client/server on separate machines. Do not select client/server merely because the application uses ZeroMQ or HTTP.
  2. Use the existing scripts/install.py and thin wrappers as the default implementation. It starts with DEPLOYMENT_READY = False. Complete its file ownership, deployment preparation, configuration preservation and validation for the actual application before enabling it. No empty stub may claim an installation completed.
  3. Every successfully installed project owns D<Name>.BASE_DIR, normally /opt/prod/<slug>, including pure client and custom library installs. Include a readable <slug>/constants/D<Name>.py, the existing .installation-manifest.json ownership record and the .deployment-version marker containing the successfully installed literal D<Name>.VERSION. If pyproject.toml contains a version, keep it in sync. Keep the payload minimal for library-only installs, but actually install/verify the chosen library or CLI.
  4. If two deployment roles are explicitly required, inspect references/source/devlog/ to learn the client-only install.sh -server HOST, optional install-server.sh, persisted conf/installation.json role, release activation and role-preserving upgrade.sh pattern. Adapt this behaviour inside the application’s own deployment interface. Never transplant DevLog’s time-tracker features, database credentials or hard-coded ports.
  5. Python production isolation (specification 0.1.3): for a Python application with dependencies, configure the existing installer with REQUIREMENTS_FILE = "requirements.txt", SYSTEM_PYTHON pointing to the host interpreter (not a development venv), and RUNTIME_IMPORTS listing the package, service, CLI/client and significant third-party modules. Deploy requirements into <BASE_DIR>, create/reuse <BASE_DIR>/.venv, run its pip with install --upgrade -r followed by pip check and deployed imports, and record venv_owned before creation. Preflight host venv/ensurepip, not global PyZMQ. Refuse editable/development requirements, unowned venvs and broken venvs. --check must be read-only; failed installation/import/startup may never advance .deployment-version. Remove only installer-owned venvs on uninstall. When dependencies are absent, do not create a venv.
  6. Wire every deployed entry point: make systemd WorkingDirectory the installed application directory and ExecStart use <BASE_DIR>/.venv/bin/python. Deployed CLI/client launchers must cd <BASE_DIR> and execute that interpreter. Fail2ban actions, service health checks, activation probes and scheduled jobs must call the installed launcher or the same interpreter. Never run a production application with /usr/bin/python3 or a developer checkout python3, PYTHONPATH, editable install or path under /opt/dev. Codex must update actual service definitions, not stop after creating .venv.
  7. Preflight the role-and-operation-specific executable set before any host changes, using identical prerequisites for the actual action and --check. A fresh server installation must verify mariadb when it will provision a database; client installs and upgrades that never provision a database must not require that administrator executable. For a client-only machine, do not install server dependencies, provision MariaDB, create users/systemd units, or require a running server during installation. Validate the address before changes. For a server, provision only explicitly required services, validate startup through the existing application health endpoint, and preserve secrets/configuration.
  8. Implement and test all three mandatory operations: install, upgrade and uninstall. Only create an install-server.sh when a separate server installation role is genuinely required. Upgrade retains the installed role and user data; uninstall removes managed files/services for that role while retaining application/user data unless explicitly authorized otherwise.
  9. Use disposable directories and local service/DB fixtures to test metadata-only library installs, client-only installs, server installs, upgrades of both roles, failed activation, uninstall and repeat uninstall. Simulate missing executables and verify that --check and the real action both fail before mutation only when those executables are required by the specific operation. For Python services, exercise a real offline dependency install/upgrade, failed pip/imports, an unowned venv, and the service/client/health runtime with the development checkout unavailable. Verify ownership, read-only checks and the last-successful marker. DevLog’s pinned revision has no uninstall script; don’t mistake it for a complete implementation.
  10. Before releasing, check that deployment is enabled, wrappers are executable, --help and --check work, installed versions match the application’s literals, and success markers move only after verification. Applying the bmforge.installation component marker is provenance, not a substitute for testing.
  11. No installation or uninstall on a real host, Git release, privilege escalation or secret provisioning is authorized merely by loading this skill. Implementation and use are separate. Report which operations were tested and what needs explicit user approval.

The stable standards for Git release publication and skill-version update notifications remain unchanged.