Update agent guidance with performance best practices and stale state examples#1469
Merged
steve-the-edwards merged 3 commits intomainfrom Feb 20, 2026
Merged
Update agent guidance with performance best practices and stale state examples#1469steve-the-edwards merged 3 commits intomainfrom
steve-the-edwards merged 3 commits intomainfrom
Conversation
… pitfall Add performance best practices section to AGENTS.md sourced from the Android dev guide, covering render rules, worker/action rules, eventHandler rules, Compose stability, and dependency injection patterns. Expand the stale state capture pitfall with detailed examples showing both direct and indirect (local variable) capture of renderState, correct usage of the Updater receiver's `state` property, and `safeAction` for sealed state hierarchies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
steveinflow
approved these changes
Feb 20, 2026
|
|
||
| 1. **Don't capture stale state** — In action lambdas, always use the `state` property from the | ||
| `Updater` receiver, never the `renderState` parameter from `render()`. | ||
| 1. **Don't capture stale state** — This is the most common and dangerous pitfall. The `renderState` |
There was a problem hiding this comment.
Oh no, we have to fix this. Claude doesn't natively look at Agents.md, it looks at Claude.md. We need to have a shared root md that's used to generate rules for all the agents. Doesn't block this PR
Contributor
Author
There was a problem hiding this comment.
Ya, here I just symlink it.
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.
Summary
renderState, correct usage of the Updater receiver'sstateproperty, andsafeActionfor sealed state hierarchiesTest plan
🤖 Generated with Claude Code