Development¶
Setup¶
Project structure¶
src/mcp_zen_of_languages/core packagelanguages/per-language analyzers and detectorsanalyzers/shared pipeline and registry logicrules/zen principle modelsdocs/documentation site
Checks¶
uv run ruff check
uv run ruff format --check
uv run ty check src
uv run pytest
uv run python scripts/check_docs_contrast.py --build --mode check
uv run python scripts/check_content_quality.py
Developer tasks (Poe)¶
All scripts/*.py helpers are available through Poe tasks in pyproject.toml.
uv run poe check_docs_links
uv run poe check_orphan_docs
uv run poe check_content_quality
uv run poe generate_cli_docs
uv run poe generate_mcp_tools_docs
uv run poe export_svg_assets
Use uv run poe (without a task) to list all available developer tasks.
Tasks are now documented with Poe help text, so discovery is much nicer:
When defining or reviewing tasks, you can use either inline-table notation or a dedicated task table:
check_docs_assets = { cmd = "python scripts/check_docs_assets.py", help = "Validate docs asset, CSS, JS, and SVG quality gates" }
[tool.poe.tasks.check_docs_assets]
cmd = "python scripts/check_docs_assets.py"
help = "Validate docs asset, CSS, JS, and SVG quality gates"
Poe also supports configuring the uv executor globally or per task. See the
official guidance for details and examples:
- https://poethepoet.natn.io/global_options.html#uv-executor
- https://poethepoet.natn.io/guides/help_guide.html
Pre-commit¶
pre-commit install --hook-type pre-commit --hook-type pre-push
pre-commit run --all-files
pre-commit run --hook-stage pre-push --all-files
Debugging tips¶
- Use
uv run pytest -k <pattern> -xvsfor focused tests. - Run
uv run zensical serve -f mkdocs.ymlto preview docs locally.
Don't skip pre-commit
Pushing without running pre-commit run --all-files will likely trigger CI failures. The hooks check linting, docs links, orphan pages, Sphinx role leaks, and docs contrast.
Docs-from-code model¶
Technical references are generated from source code and docstrings:
- CLI reference from
cli.py(scripts/generate_cli_docs.py) - MCP tools reference from
server.py(scripts/generate_mcp_tools_docs.py) - Config reference from
AnalyzerConfig(scripts/generate_config_docs.py) - API pages from mkdocstrings
:::declarations indocs/api/*.md
Narrative pages (README, docs home, onboarding flow, philosophy) stay human-authored Markdown. Keep duplicated strategic messaging in snippet blocks and include them with --8<--.
Contrast policy (WCAG AA)¶
- Documentation styles must satisfy WCAG AA contrast checks for both
caligo-lightandcaligo-dark. - The contrast audit runs in pre-commit and CI via
scripts/check_docs_contrast.py. - Allowed exceptions must be added to
scripts/docs_contrast_config.jsonwith explicit selector scope. - Prefer token updates first in
docs/stylesheets/tokens/palette.cssanddocs/stylesheets/tokens/semantic.css, then targeted selector overrides in component modules as needed.