lsp-python
Python code quality checking and LSP integration using pylsp. Provides code diagnostics, completion, hover tips, and style analysis. Use when: checking Python errors/warnings, getting code completions, viewing function signatures, analyzing code quality, or fixing style issues.
Why use this skill?
Enhance your Python development with the lsp-python skill. Get real-time diagnostics, PEP8 linting, code completions, and automated style fixes in OpenClaw.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/genify/lsp-pythonWhat This Skill Does
The lsp-python skill acts as a comprehensive Python intelligence engine for OpenClaw. By leveraging the Python Language Server Protocol (pylsp), it provides deep static analysis and development assistance directly within your agent workflow. It performs real-time code diagnostics to catch errors (via pyflakes) and enforces stylistic standards (via pycodestyle), effectively functioning as an automated pair programmer that scans for bugs, unused imports, PEP8 violations, and structural issues. Beyond mere linting, the skill offers intelligent code completion, function signature lookups, and symbol definition navigation, ensuring that your Python codebases remain clean, consistent, and error-free.
Installation
To integrate this skill, use the ClawHub manager. Ensure you have Python 3.x installed on your environment before running the installation command:
clawhub install openclaw/skills/skills/genify/lsp-python
After installation, verify your environment with which pylsp. For a full-featured experience, it is highly recommended to install the expanded plugin suite: pip install python-lsp-server[all]. You may also install pylsp-mypy for static type checking and pylsp-black for automated code formatting.
Use Cases
- Code Audits: Quickly identify syntax errors, undefined variables, or dead code in legacy scripts.
- Style Enforcement: Automate the correction of whitespace, line length, and import ordering to match industry-standard PEP8 guidelines.
- Feature Development: Utilize completion and hover tips to explore library functions, see parameter requirements, and understand existing code structures.
- Refactoring: Use the 'goto' capability to safely navigate through large codebases, ensuring changes are made in the correct definitions.
Example Prompts
- "Analyze the current project folder and report all PEP8 style violations along with a summary of potential bugs."
- "What are the arguments for the
requests.getfunction? Please provide a summary of its documentation and expected input types." - "Check the script named
data_processor.pyfor errors and automatically fix any formatting issues found using the available tools."
Tips & Limitations
- Timeout Handling: Large projects may trigger a timeout during analysis. Adjust the
LSP_TIMEOUTvariable in thelsp-service.pyscript if you encounter connectivity delays. - Environment Consistency: Always run the tool within the same virtual environment where your project dependencies are installed to ensure the LSP correctly resolves third-party module imports.
- Formatting: While
blackis excellent for formatting, always backup your files before running--auto-fixoperations to prevent irreversible structural changes.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-genify-lsp-python": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution