Agent Skills › yb2460/harness-anything

yb2460/harness-anything

GitHub

通过COM自动化操控WPS Office的CLI工具。核心支持JSON数据驱动PPT自动生成,涵盖数据搜索、图表生成及12-15页标准排版。同时提供Writer/Calc/Impress的文档管理、样式预设应用及导出功能,适用于Windows环境下的办公自动化与演示文稿批量生产。

3 skills 1,016

Install All Skills

npx skills add yb2460/harness-anything --all -g -y
More Options

List skills in collection

npx skills add yb2460/harness-anything --list

Skills in Collection (3)

通过COM自动化操控WPS Office的CLI工具。核心支持JSON数据驱动PPT自动生成,涵盖数据搜索、图表生成及12-15页标准排版。同时提供Writer/Calc/Impress的文档管理、样式预设应用及导出功能,适用于Windows环境下的办公自动化与演示文稿批量生产。
需要基于结构化数据快速生成专业PPT 使用命令行批量创建或修改WPS文档/表格/演示稿 需要自动化处理WPS文件的样式应用与格式导出
cli_anything/wps/skills/SKILL.md
npx skills add yb2460/harness-anything --skill cli-anything-wps -g -y
SKILL.md
Frontmatter
{
    "name": "cli-anything-wps",
    "description": "WPS Office CLI — JSON数据驱动PPT自动生成 + 命令行操控WPS文字\/表格\/演示文稿"
}

cli-anything-wps

通过 COM 自动化接口操控 WPS Office 的命令行工具。支持 WPS 文字(Writer)、WPS 表格(Calc)和 WPS 演示(Impress)。

前置条件

  • Windows 操作系统
  • WPS Office(已安装,版本 12.0+)
  • Python 3.10+
  • pywin32pip install pywin32

安装

pip install -e .
cli-anything-wps --help

JSON 数据驱动 PPT 自动生成 ⭐ 生产环境核心工作流

这是最常用的模式:搜数据 → 生成 matplotlib 图表 → 写 JSON → WPS COM 一键生成。

完整流程(6步)

1. 提取模板背景: 模版.pptx → template_bg.png (960x540)
2. WebSearch 搜索数据: 招生分数线/学科排名/招生计划/科研数据
3. matplotlib 生成图表: 柱状图/饼图/折线图/横向柱/气泡图
4. 编写 data.json: 12-15页 elements[] 编排(标题≤4字 + 间距≥24pt)
5. python build_xxx.py: WPS COM 逐页构建
6. 输出: PPTX + PDF 双格式

标准页序

S1 封面 → S2 目录 → S3-S10 内容页(图+表+卡片) → S11 总结卡片 → S12 致谢

元素类型路由

type 用途
text 文本框
image 图片(含matplotlib图表)
table 表格
cards_2x3 2行x3列彩色卡片
cards_1x4_info 4列数字统计卡
card_list_wide 目录编号列表
tagline_bar 页面底部总结条

关键约束 ⚠️

  • 标题与内容间距:标题 y=14 h=40(结束于y≈54),第一个内容元素必须起始于 y≥76-78(≥24pt gap)
  • 标题最多4字,居中,SimHei 40-44pt,品牌色,无装饰线
  • JSON中文引号:文本内引用用「」代替 ""
  • 所有元素不出画布:960×540,y+h≤518
  • WPS COMFill.ForeColor.RGBSaveAs(path, 32)导出PDF
  • 执行前清理taskkill //F //IM wps.exe //T

参考案例

WPS/ 目录下16个项目:

项目 页数 主题
清华协和/兰州大学/同济医学院/哈工大/重庆大学/南华大学 12页 各校招生
中山大学/中科大/国科大 15页 名校招生
复旦大学 12页 新工科+医学院
南科大肿瘤医院 12页 联合培养硕博
北大/清华/南科大/华中科大/浙大城市学院 9-14页 各校介绍
# 完整执行示例
python -c "import zipfile; ..."  # 提取模板
python gen_charts.py              # 生成图表
python -c "import json; json.load(open('data.json','r',encoding='utf-8'))"  # 验证JSON
taskkill //F //IM wps.exe //T
python build_xxx.py               # 构建PPTX+PDF

CLI 命令结构

wps
├── document          # 文档管理: new/open/save/info
├── writer            # 文字: add-paragraph/heading/list/table/image
├── calc              # 表格: set-cell/get-cell/set-range/merge-cells
├── impress           # 演示: add-slide/remove-slide/set-content/add-element
├── style             # 样式: create/modify/list/apply/remove
├── preset            # 设计预设: list/info/apply
├── export            # 导出: render output.pptx -p pptx
└── session           # 会话: status/undo/redo/history

使用示例

# 创建文档
cli-anything-wps document new --type writer --name "报告" -o report.json
cli-anything-wps --project report.json writer add-heading -t "年度报告" -l 1
cli-anything-wps --project report.json export render report.docx -p docx

# JSON模式(Agent使用)
cli-anything-wps --json document new --type writer --name "test"

设计预设

预设 配色 适用场景
academic 深蓝#1A3C8B 学术答辩/基金申请
consultant 深蓝#003366+亮青 咨询报告
business 商务蓝#005294 会议汇报/课件
tech 近黑#0F1423 科技/AI/数据报告

质量审查(5维度)

维度 检查项 阈值
visual 字体层级/对比度/留白 70分
pedagogy 叙事弧/预备知识 75分
proofreading 拼写/术语/溢出 80分
parity PPTX/PDF一致性 85分
substance 数据准确性/引用 90分
通过Windows COM自动化在PS中执行CLI命令,支持项目、图层、选区、文字及导出操作。适用于需批量或程序化控制Photoshop的场景。
需要自动化创建或修改Photoshop PSD文件 批量处理图像图层、选区或文字 将Photoshop集成到Python脚本或AI Agent工作流中
photoshop-harness/skills/cli-anything-photoshop/SKILL.md
npx skills add yb2460/harness-anything --skill cli-anything-photoshop -g -y
SKILL.md
Frontmatter
{
    "name": "cli-anything-photoshop",
    "description": "通过 COM 自动化操控 Adobe Photoshop 的 CLI harness。支持项目管理、图层操作、选区控制、文字编辑、图像调整和多格式导出。"
}

CLI-Anything Photoshop

通过 Windows COM 自动化接口操控 Adobe Photoshop 的命令行工具。

前置条件

  • Windows 10/11
  • Adobe Photoshop 2023+ (需注册 COM 接口)
  • Python 3.10+pywin32

安装

cd photoshop-harness/agent-harness
pip install -e .

安装后可使用 cli-anything-photoshop 命令。

命令结构

cli-anything-photoshop [--json] [--project <path>] [--dry-run] <command-group> <command> [options]

全局选项

选项 描述
--json 以 JSON 格式输出(供 AI Agent 解析)
--project <path> 自动打开或创建 PSD 项目文件
--dry-run 执行命令但不保存到磁盘

命令组

project — 项目管理

命令 选项 描述
new <path> -w width, -h height, -r resolution, -m mode, -b bg-color 创建新 PSD
open <path> 打开 PSD 文件
save [path] 保存文档
close --no-save 关闭文档

document — 文档操作

命令 选项 描述
info 文档信息
resize -w width, -h height, -r resolution 调整尺寸
canvas -w width, -h height, -a anchor 调整画布
crop --left --top --right --bottom 裁切
rotate -a angle 旋转画布
flip -d direction 翻转画布
mode -m mode 更改色彩模式
trim -t type 裁切边缘

layer — 图层操作

命令 选项 描述
add -n name, -t type, -o opacity, -b blend 添加图层
delete -n name 删除图层
duplicate -n name, --new-name name 复制图层
rename --old name, --new name 重命名
show / hide -n name 显示/隐藏
opacity -n name, -o opacity 设置透明度
blend -n name, -m mode 设置混合模式
list 列出所有图层
reorder -n name, -p position 调整顺序
merge -n name, --with-layer name 合并图层

selection — 选区操作

命令 选项 描述
all 全选
none 取消选区
invert 反转选区
feather -r radius 羽化
expand -p pixels 扩展
contract -p pixels 收缩
border -w width 边框选区
rect --left --top --right --bottom 矩形选区
fill -c color, -o opacity 填充选区

text — 文字操作

命令 选项 描述
add -t text, -f font, -s size, -c color 添加文字
edit -n name, -t text, -f font, -s size, -c color 编辑文字
info -n name 文字信息

export — 导出

命令 选项 描述
save <path> -f format, -q quality, -w width, -h height 导出文件

repl

命令 描述
repl 启动交互式 REPL 模式

使用示例

AI Agent 用法(--json 模式)

# 创建新项目并获取 JSON 输出
cli-anything-photoshop --json project new -w 800 -h 600 poster.psd

# 添加文字图层
cli-anything-photoshop --json --project poster.psd text add -t "Hello World" -f Arial -s 48 -c "#FF0000"

# 列出所有图层(JSON 格式)
cli-anything-photoshop --json --project poster.psd layer list

# 导出为 PNG
cli-anything-photoshop --json --project poster.psd export save -f png output.png

# 预览(不保存)
cli-anything-photoshop --dry-run --project poster.psd layer add -n "draft" --type text

人工使用

# 打开 PSD,交互编辑
cli-anything-photoshop --project work.psd layer list

# 启动 REPL
cli-anything-photoshop repl

Agent 使用指南

  1. 始终使用 --json 标志 获取结构化输出
  2. 使用 --dry-run 预览,确认后再正式保存
  3. 错误处理:退出码非零时检查 stderr 中的 JSON 错误对象
  4. 项目状态:使用 --project 自动管理文件打开/保存
  5. REPL 模式:适合多步骤交互式操作,减少 Photoshop 进程启动开销

Photoshop COM 架构

CLI 命令 → Click CLI → Core 模块 → ComBridge (单例) → Photoshop.Application COM → Photoshop 引擎

Photoshop 通过 Windows COM 接口暴露全部编辑能力。本 harness 封装了最常用的操作。如需扩展,参考 Adobe Photoshop COM 文档添加新方法到 utils/com_bridge.py

Zotero桌面版的原生CLI工具,通过组合本地接口而非重实现来管理文献。支持应用状态检查、集合与标签管理、文献检索导出、引用生成、笔记读写及文件导入等功能,需启用本地API或依赖GUI上下文。
需要命令行操作Zotero文献库 批量管理Zotero中的集合、标签或文献条目 从Zotero获取引用格式或元数据 自动化处理Zotero中的笔记和附件
cli_anything/zotero/skills/SKILL.md
npx skills add yb2460/harness-anything --skill cli-anything-zotero -g -y
SKILL.md
Frontmatter
{
    "name": "cli-anything-zotero",
    "description": "CLI harness for Zotero."
}

cli-anything-zotero

cli-anything-zotero is an agent-native CLI for Zotero desktop. It does not reimplement Zotero. Instead, it composes Zotero's real local surfaces:

Installation

pip install -e .

Entry Points

cli-anything-zotero
python -m cli_anything.zotero

Important Constraints

  • search items, item export, item citation, and item bibliography require Zotero's Local API to be enabled.
  • note add depends on the live Zotero GUI context and expects the same library to be selected in the app.
  • Import-time PDF attachment support is limited to items created in the same connector session; arbitrary existing-item attachment upload is still out of scope.
  • Experimental SQLite write commands are local-only, user-library-only, and should be treated as non-stable power-user operations.
  • If a bare key is duplicated across libraries, set session use-library <id> before follow-up commands.

Command Groups

App

Application and runtime inspection commands.

Command Description
status Execute status.
version Execute version.
launch Execute launch.
enable-local-api Execute enable-local-api.
ping Execute ping.

Collection

Collection inspection and selection commands.

Command Description
list Execute list.
find Execute find.
tree Execute tree.
get Execute get.
items Execute items.
use-selected Execute use-selected.
create Execute create.

Item

Item inspection and rendering commands.

Command Description
list Execute list.
find Execute find.
get Execute get.
children Execute children.
notes Execute notes.
attachments Execute attachments.
file Execute file.
export Execute export.
citation Execute citation.
bibliography Execute bibliography.
context Execute context.
analyze Execute analyze.
add-to-collection Execute add-to-collection.
move-to-collection Execute move-to-collection.

Search

Saved-search inspection commands.

Command Description
list Execute list.
get Execute get.
items Execute items.

Tag

Tag inspection commands.

Command Description
list Execute list.
items Execute items.

Style

Installed CSL style inspection commands.

Command Description
list Execute list.

Import

Official Zotero import and write commands.

Command Description
file Execute file.
json Execute json.

Note

Read and add child notes.

Command Description
get Execute get.
add Execute add.

Session

Session and REPL context commands.

Command Description
status Execute status.
use-library Execute use-library.
use-collection Execute use-collection.
use-item Execute use-item.
use-selected Execute use-selected.
clear-library Execute clear-library.
clear-collection Execute clear-collection.
clear-item Execute clear-item.
history Execute history.

Examples

Runtime Status

Inspect Zotero paths and backend availability.

cli-anything-zotero app status --json

Read Selected Collection

Persist the collection selected in the Zotero GUI.

cli-anything-zotero collection use-selected --json

Render Citation

Render a citation using Zotero's Local API.

cli-anything-zotero item citation <item-key> --style apa --locale en-US --json

Add Child Note

Create a child note under an existing Zotero item.

cli-anything-zotero note add <item-key> --text "Key takeaway" --json

Build LLM Context

Assemble structured context for downstream model analysis.

cli-anything-zotero item context <item-key> --include-notes --include-links --json

Version

0.1.0


Academic Research Skills Integration

Zotero harness integrates 27 academic research skills. Use skills command group:

cli-anything-zotero skills list              # List all skills
cli-anything-zotero skills list -c writing   # Writing skills only
cli-anything-zotero skills pipeline original_article  # Recommended workflow
cli-anything-zotero skills journal "Nature"  # Journal figure guide

Skill Categories

Category Skills Description
search lit-review, systematic-review, deep-search Literature discovery
research ideation, brainstorming, hypothesis, deep-research Research design
writing write-paper, manuscript, citation, outline, revision Paper writing
review full-review, peer-review, seven-pass, verify-citations, audit-data Peer review
visualization slides, schematics, poster, nature-fig Figures & presentations
analysis eda, statistics, critical-thinking Data analysis
pipeline full-pipeline, research-to-paper End-to-end workflows

Task Pipelines

Task Steps
literature_review systematic-review → critical-thinking → write-paper → seven-pass
original_article hypothesis → statistics → manuscript → schematics → slides → full-review
meta_analysis deep-search → deep-research → statistics → write-paper → peer-review
thesis full-pipeline → seven-pass → slides → poster

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-22 02:33
浙ICP备14020137号-1 $お客様$