Skip to main content

Module inject

Module inject 

Source
Expand description

Turn ranked hits into the text injected into the model’s context.

Two shapes (Config::inject_mode):

  • directive — a short pointer to the skill (name + description + path) that tells the model to invoke it via the Skill tool, not to read the file. Forcefulness set by Strength.
  • body — the SKILL.md content inlined directly, no model agency.

Either way the total stays under char_budget: blocks are added until the next one would overflow (the first block is always allowed so a single large skill still gets injected).

Structs§

Rec
A skill chosen for injection: its id, the confidence we’ll display, and an optional one-line evidence note (why this skill was surfaced — a referenced file, the workspace’s ecosystem). The hook computes these (stage-appropriate confidence + dedup) and hands them to build; tests construct them directly.

Functions§

build
Build the injection text for recs and return it alongside the ids actually injected (after the char budget is applied). strength must already be resolved (not Strength::Auto); Auto is treated as Soft.