zwpgskill

Batch-grade student essay images or PDFs, automatically recognize essay structure, generate inline comments and an overall evaluation, and output a professionally formatted PDF.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "zwpgskill" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-ee461fd25e154041df04331db6b57d805c520126567286c19bd00feab70582a9. Verify the upstream source and version against https://skillhub.cn/skills/user_8fb569a2/zwpgskill before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Batch-grade student essay images or PDFs, automatically recognize essay structure, generate inline comments and an overall evaluation, and output a professionally formatted PDF.

0 Downloads

Introduction source: third_party · user_8fb569a2 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Software, accounts and paid services
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: 问渠作文批改
description: 批量批改学生作文图片/PDF,自动识别篇章、生成旁批与总评,输出精美排版PDF
disable: false
allowed-tools: 

问渠作文批改 Skill

触发条件

用户说「批改作文」「帮我批改这些作文」「给这堆图片作文打分」「批改 XX 目录」等,立即加载本 skill。


角色定位

你(AI助理)是批改主体。 Python 脚本只负责 PDF 排版,不调用任何外部 AI 接口。整个流程由你驱动:读图 → 断篇 → 批改 → 调脚本排版输出。


输入形态识别

用户提供目录路径后,先判断形态:

形态 特征 处理方式
A. 目录散图 目录下全是图片(jpg/png/webp 等) 你视觉读图,AI断篇后逐篇批改
B. 目录多PDF 目录下多个 PDF,每个=一篇 每个PDF逐页转图,逐篇批改
C. 合并大PDF 单个PDF包含全班所有作文 逐页转图,AI断篇后逐篇批改

如果目录下混有图片和PDF,优先按B处理PDF,剩余图片按A处理。


完整工作流程(你必须严格遵循)

Step 0:环境准备

运行以下命令安装依赖(只需首次,幂等):

pip install pymupdf pillow reportlab

Step 1:收集素材

形态A(散图):

# 列出目录下所有图片,按文件名排序
Get-ChildItem "用户提供的目录" -Include *.jpg,*.jpeg,*.png,*.webp,*.bmp -Recurse | Sort-Object Name | Select-Object -ExpandProperty FullPath

形态B(多PDF目录):

# 列出所有PDF,按文件名排序
Get-ChildItem "用户提供的目录" -Filter *.pdf | Sort-Object Name | Select-Object -ExpandProperty FullPath

形态B/C(PDF转图): 用 scripts/pdf_to_images.py 把每个PDF的每页转为PNG,输出到临时目录 {原目录}/_pages/:

python "~/.workbuddy/skills/essay-grader/scripts/pdf_to_images.py" --pdf "路径" --out "{原目录}/_pages/"

如果是形态C(单个大PDF),同样调用此脚本,输出所有页到 _pages/ 目录。

Step 2:断篇(AI视觉)

仅形态A和形态C需要断篇;形态B每个PDF直接视为一篇。

你用 read_file 逐张读取图片,根据以下特征判断每张图片属于哪篇作文:

  • 作文纸格式统一,但每篇第一页通常有标题、姓名、日期、班级等信息
  • 如果没有明显标记,通过书写风格、笔迹、纸张边缘特征推断篇章切换点
  • 记录断篇结果:[[img1, img2], [img3, img4, img5], ...]

如果图片数量超过30张,先读前3张样本确认格式,再批量推断。

Step 3:询问评分要求

如果用户尚未提供评分标准,必须先询问:

「请告诉我评分要求,例如:

  • 内容立意(40分)
  • 语言表达(30分)
  • 结构层次(20分)
  • 书写规范(10分)

或者直接告诉我总分和关注重点即可。」

Step 4:逐篇AI批改

对每篇作文,你用 read_file 读取该篇所有图片,然后执行批改:

批改内容(你直接生成,无需调用外部API):

  1. 旁批:针对具体句子/段落的点评,要具体、有建设性、语气友善

    • 每条 20-40 字(约 1-4 行),内容要饱满,避免只写一个短句
    • 格式:{"page": 1, "position": "middle", "text": "...", "highlight": {"x_ratio":0.15,"y_ratio":0.22,"w_ratio":0.30,"h_ratio":0.07}}
    • highlight 字段(可选):在原图上标注被批注文字区域
      • x_ratio/y_ratio:文字区域左上角相对于图片的归一化坐标(0~1),AI 目测估算即可
      • w_ratio/h_ratio:文字区域宽高占图片的归一化比例
      • ⚠️ w_ratio 必须 ≤ 0.5:只标记被批注的具体词语/短句,不要整行高亮
      • 误差 ±0.05 均可接受,不需要像素级精确
    • position 取值:"top" / "upper-mid" / "middle" / "lower-mid" / "bottom"(无 highlight 时作为 fallback)
    • 每页 2-5 条旁批
  2. 总评:整体评价,120-200 字,三段式结构:亮点 → 不足 → 改进建议

  3. 分值:按照评分要求逐项打分,给出总分

输出 JSON(每篇一个对象):

{
  "title": "推断的作文题目或'第N篇'",
  "student": "学生姓名(如能识别)",
  "score": 87,
  "score_detail": "内容35/40,语言25/30,结构18/20,书写9/10",
  "summary": "本文选取了...(亮点),但...(不足),建议...(改进方向)。整体而言,这是一篇...水平的作文。",
  "annotations": [
    {
      "page": 1,
      "position": "top",
      "text": "开篇简洁有力,直入主题——'雨声淅沥'四字迅速渲染氛围,引人入胜。",
      "highlight": {"x_ratio": 0.10, "y_ratio": 0.02, "w_ratio": 0.20, "h_ratio": 0.06}
    },
    {
      "page": 1,
      "position": "middle",
      "text": "环境描写细腻,'淅淅沥沥'用词准确,烘托事件氛围,为后文情感抒发做铺垫。",
      "highlight": {"x_ratio": 0.15, "y_ratio": 0.15, "w_ratio": 0.25, "h_ratio": 0.06}
    },
    {
      "page": 2,
      "position": "upper-mid",
      "text": "细节描写生动——'雨水顺着发梢滴落',比喻贴切,画面感强,情感真挚。"
    }
  ]
}

将所有篇的 JSON 写入临时文件 {原目录}/_grades.json。

Step 5:生成排版PDF

调用排版脚本:

python "~/.workbuddy/skills/essay-grader/scripts/layout_pdf.py" `
  --dir "用户目录" `
  --grades "{原目录}/_grades.json" `
  --output "用户目录/批改结果_YYYYMMDD.pdf"

脚本会按以下版式生成PDF:

  • 左侧62%:作文图片原图
  • 右侧38%:旁批栏(米黄色背景,红笔风格批注)
  • 末页底部:总评区域(淡蓝色背景)
  • 首页右上角:分值红色徽章

Step 6:交付结果

用 deliver_attachments 工具将生成的 PDF 发给用户,并简要说明:

  • 共批改了几篇作文
  • 分数区间
  • 输出文件路径

错误处理

情况 处理方式
图片无法读取/损坏 跳过该图片,在结果PDF中注明"此页读取失败"
字迹模糊无法识别内容 批改时注明"字迹清晰度有限,批注仅供参考"
PDF转图失败 提示用户检查pymupdf是否正确安装
断篇不确定 列出候选方案请用户确认,再继续

重要约束

  • 你是批改主体,不要生成调用 OpenAI/Claude 等外部 AI 的代码
  • 批改结果必须具体、有针对性,避免泛泛而谈
  • 旁批文字保持简洁(15字以内),总评100-200字
  • 如果作文超过10篇,每批改完3篇向用户报告进度
  • 输出PDF文件名包含日期,避免覆盖历史结果

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 解决教师批量批改作文的高频刚需痛点
  • 支持多种输入形态(散图/多PDF/合并PDF)
  • 端到端自动化流程,显著提升工作效率
Trigger Precision85/100

Areas to improve

  • 触发词描述位置 Reported severity: Minor

    触发条件写在skill_body内部而非顶层frontmatter

    Recommendation: 建议将触发条件移至frontmatter中以提高可读性

Highlights

  • 触发词覆盖全面,包含多种常见表达方式
  • 边界清晰,不易与其他Skill混淆
Structure and Standards75/100

Areas to improve

  • 文档过长 Reported severity: Minor

    SKILL.md文档约600行,超出建议的500行限制

    Recommendation: 可考虑将部分详细说明移至独立文档或附录

  • 缺少When to Use章节 Reported severity: Minor

    未明确说明适用场景和使用时机

    Recommendation: 建议添加When to Use章节说明最佳使用场景

Highlights

  • 工作流程步骤清晰,Phase划分合理
  • 包含完整的端到端示例和错误处理方案
  • frontmatter结构完整
Execution Reliability90/100

Highlights

  • 依赖库明确且常用(pymupdf/pillow/reportlab)
  • 覆盖主要异常场景并提供具体处理方案
  • 不可逆操作有用户确认机制
  • 参数定义清晰,脚本调用方式规范
Evidence Verifiability (mean of the first four)86/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 43

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Translation pending; see source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.