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.
.cursor/rules/graphical-apps-development-cursorrules-prompt-file.mdcWhat 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.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/graphical-apps-development-cursorrules-prompt-file.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/graphical-apps-development-cursorrules-prompt-file.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/graphical-apps-development-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/graphical-apps-development-cursorrules-prompt-file.mdStep 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