pstack: teach explicit variable naming in minimize-reader-load - #232
Open
codeBud7 wants to merge 3 commits into
Open
pstack: teach explicit variable naming in minimize-reader-load#232codeBud7 wants to merge 3 commits into
codeBud7 wants to merge 3 commits into
Conversation
Add one pattern bullet and one test sentence for naming variables after what they are, not the operation that produced them. Scoped to when a transformation changes meaning; outcome-names stay fine inside generics and one-liners. Co-authored-by: Cursor <cursoragent@cursor.com>
Cover domain roles and guarantees beyond transformed values, while keeping short generic names acceptable in tight scopes. Co-authored-by: Cursor <cursoragent@cursor.com>
Tie vague names to remembered state, keep short names valid when declaration and use stay visible together, and update routing summaries so agents discover the guidance. Co-authored-by: Cursor <cursoragent@cursor.com>
codeBud7
marked this pull request as ready for review
August 20, 2026 08:26
cortinaHs
approved these changes
Aug 20, 2026
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.
Why
Generated code often defaults to names such as
result,data, andvalue. Those names describe a generic outcome, not the value's role. Readers must return to the assignment to recover meaning each time the value appears later.Variable names should carry information that types do not: domain role or a guarantee gained during processing.
requesterandvalidatedUsertell the reader something useful.resultdoes not.This is a common readability problem in generated code, which makes it relevant to pstack.
What
Extend
principle-minimize-reader-loadwith one naming pattern and fold naming into its existing 30-second test.The guidance treats vague names as state the reader must remember, so it stays within the principle's existing two-axis model. It remains scoped by reader cost: short names are fine when declaration and use are visible together.
Update the skill description, README principle table, guide, and poteto-mode index so agents can discover the naming guidance.
Why this skill
A vague name makes the reader retain or reconstruct context. This fits the principle's "state to hold" axis. The skill already advises naming invariants at boundaries, so this extends an existing pattern instead of adding another principle.
This follows #174, which added constructive type modeling to
type-system-disciplinerather than creating a separate principle.Validation
node scripts/validate-plugins.mjsgit diff --checkMade with Cursor