Skip to content

Conversation

@Yrzhe
Copy link

@Yrzhe Yrzhe commented Jan 11, 2026

Description

Screencast

Checklist

@raycastbot raycastbot added the new extension Label for PRs with new extensions label Jan 11, 2026
@raycastbot
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

Due to our current reduced availability, the initial review may take up to 10-15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@Yrzhe Yrzhe marked this pull request as ready for review January 11, 2026 10:01
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 11, 2026

Greptile Overview

Greptile Summary

This PR introduces a new "AI Recipes" extension that allows users to create and manage reusable AI prompts with custom configurations. The extension provides three main commands for browsing recipes, creating new recipes, and managing tags.

What Changed

The PR adds a complete new extension with:

  • Recipe Management: Create, edit, duplicate, and delete AI recipes with custom system prompts
  • Tag System: Organize recipes with colored tags and filtering
  • Usage History: Track and view previous recipe executions with input/output pairs
  • Prompt Versioning: Automatically save prompt history and support version rollback
  • Storage Layer: LocalStorage-based persistence with model migration support

Architecture

The extension follows Raycast patterns well with:

  • Clean separation between storage layer (lib/storage.ts) and UI components
  • Proper TypeScript types defined in types.ts
  • React hooks for state management and data loading
  • Consistent error handling and loading states across all views

Issues Found

Three style-level issues were identified:

  1. Model Hardcoding: The extension stores a defaultModel field in recipes but always uses hardcoded OpenAI_GPT4o when executing recipes, creating dead code and confusion about whether model selection is a feature.

  2. Migration Logic: All Anthropic Claude models in the migration map are converted to OpenAI GPT-4o. While this may be intentional if those models are unsupported, it lacks documentation explaining why.

  3. Revert Creates Duplicates: The revertToPromptVersion function doesn't actually revert - it creates a new version entry with the old prompt, which could lead to history bloat if users repeatedly revert between versions.

Compliance

✅ CHANGELOG.md created with proper structure
✅ Metadata screenshots included (3 images)
✅ No manual Preferences interfaces defined
✅ No improper fetch imports
✅ Proper use of Raycast AI APIs
✅ Good error handling and validation throughout

Confidence Score: 4/5

  • This PR is safe to merge with minor style improvements recommended
  • The code is well-structured with no critical bugs or security issues. All three issues found are style/design concerns that don't affect functionality: (1) unused defaultModel field creating dead code, (2) undocumented model migration logic, and (3) revert function naming that doesn't match behavior. The extension follows Raycast patterns, has proper error handling, includes required metadata and documentation, and would work correctly for users.
  • Pay closer attention to src/lib/storage.ts (model migration logic) and src/components/UseRecipeView.tsx (hardcoded model usage)

Important Files Changed

File Analysis

Filename Score Overview
src/lib/storage.ts 4/5 Core storage layer with LocalStorage operations, model migration, and data initialization. Has style issues with hardcoded model migration and revert logic that creates duplicates instead of true reversion.
src/components/UseRecipeView.tsx 4/5 Recipe execution view with AI.ask integration. Hardcodes model to OpenAI GPT-4o instead of using recipe.defaultModel, creating inconsistency with stored data. Otherwise well-structured with proper error handling and loading states.
src/components/EditRecipeForm.tsx 5/5 Recipe creation/editing form with proper validation and error handling. Hardcodes model to OpenAI GPT-4o but otherwise clean implementation.
src/components/HistoryView.tsx 5/5 Usage history view with proper list rendering, search, copy actions, and delete confirmations. Clean implementation with good UX patterns.
src/recipes.tsx 5/5 Main recipes list view with tag filtering, search, and recipe management actions. Well-structured with proper async handling and loading states.
src/manage-tags.tsx 5/5 Tag management interface with create, edit, and delete operations. Includes proper validation and shows recipe counts per tag. Clean implementation.
src/types.ts 5/5 Type definitions for recipes, tags, usage records, and form values. Well-structured with proper TypeScript types.
package.json 5/5 Extension manifest with proper metadata, three view-mode commands, and appropriate dependencies. Configuration is correct.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 11, 2026

Additional Comments (3)

src/components/UseRecipeView.tsx
The model is hardcoded to OpenAI_GPT4o, but the Recipe type includes a defaultModel field that is stored but never used. This creates confusion and dead code.

If model selection is not a feature, consider removing the defaultModel field from the Recipe type and storage. If it should be a feature, the hardcoded FIXED_MODEL should be replaced with recipe.defaultModel:

const response = await AI.ask(fullPrompt, {
  model: recipe.defaultModel,
  creativity: recipe.creativity,
});

The same issue exists in EditRecipeForm.tsx line 7.


src/lib/storage.ts
The migration map converts all Anthropic Claude models to AI.Model.OpenAI_GPT4o, which seems incorrect. If these Anthropic models are no longer supported in Raycast, this migration is reasonable, but it would be better to:

  1. Add a comment explaining why Anthropic models are migrated to OpenAI
  2. Consider migrating to a generic/default value rather than specifically to OpenAI GPT-4o
  3. If this is temporary, consider adding a TODO comment

This is especially important since the extension currently hardcodes all recipes to use OpenAI GPT-4o (see UseRecipeView.tsx line 19), making this migration somewhat redundant.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


src/lib/storage.ts
When reverting to a previous prompt version, this function calls updateRecipe() which creates a NEW version entry in the history (lines 104-113). This means "reverting" doesn't actually restore the history to a previous state - it adds the old prompt as a new version.

This could lead to history bloat if users repeatedly revert between versions. Consider either:

  1. Renaming this function to restorePromptVersion or copyPromptVersion to better reflect what it does
  2. Implementing true reversion that removes newer versions and restores to the selected version
  3. Adding a note parameter when reverting so users can see in history that it was a reversion

@0xdhrv 0xdhrv assigned 0xdhrv and unassigned pernielsentikaer Jan 12, 2026
@0xdhrv
Copy link
Contributor

0xdhrv commented Jan 12, 2026

Hey @Yrzhe 👋

Thanks for your contribution 🔥

Could you look into the suggestions from Greptile?

@0xdhrv 0xdhrv marked this pull request as draft January 12, 2026 13:45
Copy link
Contributor

@0xdhrv 0xdhrv left a comment

Choose a reason for hiding this comment

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

Could you look into the suggestions from Greptile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants