Skip to content
Back to skills

Cli Agent

ASecurity

Dispatches bounded tasks, reviews, and audits through external CLI coding agents (Claude, Codex, Copilot, Agy, and local llama-server), with server lifecycle and model catalog maintenance.

  • 8 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added November 9, 2026
ai-agentspythongobashgitbackendsecurity

Works with

  • claude code
  • cursor
  • cli

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 23, 2026

npx -y skills add richfrem/agent-plugins-skills --skill cli-agent --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cli Agent?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cli Agent
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/richfrem-cli-agent/badge)](https://www.skillsdirectory.com/skills/richfrem-cli-agent)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cli-agent
plugin: cli-agents
description: Dispatches bounded tasks, reviews, and audits through external CLI coding agents (Claude, Codex, Copilot, Agy, and local llama-server), with server lifecycle and model catalog maintenance.
allowed-tools: Bash, Read, Write
---

# CLI Agent (`cli-agent`)

Unified multi-LLM task router and execution engine for external CLI agents and local models.

## Contents

- [Constraints](#constraints) • [Quick Start](#quick-start) • [Backends](#supported-backends--dispatch) • [Workflow](#workflow) • [Verification](#verification) • [Setup & Maintenance](#setup--maintenance) • [Personas](#personas) • [References](#references)

## Constraints

- **Authorization & Isolation**: Analysis uses `--isolated` to suppress hazardous flags; non-isolated execution requires explicit user authorization. With `--isolated`, `run_agent.py` wraps input in `---SOURCE---` … `---END SOURCE---` and appends the isolation instruction. Without `--isolated` (including `--cli llama`), add that instruction to the prompt yourself:
  > "You are operating as an isolated sub-agent. Do NOT use tools. Do NOT access filesystem. Only use the provided input."
- **Fail-Closed & Fallback Routing**: Use one backend per task unless an explicit fallback chain is supplied via `--fallback-chain <chain>` (which triggers failover exclusively on recognized rate-limit/capacity exhaustion). Halt immediately on task or code errors without silent fallback. GitHub Copilot requires explicit `--allow-copilot` authorization. See [fallback-tree.md](references/fallback-tree.md), [execution-contract.md](references/execution-contract.md), and [setup-subscription-pooling.md](references/setup-subscription-pooling.md).
- **Enforced Launch Controls**: `run_agent.py --cwd/--allowed-root`, `--claim-dir/--unit/--owner[/--claim-token]`, `--timeout`, `--clean-context` (claude), `--result-json` enforce worktree boundary, duplicate-launch refusal, process timeout and context policy and return a structured result (checks, limitations, usage or unknown). Guards live in `scripts/dispatch_guard.py` (claim, cwd-check, exec-check, context-check, reconcile). Only code paths using the flags are protected; everything else in this skill is instruction. See [execution-contract.md](references/execution-contract.md).
- **Reproducibility & Scope**: Reuse the caller's runtime/model/effort choice; do not start an unrequested review. Record executable versions, tokens, and outputs.

## Quick Start

```bash
# Zero-token JEV latent task routing (<0.3ms, 0 tokens)
python3 scripts/jev_router.py --format cli-flags "Format markdown table in README.md"
# Output: --runtime openrouter --model meta-llama/llama-3.2-3b-instruct

# OpenRouter micro-tier call under the $10/month cap (falls back to the local server)
python3 scripts/openrouter_client.py --model meta-llama/llama-3.2-3b-instruct "Format this JSON: {...}"
python3 scripts/openrouter_client.py --spend
python3 scripts/smoke_test_openrouter.py   # live end-to-end check (router -> client -> verify), skips without key

# Direct dispatch with automatic multi-subscription fallback
python3 scripts/run_agent.py <personas>/security-auditor.md <input> <output> "Review supplied source." --cli claude --fallback-chain agy,codex --isolated --require-input
```

## Supported Backends & Dispatch

| Backend | CLI Flag | Target Runtime / Engine | Dispatch Reference |
| :--- | :--- | :--- | :--- |
| **Claude** | `--cli claude` | Claude Code CLI (Sonnet / Opus) | [claude-cli-dispatch.md](references/claude-cli-dispatch.md) |
| **Codex** | `--cli codex` | OpenAI Codex CLI (GPT-5 / o-series) | [codex-cli-dispatch.md](references/codex-cli-dispatch.md) |
| **Copilot** | `--cli copilot` | GitHub Copilot CLI | [copilot-cli-dispatch.md](references/copilot-cli-dispatch.md) |
| **Antigravity** | `--cli agy` | Google Antigravity / Gemini CLI | [agy-cli-dispatch.md](references/agy-cli-dispatch.md) |
| **Cursor** | `--cli agent` | Cursor Agent CLI (Grok / Claude / GPT) | [cursor-cli-dispatch.md](references/cursor-cli-dispatch.md) |
| **Local LLM** | `--cli llama` | Local Gemma 4 12B at localhost:8089 or MLX at localhost:8080 | [local-llm-dispatch.md](references/local-llm-dispatch.md) & [local-mlx-apple-silicon.md](references/local-mlx-apple-silicon.md) |
| **OpenRouter** | `scripts/openrouter_client.py` (not a `run_agent.py --cli` value) | Cloud Micro-Tier (Llama-3.2 1B/3B, Qwen3 Coder MoE), $10/month cap, local-server fallback | [openrouter-micro-tier-dispatch.md](references/openrouter-micro-tier-dispatch.md) |

## Workflow

1. **Select Backend & Persona**: Check [backend capabilities](references/backend-capabilities.md) and [cheapest models](references/cheapest_models.md). Choose a persona from `<personas>/` (see [Personas](#personas)).
2. **Dispatch & Verify**: Execute `scripts/run_agent.py` with `--cli <backend>`. Verify exit 0 and non-empty output. Empty or failed output is not a completed review.

## Verification

For gated reviews, record the result through control-plane `record-critic-review PASS|REVISE|REJECT`; only PASS approves. Verify compliance against [acceptance-criteria.md](references/acceptance-criteria.md).

## Setup & Maintenance

- **Subscription Pooling & Fallback Routing**: Probe readiness: `python3 scripts/check_routing_readiness.py`. Validate fallback chain: `python3 scripts/check_routing_readiness.py --validate-chain claude,agy,codex` (see [setup guide](references/setup-subscription-pooling.md)). Pools Claude Pro, Gemini Pro, and ChatGPT Plus on macOS M1 via zero-daemon CLI fallback chains with `--allow-copilot` guards.
- **Project Setup & Catalogs**: Follow [project setup](references/project-setup.md), [capability baseline](references/project-capability-baseline.md), [workflow](references/project-configuration-workflow.md), [profile contract](references/capability-profile-contract.md), and [catalog maintenance](references/model-catalog-maintenance.md). Update catalog: `python3 scripts/sync_cheapest_models.py --repository . --dry-run` (refresh neither authorizes model calls nor starts reviews).
- **Local LLM & Specs**: Start llama-server: `python3 scripts/run_server.py` (see [deep reference](references/local-llm-setup-deep-reference.md), [latency findings](references/routing_latency_findings.md), [proxy diagram](references/routing-proxy.mmd), and [debrief](references/local_llm_debrief.md)). Inspect [Claude spec](references/claude-directory-spec.md), [Claude settings](references/claude-settings-schema.md), [Antigravity spec](references/antigravity-directory-spec.md), [Gemini commands](references/gemini-cli-commands.md), [Codex fixture](references/p0-codex-observation-fixture.json), and [map debt](references/map-debt.md).

## Personas

`<personas>` is the cli-agents host sub-agent directory, not part of this skill: the cli-agents plugin's top-level `agents/` folder in a source checkout, or the harness's installed agents (e.g. `.claude/agents/`). Any prompt file or `/dev/null` also works. Common: `security-auditor.md`, `refactor-expert.md`, `architect-review.md`, `red-team-reviewer.md`.

Without `--isolated`, add to the prompt: "You are operating as an isolated sub-agent. Do NOT use tools. Do NOT access filesystem. Only use the provided input."

## References

- [Project Setup](references/project-setup.md) • [Capability Baseline](references/project-capability-baseline.md) • [Workflow](references/project-configuration-workflow.md) • [Profile Contract](references/capability-profile-contract.md) • [Acceptance Criteria](references/acceptance-criteria.md)
- [Backend Capabilities](references/backend-capabilities.md) • [Execution Contract](references/execution-contract.md) • [Fallback Tree](references/fallback-tree.md) • [Cheapest Models Reference](references/cheapest_models.md) • [Model Catalog Maintenance](references/model-catalog-maintenance.md)
- [Cursor CLI Dispatch](references/cursor-cli-dispatch.md) • [Autonomous Agent Platforms](references/autonomous-agent-platforms.md) • [Provider Fallback Routing](references/provider-fallback-routing.md) • [Subscription Pooling & Readiness Probe](references/setup-subscription-pooling.md) • [OpenRouter Micro-Tier Dispatch](references/openrouter-micro-tier-dispatch.md) • [OpenRouter Models Catalog](references/openrouter-models.json) • [Zero-Token JEV Router](references/jev-router.md)
- [Local LLM Setup Reference](references/local-llm-setup-deep-reference.md) • [Local Apple Silicon MLX Reference](references/local-mlx-apple-silicon.md) • [Local LLM Debrief](references/local_llm_debrief.md) • [Routing Latency Findings](references/routing_latency_findings.md) • [Routing Proxy Diagram](references/routing-proxy.mmd) • [Map Debt](references/map-debt.md)
- [Claude Directory Spec](references/claude-directory-spec.md) • [Claude Settings Schema](references/claude-settings-schema.md) • [Antigravity Directory Spec](references/antigravity-directory-spec.md) • [Gemini CLI Commands](references/gemini-cli-commands.md) • [Codex Fixture](references/p0-codex-observation-fixture.json)

Files in this skill

  • SKILL.md7.9 KB
  • evals/evals.json2.5 KB
  • references/acceptance-criteria.md3 KB
  • references/agy-cli-dispatch.md2.6 KB
  • references/agy-models.json19.7 KB
  • references/antigravity-directory-spec.md3.4 KB
  • references/autonomous-agent-platforms.md5.7 KB
  • references/backend-capabilities.md2.5 KB
  • references/capability-profile-contract.md2.5 KB
  • references/cheapest_models.json984 B
  • references/cheapest_models.md1.4 KB
  • references/claude-cli-dispatch.md1.9 KB
  • references/claude-directory-spec.md3.2 KB
  • references/claude-models.json16.6 KB
  • references/claude-settings-schema.md2.2 KB
  • references/codex-cli-dispatch.md2.3 KB
  • references/codex-models.json12.8 KB
  • references/copilot-cli-dispatch.md3.3 KB
  • references/copilot-models.json32.8 KB
  • references/cursor-cli-dispatch.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.