Agent skill

Autopku

by WindGraham in WindGraham/AutoPku

“AutoPku - 自动获取PKU课程通知、完成作业、撰写笔记”

— description from SKILL.md by WindGraham
MITAuto-check passedDocuments & Office

Install Autopku

skills CLI
$ npx skills add WindGraham/AutoPku --skill autopku -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install WindGraham/AutoPku autopku --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
autopku
GitHub stars
151
Token cost
~1.8k tokens
SKILL.md length
311 words
Files
27
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

  • Works in 7 steps: 环境检测 → 任务路由 → Agent 创建 → …
  • SKILL.md covers 配置说明, 使用方式, 执行架构 and 核心依赖: pku3b, plus 7 more sections
  • Calls curl; reaches github.com

About this skill

Autopku is a skill in WindGraham/AutoPku (151 stars). Its SKILL.md is about 1.8k tokens, with 26 other files in the folder. Licence: MIT.

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. 环境检测
  2. 任务路由
  3. Agent 创建
  4. 课程筛选遗漏
  5. 附件下载问题
  6. 数据格式问题
  7. 用户确认(重要)

What it can do on your machine

Read from SKILL.md and the folder at commit 8ecdff7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Autopku loads about 1.8k tokens when it runs. Until then it costs about 10 tokens; SKILL.md has 311 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~10
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from WindGraham/AutoPku at commit 8ecdff7, republished under its MIT licence (© WindGraham). 311 words, ~1,769 tokens.

Download SKILL.mdSave it as .claude/skills/autopku/SKILL.md (or your agent's skills folder). This skill also uses 26 other files; get the full folder from GitHub.
name
autopku
description
AutoPku - 自动获取PKU课程通知、完成作业、撰写笔记

AutoPku

自动处理北京大学课程相关任务:同步通知、完成作业、撰写笔记。

配置说明

本地配置(推荐)

文件位置: .claude/settings.local.json(项目根目录)

json
{
  "permissions": {
    "allow": ["Skill(update-config)", "Bash(*)"],
    "deny": ["Bash(rm:*)", "Bash(rm -rf:*)"],
    "defaultMode": "bypassPermissions"
  },
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1",
    "USER_TYPE": "ant"
  }
}

本地配置仅在本项目目录生效,不会影响其他目录的 Claude Code 行为。

Kimi Code CLI 用户: 建议设置环境变量 KIMI_CODE_CLI=1 以启用 Kimi Agent Team 支持(或通过 which kimi 自动检测)。

全局配置(可选)

文件位置: ~/.claude/settings.json

内容同上。全局配置会在所有目录生效,每次打开 Claude Code 都会显示 bypass 模式警告。除非你只在本机使用 AutoPku,否则不推荐。

配置项说明
配置项说明
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS启用 Agent Team 并行处理功能
USER_TYPE用户类型标识(ant 为开发测试账号)
permissions.allow允许使用的工具
permissions.deny禁止使用的工具(安全保护)
defaultMode默认权限模式

使用方式

直接告诉我要做什么:

在 AutoPku 桌面端中,这个 skill 应被视为已预加载。用户只输入“同步通知”“看看有什么作业”“课程/选课/DDL”等短请求时,不要先凭记忆或旧摘要回答;第一步必须先运行只读 pku3b 命令获取当前教学网数据。如果本轮当前终端里没有实际调用这些 pku3b 命令,就不能声称完成同步,必须先调用或报告具体失败命令和原因。

用户意图示例执行的任务
"同步课程通知" / "看看有什么作业"同步所有课程通知和作业
"完成量子力学的第五次作业"完成指定课程作业(解析→解答→渲染→询问→提交)
"给逻辑导论写笔记"从课件提取数学核心内容撰写笔记
"写马原课程论文" / "生成论文"生成课程论文(大纲→正文→渲染→询问)
"给XX课做个汇报PPT" / "生成幻灯片"基于课件/笔记/论文生成汇报幻灯片(Typst PDF)

执行架构

1. 环境检测

执行时自动检测运行环境:

python
import os
import shutil

if os.environ.get("CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS"):
    RUNTIME = "claude"      # 使用 Agent() tool + SendMessage()
elif os.environ.get("CODEX") == "1":
    RUNTIME = "codex"       # 使用 native subagents
elif os.environ.get("KIMI_CODE_CLI") == "1" or os.environ.get("KIMI") == "1" or shutil.which("kimi"):
    RUNTIME = "kimi"        # 使用 Kimi Agent() + TaskList/TaskOutput
else:
    RUNTIME = "serial"      # 串行执行
2. 任务路由

根据用户意图,引用对应的 task skill:

用户: "同步课程通知"
  ↓
引用: sub-skills/tasks/sync-notices.md
  ↓
执行同步流程

用户: "完成作业"
  ↓
引用: sub-skills/tasks/do-homework.md
  ↓
执行作业流程(含用户确认)

用户: "写笔记"
  ↓
引用: sub-skills/tasks/write-notes.md
  ↓
执行笔记撰写流程

用户: "写论文" / "生成课程论文"
  ↓
  引用: sub-skills/tasks/write-paper.md
  ↓
执行论文生成流程(大纲→正文→渲染→询问)

用户: "制作幻灯片" / "生成汇报PPT"
  ↓
  引用: sub-skills/tasks/make-slides.md
  ↓
执行幻灯片生成流程(提取→大纲→生成→渲染→询问)
3. Agent 创建

主 skill 根据 RUNTIME 创建 agents:

python
# Claude Code 环境
for config in agent_configs:
    Agent({
        "name": config["name"],
        "prompt": config["task"],
        "description": config.get("description", "")
    })

# Kimi Code CLI 环境
for config in agent_configs:
    Agent({
        "description": config.get("description", ""),
        "prompt": config["task"],
        "subagent_type": config.get("subagent_type", "coder")
    })

# Codex 环境
# 使用自然语言描述并行 subagent 任务

# 其他环境
# 串行执行

核心依赖: pku3b

安装
bash
# 检查是否已安装,并固定本轮实际路径
PKU3B="$(command -v pku3b || true)"
test -n "$PKU3B" || echo "NOT_FOUND"

# 未安装时执行(macOS Apple Silicon 示例)
mkdir -p "$HOME/.local/bin"
cd /tmp
curl -LO "https://github.com/sshwy/pku3b/releases/download/0.11.0/pku3b-0.11.0-aarch64-apple-darwin.tar.gz"
tar -xzf pku3b-0.11.0-aarch64-apple-darwin.tar.gz
chmod +x pku3b-0.11.0-aarch64-apple-darwin/pku3b
install -m 755 pku3b-0.11.0-aarch64-apple-darwin/pku3b "$HOME/.local/bin/pku3b"
pku3b --version

重要:

  • 正确仓库: sshwy/pku3b (原 yang-er/pku3b 已失效)
  • 推荐版本: v0.11.0+ (支持公告 ann 和课表 ct 功能)
登录

pku3b init 只在初始化执行一次。后续所有命令自动读取 cfg.toml 中的凭证。

步骤:

bash
# 1. 检查是否已登录
pku3b a ls 2>&1 || echo "NOT_LOGGED_IN"

如果已登录(正常返回作业列表),跳过步骤 2-3,直接进入任务。

如果返回 NOT_LOGGED_IN(凭证不存在或密码错误),执行步骤 2:

bash
# 2. 在当前 Kimi Code 终端里交互式登录
pku3b init
bash
# 3. 验证登录成功
pku3b a ls

踩坑: 直接管道输入会报错 "input device is not a TTY"。在 AutoPku 里不要生成 expect 脚本或明文密码文件,直接让用户在当前嵌入式 Kimi Code 终端回答 pku3b init 的交互提示。

常用命令
bash
# 作业
pku3b a ls --all-term                   # 所有学期作业(带ANSI颜色码)
pku3b a download <ID> -d <dir>          # 下载附件
pku3b a submit <ID> <file>              # 提交作业

# 公告 (v0.11.0+)
pku3b ann ls                            # 列出公告
pku3b ann show <ID>                     # 查看公告详情

# 课表 (v0.11.0+)
pku3b ct -r                             # 获取课表 JSON

# 选课
pku3b s -d major show                   # 主修课程(可能返回302,作为可选)

Task Skills 索引

Task文件说明
同步通知tasks/sync-notices.md获取作业/公告,生成摘要,并行处理课程
完成作业tasks/do-homework.md解析PDF→解答→渲染→询问用户→提交
撰写笔记tasks/write-notes.md从课件提取数学核心,去除噪声
撰写论文tasks/write-paper.md从大纲到正文到编译,支持LaTeX/Word双模式
生成幻灯片tasks/make-slides.md基于pkusli模板生成Typst汇报幻灯片

Tool Skills 索引

Tool文件说明
pku3b配置tools/pku3b-setup.md安装、登录、命令参考
数据解析tools/data-parser.mdANSI颜色码处理、正则提取
PDF读取tools/pdf-reader.mdPyMuPDF/pdfplumber 代码示例
图片处理tools/image-handler.md论文配图搜索、绘制与LaTeX插入
Agent模板tools/agent-helpers.mdCoordinator/Parser/Solver/Writer/Submitter Prompts
幻灯片渲染tools/slide-renderer.mdpkusli模板获取、main.typ组装、typst编译

Runtime Skills 索引

Runtime文件说明
环境检测runtime/_detect.md自动检测 Claude/Codex/Kimi/Fallback
Agent 创建runtime/create-agent.md统一的跨平台 Agent 创建接口
Claude Teamruntime/claude-team.mdClaude Code Agent Team 语法
Codex Subagentruntime/codex-subagent.mdCodex native subagent 语法
Kimi Teamruntime/kimi-team.mdKimi Code CLI Agent Team 语法

关键踩坑记录

1. 课程筛选遗漏

问题: 选课系统显示"未选上"但作业系统有记录(如"学术英语写作")。

解决: 从作业系统提取所有课程,对比选课系统,标注不一致状态。

2. 附件下载问题
情况说明示例
无附件提交类作业无下载内容操作系统(实验班)
教学网无作业使用Canvas/微信群哲学导论、逻辑导论
体育课通常无在线作业太极拳

检查: grep "课程名" /tmp/pku_assignments_raw.txt | grep "附件"

3. 数据格式问题
  • 无 --json 参数: pku3b 输出纯文本带ANSI颜色码,需正则解析
  • pku3b a ls -a 不完整: 只显示有作业的课程,需用 pku3b s show 补全
  • --all-term 返回所有历史学期: 需筛选当前学期
4. 用户确认(重要)

完成作业前必须:

  1. 列出所有待交作业
  2. 使用 AskUserQuestion 让用户选择
  3. 二次确认后才创建 Agent Team
  4. 渲染完成后询问是否提交

禁止: 自动选择最新作业、未经确认直接提交

输出规范

同步通知输出
test/
├── 通知摘要汇总.md
├── {course1}/
│   ├── 作业/           # 下载的附件
│   ├── 通知/           # 公告详情
│   ├── 资料/           # 课程资料
│   └── 通知摘要.md     # 该课程摘要
└── {course2}/
    └── ...
完成作业输出
{course}/
├── 作业/
│   ├── Homework202605.pdf          # 原题
│   ├── homework_parsed.json        # 解析结果
│   ├── answers.json                # 解答数据
│   ├── Homework202605_answer.md    # Markdown答案
│   └── Homework202605_answer.pdf   # PDF答案
└── 提交/                           # 最终提交文件
    └── Homework202605_answer.pdf
生成幻灯片输出
{course}/
└── slides/
    ├── main.typ              # Typst 源文件
    ├── slides.pdf            # 最终 PDF
    ├── outline.md            # 幻灯片大纲
    └── figures/              # 图片目录
        └── ...

安全规则

  • 从不回显密码到日志
  • 不自动提交作业(必须用户确认)
  • 不自动选择作业(必须用户选择)
  • 安全处理课程名中的特殊字符

参考

© WindGraham, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 26 other files in the repository root of WindGraham/AutoPku.

  • SKILL.md
  • .gitignore
  • CHANGELOG.md
  • LICENSE
  • README.md
  • images/ccui.png
  • images/getthehomwwork.png
  • images/icon.png
  • images/pipeline.png
  • images/signin.png
  • sub-skills/runtime/_detect.md
  • sub-skills/runtime/claude-team.md
  • sub-skills/runtime/codex-subagent.md
  • sub-skills/runtime/create-agent.md
  • sub-skills/runtime/kimi-team.md
  • sub-skills/tasks/do-homework.md
  • sub-skills/tasks/make-slides.md
  • … and 10 more

Open the folder on GitHubat commit 8ecdff7

Compare with similar skills

Autopku next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Autopku compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Autopku this skillWindGraham/AutoPku151—~1.8kAutomated safety check: PassMIT
Gongwenmizzlelover/gongwen-gbt9704-skill763—~1kAutomated safety check: PassMIT
Paper ReviewRapidAI/MaClaw147—~1kAutomated safety check: PassMIT
Open Kimi Pptjinwyp/open-ppt-skill1592 repos~5.1kAutomated safety check: PassMIT
Kimi PDFthvroyal/kimi-skills238—~1.9kAutomated safety check: PassNone
Kimi DOCXthvroyal/kimi-skills238—~8kAutomated safety check: PassNone

Similar skills

  • Gongwen

    mizzlelover/gongwen-gbt9704-skill

    把中文正式材料整理成可直接交付的公文 DOCX:按 GB/T 9704-2012 处理版心、字体、标题层级、文号、页码、附件与版记;普通稿不误用红头,正式发文支持预印红头纸套打或完整电子红头,并保留 Word/WPS 可更新目录。

    763 GitHub stars~1k tokensUpdated 26 days ago
    Documents & OfficeAuto-check passed
  • Paper Review

    RapidAI/MaClaw

    论文深度解读 Skill — 下载论文PDF → LLM深度解读(问题/创新点/方法原理/实验分析)→ PDF图片提取 → 生成组会PPT → 生成解读音频MP3。端到端学术论文解读工具。

    147 GitHub stars~1k tokensUpdated today
    Documents & OfficeAuto-check passed
  • Open Kimi Ppt

    jinwyp/open-ppt-skill

    Create, edit, replicate, read, and export presentations. An agent skill from jinwyp/open-ppt-skill.

    159 GitHub starsUsed in 2 repos~5.1k tokens
    Documents & OfficeAuto-check passed
  • Kimi PDF

    thvroyal/kimi-skills

    Professional PDF solution. An agent skill from thvroyal/kimi-skills.

    238 GitHub stars~1.9k tokensUpdated 6 mo ago
    Documents & OfficeAuto-check passed
  • Kimi DOCX

    thvroyal/kimi-skills

    Generate and edit Word documents (.docx). An agent skill from thvroyal/kimi-skills.

    238 GitHub stars~8k tokensUpdated 6 mo ago
    Documents & OfficeAuto-check passed
  • Kimi XLSX

    thvroyal/kimi-skills

    Specialized utility for advanced manipulation, analysis, and creation of spreadsheet files, including (but not limited to) XLSX, XLSM, CSV formats.

    238 GitHub stars~9.5k tokensUpdated 6 mo ago
    Documents & OfficeAuto-check passed

Works with

Questions about Autopku

How do I install Autopku in Claude Code?

Run `npx skills add WindGraham/AutoPku --skill autopku -a claude-code`. Or copy the skill folder (the WindGraham/AutoPku repository) into .claude/skills/autopku in your project. Claude Code loads it when a task matches its description.

How do I install Autopku in Codex?

Run `npx skills add WindGraham/AutoPku --skill autopku -a codex`. Or copy the skill folder (the WindGraham/AutoPku repository) into .agents/skills/autopku in your project. Codex loads it when a task matches its description.

Can I use Autopku in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add WindGraham/AutoPku --skill autopku -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/autopku, .gemini/skills/autopku, .github/skills/autopku and .opencode/skills/autopku in your project.

What does Autopku need to run?

Going by SKILL.md and its folder, Autopku needs the command-line tools its instructions call (curl).

Does Autopku access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Autopku safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Autopku use?

Autopku is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Autopku use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Autopku?

Skills that share tags, products or a category with Autopku: Gongwen (mizzlelover/gongwen-gbt9704-skill, 763 stars), Paper Review (RapidAI/MaClaw, 147 stars), Open Kimi Ppt (jinwyp/open-ppt-skill, 159 stars) and Kimi PDF (thvroyal/kimi-skills, 238 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Autopku?

WindGraham (a GitHub user) maintains it in WindGraham/AutoPku, which has 151 GitHub stars. The repository was last updated on August 1, 2026.

Source: WindGraham/AutoPku on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.