generic-agent-code-run

generic-agent-code-run is a skill for Claude Code, Codex from DDDFXYqiming/Agent_Extensions. It costs 75 tokens per session (1,403 once invoked), scanned C, original, MIT.

A skill for controlling Windows desktop applications and real browser sessions through scripted interaction, accessibility information, OCR, screenshots, and browser debugging connections.

In plain words
What is it for?
Use it to automate Windows apps, inspect browser pages, read screen text, capture screenshots, interact through UI controls, or connect to a browser's debugging interface.
Why use it?
It supports tasks where inspecting and operating a graphical application is necessary, rather than working only with source files or a terminal. Its observe-act-verify approach helps check whether each interaction had the intended result.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for hermes-agent. Also seen: built for hermes-agent.

Good fit Use it to automate Windows apps, inspect browser pages, read screen text, capture screenshots, interact through UI controls, or connect to a browser's debugging interface.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dddfxyqiming/agent_extensions/generic-agent-code-run
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add DDDFXYqiming/Agent_Extensions --skill generic-agent-code-run
Clone the repo
git clone --depth 1 https://github.com/DDDFXYqiming/Agent_Extensions

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generic-agent-code-run

README.md
[![agentmods](https://agentmods.dev/badge/skills/dddfxyqiming/agent_extensions/generic-agent-code-run/github.svg)](https://agentmods.dev/skills/dddfxyqiming/agent_extensions/generic-agent-code-run)
Your own site
<a href="https://agentmods.dev/skills/dddfxyqiming/agent_extensions/generic-agent-code-run"><img src="https://agentmods.dev/badge/skills/dddfxyqiming/agent_extensions/generic-agent-code-run/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for generic-agent-code-run

Your own site · 80×15
<a href="https://agentmods.dev/skills/dddfxyqiming/agent_extensions/generic-agent-code-run"><img src="https://agentmods.dev/badge/skills/dddfxyqiming/agent_extensions/generic-agent-code-run.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,403 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00075 $0.01403
Opus 5.5 $0.00030 $0.00561
Sonnet 5.5 $0.00015 $0.00281
Haiku 4.5 $0.00007 $0.00140

Measured 1mo ago against content hash 6e625250f9be, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

generic-agent-code-run scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 6 executable files (scripts/browser_cdp_probe.py, scripts/desktop_probe.py, scripts/ga_env.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- 删除文件或目录;不跑 `rm -rf`、`Remove-Item -Recurse -Force` 及等价命令。
General_skills/generic-agent-code-run/SKILL.md · 128 lines

How it starts

The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GenericAgent Code_Run

用 GenericAgent 的模式操作 Windows 原生桌面应用与真实浏览器会话:极少的固定工具、一条通用的 code_run 执行通道、本地能力库,外加严格的「观察-执行-校验」闭环。

核心思路不是背下一大堆固定工具,而是:针对当前任务生成一小段专用 Python,执行它,拿回 JSON 证据,再从已验证的状态决定下一步动作。

何时使用

  • Windows 原生应用操控:窗口枚举、激活、截图、OCR、UIA、点击、输入。
  • 带已有登录态的真实浏览器操控:TMWebDriver、Chrome 扩展 CDP 桥、DOM/JS/CDP 操作。
  • 需要临时组合本地 Python 能力,而不是依赖预先声明好的 GUI 工具集。
  • 每一次副作用之后都必须可靠地校验结果。

不要照搬 GenericAgent 的完整 agent loop、LLM 客户端或记忆系统——这些层次由宿主框架负责。

核心机制

observe -> generate minimal code_run Python -> execute -> return JSON evidence -> verify -> next action

一个 code_run 代码块只导入当前这一步真正需要的模块:

import json
# optional imports as needed:
# import win32gui, win32api, win32con
# from PIL import ImageGrab
# import pyperclip, uiautomation
# from TMWebDriver import TMWebDriver

result = {"ok": False, "action": "", "evidence": {}, "error": None}
# perform one minimal action or one observation
print(json.dumps(result, ensure_ascii=False, indent=2))

一律返回 JSON。

桌面操控流程

  1. 观察:用 win32gui.EnumWindows 枚举窗口,用 PIL.ImageGrab.grab 截图,UIA/OCR 只在需要时看。
  2. 锁定目标:产生任何副作用前,先核对标题、hwnd、class、进程和窗口矩形区域。
  3. 执行:使用尽可能小的 Win32/UIA/剪贴板/鼠标/键盘动作。
  4. 校验:动作之后用截图/OCR/UIA/窗口状态确认结果。
  5. 只报告已验证的结论。

细则见 references/windows-control.md、references/code-run-core.md。

浏览器操控流程

优先级顺序:

DOM/Runtime.evaluate -> CDP Input.dispatchMouseEvent -> physical mouse click

需要真实登录态时,复用已有浏览器会话或持久化上下文。校验手段:URL、标题、DOM 文本、截图或接口响应。

细则见 references/browser-control.md,探针脚本:scripts/browser_cdp_probe.py。

安全规则

绝不做:

  • 删除文件或目录;不跑 rm -rf、Remove-Item -Recurse -Force 及等价命令。
  • 批量杀进程,例如杀掉所有 python.exe。
  • 读取或输出凭据、API Key、Cookie 或任何机密。
  • 未经明确确认就提交支付或敏感个人信息。
  • 在没有观察证据的情况下点击凭猜测得出的坐标。
  • 未做校验就宣称成功。

必须做:

  • 副作用之前先确认目标窗口。
  • 每段 code_run 片段保持简短。
  • 返回带证据的 JSON。
  • 每次副作用之后都校验。
  • 如实报告失败。

完整清单见 references/safety-rules.md。

环境

设计上要求可移植——绝不把本地 GenericAgent 检出路径写死。

$env:GENERIC_AGENT_ROOT='D:\path\to\GenericAgent'
$env:GENERIC_AGENT_PYTHON='D:\path\to\GenericAgent\.venv\Scripts\python.exe'

Read the full file on GitHub · 128 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -205 lines · +30 tokens per session 6e625250f9be
  2. 1mo ago First seen · 333 lines · 45 tokens per session scan C c3553d0ce5b7

Subscribe to this mod's changes

generic-agent-code-run is a skill published in the GitHub repository DDDFXYqiming/Agent_Extensions (6 stars, last pushed 6d ago), licensed MIT. It adds 75 tokens to every session and 1,403 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

python-programming-expert

Expert-level skill for Python programming (Python 3.13/3.14+). Covers type safety, generic syntax (PEP 695), async/await TaskGroups, FastAPI 0.115+, Pydantic v2, uv package manager, Ruff, and pytest in English and Indonesian.

roedyrustam/vibes-plug · 68 tokens

developing-kafka-python-client

Use when the user wants to build a Python Kafka producer or consumer, add Schema Registry to existing Python code, migrate from raw JSON to schema-backed serialization, or scaffold a confluent-kafka-python project for Confluent Cloud, local Docker, or WarpStream. Also use when user wants to optimize Python Kafka…

confluentinc/agent-skills · 75 tokens

upstash-box-py

Work with the upstash-box Python SDK for sandboxed cloud containers with AI agents, shell, filesystem, git, cron schedules, snapshots, and a headless browser. Use when building with Upstash Box in Python, creating a sandbox or isolated environment to run untrusted or agent-generated code, running AI coding agents in…

upstash/skills · 109 tokens

django

Use when building Django applications. Covers ORM query performance, model design, migrations, Django REST Framework, security defaults, and testing. Trigger on "django view is slow", "too many queries from the orm", "add a drf endpoint", "migration on a big table". Do not use for API contract decisions independent of…

nimadorostkar/Claude-Skills-collection · 75 tokens

fastapi

Use when building APIs with FastAPI. Covers dependency injection, Pydantic v2 validation, async database access, authentication, background tasks, and testing. Trigger on "fastapi endpoint is slow under load", "set up depends for the db session", "pydantic v2 validation error", "test my fastapi app". Do not use for…

nimadorostkar/Claude-Skills-collection · 89 tokens

create-pubsub-python

Creates a Dapr pub/sub app in Python with FastAPI (publisher, subscriber or both) and declarative, programmatic or streaming subscriptions. Use for "create a pub/sub app in Python" or "build a FastAPI publisher and subscriber with Dapr". For an existing app use add-pubsub-python.

diagrid-labs/dapr-skills · 70 tokens