Agent Skills › google/skia › skia-style-check

skia-style-check

GitHub

用于检查当前 Git 分支代码变更是否符合 Skia 项目风格规范。通过对比上游分支获取差异,依据官方文档审查新增或修改的代码行,并报告合规性或违规问题,适用于提交前的代码审核场景。

_agents/skills/skia-style-check/SKILL.md google/skia

触发场景

验证代码风格合规性 审计分支变更 提交前代码审查

安装

npx skills add google/skia --skill skia-style-check -g -y
更多选项

非标准路径

npx skills add https://github.com/google/skia/tree/main/_agents/skills/skia-style-check -g -y

不安装直接使用

npx skills use google/skia@skia-style-check

指定 Agent (Claude Code)

npx skills add google/skia --skill skia-style-check -a claude-code -g -y

安装 repo 全部 skill

npx skills add google/skia --all -g -y

预览 repo 内 skill

npx skills add google/skia --list

SKILL.md

Frontmatter
{
    "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."
}

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/main or 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/main if 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)
      

Style Rules Reference

Always inspect site/docs/dev/contrib/style.md to determine the requirements applicable to the modified files.

Review Workflow

  1. 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.
  2. Consult Style Guidelines:
    • Read the relevant sections of site/docs/dev/contrib/style.md for the types of changes and languages in the diff.
  3. Verify Compliance:
    • Check all newly added or modified lines against the rules in site/docs/dev/contrib/style.md.
  4. 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.

版本历史

  • e5ad386 当前 2026-11-02 19:55

同 Skill 集合

_agents/skills/skia-add-test/SKILL.md
_agents/skills/skia-gn-workflow/SKILL.md
agents/skills/skia-add-test/SKILL.md
agents/skills/skia-style-check/SKILL.md

元信息

文件数
0
版本
e5ad386
Hash
509207aa
收录时间
2026-11-02 19:55

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-05 05:09
浙ICP备14020137号-1