Expand description
Rules + SKILL.md injection for every supported agent, split by concern
(GL#440): content (payloads), targets (agent catalog), detect
(installation checks), write (atomic file surgery), skills (SKILL.md).
This hub owns the shared types and the orchestration entry points.
Structs§
Constants§
- GEMINI_
DEDICATED_ CONTEXT_ FILENAME - The
context.fileNameentry registered for Gemini in dedicated mode. - RULES_
END_ MARKER - RULES_
MARKER - RULES_
VERSION_ STR
Functions§
- any_
rules_ marker_ present - Returns
trueif a lean-ctx rules marker is present in any supported agent’s rules file (checking both the shared and dedicated layouts). - canonical_
rules_ block - The canonical shared rules block lean-ctx injects into a host instruction file
(
CLAUDE.md/CODEBUDDY.md/AGENTS.md). Exposed for honest per-turn overhead accounting (seecore::context_overhead, GitHub #361). - check_
rules_ freshness - Check if the rules file for a given MCP client is up-to-date.
Returns
Some(message)if rules are stale/missing,Noneif current. - collect_
rules_ status - dedicated_
session_ summary - Compact, agent-agnostic tool-mapping summary injected as
SessionStartadditionalContextinrules_injection = "dedicated"mode. - gemini_
dedicated_ rules_ path - Dedicated-mode rules file for Gemini CLI, auto-loaded via
settings.jsoncontext.fileNameinstead of polluting~/.gemini/GEMINI.md. The filename is deliberately distinctive: Gemini discovers context files by name across the project tree, so a genericlean-ctx.mdwould get picked up everywhere. - inject_
all_ rules - inject_
rules_ for_ agent - Inject global rules for a single agent (by CLI key like “opencode”, “cursor”, etc.).
Used by
init --agentto ensure global rules are written alongside MCP config. - install_
all_ skills - Install SKILL.md for all detected agents.
Returns
Vec<(display_name, was_new_or_updated)>. - install_
skill_ for_ agent - Install SKILL.md for a specific agent. Returns the installed path.
- opencode_
dedicated_ rules_ path - Dedicated-mode rules file for OpenCode, auto-loaded via
opencode.jsoninstructions[](absolute path) instead of polluting~/.config/opencode/AGENTS.md. - rules_
dedicated_ markdown - rules_
shared_ content