Imported from CloverKG369/Media-Tools (
AGENTS.md). Install upstream withnpx skills add CloverKG369/Media-Tools. Copyright stays with the author.
AGENTS.md — {{PROJECT_NAME}}
Agent System v2.0 for AI-assisted PySide6 Desktop Application Development.
Project Identity
Read .project.json for project-specific values. Replace {{PROJECT_NAME}} and {{PROJECT_EXECUTABLE}} with actual values from that file.
Project Context
- Type: Python Desktop Application
- Framework: PySide6 (Qt6 for Python)
- Python: 3.11+
- Architecture: MVC with Service Layer
Technology Stack
| Category | Technology |
|---|---|
| Language | Python 3.11+ |
| UI Framework | PySide6 (Qt6 for Python) |
| Design System | qt-material (Material Design) |
| Color Palette | Material Design themes (dark_teal, light_teal_500) |
| Automation | DrissionPage + Playwright + playwright-stealth |
| AI (Brain) | llama-cpp-python (Local LLM - Qwen/Phi) |
| Architecture | MVC/MVP with Service Layer |
| Async | asyncio + QThread for background tasks |
| Packaging | PyInstaller / Nuitka |
| Testing | pytest + pytest-qt |
Agent System (13 Agents)
| # | Agent | Domain | Files |
|---|---|---|---|
| 1 | orchestrator |
Multi-agent coordination | Cross-domain |
| 2 | project-planner |
Strategy & architecture | .github/plans/*.md |
| 3 | pyside6-ui-specialist |
qt-material UI | ui/**/*.py |
| 4 | qt-threading-expert |
QThread, workers | Background tasks |
| 5 | python-backend-specialist |
Services, models | services/**/*.py, core/**/*.py |
| 6 | browser-automation-expert |
DrissionPage, Playwright, bots | services/automation/**/*.py |
| 7 | desktop-packaging-pro |
PyInstaller, installers | *.spec, scripts/**/*.py |
| 8 | test-engineer |
pytest, pytest-qt | tests/**/*.py |
| 9 | debugger |
Troubleshooting | All files |
| 10 | performance-optimizer |
Profiling | All files |
| 11 | quality-inspector |
Lint, type check | All files |
| 12 | security-auditor |
Security, credentials | All files |
| 13 | documentation-writer |
Docs, API reference | docs/**/*.md |
Skills Library (39 Skills)
Core Python (8)
python-pro · python-patterns · python-design-patterns · python-code-style · python-type-safety · python-project-structure · python-configuration · async-python-patterns
UI/Desktop (4)
qt-material · qt-signals-slots · qt-threading · pyside6-patterns
Quality (8)
clean-code · code-reviewer · error-handling-patterns · python-anti-patterns · python-testing-patterns · python-error-handling · python-observability · python-resource-management
Architecture (3)
architecture · api-design-principles · i18n-localization
Packaging (2)
desktop-packaging · python-packaging
Security (2)
api-security-best-practices · security-hardening
Automation & AI (3)
drissionpage-patterns · playwright-stealth · llm-integration
Testing (2)
test-driven-development · pytest-qt-patterns
Methodology (4)
systematic-debugging · writing-plans · brainstorming · context-engineering
Other (3)
flat-minimal-ui · ci-cd-desktop · python-performance-optimization
Instructions (8 Files)
| Instruction | ApplyTo | Purpose |
|---|---|---|
python.instructions.md |
**/*.py |
Python 3.11+ standards |
pyside6.instructions.md |
ui/**/*.py |
PySide6 widget patterns |
services.instructions.md |
services/**/*.py |
Service layer patterns |
controllers.instructions.md |
controllers/**/*.py |
Controller patterns |
tests.instructions.md |
tests/**/*.py |
pytest conventions |
core.instructions.md |
core/**/*.py |
Core module patterns |
scripts.instructions.md |
scripts/**/*.py |
Build script patterns |
config.instructions.md |
*.{toml,json,yaml} |
Config file standards |
Core Rules
Threading
- NEVER block main thread
- Use
QThread+Workerpattern for background tasks - Emit signals to update UI from threads
- Use
QTimer.singleShot()instead oftime.sleep()in main thread
Code Style
- Type hints required (Python 3.11+ syntax)
- Use
pathlib.Path, notos.path - Logging via
core.logging_config.get_logger() - Localization via
core.localization.tr() - All code MUST pass Pylint (see
.pylintrc)
qt-material Theming
- Dark theme:
dark_teal.xml(default) - Light theme:
light_teal_500.xml(always withinvert_secondary=True) - Semantic buttons:
setProperty('class', 'danger/warning/success') - Never write full QSS from scratch — use
apply_stylesheet()+extradict - Access theme colors via
os.environ['QTMATERIAL_PRIMARYCOLOR']etc.
Security
- No hardcoded credentials — use OS keyring
- Validate all file paths against traversal
- No
shell=Truein subprocess calls - HTTPS enforced for all external requests
Automation
- Use DrissionPage for simple automation, Playwright + stealth for complex/anti-bot
- Always apply
stealth_async(page)for Playwright - Always add human-like delays
- Implement retry logic with exponential backoff
- Run automation in QThread, never main thread
- Do NOT use Selenium
Forbidden Patterns
| ❌ Don't | ✅ Do Instead |
|---|---|
time.sleep() in main thread |
QTimer.singleShot() or QThread |
| Write full QSS from scratch | apply_stylesheet() from qt-material |
| Hardcode colors in widgets | os.environ['QTMATERIAL_*'] or extra dict |
Forget invert_secondary on light themes |
Always invert_secondary=True |
| Print statements for logging | logger.info/debug/error |
| Hardcoded strings in UI | tr() for localization |
os.path for paths |
pathlib.Path |
| Modify widgets from worker threads | Emit signals to main thread |
| Hardcode API keys/secrets | OS keyring or env vars |
shell=True in subprocess |
List args: ["cmd", "arg"] |
| Selenium | DrissionPage or Playwright + stealth |
File Structure
{{PROJECT_EXECUTABLE}}/
├── main.py # Application entry point
├── .project.json # Project identity
├── requirements.txt # Dependencies
├── controllers/ # MVC Controllers
├── core/ # Config, logging, models
├── services/ # Business logic
│ ├── automation/ # Browser automation
│ ├── downloader/ # Download services
│ ├── license/ # License management
│ └── subtitle/ # Subtitle processing
├── ui/ # User interface
│ ├── main_window.py # Main QMainWindow
│ ├── tabs/ # Tab widgets
│ ├── widgets/ # Reusable widgets
│ ├── dialogs/ # QDialog subclasses
│ └── resources/ # Icons, images
├── tests/ # pytest tests
├── scripts/ # Build & automation scripts
├── bin/ # External binaries
├── docs/ # Documentation
└── .github/
├── agents/ # 13 agent definitions
├── skills/ # 39 skill files
├── instructions/ # 8 instruction files
├── templates/ # Code templates
├── prompts/ # Reusable prompts
└── plans/ # Implementation plans
Quick Commands
# Activate venv first (required)
.\.venv\Scripts\Activate.ps1
# Run application
python main.py
# Run tests
pytest tests/ -v
# Type checking
mypy . --strict
# Lint (Ruff - fast)
ruff check .
ruff format .
# Security audit
pip audit
# Build executable
python scripts/build.py
# Install dependencies
pip install -r requirements.txt
Related Files
.project.json— Edit this first! Project name and executable.pylintrc— Pylint configuration for PySide6.github/copilot-instructions.md— Detailed coding standards.github/agents/README.md— Agent system documentation.github/instructions/— Path-specific rules.github/skills/— Domain knowledge (39 skills).github/plans/analysis-report.md— System analysis report
Version: 2.1.0 | Last updated: 2026-02-10