Prompt authoring guide

Prompts are the primary way you instruct Freddy AI to build, edit, or maintain apps. This section explains what prompts are, the types of prompts you can use, how to write effective prompts, and how to align them with the Freshworks platform context.

A prompt is a specific input, such as a phrase, code snippet, or instruction, which you provide to get a desired output. In the Freddy AI Copilot for Developers extension, prompts guide the AI to generate code, documentation, explanations, or refactored code.

Importance of effective prompts

  • The quality of the output depends heavily on prompt clarity, specificity, and relevance.
  • Poorly formed prompts can lead to incorrect, verbose, or off-topic responses.
  • Understanding how to craft prompts helps you get better results faster and reduces the need for manual corrections.

Types of prompts

Freddy AI supports multiple forms of prompts depending on your development goal, as documented in the following table.

Prompt typeDescription

Text prompts

Natural-language instructions or questions.

Example: “Generate a form to capture email address and department.”

Code prompts

Code or project context passed as input, asking for modification or generation.

Example: Providing a manifest.json and asking changes to the code.

Dialogue promptsA back-and-forth or multi-turn conversation with the AI, often refining or iterating on code.

Best practices for writing prompts

Use the following best practices to improve the quality and relevance of prompt outputs when working with Freddy AI.

Do

  • Be clear and specific. Clearly describe what you want to build, including the product (for example, Freshdesk or Freshservice) and the component (for example, the ticket sidebar).
  • Provide context. When referencing UI elements, specify whether they belong to the product UI or use CRAYONS components.
  • Include constraints or examples. For example: “Use a CRAYONS form with three fields. Validate the email field and display a success notification.”
  • Use incremental prompts. Start with a base prompt and refine it with additional instructions as needed.
  • Review and iterate. If the output does not meet your expectations, revise the prompt based on the results and try again.

Don’t

  • Avoid vague or generic prompts. Prompts such as “Create ticket UI” without context can produce unpredictable results.
  • Avoid assuming full common-sense understanding or real-time knowledge. Freddy’s responses are based on training data and the Freshworks platform context.
  • Avoid overloading a single prompt with multiple tasks. Break complex requests into smaller, focused prompts for better control.
  • Avoid skipping the review of AI-generated output. Always verify correctness, especially for platform-specific logic, APIs, or dependencies.

Align with the Freshworks platform context

To get platform-compatible code and best results, your prompts should reflect the terminology and structure of the Freshworks app ecosystem.

Key terms and concepts to reference where applicable:

  • Placeholders – where an app appears in the product UI (e.g., ticket_sidebar).
  • Events, Interface methods, Request methods, Scheduled events – these refer to platform actions and methods.
  • Data store – key-value or entity store used in the app.
  • CRAYONS UI components – Freshworks-specific UI library.

By including these terms in your prompt, Freddy is more likely to generate code that aligns with Freshworks standards and tooling.

Prompt examples and use cases

Here are real-world prompt examples you can use or adapt.

Conversation to code

  • “Generate app installation settings to capture Freshdesk domain and API key.”
  • “Write a function that fetches contact details from the Freshservice API and displays them in a panel.”

Use case to code

  • “Create a Freshservice app that automates ticket assignment based on priority and SLA.”
  • “Build a Freshdesk app that shortens the current ticket URL using the Bitly API and displays the shortened link.”

Use these examples as starting points and refine them to suit your specific app scenario.