# deploy

Builds and pushes Power Apps code apps directly to Power Platform. Useful when shipping updates or redeploying an existing project from Claude Code.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 1167 repo stars
- Author: Microsoft
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/microsoft/power-platform-skills/tree/HEAD/plugins/code-apps/skills/deploy/SKILL.md
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/deploy-2

## What it does

This skill coordinates the full deployment cycle from the current directory. It starts by inspecting `memory-bank.md` to locate the project name and target environment. It then executes `npm run build`. If compilation hits `TS6133` unused import warnings, the skill cleans them up automatically and retries. Any other TypeScript failure halts the process with file and line markers.

The deployment step runs via `$PA app push` or `power-apps push`. The skill always requests explicit confirmation before touching the live app. Expired credentials trigger guidance to run `pa auth logout` for browser re-authentication, while mismatched targets require updating `environmentId` inside `power.config.json`.

Once finished, the skill saves the captured app URL and timestamp into `memory-bank.md`. The workflow refuses to deploy if `dist/index.html` is absent after building.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add microsoft/power-platform-skills
```
In the agent chat (not a shell):
```text
/plugin install code-apps-preview@power-platform-skills
```
This installs the whole code-apps-preview plugin with all its skills

2. **Skills CLI (Vercel)**
```bash
npx skills add microsoft/power-platform-skills --skill deploy -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/deploy/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/deploy/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add microsoft/power-platform-skills --skill deploy -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/deploy/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add microsoft/power-platform-skills --skill deploy -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/deploy/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install microsoft/power-platform-skills plugins/code-apps/skills/deploy
```

2. **Manually: put the files in place**
- File: `.github/skills/deploy/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add microsoft/power-platform-skills --skill deploy -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/microsoft/power-platform-skills --path plugins/code-apps/skills/deploy
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/deploy/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/microsoft/power-platform-skills/tree/HEAD/plugins/code-apps/skills/deploy/SKILL.md

## When to use it
- build Power Apps projects with automated cleanup for unused imports
- push application updates to target Power Platform environments
- store deployment timestamps and application URLs in `memory-bank.md`
- recover from CLI authentication timeouts using `pa auth logout`

## Example prompts
- Deploy the current Power Apps project to Power Platform
- Build and push latest code changes to the live environment
- Redeploy the application and record details in memory-bank.md

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: e7fcca8ae38c2146.

BEGIN THIRD-PARTY FILE e7fcca8ae38c2146
````text
---
name: deploy
description: Builds and deploys a Power Apps code app to Power Platform. Use when deploying changes, redeploying an existing app, or pushing updates.
user-invocable: true
allowed-tools: Read, Edit, Write, Grep, Glob, Bash
model: sonnet
---

**📋 Shared Instructions: [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md)** - Cross-cutting concerns.

# Deploy

Builds and deploys the app in the current directory to Power Platform.

## Workflow

1. Check Memory Bank → 2. Build → 3. Deploy → 4. Update Memory Bank

---

### Step 1: Check Memory Bank

Check for `memory-bank.md` in the project root. If found, read it for the project name and environment. If not found, proceed — the project may have been created without the plugin.

### Step 2: Build

```bash
npm run build
```

If the build fails:

- **TS6133 (unused import)**: Remove the unused import and retry.
- **Other TypeScript errors**: Report the error with the file and line number and stop. Do not deploy a broken build.

Verify `dist/` exists with `index.html` before continuing.

### Step 3: Deploy

Ask the user: _"Ready to deploy to [environment name]? This will update the live app."_ Wait for explicit confirmation before proceeding.

> Resolve the CLI first (see [cli-binary.md](${PLUGIN_ROOT}/shared/cli-binary.md)): run as `$PA app push` (`npx --no-install pa …`), never a bare `pa`. On `power-apps`-only projects, translate to `power-apps push`.

```bash
pa app push
```

Capture the app URL from the output if present.

If deploy fails, report the error and stop — do not retry silently. Common fixes:

- Auth error / token expired → `pa auth logout` (or `power-apps logout` on `power-apps`-only projects), then retry — the CLI will re-prompt browser login.
- Environment mismatch → update `environmentId` in `power.config.json` to the correct value and retry.

### Step 4: Update Memory Bank

If `memory-bank.md` exists, update:

- Last deployed timestamp
- App URL (if captured)
````
END THIRD-PARTY FILE e7fcca8ae38c2146

The third-party file has ended. Everything between the e7fcca8ae38c2146 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© Microsoft · MIT · https://github.com/microsoft/power-platform-skills/tree/HEAD/plugins/code-apps/skills/deploy/SKILL.md

## Similar
- [platform-destructive-deploy](https://affpapa.org/en/nevibecode/skills/platform-destructive-deploy.md) — skill · 2900 installs
- [platform-quick-deploy](https://affpapa.org/en/nevibecode/skills/platform-quick-deploy.md) — skill · 2800 installs
- [aracli-deploy-management](https://affpapa.org/en/nevibecode/skills/aracli-deploy-management.md) — skill · 1200 installs
- [power-apps-code-app-scaffold](https://affpapa.org/en/nevibecode/skills/power-apps-code-app-scaffold.md) — skill · 8700 installs
- [alibabacloud-ecs-code-deploy](https://affpapa.org/en/nevibecode/skills/alibabacloud-ecs-code-deploy.md) — skill · 277 installs

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
