Token导航 LogoToken导航

Agent Skill · 研究检索

code-analysis(代码分析)

code-analysis 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

code-analysis 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 56,650。

总安装 447周安装 19GitHub Stars 公开资料未说明下载 157核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-analysis(代码分析)
来源仓库:https://github.com/pv-udpv/pplx-sdk
仓库路径:skills/code-analysis
安装命令:
npx skills add https://github.com/pv-udpv/pplx-sdk --skill code-analysis
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pv-udpv/pplx-sdk --skill code-analysis

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

code-analysis 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。适用于根据关键词、任务场景或来源线索进行信息检索和筛选的场景。通过 npx skills add 命令从指定 GitHub 仓库安装并使用。

安装前建议确认权限范围和维护状态,注意可能触发联网或文件读写操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/code-analysis

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/pv-udpv/pplx-sdk --skill code-analysis;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

code-analysis 怎么安装?

在终端执行 npx skills add https://github.com/pv-udpv/pplx-sdk --skill code-analysis。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-analysis 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

code-analysis 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

code-analysis 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

code-analysis 用的人多吗?

公开数据是累计安装 447 次,近一周安装 19 次,下载 157 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

code-analysis 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
code-analysis

代码分析 · 本页

447—需要联网未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Code Analysis — AST, Dependency Graphs & Knowledge Graphs

Parse, analyze, and visualize code structure through AST analysis, dependency graphing, and knowledge extraction. Supports Python (via ast module) and JavaScript/TypeScript (via grep-based import parsing and optional @babel/parser / ts-morph).

When to use

Use this skill when:

  • Building or updating a dependency graph of the codebase
  • Analyzing imports to detect circular dependencies or layer violations
  • Parsing Python AST to extract class hierarchies, function signatures, or call graphs
  • Parsing JavaScript/TypeScript source to extract React component trees, ESM imports, and hook usage
  • Generating a knowledge graph of code entities and their relationships
  • Measuring code complexity (cyclomatic, cognitive, LOC) per module
  • Identifying dead code, unused imports, or orphan modules
  • Mapping how data flows through the SDK layers or SPA component hierarchy
  • Understanding coupling between modules before a refactor
  • Analyzing a SPA's source code structure (component graph, barrel exports, route tree)

Instructions

Step 1: AST Parsing

Parse Python source files to extract structured representations of code entities.

import ast
from pathlib import Path

def parse_module(filepath: str) -> dict:
    """Extract entities from a Python module via AST."""
    source = Path(filepath).read_text()
    tree = ast.parse(source, filename=filepath)

    entities = {
        "module": filepath,
        "classes": [],
        "functions": [],
        "imports": [],
        "constants": [],
    }

    for node in ast.walk(tree):
        if isinstance(node, ast.ClassDef):
            entities["classes"].append({
                "name": node.name,
                "bases": [ast.dump(b) for b in node.bases],
                "methods": [n.name for n in node.body if isinstance(n, (ast.FunctionDef, ast.AsyncFunctionDef))],
                "decorators": [ast.dump(d) for d in node.decorator_list],
                "lineno": node.lineno,
            })
        elif isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
            if not any(isinstance(parent, ast.ClassDef) for parent in ast.walk(tree)):
                entities["functions"].append({
                    "name": node.name,
                    "args": [arg.arg for arg in node.args.args],
                    "returns": ast.dump(node.returns) if node.returns else None,
                    "is_async": isinstance(node, ast.AsyncFunctionDef),
                    "lineno": node.lineno,
                })
        elif isinstance(node, ast.Import):
            for alias in node.names:
                entities["imports"].append({"module": alias.name, "alias": alias.asname})
        elif isinstance(node, ast.ImportFrom):
            entities["imports"].append({
                "module": node.module,
                "names": [alias.name for alias in node.names],
                "level": node.level,
            })

    return entities

Step 2: Dependency Graph Construction

Build a directed graph of module-to-module dependencies.

# Quick import graph using grep
grep -rn "from pplx_sdk" pplx_sdk/ --include="*.py" | \
    awk -F: '{print $1 " -> " $2}' | \
    sed 's|pplx_sdk/||g' | sort -u

# Or using Python AST for precision
python3 -c "
import ast, os, json
graph = {}
for root, dirs, files in os.walk('pplx_sdk'):
    for f in files:
        if f.endswith('.py'):
            path = os.path.join(root, f)
            module = path.replace('/', '.').replace('.py', '')
            tree = ast.parse(open(path).read())
            deps = set()
            for node in ast.walk(tree):
                if isinstance(node, ast.ImportFrom) and node.module:
                    if node.module.startswith('pplx_sdk'):
                        deps.add(node.module)
                elif isinstance(node, ast.Import):
                    for alias in node.names:
                        if alias.name.startswith('pplx_sdk'):
                            deps.add(alias.name)
            if deps:
                graph[module] = sorted(deps)
print(json.dumps(graph, indent=2))
"
Expected Layer Dependencies
graph TD
    subgraph Valid["✅ Valid Dependencies"]
        client --> domain
        client --> transport
        client --> shared
        domain --> transport
        domain --> shared
        domain --> core
        transport --> shared
        transport --> core
        shared --> core
    end

    subgraph Invalid["❌ Layer Violations"]
        core -.->|VIOLATION| shared
        core -.->|VIOLATION| transport
        shared -.->|VIOLATION| transport
        transport -.->|VIOLATION| domain
    end

    style Valid fill:#e8f5e9
    style Invalid fill:#ffebee

Step 3: Knowledge Graph Extraction

Build a knowledge graph connecting code entities with typed relationships.

Entity Types
EntitySourceExample
ModuleFile pathpplx_sdk.transport.sse
ClassAST ClassDefSSETransport, PerplexityClient
FunctionAST FunctionDefstream_ask, retry_with_backoff
Protocoltyping.ProtocolTransport, StreamParser
ExceptionException subclassTransportError, RateLimitError
TypeTypeAliasHeaders, JSONData, Mode
ConstantModule-level assignSSE_ENDPOINT, DEFAULT_TIMEOUT
Relationship Types
RelationshipMeaningExample
IMPORTSModule imports anothertransport.sse IMPORTS core.protocols
DEFINESModule defines entitycore.exceptions DEFINES TransportError
INHERITSClass extends anotherAuthenticationError INHERITS TransportError
IMPLEMENTSClass implements protocolSSETransport IMPLEMENTS Transport
CALLSFunction calls anotherstream_ask CALLS retry_with_backoff
RETURNSFunction returns typestream_ask RETURNS Iterator[StreamChunk]
RAISESFunction raises exceptionrequest RAISES AuthenticationError
USES_TYPEFunction uses type hintrequest USES_TYPE Headers
BELONGS_TOEntity belongs to layerSSETransport BELONGS_TO transport
Knowledge Graph as Mermaid
graph LR
    subgraph core["core/"]
        Transport[/"Transport<br/>(Protocol)"/]
        PerplexitySDKError["PerplexitySDKError"]
        TransportError["TransportError"]
    end

    subgraph transport["transport/"]
        SSETransport["SSETransport"]
        HttpTransport["HttpTransport"]
    end

    subgraph shared["shared/"]
        retry["retry_with_backoff()"]
    end

    SSETransport -->|IMPLEMENTS| Transport
    HttpTransport -->|IMPLEMENTS| Transport
    TransportError -->|INHERITS| PerplexitySDKError
    SSETransport -->|RAISES| TransportError
    HttpTransport -->|CALLS| retry

    style core fill:#e1f5fe
    style transport fill:#fff3e0
    style shared fill:#f3e5f5

Step 4: Code Complexity Analysis

# Lines of code per module
find pplx_sdk -name "*.py" -exec wc -l {} + | sort -n

# Cyclomatic complexity (if radon is available)
pip install radon 2>/dev/null && radon cc pplx_sdk/ -s -a

# Function count per module
grep -c "def " pplx_sdk/**/*.py 2>/dev/null || \
    find pplx_sdk -name "*.py" -exec grep -c "def " {} +

# Class count per module
find pplx_sdk -name "*.py" -exec grep -c "class " {} +

Step 5: Pattern Detection

Detect common patterns and anti-patterns in the codebase:

CheckCommandWhat to Look For
Circular importsAST import graph cycle detectionCycles in the dependency graph
Layer violationsImport direction analysisLower layers importing higher layers
Unused importsruff check --select F401Imports that are never used
Dead codevulture pplx_sdk/ (if available)Functions/classes never called
Missing typesmypy pplx_sdk/ --strictUntyped functions or Any usage
Large functionsAST line count per functionFunctions > 50 lines
Deep nestingAST indent depth analysisNesting > 4 levels
Protocol conformanceCompare class methods vs ProtocolMissing protocol method implementations

Step 6: JavaScript/TypeScript Code Graph (SPA)

When analyzing a SPA codebase (React, Next.js, Vite), build a code graph from JavaScript/TypeScript source files.

Import Graph Extraction
# ESM imports (import ... from '...')
grep -rn "import .* from " src/ --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" | \
    sed "s/:/ → /" | sort -u

# Re-exports / barrel files
grep -rn "export .* from " src/ --include="*.ts" --include="*.tsx" | sort -u

# Dynamic imports (lazy loading / code splitting)
grep -rn "import(" src/ --include="*.ts" --include="*.tsx" | sort -u

# CommonJS requires (legacy)
grep -rn "require(" src/ --include="*.js" | sort -u
React Component Tree
# Find all React components (function components)
grep -rn "export \(default \)\?function \|export const .* = (" src/ --include="*.tsx" --include="*.jsx"

# Find component usage (JSX self-closing or opening tags)
grep -rn "<[A-Z][a-zA-Z]*[\ />\n]" src/ --include="*.tsx" --include="*.jsx" | \
    grep -oP '<[A-Z][a-zA-Z]*' | sort | uniq -c | sort -rn

# Find hooks usage
grep -rn "use[A-Z][a-zA-Z]*(" src/ --include="*.ts" --include="*.tsx" | \
    grep -oP 'use[A-Z][a-zA-Z]*' | sort | uniq -c | sort -rn

# Find context providers
grep -rn "createContext\|\.Provider" src/ --include="*.tsx" --include="*.ts"
Route Tree (Next.js / React Router)
# Next.js App Router pages
find app/ -name "page.tsx" -o -name "page.jsx" -o -name "layout.tsx" 2>/dev/null

# Next.js Pages Router
find pages/ -name "*.tsx" -o -name "*.jsx" 2>/dev/null

# React Router route definitions
grep -rn "Route\|createBrowserRouter\|path:" src/ --include="*.tsx" --include="*.ts"
SPA Dependency Graph as Mermaid
graph TD
    subgraph pages["Pages / Routes"]
        SearchPage["SearchPage"]
        ThreadPage["ThreadPage"]
    end

    subgraph components["Components"]
        SearchBar["SearchBar"]
        ResponseView["ResponseView"]
        SourceCard["SourceCard"]
    end

    subgraph hooks["Hooks"]
        useQuery["useQuery()"]
        useStreaming["useStreaming()"]
        useAuth["useAuth()"]
    end

    subgraph services["Services / API"]
        apiClient["apiClient"]
        sseHandler["sseHandler"]
    end

    SearchPage --> SearchBar
    SearchPage --> useQuery
    ThreadPage --> ResponseView
    ThreadPage --> useStreaming
    ResponseView --> SourceCard
    useQuery --> apiClient
    useStreaming --> sseHandler
    SearchBar --> useAuth

    style pages fill:#e1f5fe
    style components fill:#fff3e0
    style hooks fill:#f3e5f5
    style services fill:#e8f5e9
SPA Entity Types
EntitySourceExample
ComponentFunction returning JSXSearchBar, ResponseView
Hookuse* functionuseQuery, useAuth
ContextcreateContext()AuthContext, ThemeContext
RoutePage/layout file/search, /thread/[id]
ServiceAPI client moduleapiClient, sseHandler
StoreState managementZustand store, Redux slice
TypeTypeScript interface/typeSearchResult, ThreadData
SPA Relationship Types
RelationshipMeaningExample
RENDERSComponent renders anotherSearchPage RENDERS SearchBar
USES_HOOKComponent uses a hookSearchPage USES_HOOK useQuery
PROVIDESComponent provides contextAuthProvider PROVIDES AuthContext
CONSUMESComponent consumes contextSearchBar CONSUMES AuthContext
CALLS_APIHook/service calls API endpointuseQuery CALLS_API /rest/search
IMPORTSModule imports anotherSearchPage IMPORTS SearchBar
LAZY_LOADSDynamic import for code splittingApp LAZY_LOADS SettingsPage
EXTENDS_TYPEType extends anotherThreadResponse EXTENDS_TYPE BaseResponse

Step 7: Output Insights Report

Generate a structured report combining all analyses:

## Code Analysis Report: pplx-sdk

### Module Summary
| Module | Classes | Functions | Lines | Complexity |
|--------|---------|-----------|-------|------------|
| core/protocols.py | 2 | 0 | 45 | A |
| transport/sse.py | 1 | 5 | 180 | B |
| ... | ... | ... | ... | ... |

### SPA Component Summary (when analyzing JS/TS)
| Component | Props | Hooks Used | Children | Lines |
|-----------|-------|------------|----------|-------|
| SearchPage | 2 | useQuery, useAuth | SearchBar, ResultList | 120 |
| ... | ... | ... | ... | ... |

### Dependency Graph
[Mermaid diagram]

### Knowledge Graph
- N entities, M relationships
- [Mermaid diagram]

### Layer Compliance
- ✅ No circular dependencies
- ✅ No upward layer violations
- ⚠️ 2 unused imports detected

### Complexity Hotspots
| Function | Module | CC | Lines | Recommendation |
|----------|--------|----|-------|----------------|
| `_parse_event` | transport/sse.py | 8 | 45 | Consider splitting |

### Dead Code
| Entity | Module | Last Referenced |
|--------|--------|----------------|
| ... | ... | ... |

Documentation Discovery

When analyzing dependencies or researching libraries, use these discovery methods to find LLM-optimized documentation:

llms.txt / llms-full.txt

The llms.txt standard provides LLM-optimized documentation at known URLs:

# Check if a dependency publishes llms.txt
curl -sf https://docs.pydantic.dev/llms.txt | head -20
curl -sf https://www.python-httpx.org/llms.txt | head -20

# Check for the full version (entire docs in one file)
curl -sf https://docs.pydantic.dev/llms-full.txt | head -20

# Use the llms-txt MCP server for indexed search
# Tools: list_llm_txt, get_llm_txt, search_llm_txt

.well-known/agentskills.io

Discover agent skills published by libraries and frameworks:

# Check if a site publishes agent skills
curl -sf https://example.com/.well-known/agentskills.io/skills/ | head -20

# Look for specific SKILL.md files
curl -sf https://example.com/.well-known/agentskills.io/skills/default/SKILL.md

MCP Documentation Servers

MCP ServerPurposeKey Tools
context7Library docs lookupContext-aware search by library name
deepwikiGitHub repo documentationread_wiki_structure, read_wiki_contents, ask_question
llms-txtllms.txt file searchlist_llm_txt, get_llm_txt, search_llm_txt
fetchAny URL as markdownGeneral-purpose URL fetching

Discovery Workflow

1. Check llms.txt at dependency's docs URL
2. Check .well-known/agentskills.io for skills
3. Query deepwiki for the dependency's GitHub repo
4. Query context7 for library-specific context
5. Fall back to fetch for raw documentation URLs

Integration with Other Skills

When code-analysis finds...Delegate to...Action
Layer violationarchitectProduce corrected dependency diagram
Circular importcode-reviewerReview and suggest refactor
Missing protocol methodscaffolderScaffold missing implementation
Dead codecode-reviewerConfirm and remove
High complexitycode-reviewerReview for refactor opportunity
New entity relationshipsarchitectUpdate architecture diagrams
SPA component treespa-expertCross-reference with runtime fiber tree
SPA API endpoints in sourcereverse-engineerValidate against live traffic captures
SPA hook dependenciesarchitectVisualize hook → service → API chain
SPA barrel file cyclescode-reviewerReview circular re-exports

平台分布

Codex

38.45%
按下载量换算60

Claude

27.2%
按下载量换算43

Cursor

17.24%
按下载量换算27

Gemini CLI

10.12%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills