Skip to content
Back to skills

Formae Destroy

ASecurity

Use when the user wants to destroy, delete, or tear down infrastructure resources, stacks, or environments

  • 6 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 8, 2026
ai-agentsawsapi

Works with

  • terminal
  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned October 8, 2026

npx -y skills add platform-engineering-labs/formae-mcp --skill formae-destroy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Formae Destroy?

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

Security grade badge for Formae Destroy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/platform-engineering-labs-formae-destroy/badge)](https://www.skillsdirectory.com/skills/platform-engineering-labs-formae-destroy)

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: formae-destroy
description: "Use when the user wants to destroy, delete, or tear down infrastructure resources, stacks, or environments"
---

# Destroy Infrastructure

Use the `destroy_forma` MCP tool to remove infrastructure resources.

## Targeting an environment (`profile`)

In mode `none`, describe the affected resources/stacks, destructive effects,
warnings, confirmation and confirmed outcomes. Keep disposable files, source
edits, extraction and cleanup internal. Maintained-codebase mode still reports
source catch-up and conflicts separately from the destruction outcome.

`destroy_forma` (and `get_command_status`) hit the formae agent's API directly and take an optional `profile` argument. If the user is working against a specific environment (e.g. `prod`, `staging`), pass that profile name as `profile` on the `destroy_forma` call and any `get_command_status` follow-up so it targets that environment — for this session only, without changing global state. Destroying the wrong environment is especially damaging, so be strict here. If which environment they mean is unclear and `list_profiles` shows more than one, ask first. Never use `use_profile` to "set up" this session — the active profile is global and shared with the user's CLI and any other open sessions. When no profile is named, the active profile is used. Requires formae >= 0.87.0.

## Destroy Modes

Destruction can be specified two ways (mutually exclusive):
- **By file**: Destroys all resources declared in a forma file
- **By query**: Destroys resources matching a query

## Source context

Use `get_codebase_context` to identify any selected maintained source. File-based destruction carries the selected `context` and uses a file inside that project or the prepared disposable directory. For no-codebase file work, use `prepare_authoring` and keep its PklProject/dependencies available. Query destruction has no local source context; do not pass `context` with `query`. Its explicit query and final simulation define the operation.

After terminal destruction, remove only the corresponding declarations from the selected maintained project, preserving unrelated edits and reporting conflicts separately. A disposable workspace can be removed after outcome/retry inspection. A failed-create desired-intent diagnostic requires investigation/recovery; never infer successful deletion or remove its source merely from missing inventory.

## Workflow

1. Clarify what the user wants to destroy
2. **Always simulate first**: call `destroy_forma` with `simulate: true`
3. Present what will be destroyed — clearly and completely
4. **Ask for explicit confirmation** — destruction is irreversible
5. If confirmed: call `destroy_forma` with `simulate: false`
6. Poll `get_command_status` to monitor progress:
   - **Wait 5 seconds between polls** (`sleep 5`). Do NOT poll in a tight loop.
   - **Only report state transitions** — do NOT print anything unless a resource changed status since the last poll (e.g., in_progress → completed, in_progress → failed). Silently poll until something changes.
   - When reporting, summarize what changed (e.g., "3 resources deleted, VPC now destroying") rather than dumping the full JSON.
7. Report results

## Common Patterns

| User wants to... | Approach |
|---|---|
| Tear down a stack | `query: "stack:staging"` |
| Remove specific resources | `query: "type:AWS::S3::Bucket label:temp-data"` |
| Destroy what's in a file | `file_path: "/path/to/forma.pkl"` |

## Important

- NEVER use `pkl eval` to evaluate forma files — ALWAYS use `formae eval --output-consumer machine`. Forma files use formae-specific extensions that only the formae CLI can resolve, and `--output-consumer machine` ensures parseable output instead of human-formatted text.
- NEVER skip the simulation step
- NEVER destroy without explicit user confirmation
- Destruction is **irreversible**
- For large destroy operations, consider destroying one stack at a time

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.