8000 docs(generic): coach the missing concept, not the parameter count by devill · Pull Request #122 · habit-hooks/habit-hooks · GitHub
[go: up one dir, main page]

Skip to content

docs(generic): coach the missing concept, not the parameter count - #122

Closed
devill wants to merge 1 commit into
mainfrom
coach-the-missing-concept
Closed

devill wants to merge 1 commit into
mainfrom
coach-the-missing-concept

Conversation

@devill
@devill devill commented Aug 10, 2026
Copy link
Copy Markdown
Collaborator

The problem

The guide already asks for a better object, but the agent's default answer to it is a bag named after the function that takes it — a FooProps, an options object, { ...everything }. That clears the report and entrenches the smell: such an object is organised by method rather than by abstraction, so the next function invents another bag and the concept stays unnamed.

What I measured

On a real TypeScript codebase (a thumbnail editor, ~900 tests), five parameter lists were over the threshold. Three of the five re-listed the members of an entity the codebase had already named somewhere else — the props interface spelled out the fields instead of taking the existing type. The other two pointed at one concept that appeared independently in two files and had no name at all.

The tell was mechanical in one case: the component immediately passed four of its five props straight back out to a hook. Values that arrive together and leave together are an entity.

What the guide now says

Three additions, all terse, keeping the existing ROSE shape:

  1. Names domain-driven design as the tool for finding the entity — parameters that travel together are usually one of the domain's own nouns.
  2. Says to search the rest of the codebase for the same values appearing side by side. The combinations that recur are the real entity, and where one already carries a name, that name is the answer.
  3. Requires refactoring every site the entity fits, not only the line that fired. An abstraction used in one place is hidden, not introduced, and a call passing three of its fields is the same concept sitting under the threshold.

Testing

uv run pytest — the generic plugin's suite passes. 16 failures in plugins/typescript are identical with and without this change on origin/main (knip and comment sensors); they are not touched here.

Related

There is a blind spot no guide can reach: max-params counts parameters, so a props object is one parameter however many values it carries, and the guide never fires. Filed separately.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xb1JpxqxY9mtqzXgQKdBYS

The guide asks for a better object, but an agent's default answer is a bag
named after the function that takes it -- a FooProps, an options object. That
is organised by method rather than by abstraction, so the next function invents
another bag and the concept stays unnamed.

Measured on a real TypeScript codebase: five prop lists over the threshold, and
three of them re-listed the members of an entity the codebase had already named
somewhere else.

The guide now names domain-driven design as the tool for finding the entity,
says to search the codebase for the same values appearing side by side because
the combinations that recur are the real one, and asks for every fitting site
to be refactored rather than only the line that fired -- an abstraction used
once is hidden, not introduced.
@devill devill left a comment
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change removes tested and critical parts of the prompt. It needs to be revised to extend rather then rewrite the existing prompt.

@devill
devill commented Aug 19, 2026
Copy link
Copy Markdown
Collaborator Author

Landed on main as 9422287, reworked to extend the existing guide instead of replacing it: step 1 now says to search wider than the file that fired, a new step 4 asks for the entity to be used everywhere it fits, and the AVOID line covers a caller-named props object. Every original line is untouched.

@devill devill closed this Aug 19, 2026
@devill
devill deleted the coach-the-missing-concept branch August 19, 2026 14:11
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.

1 participant

0