docs: reframe docstring guidance as public API reference, not prompts - #1606
Open
ajbozarth wants to merge 1 commit into
Open
docs: reframe docstring guidance as public API reference, not prompts#1606ajbozarth wants to merge 1 commit into
ajbozarth wants to merge 1 commit into
Conversation
The "Docstrings are prompts — the LLM reads them" framing encouraged writing docstrings for an LLM audience, when docstrings are actually published verbatim in the public API reference and read by humans. Reframe the guidance in AGENTS.md and CONTRIBUTING.md to emphasize being specific and accurate for the published reference. Assisted-by: Claude Code Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
Contributor
Author
|
I have some personal preferences in my project memory around keeping docstring concise and direct, and to not leak session context into them. I regularly have to remind Claude to use these preferences and today my session pointed out to me that my preference conflict with the AGENTS file and pointed me at these lines. I believe the original source of these lines came during the generation of AGENTS.md from our existing docs at the time and it picked up the best practices for writing docstrings in mellea apps which feed the docstrings for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The "Docstrings are prompts — the LLM reads them" framing in AGENTS.md and CONTRIBUTING.md tells contributors (and coding agents) to write docstrings for an LLM audience. In practice docstrings are published verbatim in the public API reference and read by humans, so that framing has two concrete downsides:
Reframing the guidance to "published in the public API reference — be specific and accurate" keeps docstrings human-facing and accurate for the shipped docs.
Testing
Attribution
Adding a new component, requirement, sampling strategy, or tool?