跳到正文
cccskills
免费在 GitHub 公开

pr-reviewer-add-rule

Turn a convention found in a Git commit or pull request review comment into a reusable `pr-reviewer` rule. The skill checks existing rules for overlap, writes the rule in the project’s format, and tests that it catches the original violation without flagging the fix.

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

原文查看原文说明

Add a new rule to pr-reviewer/rules, derived from a Git commit or a review comment.

liferay/liferay-portal星标 2,267(GitHub 2,267 + cccskills 0)

实测评分 未实测

查看安装方法

适用场景

  • Add a reusable rule from a code change
  • Encode a convention from a PR review comment
  • Check whether a proposed rule duplicates an existing one

包含的文件(1)

  • SKILL.md3.9 KB

SKILL.md(原文)

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

PR Reviewer: Add Rule

Add a new rule to pr-reviewer/rules, derived from a Git commit or from a reviewer's comment on a pull request. Anyone can use this to encode a convention they spotted in a commit or were asked to follow in review. Rules can apply to any file type the reviewer reads (Java, .properties, XML, JSP, Markdown, Gradle, YAML, shell, and so on), so do not bias toward Java.

Inputs

  • A Git commit SHA, or the text of a review comment together with the commit or pull request it was made on.

  • Optional: a hint about which aspect of the commit to encode. Commits often touch multiple things, and a hint narrows the scope.

Workflow

Inspect the Source

Inspect the commit's full diff, or the comment and the code it points at. Identify a single learnable convention that a future reviewer could apply mechanically to other code. Stop and ask the user to clarify when:

  • Multiple distinct rules are present. Ask the user to pick one, or run the skill once per rule.

  • The commit mixes convention changes with logic or refactoring changes that cannot be separated.

  • The pattern is not generalizable beyond the specific file or context.

Check for Duplicates

Read the existing rules in pr-reviewer/rules and pr-reviewer/STYLE.md and compare them against the pattern. When the pattern duplicates or substantially overlaps an existing rule, flag it to the user and ask whether to skip, extend the existing rule, or proceed anyway. When the pattern is enforced by SourceFormatter already, say so and stop, since the reviewer would only repeat what the formatter fixes.

Write the Rule

Pick the category by the leading digit of the existing files (0xx convention, 1xx naming, 2xx ordering, 3xx utility methods, 4xx control flow, 5xx redundancy, 6xx tests, 7xx prose, 8xx visibility, 9xx formatting) and take the next free number in it. When no group in _GROUPS at the end of pr-reviewer/review.sh covers the new number's leading digits, add them to the group of that category, since review.sh reviews no rule outside a group. Create pr-reviewer/rules/<number>-<kebab-case-imperative-title>.md with this shape, matching the existing files:

  1. # <number>: <Title Case Imperative Title>

  2. One or two paragraphs stating the rule, with code in inline backticks.

  3. A paragraph starting **Rationale:** that explains what consistency the rule buys, not what the rule does.

  4. A paragraph starting A violation is ... that defines the boundary of the rule and names what not to flag.

  5. A paragraph starting **Example:** that cites the commit or pull request in prose. Follow it with a diff fence when a before and after reads faster than prose, using abstract identifiers (foo, Bar, methodA) rather than the commit's literal code, so the example illustrates the pattern instead of overfitting it to one case.

Write the file the way the rules themselves demand: no hyphens in prose (rule 701), each paragraph on one line (rule 708), complete sentences, and no trailing newline at the end of the file (rule 908).

When the rule belongs to a section of pr-reviewer/STYLE.md, add a bracketed reference to it there.

Self Test the Rule

Validate that the reviewer catches the violation with the new rule in place. Review the reverse of the commit, which reintroduces the violation:

pr-reviewer/review.sh --json <sha>..<sha>~1

The output must include a violation whose rule is the new number, on the file and line the commit changed. When it does not, revise the rule and repeat. Then review the commit itself, <sha>~1..<sha>, and confirm the new rule reports nothing, so the rule does not flag the fix it describes.

Commit the Rule

After the self test passes, stage the new rule file and any STYLE.md change and commit with this message:

<ticket> Add rule <number> derived from <sha>

评价

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

评论

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

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

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

0 / 1000 字

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

同一仓库的技能

Use this skill to format Liferay source files according to the project’s conventions. It describes the formatter workflows for modules and committed changes, how to handle Go and shell files, and which generated files to leave untouched.

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

  • Formatting source files in a module
  • Checking formatting across committed changes
  • Applying the separate Go or shell formatting rules
liferay/liferay-portal22672026年10月29日 更新

jira-bug

免费

Use this skill to file a bug in the LPD Jira project from a description or fix commit. It gathers reproduction steps and expected versus actual behavior, applies required project fields, and returns the created ticket key and link.

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

  • Filing a newly reported LPD bug
  • Turning a fix commit into a bug ticket
  • Recording reproduction steps and expected behavior
liferay/liferay-portal22672026年10月29日 更新

jira-task

免费

Use this skill to create a Task ticket in the LPD Jira project from a description or commit. It gathers missing details, selects a matching component, formats the description with acceptance criteria when applicable, and returns the ticket key and link.

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

  • Creating an LPD task from a short description
  • Turning a commit into a task ticket
  • Adding acceptance criteria to a Jira task
liferay/liferay-portal22672026年10月29日 更新

Format Markdown files for Liferay repositories by aligning front matter, heading capitalization, shell examples, and prose with the project’s style rules. Use it to clean up or copy-edit a document and receive a summary of the changes.

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

  • Formatting a Markdown guide for a Liferay repository
  • Cleaning up headings and front matter in a document
  • Polishing shell examples and prose in Markdown
liferay/liferay-portal22672026年10月29日 更新

Analyzes a Liferay Poshi `.testcase`, checks feasibility and existing coverage, then routes each test to Playwright, Jest, JUnit unit, or Java integration tests. It creates a migration plan and can implement the approved changes using repository patterns.

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

  • Migrating Poshi test cases to modern test layers
  • Finding existing specs that already cover Poshi tests
  • Planning Playwright, Jest, or JUnit test conversions
liferay/liferay-portal22672026年10月29日 更新

Plan and carry out a reduction of a Liferay component’s Poshi test suite by identifying overlapping tests and combining their unique assertions. The skill inventories matching test files, preserves tests with special setup or properties, and commits each planned rename or merge separately.

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

  • Reduce overlapping Poshi tests for a component
  • Prepare a test suite for migration to another test layer
  • Review a file-by-file plan for merging functional tests
liferay/liferay-portal22672026年10月29日 更新

查看 liferay 的全部技能

报告此技能的问题