Skip to content
Development
Skill

/arn-infra-cleanup

This skill should be used when the user says "cleanup", "infra cleanup", "arn infra cleanup", "clean up resources", "destroy expired resources", "check ttl", "check expired", "ttl cleanup", "remove old deployments", "destroy dev environment", "tear down", "teardown infra",

From plugin
arness
3590 skills48 agents

Claude Code

$ npx -y skills add AppsVortex/arness --skill arn-infra-cleanup --agent claude-code

SKILL.md

arn-infra-cleanup.SKILL.md
name: arn-infra-cleanup
description: >-
  This skill should be used when the user says "cleanup", "infra cleanup",
  "arn infra cleanup", "clean up resources", "destroy expired resources",
  "check ttl", "check expired", "ttl cleanup", "remove old deployments",
  "destroy dev environment", "tear down", "teardown infra", "destroy resources",
  "cleanup ephemeral", "check for expired resources", "clean up infra",
  "resource cleanup", "destroy old resources", "prune resources",
  "delete expired deployments", "decommission", or wants to check for and
  destroy expired ephemeral infrastructure resources. This skill also supports periodic
  monitoring via `/loop 6h /arn-infra-cleanup` for
  session-duration TTL enforcement.
version: 1.0.0

Arness Infra Cleanup

Check for expired ephemeral infrastructure resources across three TTL sources (issue tracker, TTL registry, resource manifest) and destroy them with user confirmation. Supports periodic monitoring via `/loop` for session-duration TTL enforcement.

This skill never auto-destroys resources. Every destruction requires explicit user confirmation with a summary of what will be destroyed and its associated cost.

Prerequisites

Read `## Arness` from the project's CLAUDE.md. If no `## Arness` section exists or Arness Infra fields are missing, inform the user: "Arness Infra is not configured for this project yet. Run `/arn-infra-wizard` to get started — it will set everything up automatically." Do not proceed without it.

Check the **Deferred** field. If `Deferred: yes`, inform the user: "Infrastructure is in deferred mode. Cleanup is not available until infrastructure is fully configured. Run `/arn-infra-assess` to un-defer." Stop.

Extract:

  • **Experience level** -- derived from user profile. Read `~/.arness/user-profile.yaml` (or `.claude/arness-profile.local.md` if it exists — project override takes precedence). Apply the experience derivation mapping from `${CLAUDE_PLUGIN_ROOT}/skills/arn-infra-ensure-config/references/experience-derivation.md`. If no profile exists, check for legacy `Experience level` in `## Arness` as fallback.
  • **Providers** -- which cloud providers are configured
  • **Providers config** -- path to `providers.md`
  • **Default IaC tool** -- for determining destroy commands
  • **Environments** -- environment names in promotion order
  • **Environments config** -- path to `environments.md` for per-environment deployment state
  • **Resource manifest** -- path to `active-resources.json` for resource inventory
  • **Reference overrides** -- path to local reference override directory (for evolving reference reads)
  • **Platform** -- for issue tracker access
  • **Issue tracker** -- for reading cleanup issues and updating labels
  • **Tooling manifest** -- path to `tooling-manifest.json` for available CLIs

---

Workflow

Step 1: Scan TTL Sources

Check all three TTL sources in priority order. Collect a unified list of resources with expired or near-expiry TTLs.

**Source 1: Issue Tracker (highest priority)**

If issue tracking is configured (Platform is github or Issue tracker is jira):

For GitHub:

gh issue list --label "arn-infra-cleanup" --state open --json number,title,body,createdAt

For Jira: Query issues with label `arn-infra-cleanup` in the configured Jira project.

Parse each cleanup issue:

  • Extract TTL expiry timestamp from the issue body (set by `arn-infra-deploy` during ephemeral deployments)
  • Extract resource identifiers and destroy commands from the issue body
  • Determine if the TTL has expired (expiry timestamp < current time)
  • Determine if the TTL is approaching (within 1 hour of expiry) for early warning

**Source 2: TTL Registry (secondary)**

Check for the TTL registry file:

Read .arness/infra/ttl-registry.md

If the file exists, parse resource entries with their TTL timestamps. The TTL registry is a fallback for environments without issue tracking or for resources created outside the normal deployment flow.

Expected format:

# TTL Registry

| Resource | Environment | Provider | Created | TTL Expiry | Destroy Command |
|----------|-------------|----------|---------|------------|-----------------|
| [name] | [env] | [provider] | [timestamp] | [expiry] | [command] |

**Source 3: Resource Manifest (tertiary)**

Read the resource manifest:

Read <resource-manifest-path>

Filter resources where:

  • `ttl` is not null
  • `ttl` timestamp is in the past (expired)
  • `status` is `active` (not already destroyed)

---

Step 2: Compile Expired Resource List

Merge results from all three sources, deduplicating by resource ID. For each expired resource, compile:

  • Resource name and type
  • Provider and region
  • Environment
  • Created timestamp
  • TTL expiry timestamp (how long ago it expired)
  • Estimated cost since creation (calculate: `monthly_cost × (hours_since_creation / 730)`)
  • Destroy command (IaC-tool-appropriate)
  • Source (which TTL source identified this resource)

**If no expired resources are found:**

Present: "No expired resources found. All TTLs are current."

If there are resources with TTLs approaching expiry (within 1 hour), list them as early warnings: "The following resources will expire soon:

  • [resource]: expires in [time remaining]"

Stop here (or if running via `/loop`, wait for the next interval).

**If expired resources are found:**

Continue to Step 3.

---

Step 3: Present Expired Resources for Confirmation

Present each expired resource group (grouped by environment):

"The following resources have expired TTLs and are candidates for cleanup:

**Environment: [env]**

| Resource | Type | Provider | Expired | Cost Since Creation | Destroy Command | |----------|------|----------|---------|--------------------| --------------- | | [name] | [type] | [provider] | [time since expiry] | $[amount] | [command] |

**Total cost of expired resources:** $[total] (estimated charges since TTL expired)

Ask (using `AskUserQuestion`):

**"How would you

Read more
@appsvortex
Ships witharness

Arness — H not required. Structured AI workflows for Claude Code. From first idea to production deploy. Seven entry commands. That's all you need to remember.

3590 skills48 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
35
Star history of AppsVortex/arness on GitHub, a chart by star-history.com

Other skills on arness.

arn-assessing

arn-assessing

This skill should be used when the user says "assessing", "arness assessing", "assess", "assess codebase", "technical review",…

@appsvortex@appsvortexInstall Skill
arn-code-assess

arn-code-assess

This skill should be used when the user says "arness code assess", "arn-code-assess", "tech debt audit", "assess the project", or…

@appsvortex@appsvortexInstall Skill
arn-code-batch-cve-fix

arn-code-batch-cve-fix

This skill should be used when the user says "fix CVEs", "patch vulnerabilities", "apply security patches", "batch CVE fix",…

@appsvortex@appsvortexInstall Skill
arn-code-batch-cve-scan

arn-code-batch-cve-sca…

This skill should be used when the user says "scan for CVEs", "CVE scan", "check for vulnerabilities", "dependabot triage",…

@appsvortex@appsvortexInstall Skill
arn-code-batch-implement

arn-code-batch-impleme…

This skill should be used when the user says "batch implement", "implement all", "batch execution", "implement all features",…

@appsvortex@appsvortexInstall Skill
arn-code-batch-merge

arn-code-batch-merge

This skill should be used when the user says "batch merge", "merge batch", "arness batch merge", "arn-code-batch-merge", "merge…

@appsvortex@appsvortexInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about arn-infra-cleanup.

Which coding agents can use arn-infra-cleanup?
arn-infra-cleanup installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.