command-execution
Command execution procedures
This skill provides procedural how-to for the invariants defined
in the command-execution rule module. The rule module states
what must hold; this skill states how to comply.
Federated identity flow handoff
When an automation-launched browser context is blocked or degraded during a federated identity flow (Google, Apple, Microsoft, GitHub):
- Stop the automation at the moment the IdP redirect URL is reached. Do not attempt to fill the IdP form from automation.
- Hand off the IdP step to a real browser session via Chrome DevTools Protocol attach, or by asking the user to complete the sign-in step interactively.
- Wait for the post-IdP redirect back to the application's callback URL.
- Resume automation from the post-callback state.
The agent MUST NOT attempt to bypass provider anti-automation,
embedded-browser restrictions, or "this browser is not secure"
gates. Such bypasses are explicitly forbidden by the
command-execution rule module.
Agent-browser session retry
When the default agent-browser session bind fails on Windows:
- Choose an explicit, task-scoped session name (e.g.,
task-<short-id>). - Retry the bind with the new name.
- If multiple binds fail in sequence, capture the error and surface it; do not loop indefinitely.
- Track every session name your task opens so you can close them on completion.
Privilege elevation fallback
The rule module requires sudo first; this is the fallback
ladder when sudo is unavailable:
- Try
sudo <command>directly. - If
sudois not on PATH, check forgsudo(a PowerShell-friendly elevation tool) and use it if available. - As a last resort, instruct the user to re-run the command in an elevated terminal session.
- NEVER spawn a separate elevated shell window such as
Start-Process -Verb RunAsfrom inside an automation flow — the parent loses stdout/stderr capture and exit code propagation.
Destructive PowerShell file deletion safety
When the rule module requires verifying the final absolute target path before a destructive operation:
- Resolve the target with
[System.IO.Path]::GetFullPath($candidate)orResolve-Path -LiteralPath $candidate. - Assert the resolved path is inside the expected directory tree before deleting.
- Normalize file attributes (
attrib -r -h -s) on read-only, hidden, or system files before attempting deletion. - Prefer
[System.IO.File]::Delete()/[System.IO.Directory]::Delete($path, $true)over thermalias, which dispatches through provider hooks that may silently fail on locked files. - After deletion, re-stat the path and verify it is gone.
Avoiding interactive git prompts
The rule module forbids interactive git prompts. Apply one of these in every git invocation that might open an editor:
- Pass
--no-edittomerge,revert,cherry-pick, etc. - Set
GIT_EDITOR=truefor the invocation. - For commit messages, always pass
-m "<msg>"or use a here-doc.
Diagnosing third-party tool failures
When the rule module requires checking the latest stable release:
- Determine the currently installed version
(
<tool> --versionor package manager query). - Look up the latest stable release on the tool's official release feed.
- Upgrade to the latest stable in an isolated install if feasible.
- Re-run the failing command on the latest stable.
- If the failure persists, document the version, exact command, and reproduction steps as a verified limitation.
- Implement the smallest deterministic workaround that does not bypass safety checks.