Skip to main content

Cursor Rules and AI Coding Assistants

Prismatic provides a set of best-practice rules to help AI tools like Cursor generate well-structured, production-ready custom components. These guidelines are designed to reduce the time it takes to build components by steering AI toward consistent, proven patterns that align with Prismatic's SDK.

support for code-native integration development is coming!

While the current rules focus on custom components, we plan to expand support to code-native integrations and additional AI coding environments in the future.

What the rules help with

The Cursor Rules nudge AI agents to adopt the same best practices we follow internally. For example:

  • Logging should use Prismatic's logger: logger.debug(), logger.info(), etc.
  • Configuration values should come inputs and not be embedded directly in code.
  • Errors should be handled gracefully, to give users sufficient information to debug issues.
  • Functions should be clearly named and avoid unnecessary async wrappers or IIFEs.

How to use with Cursor

To enable the rules in Cursor:

  1. Clone or reference the Spectral rule set.
  2. Add it to your project's .spectral.yaml configuration.
  3. Use Cursor to scaffold or update your component code—your AI will be guided to follow the structure Prismatic expects.

Example prompts

Here are two real-world examples of how Cursor can use Prismatic's ruleset and supporting files to accelerate custom component development:

Example 1: Create a new custom connector

Prompt:

Help me create a component that wraps the API @docs.my-messaging-service.com while referencing @start-new-component.md

What Happens:

Cursor uses the linked API docs and start-new-component.md (which outlines how to write a Prismatic component) along with the ruleset to scaffold a new component. It generates a task list (tasks.md) covering all needed actions and connections, which you can review and guide through follow-up prompts like @next-task.md.

Example 2: Add actions to an existing connector

Prompt:

Add a trigger for when a new channel is created

Add a "Get User Details" action

What Happens:

Cursor uses the component-dev.mdc context file to understand how to apply the Prismatic SDK. With your project-specific best practices loaded, the assistant can safely extend an existing component with new triggers or actions—ensuring it aligns with your development standards.