Agy delegate

From fritzprix/libr-agent · View interactive version

Agy delegate is an AI agent skill from the GitHub repository fritzprix/libr-agent. Delegate work to the local `agy` CLI (print mode) — typically Gemini or other models listed by `agy models`. Use from Cursor when you need a one-shot or follow-up agy turn with a self-contained handoff, optional `--add-dir` workspace, and parseable stdout. Triggers: agy, agy -p, --model gemini, Gemi

How to use this skill

Skill file

Agy Delegate (Cursor → `agy` CLI)

Spawn and steer agy turns from Cursor via the local CLI. agy must be

installed and on PATH (typically ~/.local/bin/agy).

vs `libr-delegate`

| Caller need | Skill |

| ------------------------------------------- | --------------- |

| Cursor → agy (Gemini/Claude/etc. CLI) | This skill |

| Cursor → LibrAgent HTTP /api/sessions | libr-delegate |

Preconditions

# Bash (Linux / macOS)
command -v agy >/dev/null || { echo "agy not on PATH"; exit 1; }
# PowerShell (Windows)
if (-not (Get-Command agy -ErrorAction SilentlyContinue)) { Write-Error "agy not on PATH"; exit 1 }

Only run agy models when the user asked for a non-default model, or the

default id failed as unknown/stale.

Workflow

  1. Write a self-contained handoff (agy does not see this Cursor chat)
  2. Use this skill’s default --model (below). Do not pick a different

model for “harder” work, cost, or preference

  1. Run print mode (piped stdin or run.ps1 on Windows, -p on Bash) from the relevant cwd or pass --add-dir
  2. Read stdout as the result; on failure check exit code and stderr
  3. Follow-ups: new -p with fuller context, or --conversation <id> /

--continue when resuming the same thread — same model as the first turn

  1. Optional: --output-format json when you need status / response fields
  2. Temporary files: Write temporary task files in .libragent/tmp/, never in the skill folder (.agents/skills/agy-delegate/)

Recipes: references/cli.md. Handoff / isolation: references/handoff.md.

Optional wrappers: scripts/run.sh (Bash) or scripts/run.ps1 (PowerShell).

Default invoke (unattended)

Default model (do not change): gemini-3.8-flash-high

Linux / macOS (Bash)

agy -p "$TASK" \
  --model gemini-3.8-flash-high \
  --dangerously-skip-permissions \
  --print-timeout 300s \
  --add-dir "$WORKSPACE_ABS"
# Using bundled bash wrapper
./scripts/run.sh --dir "$WORKSPACE_ABS" -- "$TASK"
./scripts/run.sh --json --dir "$WORKSPACE_ABS" -- "$TASK"

Windows (PowerShell)

[!IMPORTANT]

In PowerShell, unquoted multiline variables split across spaces. Always quote "$TASK" or pass via Here-String (@' ... '@).

$TASK = @'
Goal: ...
Scope: ...
'@

$TASK | & agy `
  --model gemini-3.8-flash-high `
  --dangerously-skip-permissions `
  --print-timeout 300s `
  --add-dir "$WORKSPACE_ABS"
# Using bundled PowerShell wrapper (recommended on Windows; passes task via stdin with UTF-8 encoding)
& .agents/skills/agy-delegate/scripts/run.ps1 -Dir "$WORKSPACE_ABS" -Task "$TASK"
& .agents/skills/agy-delegate/scripts/run.ps1 -Dir "$WORKSPACE_ABS" -Json -Task "$TASK"

Model selection (strict)

| Rule | Action |

| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------ |

| Normal delegate | Always --model gemini-3.8-flash-high (or omit --model when using scripts/run.sh / AGY_MODEL default) |

| User names a model | Use exactly that id (verify with agy models if it fails) |

| Agent judgment (“this needs Pro/Claude”) | Forbidden — keep the default |

Do not hardcode alternate model names into invocations. Do not “upgrade”

to Pro/Opus/Claude unless the user asked. If agy rejects the default id as

stale, list agy models and pick the closest flash-high equivalent — still

do not silently jump to Pro.

Isolation (critical)

The agy session is not a clone of this Cursor chat:

--add-dir

Anti-patterns

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.