360 Secure SkillHub
360 安全技能中心

CodeByteLens — 代码智能分析镜

该 Skill 通过 python3 脚本对 Python 文件或目录做静态代码分析:列出文件符号、按名称搜索定义、生成函数调用图并输出复杂度报告。使用 ripgrep 做正则搜索、pyright 做 Python 类型检查、AST 解析做结构分析,无需 LSP 服务器,前提是安装 pyright。

lxr-666
lxr-666
热度 16.02
最近更新 2026-06-22 07:24:36
分类:开发依赖:代码执行 / 读写文件应用场景:代码审查 / 调试排错

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add codebytelens
Metadata
name
codebytelens
description
代码智能分析工具箱。受 Claude Code LSPTool 设计模式启发,但使用 100% 开源工具:ripgrep (搜索)、pyright (Python 类型检查)、tree-sitter (AST 解析)。不需要 LSP 服务器,开箱即用。
metadata
{"openclaw":{"emoji":"🔬","requires":{"bins":["python3"]}}}

OpenClaw Code Intel 🔬

灵感来自 Claude Code 的 LSP 代码智能架构,实现完全原创。 使用标准开源工具:ripgrep、pyright、AST 解析。

功能

操作 Claude Code LSPTool OpenClaw Code Intel
搜索定义 textDocument/definition ripgrep + 正则模式匹配
查找引用 textDocument/references ripgrep 全局搜索
符号列表 documentSymbol AST 解析 (Python)
类型检查 hover (类型信息) pyright 类型检查
调用图 callHierarchy 静态分析 (import/function graph)

前提

# 安装依赖
pip install pyright  # Python 类型检查

使用方式

# 分析 Python 文件结构
python3 {{SKILL_DIR}}/scripts/analyze.py symbols path/to/file.py

# 搜索定义
python3 {{SKILL_DIR}}/scripts/analyze.py define "ClassName.method" path/to/

# 生成函数调用图
python3 {{SKILL_DIR}}/scripts/analyze.py calls path/to/file.py

# 代码复杂度报告
python3 {{SKILL_DIR}}/scripts/analyze.py complexity path/to/file.py