AgentSkillsCN

large-context-analysis

在分析整个代码库、全项目范围内的模式、架构,或解答“X是否已被实现?”这类问题时使用。可将大规模上下文信息的处理交由Gemini CLI完成。

SKILL.md
--- frontmatter
name: large-context-analysis
description: Use when analyzing entire codebases, project-wide patterns, architecture, or "is X implemented?" questions. Delegates to Gemini CLI for massive context capacity.

Large Context Analysis via Gemini CLI

When to Use (Scope-Based Triggers)

Automatically invoke when the task involves:

  • Analyzing "entire codebase" or "whole project"
  • Finding patterns across "all files" or multiple directories
  • Architecture or structure analysis
  • Implementation verification: "Is X implemented?", "Find all uses of Y"
  • Comparing conventions across modules
  • Any question requiring project-wide code understanding

Execution Flow

  1. Notify briefly: "Using Gemini CLI for this codebase-wide analysis..."
  2. Construct command with appropriate @ paths and specific prompt
  3. Execute via Bash and capture output
  4. Integrate findings into coherent response with file paths

Command Syntax

gemini -p "@<path> <prompt>"

TaskCommand
Full projectgemini --all_files -p "<prompt>"
Source onlygemini -p "@src/ <prompt>"
With testsgemini -p "@src/ @tests/ <prompt>"
Specific dirsgemini -p "@src/auth/ @middleware/ <prompt>"
Multi-filegemini -p "@package.json @src/index.js <prompt>"

Prompt Principles

  • Be specific: "List files and functions", not "find it"
  • Request evidence: "Show relevant code snippets"
  • Ask for structure: "Organize by module with file paths"

Notes

  • @ paths are relative to current working directory
  • No --yolo flag needed for read-only analysis
  • Gemini handles codebases exceeding Claude's context limits