This repository was archived by the owner on Feb 6, 2026. It is now read-only.
feat(si): Implement Multi-File Context System for AI Coding Tools#8151
Merged
vbustamante merged 1 commit intomainfrom Jan 6, 2026
Merged
feat(si): Implement Multi-File Context System for AI Coding Tools#8151vbustamante merged 1 commit intomainfrom
vbustamante merged 1 commit intomainfrom
Conversation
Dependency Review✅ No vulnerabilities or OpenSSF Scorecard issues found.Scanned FilesNone |
2782efb to
59d8ccc
Compare
vbustamante
previously approved these changes
Jan 6, 2026
wendybujalski
previously approved these changes
Jan 6, 2026
The System Initiative assistant context was defined in a single monolithic SI_Agent_Context.md.tmpl file (~27KB) that was used identically across all AI coding tools (Claude Code, Codex, Cursor, OpenCode.ai). This approach:
- Loaded entire context into memory at startup regardless of what was needed
- Couldn't leverage each tool's native multi-file capabilities
- Made maintenance difficult as provider documentation grew
- Provided no way to selectively access provider-specific documentation
We now implemented a modular template system that splits provider documentation into separate files and uses each tool's optimal loading strategy for efficient, on-demand context access.
### Modular Template Structure
**Created provider-specific templates in data/templates/providers/:**
- common.md.tmpl - Core System Initiative concepts (change sets, MCP server)
- aws.md.tmpl - AWS CloudFormation schema documentation
- azure.md.tmpl - Microsoft Azure ARM resource documentation
- hetzner.md.tmpl - Hetzner Cloud schema documentation
- digitalocean.md.tmpl - DigitalOcean resource documentation
- google.md.tmpl - Google Cloud resource documentation
### Tool-Specific Implementations
**Claude Code - Skills with Progressive Disclosure:**
- CLAUDE.md contains common content + skill usage instructions
- Generates 5 provider skills in .claude/skills/{provider}-infrastructure/SKILL.md
- Skills auto-discovered and invoked based on query context
- Skills use 3-level progressive disclosure: metadata → instructions → resources
- Includes proper YAML frontmatter with allowed-tools matching Claude settings
**Codex - On-Demand Read Tool:**
- AGENTS.md contains common content + instructions to use Read tool for provider docs
- Creates docs/providers/{provider}.md for each provider (5 files)
- Codex dynamically reads provider docs only when answering provider-specific questions
- No global configuration required, works out of the box
- Supports multi-provider workflows without context window bloat
**Cursor - On-Demand Read Tool:**
- .cursorrules contains common content + instructions to use Read tool
- Shares docs/providers/ directory with Codex (5 provider files)
- Cursor reads provider docs on-demand when answering provider questions
- Efficient lazy loading prevents unnecessary context consumption
**OpenCode - On-Demand Read Tool:**
- Auto-loads AGENTS.md (shared with Codex)
- Shares docs/providers/ directory with Codex and Cursor
- Reads provider docs on-demand using Read tool
- Works automatically without additional configuration
### Benefits
✅ Efficient context usage - Tools load only what they need, when they need it
✅ Modular maintenance - Update one provider file, all tools benefit
✅ File sharing - Codex, Cursor, and OpenCode share AGENTS.md and docs/providers/
✅ No duplication - Single source templates, tool-specific generation strategies
✅ Native capabilities - Each tool uses its optimal loading mechanism
✅ Scalable - Add new providers by creating one template file
✅ Multi-provider support - All tools can access multiple providers in one session
fa74f88
59d8ccc to
fa74f88
Compare
vbustamante
approved these changes
Jan 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The System Initiative assistant context was defined in a single monolithic SI_Agent_Context.md.tmpl file (~27KB) that was used identically across all AI coding tools (Claude Code, Codex, Cursor, OpenCode.ai). This approach:
We now implemented a modular template system that splits provider documentation into separate files and uses each tool's optimal loading strategy for efficient, on-demand context access.
Modular Template Structure
Created provider-specific templates in data/templates/providers/:
Tool-Specific Implementations
Claude Code - Skills with Progressive Disclosure:
Codex - On-Demand Read Tool:
Cursor - On-Demand Read Tool:
OpenCode - On-Demand Read Tool:
Benefits
✅ Efficient context usage - Tools load only what they need, when they need it
✅ Modular maintenance - Update one provider file, all tools benefit
✅ File sharing - Codex, Cursor, and OpenCode share AGENTS.md and docs/providers/
✅ No duplication - Single source templates, tool-specific generation strategies
✅ Native capabilities - Each tool uses its optimal loading mechanism
✅ Scalable - Add new providers by creating one template file
✅ Multi-provider support - All tools can access multiple providers in one session
For non-Claude (where Claude has skills), we generate a file as follows:
Which means we get the following behaviour:
It has read the correct file on demand. This means that it still understands that it needs to get the correct context about a provider when the user needs it.
This reduces the initial tokens that a user spends starting our agent