Skip to main content

frb-categorize-code-diff

Use when classifying a flutter_rust_bridge branch or PR diff into test and non-test changes, including colocated Rust test modules.

来源信息

仓库
fzyzcjy/flutter_rust_bridge
最近来源活动
2026年8月23日 12:52
检测到的 SKILL.md 语言
英语
星标
5,453
分支
423

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
3 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
frb-categorize-code-diff
description
Use when classifying a flutter_rust_bridge branch or PR diff into test and non-test changes, including colocated Rust test modules.
# 1 When to use - Use this skill to answer which changes in a branch or PR are tests and which are not. - Use the repository script instead of classifying paths by hand. Rust tests are commonly colocated in production `.rs` files. ## 2 Run - Fetch the PR base before relying on `origin/master`. - Run from the repository root: ```bash uv run --no-project .claude/skills/frb-categorize-code-diff/categorize_code_diff.py --base origin/master --head HEAD ``` - Add `--json` when another tool will consume the result. - Pass the PR's actual base revision when it is not `origin/master`. ## 3 Interpret - `test-only`: every changed line is in a dedicated test path or a recognized colocated Rust test region. - `non-test-only`: every changed line is outside recognized test code. - `mixed`: the file contains both test and non-test changed lines. - `unclassified`: the diff cannot be mapped confidently, such as a binary patch. - Treat the non-test list as conservative. Unknown code is non-test rather than silently counted as test. ## 4 Reliability - The script compares `base...head`, matching GitHub pull request diff semantics. - Dedicated test paths include `test/`, `tests/`, `test_fixtures/`, and conventional test filenames. - Rust inline classification recognizes brace-delimited items preceded by `#[cfg(test)]` or `#[test]` in both the base and head revisions. - Re-run after every PR update. Line identities and rename targets may change. - Inspect `mixed` files manually before claiming that a PR contains no production changes. ## 5 Validation - Run the script tests after changing its classification logic: ```bash PYTHONDONTWRITEBYTECODE=1 uv run --no-project --with pytest --with typer pytest -q .claude/skills/frb-categorize-code-diff/test_categorize_code_diff.py ``` - Keep `PYTHONDONTWRITEBYTECODE=1`; otherwise pytest leaves an untracked `__pycache__/` inside the skill directory.
在 GitHub 查看