Skip to content

docs(comments): enhance comments guidelines - #14

Merged
GentBajko merged 1 commit into
mainfrom
feat/comments
Sep 4, 2026
Merged

docs(comments): enhance comments guidelines#14
GentBajko merged 1 commit into
mainfrom
feat/comments

Conversation

@GentBajko

@GentBajko GentBajko commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary by Sourcery

Establish and enforce a code-comment policy that keeps prose focused on constraints and rationale the code cannot express.

New Features:

  • Define explicit guidelines for writing earned comments, docstrings, workarounds, and constraint markers while rejecting narration and redundant prose.

Enhancements:

  • Apply the comments policy consistently across planning, building, implementation, standards, and review protocols.
  • Treat redundant or stale comments as review findings and require comment guidance to be included in delegated implementation and review context.

@sourcery-ai sourcery-ai 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.

Sorry @GentBajko, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 10 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@GentBajko
GentBajko merged commit bfe18bb into main Sep 4, 2026
1 check failed
@GentBajko
GentBajko deleted the feat/comments branch September 4, 2026 13:10
@sourcery-ai

sourcery-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR introduces an earned-comments framework that distinguishes useful rationale and constraints from redundant narration, then threads that policy through code-craft guidance, planning, building, implementation prompts, review checks, and standards discovery.

Flow diagram for earned-comments policy enforcement

flowchart LR
    A["Code-craft Comments section"] --> B["Plan: filter comments in snippets"]
    A --> C["Build: constrain sketches and prompts"]
    A --> D["Implement: provide policy to subagents"]
    A --> E["Review: flag redundant comments"]
    A --> F["Standards: discover comment policy"]
Loading

File-Level Changes

Change Details Files
Establishes a detailed policy for writing and reviewing comments and docstrings based on whether they convey information the code cannot.
  • Defines earned comment categories, including rationale, non-obvious constraints, workarounds, ceilings, and explicitly required docstrings.
  • Rejects narration, restatement, banners, redundant docstrings, commented-out code, and task-covered TODOs.
  • Prioritizes renaming or extracting functions over explanatory comments and requires stale comments to be updated or removed with the code.
  • Treats redundant prose as a review finding.
skills/core/references/code-craft.md
Propagates the earned-comments policy into build planning and execution guidance, including subagent prompts and implementation review.
  • Requires code sketches and implementation layouts to include only comments that satisfy the new policy.
  • Copies the Comments section into subagent prompts alongside the existing coding and Git guidance.
  • Adds comment-restatement checks to implementation review lenses.
skills/core/references/protocols/build.md
skills/core/references/protocols/implement.md
Extends planning and review workflows to detect unearned comments before and during implementation.
  • Requires planned snippets to avoid narrating their own code.
  • Adds a plan-pass check for comments that merely restate adjacent lines.
  • Adds narrating comments to craft-divergence review findings.
skills/core/references/protocols/plan.md
skills/core/references/protocols/review.md
Makes the new comment and docstring policy the default standard for repository conventions.
  • Replaces the generic comment-policy discovery item with the code-craft Comments rules.
  • Directs standards analysis to identify user-specific deviations and surfaces where docstrings are mandatory.
skills/core/references/protocols/standards.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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