Communitygithub.com

reyalka/astro

编写和更新 Astro 拉取请求(PR),使用审阅者友好的标题和高质量正文。当用户要求创建 PR、打开 PR、起草 PR、更新 PR 标题/正文或撰写 PR 注释/摘要时触发。

astro 是什么?

该技能专为 Astro 项目设计,用于生成和更新拉取请求(PR),确保标题和正文对审阅者非常友好。其核心原则是清晰描述变更内容、工作原理及重要性,并将 PR 正文划分为“Changes”(变更)、“Testing”(测试)和“Docs”(文档)三个部分,避免将 PR 各节当作任务日志使用。PR 标题应使用自然语言、简洁具体,禁止使用传统提交前缀(如 `fix:`、`feat:`)。正文默认保持简短,典型补丁应在 30 秒内可读完。此外,该技能会检查是否遗漏 changeset 文件,并在必要时自动调用 `changeset` 技能创建,确保包修改 PR 合规。适用于任何需要创建、打开、起草 PR 或更新 PR 标题/正文的用户请求。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/reyalka/astro/tree/HEAD/.agents/skills/astro-pr-writer

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Astro PR 编写器

编写有助于审阅者快速理解意图、行为变更和验证的 Astro 拉取请求描述。

当用户提出任何与 PR 编写相关的任务时使用此技能,包括:

  • 创建/打开一个拉取请求
  • 创建/打开一个草稿拉取请求
  • 更新 PR 标题
  • 更新 PR 正文/描述
  • 撰写 PR 注释/摘要

核心原则

描述变更、工作原理以及为什么重要。

  • Changes 解释修复/功能的作用。
  • Testing 列出添加或修改了哪些测试代码。
  • Docs 说明是否需要面向用户的文档变更。

不要将 PR 各节用作任务日志。

PR 标题规则

使用人类可读、审阅者友好的标题。

  • 用平实的语言描述结果。
  • 保持简洁且具体。
  • 优先使用审阅者在队列中自然看到的措辞。

不要使用:

  • 传统提交前缀(fix:、feat:、docs: 等)
  • 带有作用域的提交风格标题(fix(cloudflare): ...)

正文规则

使用以下结构:

## Changes

- <行为变更及其重要性>
- <实现细节及影响>

## Testing

- <新增或修改的测试及其覆盖范围>
- <为什么现有断言发生了变更>

## Docs

- <无需文档更新,因为……>

Changes

关注行为、实现方法和影响。

包括:

  • 之前不能工作但现在可以工作的内容
  • 修复/功能的工作原理(对审阅者有帮助的级别)
  • 用户可见的可靠性/兼容性/性能行为变化

不要包括:

  • “已添加测试”或“已更新 fixture”(属于 Testing 部分)
  • “已添加 changeset”
  • 对行为无影响的内部过程说明

Testing

列出添加或修改的测试代码及其原因。审阅者阅读此部分是为了了解测试覆盖率的变更——而不是听你说运行了测试套件。

包括:

  • 新增的测试文件或测试用例,附上简短描述说明它们覆盖了什么
  • 更新了哪些现有测试,以及为什么断言发生了变化

不要包括:

  • 测试通过(CI 会显示这一点;这属于噪音)
  • 你运行了哪些命令
  • 通过了多少个测试

Docs

清晰地说明文档影响。

  • 如果不需要文档,请用一句话说明原因。
  • 如果需要文档,请链接文档 PR。

简洁性指导

默认简短。每个部分 1-2 个要点是正常的——只有当变更确实复杂时才增加更多。扫描 PR 队列的审阅者对于典型的补丁应该能在 30 秒内读完整个正文。

过于冗长:

  • 将 server 配置属性(位于 base.ts 和 relative.ts 中)的 .optional().prefault({}) 移出 z.preprocess(),与 #16531 中的 integrations 修复保持一致。Zod 4.4.0 会拒绝包裹在 z.preprocess() 内的缺失属性,因为预处理器或内部默认值无法执行——将 .optional().prefault({}) 移出 preprocess 调用即可解决此问题。修复了 @rururux 报告的 server 属性问题。
  • 为 Astro 和 DB 错误映射添加了 invalid_key、invalid_element 和区分联合 options 处理程序,以兼容 Zod 4.4.0。Zod 4.4.0 将记录键细化失败(例如 env 架构变量名)作为结构化的 invalid_key 问题(带有嵌套错误)而不是扁平消息返回。这些处理程序提取实际的细化消息,以提供清晰的用户可见错误。
  • 所有更改向后兼容 Zod 4.3.x。新的错误映射分支仅在 4.4.0 开始发出的问题代码上激活。

更好的写法:

  • 将 server 配置的 .optional().prefault({}) 移出 z.preprocess(),与 #16531 中的 integrations 修复保持一致。修复了 @rururux 在那报告的问题。
  • 为两个错误映射添加了 invalid_key、invalid_element 和区分联合 options 处理程序,以兼容 Zod 4.4.0。
  • 向后兼容 Zod 4.3.x。

Changesets

每个修改包的 PR 都需要一个 changeset。只有 examples/* 的更改例外。

加载 changeset 技能来创建 changeset 文件并编写消息。它涵盖了文件创建、格式、版本变更类型和消息约定。

在编写 PR 正文时:

  • 在发布前,检查是否存在 changeset。如果 PR 修改了一个包且没有 changeset,请立即使用 changeset 技能创建它——不要在缺少 changeset 的情况下发布 PR。
  • 不要在 Changes 部分提及“已添加 changeset”——这是过程噪音,而非行为变更。

发布前自检

  • 标题是审阅者友好的(不是提交风格)
  • Changes 要点描述了行为/实现/影响
  • Testing 列出了添加/修改的测试代码,而不是测试运行结果
  • Docs 决策明确
  • 对于任何修改包的 PR,.changeset/ 目录中存在 changeset 文件——如果缺失,请在发布前创建它

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

reyalka/astro

Analyze recent GitHub Actions workflow runs to identify patterns, mistakes, and improvements. Use when asked to "analyze workflow logs", "review action runs", or "analyze GitHub Actions".

reyalka/astro

Independently implement and validate an alternative solution for an Astro pull request. Use only for Factory's adversary blue team.

reyalka/astro

Qualify and compare red and blue solutions for an Astro pull request using Astro-specific merge and tie-break criteria. Use only for Factory's adversary purple team.

reyalka/astro

Perform a static, read-only code review of an Astro pull request or of a local branch, commit range, diff, patch, or working tree being prepared as a pull request. Determine whether the change satisfies its stated business requirements and is good enough to merge, using the PR description, linked requirement issues and roadmap items, and PR or issue discussions when available. Use this skill only for PR review or self-review, not issue triage or bug investigation. It reports only merge-relevant findings and never edits code or runs project code, tests, builds, checks, or scripts.

reyalka/astro

Comprehensive guide for developing in the Astro monorepo. Covers architecture, debugging, testing, and critical constraints. Use when working on features, fixes, tests, or understanding the codebase structure.

reyalka/astro

Handle main-to-next merge tasks including conflict resolution, changeset cleanup, and CI fix-ups. Use when merging main into next.

reyalka/astro

How to write JSDoc (/** */) and inline (//) comments in the Astro codebase, for contributors reading the source — not end users. Use whenever writing or editing comments in .ts/.js source, including comments added incidentally while fixing bugs or building features. Does not cover the @docs-generated config/error reference.

相关技能