К основному содержанию
правило

graphical-apps-development-cursorrules-prompt-file — правило

Правило Cursor, которое задаёт агенту контекст проекта Pyllments: графовые LLM-приложения на Python с Panel и Langchain.

Установить в Cursor · Вручную: положить файлы Все способы и платформы ↓
.cursor/rules/graphical-apps-development-cursorrules-prompt-file.mdc
Открыть на GitHub

Что делает graphical-apps-development-cursorrules-prompt-file

Правило описывает Pyllments — библиотеку на Python для графических и API-приложений поверх LLM. Приложение собирается из Elements, связанных в граф, который может быть циклическим. Каждый Element отвечает за свою функцию: один делает вызовы к провайдерам LLM, другой держит интерфейс чата.

Внутри — модель компонентов. Component состоит из Model и Views: Model хранит данные и логику, Views рисуют интерфейс. Связь идёт через порты по паттерну наблюдателя, где выходной порт — субъект, а входной — наблюдатель. Чтобы соединить порты, они должны отправлять и принимать один тип Payload. Файлы элемента лежат в отдельной папке: __init__.py, файлы элемента и модели, плюс css с buttons.css, column.css, input.css.

Стек назван прямо: Panel для слоя визуализации и запуска GUI, Param для параметризованных классов с валидацией типов и реактивностью, Langchain для рабочих процессов с LLM. Docstrings правило требует в стиле NumPy/SciPy. Если вы не пишете на Panel и Param, контекст будет мимо: правило заточено под этот стек, а не под React или Qt.

Какие задачи решает

  • объяснить агенту архитектуру графа из Elements и портов
  • разложить компонент на Model и Views без путаницы
  • связать выходной порт с входным по одному типу Payload
  • собрать файловую структуру элемента с папкой css
  • удержать docstrings в стиле NumPy/SciPy

Примеры запросов агенту

  • Добавь новый Element для выбора модели и подключи его выходной порт к интерфейсу чата
  • Раздели этот компонент на Model и Views, логику вынеси в модель
  • Оформи docstrings в стиле NumPy/SciPy для новых классов

Как установить graphical-apps-development-cursorrules-prompt-file

Вручную: положить файлы

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

Во frontmatter: description, globs, alwaysApply

По шагам, с командами для каждой платформы: Cursor rules: файлы .mdc, четыре режима и замена .cursorrules

Вопросы о graphical-apps-development-cursorrules-prompt-file

Как установить graphical-apps-development-cursorrules-prompt-file в Cursor?

Создайте файл .cursor/rules/graphical-apps-development-cursorrules-prompt-file.mdc в корне проекта и вставьте в него содержимое правила.

Что делает graphical-apps-development-cursorrules-prompt-file?

Задаёт агенту Cursor контекст проекта Pyllments: компоненты из Model и Views, Elements, порты и Payload, а также приоритет модульности и расширяемости.

Какие библиотеки нужны для работы по этому правилу?

Panel для визуализации и запуска GUI, Param для параметризованных классов и реактивности, Langchain для рабочих процессов с LLM.

Исходный текст

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

Похожие правила IDE

Все правила IDE по теме «Фронтенд и UI» →
langchain-development Mindrally Задаёт агенту правила разработки на LangChain и LangGraph: композиция цепочек, агенты, память, RAG. Пригодится, когда проект на Python растёт и код надо держать в одном стиле. CX Codex +1 681установок langchain-python официальный github Правило для GitHub Copilot, которое подсказывает агенту паттерны LangChain: Runnable, LCEL, чат-модели, ретриверы и векторные хранилища. Пригодится, если вы пишете на Python с LangChain. ★ 40 418звёзд репо langchain-architecture Seth Hobson Скилл помогает проектировать LLM-приложения на LangChain 1.x и LangGraph: агентов, память, состояние и вызов инструментов. Нужен для сложных AI-воркфлоу. CX Codex 13 150установок sap-cloud-sdk-ai-python secondsky Подключает пакет sap-ai-sdk-gen к проектам на Python. Помогает обращаться к языковым моделям через SAP AI Core и настраивать оркестрацию запросов. CX Codex +1 545установок langsmith-custom-apps langchain-ai Скилл ведёт через жизненный цикл LangSmith Custom App: инициализация, локальная разработка, пуш и передача исходников наружу. CX Codex +1 398установок autogen-development Mindrally Подсказывает агенту, как писать код на Microsoft AutoGen: создание агентов, групповые чаты, инструменты, оркестрация. CX Codex +1 721установок

Из того же набора68

javascript-chrome-apis-cursorrules-prompt-file Правило для Cursor, которое настраивает ИИ-агента на разработку расширений Chrome: манифест, архитектура, работа с Chrome API. ★ 41 011звёзд репо htmx-go-fiber-cursorrules-prompt-file Правило Cursor для проектов на Go с Fiber и HTMX: задаёт структуру папок, роутинг и работу с шаблонами, чтобы агент не изобретал своё. ★ 41 011звёзд репо htmx-django-cursorrules-prompt-file Правило для Cursor, которое задаёт агенту привычки Django при работе с HTMX: шаблоны, формы, CSRF, class-based views. ★ 41 011звёзд репо how-to-documentation-cursorrules-prompt-file Правило превращает технические шаги, тест-скрипты и скриншоты в пошаговые инструкции для нетехнических пользователей. Пригодится, когда нужно писать «How To» по фиче. ★ 41 011звёзд репо flutter-development-guidelines-cursorrules-prompt-file Задаёт структуру проекта, нейминг и стиль Dart для Flutter-приложений на MVVM с Riverpod. Пригодится, когда агент в Cursor разносит код по папкам как попало. ★ 41 011звёзд репо embedded-stm32-hal Правило для Cursor, которое задаёт агенту рамки при работе с прошивками на C и C++: STM32 HAL, прерывания, DMA, экономия памяти. ★ 41 011звёзд репо dragonruby-best-practices-cursorrules-prompt-file Правило для Cursor, которое задаёт стиль кода на Ruby в DragonRuby Game Toolkit: имена, структура файлов, обработка ошибок. ★ 41 011звёзд репо database Правило для Cursor с набором практик по Prisma и Supabase: схемы, миграции, запросы, RLS-политики. Подключается к файлам базы по маске. ★ 41 011звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой