Refactor AI prompt system: deduplicate, shorten, and improve quality#15
Refactor AI prompt system: deduplicate, shorten, and improve quality#15epavanello merged 3 commits intomainfrom
Conversation
- Remove duplicated getKeyPropsForLayerType() from both system-prompt.ts and schemas.ts; replace with extractKeyProps() that auto-infers key properties from Zod schema shape order (first 4 fields) - Remove hardcoded getExampleProps() with manually maintained examples; tool descriptions now rely on schema defaults instead - Simplify system prompt from ~150 lines to ~50 lines by removing content already present in tool definitions (preset lists, layer tool lists, verbose JSON examples, repeated rules) - Add configure_project as explicit first workflow step to prevent AI from skipping project setup (background, dimensions) - Improve layer reference error messages in mutations.ts to include available layer names/IDs, helping AI self-correct on wrong references - Consolidate layer reference rules into one clear section instead of two separate explanations - Make tool descriptions concise and non-redundant https://claude.ai/code/session_01JxrfQtGiLm9wQKhf1UJN9L
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughRefactors AI layer-not-found error handling, adds schema introspection to derive layer key props, streamlines the AI system prompt, introduces new tooltip and tool-part UI components, and applies documentation formatting edits. Several UI interactions and a login guard were updated; no public API signatures were added beyond prop changes noted. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… with dedicated wrapper, provider, and button components.
and schemas.ts; replace with extractKeyProps() that auto-infers key
properties from Zod schema shape order (first 4 fields)
tool descriptions now rely on schema defaults instead
content already present in tool definitions (preset lists, layer tool
lists, verbose JSON examples, repeated rules)
from skipping project setup (background, dimensions)
available layer names/IDs, helping AI self-correct on wrong references
two separate explanations
https://claude.ai/code/session_01JxrfQtGiLm9wQKhf1UJN9L
Summary by CodeRabbit
New Features
Bug Fixes
Chores
UX