Index
spec
¶
Specification corpus loading and management.
Provides the SpecCorpusLoader for reading venue spec directories into SpecFragment models for injection into agent prompts.
Classes¶
SpecCorpusLoader
¶
Loads specification fragments from a directory.
The loader reads all recognized files from the spec directory and produces SpecFragment instances. YAML files are parsed for structured content (name, tags, kind, content, data). Markdown files become text fragments with the filename stem as the name.
Binary files and unrecognized extensions are silently skipped.
Functions¶
load
staticmethod
¶
Load all spec fragments from a directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec_dir
|
str | Path
|
Path to the specification directory. Must exist. |
required |
Returns:
| Type | Description |
|---|---|
list[SpecFragment]
|
List of loaded SpecFragment instances, sorted by name for |
list[SpecFragment]
|
deterministic ordering. |
Raises:
| Type | Description |
|---|---|
SpecCorpusError
|
If the directory does not exist or cannot be read. |
Source code in src/marianne/spec/loader.py
load_claude_md
staticmethod
¶
Load CLAUDE.md as a spec fragment if it exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_root
|
str | Path
|
Path to the project root directory. |
required |
Returns:
| Type | Description |
|---|---|
SpecFragment | None
|
SpecFragment with name='claude_md' and kind='text', or None |
SpecFragment | None
|
if CLAUDE.md does not exist. |