-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Description
What would you like to be added?
I would like GEMINI.md context files to support a syntax for importing content from other files recursively.
Currently, if I have multiple projects that share a set of coding conventions, I have to duplicate those conventions into every GEMINI.md file. I would like to be able to use a syntax like @path/to/shared_conventions.md inside a GEMINI.md file, which the CLI should resolve, read, and inject into the context window at runtime.
Requirements:
- Syntax: Support a clear syntax (e.g.,
@./relative/path.mdor@/absolute/path.md) to reference other files. - Recursion: Imported files should be able to import other files (nested imports).
- Cycle Detection: The system should gracefully handle or error out on circular dependencies (e.g., File A imports File B, File B imports File A).
- Path Resolution: Support relative paths (relative to the file doing the importing) and project-absolute paths.
Why is this needed?
This feature is essential for Context Management at Scale:
- DRY (Don't Repeat Yourself): Teams often have global coding standards (linting rules, architectural patterns) that apply to all repositories. Currently, these must be copy-pasted into every project's
GEMINI.md. - Maintainability: If a team convention changes, developers currently have to update every single
GEMINI.mdfile across their file system. With imports, they would only need to update the single source-of-truth file. - Modularity: It allows developers to organize context logically (e.g.,
testing_rules.md,style_guide.md,architecture.md) rather than having one massive, unreadableGEMINI.mdfile.
Additional context
Example Workflow:
File Structure:
/my-project
├── GEMINI.md
├── docs/
│ └── api-conventions.md
└── shared-rules/ (perhaps a submodule or shared folder)
└── team-style.md
Content of GEMINI.md:
# Project Overview
This is the main backend service.
# Context Imports
@docs/api-conventions.md
@shared-rules/team-style.md
# Specific Instructions
Focus on high performance.Desired Behavior:
When the CLI initializes or refreshes context, it should construct a final system prompt that concatenates the content of GEMINI.md with the fully resolved content of api-conventions.md and team-style.md.