infrastructure-corelisted
Install: claude install-skill docxology/template
# Core Infrastructure Module
Foundation utilities used across the entire infrastructure layer and all project scripts.
## Logging (`logging/utils.py`)
```python
from infrastructure.core import get_logger, log_operation, log_stage, format_duration
from infrastructure.core.logging.setup import setup_logger
from infrastructure.core.logging.utils import log_timing, log_substep
logger = get_logger(__name__)
logger.info("Processing started")
# log_operation is a context manager (logs start, completion, failure)
with log_operation("Processing data"):
process()
# Decorator for automatic timing and logging
@log_timing
def expensive_operation():
pass
# Structured progress logging
log_stage(1, 10, "Running Tests")
log_substep("Unit tests passed")
# ETA calculation
from infrastructure.core.runtime import calculate_eta
```
## Configuration (`config/loader.py`)
```python
from infrastructure.core.config.loader import load_config, find_config_file, get_config_as_dict
# Load project config.yaml
config = load_config(project_path / "manuscript" / "config.yaml")
# Auto-discover config file
config_path = find_config_file(project_root)
```
## Exception Hierarchy (`exceptions.py`)
All exceptions extend `TemplateError`. Use context-preserving helpers:
```python
from infrastructure.core import TemplateError
from infrastructure.core.exceptions import (
ConfigurationError, ValidationError, BuildError,
RenderingError, LLMError, PublishingError,
raise_with_context, chai