Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计通过

source-code-analysis源码分析

Agent Skill

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

总安装

7,103

周安装

302

GitHub Stars

1

下载量

2,488
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install source-code-analysis

简介

source-code-analysis 帮助用户理解指定代码库结构、逻辑与关键技术选型。

  • 适用于新项目调研、遗留系统接手或架构评审等开发协作场景。
  • 输入可为目标仓库 URL 或本地路径,输出为简明分析报告。
  • 分析深度取决于代码复杂度,超大型项目可能需分模块处理。
  • 涉及闭源商业软件时请勿尝试逆向工程,尊重知识产权法律法规。

SKILL.md

name
source-code-analysis
description
This skill should be used when the user asks to "analyze source code", "understand this codebase", "perform code analysis", "study this project", "explain this repository", or discusses source code learning, codebase comprehension, open source project analysis, understanding software architecture, or learning from existing code.
version
1.0.0

Source Code Analysis

This skill provides a systematic 7-step methodology for analyzing and understanding source code repositories. It helps developers efficiently comprehend complex codebases by focusing on high-value content and following a structured approach.

Core Methodology

The 7-Step Analysis Process

  1. Build Global Cognition

- Create a mental map before diving into details - Understand project structure, directory organization, and code distribution - Identify main entry points and startup sequences - Recognize architectural patterns from directory structure

  1. Trace Core Pathways

- Follow complete functional chains end-to-end - Track user requests from input to output - Understand data flow and transformation through the system - Map key call chains and interaction patterns

  1. Understand Design Decisions

- Comprehend design rationale and architectural trade-offs - Identify key design patterns and abstractions - Learn why certain technical choices were made - Understand extension mechanisms and plugin systems

  1. Examine Engineering Practices

- Focus on production code realities, not ideals - Study error handling and edge case patches - Learn from code comments and engineering wisdom - Understand technical debt as conscious choices

  1. Running Analysis

- Validate understanding through actual execution - Analyze build, test, and deployment processes - Verify assumptions by running code - Use debugging tools to observe runtime behavior

  1. Identify Core 20%

- Focus on high-value paths, not all files equally - Prioritize startup entries, core logic, extension mechanisms - Identify configuration management and state management systems - Map external interaction boundaries

  1. Feature Deep-Dive

- Use specific features to understand the broader system - Trace implementation details of key functionality - Expand understanding outward from focused points - Follow one thread through the entire system

When This Skill Applies

This skill activates when the user's request involves:

  • Analyzing unfamiliar codebases
  • Understanding open source projects
  • Learning from existing software architecture
  • Planning contributions to open source
  • Evaluating technologies and frameworks
  • Studying design patterns and implementation
  • Comprehending complex software systems

Analysis Approach

Before Starting

Always ask clarifying questions:

  1. What is your goal? Learning, contributing, evaluating, or fixing?
  2. What's your experience level? Beginner, intermediate, or advanced?
  3. What specifically interests you? Architecture, features, patterns, or practices?
  4. How deep should the analysis go? Overview, standard, deep, or comprehensive?

During Analysis

Follow this systematic approach:

  1. Start with questions before code

- What problem does this project solve? - Who are the users/clients of this code? - What are the core concepts and terminology?

  1. Establish global cognition first

- Read README and documentation - Examine directory structure - Identify main entry points - Map module organization - Understand technology stack

  1. Trace one complete pathway

- Choose a user-visible feature - Follow it from input to output - Document key files and functions - Understand data transformation - Map module interactions

  1. Understand design decisions

- Question "why" not just "what" - Identify trade-offs and constraints - Understand extension mechanisms - Learn architectural patterns

  1. Study engineering practices

- Look for error handling patterns - Find performance optimizations - Read valuable comments - Understand testing approach

Output Format

Structure your analysis with these sections:

1. Executive Summary

  • Project purpose and core functionality
  • Key technologies and patterns
  • Overall architecture style
  • Main findings and recommendations

2. Global Cognition Report

## Project Overview
- **Core Goal**: [What problem it solves]
- **Main Features**: [Key functionality]
- **Technology Stack**: [Languages, frameworks, tools]
- **Code Scale**: [Size metrics]

## Architecture Analysis
- **Architecture Pattern**: [Identified pattern]
- **Directory Organization**: [Structure analysis]
- **Module Boundaries**: [Main modules and responsibilities]
- **Entry Points**: [Startup and initialization]

3. Core Pathways

## Feature: [Feature Name]
### Entry Point
- File: [path/to/file.ts:line-number]
- Function: [functionName()]

### Execution Flow
1. [Step 1] → [file:line]
2. [Step 2] → [file:line]
3. [Step 3] → [file:line]

### Data Flow
[Diagram or description of data transformation]

4. Design Insights

## Key Design Decisions

### [Decision Name]
- **What**: [Description]
- **Why**: [Rationale]
- **Trade-offs**: [Considerations]
- **Alternatives considered**: [Other options]

5. Engineering Practices

## Production Realities

### Error Handling
[Patterns and approaches found]

### Performance Optimizations
[Techniques and their rationale]

### Code Quality Practices
[Testing, documentation, standards]

6. High-Value Files (The 20%)

## Priority Reading List

1. **[file-path]** - [Why it's critical]
2. **[file-path]** - [Why it's critical]
3. **[file-path]** - [Why it's critical]
...

7. Learning Recommendations

## For [Beginner|Intermediate|Advanced] Learners

### Recommended Path
1. [Stage 1]: [Goal] → [Files to read]
2. [Stage 2]: [Goal] → [Files to read]
3. [Stage 3]: [Goal] → [Files to read]

### Practice Suggestions
[Specific exercises and projects]

Best Practices

For Analysts

  • Question-driven: Always have specific questions before diving in
  • Progressive depth: Start broad, then go deep selectively
  • Validation: Run code to verify understanding
  • Documentation: Take notes and document findings
  • Focus: Avoid getting lost in details; stay on high-value paths

Common Mistakes to Avoid

  • Starting at random: Don't just open files and read linearly
  • Equal attention: Not all files deserve equal study time
  • Missing the forest: Don't get lost in trees; maintain global view
  • Static-only: Don't just read; run and observe
  • Syntax over semantics: Focus on design, not just code structure

High-Value Indicators

Prioritize files that are:

  • Entry points (main, index, app, server)
  • Core logic (engine, core, kernel, handler)
  • Extension mechanisms (plugin, adapter, strategy)
  • Configuration (config, settings, options)
  • State management (store, state, context, session)
  • External interfaces (api, client, driver, protocol)

Lower priority:

  • Tests (unless understanding behavior)
  • Build tools (unless deployment focus)
  • Documentation (already in README)
  • Utility functions (use on-demand basis)

Example Analyses

Quick Overview Mode

"Give me a quick overview of the Next.js codebase focusing on
the routing system and server components"

Deep Feature Analysis

"Trace the complete implementation of React's useState hook,
including the fiber architecture integration and scheduler coordination"

Design Philosophy

"Analyze the design decisions in Go's standard library,
focusing on error handling philosophy and interface design"

Learning Path Creation

"Create a learning path for an intermediate developer to
understand the TypeScript compiler, focusing on the type checking system"

Integration with Other Tools

This skill works well with:

  • Read tool: For examining file contents
  • Grep tool: For finding patterns and usage
  • Glob tool: For discovering file organization
  • Explore agent: For parallel codebase investigation
  • Plan agent: For architectural analysis

Notes

  • This methodology is based on proven approaches for understanding complex software systems
  • The 20% rule comes from the observation that a small percentage of files contain most architectural insight
  • Progressive understanding prevents getting overwhelmed by large codebases
  • Question-driven analysis ensures relevance and efficiency
  • Running code validates theoretical understanding

Version: 1.0.0 Methodology: 7-Step Source Code Analysis Framework Target Users: Developers learning new codebases, open source contributors, technical leads, software engineering students

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

73.4%
按下载量换算1,826

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills