Skip to content

pstack: teach explicit variable naming in minimize-reader-load - #232

Open
codeBud7 wants to merge 3 commits into
cursor:mainfrom
codeBud7:pstack/explicit-variable-names
Open

pstack: teach explicit variable naming in minimize-reader-load#232
codeBud7 wants to merge 3 commits into
cursor:mainfrom
codeBud7:pstack/explicit-variable-names

Conversation

@codeBud7

@codeBud7 codeBud7 commented Aug 20, 2026

Copy link
Copy Markdown

Why

Generated code often defaults to names such as result, data, and value. 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. requester and validatedUser tell the reader something useful. result does not.

This is a common readability problem in generated code, which makes it relevant to pstack.

What

Extend principle-minimize-reader-load with 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-discipline rather than creating a separate principle.

Validation

  • node scripts/validate-plugins.mjs
  • git diff --check

Made with Cursor

codeBud7 and others added 3 commits August 20, 2026 09:46
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
codeBud7 marked this pull request as ready for review August 20, 2026 08:26
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.

2 participants