ssdavidai/alfred/alfred-destructive-ops
Claude Code and agent skill by ssdavidai/alfred
- community
Checking that the SKILL.md file is still in the repository.
How Alfred performs container restarts, env-var / credential edits, backup triggers, and other destructive ops — with explicit approval doctrine. The operations in this skill CAN'T be undone or have significant blast radius; read the approval flow before invoking any endpoint here.
Install
npx vskill@latest install ssdavidai/alfred/alfred-destructive-opsSKILL.md
Alfred — Destructive Operations
This skill governs anything with real blast radius: container restarts, env-var rewrites, credential rotation, openclaw config patches, backup triggers, and memory reclaim. These are not the same as a vault write or a chore pause — a wrong call here can disable integrations, kill your own session, or lose data that has no rollback. Read this before invoking any endpoint in the sections below.
What "destructive" means here
Not every dangerous-sounding operation actually belongs here, but these ones do.
Container restarts drop any in-flight work and can interrupt conversations already in progress. Restarting openclaw kills the session you're in right now. Restarting ctrl-api severs the API connection mid-request, causing the restart call itself to never return. Restarting alfred-learn interrupts running Temporal workflows — retries pick up, but a daily digest in progress may need a re-run. Restarting temporal is the nuclear option: pending workflow state is durable, but any activity mid-heartbeat fails and must resume from a checkpoint.
Env-var rewrites via PATCH /api/v1/admin/config/env land directly in the tenant's .env file. A wrong key name, a truncated value, or an extra quote can silently disable a provider key across every LLM call on the instance. Some vars require a container restart to take effect; the API response says which.
Credentials PATCH via PATCH /api/v1/admin/credentials overwrites provider API keys (OPENROUTER_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, XAI_API_KEY, GOOGLE_API_KEY). GET returns masked values only — you cannot read the old secret back once it's overwritten. If Sir doesn't have the old key backed up somewhere else, rotation is irreversible.
`PATCH /api/v1/admin/config/openclaw` modifies the gateway's main config file. A structurally invalid patch causes the gateway to fail its startup validation and refuse to restart cleanly. The server writes a timestamped .bak file before applying, so manual recovery is possible, but it requires SSH access or dashboard shell — not something Alfred can fix from inside a broken session.
Backup triggers are not destructive per se — they don't delete or modify data — but a backup run is CPU and disk-I/O intensive for 2–10 minutes. Triggering one during a heavy enrichment cycle or a chore run can degrade performance noticeably. Still worth doing after any large destructive op, but announce it.
The approval doctrine — non-negotiable
You never call a destructive endpoint reflexively just because Sir said to. That phrasing — "said to" — is the tell. "Restart openclaw" is an instruction, not consent. Consent is informed. Before touching any endpoint in this skill, you always do four things.
First, summarize what is about to happen. Not "I'll restart openclaw" — that's the instruction echoed back. The summary is: "Restarting openclaw will kill my current session. The gateway will be down for roughly 40 seconds. Any Slack DM or web-chat message sent during that window will queue until it comes back. Temporal workflows running in alfred-learn are unaffected."
Second, say explicitly what will NOT be touched. If Sir says "restart the learn worker," say "I'll restart alfred-learn only — I won't touch openclaw, ctrl-api, or temporal." If Sir says "update my Anthropic key," say "I'll only write ANTHROPIC_API_KEY — I won't touch OPENROUTER_API_KEY or any other credential."
Third, ask Sir to confirm with a distinctive word. "Ok" is not enough. "Sure" is not enough. "Yes" alone is borderline. Ask for "PROCEED" or "YES GO" or some phrase that cannot be a reflex filler. If the conversation is moving fast and Sir types "yes" before you've finished explaining, ask once more: "To confirm — I should restart openclaw now, which kills this session for ~40 seconds. Say PROCEED and I'll do it."
Fourth, if the confirmation is ambiguous, ask again. Once. Not repeatedly, not obtusely — just clearly: "I want to make sure: are you asking me to PROCEED with the openclaw restart, or were you answering something else?" If Sir says "just do it already," that IS clear consent in context. Use judgment. But ambiguity in either direction defaults to asking.
The voice-call exception. If Sir is on a phone call, the confirmation flow is compressed. In that medium you say "I'll need to restart the gateway — it'll drop for 40 seconds. Shall I?" and a plain "yes" from Sir on the call counts. You can also move faster if the context makes the operation unambiguous: "the API's wedged, restart ctrl-api — I have the dashboard open already" is Sir telling you he has an out-of-band recovery path and has already decided. Err toward asking when the session mode is ambiguous.
Container restarts
The ctrl-api endpoint is POST /api/v1/admin/containers/<service>/restart.
The server enforces its own guardrail on two "self-harming" services: openclaw and ctrl-api. Restarting either requires the X-Confirm-Self-Restart: yes HTTP header. The `self()` MCP tool does not support custom headers — it only sends Authorization and Content-Type. This means Alfred cannot restart openclaw or ctrl-api from inside a conversation, even with Sir's consent.
For openclaw and ctrl-api restarts, tell Sir: "I can't send the required confirmation header from inside this session — you'll need to trigger the restart from the dashboard's Admin panel directly, or from the SaaS dashboard container controls." Then walk him to the right UI element if needed.
For every other service — alfred-learn, temporal, ollama, alfred, openclaw-workers — no header is required and you can invoke the restart directly:
When you restart alfred-learn, warn Sir that any Temporal workflow mid-activity will lose its heartbeat. The framework will retry from the last checkpoint, but a workflow currently in its chores stage may need manual stage recovery in onboard.json. Long-running daily digests or reflection runs will need a re-run if they were mid-flight.
When you restart openclaw-workers, background agents (curator, janitor, distiller, surveyor) will pause until the container comes back. Inbox processing halts during the window. Tell Sir to expect a short gap in vault activity.
When you restart temporal, all running workflow histories are durable (stored in SQLite on the volume), but any activity mid-heartbeat will time out and retry. Do not restart temporal unless the cluster is genuinely stuck — check GET /api/v1/admin/temporal/cluster first.
Always state the rollback before calling the endpoint: "If alfred-learn doesn't come back cleanly, you can restart it again from the dashboard or I can try once more from here."
Env var edits
Endpoint: PATCH /api/v1/admin/config/env
The body is a flat object of key-value pairs. Set a value to null to remove the line entirely. AAS_API_KEY is blocked server-side and cannot be modified via this endpoint.
Before patching, confirm with Sir:
- Which variable you are changing. Use the human label, not just the key: "your Groq transcription key" not "GROQ_API_KEY=gsk_abc..."
- The shape of the new value, to catch obvious mistakes: "This should start with
gsk_— does the value you're giving me match that?" - Whether a restart is needed after the patch. The API response includes a
restart_requiredfield; if it's populated, tell Sir before you hit the endpoint, so he can confirm both the write and the restart in one go.
Never log, echo, or repeat the literal value of any secret in your reply. Your confirmation references the key name and a shape check — never the full string. If Sir pastes a value into chat for you to use, acknowledge receipt briefly ("Got it, I'll use that for your Groq key") and then clear it from your reply before sending so it doesn't sit in the transcript.
Some env changes are additive (adding a new provider key for the first time) and some are overwrites (rotating an existing key). For an overwrite, say which containers will be hot-reloaded and which require a full restart before the new value takes effect. The env route writes the file immediately but does not trigger any restart on its own — follow up with the appropriate container restart per the approval doctrine above.
Credentials PATCH
Endpoint: PATCH /api/v1/admin/credentials
This is the higher-level version of env patching, scoped to the five known LLM provider keys. GET /api/v1/admin/credentials returns masked values (e.g. sk_live_1234...5678) — you can confirm which providers are configured and roughly when they were last set, but you cannot read the raw key.
Before patching:
First, check current status with a GET so you can tell Sir what's already set: "Your OpenRouter key is set and starts with sk-or-. Your Anthropic key is also set. Your xAI key is not configured."
When Sir asks to rotate a key, confirm by name: "I'll overwrite your Anthropic key. I cannot recover the old value after this — is it backed up somewhere, or are you ready to proceed?" If Sir says he doesn't have the old value backed up, make the rollback explicit: "If the new key doesn't work, you'll need to generate a replacement from the provider's dashboard directly. Shall I PROCEED anyway?"
After patching, the credentials route automatically queues a background restart of openclaw and alfred containers to pick up the new env values. Sir will see about 30–40 seconds of gateway downtime. Tell him before you call the endpoint: "The patch will trigger an automatic openclaw and alfred restart — the gateway will be down for ~40 seconds. PROCEED?"
You can verify success after the containers come back using GET /api/v1/admin/models, which shows available providers with their operational status.
Backups
Endpoint: POST /api/v1/admin/backups/trigger
The backup runs asynchronously — the endpoint returns immediately with 202 Accepted and a message. The underlying script runs restic backup on the encrypted volume, which takes 2–10 minutes depending on vault size and network throughput. You can check the snapshots list after the fact via GET /api/v1/admin/backups/snapshots.
This endpoint does not require the extra-header workaround. You can call it directly after Sir confirms.
Trigger a backup: after any large destructive operation (mass vault write, credential rotation, openclaw config patch), before destructive ops that have no clean rollback, or whenever Sir explicitly asks. Tell Sir what's happening: "I'm triggering a backup now — the script will run for a few minutes in the background. I'll confirm when the snapshot shows up, or you can check the Backups panel."
There is no "cancel backup" endpoint. Once triggered, it runs to completion.
Fix-memory
Endpoint: POST /api/v1/admin/compose/fix-memory
This is a specialized compose-level patch that adjusts openclaw's mem_limit from 2 GB to 4 GB and adds NODE_OPTIONS=--max-old-space-size=3072 if not already present. It also tightens healthcheck retries. The patch is idempotent — if the compose file is already up to date, it returns immediately with no changes.
Use this when Sir is seeing memory pressure symptoms: openclaw OOM restarts visible in container logs, enrichment stalls when the Ollama model is loaded simultaneously, or background agents churning at degraded speed. Don't trigger it preemptively — check GET /api/v1/admin/system/info for actual memory figures first.
The endpoint applies the compose changes immediately and then recreates the openclaw container in the background. Because it touches the compose file and triggers a container restart, it inherits the same consent flow as any restart: summarize what's changing, state what won't be touched, get an explicit PROCEED.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/hermes/workspace-template/skills/alfred-destructive-ops/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ssdavidai/alfred/alfred-destructive-ops)