Module

cli.skeleton.hydrator

Skeleton Hydrator.

This module implements the logic to turn a Skeleton schema into actual files on disk.

It handles:

  1. Traversing the component tree
  2. Merging cascades (parent -> child)
  3. Generating frontmatter (mapping Component Model -> YAML)
  4. Writing files (atomic writes)

Classes

Hydrator
Hydrates a Skeleton into a file structure.
5

Hydrates a Skeleton into a file structure.

Methods 1

apply
Apply the skeleton to the root path.
1 None
def apply(self, skeleton: Skeleton) -> None

Apply the skeleton to the root path.

Parameters 1
skeleton Skeleton
Internal Methods 4
__init__
3 None
def __init__(self, root_path: Path, dry_run: bool = False, force: bool = False)
Parameters 3
root_path Path
dry_run bool
force bool
_process_components
Process a list of components recursively.
3 None
def _process_components(self, components: list[Component], parent_path: Path, cascade: dict[str, Any]) -> None

Process a list of components recursively.

Parameters 3
components list[Component]
parent_path Path
cascade dict[str, Any]
_generate_file_content
Generate the full markdown file content with frontmatter.
3 str
def _generate_file_content(self, comp: Component, effective_type: str | None, effective_variant: str | None) -> str

Generate the full markdown file content with frontmatter.

Parameters 3
comp Component
effective_type str | None
effective_variant str | None
Returns

str

_write_file
Write file to disk (handling dry-run and force).
2 None
def _write_file(self, path: Path, content: str) -> None

Write file to disk (handling dry-run and force).

Parameters 2
path Path
content str