Skip to content

Add a skill to clarify Java comments - #12362

Open
bric3 wants to merge 2 commits into
masterfrom
docs/clarify-java-comments-skill
Open

Add a skill to clarify Java comments#12362
bric3 wants to merge 2 commits into
masterfrom
docs/clarify-java-comments-skill

Conversation

@bric3

@bric3 bric3 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Adds the clarify-java-comments Codex skill for reviewing or rewriting Java
Javadocs and explanatory comments.

The skill provides source-grounded guidance for:

  • preserving contracts, material constraints, and non-obvious JVM behavior;
  • removing narration of visible code and intermediate inferences;
  • repairing Javadoc tags and inline markup;
  • editing documentation locally by file, class, or member; and

Tip

At this time, this skill works WAY better with codex.

Motivation

Claude-generated Javadoc and comments often narrate every inference instead of providing useful documentation for human readers. This makes contracts, invariants, and important JVM behavior harder to find and understand.

The skill defines a reusable boundary: retain verified explanations that materially affect the contract, correctness, safe modification, compatibility, or performance
when they are not readily recoverable from nearby code. It should express that reasoning as the shortest useful causal chain and remove the rest.

Additional Notes

  • This is documentation-only tooling and never perform executable code changes.
  • Local edits, GitHub mutations, review replies, and review submission have separate
    authorization boundaries.

Contributor Checklist

@bric3 bric3 added type: documentation tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM labels Sep 1, 2026
@bric3
bric3 marked this pull request as ready for review September 1, 2026 14:57
@bric3
bric3 requested a review from a team as a code owner September 1, 2026 14:57
@bric3
bric3 requested review from mtoffl01 and removed request for a team September 1, 2026 14:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T15:19:09.927997Z f6d8a8d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bric3
bric3 requested review from a team, amarziali and sarahchen6 September 1, 2026 14:59
@datadog-datadog-prod-us1

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d87ee17e25

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .agents/skills/clarify-java-comments/SKILL.md Outdated
Comment thread .agents/skills/clarify-java-comments/SKILL.md Outdated

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: FAIL

The skill cannot run its required Gradle checks because it names a command that this repository does not provide.

Open Bits AI session

🤖 Datadog Autotest · Commit d87ee17 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Comment thread .agents/skills/clarify-java-comments/SKILL.md Outdated
@dd-octo-sts

dd-octo-sts Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.77 s 14.67 s [-0.3%; +1.7%] (no difference)
startup:insecure-bank:tracing:Agent 13.59 s 13.68 s [-1.4%; +0.0%] (no difference)
startup:petclinic:appsec:Agent 16.78 s 16.61 s [+0.3%; +1.8%] (maybe worse)
startup:petclinic:iast:Agent 16.91 s 16.96 s [-1.3%; +0.6%] (no difference)
startup:petclinic:profiling:Agent 16.66 s 16.86 s [-2.5%; +0.1%] (no difference)
startup:petclinic:sca:Agent 16.69 s 15.95 s [+0.2%; +9.1%] (maybe worse)
startup:petclinic:tracing:Agent 16.06 s 16.00 s [-0.5%; +1.2%] (no difference)

Commit: f6d8a8d6 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@bric3

bric3 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f6d8a8d65e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .agents/skills/clarify-java-comments/SKILL.md
@dougqh

dougqh commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

One question on the new SKILL.md frontmatter: it only declares name and description. Every other skill under .agents/skills/ (techdebt, perf-review, apm-integrations, etc.) also sets user-invocable: true, and the ones that do file edits / gh mutations / gradle invocations declare context: fork and/or an explicit allowed-tools list (e.g. perf-review marks itself read-only via allowed-tools).

Given this skill can edit local files, post GitHub review comments, and run ./gradlew, was omitting those fields intentional (inherit everything from the invoking session) or an oversight? Worth aligning with the sibling skills' convention either way.

@sarahchen6 sarahchen6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support this skill given more and more AI contributions!

In general, I think the skill is a bit verbose though. I started leaving some comment suggestions, but we should rework to keep instructions minimal so not to overwhelm the context of the AI using this, similar to existing skills like for techdebt: https://github.com/DataDog/dd-trace-java/blob/master/.agents/skills/techdebt/SKILL.md.

WDYT about centering the skill around existing best practices like https://stackoverflow.blog/2021/12/23/best-practices-for-writing-code-comments/? I think defining these 9 rules plus a bit of context is sufficient and straightforward.

Comment on lines +4 to +10
Clarify or review Java Javadocs, Javadoc tags, and explanatory code comments for
legibility, accuracy, and source alignment. Use when asked to simplify verbose or
generated comments, edit documentation in a local file, class, or member, repair
Javadoc markup, propose copy-ready replacements, or add GitHub suggestions to an
existing pending PR review. Documentation-focused: never change executable code
or turn the task into a general code review. Do not submit a review unless
explicitly requested.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Clarify or review Java Javadocs, Javadoc tags, and explanatory code comments for
legibility, accuracy, and source alignment. Use when asked to simplify verbose or
generated comments, edit documentation in a local file, class, or member, repair
Javadoc markup, propose copy-ready replacements, or add GitHub suggestions to an
existing pending PR review. Documentation-focused: never change executable code
or turn the task into a general code review. Do not submit a review unless
explicitly requested.
Clarify or review Java Javadocs, Javadoc tags, code comments, and documentation for concision,
legibility, accuracy, and source alignment. Use when asked to improve or simplify verbose
comments, documentation, Javadoc markup, etc. Documentation-focused: never change
executable code or turn the task into a general code review. Do not submit a review unless
explicitly requested.

Comment on lines +30 to +34
- For a PR, pin the live head and base before drafting suggestions. Refresh them
before posting because comment ranges and conclusions are revision-specific.
- Preserve unrelated tracked and untracked work. Keep any authorized local edit
limited to the comments in scope, and do not switch branches in a dirty checkout
merely to inspect a PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these two bullets are necessary to specify, as I find it a part of general Codex, etc. workflow

Comment on lines +130 to +140
- Put the main point first. Use a concrete subject and an active verb where practical.
- Keep one idea per sentence and one purpose per paragraph. Split nested clauses and
long parenthetical chains.
- Name the relevant method, state, or JVM mechanism instead of relying on an unclear
pronoun or distant antecedent.
- Keep the connective sentence that makes a causal relationship understandable.
Concision must not make the text compressed, cryptic, or abrupt.
- Use terminology that matches the code and domain. Replace vague generated labels
with names a maintainer would naturally use.
- Read the replacement once in its surrounding context. If understanding a sentence
requires backtracking to find its subject, condition, or conclusion, rewrite it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Put the main point first. Use a concrete subject and an active verb where practical.
- Keep one idea per sentence and one purpose per paragraph. Split nested clauses and
long parenthetical chains.
- Name the relevant method, state, or JVM mechanism instead of relying on an unclear
pronoun or distant antecedent.
- Keep the connective sentence that makes a causal relationship understandable.
Concision must not make the text compressed, cryptic, or abrupt.
- Use terminology that matches the code and domain. Replace vague generated labels
with names a maintainer would naturally use.
- Read the replacement once in its surrounding context. If understanding a sentence
requires backtracking to find its subject, condition, or conclusion, rewrite it.
- Put the main point first.
- Keep one idea per sentence and one purpose per paragraph.
- Name the relevant method, state, or JVM mechanism instead of relying on an unclear
pronoun or distant antecedent.
- Use terminology that matches the code and domain. Replace vague generated labels
with names a maintainer would naturally use.

Comment on lines +100 to +102
tag. Apply this bonus pass only to a whole-comment rewrite or an explicit tag-repair
request. For a sentence-, typo-, or wording-limited request, leave unrelated tags
unchanged and report any separate defect.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tag. Apply this bonus pass only to a whole-comment rewrite or an explicit tag-repair
request. For a sentence-, typo-, or wording-limited request, leave unrelated tags
unchanged and report any separate defect.
tag.

is already clear.
- Never modify suppression directives, generated markers, license text, or tooling
instructions in this skill. Preserve TODO/FIXME ownership and status; rewrite only
their explanatory prose when the user explicitly names it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
their explanatory prose when the user explicitly names it.
- Preserve the comment's form and scope unless the user requests an API documentation change.
- Keep comments that record an invariant, a non-obvious reason, a compatibility
constraint, or a deliberate tradeoff. Remove line-by-line narration of code that
is already clear.
- Never modify suppression directives, generated markers, license text, or tooling
instructions in this skill.
Preserve TODO/FIXME ownership and status.

instructions in this skill. Preserve TODO/FIXME ownership and status; rewrite only
their explanatory prose when the user explicitly names it.

## Local edit mode

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section is a bit redundant.... Most of these points are inherent and Codex already does a good enough job at this. We should try to minimize unnecessary rules to reduce context needed by this skill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants