agentleFS
fritzprixfritzprix/libr-agent/.agents/skills/agy-delegate/SKILL.md

agy-delegate

Skill11 starsChanged 19 days agoMITView on GitHub

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, Gemini via agy, delegate to agy, agy print mode, agy-delegate. NEVER for LibrAgent HTTP Session API (that is `libr-delegate`). NEVER invent MCP tool names for agy. NEVER swap `--model` away from this skill’s default unless the user explicitly names a model.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 3 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Only run agy models when the user asked for a non-default model, or the default id failed as unknown/stale.

    line 38
  2. Distinctive:

    Write a self-contained handoff (agy does not see this Cursor chat)

    line 43
  3. Very specific:

    Use this skill’s default --model (below).

    line 44
  4. Very specific:

    Run print mode (-p / --print) from the relevant cwd or pass --add-dir

    line 46
  5. Distinctive:

    Read stdout as the result.

    line 47
  6. Very specific:

    Follow-ups: new -p with fuller context, or --conversation <id> / --continue when resuming the same thread — same model as the first turn

    line 48
  7. Very specific:

    Use --output-format json / -Json to parse status (SUCCESS / …) and response

    line 102
  8. Very specific:

    Do not hardcode alternate model names into invocations.

    line 112
  9. Very specific:

    Default cwd is whatever shell cwd you launch with — set it, or pass absolute --add-dir

    line 121
  10. Very specific:

    Put objective, scope, paths, and output format in the -p prompt

    line 123
  11. Distinctive:

    Do not assume Cursor files, notes, or skills are visible inside agy

    line 125

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 needSkill
Cursor → agy (Gemini/Claude/etc. CLI)This skill
Cursor → LibrAgent HTTP /api/sessionslibr-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
  3. Run print mode (-p / --print) from the relevant cwd or pass --add-dir
  4. Read stdout as the result; on failure check exit code and stderr
  5. Follow-ups: new -p with fuller context, or --conversation <id> / --continue when resuming the same thread — same model as the first turn
  6. Optional: --output-format json when you need status / response fields

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: ...
'@

& agy -p "$TASK" `
  --model gemini-3.8-flash-high `
  --dangerously-skip-permissions `
  --print-timeout 300s `
  --add-dir "$WORKSPACE_ABS"
# Using bundled PowerShell wrapper (recommended on Windows)
& .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"
  • Omit --dangerously-skip-permissions / -NoSkipPerms when the user must approve tool use
  • Raise timeout for long coding/research turns; 0 waits until completion
  • Repeat --add-dir / -Dir for extra roots
  • Use --output-format json / -Json to parse status (SUCCESS / …) and response

Model selection (strict)

RuleAction
Normal delegateAlways --model gemini-3.8-flash-high (or omit --model when using scripts/run.sh / AGY_MODEL default)
User names a modelUse 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:

  • Default cwd is whatever shell cwd you launch with — set it, or pass absolute --add-dir
  • Put objective, scope, paths, and output format in the -p prompt
  • Require deliverables in stdout (final assistant text / JSON response)
  • Do not assume Cursor files, notes, or skills are visible inside agy

Anti-patterns

  • Calling nonexistent MCP tools (agy__*, spawnAgy, …)
  • Vague prompts that rely on Cursor thread context
  • Treating non-zero exit or JSON status ≠ SUCCESS as success
  • Using this skill for LibrAgent Session API (use libr-delegate)
  • Interactive-only flags (-i) for automation — prefer -p
  • Changing --model without an explicit user request (including Pro/Claude “for quality”)
  • Unquoted variables in PowerShell (agy -p $TASK splits words into CLI flags; always quote or use Here-Strings)
  • Bash syntax in PowerShell (&&, \, ./scripts/run.sh — use ;, `, or run.ps1)
  • Script sprawl: fabricating ad-hoc .bat/.py/.js wrappers instead of using direct invocations or the provided run.sh/run.ps1

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.