Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

codebase-analysis代码库分析

Agent Skill

用于辅助提示词、系统指令、Agent 行为约束和工作流模板的整理。它适合让 Agent 规范任务边界、统一输出格式、拆分操作步骤或优化提示词可复用性。使用时需要保留真实业务约束,不要把示例当硬规则;涉及自动执行、外部工具或高风险操作时,应在提示词中明确确认步骤、权限边界和失败处理方式。

总安装

541

周安装

23

GitHub Stars

6

下载量

190
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/atman36/ai-vibe-prompts --skill codebase-analysis

简介

codebase-analysis 系统化分析项目结构、技术栈和代码质量,输出架构图和复杂度指标。

  • 它识别关键组件关系、依赖冲突和潜在重构点,辅助制定技术决策路线图。
  • 自动触发条件包括用户明确要求分析、新项目启动或重大变更前的审计需求。
  • 分析结果应结合团队上下文解读,避免机械套用指标而忽略业务特殊性。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Codebase Analysis Skill

Objective

Perform comprehensive, systematic analysis of project codebases to understand:

  • Project structure and organization
  • Technology stack and dependencies
  • Architectural patterns and conventions
  • Code complexity and quality metrics
  • Key components and their relationships

When to Use This Skill

Auto-invoke when:

  • Starting work on a new project
  • User asks to "analyze", "review", "audit", or "understand" the codebase
  • Before making architectural decisions
  • Planning refactoring or major changes
  • Onboarding new developers

Analysis Methodology

Phase 1: Discovery (Project Structure)

Goal: Map the high-level project organization

Tools: Glob, LS, Read

Process:

  1. Identify project type by reading package.json, tsconfig.json, or framework-specific configs
  2. Map directory structure using LS at root level: Key directories to identify: - Source code: src/, app/, pages/, components/ - Tests: __tests__/, tests/, *.test.*, *.spec.* - Config: config/,.config/ - Documentation: docs/, README.md - Build output: dist/, build/,.next/
  3. Scan for important files:

- Build configs: vite.config.*, webpack.config.*, next.config.* - TypeScript: tsconfig.json, tsconfig.*.json - Package management: package.json, package-lock.json, yarn.lock, pnpm-lock.yaml - Environment: .env*, .env.example - Git: .gitignore, .git/

Phase 2: Technology Stack Analysis

Goal: Identify frameworks, libraries, and versions

Tools: Read, Grep

Process:

  1. Read package.json:

- Extract dependencies (runtime libraries) - Extract devDependencies (development tools) - Note scripts (available commands) - Check engines (Node.js version requirements)

  1. Identify framework:

- Next.js: Check for next in dependencies, next.config.*, app/ or pages/ directory - React: Check for react and react-dom - Vue: Check for vue, *.vue files - Svelte: Check for svelte, *.svelte files - Angular: Check for @angular/core, angular.json

  1. Identify key libraries:

- State management: Redux, Zustand, MobX, Pinia - Routing: react-router, vue-router, next/navigation - UI libraries: MUI, Ant Design, shadcn/ui, Chakra UI - Styling: Tailwind CSS, styled-components, emotion, CSS modules - Testing: Vitest, Jest, Playwright, Cypress - Build tools: Vite, Webpack, esbuild, Turbopack

Phase 3: Architecture Pattern Analysis

Goal: Understand code organization and patterns

Tools: Grep, Glob, Read

Process:

  1. Component patterns (for React/Vue/Svelte): Use Glob to find: **/*.{jsx,tsx,vue,svelte} Analyze: - Component naming conventions - File structure (co-located styles, tests) - Component size (lines of code)
  2. API/Backend patterns: Use Grep to search for: - API routes: "export.*GET|POST|PUT|DELETE" - Database queries: "prisma\.|mongoose\.|sql" - Authentication: "auth|jwt|session"
  3. State management patterns: Use Grep to find: - Context API: "createContext|useContext" - Redux: "createSlice|useSelector" - Zustand: "create.*useStore"
  4. File organization patterns:

- Monorepo: Check for packages/, apps/, turbo.json, nx.json - Feature-based: Check for directories like features/, modules/ - Layer-based: Check for components/, services/, utils/, hooks/

Phase 4: Code Quality & Complexity Assessment

Goal: Identify potential issues and technical debt

Tools: Grep, Bash, Read

Process:

  1. Linting & Formatting:

- Check for: .eslintrc*, .prettierrc*, biome.json - Run linter if available: npm run lint (via Bash)

  1. Testing coverage:

- Find test files: Use Glob for **/*.{test,spec}.{js,ts,jsx,tsx} - Calculate coverage: Run npm run test:coverage if available

  1. TypeScript strictness:

- Read tsconfig.json - Check strict: true, strictNullChecks, etc. - Look for @ts-ignore or any usage (Grep)

  1. Code complexity indicators: Use Grep to flag potential issues: - Large files: Find files > 500 lines - Deep nesting: Search for excessive indentation - TODO/FIXME comments: Grep for "TODO|FIXME|HACK" - Console logs: Grep for "console\.(log|debug|warn)"

Phase 5: Dependency & Security Analysis

Goal: Identify outdated or vulnerable dependencies

Tools: Bash, Read

Process:

  1. Check for lock files:

- Presence of package-lock.json, yarn.lock, pnpm-lock.yaml

  1. Run security audit (if npm/pnpm available): npm audit --json # or pnpm audit --json
  2. Check for outdated dependencies: npm outdated

Output Format

Provide a structured analysis report:

# Codebase Analysis Report

## Project Overview
- **Name**: [project name from package.json]
- **Type**: [framework/library]
- **Version**: [version]
- **Node.js**: [required version]

## Technology Stack
### Core Framework
- [Framework name & version]

### Key Dependencies
- UI: [library]
- State: [library]
- Routing: [library]
- Styling: [library]
- Testing: [library]

### Build Tools
- [Vite/Webpack/etc]

## Architecture

### Directory Structure

[tree-like representation of key directories]

### Patterns Identified
- [Component patterns]
- [State management approach]
- [API structure]
- [File organization]

## Code Quality Metrics
- **TypeScript**: [strict/loose/none]
- **Linting**: [ESLint/Biome/none]
- **Testing**: [X test files found, coverage: Y%]
- **Code Issues**: [TODOs: X, Console logs: Y]

## Recommendations
1. [Priority recommendation]
2. [Next priority]
3. ...

## Risk Areas
- [Potential issues or technical debt]

## Next Steps
- [Suggested actions based on analysis]

Best Practices

  1. Progressive Detail: Start with high-level overview, dive deeper only when needed
  2. Context Window Management: For large codebases, analyze in chunks (by directory/feature)
  3. Tool Selection:

- Use Glob for file discovery (faster than find) - Use Grep for pattern search (faster than reading all files) - Use Read only for critical files (package.json, configs)

  1. Time Efficiency: Complete analysis in < 60 seconds for typical projects
  2. Actionable Insights: Always provide specific, actionable recommendations

Integration with Other Skills

This skill works well with:

  • quality-gates - Use analysis results to run appropriate quality checks
  • project-initialization - Compare against templates to identify missing setup
  • refactoring-safe - Identify refactoring opportunities
  • Framework-specific skills (nextjs-optimization, react-patterns) - Auto-invoke based on detected framework

Error Handling

If analysis cannot complete:

  1. Missing dependencies: Suggest running npm install
  2. Corrupted files: Report specific files and continue with partial analysis
  3. Large codebase: Switch to targeted analysis mode (specific directories only)
  4. Permission issues: Request necessary file access permissions

Version History

  • 1.0.0 (2025-01-03): Initial skill creation with progressive disclosure support

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.54%
按下载量换算66

Claude

30.29%
按下载量换算58

Cursor

20.12%
按下载量换算38

Gemini CLI

9.48%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

来源信息

继续浏览同类 Skills