بنقرة واحدة
slang-review-clarity
// Review Slang changes for high-level clarity. Use whenever reviewing PRs or diffs for code quality or correctness. Produces candidate review comments in a markdown file.
// Review Slang changes for high-level clarity. Use whenever reviewing PRs or diffs for code quality or correctness. Produces candidate review comments in a markdown file.
Run the full Slang clarity review workflow: generate high-level and fine-grained candidates, consolidate overlap, filter for PR-author scope, and optionally post one GitHub PR review. Use when asked to perform an end-to-end clarity-focused review.
Merge Slang clarity review candidate files and resolve overlapping, duplicate, or superseded comments. Use after high-level and fine-grained clarity review passes and before scope filtering or GitHub posting. Produces or updates one canonical candidate markdown file.
Review Slang changes for fine-grained clarity. Use whenever reviewing PRs or diffs for code quality or correctness. Produces candidate review comments in a markdown file.
Post filtered Slang clarity review candidates as one proper GitHub PR review. Use after candidate consolidation and scope filtering. Uses the bundled stdlib Python script to validate candidate formatting, map comments to PR diff lines, and submit a GitHub review through gh.
Resolve Slang clarity review candidates marked as needing a judgment call. Use after consolidation and scope filtering, before posting, to perform focused follow-up analysis and decide whether uncertain candidates should be kept, revised, or dropped.
Filter candidate review comments in place for PR-author ownership. Use after slang-review-consolidate-candidates, slang-review-clarity, or slang-review-fine-grained-clarity to conservatively keep only comments about code the PR author is justifiably responsible for addressing. Updates candidate status metadata in the markdown file.
| name | slang-review-clarity |
| description | Review Slang changes for high-level clarity. Use whenever reviewing PRs or diffs for code quality or correctness. Produces candidate review comments in a markdown file. |
| argument-hint | <pr-number-or-diff-path> |
| allowed-tools | ["Bash","Read","Grep","Glob","Write","Edit"] |
Generate high-level candidate comments to be used as review feedback, focused on the clarity and explainability of code.
This skill is intentionally broader than the normal bug-review protocol in REVIEW.md.
Code need not be demonstrably wrong to warrant a comment.
If changed code does not clearly communicate its intent and approach, or does not explain why it is correct, that is a valid candidate finding.
Do not directly post comments to PRs; write candidate comments to a markdown file under
tmp/review-candidates/.
If the caller provides an existing candidate file, append new candidates to that file instead
of creating a fresh file. This is useful for sequential workflows. When multiple review passes
may run concurrently, write separate raw files and let slang-review-consolidate-candidates
merge them.
When appending, inspect existing candidate IDs and continue numbering for this skill's C
prefix instead of restarting at C001.
If requested to post comments, write the candidates to a file, then run the consolidation and
filtering skills before posting the filtered results.
Prefer reviewing from a saved diff:
mkdir -p tmp/review-candidates
gh.exe pr diff <number> -R shader-slang/slang > tmp/pr-diff.patch
gh.exe pr view <number> -R shader-slang/slang --json files -q '.files[].path' > tmp/pr-files.txt
If the user provides a local branch or patch instead, save the equivalent diff and file list
under tmp/ first.
Read:
CLAUDE.md for Slang project context.AGENTS.md for cross-harness repository guidance.tmp/pr-files.txt for the changed file list.tmp/pr-diff.patch for the actual changes.If the caller provides an output file, append candidates there. Otherwise, write candidates to:
tmp/review-candidates/pr-<number>-clarity.md
If no PR number is known, use:
tmp/review-candidates/clarity-review.md
Treat clarity issues as evidence of correctness risk. The desired standard is code that is clear enough for a future maintainer to understand the problem, the chosen decomposition, the important invariants, and why the implementation should be trusted. "Obviously no bugs" rather than "no obvious bugs."
The review protects maintainer attention. PR authors are responsible for making changes easy to review, not merely for producing code that might be correct after prolonged reconstruction. Generate a candidate unless you can confidently say a careful reader would find the changed code, comments, names, and tests obviously necessary and correct.
Strong clarity comments do not say "make change X." They say:
Proposed comments should lead with the understanding or certainty the reader currently lacks. Only prescribe a specific remedy when there is only one credible way to resolve the confusion. Otherwise, identify the missing clarity and let the PR author decide how best to supply it.
Code that is not commented should be held to the highest possible standard of clarity. If it is not manifestly obvious why a line of code is both correct and necessary, there must be a comment that speaks to it.
Prioritize high-level concerns in and around changed code:
DeclRef to plain Decl*, without providing a solid proof of why it is valid to do so.When reviewing compiler code, pay special attention to consistent use of established Slang terminology. E.g.:
Generate candidates liberally, but tag the apparent PR ownership scope:
Scope: Direct for changed lines, newly added declarations, or comments changed by the PR.Scope: Contextual for nearby pre-existing code whose contract is changed, invalidated, or
made important by the PR.Scope: Probably out-of-scope for concerns discovered while reading that may be real but
are not clearly the PR author's responsibility.Do not discard Probably out-of-scope candidates in this skill. The separate scope filter
will decide what is postable.
Use this exact structure:
### C001: Short Title
- Status: Proposed
- Confidence: High | Medium | Low
- Scope: Direct | Contextual | Probably out-of-scope
- Category: comments | terminology | organization | invariant | API shape | decl-ref/substitution | correctness smell
- Location: `path:line`
- GitHub link:
Context:
```cpp
<small PR-version snippet>
```
Proposed comment:
> <comment text suitable for GitHub after filtering>
Notes:
<why this candidate was raised, uncertainty, related candidates>
Keep context snippets short enough to identify the issue, but include the relevant comment, name, signature, or control-flow fragment. Prefer PR-version source context over only a GitHub link.
Scope: Probably out-of-scope or
Confidence: Low rather than silently discarding them.Do not run the normal REVIEW.md severity filter here. Do not require a concrete crash,
miscompile, or missing test. Do not post to GitHub. Do not rewrite the PR.