Agent Skills › yb2460/harness-anything

yb2460/harness-anything

GitHub

基于Windows COM自动化的Photoshop CLI工具,支持通过Python操控PSD项目、图层、选区、文字及导出。适用于AI Agent自动化图像编辑任务,需Windows环境及Photoshop 2023+。

3 skills 905

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)

基于Windows COM自动化的Photoshop CLI工具,支持通过Python操控PSD项目、图层、选区、文字及导出。适用于AI Agent自动化图像编辑任务,需Windows环境及Photoshop 2023+。
需要批量或自动化处理Adobe Photoshop文件 AI Agent执行复杂的图像合成与编辑任务 在Windows环境下通过命令行脚本控制PS操作
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

Windows下通过COM接口操控WPS Office的CLI工具,支持文字、表格、演示的创建、编辑、样式管理及多格式导出。提供JSON输出和REPL模式,专为Agent自动化办公场景设计。
需要批量处理WPS文档或表格 自动化生成报告或数据表 将结构化数据转换为WPS文件格式 需要通过命令行脚本操作WPS Office
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 — 通过命令行操控 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

命令结构

wps
├── document          # 文档管理
│   ├── new           # 创建新文档
│   ├── open          # 打开项目文件
│   ├── save          # 保存文档
│   ├── info          # 文档信息
│   ├── profiles      # 页面配置列表
│   └── json          # 打印原始 JSON
├── writer            # WPS 文字
│   ├── add-paragraph
│   ├── add-heading
│   ├── add-list
│   ├── add-table
│   ├── add-page-break
│   ├── add-image
│   ├── remove
│   ├── list
│   ├── set-text
│   └── find-replace
├── calc              # WPS 表格
│   ├── add-sheet
│   ├── remove-sheet
│   ├── rename-sheet
│   ├── set-cell
│   ├── get-cell
│   ├── set-range
│   ├── merge-cells
│   └── list-sheets
├── impress           # WPS 演示
│   ├── add-slide
│   ├── remove-slide
│   ├── set-content
│   ├── list-slides
│   └── add-element
├── style             # 样式管理
│   ├── create
│   ├── modify
│   ├── list
│   ├── apply
│   └── remove
├── preset            # 设计预设(PPT风格一键切换)
│   ├── list           # 列出所有预设
│   ├── info [name]    # 查看预设详情
│   └── apply [name]   # 应用设计预设
├── export            # 导出
│   ├── presets       # 列出预设
│   ├── preset-info   # 预设详情
│   └── render        # 导出到文件
└── 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 writer add-paragraph -t "这是报告正文内容。"
cli-anything-wps --project report.json writer add-table -r 3 -c 3

# 导出为 DOCX
cli-anything-wps --project report.json export render report.docx -p docx

# 导出为 PDF
cli-anything-wps --project report.json export render report.pdf -p pdf

使用电子表格

cli-anything-wps document new --type calc --name "数据" -o data.json
cli-anything-wps --project data.json calc set-cell A1 "姓名"
cli-anything-wps --project data.json calc set-cell B1 "年龄"
cli-anything-wps --project data.json calc set-range A2 -d '[["张三",28],["李四",35]]'
cli-anything-wps --project data.json export render data.xlsx -p xlsx

JSON 输出(Agent 使用)

# 所有命令都支持 --json 标志用于机器解析
cli-anything-wps --json document new --type writer --name "test"
cli-anything-wps --json --project test.json session status

REPL 模式

cli-anything-wps
#> document new --type writer --name "演示"
#> writer add-paragraph -t "你好 WPS!"
#> export render demo.docx -p docx
#> quit

Agent 使用指南

  1. 所有命令都支持 --json,返回结构化 JSON
  2. 使用 --project 标志加载现有项目,然后链式执行命令
  3. 会话自动保存:单次命令模式下,退出时会自动保存修改
  4. REPL 模式适合交互式探索
  5. 导出前确保内容已保存到项目文件

导出预设

预设 说明 适用类型
docx Word 文档 writer
doc Word 97-2003 writer
pdf PDF(从 Writer) writer
txt 纯文本 writer
html 网页 writer
xlsx Excel 工作簿 calc
xls Excel 97-2003 calc
csv CSV calc
pdf-calc PDF(从 Calc) calc
pptx PowerPoint impress
ppt PowerPoint 97-2003 impress
pdf-impress PDF(从 Impress) impress

原理

此 CLI 通过 Windows COM 接口与 WPS Office 通信:

  • KWPS.Application → WPS 文字
  • KET.Application → WPS 表格
  • KWPP.Application → WPS 演示

WPS COM API 与 Microsoft Office VBA API 高度兼容。


PPT 设计风格系统

本工具内置 4 套设计预设、14 种布局模板、4 种演讲类型预设和 5 维度质量审查。 做 PPT 时自动调取,生成精美幻灯片。

一、设计预设(Design Presets)

通过 preset apply <名称> 一键切换。AI Agent 应在创建 PPT 前先调用此命令。

1. 学术答辩 (academic)

  • 来源: scientific-slides skill
  • 配色: 深蓝 #1A3C8B / 橙 #E67733 / 绿 #188050
  • 字体: Arial + 微软雅黑,标题 40pt,正文 24pt,标注 16pt
  • 规则: 视觉优先 65% | 色盲友好 | 每页一个主题 | 留白 40% | 最多 6 条要点
  • 适用: 学术会议、论文答辩、基金申请、Journal Club

2. 咨询顾问 (consultant)

  • 来源: pptx-from-layouts skill
  • 配色: 深蓝 #003366 / 亮青 #00A8E8 / 橙 #FF8C00
  • 字体: Arial + 微软雅黑,标题 36pt,正文 18pt,标注 14pt
  • 规则: 59种网格布局 | 中等密度 | 4色限制 | 最多 5 条要点
  • 适用: 商业计划书、咨询报告、年度汇报

3. 商务汇报 (business)

  • 来源: pptx skill
  • 配色: 商务蓝 #005294 / 强调红 #C82828 / 绿 #2DA050
  • 字体: Arial + 微软雅黑,标题 36pt,正文 18pt,标注 14pt
  • 规则: 视觉 45% | 留白 35% | 最多 6 条要点
  • 适用: 会议汇报、项目提案、教学课件

4. 科技极简 (tech)

  • 来源: 现代科技设计
  • 配色: 近黑 #0F1423 / 亮青 #00C8FF / 橙红 #FF643C
  • 字体: Arial + 微软雅黑,标题 44pt,正文 20pt,标注 14pt
  • 规则: 暗色模式 | 3色极简 | 留白 50% | 最多 4 条要点 | 低密度
  • 适用: 科技产品发布、AI/技术演示、数据报告

二、布局模板(Layout Templates)

14 种标准布局,覆盖 PPT 全场景。Agent 做 PPT 时按顺序选用。

模板名称 分类 用途 关键元素
cover 封面 开场标题页 72pt大字 + 装饰线 + 副标题
toc 目录 内容导航 蓝色竖线 + 圆角方块编号 + 6项
overview 概览 信息总览 深色横幅 + 2x4卡片 + 侧边荣誉栏
timeline 时间轴 历史/发展 圆点+竖线 + 日期+事件 + 名人语录卡
grid_cards 卡片网格 人物/地标/产品 4x2网格 + 头像圆 + 名字+简介
quadrant 四象限 对比/分类 2x2布局 + 彩色标题块 + 内容区
stats 数字统计 数据展示 6大数字 + 底部荣誉/说明区
three_col 三列对比 三种方案对比 深色全屏背景 + 三列并排
pipeline 流程图 管道/流程 6个彩色模块 + 连接箭头 + 总结条
data_table 数据表格 排名/指标 左表格 + 右解读区
content_image 图文 图文并茂 左文右图 / 左图右文
closing 结语 收尾页 深色全屏 + 总结 + 校训/联系方式

三、演讲类型预设(Talk Type Presets)

完整的幻灯片序列推荐。Agent 应按类型选用。

conference(学术会议,12-20页)

cover → toc → overview → timeline → quadrant → grid_cards
      → stats → pipeline → data_table → content_image
      → quadrant → timeline → stats → closing

规则: 最多 20 页 | 视觉 65% | 1-2 个核心发现

business(商务汇报,8-15页)

cover → toc → overview → stats → three_col
      → pipeline → grid_cards → data_table → closing

规则: 最多 15 页 | 视觉 50%

defense(论文答辩,45-65页)

cover → toc → overview → timeline → quadrant → content_image
      → pipeline → data_table → stats → quadrant → timeline
      → stats → closing

规则: 最多 65 页 | 视觉 60%

school(学校介绍,14页)

cover → toc → overview → timeline → three_col
      → grid_cards → quadrant → stats → closing

规则: 最多 14 页 | 视觉 55%


四、质量审查标准

5 维度审查,确保 PPT 出品质量。

维度 来源 检查项 通过阈值
visual(视觉) slide-excellence 字体层级、颜色对比度、留白比例、布局一致性 70分
pedagogy(教学法) slide-excellence 叙事弧完整性、预备知识、示例、符号一致性 75分
proofreading(校对) slide-excellence 拼写、语法、术语、标点、字体溢出 80分
parity(格式一致) slide-excellence PPTX/PDF一致、字体嵌入、图片、动画兼容 85分
substance(内容实质) slide-excellence 数据准确性、引用完整、结论支撑 90分

五、Agent 做 PPT 标准流程

1. 确认主题和类型 → 选择预设和演讲类型
   cli-anything-wps preset apply academic --talk-type conference

2. 按演讲类型序列逐页生成内容
   每页应用对应的 layout template

3. 生成完成后执行质量审查
   确保 visual >= 70, pedagogy >= 75

4. 导出 PPTX + PDF 双格式
   cli-anything-wps export render output.pptx -p pptx
   cli-anything-wps export render output.pdf -p pdf
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

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 22:58
浙ICP备14020137号-1 $Гость$