agentleFS
AWSKnown publisherawslabs/do-agent-aws/Container-Root/agent/skills/detect-deployment-thrashing/SKILL.md

detect-deployment-thrashing

Skill3 starsChanged 2 days agoApache-2.0View on GitHub

Use when an optimization campaign on Kubernetes involves infrastructure changes (pod restarts, StatefulSet recreations, image rebuilds) and the ratio of deployment operations to actual benchmark runs exceeds 2:1. Use when more than 10 minutes pass between benchmark results, or when kubectl operations dominate session activity.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Measure your deployment:test ratio: If you spend more time restarting pods than running benchmarks, you are thrashing.

    line 10

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Detect Deployment Thrashing

Overview

Measure your deployment:test ratio. If you spend more time restarting pods than running benchmarks, you are thrashing. Target: 5+ experiments per hour. Below 3/hour, stop and fix your experiment loop.

When to Use

  • More than 10 minutes between benchmark results
  • Doing kubectl delete/apply instead of kubectl set env
  • Rebuilding Docker images for env var changes
  • Session is 80%+ kubectl commands with <20% benchmark data
  • Running the same experiment multiple times due to pod crashes

The Efficiency Ladder

MethodTime to ChangeWhen to Use
kubectl set env statefulset/<name> VAR=VAL~60s (rolling restart)Env var experiments (ALWAYS use this)
kubectl patch configmap~30s (if pod watches)Config file changes
kubectl exec -- sed -i~5s (hot patch)One-line code tweaks for testing
kubectl delete sts && apply~5 minSchema changes to StatefulSet
Docker rebuild + ECR push + redeploy~15-30 minSource code changes, new libraries

Self-Check: Am I Thrashing?

Count in last hour:
  Benchmark results captured: ___
  kubectl apply/delete/create: ___
  Pod restarts observed: ___

RATIO = kubectl_ops / benchmark_results

Ratio < 2:1  → Healthy
Ratio 2-5:1  → Warning — simplify your loop
Ratio > 5:1  → STOP. Fix deployment method before continuing.

Common Traps

TrapWasteFix
Recreate StatefulSet for env var change5 min instead of 60sUse kubectl set env
Rebuild image for env var test15 min instead of 60sEnv vars go in StatefulSet spec, not Dockerfile
Delete pod to "clean state"Triggers CrashLoopBackOff timing issuesLet rolling update handle it
Wait for ProcessGroup cleanup (600s)Wasted 10 minCapture results in the 600s window, then let it crash
Re-read documentation between every experiment65% of session on readingRead once, make a checklist, execute

Quick Protocol

1. Change ONE env var: kubectl -n <ns> set env sts/<name> VAR=VAL
2. Wait for rollout: kubectl rollout status sts/<name> --timeout=180s
3. Wait for benchmarks: watch for test_*.py to finish (~5-7 min)
4. Capture: grep results from /tmp/bench_ll.log
5. Record: append to CSV immediately
6. Revert: kubectl set env sts/<name> VAR=ORIGINAL
7. Repeat. Target: 5+ experiments/hour.
<!-- imported on 2026-10-31 by tools/import-skills.py from a native Claude Code instance's skill library; the source site's names, ids, hosts and paths are scrubbed to <placeholders>; its other files were not copied -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.