Improve perf audit skill based on eval findings#3
Open
sethconvex wants to merge 2 commits into
Open
Conversation
Two additions to address gaps identified by evals: 1. function-budget.md: Add "Don't scan to count" section with three alternatives (bounded range, maintained counter, aggregate component). Models consistently use .collect().length for counting instead of maintained counters -- this addresses that gap. 2. subscription-cost.md: Add "Don't store per-user state on shared documents" section explaining why readBy/seenBy arrays on source documents cause O(users^2) invalidation. Recommends separate tracking tables. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a linter script that catches schema-level and subscription anti-patterns that @convex-dev/eslint-plugin doesn't cover: - readBy/seenBy arrays on shared documents - Date.now() in query handlers - heartbeat/presence fields on user profile tables - redundant prefix indexes - collect-then-count patterns - ctx.runQuery inside mutations Skill now instructs the agent to run the linter as the first diagnostic step, and re-run after fixes to verify. Complements (does not replace) the existing @convex-dev/eslint-plugin. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
convex-perf-lint.mjslinter for schema/subscription anti-patterns that @convex-dev/eslint-plugin doesn't coverWhat the linter catches
Complements (does not replace)
@convex-dev/eslint-plugin:Why these changes
Both patterns were identified as the most common gaps in agent-generated Convex code across multiple models (Sonnet, Opus, Codex). Agents consistently use
.collect().lengthfor counting and put per-user tracking arrays on shared documents.🤖 Generated with Claude Code