Skip to main content

Module rules_inject

Module rules_inject 

Source
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.

Content is delegated to core::rules_canonical — all rule text lives there as pub const sections. Markers (START_MARK, END_MARK, RULES_VERSION) are also re-exported from canonical.

Re-exports§

pub use crate::core::rules_canonical::END_MARK;
pub use crate::core::rules_canonical::RULES_VERSION;
pub use crate::core::rules_canonical::START_MARK;

Structs§

InjectResult
RulesTargetStatus

Constants§

GEMINI_DEDICATED_CONTEXT_FILENAME
The context.fileName entry registered for Gemini in dedicated mode.

Functions§

any_rules_marker_present
Returns true if a lean-ctx rules marker is present in any supported agent’s rules file.
canonical_rules_block
Forwarding functions — content is delegated to core::rules_canonical.
check_rules_freshness
Check if the rules file for a given MCP client is up-to-date.
collect_rules_status
expected_blocks_by_target
The canonical rules block lean-ctx would write for each target, keyed by the target’s display name.
gemini_dedicated_rules_path
inject_all_rules
inject_rules_for_agent
Inject global rules for a single agent (by CLI key like “opencode”, “cursor”, etc.).
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
rules_dedicated_markdown
rules_shared_content