Skip to content
Back to skills

Deploy

ASecurity

Build a container image, push it, and deploy the service to the Akka platform. This is the transition from local development to development on the AAO platform.

  • 8 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 20, 2026
ai-agentsjavashelldockertestinggitapi

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned November 27, 2026

npx -y skills add akka/ai-marketplace --skill deploy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Deploy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Deploy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/akka-deploy/badge)](https://www.skillsdirectory.com/skills/akka-deploy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: deploy
description: "Build a container image, push it, and deploy the service to the Akka platform. This is the transition from local development to development on the AAO platform."
---

## User Input

You **MUST** consider the user input before proceeding (if not empty).

## Before anything else

This command keeps a run in the idea's record when the akka CLI has one: the
`akka_run_start` MCP tool is available, or the output of `akka specify run start
--help` contains `--station`. A CLI without it predates the idea record. With
such a CLI, say so once and carry this command out as before: skip every step
marked **Idea record**, and open no run.

**Idea record: a console run.** Call the `akka_run_context` MCP tool first when
it is available: it answers `{ console, idea, station, run, spec, topic,
questions }`, and `console: true` means the console started this command. Only
without that tool, the console started it when `AKKA_RUN_ID` is set in its
environment, or when the command has no shell to run the akka CLI in. The
console has already opened the run and enforced the rules for it, so in a
console run the run is open from the first step: its id is the `run`
`akka_run_context` answered. Any stop before the normal close, such as a
mode-check refusal, a missing argument, or a check that needs a tool this run
lacks, closes it with `akka_run_close`, that `run`, `outcome: failed` and the
reason. So in a console run: the feature is `akka_run_context`'s `spec` (for
`/akka:discover`, the topic is its `topic`), and the command never searches for
one; skip every step that finds, adopts, starts or links an idea, and never ask
a person a question: wherever this command would ask one, it closes the run with
`outcome: waiting` and `question` set to the question (`--outcome waiting
--question "<question>"` on the CLI); the owner answers in the console, and the
re-run reads the answer from `akka_run_context`'s `questions` (`{station, run,
question, answer}`) and does not ask it again; run the mode check with `--idea`
set to the `idea` `akka_run_context` answered, and skip it when it cannot run
here or no idea is known; open the run by calling `akka_run_start` with
`command` and `args` only, no `idea` and no `station`, and the CLI joins the
console's run; close it as usual; and skip the carry-on step, because the
console moves the idea on. A run with no shell for the akka CLI that
`akka_run_context` answers `console: false` for is not a console run and keeps
no record: open no run, ask nothing about ideas or lanes, and carry the command
out as before the idea record, skipping every step marked **Idea record**.

**Idea record: deploy in a console run.** Use only the deploy tools the console
grants: `akka_build_image`, `akka_push_image`, `akka_services_deploy`,
`akka_projects_list`, `akka_services_get` and `akka_services_logs`. Skip the
step that stops local services (`akka_local_stop_service`, `akka_local_stop`)
and Option B, and deploy with Option A. When the deploy needs anything those
tools do not give, such as creating a project, a route or a hostname, stop and
close the run with `outcome: failed` and the reason. Deploy to the configured
project: pass no `project` and no `registry` on any platform tool call, whatever
the platform-context step below says, and do not read the `akka://context` or
`akka://regions` resources. When no project is configured, close the run
`failed` with that reason. Wherever the steps below ask the person (the
reliability-artifact prompt, the confirmation to deploy), close the run with
`outcome: waiting` and that question; the re-run reads the answer from
`akka_run_context`'s `questions`. Skip the Docker image store check, because the
image tools report Docker problems themselves, and deploy as the pom's
`<artifactId>` without asking for a service name.

**Idea record: find the idea.** On a laptop run, find the feature this command
works on first: the feature the user input names; otherwise call
`akka_sdd_list_specs` and take the only feature, or the one whose folder name is
the current branch's, and ask which when that leaves several. Its idea is the
one in `akka specify idea list --json` whose `spec` is the feature's folder name
(`NNN-name`); an idea is never found from the git branch. When that idea has
`derived: true`, it has no record yet: adopt it with `akka specify ideas adopt
--idea <id>`, then use it. When no idea has it, read the mode with `akka specify
mode`. In À la carte mode, open no run: say in one line that this run is not
recorded, and continue. In Enforced mode, stop: the project's specs and topics
get their ideas once with `akka specify ideas adopt`, and this command runs
after that. Pass the idea's id as `idea` to the run start.

**Idea record: open the run.** On a laptop run, call the `akka_run_start` MCP
tool with `station: ship`, `command: /akka:deploy`, `idea` set to the idea found
above and `args` set to the user input. Where the tool is not available, run
`akka specify run start --station ship --command /akka:deploy --idea <id> --args
"<the user input>" --json`, with the input quoted as one argument. A run is
never started without its idea. It answers JSON: `recorded`, and for a recorded
run its `idea` and `run.id`. Keep both: the last steps use them.

- When it answers `recorded: false`, continue without a run, and say in one line
  that this run is not recorded, with its `reason`.
- A refusal by rule is an error whose JSON is `{refused, message, remedy}`,
  `refused` naming the rule: `paused`, `limit`, `shipped`, `dropped`,
  `approval`, `order`, `no-idea-enforced`, `idea-unresolved` or `console-run`. Print `message` and `remedy` verbatim and stop.
- Any other error, one without `refused` (such as no login), does not stop the
  command: continue without a run, and say in one line that this run is not
  recorded.

**Idea record: a run that fails is closed too.** Once the run is open, every way
the command ends closes it. When the work fails (a build or tests fail, or a
step stops the command early), call `akka_run_close` with `run`, `outcome:
failed` and `error` set to what failed, in one line, then stop. Where the tool
is not available, run `akka specify run close --run <id> --outcome failed
--error "<what failed>"`. When the person stops the command, close the run with
`outcome: stopped`. This holds in a console run too. The close step below is for
the work's normal end.

## Purpose

This command transitions the service from **local development** to the
**Akka platform**. It builds a container image, pushes it to a registry,
deploys it, and configures routing. Only run this when the service works
locally (via `/akka:build`) and you're ready to ship.

## Outline

1. **Pre-flight checks**:
   - Run `mvn compile` and `mvn test` — do not deploy if tests fail
   - **Ensure platform context**:
     1. Read `akka://context` resource to check current org/project
     2. If organization is empty:
        a. Call `akka_organizations_list` to get available orgs
        b. Present the list to the user and ask which to use
        c. Remember the chosen org for subsequent tool calls
     3. If project is empty:
        a. Call `akka_projects_list` (pass `organization` parameter if known)
        b. If projects exist: present list and ask user to pick
        c. If none: ask if they want to create one via `akka_projects_create`
        d. Remember the chosen project for subsequent tool calls
     4. Read `akka://regions` to confirm target region
     5. **IMPORTANT** (laptop runs; a console run passes no `project` and no
        `registry`): Pass the chosen project as the `project` parameter on
        every platform tool call. Do NOT call `akka config set` — that
        modifies the user's persistent CLI configuration.
   - **Check the service name**: Read `pom.xml` and check the `<artifactId>`.
     If it is a scaffold default (e.g. `empty-service`, `my-service`,
     `example-service`), ask the user what service name they want to deploy
     as. Use the user's chosen name as the `service` parameter in
     `akka_services_deploy` — do NOT rename the artifactId in pom.xml.
   - **Check Docker image store**: Docker Desktop may have the containerd
     image store enabled, which is incompatible with the Akka container
     registry push flow. Check `docker info` output for `containerd` as the
     storage driver or image store. If detected, warn the user:
     _"Docker Desktop appears to be using the containerd image store, which
     is incompatible with the Akka container registry push flow. Please:_
     1. _Open Docker Desktop → Settings → General_
     2. _Uncheck 'Use containerd for pulling and storing images'_
     3. _Apply & Restart Docker Desktop_

     _Then let me know and I'll continue the deploy."_
     Do NOT proceed with the build until the user confirms this is resolved.

   - **Check for reliability testing artifacts**: Look for
     `.akka/reliability.manifest` or an `AdminEndpoint.java` file in the
     project's api package. If found, warn the user:
     _"Reliability testing admin endpoint detected. This endpoint provides
     full cluster control and proxied access to business endpoints — it
     must not be deployed to production. Run `/akka:reliability remove`
     to clean up before deploying."_
     Ask the user whether to proceed anyway (for development/staging
     deployments) or stop and run the remove command first.

   - Confirm with the user that they want to deploy to the platform

2. **Stop local services**: Before building the container image, call
   `akka_local_stop_service` to stop any locally running instance of the
   service. Running services hold file locks on build artifacts that prevent
   `mvn clean install` from packaging the image. Then call `akka_local_stop`
   to shut down the local runtime environment. If nothing is running, these
   calls are safe no-ops — proceed to the next step.

3. **Build container image**: Use `akka_build_image` MCP tool to run
   `mvn clean install -DskipTests`. This creates a local Docker image.
   Note the image name and tag from the output.

4. **Deploy to platform**: Choose the appropriate method:

   **Option A — Direct deploy** (quick iteration):
   - Use `akka_services_deploy` MCP tool with the image:tag and `push=true`
   - The `--push` flag pushes the image to the Akka container registry
     and deploys it in one step
   - Docker registry credentials are configured automatically if the user
     is logged in via `akka auth login` — no separate credential setup needed
   - Use `secret_env` to inject secrets (e.g. `{"MY_VAR": "secret-name/key"}`)
   - Suitable for development and testing

   **Option B — Descriptor-based deploy** (production):
   - Use `akka_push_image` to build and push the image first
   - Use `akka_project_export` to capture current state
   - Modify or create a project descriptor YAML with the new service
   - Use `akka_project_validate` to check the descriptor
   - Use `akka_project_apply` with `dry_run=true` first
   - Use `akka_project_apply` to apply

5. **Verify deployment**:
   - Use `akka_services_get` to check service status
   - Use `akka_services_logs` to verify the service started correctly
   - Check for errors in the logs

6. **Inspect deployed service** (optional): Use backoffice tools to inspect the
   deployed service's runtime state. These are read-only and safe for production.
   - `akka_backoffice_list_components` to verify all expected components
     (entities, views, workflows, agents) are registered and active
   - `akka_backoffice_get_entity_state` or `akka_backoffice_list_events` to
     spot-check entity state if test traffic has been sent
   - `akka_backoffice_get_workflow` to verify workflow execution
   - `akka_backoffice_query_view` to confirm view projections are working
   - `akka_backoffice_list_timers` to check timer registrations
   - Do NOT pass `local=true` — these calls target the deployed service

7. **Configure routing** (if needed):
   - Use `akka_routes_list` to check existing routes
   - If routes already exist for this service, no action needed
   - If no routes exist and the user wants external access:
     - Use `akka_hostnames_list` to check if the project has a hostname
     - If no hostnames exist, use `akka_hostnames_add` (without a hostname
       parameter) to get an auto-generated hostname — this is the easiest
       option for development
     - Once a hostname exists, use `akka_routes_create` with a path
       mapping (e.g. path `/` → service name)
   - If the user doesn't need external access yet, skip routing

8. **Report**: Summarize deployment:
   - Image URI pushed
   - Service name and version
   - Region deployed to
   - Route URL (if configured)
   - Service status
   - Component health (if backoffice inspection was performed)

9. **Close the run** (the last step). If a run was opened, call the
   `akka_run_close` MCP tool with `run` set to its id, `outcome: ok`, and `outputs` set to the
   project descriptor file when Option B exported one, as a project-relative
   path, or to none. Where the tool is not available, run `akka specify run
   close --run <id> --outcome ok`, with `--file <path>` for the descriptor. On an error,
   print its message; the deployment stands. After the close, run `git status --porcelain -- .akka/record/` and end the final message with one line naming the files it lists, such as "Record files to commit with your work: .akka/record/<id>/…". This command does not commit the record. When git is not available, the line says the record is in `.akka/record/<id>/`.

## Key Rules

- ALWAYS run tests before deploying — do not deploy broken code
- ALWAYS confirm with the user before deploying to the platform; a console run closes `waiting` with this confirmation instead
- Always validate descriptors before applying
- Always use dry_run before real apply
- Check logs after deployment to verify health
- Prefer descriptor-based deployment for production
- **NEVER modify pom.xml for image building or deployment** — do not add Jib,
  docker-maven-plugin, buildx configuration, or any other image-related plugins.
  The Akka SDK parent POM already configures docker-maven-plugin with the correct
  platform (`linux/amd64`) and base image. Running `mvn clean install -DskipTests`
  (via `akka_build_image`) is all that's needed to produce a deployable image.
  If the build fails with architecture errors, check that Docker/Colima is running
  and supports buildx — do NOT attempt to fix it by editing pom.xml.

## Done When

- [ ] `mvn compile` and `mvn test` succeeded — no deploy was attempted with failing tests.
- [ ] On a laptop run, platform context is confirmed: `akka://context` was read; an organization and project were selected (from `akka_organizations_list` / `akka_projects_list` if empty) and passed as the `project` parameter on every subsequent platform call — `akka config set` was NOT invoked.
- [ ] On a laptop run, the target region was confirmed via `akka://regions`; a console run took its target from `akka_projects_list` and the project's configuration.
- [ ] The `pom.xml` `<artifactId>` was checked (a console run deployed as it, asking nothing); on a laptop run, if it was a scaffold default, the user supplied the deploy service name and it was passed as the `service` parameter to `akka_services_deploy` — `<artifactId>` was NOT renamed.
- [ ] On a laptop run, Docker Desktop was checked for the containerd image store; if detected, the deploy paused until the user disabled it and confirmed.
- [ ] On a laptop run, the user explicitly confirmed the deploy; a console run asked nothing and closed `waiting` with each question it needed answered.
- [ ] Outside a console run, `akka_local_stop_service` and `akka_local_stop` were called to release file locks before building the image; a console run used only the deploy tools the console grants.
- [ ] `akka_build_image` produced a local Docker image and the image name/tag are known.
- [ ] Either Option A (`akka_services_deploy` with `push=true`) or Option B (`akka_push_image` → `akka_project_export` → `akka_project_validate` → `akka_project_apply` with `dry_run=true` then real apply) completed successfully — production deploys used the descriptor-based flow.
- [ ] `akka_services_get` and `akka_services_logs` confirm the deployed service is healthy with no startup errors.
- [ ] Routing was configured only if requested; when configured, a hostname exists (`akka_hostnames_list` / `akka_hostnames_add`) and a route maps to the service (`akka_routes_create`).
- [ ] NO changes were made to `pom.xml` for image building or deployment — no Jib, docker-maven-plugin, or buildx plugins were added.
- [ ] The report includes image URI, service name and version, region, route URL (if configured), and current service status.
- [ ] The run was opened at the `ship` station with `akka_run_start` before any other step and closed with `akka_run_close` as the last step, or the CLI was reported as predating the idea record.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.