skia-style-check
Checks that changed code on the current git branch matches Skia's style and formatting requirements defined in site/docs/dev/contrib/style.md. Use this skill when verifying, auditing, or reviewing code changes on the active branch for style compliance before committing or submitting. Do not use for compiler errors or build workflows.
- License 许可
- BSD-3-Clause
- 所属仓库
- google/skia
- 最近更新
- 2026-11-14
- Stars
- ★ 1.1w
- Forks
- 1.8k
01 前言 Front Matter
- name
- skia-style-check
- description
- Checks that changed code on the current git branch matches Skia's style and formatting requirements defined in site/docs/dev/contrib/style.md. Use this skill when verifying, auditing, or reviewing code changes on the active branch for style compliance before committing or submitting. Do not use for compiler errors or build workflows.
03 SKILL.md 正文
Skia Style Check Skill
This skill guides the agent in verifying that code modifications on the current git branch adhere to Skia's coding standards.
Scope: Current Branch Changes Only
- Target Scope: Evaluate only the lines and files that have been changed on the
current branch compared to its tracked upstream branch (
@{u}, e.g.,origin/mainor parent feature branch). - Ignore Unchanged Code: Do not review or flag pre-existing style inconsistencies in unchanged code or outside the diff.
- Obtaining Changes:
- Determine the tracked upstream branch (falls back to
origin/mainif not set):UPSTREAM=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null || \ echo "origin/main") - To view committed changes on the branch against the tracked upstream:
git diff $(git merge-base "$UPSTREAM" HEAD)..HEAD - To include any uncommitted / staged working tree changes as well:
git diff $(git merge-base "$UPSTREAM" HEAD)
- Determine the tracked upstream branch (falls back to
Style Rules Reference
Always inspect site/docs/dev/contrib/style.md to determine the requirements applicable to
the modified files.
Review Workflow
- Extract Changed Files and Lines:
- Determine the tracked upstream branch and its merge base with
HEAD. - Inspect the diff to identify modified files and line numbers.
- Determine the tracked upstream branch and its merge base with
- Consult Style Guidelines:
- Read the relevant sections of
site/docs/dev/contrib/style.mdfor the types of changes and languages in the diff.
- Read the relevant sections of
- Verify Compliance:
- Check all newly added or modified lines against the rules in
site/docs/dev/contrib/style.md.
- Check all newly added or modified lines against the rules in
- Report Findings:
- List any violations found in the modified code, including file path, line numbers, description of the issue, and suggested corrections.
- If no violations are found, report that the changes comply with the current style requirements.
04 同仓库更多 Skills
skia-gn-workflow
MANDATORY: Use this skill for ANY and ALL tasks involving building Skia with GN, Ninja, or compiling any Skia tool. It is the authoritative source for Skia's build workflows and MUST be used whenever compilation is required.
skia-add-test
Add a new test to the Skia repository. Use this skill when you need to create a new unit or integration test in the tests/ directory and ensure it's part of the build system.