Agent skill

Write PR

by MoonshotAI in MoonshotAI/kimi-code

在 kimi-code 仓库里创建或更新 PR 时使用:如何把 PR 模板的每一节写得简洁、便于 reviewer 理解,包括"行为变化与受影响人群"表。

MITAuto-check passedDevelopment

Install Write PR

skills CLI
$ npx skills add MoonshotAI/kimi-code --skill write-pr -a claude-code

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

GitHub CLI
$ gh skill install MoonshotAI/kimi-code write-pr --agent claude-code

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

Manual copy
$ git clone --depth 1 https://github.com/MoonshotAI/kimi-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/write-pr .claude/skills/write-pr && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

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

Facts

Skill name
write-pr
GitHub stars
7.8k
Token cost
~909 tokens
SKILL.md length
216 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

在 kimi-code 仓库里创建或更新 PR 时使用:如何把 PR 模板的每一节写得简洁、便于 reviewer 理解,包括"行为变化与受影响人群"表。

  • Works in 5 steps: 读 PR 模板 → 找到或创建 PR → 收集解释改动所需的上下文 → …
  • Development work in your project
  • SKILL.md covers 工作流, 行为变化与受影响人群 and 代码变更的可视化大纲
  • Calls gh and git

What it does

Write PR is an agent skill from MoonshotAI/kimi-code. 在 kimi-code 仓库里创建或更新 PR 时使用:如何把 PR 模板的每一节写得简洁、便于 reviewer 理解,包括"行为变化与受影响人群"表。

Its SKILL.md is about 910 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with Kimi and Git. The repository describes itself as: Kimi Code CLI — The Starting Point for Next-Gen Agents. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “行为变化与受影响人群”
  • “/write-pr”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 读 PR 模板
  2. 找到或创建 PR
  3. 收集解释改动所需的上下文
  4. 按模板各节写描述。描述用用户当前使用的语言,行为变化表也一样;只有三样固定:PR 标题保持英文 Conventional Commit,changeset 保持英文(见 gen-changesets skill),节标题沿用模板原文。
  5. 发布描述

What it can do on your machine

Read from SKILL.md and the folder at commit 0f052fe. 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:

    • gh
    • git

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

  • Network

    No URLs in SKILL.md. Its commands use gh and git, which can reach the network depending on how they are called.

    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

Write PR loads about 909 tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 216 words of instructions outside code blocks.

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

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 MoonshotAI/kimi-code at commit 0f052fe, republished under its MIT licence (© MoonshotAI). 216 words, ~909 tokens.

Download SKILL.mdSave it as .claude/skills/write-pr/SKILL.md (or your agent's skills folder).
name
write-pr
description
在 kimi-code 仓库里创建或更新 PR 时使用:如何把 PR 模板的每一节写得简洁、便于 reviewer 理解,包括"行为变化与受影响人群"表。

写 PR 描述

为当前分支创建或更新 PR,描述要让 reviewer 明白这个改动为什么存在、实现长什么样、现有用户会失去什么。

工作流

  1. 读 PR 模板:

    Read(.github/pull_request_template.md)

  2. 找到或创建 PR:

    • 先查当前分支有没有 PR:gh pr view --json url,number,title,state 2>/dev/null。
    • 没有的话,看 git status --short --branch 和当前分支上的提交。
    • 提交剩余改动,带 upstream 推送分支,用 gh pr create 创建 PR。
    • 遵守仓库的 git 安全规范。
  3. 收集解释改动所需的上下文:

    • 读关联的 issue 和相关任务产物。
    • 读完整 diff(git diff main...HEAD)和足够的周边代码,理解行为与归属。
    • PR 已存在时,用 gh pr view 拿元数据和改动文件列表。
  4. 按模板各节写描述。描述用用户当前使用的语言,行为变化表也一样;只有三样固定:PR 标题保持英文 Conventional Commit,changeset 保持英文(见 gen-changesets skill),节标题沿用模板原文。

    • Requirement or Bug:一句话,或 Resolve #<number>。不要多写。
    • Bug Reproduction Steps:只有 bug 类 PR 需要;feature 写 N/A。步骤已在 issue 里的写 See linked issue。
    • Root Cause:只有 bug 类 PR 需要;feature 写 N/A。说明根因,以及这是根本修复还是绕过。
    • Code Changes:能用可视化大纲说清楚的就不要写散文,见"代码变更的可视化大纲"。
    • Behavior Changes and Affected Users:先填行为变化表,再列受影响模块与测试覆盖,见"行为变化与受影响人群"。
    • Checklist:勾上所有适用的项。
  5. 发布描述:

    • 先存到临时文件,再 gh pr edit <number> --body-file <path> 或 gh pr create --body-file <path>。
    • 确认更新成功。

行为变化与受影响人群

这一节回答一个问题:合入之后,现有用户会失去什么。这个仓库过去的回归大多来自没人回答这个问题,而不是逻辑错误。

判据:改动前能工作的任何输入(配置键、环境变量、命令行参数、provider 响应形态、旧版本写的会话数据、客户端请求、hook 载荷)改动后必须行为不变,除非这里明确声明了变化并给出退路。

写法:

  1. 列出 diff 改变的每一个可观测行为,一行一个。包括你认为"不变"但分支条件挪动了的:新增的条件会不会先于旧条件命中既有输入;删除或收窄的分支改动前谁在走。内部包会打进 CLI 发布包,"内部"不等于用户无感。表格用 PR 描述的语言,下面的示例用英文只是示意形状:

    BehaviorBeforeAfterWho relies on the old behaviorEscape hatch
    reasoning parsing when reasoning_details is an arraystring reasoning also readstring ignoredOpenAI-compatible gateways that send both (OpenRouter dialect)none
  2. 人群要具名,不要写"部分用户"。从 .agents/skills/review-pr/surfaces.md 里取:客户端(TUI、print 模式、desktop 与 web、VS Code、ACP、SDK)、provider 方言、平台、配置状态、数据年代、外部脚本。

  3. 改了 prompt 文本(system prompt、工具描述、提醒)的,每一句单独成行,写清这句改动前约束了什么行为、谁依赖、现在由什么来约束。"没有测试引用这句"不是无影响的证据。

  4. 替换或绕过旧路径的(移植、runtime binding、协议替换),额外列出旧路径的功能清单:它认哪些环境变量、有哪些兜底、接受哪些输入,以及每一项在新路径里的位置。

  5. 确实没有可观测变化的,写 None,并说明证据:哪些分支、默认值、契约文件没动。

  6. 表后面列受影响模块与每一行对应的测试覆盖。默认翻转或删除行为的,必须有一条测试把未被改动的人群的旧行为钉住,并且 changeset 要写明用户失去了什么,见 gen-changesets skill;没有退路的,在 PR 里请维护者显式拍板。

代码变更的可视化大纲

优先用结构化视图,少用散文。用能说清实现的最小组合,没变的类别不要列。

逻辑或算法变化用伪代码 diff:

diff
 on(save)
-  write content
+  if content is unchanged
+    return cached result
+  write new content
+  invalidate cache

运行时控制流用调用树 diff:

diff
 submitForm
   createSession
     persistPrompt
+    expandSkillMention
     launchAgent
-  navigateToSession
+  navigateToSession
+    subscribeToEvents

文件职责变化用浅层文件树 diff:

diff
 src/
 ├── commands/
+│   └── show-me.ts       # expands the slash command
 ├── sessions/
-└── transport.ts
+└── transport/
+    ├── client.ts
+    └── stream.ts

组件或 UI 结构变化用树 diff:

diff
 <SessionPage>
   useSessionEvents()
   <SessionToolbar>
+    <RunSkillButton />
   <SessionTimeline>
+    <SkillResultCard />

组件交互、控制流或数据流用 Mermaid,解释 bug 机制时尤其有用:

mermaid
sequenceDiagram
    participant User
    participant UI
    participant Daemon
    User->>UI: choose command
    UI->>Daemon: send expanded prompt
    Daemon-->>UI: stream result

关键数据结构或类型变化用对应语言的代码块:

ts
interface SessionEvents {
  onTurnStart(cb: (turn: Turn) => void): void;
  onTurnEnd(cb: (turn: Turn) => void): void;
}

可视化大纲的规则:

  • 重点是"变了什么"且周边形状已存在时,用 diff 块。
  • 大部分是新内容,或 diff 记法会掩盖归属和顺序时,用对应语言或 text 块给出完整目标形状。
  • 按最容易理解的顺序讲:先文件还是先数据结构,哪个合适用哪个。
  • 像一个人对另一个人讲话:简单、连贯、简洁。

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

Files

Just SKILL.md in .agents/skills/write-pr of MoonshotAI/kimi-code.

Open the folder on GitHubat commit 0f052fe

Compare with similar skills

Write PR 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.

Write PR compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Write PR this skillMoonshotAI/kimi-code7.8k—~909Automated safety check: PassMIT
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT
Pulse Releasequnqin24/Pulse516—~1.3kAutomated safety check: PassApache-2.0
Polyphonyalinaqi/maggy707—~980Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Pulse Release

    qunqin24/Pulse

    Release a new Pulse version end to end — checks, bilingual CHANGELOG entry, VERSION, tag, the release workflow, syncing main, and the issue replies that go with it.

    516 GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Polyphony

    alinaqi/maggy

    Multi-agent orchestration with container-isolated workspaces — each agent session runs in its own Docker container with independent git branches

    707 GitHub stars~980 tokensUpdated 13 days ago
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Codebase Knowledge Graph Q&A

    Egonex-AI/Understand-Anything

    Answers questions about a codebase by searching a prebuilt knowledge graph of its files, functions, classes and dependencies, not by rereading every source file.

    86k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed

More from MoonshotAI/kimi-code

All 11 skills in this repo
  • Kimi Webbridge

    MoonshotAI/kimi-code

    Kimi Browser Extension(Kimi 浏览器扩展,原 Kimi WebBridge)lets AI control the user's real browser — navigate, click, type, read, screenshot, and interact with any website using the user's actual login…

    7.8k GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Gen Changesets

    MoonshotAI/kimi-code

    A skill your agent uses when generating changesets in the kimi-code repository — deciding whether to write one, which package to list, the bump level, the wording, and the confirmation workflow.

    7.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Gen Docs

    MoonshotAI/kimi-code

    Update Kimi Code CLI user documentation after meaningful code changes that affect product behavior or user experience.

    7.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Kimi Datasource

    MoonshotAI/kimi-code

    Universal data-source assistant for stocks (Wind, S&P, SEC EDGAR), macro (World Bank, IMF, FRED, NBS), Chinese government data and standards (GB/HB/DB/TT), corporate, academic, legal, WHO/FAO/OECD…

    7.8k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Pre Changelog

    MoonshotAI/kimi-code

    Use before merging a kimi-code release PR to preview the user-facing CLI changelog in Chinese.

    7.8k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Review PR

    MoonshotAI/kimi-code

    在 kimi-code 仓库里 review 一个 PR 时使用:按 PR 模板逐节核对描述与 diff,并单独做一轮"回归与用户影响"评审,给出影响等级与评审摘要,评审摘要用用户当前使用的语言。

    7.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Write PR

What does Write PR do?

在 kimi-code 仓库里创建或更新 PR 时使用:如何把 PR 模板的每一节写得简洁、便于 reviewer 理解,包括"行为变化与受影响人群"表。. Write PR is an agent skill from MoonshotAI/kimi-code.

When should I use Write PR?

Write PR fits situations like: development work in your project.

How do I install Write PR in Claude Code?

Run `npx skills add MoonshotAI/kimi-code --skill write-pr -a claude-code`. Or copy the skill folder (.agents/skills/write-pr in MoonshotAI/kimi-code) into .claude/skills/write-pr in your project. Claude Code loads it when a task matches its description.

How do I install Write PR in Codex?

Run `npx skills add MoonshotAI/kimi-code --skill write-pr -a codex`. Or copy the skill folder (.agents/skills/write-pr in MoonshotAI/kimi-code) into .agents/skills/write-pr in your project. Codex loads it when a task matches its description.

Can I use Write PR 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 MoonshotAI/kimi-code --skill write-pr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-pr, .gemini/skills/write-pr, .github/skills/write-pr and .opencode/skills/write-pr in your project.

What does Write PR need to run?

Going by SKILL.md and its folder, Write PR needs the command-line tools its instructions call (gh and git).

Does Write PR access the network?

SKILL.md contains no URLs. Its commands use gh and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Write PR 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 Write PR use?

Write PR is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Write PR use?

About 909 tokens (SKILL.md is roughly 3.6k 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 Write PR?

Skills that share tags, products or a category with Write PR: Ccmanager Config (kbwo/ccmanager, 1.3k stars), Pulse Release (qunqin24/Pulse, 516 stars), Polyphony (alinaqi/maggy, 707 stars) and Finishing a Development Branch (obra/superpowers, 296k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Write PR?

MoonshotAI (a GitHub organization) maintains it in MoonshotAI/kimi-code, which has 7,796 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 8, 2026.

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