Files
bortstack-forge/skills/deployment-check/SKILL.md
T

14 KiB
Raw Blame History

name, description
name description
deployment-check Safely preflight, execute, verify, or assess a web-app deployment using repository and runtime evidence. Check release artifacts, configuration/secrets, migrations, containers/processes, reverse proxy/TLS, health, logs, smoke tests, backup/rollback readiness, and release recording. Production mutation requires explicit user authorization; stop on failed gates instead of improvising.

Deployment Check

Version: 2.0.

Use this skill when the user asks to prepare for, validate, perform, verify, troubleshoot, or roll back a deployment of a web application.

This skill is narrower than a production-readiness review. It answers: can this specific release be deployed safely, and did the deployment actually succeed?

Repository workflow

In a BortStack project, use bortstack-context with the applicable repository AGENTS.md before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action.

For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use bortstack-contributor for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority.

When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing testtask wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure.

Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there.

  • use production-readiness-review for broad launch readiness rather than a specific release operation;
  • use webapp-debug if a post-deploy failure needs root-cause investigation rather than deployment gating.

Do not redefine the repository's task, decision, branch, or deployment conventions.

Core principle

Deployment is a sequence of gates, not a script to force through.

At every stage ask:

  • Do we know exactly what release is being deployed?
  • Are configuration, secrets, data, and dependencies ready for that release?
  • Is the migration path safe and recoverable?
  • Can the release be verified from the user-facing path?
  • Can we return to a known-good state if verification fails?

If a required gate fails, stop. Do not improvise destructive workarounds merely to get a green deployment.

Deployment modes

Determine the requested mode from the user's instruction.

Preflight

Read-only assessment before deployment. Verify readiness of the specific release and identify blockers. Do not mutate production.

Execute

Perform the deployment only when the user has explicitly requested deployment and the required production access is available. Mutation is limited to the approved deployment scope.

Verify

Inspect an already-performed deployment using health, logs, smoke tests, release identity, proxy/TLS, and data/migration evidence. Avoid unrelated changes.

Rollback / recovery

Use only when explicitly requested or when the deployment plan already authorizes an automatic rollback on failed verification. Prefer the documented release-specific rollback path. Never invent rollback commands against production data.

If the user's request is ambiguous between checking and deploying, default to Preflight.

Mutation authorization gate

Read the repository’s merge, release and deployment authority rules and identify the exact authorised artifact before acting. Successful source checks do not grant deployment authority.

Repository inspection, local validation, reading logs, and non-destructive health/smoke requests are normally safe.

Before any action that changes production state, confirm that the current user request explicitly authorizes that class of action. Examples include:

  • pulling/restarting production containers;
  • changing Compose/systemd/Kubernetes state;
  • applying database migrations to production;
  • updating a release/image reference;
  • changing proxy configuration;
  • changing DNS/TLS;
  • rotating secrets;
  • restoring a database;
  • rollback to another release.

Authorization to "check deployment" is not authorization to deploy. Authorization to deploy application containers is not automatically authorization to change DNS, rotate credentials, or restore data.

Do not commit, push, merge, or switch branches unless the user explicitly requests it and repository rules permit it.

Workflow

1. Establish release identity and topology

Read repository context and inspect deployment-relevant files. Determine, where evidence permits:

  • source commit / tag / release ID;
  • image name, tag, and preferably immutable digest;
  • frontend/backend/database services;
  • database engine and migration mechanism;
  • production Compose/Kubernetes/systemd topology;
  • reverse proxy and TLS termination;
  • secrets/config source;
  • persistent volumes/data paths;
  • health/readiness mechanism;
  • backup/recovery mechanism;
  • expected external services;
  • rollback method and previous known-good release.

Never deploy an unidentified working tree or ambiguous mutable artifact when the project requires immutable releases.

2. Preflight the release

Use references/deployment-gates.md as the coverage guide.

At minimum, verify the applicable gates:

  • repository/Git state matches the intended release;
  • required CI/build/test gates are satisfied or freshly rerun where practical;
  • release artifacts exist and correspond to the intended source;
  • runtime versions are supported;
  • production config contains required keys without exposing secret values;
  • no development/debug configuration is accidentally enabled;
  • target ports/networks/volumes are coherent;
  • database connectivity assumptions and migration head are known;
  • destructive/irreversible migration risks are identified;
  • current backup/recovery evidence is adequate for the planned data change;
  • proxy/TLS hostnames and routing expectations are known;
  • external dependencies required at startup/runtime are understood;
  • disk/resource capacity has no obvious blocker when runtime access permits checking it;
  • rollback target/procedure exists before changing production.

A successful syntax check is not sufficient if critical release identity, migration, or recovery gates are unknown.

3. Validate configuration without leaking secrets

Inspect names/presence/types and safe metadata only.

Do not echo secret contents into the response. When needed, report:

  • missing key;
  • unexpected source;
  • empty value;
  • malformed non-secret structure;
  • permission/ownership issue;
  • environment mismatch.

Use repository examples/schema/config code to determine requirements rather than guessing.

4. Treat database migrations as a separate gate

Use references/migration-safety.md to evaluate migration ordering, compatibility, backup and recovery.

Before production migration, inspect the actual migration(s) between current and target revisions.

Check for risks such as:

  • drops/renames that lose data;
  • non-null columns without safe population/default strategy;
  • type conversions;
  • uniqueness/foreign-key additions against existing data;
  • long table rewrites/locks;
  • data backfills mixed into schema change;
  • one-way migrations that make application rollback unsafe;
  • mismatch between application and migration release ordering.

Where supported, validate on a disposable/restored database first.

Do not rewrite existing production migration history to simplify deployment.

5. Execute only the documented minimal release change

In Execute mode, prefer project-defined scripts/workflows over ad-hoc commands.

Typical safe ordering may be:

  1. capture current release identity and runtime state;
  2. confirm recent backup/recovery gate if data changes require it;
  3. fetch/pull the exact approved artifact;
  4. run migration at the documented point in the release sequence;
  5. replace/restart only intended services;
  6. wait for health/readiness;
  7. verify through the real proxy/user-facing path;
  8. inspect relevant logs;
  9. record the exact deployed release.

But always follow repository-specific deployment order when it differs.

Avoid latest-style ambiguity when immutable tags/digests are available.

6. Verify the deployed release

Verification must go beyond "container is running".

Where applicable, verify:

  • deployed image/release identity matches the approved artifact;
  • container/process state and restart loops;
  • application liveness/readiness;
  • database migration revision;
  • user-facing HTTPS endpoint through the real reverse proxy;
  • TLS certificate/hostname behavior;
  • authentication/session path if safe test credentials exist;
  • one or more critical read/write smoke paths appropriate to the app;
  • static assets/frontend API routing;
  • external service behavior needed for core flows;
  • recent error/warning logs;
  • backup/monitoring jobs remain healthy after deployment.

Do not create real customer/user data for smoke tests unless the project has an approved test mechanism.

7. Decide success, stop, or rollback

Use one of these deployment outcomes:

  • Pass — all required gates and post-deploy verification succeeded.
  • Pass with conditions — deployment is functioning, but explicit non-blocking limitations remain.
  • Stop before deployment — a preflight gate failed; production was not changed.
  • Deployment failed — rollback required — production changed and required verification failed, with a known rollback path available.
  • Deployment state uncertain — evidence/access is insufficient to determine a safe state; avoid further mutation until state is established.

If rollback is required and authorized, use the known previous release and documented data compatibility rules. If database migration makes rollback unsafe, do not pretend application-only rollback is sufficient.

8. Update context after an authorized deployment

In BortStack projects, preserve durable deployment facts when appropriate, such as:

  • exact deployed release/digest;
  • validation result;
  • new verified production state;
  • blocker/failure discovered;
  • rollback performed;
  • task completion/blocking state;
  • concise next-session handoff.

Do not store credentials, secret values, or noisy transient logs in context documentation.

Do not mark a deployment task Complete if required verification was blocked or failed.

Failure handling rules

  • Stop on an unexpected migration state before applying new migrations.
  • Stop when the artifact does not match the intended release.
  • Stop when required secrets/config are missing or ambiguous.
  • Stop when there is no acceptable rollback/recovery path for a risky data change.
  • Stop on failing health/readiness instead of hiding it with longer arbitrary sleeps.
  • Inspect logs/evidence before restarting repeatedly.
  • Do not disable TLS verification, auth, health checks, migrations, tests, or security controls merely to complete a deployment.
  • Do not delete volumes, databases, caches, certificates, or release history unless the user explicitly authorizes the specific destructive action.

Output format

For Preflight, start with one of:

  • Ready to deploy
  • Ready to deploy with conditions
  • Stop before deployment
  • Preflight incomplete

For Execute/Verify, start with one of:

  • Deployment passed
  • Deployment passed with conditions
  • Deployment failed — rollback required
  • Deployment state uncertain

Then report:

  1. release identity and target environment;
  2. repository/runtime/deployment evidence inspected;
  3. preflight gate results;
  4. actions actually performed (if any);
  5. database/migration result;
  6. service/container/process state;
  7. proxy/TLS/health/smoke results;
  8. relevant log findings;
  9. rollback/recovery readiness or action;
  10. validation limitations/unverified assumptions;
  11. context/task updates made, if any;
  12. exact recommended next action.

When useful, present gates as a concise table with Pass / Fail / Blocked / Not applicable / Not verified.

Completion criteria

A deployment check is complete only when:

  1. the intended release and environment are unambiguous;
  2. applicable preflight gates were checked against real evidence;
  3. production mutation, if any, was explicitly authorized;
  4. migration/data risk was considered separately;
  5. post-deploy verification used the real runtime/user-facing path where available;
  6. release identity and rollback state are known;
  7. failures/unknowns are reported honestly rather than worked around speculatively;
  8. the final deployment outcome matches the evidence.