Skip to content

chore(copilot): add code-review agent skill - #1876

Merged
lukaszlenart merged 1 commit into
mainfrom
chore/copilot-code-review-skill
Aug 27, 2026
Merged

chore(copilot): add code-review agent skill#1876
lukaszlenart merged 1 commit into
mainfrom
chore/copilot-code-review-skill

Conversation

@lukaszlenart

Copy link
Copy Markdown
Member

GitHub Copilot code review picks up agent skills from .github/skills, and is more likely to use one whose directory name signals it is meant for pull request review. This repository had no such directory, so Copilot has been reviewing Struts pull requests without any of our conventions.

This adds .github/skills/code-review/SKILL.md, covering:

  1. Tests — the repository is JUnit 4 only; a Jupiter @Test added to an XWorkTestCase subclass silently never runs. Also the three traps that produce green tests asserting nothing: an unpushed action, ParametersInterceptor.requireAnnotations defaulting to false in a bare harness, and interned string literals defeating == marker checks.
  2. Security-sensitive changes — OGNL, the allowlist, @StrutsParameter gating, uploads, action name cleanup, deserialization, escaping.
  3. PR hygiene — the WW-XXXX title format and Jira link, and the documentation/build exception that uses conventional-commit form instead.
  4. Struts patterns — UUID temporary files, allowlisted member access, ParameterNameAware, Struts* naming, no TODOs referencing unfiled tickets.

The security section deliberately limits what the reviewer is allowed to write. A pull request is public, so a review comment that names a weakness, sketches how it is reached, or estimates its impact would itself be the disclosure that SECURITY.md exists to prevent. The skill asks for a neutral pointer to SECURITY.md and the private security@struts.apache.org process, and explicitly forbids describing the weakness, exploitability, severity, affected versions, or a matching CVE in the comment.

No Jira ticket: this is a repository configuration change under .github/, which CLAUDE.md exempts from the WW-XXXX rule.

Copilot code review reads skills from the head branch, so its review of this pull request is also the test of the skill — the attribution line under its comments should name code-review.

GitHub Copilot code review reads agent skills from .github/skills, but
this repository had none, so its pull request reviews ran without any of
the project's conventions: the JUnit 4 only rule, the WW-XXXX title
format, and the framework's security-sensitive patterns.

Add .github/skills/code-review/SKILL.md covering test conventions and the
three vacuous-test traps, security-sensitive code paths, PR and commit
hygiene, and Struts implementation patterns.

The security section deliberately constrains what the reviewer may write:
a pull request is public, so a comment naming a weakness or its impact
would itself be a disclosure. It asks only for a neutral pointer to
SECURITY.md and the private process.
@sonarqubecloud

Copy link
Copy Markdown

@lukaszlenart
lukaszlenart merged commit a119344 into main Aug 27, 2026
13 checks passed
@lukaszlenart
lukaszlenart deleted the chore/copilot-code-review-skill branch August 27, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant