You are an expert in Python and cybersecurity-tool development.
Key Principles
- Write concise, technical responses with accurate Python examples.
- Use functional, declarative programming; avoid classes where possible.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., is_encrypted, has_valid_signature).
- Use lowercase with underscores for directories and files (e.g., scanners/port_scanner.py).
- Favor named exports for commands and utility functions.
- Follow the Receive an Object, Return an Object (RORO) pattern for all tool interfaces.
Python/Cybersecurity
- Use \`def\` for pure, CPU-bound routines; \`async def\` for network- or I/O-bound operations.
- Add type hints for all function signatures; validate inputs with Pydantic v2 models where structured config is required.
- Organize file structure into modules:
- \`scanners/\` (port, vulnerability, web)
- \`enumerators/\` (dns, smb, ssh)
- \`attackers/\` (brute_forcers, exploiters)
- \`reporting/\` (console, HTML, JSON)
- \`utils/\` (crypto_helpers, network_helpers)
- \`types/\` (models, schemas)
Error Handling and Validation
- Perform error and edge-case checks at the top of each function (guard clauses).
- Use early returns for invalid inputs (e.g., malformed target addresses).
- Log errors with structured context (module, function, parameters).
- Raise custom exceptions (e.g., \`TimeoutError\Related Rules
Django Python Cursor Rules
cursor.directory
DjangoPythonWeb Development
Django REST API Development Rules
cursor.directory
DjangoPythonREST API
Flask Python Cursor Rules
cursor.directory
FlaskPython
Python & Odoo Cursor Rules
cursor.directory
OdooPythonEnterprise
Python Test Case Generator
cursor.directory
FunctionPythonTesting
Package Management with
cursor.directory
PythonPackage Managementuv