Skip to main content

Module context

Module context 

Source
Expand description

What the checkout says, as opposed to what the pack remembers.

Rules, skills and the file outline are read from the working tree on every call and never written back. That separation is the point: the pack holds what somebody chose to remember, and this holds what is simply true of the directory right now, so neither can quietly become the other.

Constants§

ATTACH_CAP
The most characters one attached body carries.
IGNORE_FILE_NAMES
Ignore files whose patterns narrow the outline.
LINKED_RULE_NAMES
Rule files other tools read, which a project may also carry.
LINKED_RULE_RELPATHS
Linked rules that live at a fixed path under the root.
MAP_LIST_CAP
The most paths one outline names.
MAP_TOO_LARGE
Past this many files the outline lists none of them.
PROJECT_RULE_NAMES
Rule files a project writes for itself.
SKILL_DIR_NAMES
Directories a skill catalog may live in.

Functions§

discover_rules
Rule files, most specific first.
discover_skills
The skill catalog: names, descriptions and paths, with no bodies.
git_dir
The resolved git directory, which a worktree does not share.
git_root
The repository toplevel, or nothing when this is not a work tree.
is_ignored
Whether a repository-relative path is ignored.
parse_frontmatter
A leading --- key: value --- block and the body after it.
read_attach_source
A file’s contents when raw names one, else raw itself, capped.
read_skill
One skill in full: the first whose name or directory matches.
repo_map
The git-tracked outline of a checkout. Never a pack write.
rules_payload
The /v1/rules answer.
skills_payload
The /v1/skills answer, for the catalog or for one skill.
walk_to_root
cwd first, then its parents, ending at stop.