Skip to main content
rule

graphical-apps-development-cursorrules-prompt-file — Cursor rule

A Cursor rule that feeds the agent the Pyllments context: graph-based LLM apps in Python built on Panel and Langchain.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/graphical-apps-development-cursorrules-prompt-file.mdc
Open on GitHub

What graphical-apps-development-cursorrules-prompt-file does

The rule lays out Pyllments, a Python library for graphical and API-based LLM applications. An app is a graph of Elements, and the graph can be cyclic. Each Element covers one job: one handles LLM selection and generation, another owns the chat interface.

The component model is the core. A Component pairs a Model with Views — the Model holds data and logic, the Views render the interactive UI. Elements connect through Ports using an observer pattern, where the output port is the subject and the input port is the observer. Ports only link when they send and receive the same Payload type. A single element lives in its own folder: __init__.py, the element and model files, and a css directory with buttons.css, column.css, input.css.

The stack is named outright: Panel for the visualization layer and running the GUI, Param for parameterized classes with type validation and reactivity, Langchain for LLM workflows. Docstrings follow NumPy/SciPy style. If your project is not built on Panel and Param, this context will not match — the rule assumes that stack, not React or Qt.

What it helps with

  • explain the Element-and-port graph to the agent
  • split a component into Model and Views cleanly
  • wire an output port to an input port over one Payload type
  • lay out an element folder with its css directory
  • keep docstrings in NumPy/SciPy style

Example prompts for the agent

  • Add a new Element for model selection and connect its output port to the chat interface
  • Split this component into Model and Views, move the logic into the model
  • Write NumPy/SciPy style docstrings for the new classes

How to install graphical-apps-development-cursorrules-prompt-file

Manually: put the files in place

.cursor/rules/graphical-apps-development-cursorrules-prompt-file.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about graphical-apps-development-cursorrules-prompt-file

How do I install graphical-apps-development-cursorrules-prompt-file in Cursor?

Create .cursor/rules/graphical-apps-development-cursorrules-prompt-file.mdc in your project root and paste the rule contents into it.

What does graphical-apps-development-cursorrules-prompt-file do?

It gives the Cursor agent the Pyllments context: components built from Model and Views, Elements, ports and Payloads, with modularity and extensibility as priorities.

Which libraries does this rule assume?

Panel for the visualization layer and GUI, Param for parameterized classes and reactivity, and Langchain for LLM workflows.

Source text

graphical-apps-development-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for graphical apps development with integration."
globs: **/*
alwaysApply: false
---
# Project Synopsis

Pyllments is a Python library for building graphical and API-based LLM applications through chaining together Elements in a potentially cyclic graph. Elements and Payloads are a type of Components. A Component is composed of a Model and Views. The Model handles the underlying data and logic, while the Views are the UI components that are used to display display the interactive UI used to interact with the Model.

An Element is a type of Component that is responsible for a specific function. For instance, an Element can handle the LLM selection and generation by making calls to LLM providers. Another Element may handle the chat interface, whose Model would store the chat message history, and the Views would be the text boxes and buttons used to interact with the chat interface. Elements are meant to connect to other Elements through Ports. All that is necessary to link Elements together is to link the output port of one Element to the input port of Another. Each output port may have unlimited input ports it connects to, and each input port may have unlimited output ports it connects to. The ports follow an observer pattern where the output port is the subject and the input port is the observer. The subject notifies the observers when a certain event that we set within the Element is triggered.

In order to connect an input and and output port, they need to be setup in a manner that sends and receives the same type of Payload. A Payload is also a Component with a Model as well as views responsible for the display logic. Elements may receive payloads and use methods of the Payload to generate the views for the UI. The sending Element is responsible for packing data into the Payload.

I am currently working on making this a fully-fledged framework.

# Project Organization

Here is an example of the file structure of an individual element:

chat_interface:
  - __init__.py
  - chat_interface_element.py
  - chat_interface_model.py
  - css:
    - buttons.css
    - column.css
    - input.css

# Primary Libraries Used

- Panel is used to create the visualization layer and run the GUI. Views tend to consist of Panel objects which can be styled with Python and CSS.
- Param is used to create parameterized classes which help create parameters that handle type validation, default values, constraints, and most importantly, reactivity(setting event handlers to catch changes).
- Langchain is responsible for the specific functions pertaining to incorporating LLM workflows.

# Development Priorities

Pyllments code is prioritized on being developer-friendly, where extensibility and modularity are first-class citizens. Elements should be customizeable with clean and intuitive interfaces. It should also be easy to create new elements depending on the needs of the developer.

# Documentation

Docstrings should use a NumPy/SciPy style.

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set68

javascript-chrome-apis-cursorrules-prompt-file A Cursor rule that points the AI agent at Chrome extension work: manifest, architecture, Chrome API usage. ★ 41,011repo stars htmx-go-fiber-cursorrules-prompt-file A Cursor rule for Go projects built on Fiber with HTMX: it pins down folder layout, routing and template rendering so the agent stops improvising. ★ 41,011repo stars htmx-django-cursorrules-prompt-file A Cursor rule that keeps the agent on Django rails while it writes HTMX code: templates, forms, CSRF, class-based views. ★ 41,011repo stars how-to-documentation-cursorrules-prompt-file A Cursor rule that turns technical steps, test scripts and screenshots into step-by-step guides for non-technical users. Useful when you write How To docs for a feature. ★ 41,011repo stars flutter-development-guidelines-cursorrules-prompt-file Locks down folder layout, naming and Dart style for Flutter apps built on MVVM with Riverpod. Useful when the agent scatters files across the project. ★ 41,011repo stars embedded-stm32-hal A Cursor rule that keeps the agent inside embedded C/C++ conventions: STM32 HAL, interrupts, DMA and tight memory budgets. ★ 41,011repo stars dragonruby-best-practices-cursorrules-prompt-file A Cursor rule that sets Ruby coding style for DragonRuby Game Toolkit: naming, file structure, error handling. ★ 41,011repo stars database A Cursor rule with database practices for Prisma and Supabase: schemas, migrations, queries, RLS policies. Scoped to database files by glob. ★ 41,011repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor