docs(agents): self-documenting code + <summary>/<remarks> guidance#11544
docs(agents): self-documenting code + <summary>/<remarks> guidance#11544LukaszRozmej merged 4 commits intomasterfrom
Conversation
… over inline comments Add guidance to AGENTS.md "Coding guidelines and style": - emit comments only when they capture non-obvious context (why, invariants, workarounds, EIP refs) - prefer XML doc comments (<summary>/<remarks>) for method-level documentation - reserve in-line comments for implementation-specific details that can't live on the header Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- <summary>: one or two sentences, caller's-perspective contract; not implementation - <remarks>: rationale, algorithm, invariants, thread-safety, perf, side effects, spec refs, caveats - Note that <param>/<returns>/<exception>/<typeparam> have their own tags Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @LukaszRozmej's task in 1m 14s —— View job Review
The changes are clear, well-written, and correct. The Two low-severity observations worth considering (neither blocks merge): Low — Scope is method-only, but properties/constructors/classes also benefit The bullet says "method-level documentation", but the same Low — No mention of When a class implements an interface or overrides a base, Minor consistency note (out of scope for this PR)
Overall: clean, well-scoped documentation improvement. The guidance is actionable and fills a real gap for agents writing or reviewing C# doc comments. |
Per review feedback on #11544: - Generalize "method-level" to "member-level" (methods, constructors, properties, types) - Add bullet on preferring <inheritdoc/> for interface implementations and overrides Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@claude review |
|
Claude finished @LukaszRozmej's task in 1m 0s —— View job Review
The three commits in this PR progressively build out documentation guidance — the latest state of What the previous review flagged → now resolved:
Remaining observations (all Low — do not block merge): Low —
No Critical, High, or Medium findings. Clear to merge. |
|
@claude re-review |
|
Claude finished @LukaszRozmej's task in 1m 7s —— View job Re-review
Current state of What previous reviews flagged → resolved:
Remaining observation (Low — does not block merge): Low —
No Critical, High, or Medium findings. Clear to merge. |
Add <remarks>, <exception>, <typeparam>, <inheritdoc/> to the canonical tag list on coding-style.md line 12 and point to AGENTS.md for per-tag guidance. Closes the gap flagged on #11544 — an agent reading only coding-style.md would otherwise apply the narrower (summary/param/returns) tag set. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Changes
AGENTS.md: emit comments only when they capture context that isn't obvious from the code (the why, invariants, workarounds, EIP/Yellow-Paper refs, subtle edge cases). Comments that merely restate the code are noise.<summary>— one or two sentences describing the method's contract from the caller's perspective; short enough for IntelliSense; no implementation, no rationale.<remarks>— the longer-form: algorithm, design rationale, invariants, thread-safety, performance, side effects, edge cases, EIP/spec references, caveats.<param>,<returns>,<exception>,<typeparam>for their respective concerns rather than stuffing into<summary>/<remarks>.This complements the existing
coding-style.mdrule "comments explain why, not what" by giving agents concrete guidance on where to put the explanation.Types of changes
Testing
Requires testing
Documentation
Requires documentation update
Requires explanation in Release Notes