Command Palette

Search for a command to run...

Назад к скиллам
скилл № 44647

Unattended

Author an unattended PowerShell script for scriptable work blocked by privilege/policy boundary (UAC, elevated shell, operator-only): agent authors, never…

БесплатноЗапускает вложенные скрипты
melodic-softwareот melodic-software★ 34 звезды на GitHub

Установить Unattended в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Unattended launch

/wizard:generate is for a step a human has to perform: a dashboard click, a 2FA code, an unplug. This skill is the other case. The work is fully scriptable, and a human is in the loop only because the agent lacks the privilege or a policy reserves the run for the operator. The human launches the script once. The script does the work and writes a result file. The agent reads that file. The human does not paste a terminal log back into the chat.

An irreversible step (wsl --unregister, git push --force) still asks the human, in this skill or in generate. That is a consent prompt, not a reason to make the rest of the script interactive.

When to use which

Reason a human is involved Owner
Agent lacks the privilege (UAC, elevated shell) this skill
Agent is forbidden by policy this skill
Dashboard, 2FA, or another step no script can perform /wizard:generate
Irreversible and needs consent Confirm-Irreversible in the script

Process

1. Scope

List the steps, the inputs, and why the agent cannot launch the script. Read the repo for commands and key names. From a live .env, take key names only. Never values. Mark each irreversible step with the exact name the human will type (wsl --unregister Ubuntu-26.04); step 2 passes those names to -Irreversible. Show the ordered stages and wait for the user to confirm them.

Done when: every stage is named, each input has a resolution rung, and each irreversible step is marked and listed as an -Irreversible name.

2. Author

Copy template.ps1 with exactly cat "${CLAUDE_SKILL_DIR}/template.ps1" > <target>.ps1, then edit the copy; never retype it. Leave the library above # STAGES unchanged. Replace the example Invoke-UnattendedRun body with the procedure, using only these helpers:

  • Invoke-UnattendedRun -ResultDirectory -Stages -Irreversible <names> -Secrets <declarations>. Runs the stages and writes the result. -Irreversible is the declared list of irreversible steps, for example 'wsl --unregister Ubuntu-26.04'. It is printed to the transcript before the stages run (irreversible actions: none when empty; not under -Test) and recorded as irreversible_actions, on success and on failure. -Secrets is the declared list of secrets, each @{ Name = 'API_TOKEN'; FilePath = 'C:\ops\token.txt' } (FilePath is optional). Every declared name resolves once, before the first stage, so the human answers every hidden prompt up front and the rest of the run is unattended. The names are printed (secrets: none when empty; not under -Test) and recorded as secrets, names only, on success and on failure.
  • Assert-Elevation -Mode Required or Forbidden. Elevation is a constraint with two failure directions.
  • Assert-NotInside -Name <wsl-distro>. The script must not be running inside the WSL distro it restarts. It compares Name with WSL_DISTRO_NAME only: a service, container or process is not detected. A WSL login cutover cannot be a script running inside that distro; emit PowerShell so it runs on the Windows host.
  • Resolve-UnattendedSecret -Name <ENV> -FilePath <optional>. First hit wins: environment variable, then the file, then a Microsoft.PowerShell.SecretManagement vault, then the native store (macOS Keychain through security find-generic-password -s <name> -w; Linux pass show <name> for an entry file <name>.gpg, first line only), then one hidden prompt. Each store rung is skipped silently when its module, command or the name is absent. The vault uses only a string secret (see the store gotchas). A name declared in -Secrets returns the value resolved before the first stage; declaring a name twice fails the run. An undeclared name runs the ladder at this call, with its own prompt. The value is redacted out of the transcript.
  • Assert-PriorResult -Path <result-latest.json>. Do not start until the previous script's result is ok.
  • Add-Preflight -Name -Test -Fix. Fail before later steps, and carry the remediation command in the result.
  • Invoke-IdempotentStep -Name -Done -Action. A re-run after a partial failure skips work that is already done.
  • Wait-ForState -Name -Predicate -TimeoutSeconds 300 -IntervalSeconds 5. The preferred way to prove a requested state: poll the outcome, never the exit code of the request. It polls the predicate, prints one progress line per poll, and returns once the predicate's last output is truthy; otherwise it throws timed out waiting for <Name> with the last value or error. A predicate that throws counts as not yet, because ephemeral targets race. The predicate must first assert a non-empty observation ($pools.Count -gt 0 -and ...): a vacuous pass is the author's bug, so a drain proof that sees no pools must fail, not pass. It records a wait <Name> step. It emits $true, so standing alone it is written `$null = Wait-For
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • template.ps1
  • template.test.sh

FAQ

Что делает скилл Unattended?

Author an unattended PowerShell script for scriptable work blocked by privilege/policy boundary (UAC, elevated shell, operator-only): agent authors, never launches real run; human runs once; script writes cutover.result/1 JSON. Use when: 'run this elevated', 'I have to launch it', 'operator must apply'. Not for dashboard/2FA or agent-runnable work.

Как установить скилл Unattended?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Unattended запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить Unattended с