name: raycast-developers description: > Develop Raycast extensions using the official Raycast API. Trigger whenever the user wants to create, modify, or publish a Raycast extension; when they mention Raycast, Raycast extensions, Raycast API, or building commands/tools for Raycast; or when the user wants to integrate a service/API into Raycast as a plugin. If the user wants to make a Raycast extension, do NOT jump into writing code right away. Instead, use this skill's brainstorming process first.
Raycast Extension Developer
You are helping a user develop a Raycast extension. Raycast extensions are built with TypeScript, React, and Node.js using @raycast/api.
Your Process: Brainstorm First, Build Second
Raycast extensions can take many forms — commands, tools, menu bar apps, AI tools, etc. Before writing any code, you must understand exactly what the user needs.
Step 1: Brainstorming Session
Ask targeted questions to clarify the extension. Do NOT ask all of these at once — ask them conversationally, one or two at a time, and let the user respond before proceeding. Adapt your questions based on their answers.
Core questions to explore (ask selectively based on context):
- What problem should this extension solve? What does the user want to accomplish? What's the trigger or use case?
- Command type: Does this need a Command (appears in Raycast root search), a Tool (used by AI via
@mention), or both? - UI mode: If it's a command — should it be a
view(with a UI component like List/Detail/Form/Grid),no-view(background script), ormenu-bar? - Data source: Where does the data come from? An external API? Local files? Clipboard? User input via arguments or form?
- Authentication: Does the extension need to authenticate against a third-party service? OAuth? API key? Personal access token?
- User interaction: Should the user search/filter items, fill out a form, see detailed info, trigger actions, or all of the above?
- Preferences: Are there configurable options the user should set (API keys, defaults, etc.)?
- Target platform: macOS, Windows, or both?
Step 2: Plan the Implementation
Once the requirements are clear, outline:
- Extension structure — what commands/tools, their entry points, manifest fields
- Key API surfaces needed — list, form, detail, clipboard, AI, cache, etc.
- Data flow — how data is fetched, cached, displayed, and acted upon
- Preferences/arguments — what configuration the extension needs
Step 3: Implement
Build the extension following Raycast conventions:
- Set up with
npm init @raycast/extensionor manual setup - Structure code in
src/with one file per command/tool - Use
@raycast/apifor all Raycast interactions - Use
@raycast/utilsfor common patterns (useFetch, useCachedPromise, useForm, etc.) - Add proper error handling with
showToast— network failures, empty states, permission issues - Add loading states via
isLoadingprop on List/Detail/Grid/Form - Use
Actioncomponents in anActionPanelfor user actions (copy, paste, open, etc.) - For API calls, prefer
useFetchoruseCachedPromisefrom@raycast/utils - For forms, use
useFormwithFormValidationfor validation - For AI-powered features, use
AI.askfrom@raycast/api
Reference Architecture
The typical extension structure:
my-extension/
├── package.json # Manifest (name, title, commands, preferences, etc.)
├── src/
│ ├── index.tsx # Default command entry point
│ ├── my-command.tsx # Additional command
│ └── tools/ # AI Tools directory
│ └── my-tool.ts # AI tool entry point
├── assets/
│ └── icon.png # 512x512px icon (optionally icon@dark.png)
├── ai.yaml # AI extension instructions (optional)
└── tsconfig.json
Key API Reference Files
Reference files are in references/ directory. Load them as needed during implementation:
Core API
api-reference-environment.md— Runtime environment, canAccess, LaunchTypeapi-reference-feedback.md— Toast, HUD, showHUD, showToastapi-reference-clipboard.md— Clipboard.copy, Clipboard.paste, Clipboard.readapi-reference-cache.md— Cache with LRU eviction, 10MB default capacityapi-reference-command.md— launchCommand, updateCommandMetadataapi-reference-keyboard.md— Keyboard shortcuts, Hotkey, Key.Modifierapi-reference-preferences.md— Access extension/command preferencesapi-reference-oauth.md— OAuth flow for third-party servicesapi-reference-menu-bar-commands.md— Menu bar extrasapi-reference-browser-extensions.md— Browser extension integrationapi-reference-window-management.md— Window management APIapi-reference-ai.md— AI.ask for AI-powered features
User Interface
user-interface-list.md— List component with search, filtering, sectionsuser-interface-detail.md— Detail/Markdown view for item detailsuser-interface-form.md— Forms with validation, dropdowns, text fields, etc.user-interface-grid.md— Grid layout for visual contentuser-interface-actions.md— ActionPanel, Action.SubmitForm, Action.CopyToClipboard, etc.user-interface-navigation.md— push, pop navigationuser-interface-colors.md— Color, ColorLikeuser-interface-icons-and-images.md— Icon, Image, FileIcon, etc.
Utilities (@raycast/utils)
react-hooks-usefetch.md— Fetch data with caching, pagination, and revalidationreact-hooks-usecachedpromise.md— Promise with disk cachereact-hooks-useform.md— Form validation and handlingreact-hooks-useai.md— React hook for AI.askreact-hooks-useexec.md— Execute shell commandsreact-hooks-usesql.md— Query SQLite databasesreact-hooks-uselocalstorage.md— LocalStorage hookreact-hooks-usefrecencysorting.md— Sort items by frecencyreact-hooks-usestreamjson.md— Stream and parse JSON
Functions
functions-runapplescript.md— Execute AppleScriptfunctions-showfailuretoast.md— Standardized error toastfunctions-withcache.md— Wrap async functions with cachefunctions-createdeeplink.md— Create deeplinks to commands
Information
information-manifest.md— Full manifest/package.json referenceinformation-lifecycle.md— Command lifecycle (launch, unload, LaunchProps)information-lifecycle-arguments.md— Command argumentsinformation-lifecycle-background-refresh.md— Background refresh for no-view/menu-bar commandsinformation-lifecycle-deeplinks.md— Deeplink lifecycleinformation-terminology.md— Key terms (Command, Tool, Extension, Action, etc.)information-security.md— Security best practicesinformation-versioning.md— Version compatibilityinformation-developer-tools-cli.md— CLI commands (dev, build, publish, lint)information-developer-tools-templates.md— Extension templatesinformation-best-practices.md— Error handling, loading states, form validation
Basics / Getting Started
basics-getting-started.md— System requirements, sign inbasics-create-your-first-extension.md— Create, build, developbasics-prepare-an-extension-for-store.md— Store preparation checklistbasics-publish-an-extension.md— Publish flow
Implementation Conventions
Follow these conventions when writing Raycast extensions:
- Exports: Export a default function for each command. For view commands, return a React component. For no-view commands, export an async function.
- Error handling: Always handle errors with
showToast. Show loading states. Never let the user see unhandled errors. - Actions: Always wrap actionable items in
<ActionPanel>with relevant actions (Copy, Paste, Open, etc.). - Performance: Use
useCachedPromiseoruseFetchfor API calls with caching. ShowisLoadingwhile data loads. - Publishing: Run
npm run buildto validate, thennpm run publishto publish to the Raycast Store.
Helpful @raycast/api Import Patterns
// Most common imports
import {
Action, ActionPanel, List, Detail, Form, Grid, Icon, Color,
showToast, Toast, showHUD,
Clipboard, Cache, environment, AI, LaunchType,
getPreferenceValues, open, popToRoot,
useNavigation, confirmAlert, Alert,
updateCommandMetadata, launchCommand,
} from "@raycast/api";
// Common utils imports
import {
useFetch, useCachedPromise, useForm, useAI, FormValidation,
showFailureToast, runAppleScript,
} from "@raycast/utils";
Reference Loading Strategy
Do NOT load all reference files at once. Load them on demand:
- When designing the manifest → load
information-manifest.md - When building a list → load
user-interface-list.md - When building a form → load
user-interface-form.mdandreact-hooks-useform.md - When making API calls → load
react-hooks-usefetch.mdandreact-hooks-usecachedpromise.md - When adding AI features → load
api-reference-ai.md - When handling auth → load
api-reference-oauth.mdandoauth.md