cdkd: Skill for Claude Code

.claude/skills/cleanup/SKILL.md

cleanup is a skill for Claude Code from go-to-k/cdkd. It costs 27 tokens per session (3,843 once invoked), scanned A, original, Apache-2.0.

A detector for AWS resources left behind by cdkd integration tests. It only considers resources whose names match known cdkd test-stack patterns, and detection is the default mode.

In plain words
What is it for?
Use it to scan supported AWS regions for leftover integration-test resources, optionally filter by a stack-name prefix, and—after confirmation—delete matching resources.
Why use it?
It helps find unused test resources that may remain in an AWS account and continue to incur costs or clutter.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: names the AskUserQuestion tool; positional $N argument.

This is go-to-k/cdkd's own configuration. It tells Claude Code how to work on cdkd itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cdkd configures →

View source ↗ go-to-k/cdkd
Reuse

Borrowing it

Nothing to install: this file belongs to go-to-k/cdkd. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/go-to-k/cdkd/main/.claude/skills/cleanup/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/go-to-k/cdkd

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/go-to-k/cdkd/cleanup.svg)](https://agentmods.dev/skills/go-to-k/cdkd/cleanup)
Your own site
<a href="https://agentmods.dev/skills/go-to-k/cdkd/cleanup"><img src="https://agentmods.dev/badge/skills/go-to-k/cdkd/cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,843 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 63
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.03843
Opus 5 $0.00014 $0.01921
Sonnet 5 $0.00005 $0.00769
Haiku 4.5 $0.00003 $0.00384

Measured yesterday against content hash 5577220545ea, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/cleanup/SKILL.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Leftover Resource Cleanup

Detect and optionally delete AWS resources left behind by cdkd integration tests.

Safety

  • ONLY targets resources whose names match cdkd integration test stack name prefixes
  • NEVER deletes resources that don't match a known cdkd naming pattern
  • Always shows what will be deleted and uses AskUserQuestion for confirmation before deleting anything
  • Default mode is detect-only (no deletion)

Arguments

  • stack-name-prefix: Filter by specific stack name prefix (e.g., EcrStack, LambdaStack). If not specified, scan all known cdkd test stack prefixes.
  • --detect-only: Only list leftover resources, don't delete (this is the default)

Steps

  1. Determine stack name prefixes to scan:

    • If a prefix is given, use that
    • Otherwise, discover all integration test stack names by running synth or reading bin/app.ts in each tests/integration/*/ directory. Look for the CDK construct ID (second argument to new *Stack(app, '<id>'))
  2. Resolve region and account: Scan us-east-1, ap-northeast-1, AND us-west-2 — the benchmark suite (docs/benchmarks.md) runs its CFn/cdkd variant stacks in us-west-2, and its leftovers (billed PROVISIONED Kinesis streams, ~130 Lambda log groups) went unnoticed for a month because this skill only scanned the first two regions (2026-07-31 sweep). Additionally, derive extra regions dynamically from the state-bucket key layout (aws s3 ls the bucket recursively and collect the distinct {region} path segments) so a fixture pinned to an unusual region is not missed. Resolve account ID via aws sts get-caller-identity. IAM is global so only needs one query.

  3. Check S3 state: aws s3 ls s3://cdkd-state-{accountId}-us-east-1/stacks/ --region us-east-1

3.5. Bulk-sweep orphaned deployment-event stores (issue #885 follow-up): since the deployment-events feature (#820), cdkd destroy / cdkd state destroy removes state.json but, unless --purge-events was passed, INTENTIONALLY leaves the cdkd/{stack}/{region}/deployments/ event store behind (post-mortem history). After a long integ campaign those orphaned event stores accumulate across dozens of already-destroyed stacks, so aws s3 ls .../cdkd/ is never empty even when there are no real state / resource leaks. This step bulk-removes them. Safety: only a prefix that has a deployments/ child AND NO state.json under any region is an orphan — a prefix that still has a state.json is an ACTIVE (deployed, not destroyed) stack and MUST be left untouched (its deployments/ is live history).

Read the full file on GitHub · 139 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +7 lines 5577220545ea
  2. 8d ago First seen · 132 lines · 27 tokens per session scan A fbb9324ef9d3

Subscribe to this mod's changes

cleanup is a skill published in the GitHub repository go-to-k/cdkd (135 stars, last pushed today), licensed Apache-2.0. It adds 27 tokens to every session and 3,843 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

aws-cdk-mcp-server-mcp

AWS Cloud Development Kit (CDK) best practices, infrastructure as code patterns, and security compliance with CDK Nag.

Friz-zy/ai-capability-registry · 33 tokens

aws-cdk-development

AWS Cloud Development Kit (CDK) expert for building cloud infrastructure with TypeScript/Python. Use when creating CDK stacks, defining CDK constructs, implementing infrastructure as code, or when the user mentions CDK, CloudFormation, IaC, cdk synth, cdk deploy, or wants to define AWS infrastructure programmatically.…

zxkane/aws-skills · 88 tokens

aws-agentic-ai

AWS Bedrock AgentCore comprehensive expert for deploying and managing AI agents at scale. Use when working with any AgentCore service including Gateway, Runtime, Memory, Identity, Code Interpreter, Browser, Observability, Agent Registry, or Evaluations. Covers agent deployment, MCP tool integration, credential…

zxkane/aws-skills · 127 tokens

aws-cdk-discipline

AWS infrastructure policy for fermi-agentcore - all changes through CDK committed to main, Fermi AWS access is read-only verification.

abel30567/fermi-mcp · 32 tokens

iam-policy-validator

Validate the IAM policies in a CloudFormation template against AWS IAM Access Analyzer before deploying, using the cfn-policy-validator CLI. Use when reviewing or gating a CloudFormation (or CDK-synthesized) template that defines IAM identity or resource policies, when asked to check a template for policy errors…

awslabs/aws-cloudformation-iam-policy-validator · 81 tokens

aws-bedrock-ai

WORKFLOW SKILL — Amazon Bedrock and AWS AI design: foundation model selection, knowledge bases (RAG), agents for bedrock, guardrails, provisioned throughput, batch inference, fine-tuning, KMS, VPC endpoints, regional GA, and per-provider licensing.

odere-pro/claude-aws-architect · 65 tokens