Agent Skills7as0nch/mimo2codex › codebase-analysis

codebase-analysis

GitHub

系统化分析代码库结构、架构及规范,生成CLAUDE.md/AGENTS.md文件,帮助AI代理快速理解项目上下文。适用于用户请求分析项目、创建代理指令或了解代码结构时。

.mimocode/skills/codebase-analysis/SKILL.md 7as0nch/mimo2codex

触发场景

用户要求分析代码库(如analyze this codebase) 用户请求创建CLAUDE.md或AGENTS.md文件 用户希望理解项目结构和约定 用户需要为AI代理创建文档

安装

npx skills add 7as0nch/mimo2codex --skill codebase-analysis -g -y
更多选项

非标准路径

npx skills add https://github.com/7as0nch/mimo2codex/tree/main/.mimocode/skills/codebase-analysis -g -y

不安装直接使用

npx skills use 7as0nch/mimo2codex@codebase-analysis

指定 Agent (Claude Code)

npx skills add 7as0nch/mimo2codex --skill codebase-analysis -a claude-code -g -y

安装 repo 全部 skill

npx skills add 7as0nch/mimo2codex --all -g -y

预览 repo 内 skill

npx skills add 7as0nch/mimo2codex --list

SKILL.md

Frontmatter
{
    "name": "codebase-analysis",
    "description": "Analyze a codebase and create CLAUDE.md\/AGENTS.md files for future AI instances. Use when the user asks to analyze a project, create agent instructions, or understand a codebase structure."
}

Codebase Analysis Skill

Analyze codebases systematically and create comprehensive CLAUDE.md/AGENTS.md files that help future AI instances understand the project.

When to use

Trigger this skill when:

  • User asks "analyze this codebase" / "创建CLAUDE.md" / "create AGENTS.md"
  • User wants to understand a project's structure and conventions
  • User asks to create documentation for AI agents
  • User says "Please analyze this codebase and create a CLAUDE.md file"

Workflow

1. Project Discovery

# List root directory
ls -la

# Check for existing docs
cat README.md
cat package.json
cat go.mod
cat Cargo.toml

# Find source directories
find . -type f -name "*.ts" -o -name "*.js" -o -name "*.go" -o -name "*.py" | head -20

2. Architecture Analysis

Identify:

  • Language(s): TypeScript, Go, Python, etc.
  • Framework(s): React, Express, Gin, etc.
  • Structure: monorepo, single package, microservices
  • Entry points: main files, CLI entry, API routes
  • Key directories: src/, lib/, cmd/, internal/, tests/

3. Codebase Map

Create a mental map of:

  • Core modules and their responsibilities
  • Data flow (API → Service → Database)
  • Configuration files and env vars
  • Build/test/deploy pipeline
  • Dependencies and their purposes

4. Conventions Detection

Look for:

  • Naming: camelCase, snake_case, kebab-case
  • Imports: relative, absolute, barrel files
  • Error handling: try/catch, error boundaries, custom errors
  • Testing: framework, patterns, coverage expectations
  • Git: commit message format, branch naming

5. Create CLAUDE.md / AGENTS.md

Structure the file as:

# [Project Name]

[One-paragraph description]

## Quick Start

[How to run the project]

## Architecture

[High-level structure]

## Key Files

[Important files and their roles]

## Conventions

[Code style, naming, patterns]

## Common Tasks

[How to add features, fix bugs, etc.]

## Environment

[Required env vars, config files]

## Testing

[How to run tests, test conventions]

## Deployment

[How to deploy, CI/CD]

6. Validation

After creating the file:

  • Verify all referenced paths exist
  • Check that commands actually work
  • Ensure examples are accurate
  • Test any code snippets

Example Usage

User: Please analyze this codebase and create a CLAUDE.md file, which will be given to future instances of Codex working on this codebase.

Agent workflow:
1. ls -la (discover project structure)
2. cat package.json / go.mod (identify language/framework)
3. Find key source files
4. Analyze architecture
5. Create comprehensive CLAUDE.md
6. Validate references

Output Format

The CLAUDE.md should be:

  • Concise: 200-500 lines max
  • Actionable: Focus on what agents need to know
  • Accurate: Only include verified information
  • Bilingual: English primary, Chinese comments if helpful

Key Analysis Points

For TypeScript/Node.js Projects

  • Check package.json for scripts, dependencies
  • Look for tsconfig.json configuration
  • Identify build output (dist/, build/)
  • Check for monorepo (lerna, nx, turborepo)

For Go Projects

  • Check go.mod for module name and dependencies
  • Look for cmd/ directory structure
  • Identify internal packages
  • Check for Makefile or build scripts

For Python Projects

  • Check pyproject.toml or setup.py
  • Look for requirements.txt or poetry.lock
  • Identify package structure
  • Check for virtual environments

Don't Use This Skill For

  • Modifying code (use other skills)
  • Deploying (use deployment workflows)
  • PR review (use pr-review skill)
  • Issue investigation (use issue-investigation skill)

版本历史

  • 5cb6f5c 当前 2026-07-24 12:23

同 Skill 集合

.mimocode/skills/issue-investigation/SKILL.md
.mimocode/skills/pr-review/SKILL.md
.mimocode/skills/provider-config/SKILL.md

元信息

文件数
0
版本
5cb6f5c
Hash
96364d6c
收录时间
2026-07-24 12:23

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-07 17:15
浙ICP备14020137号-1 $访客地图$