agentleFS
orbrunoorbruno/gemini-workflows-ccplugin/skills/long-context-processing/SKILL.md

long-context-processing

Skill0 starsChanged 9 months agoMITView on GitHub

Process very large documents or codebases using Gemini's 2M token context window. Use when dealing with content that exceeds typical context limits or requires seeing everything at once.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Document or file content exceeds ~100K tokens

    line 13
  2. Distinctive:

    Use Glob to find all relevant files

    line 31
  3. Distinctive:

    Use Read to get file contents

    line 32
  4. Very specific:

    Call Gemini: Use the process_long_context tool from gemini-api MCP server

    line 35
  5. Distinctive:

    Use gemini-1.5-pro for best long-context performance

    line 38
  6. Distinctive:

    When detailed code editing is needed - Claude is better for precise changes

    line 62
  7. Distinctive:

    When summarization is not the primary goal

    line 64
  8. Distinctive:

    Always use gemini-1.5-pro model for long context tasks

    line 68
  9. Distinctive:

    Ask for structured output (headings, lists) for easier parsing

    line 71
  10. Distinctive:

    When aggregating multiple files, use clear delimiters:

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Long Context Processing with Gemini

When to Use This Skill

Automatically invoke this skill when:

  • User needs to analyze an entire codebase at once
  • Document or file content exceeds ~100K tokens
  • User explicitly requests processing multiple large files together
  • Task requires comprehensive "see everything" context
  • User asks to find patterns across many files
  • Analyzing very long documents (books, research papers, extensive logs)

Examples That Trigger This Skill

  • "Analyze the entire codebase architecture"
  • "Summarize this 500-page document"
  • "Find patterns across all log files"
  • "Review all Python files in this project"
  • "What are the common themes in these research papers?"
  • "Analyze all API endpoints across the codebase"

How to Use

  1. Gather content:
    • Use Glob to find all relevant files
    • Use Read to get file contents
    • Concatenate into a single large text block
  2. Estimate size: Calculate approximate tokens (chars / 4)
  3. Call Gemini: Use the process_long_context tool from gemini-api MCP server
    • Pass the aggregated content
    • Include user's analysis request as the prompt
    • Use gemini-1.5-pro for best long-context performance
  4. Present results: Return Gemini's comprehensive analysis

Tool Parameters

{
  "content": "[very large concatenated text content]",
  "prompt": "Analyze the overall architecture and identify main patterns",
  "model": "gemini-1.5-pro"  // Pro recommended for long context
}

Capabilities

  • Context Window: Up to 2 million tokens (~1.5 million words, ~8 million characters)
  • Whole Codebase Analysis: See entire project structure and relationships
  • Pattern Detection: Find recurring themes across extensive content
  • Comprehensive Summarization: Distill key points from massive documents
  • Cross-file Analysis: Understand how different parts relate to each other

When NOT to Use

  • Small documents (< 50K tokens) - use Claude directly instead
  • When detailed code editing is needed - Claude is better for precise changes
  • Real-time or interactive tasks - prefer Claude's faster response
  • When summarization is not the primary goal

Best Practices

  • Always use gemini-1.5-pro model for long context tasks
  • Structure the prompt clearly: "Given the following [codebase/document/logs], [task]"
  • Include file paths or section markers in content for better reference
  • Ask for structured output (headings, lists) for easier parsing
  • For very large content, consider if you truly need ALL of it or can filter first

Content Formatting

When aggregating multiple files, use clear delimiters:

=== FILE: path/to/file1.py ===
[file content]

=== FILE: path/to/file2.py ===
[file content]

This helps Gemini maintain file context in its analysis.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.