.claude-plugin/skills/enforce-model-config-consistency-hook/SKILL.md
# Skill: enforce-model-config-consistency-hook ## Overview | Field | Value | |-----------|-----------------------------------------------------------------------| | Date | 2026-02-20 | | Issue | #792 | | PR | #837 | | Objecti
npx skillsauth add homericintelligence/projectscylla .claude-plugin/skills/enforce-model-config-consistency-hookInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Field | Value | |-----------|-----------------------------------------------------------------------| | Date | 2026-02-20 | | Issue | #792 | | PR | #837 | | Objective | Promote runtime warning to hard pre-commit gate by reusing validation.py | | Outcome | Success — 16 tests, pre-commit hook blocks mismatching commits |
scylla/ and you want to call it from a scripts/ entry pointThe runtime warning lives in scylla/config/validation.py:
def validate_filename_model_id_consistency(config_path: Path, model_id: str) -> list[str]:
"""Returns list of warning strings; empty means valid."""
...
The goal is to call this function from a scripts/ entry point and exit 1 if any warnings are returned.
scripts/The script must add the repo root to sys.path before importing from scylla/ — pre-commit
does not guarantee the repo root is on sys.path:
# scripts/check_model_config_consistency.py
_REPO_ROOT = Path(__file__).parent.parent
if str(_REPO_ROOT) not in sys.path:
sys.path.insert(0, str(_REPO_ROOT))
from scylla.config.validation import validate_filename_model_id_consistency
The script then:
*.yaml files in config/models/, skipping _-prefixed fixturesmodel_id with yaml.safe_loadvalidate_filename_model_id_consistency(config_file, model_id)pixi runBecause the script imports from scylla/, it must run inside the pixi environment:
# .pre-commit-config.yaml
- id: check-model-config-consistency
name: Check Model Config Filename/model_id Consistency
description: Fails if any config/models/*.yaml filename does not match its model_id field (uses scylla.config.validation)
entry: pixi run python scripts/check_model_config_consistency.py
language: system
files: ^config/models/.*\.yaml$
pass_filenames: false
Key details:
pixi run python ... rather than plain python ... ensures the venv with pyyaml and project packages is activepass_filenames: false — the script scans the directory itself, not individual changed filesfiles: ^config/models/.*\.yaml$ — only trigger when model configs changevalidate-model-configs hookThere are now two complementary hooks:
| Hook | Script | Logic | Purpose |
|------|--------|-------|---------|
| validate-model-configs | validate_model_configs.py | Prefix match (stem is prefix of model_id) | Allows date-stamp suffixes |
| check-model-config-consistency | check_model_config_consistency.py | Exact or : → - normalization (from validation.py) | Enforces load-time contract |
Both hooks are complementary; the second is stricter for the load-time semantics.
Tests go in tests/unit/scripts/test_check_model_config_consistency.py.
Use tmp_path and a write_yaml helper. Cover:
_-prefixed fixtures skippedmodel_id field (exit 1)--verbose prints passing file namesdef write_yaml(directory: Path, filename: str, content: str) -> Path:
path = directory / filename
path.write_text(textwrap.dedent(content))
return path
python instead of pixi run python in hook entryWhen entry: python scripts/check_model_config_consistency.py is used, the script cannot
import scylla.config.validation because the pixi venv packages are not available in the
pre-commit environment's python. Always use pixi run python for scripts that import
from the project's own packages.
sys.path injectionWithout sys.path.insert(0, str(_REPO_ROOT)), running the script from an arbitrary CWD
(as pre-commit does) fails with ModuleNotFoundError: No module named 'scylla'. The repo
root injection is necessary because pre-commit's language: system does not add the CWD
to sys.path.
| Metric | Value |
|----------------------|---------------------------------------------|
| Tests added | 16 |
| Hook ID | check-model-config-consistency |
| Hook trigger | ^config/models/.*\.yaml$ |
| Validation function | scylla.config.validation.validate_filename_model_id_consistency |
| Fixtures skipped | Files prefixed with _ |
| Entry command | pixi run python scripts/check_model_config_consistency.py |
development
# Skill: docs-status-fix ## Overview | Field | Value | |------------|----------------------------------------------------| | Date | 2026-02-19 | | Category | documentation | | Objective | Fix stale "Current Status" in CLAUDE.md | | Issue | #753 | | PR | #810
tools
# Skill: preflight-closing-issues-fix ## Overview | Field | Value | |-------|-------| | Date | 2026-02-21 | | Issue | #802 | | PR | #912 | | Category | tooling | | Objective | Fix `preflight_check.sh` Check 3 false positives caused by free-text PR search matching issue numbers in unrelated PR titles/bodies | | Outcome | Success — 6 bash tests pass, all pre-commit hooks green, PR created with auto-merge | ## When to Use Trigger this skill when: - A preflight/guard script uses `gh pr list --s
tools
# Preflight Check Skill Propagation ## Overview | Field | Value | |-------|-------| | Date | 2026-02-21 | | Issue | #803 | | Objective | Add preflight check to `worktree-create` skill so developers bypassing `gh-implement-issue` still run the 6-check safety gate | | Outcome | Success — PR #917 created, auto-merge enabled | | Files Changed | `tests/claude-code/shared/skills/worktree/worktree-create/SKILL.md` | ## When to Use Use this pattern when: - A safety/quality gate exists in one entry-
tools
# Orphan Config Detection ## Overview | Field | Value | |------------|-----------------------------------------------------------------| | Date | 2026-02-20 | | Issue | #777 | | PR | #824 | | Objective | Warn when a `config/models/*.yaml` file