Defang Blog

Your Coding Agent Just Learned to Deploy

4 min read

Defang now ships skills for Claude Code and Codex. Type /defang:deploy in your AI coding agent and it handles CLI setup, authentication, stack creation, config, and deployment, step by step, inside your editor.

AI coding agents are good at writing code. They're not good at deploying it. You finish building a feature in Cursor or Claude Code, and then the real work starts: figure out which cloud services to use, write infrastructure-as-code by hand, configure networking and security, set up scaling, estimate costs, authenticate with your provider, deploy, wait, check logs, debug. Most clouds don't have a "deploy" button. You have to make dozens of infrastructure decisions before your code runs anywhere.

We just shipped three skills that teach your coding agent how to deploy, estimate costs, and diagnose problems without leaving the conversation.

What Are Skills?

Skills are structured instructions that tell a coding agent how to accomplish a specific task. They're markdown files with step-by-step procedures, and the agent follows them like a runbook. When you type /defang:deploy in Claude Code, the agent reads the deploy skill and walks through each step: install the CLI if needed, authenticate, find your Compose file, select or create a stack, set configs, and deploy.

The key difference from a raw MCP tool call is that skills encode the workflow, not just the action. The deploy skill doesn't just call defang compose up -- it checks prerequisites, handles missing config, creates stacks, and guides you through decisions along the way.

Three Skills

/defang:deploy -- Full deployment workflow

This is the main one. It handles the entire path from "I have a Compose file" to "my app is running in AWS or GCP":

  1. CLI validation -- checks if defang is installed, offers install commands if not
  2. Authentication -- runs defang whoami, prompts login if needed
  3. Compose file -- finds your compose.yaml, or helps you create one by asking about your services
  4. Stack selection -- lists existing stacks or walks you through creating one (provider, region, deployment mode)
  5. Config management -- scans your Compose file for unset environment variables and prompts you to set each one (with the option to auto-generate random secrets)
  6. Deployment -- runs defang compose up and streams the output
  7. Verification -- checks service status and endpoints after deployment

Here's what it looks like in practice. You're in Claude Code, you've just finished building a service:

The agent makes decisions at each step based on what it finds. No stack? It walks you through defang stack new. Missing configs? It asks for each one. Compose file missing? It offers to generate one based on your project.

/defang:estimate -- Cost estimation before you commit

You've written a Compose file and you want to know what it'll cost before deploying. This skill runs defang compose estimate against a target stack and breaks down the results:

The skill explains the numbers, calls out the biggest line items, and suggests alternatives if the total seems high.

/defang:status -- Diagnose what's broken

Something's wrong in production. Instead of opening a terminal and running five different commands, ask your coding agent:

The skill checks deployment status, identifies unhealthy services, pulls logs, scans for error patterns (stack traces, OOM, connection failures, HTTP 5xx), and gives you a diagnosis with specific next steps.

How to Install

Claude Code

Two commands:

After installing, the three skills are available as /defang:deploy, /defang:estimate, and /defang:status. The plugin also configures the Defang MCP server automatically, so your agent gets access to lower-level Defang tools too.

Codex

Same idea, different plugin system:

The Codex plugin includes the same three skills and MCP server configuration.

No CLI? No Problem.

You don't need the Defang CLI installed upfront. The first step of every skill checks for the CLI and walks you through installing it if it's missing. After install, run /reload-plugins to activate the MCP server.

Why Skills Instead of Just Tools?

MCP tools are single actions: "deploy this," "get logs." Skills are workflows: "deploy this, but first make sure I'm logged in, then check if I have a stack, then handle the missing config, then deploy, then verify it worked."

The difference matters because deployment isn't one step. It's a chain of decisions that depend on your current state. Do you have a stack? Is the CLI installed? Are your configs set? Each answer changes what happens next. Skills encode that logic so the agent can handle the whole thing, not just the final defang compose up.

You can also read the skills yourself -- they're just markdown files in the Defang repo. If you want to customize the workflow for your team (different default regions, specific config patterns, additional verification steps), fork and edit them.

What You Still Need the Terminal For

These skills cover the common paths: deploy, estimate, debug. They don't cover everything. Tearing down deployments (defang compose down), advanced log filtering, managing multiple stacks in one session, or provider-specific configuration still need the CLI directly. The MCP server that ships with the plugin gives your agent access to the underlying tools for some of these, but the skills themselves focus on the three workflows most people need most often.

Get Started

Install the plugin in Claude Code:

Then type /defang:deploy and let your agent take it from there.

Source: github.com/DefangLabs/defang. Skills are in the skills/ directory, plugins in claude-plugin/ and codex-plugin/.

Questions or bugs? Open an issue or find us on Discord.

Related posts

← Back to all posts