跳到正文
cccskills
免费在 GitHub 公开

Summarize testdata changes

Use this skill to write a complete report of changes in Carbon toolchain testdata. It shows how to identify diffs, extract input and output changes, group related edits, list affected files, and validate that every change is represented.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Instructions for summarizing changes to Carbon testdata files (`toolchain/*/testdata`).

carbon-language/carbon-lang星标 33,929(GitHub 33,929 + cccskills 0)
集成工具GitHub

实测评分 未实测

查看安装方法

适用场景

  • Summarizing testdata changes in a code review
  • Grouping related test input and output edits
  • Listing every affected testdata file
  • Checking that a change report covers the full diff

包含的文件(2)

  • SKILL.md7.2 KB
  • scripts/parse_diff.py2.3 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Summarize testdata changes

<!-- Part of the Carbon Language project, under the Apache License v2.0 with LLVM Exceptions. See /LICENSE for license information. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -->

This skill provides instructions for creating a comprehensive report summarizing changes to Carbon testdata files (toolchain/*/testdata) and associating them with related code changes.

This skill is about reporting a diff. For deciding whether the diff is correct in the first place, see the Review testdata changes skill.

Goals

Produce a report that:

  1. Summarizes code changes outside of testdata.
  2. Groups similar testdata changes together, listing all affected files for each group. Every change to testdata must be represented by at least one group. This includes changes to CHECK lines.
  3. Provides detailed breakdowns of test input changes and diagnostic output changes in the corresponding group. Every single change to inputs or to STDERR checks must be explicitly mentioned in the group, with either an inline diff or a link to the file.

Process

1. Identify Changes

Use your VCS (Git or Jujutsu) or query Github to identify changes. For large changes, it is recommended to use the included helper script to extract test input changes.

For Git Users:

  • Summarize code changes: git diff --stat -- ':!toolchain/*/testdata/*'
    • To see content of non-testdata changes: git diff -- ':!toolchain/*/testdata/*'
  • Identify testdata changes: git diff --name-only 'toolchain/*/testdata/*'

For Jujutsu (jj) Users:

  • Summarize code changes: jj --no-pager diff --stat '~toolchain/*/testdata'
    • Note: Quoting the fileset '~toolchain/*/testdata' is critical if it contains wildcards.
    • To see content of non-testdata changes, use --git to get standard unified diff format: jj --no-pager diff --git '~toolchain/*/testdata'
  • Identify testdata changes: jj --no-pager diff --name-only 'toolchain/*/testdata'

For Github Pull Requests:

  • Summarize code changes: gh pr diff
  • Identify testdata changes: gh pr diff --name-only | grep '^toolchain/.*/testdata'

Handling Specific Revisions:

If you are summarizing changes in a specific revision (for example, @-) or pull request (for example, #1234), add -r <rev> or <pr_number> to the commands:

  • git diff <rev>^ <rev> ... (or use git show <rev>)
  • jj --no-pager diff -r <rev> ...
  • gh pr diff <pr_number>

2. Extract Test Input Changes (Recommended)

To easily identify changes, use the included Python helper script to extract all text additions and removals from the diff, categorized by Input, STDERR, and STDOUT changes. This script reads a unified diff from stdin.

# For Git:
git diff -- 'toolchain/*/testdata/*' | python3 .agents/skills/summarize_testdata_changes/scripts/parse_diff.py

# For Jujutsu (jj):
jj diff --git 'toolchain/*/testdata' | python3 .agents/skills/summarize_testdata_changes/scripts/parse_diff.py

# For a specific revision with jj:
jj diff -r @- --git 'toolchain/*/testdata' | python3 .agents/skills/summarize_testdata_changes/scripts/parse_diff.py

# For a specific PR with Github:
gh pr diff 1234 | python3 .agents/skills/summarize_testdata_changes/scripts/parse_diff.py

3. Identify Patterns and Produce a List of Groups

  • Read the diff and produce a list of groups of changes that share a common theme or cause (for example, "Updated expected output for integer literals", "Added tests for new keyword").
  • CRITICAL: Every single change in the testdata diff must be represented by at least one group. Do not ignore changes to CHECK lines.
    • If it's not clear what group a change belongs to, create a new group for it.
  • For each group:
    • Provide a brief description of the group.
    • (Optional) Briefly note if the group appears to be an intended or unintended consequence of the code changes.
  • Divide the groups into sections:
    • Test Changes: Changes to test inputs (lines not prefixed with // CHECK), along with diagnostic output changes where relevant
    • Diagnostic Changes: Changes to diagnostic output (lines prefixed with // CHECK:STDERR) with no corresponding changes to test inputs
    • [Output Type] Changes: Changes to STDOUT (lines prefixed with // CHECK:STDOUT)
      • Create one section for each relevant kind of test. For example, parser tests should typically be in a "Parse Tree Changes" section, check tests should typically be in a "SemIR Changes" section, and lower tests should typically be in an "LLVM IR Changes" section.

4. Improve Grouping

  • Read the list of groups and check to see if any of them should be combined or split apart. If needed, do so.

5. Assign Changes to Groups

  • Read the diff again, and then for each change in the diff:
    • Add the change to the appropriate group (or, rarely, groups).
    • CRITICAL: Every single change in the testdata diff must be represented by at least one group. Do not ignore changes to CHECK lines.
    • If the change affects test inputs (lines not prefixed with // CHECK) or diagnostic output (lines prefixed with // CHECK:STDERR):
      • List the file within the group. Don't just give one or a few examples. Include every file.
      • Provide an inline diff if the change is small.
      • Provide a link to the file if the change is large.
    • Otherwise, if the change only affects STDOUT (lines prefixed with // CHECK:STDOUT):
      • Ensure the group contains a representative example that matches the current change.
      • The representative example should be an inline diff of the change.
    • CRITICAL: Every single change to test inputs and diagnostic outputs in the files being summarized must be explicitly listed in at least one group. Do not skip changes, even if they are similar to changes you've already seen, and do not just give examples.

6. Validation

As a final validation step:

  • Read through the testdata diff again.
  • Ensure that every change in the diff is reflected by at least one group in the report.

Report Template

Use the following template for the generated report:

# `testdata` Change Summary

## Code Changes

[One paragraph summarizing changes outside of testdata.]

## Test Changes

### [Group Name]

[Description of the group.]

[Change 1: diff context OR link]

[Change 2: diff context OR link]

...

## Diagnostic Changes

### [Group Name]

[Description of the group.]

[Change 1: diff context OR link]

[Change 2: diff context OR link]

...

## [Output Type] Changes

### [File Path]

[Description of the group.]

[Example diff context]

Changes of this kind were found in [Number] files. Examples: [List of files]

...

Skip sections that would be empty.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

本技能介绍如何使用命令行`gh`只读查看GitHub issue正文和评论,支持通过编号或URL定位,也可指定其他仓库,并说明如何提取大量评论。

  • 查看issue正文和评论
  • 通过URL读取issue
  • 查看其他仓库的issue
carbon-language/carbon-lang3.4万2026年10月26日 更新

Agent tools

免费有简介

本技能为在 Carbon 代码库中工作的 AI 助手规定文件查看、搜索和编辑工具,并说明临时文件的存放与清理规则,以及何时可以编写和运行自定义程序。

  • 按规定工具搜索Carbon文件
  • 为文件编辑选择专用工具
  • 确认临时文件的存放与清理规则
carbon-language/carbon-lang3.4万2026年10月26日 更新

Bazel usage

免费有简介

了解如何在 Carbon 项目中通过 Bazelisk 构建、测试和运行程序,包括指定目标、启用 ASan,以及系统依赖变更后重建缓存。

  • 构建 Carbon 代码
  • 运行与修改相关的测试
  • 启动 Bazel 构建的程序
carbon-language/carbon-lang3.4万2026年10月26日 更新

Builtin functions

免费有简介

本技能介绍如何为Carbon编译器添加内置函数,包括类型注册、签名验证、常量求值、运行时LLVM IR生成、Prelude绑定,以及使用最小Prelude编写针对性测试。

  • 注册内置函数
  • 实现常量求值
  • 添加LLVM IR生成
carbon-language/carbon-lang3.4万2026年10月26日 更新

Code style

免费有简介

了解 Carbon 工具链对 Bazel、C++、Carbon、Markdown 和 Python 文件的格式规范,并查看注释、文档、命名、设计及提交说明的写作要求。

  • 整理 Carbon 代码格式
  • 检查注释和文档
  • 确认名称是否符合实际含义
carbon-language/carbon-lang3.4万2026年10月26日 更新

Diagnostics

免费有简介

本技能介绍如何在Carbon工具链中添加或修改错误和警告,包括注册诊断类型、用带类型的参数构造消息、为源码位置添加标签和上下文,以及检查措辞规范和测试覆盖。

  • 添加诊断消息
  • 为源码位置添加标签
  • 统一诊断措辞
carbon-language/carbon-lang3.4万2026年10月26日 更新

查看 carbon-language 的全部技能

报告此技能的问题