Skip to content

Comments

Update agent guidance with performance best practices and stale state examples#1469

Merged
steve-the-edwards merged 3 commits intomainfrom
sedwards/update-guidance
Feb 20, 2026
Merged

Update agent guidance with performance best practices and stale state examples#1469
steve-the-edwards merged 3 commits intomainfrom
sedwards/update-guidance

Conversation

@steve-the-edwards
Copy link
Contributor

@steve-the-edwards steve-the-edwards commented Feb 20, 2026

Summary

  • 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 DI patterns (filtered to exclude android-register specific material)
  • Expand the stale state capture pitfall (Remove non-kotlin files and README text. #1 in Common Pitfalls) with detailed code examples showing both direct and indirect capture of renderState, correct usage of the Updater receiver's state property, and safeAction for sealed state hierarchies
  • Update create-workflow SKILL.md with expanded stale state warning and cross-reference to AGENTS.md

Test plan

  • Review AGENTS.md changes for accuracy and completeness
  • Review SKILL.md changes for consistency with AGENTS.md
  • Verify no android-register specific content leaked into the guidance

🤖 Generated with Claude Code

… 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>

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`

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya, here I just symlink it.

@steve-the-edwards steve-the-edwards merged commit 6520723 into main Feb 20, 2026
76 checks passed
@steve-the-edwards steve-the-edwards deleted the sedwards/update-guidance branch February 20, 2026 20:37
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