Add the prose rules to AGENTS.md - #278
Open
pbrubeck wants to merge 2 commits into
Open
Conversation
FIAT's style section already matches Firedrake's on class attributes, the hasattr prohibition, type hints and numpydoc. It carries neither prose rule. Add the ASD-STE100 rule for docstrings and comments, and the rule against documenting code that is not there. Give each an anti-pattern with a WRONG/RIGHT pair, since that is the form these rules get followed in. Companion to firedrakeproject/firedrake#5338. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Three sentences, one idea each, in place of one of 27 words. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
AI-assisted (Claude Code)
AGENTS.mdonly, no code. Companion to firedrakeproject/firedrake#5338, which makes the same twoadditions on the Firedrake side.
FIAT's Style and Conventions section already matches Firedrake's on class attributes, the
hasattrprohibition, type hints and numpydoc. It carries neither prose rule, so agent-written prose here is
unconstrained.
Main changes
Plain English (ASD-STE100) for docstrings and comments, with a Clause-Stacked Docstrings And
Comments anti-pattern. Unedited AI prose reliably produces garden-path sentences that bury the
subject in a relative clause.
Documenting Code That Is Not There. The case worth naming is not "this used to do X", which
nobody writes, but an argument against a branch that was just removed:
# A test for a repeated point here would divide by zero.That reads as present tense while describing absent code. The rule carries a test a reader can
apply — a reader who never saw the diff must not be able to tell that anything was removed — and
the words that give it away, including
wouldwhen its subject does not exist.This adds the first
## Anti-Patternssection to FIAT'sAGENTS.md. Both examples use small FIAT-flavoured functions rather than real code, so they do not go stale.
Why examples rather than prose
The rules with WRONG/RIGHT pairs get followed; the ones stated only as prose get missed. On the
Firedrake side,
Document The Present, Not The Pastwas violated during the work that producedfiredrakeproject/firedrake#5337 while the rule was sitting in the file, and a human caught it rather
than the rule. These two are also mechanically checkable, and I am running a local
PostToolUsehookthat greps added lines for the Sphinx field-list style, over-long sentences, the past-tense tells,
and the
hasattrguard.