Unattended
Author an unattended PowerShell script for scriptable work blocked by privilege/policy boundary (UAC, elevated shell, operator-only): agent authors, never…
от 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.-Irreversibleis 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: nonewhen empty; not under-Test) and recorded asirreversible_actions, on success and on failure.-Secretsis the declared list of secrets, each@{ Name = 'API_TOKEN'; FilePath = 'C:\ops\token.txt' }(FilePathis 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: nonewhen empty; not under-Test) and recorded assecrets, names only, on success and on failure.Assert-Elevation -Mode RequiredorForbidden. 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 comparesNamewithWSL_DISTRO_NAMEonly: 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 aMicrosoft.PowerShell.SecretManagementvault, then the native store (macOS Keychain throughsecurity find-generic-password -s <name> -w; Linuxpass 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-Secretsreturns 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 isok.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 throwstimed 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 await <Name>step. It emits$true, so standing alone it is written `$null = Wait-For
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- 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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…