
Pyqt6 Ui Development Rules
- 934 installs
- 36 repo stars
- Updated July 14, 2026
- oimiragieo/agent-studio
pyqt6-ui-development-rules is an agent skill that enforces consistent UI/UX excellence and performance standards for developers creating desktop application interfaces with the PyQt6 Python framework.
About
pyqt6-ui-development-rules is a PyQt6 desktop UI development skill with pre-execute and post-execute hooks for input validation and execution metrics recording. It instructs agents to follow strict UI/UX conventions when building Qt6 widget layouts, signal-slot connections, styling, and performance-optimized rendering in Python desktop apps. The skill has disable-model-invocation set true, requiring explicit agent invocation rather than automatic triggering. Developers reach for pyqt6-ui-development-rules when scaffolding PyQt6 windows, dialogs, or custom widgets and need agent output to meet consistent design system standards—spacing, typography, accessibility patterns, and responsive layout behavior—without manual review of every generated file.
- Enforces UI/UX excellence and performance standards for every PyQt6 component
- Provides specific rules for layout, styling, responsiveness and accessibility
- Guides integration patterns between PyQt6 and backend logic
- Maintains consistency across complex multi-window desktop applications
- Hard-gated rule set that must be followed exactly on every UI file
Pyqt6 Ui Development Rules by the numbers
- 934 all-time installs (skills.sh)
- +28 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #449 of 1,880 Design & UI/UX skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oimiragieo/agent-studio --skill pyqt6-ui-development-rulesAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 934 |
|---|---|
| repo stars | ★ 36 |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 14, 2026 |
| Repository | oimiragieo/agent-studio ↗ |
How do you enforce PyQt6 UI standards in agent code?
Enforce consistent UI/UX excellence and performance standards when creating desktop interfaces with PyQt6.
Who is it for?
Python developers building PyQt6 desktop applications who want agent-generated UI code to meet consistent design and performance standards.
Skip if: Web frontend developers using React or Vue, or mobile developers building Android/iOS native apps instead of Qt desktop.
When should I use this skill?
A developer creates PyQt6 windows, widgets, dialogs, or asks for desktop UI/UX consistency rules in Python Qt projects.
What you get
PyQt6 widget layouts, styled dialogs, and performance-optimized desktop UI modules following enforced UX rules.
- PyQt6 UI modules
- Widget layouts
- Styled dialogs
Files
PyQt6 UI Development Rules Skill
<identity> PyQt6 desktop GUI development specialist enforcing MVC separation, signal/slot architecture, QSS theming, threaded concurrency, and cross-platform rendering best practices. Ensures responsive, accessible, and visually consistent desktop applications. </identity>
<capabilities>
- Design MVC-separated PyQt6 application architecture
- Implement signal/slot communication patterns between UI and business logic
- Configure QSS application-level theming with dark/light mode support
- Manage background operations with QThread, QRunnable, and QThreadPool
- Build responsive layouts using QVBoxLayout, QHBoxLayout, QGridLayout, and QFormLayout
- Implement custom QWidget subclasses with proper paintEvent handling
- Set up cross-platform DPI-aware rendering
- Configure accessibility features (screen reader support, keyboard navigation)
</capabilities>
Overview
This skill enforces rules for building production-quality PyQt6 desktop applications. The core principles are: strict MVC separation via signals/slots, never blocking the UI thread, centralized theming via QSS, and layout-manager-driven responsive design. These rules prevent the most common PyQt6 failures: frozen UIs, untestable coupling, and platform-specific rendering bugs.
When to Use
- When building new PyQt6 desktop applications
- When refactoring existing PyQt/PySide code to PyQt6
- When debugging frozen or unresponsive Qt UIs
- When implementing custom widgets or complex layouts
- When setting up cross-platform desktop application builds
Iron Laws
1. ALWAYS use Qt's signal/slot mechanism for UI-to-logic communication -- direct method calls between UI and business logic layers break MVC separation and cause untestable coupling. 2. NEVER perform long-running operations on the main UI thread -- blocking the Qt event loop makes the interface unresponsive and triggers OS "not responding" dialogs. 3. ALWAYS apply QSS stylesheets at the QApplication level rather than per-widget -- per-widget inline styles create inconsistent themes and unmaintainable styling sprawl. 4. NEVER use absolute pixel coordinates for widget layout -- use Qt layout managers (QVBoxLayout, QHBoxLayout, QGridLayout) to ensure DPI-aware and cross-platform rendering. 5. ALWAYS test the UI on all target platforms before release -- PyQt6 rendering, font scaling, and widget sizing differ between Windows, macOS, and Linux.
Anti-Patterns
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Calling business logic directly from UI slots | Couples UI to logic; makes testing impossible and breaks MVC architecture | Emit signals from UI; connect to controller/service methods via slot |
| Running network or file I/O on the main thread | Blocks the Qt event loop; UI freezes until operation completes | Use QThread, QRunnable, or asyncio with qasync for background operations |
| Hardcoding pixel sizes and positions | Breaks on high-DPI displays and different OS DPI scaling settings | Use layout managers and size policies; use logicalDpiX() for DPI-aware sizing |
| Setting styles inline on individual widgets | Creates visual inconsistency; extremely difficult to theme or maintain | Define a single QSS stylesheet at QApplication level and use object names/classes |
| Ignoring cross-platform rendering differences | Widget sizes, fonts, and margins differ significantly between Windows/macOS/Linux | Test on all target platforms; use platform-conditional logic where rendering diverges |
Workflow
Step 1: Application Architecture (MVC)
# model.py -- Business logic, no Qt dependencies
class DataModel:
def __init__(self):
self._items = []
def add_item(self, item: str) -> bool:
if item and item not in self._items:
self._items.append(item)
return True
return False
# controller.py -- Mediates between Model and View
from PyQt6.QtCore import QObject, pyqtSignal
class Controller(QObject):
items_changed = pyqtSignal(list)
error_occurred = pyqtSignal(str)
def __init__(self, model: DataModel):
super().__init__()
self._model = model
def add_item(self, item: str) -> None:
if self._model.add_item(item):
self.items_changed.emit(self._model._items.copy())
else:
self.error_occurred.emit(f"Could not add: {item}")Step 2: Signal/Slot Wiring
# view.py -- UI only, connects via signals/slots
from PyQt6.QtWidgets import QMainWindow, QVBoxLayout, QWidget, QLineEdit, QPushButton, QListWidget
class MainView(QMainWindow):
def __init__(self, controller: Controller):
super().__init__()
self._controller = controller
# Wire signals to slots
self._controller.items_changed.connect(self._on_items_changed)
self._controller.error_occurred.connect(self._on_error)
# UI emits to controller -- never calls model directly
self._add_btn.clicked.connect(lambda: self._controller.add_item(self._input.text()))
def _on_items_changed(self, items: list) -> None:
self._list.clear()
self._list.addItems(items)Step 3: Background Operations
from PyQt6.QtCore import QThread, pyqtSignal
class WorkerThread(QThread):
progress = pyqtSignal(int)
finished_with_result = pyqtSignal(object)
error = pyqtSignal(str)
def __init__(self, task_fn, parent=None):
super().__init__(parent)
self._task_fn = task_fn
def run(self):
try:
result = self._task_fn(self.progress.emit)
self.finished_with_result.emit(result)
except Exception as e:
self.error.emit(str(e))Step 4: QSS Theming
# Apply at QApplication level
app = QApplication(sys.argv)
app.setStyleSheet(Path("styles/dark-theme.qss").read_text())
# QSS file
"""
QMainWindow {
background-color: #2b2b2b;
color: #e0e0e0;
}
QPushButton {
background-color: #3c3f41;
border: 1px solid #555;
border-radius: 4px;
padding: 6px 16px;
color: #e0e0e0;
}
QPushButton:hover {
background-color: #4c5052;
}
"""Step 5: Layout Management
# Use layout managers -- never setGeometry() or move()
layout = QVBoxLayout()
layout.addWidget(self._toolbar)
layout.addWidget(self._content, stretch=1) # stretch fills available space
layout.addWidget(self._status_bar)
# For responsive grids
grid = QGridLayout()
grid.addWidget(label, 0, 0)
grid.addWidget(input_field, 0, 1)
grid.setColumnStretch(1, 1) # input stretches, label stays fixedComplementary Skills
| Skill | Relationship |
|---|---|
modern-python | Project setup with uv, ruff, ty, pytest |
python-backend-expert | Backend service patterns for desktop app backends |
tdd | Test-driven development for Qt widget testing |
accessibility | Accessibility audit patterns applicable to desktop apps |
Memory Protocol (MANDATORY)
Before starting:
Read .claude/context/memory/learnings.md for prior PyQt6 patterns and platform-specific workarounds.
After completing: Record any platform-specific rendering issues, signal/slot patterns, or QThread gotchas to .claude/context/memory/learnings.md.
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
Invoke the pyqt6-ui-development-rules skill and follow it exactly as presented to you
'use strict';
/**
* Post-execute hook for pyqt6-ui-development-rules
* Auto-generated by enterprise-bundle-scaffolder
*
* Records metrics after skill execution.
*/
function postExecute(_context) {
// Record execution metrics
return { ok: true, skill: 'pyqt6-ui-development-rules' };
}
module.exports = { postExecute };
'use strict';
/**
* Pre-execute hook for pyqt6-ui-development-rules
* Auto-generated by enterprise-bundle-scaffolder
*
* Validates inputs before skill execution.
*/
function preExecute(context) {
// Validate skill invocation context
if (!context || typeof context !== 'object') {
return { allow: true, message: 'pyqt6-ui-development-rules: no context to validate' };
}
return { allow: true };
}
module.exports = { preExecute };
pyqt6-ui-development-rules Research Requirements
Generated: 2026-02-28
Skill Description
Specific rules for PyQt6 based UI development focusing on UI/UX excellence and performance.
Research Areas
- Current best practices for pyqt6-ui-development-rules
- Industry standards and tooling
- Integration patterns
Source References
- To be populated by skill-updater research phase
pyqt6-ui-development-rules Rules
Purpose
Specific rules for PyQt6 based UI development focusing on UI/UX excellence and performance.
Best Practices
- Follow the guidelines consistently
- Apply rules during code review
- Use as reference when writing new code
Integration Points
See SKILL.md for complete documentation.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "pyqt6-ui-development-rulesInput",
"description": "Input schema for Specific rules for PyQt6 based UI development focusing on UI/UX excellence and performance.",
"type": "object",
"additionalProperties": true,
"properties": {
"target": {
"type": "string",
"description": "Target file or path for the skill to operate on"
},
"options": {
"type": "object",
"description": "Additional options for skill execution",
"additionalProperties": true
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "pyqt6-ui-development-rulesOutput",
"type": "object",
"additionalProperties": true,
"properties": {
"ok": {
"type": "boolean"
},
"summary": {
"type": "string"
}
}
}
#!/usr/bin/env node
'use strict';
/**
* pyqt6-ui-development-rules - Enterprise Skill Script
* Auto-generated by enterprise-bundle-scaffolder
*/
const fs = require('fs');
const path = require('path');
// Parse arguments
const args = process.argv.slice(2);
const options = {};
for (let i = 0; i < args.length; i++) {
if (args[i].startsWith('--')) {
const key = args[i].slice(2);
const value = args[i + 1] && !args[i + 1].startsWith('--') ? args[++i] : true;
options[key] = value;
}
}
if (options.help) {
console.log(`
pyqt6-ui-development-rules - Enterprise Skill
Usage:
node main.cjs --check <file> Check a file against guidelines
node main.cjs --list List all guidelines
node main.cjs --help Show this help
Description:
Specific rules for PyQt6 based UI development focusing on UI/UX excellence and performance.
`);
process.exit(0);
}
if (options.list) {
console.log('Guidelines for pyqt6-ui-development-rules:');
console.log('See SKILL.md for full guidelines');
process.exit(0);
}
console.log('pyqt6-ui-development-rules skill loaded. Use with Claude for code review.');
pyqt6-ui-development-rules Implementation Template
Goal
- Define target outcome and acceptance criteria.
TDD
1. Red 2. Green 3. Refactor
Verification
- lint
- format
- targeted tests
Related skills
How it compares
Use pyqt6-ui-development-rules for Qt6 desktop Python apps; choose a web frontend skill for browser-based interfaces.
FAQ
Does pyqt6-ui-development-rules auto-invoke during coding?
pyqt6-ui-development-rules has disable-model-invocation set to true, meaning agents must be explicitly told to invoke the skill. Pre-execute and post-execute hooks validate inputs and record execution metrics.
What UI framework does pyqt6-ui-development-rules target?
pyqt6-ui-development-rules targets PyQt6 desktop application development in Python, enforcing widget layout, signal-slot wiring, styling, and performance standards for native cross-platform GUI applications.
Is Pyqt6 Ui Development Rules safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.