Contributing¶
Thanks for improving MCP Zen of Languages. Whether you're fixing a bug, adding a detector, or bringing support for a new language — this section gives you the context to contribute effectively.
Local development workflow¶
Setup¶
This is enough for tests, linting and type checking. The docs group is only needed for documentation work (see Docs work).
Run Checks¶
Docs work¶
uv sync --group dev --group docs
uv run zensical build -f mkdocs.yml
uv run python scripts/check_docs_contrast.py --build --mode check
zensical is a Rust-built package. It ships prebuilt wheels for macOS (x86_64, arm64), Linux (manylinux x86_64, aarch64, armv7l; musllinux x86_64, aarch64) and Windows (amd64, arm64). On other platforms (32-bit Linux, musl armv7, 32-bit Windows) --group docs falls back to building from source, which needs a Rust toolchain. If you do not need to touch the docs, skip the group and let CI run the docs build; the docs-build-strict pre-push hook can be skipped with SKIP=docs-build-strict git push.
Pre-commit¶
Notes¶
- Use Python 3.12+ typing (
str | None,list[str]). - Pydantic v2 only (use
ConfigDict, avoidclass Config). - Rule metrics must match detector config field names.
- Language modules must include
__init__.py,analyzer.py,detectors.py, andrules.py. - Follow the rendering conventions in
docs/contributing/rendering-style-guide.mdfor all terminal UX changes.
-
Development
Local setup, quality gates, test commands, and CI expectations.
-
Add a Language
Define zen principles, create an analyzer, wire detectors — step by step.
-
Add a Detector
Implement a violation detector with the Strategy pattern and register it.
-
Architecture
How Template Method, Strategy, Pipeline, and Factory patterns connect.
-
Content Quality Guide
Hybrid docs-from-code ownership, editorial standards, and release checks.
-
Rendering Guide
Rich/Typer output conventions and terminal UX patterns.
-
Zensical Migration
Updated docs engine/build workflow and theme migration notes.
Before opening a PR¶
Quality gates
Run these locally before pushing:
Include a regression test and note the root cause in your PR description.
Add documentation, usage examples, and update the rule/detector mapping if applicable.
Follow the Adding a Detector guide. Include at least one positive and one negative test case.
Keep PRs focused
Scope each PR to one detector or one language. Reviewers can validate behavior and docs together when changes are contained.
See Also¶
- Zensical Migration — Theme migration and docs build workflow updates.
- User Guide — End-user documentation surfaces impacted by contributor changes.
- API Reference — Generated API docs from docstrings.