{
  "schemaVersion": "1.0",
  "item": {
    "slug": "lsp-python",
    "name": "LSP Python",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/genify/lsp-python",
    "canonicalUrl": "https://clawhub.ai/genify/lsp-python",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/lsp-python",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=lsp-python",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/lsp-protocol.md",
      "references/pep8-guide.md",
      "references/pylsp-config.md",
      "scripts/check_python.py",
      "scripts/lsp-python.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/lsp-python"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/lsp-python",
    "agentPageUrl": "https://openagent3.xyz/skills/lsp-python/agent",
    "manifestUrl": "https://openagent3.xyz/skills/lsp-python/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/lsp-python/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "LSP Python 技能",
        "body": "使用 Python Language Server Protocol (LSP) 进行代码质量检查和智能分析。"
      },
      {
        "title": "1. 检查代码问题",
        "body": "# 单个文件\npython3 scripts/lsp-service.py check <文件路径>\n\n# 批量检查 (推荐)\npython3 scripts/check_python.py <文件或目录>\n\n# 批量检查并自动修复\npython3 scripts/check_python.py --auto-fix <文件或目录>\n\n示例:\n\npython3 scripts/lsp-service.py check my_script.py\npython3 scripts/check_python.py src/\npython3 scripts/check_python.py --auto-fix src/"
      },
      {
        "title": "2. 获取代码补全",
        "body": "python3 scripts/lsp-service.py complete <文件> <行号> <字符位置>"
      },
      {
        "title": "3. 查看符号信息",
        "body": "python3 scripts/lsp-service.py info <文件> <行号> <字符位置>"
      },
      {
        "title": "依赖",
        "body": "Python 3.x\npylsp: pip install python-lsp-server\n可选插件:\n\npip install python-lsp-server[all] - 完整插件集\npip install pylsp-mypy - 类型检查\npip install pylsp-black - black 格式化"
      },
      {
        "title": "代码诊断 (check)",
        "body": "检查 Python 文件中的错误和警告:\n\npyflakes - 代码错误检测 (未使用导入、未定义变量等)\npycodestyle - PEP8 风格检查 (格式、行长、空白等)\n\n输出示例:\n\n⚠️ 第 3 行 [pyflakes]: 'os' imported but unused\n⚠️ 第 6 行 [pycodestyle]: E302 expected 2 blank lines, found 1\n✅ 没有发现问题"
      },
      {
        "title": "代码补全 (complete)",
        "body": "获取指定位置的代码补全建议:\n\npython3 scripts/lsp-service.py complete script.py 5 10\n\n输出:\n\n补全建议:\n  • json (模块)\n  • jsonpatch (模块)\n  • requests (模块)"
      },
      {
        "title": "悬停提示 (info)",
        "body": "查看函数签名、文档字符串等信息:\n\npython3 scripts/lsp-service.py info script.py 10 5"
      },
      {
        "title": "跳转定义 (goto)",
        "body": "查找符号的定义位置:\n\npython3 scripts/lsp-service.py goto script.py 15 10"
      },
      {
        "title": "清理未使用的导入",
        "body": "pip install autoflake\nautoflake --remove-all-unused-imports --in-place --recursive ."
      },
      {
        "title": "格式化代码",
        "body": "pip install black\nblack ."
      },
      {
        "title": "完整修复流程",
        "body": "# 1. 备份\ncp -r project/ project.backup\n\n# 2. 清理导入\nautoflake --remove-all-unused-imports --in-place --recursive project/\n\n# 3. 格式化\nblack project/\n\n# 4. 验证\npython3 scripts/lsp-service.py check project/main.py"
      },
      {
        "title": "诊断严重性级别",
        "body": "级别代码含义❌1Error (错误)⚠️2Warning (警告)ℹ️3Information (信息)💡4Hint (提示)"
      },
      {
        "title": "常见问题代码",
        "body": "代码含义修复方法E402导入不在文件顶部移动导入到文件开头E501行太长 (>79 字符)拆分长行或使用括号W293空行包含空白字符删除行尾空格E302缺少空行函数/类定义前加 2 个空行E712布尔比较风格if x is True → if x"
      },
      {
        "title": "在 OpenClaw 中使用",
        "body": "exec: python3 /path/to/lsp-python/scripts/lsp-service.py check <file>"
      },
      {
        "title": "批量检查项目",
        "body": "# 检查所有 Python 文件\nfind . -name \"*.py\" -exec python3 scripts/lsp-service.py check {} \\;\n\n# 仅显示有问题的文件\nfor f in $(find . -name \"*.py\"); do\n  result=$(python3 scripts/lsp-service.py check \"$f\" 2>&1)\n  if ! echo \"$result\" | grep -q \"✅ 没有发现问题\"; then\n    echo \"=== $f ===\"\n    echo \"$result\"\n  fi\ndone"
      },
      {
        "title": "参考资料",
        "body": "LSP 协议详解: 见 references/lsp-protocol.md\npylsp 配置: 见 references/pylsp-config.md\n代码风格指南: 见 references/pep8-guide.md"
      },
      {
        "title": "pylsp 无法启动",
        "body": "# 检查安装\nwhich pylsp\npylsp --version\n\n# 重新安装\npip install --upgrade python-lsp-server"
      },
      {
        "title": "检查超时",
        "body": "增加脚本中的 LSP_TIMEOUT 值 (默认 10 秒)。"
      },
      {
        "title": "中文字符问题",
        "body": "确保文件使用 UTF-8 编码，脚本已设置 ensure_ascii=False。"
      }
    ],
    "body": "LSP Python 技能\n\n使用 Python Language Server Protocol (LSP) 进行代码质量检查和智能分析。\n\n快速开始\n1. 检查代码问题\n# 单个文件\npython3 scripts/lsp-service.py check <文件路径>\n\n# 批量检查 (推荐)\npython3 scripts/check_python.py <文件或目录>\n\n# 批量检查并自动修复\npython3 scripts/check_python.py --auto-fix <文件或目录>\n\n\n示例:\n\npython3 scripts/lsp-service.py check my_script.py\npython3 scripts/check_python.py src/\npython3 scripts/check_python.py --auto-fix src/\n\n2. 获取代码补全\npython3 scripts/lsp-service.py complete <文件> <行号> <字符位置>\n\n3. 查看符号信息\npython3 scripts/lsp-service.py info <文件> <行号> <字符位置>\n\n依赖\nPython 3.x\npylsp: pip install python-lsp-server\n可选插件:\npip install python-lsp-server[all] - 完整插件集\npip install pylsp-mypy - 类型检查\npip install pylsp-black - black 格式化\n核心功能\n代码诊断 (check)\n\n检查 Python 文件中的错误和警告:\n\npyflakes - 代码错误检测 (未使用导入、未定义变量等)\npycodestyle - PEP8 风格检查 (格式、行长、空白等)\n\n输出示例:\n\n⚠️ 第 3 行 [pyflakes]: 'os' imported but unused\n⚠️ 第 6 行 [pycodestyle]: E302 expected 2 blank lines, found 1\n✅ 没有发现问题\n\n代码补全 (complete)\n\n获取指定位置的代码补全建议:\n\npython3 scripts/lsp-service.py complete script.py 5 10\n\n\n输出:\n\n补全建议:\n  • json (模块)\n  • jsonpatch (模块)\n  • requests (模块)\n\n悬停提示 (info)\n\n查看函数签名、文档字符串等信息:\n\npython3 scripts/lsp-service.py info script.py 10 5\n\n跳转定义 (goto)\n\n查找符号的定义位置:\n\npython3 scripts/lsp-service.py goto script.py 15 10\n\n自动修复代码问题\n清理未使用的导入\npip install autoflake\nautoflake --remove-all-unused-imports --in-place --recursive .\n\n格式化代码\npip install black\nblack .\n\n完整修复流程\n# 1. 备份\ncp -r project/ project.backup\n\n# 2. 清理导入\nautoflake --remove-all-unused-imports --in-place --recursive project/\n\n# 3. 格式化\nblack project/\n\n# 4. 验证\npython3 scripts/lsp-service.py check project/main.py\n\n诊断严重性级别\n级别\t代码\t含义\n❌\t1\tError (错误)\n⚠️\t2\tWarning (警告)\nℹ️\t3\tInformation (信息)\n💡\t4\tHint (提示)\n常见问题代码\n代码\t含义\t修复方法\nE402\t导入不在文件顶部\t移动导入到文件开头\nE501\t行太长 (>79 字符)\t拆分长行或使用括号\nW293\t空行包含空白字符\t删除行尾空格\nE302\t缺少空行\t函数/类定义前加 2 个空行\nE712\t布尔比较风格\tif x is True → if x\n在 OpenClaw 中使用\nexec: python3 /path/to/lsp-python/scripts/lsp-service.py check <file>\n\n批量检查项目\n# 检查所有 Python 文件\nfind . -name \"*.py\" -exec python3 scripts/lsp-service.py check {} \\;\n\n# 仅显示有问题的文件\nfor f in $(find . -name \"*.py\"); do\n  result=$(python3 scripts/lsp-service.py check \"$f\" 2>&1)\n  if ! echo \"$result\" | grep -q \"✅ 没有发现问题\"; then\n    echo \"=== $f ===\"\n    echo \"$result\"\n  fi\ndone\n\n参考资料\nLSP 协议详解: 见 references/lsp-protocol.md\npylsp 配置: 见 references/pylsp-config.md\n代码风格指南: 见 references/pep8-guide.md\n故障排除\npylsp 无法启动\n# 检查安装\nwhich pylsp\npylsp --version\n\n# 重新安装\npip install --upgrade python-lsp-server\n\n检查超时\n\n增加脚本中的 LSP_TIMEOUT 值 (默认 10 秒)。\n\n中文字符问题\n\n确保文件使用 UTF-8 编码，脚本已设置 ensure_ascii=False。"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/genify/lsp-python",
    "publisherUrl": "https://clawhub.ai/genify/lsp-python",
    "owner": "genify",
    "version": "1.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/lsp-python",
    "downloadUrl": "https://openagent3.xyz/downloads/lsp-python",
    "agentUrl": "https://openagent3.xyz/skills/lsp-python/agent",
    "manifestUrl": "https://openagent3.xyz/skills/lsp-python/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/lsp-python/agent.md"
  }
}