Engineering-grade, engine-agnostic linter and security shield for Markdown documentation
Project description
๐ก๏ธ Zenzic
Zenzic Shield internally audits this repository for credential leaks on every commit.
The Safe Harbor for your Markdown documentation.
Engine-agnostic static analysis โ standalone, security-hardened, zero configuration needed.
โก Try it now โ Zero Installation
Got a folder of Markdown files? Run an instant security and link audit using uv:
uvx zenzic check all ./your-folder
Zenzic will identify your engine via its configuration files or default to Vanilla mode for standalone folders โ providing immediate protection for links, credentials, and structural integrity.
๐ Quick Start
pip install zenzic
zenzic lab # Interactive showroom โ 9 acts, every engine, zero setup
zenzic check all # Audit the current directory
๐ Full docs โ ยท ๐ Badges ยท ๐ CI/CD guide
๐ฏ Why Zenzic?
| Without Zenzic | With Zenzic |
|---|---|
| โ Broken anchors silently 200 OK in Docusaurus v3 | โ Mathematical anchor validation via VSM |
| โ Leaked API keys in code blocks committed to git | โ The Shield โ 9-family credential scanner, exit 2 |
โ Path traversal ../../../../etc/passwd in links |
โ Blood Sentinel โ non-suppressible exit 3 |
| โ Orphan pages unreachable from any nav link | โ Semantic orphan detection โ not just file-exists |
| โ Silent 404s accumulating in Google Search Console | โ Directory Index Integrity checks |
| โ MkDocs โ Zensical migration with unknown breakage | โ Transparent Proxy โ lint both with one command |
๐งฉ What Zenzic is NOT
- Not a site generator. It audits source; it never builds HTML.
- Not a build wrapper. Zero-Trust Execution: no subprocesses, no
mkdocsordocusaurusbinaries invoked. - Not a spell checker. Structure and security โ not prose.
- Not an HTTP crawler. All validation is local and file-based.
๐ Capability Matrix
| Capability | Command | Detects | Exit |
|---|---|---|---|
| Link integrity | check links |
Broken links, dead anchors | 1 |
| Orphan detection | check orphans |
Files absent from nav โ invisible after build |
1 |
| Code snippets | check snippets |
Syntax errors in Python / YAML / JSON / TOML blocks | 1 |
| Placeholder content | check placeholders |
Stub pages and forbidden text patterns | 1 |
| Unused assets | check assets |
Images and files not referenced anywhere | 1 |
| Credential scanning | check references |
9 credential families โ text, URLs, code blocks | 2 |
| Path traversal | check links |
System-path escape attempts | 3 |
| Quality score | score |
Deterministic 0โ100 composite metric | โ |
| Regression detection | diff |
Score drop vs saved baseline โ CI-friendly | 1 |
Autofix: zenzic clean assets [-y] [--dry-run] deletes unused images.
๐ v0.6.1 "Obsidian Glass" (Stable) โ Full Docusaurus v3 versioning,
@site/alias resolution, and Zensical Transparent Proxy. See CHANGELOG.md.
๐ก๏ธ Security: The Shield & Blood Sentinel
Two security layers are permanently active โ neither is suppressible by --exit-zero:
The Shield scans every line โ including fenced code blocks โ for credentials. Unicode normalization defeats obfuscation (HTML entities, comment interleaving, cross-line lookback). Detected families: AWS, GitHub/GitLab, Stripe, Slack, OpenAI, Google, PEM headers, hex payloads. โ Exit 2. Rotate and audit immediately.
Blood Sentinel normalizes every resolved link with os.path.normpath and rejects any path
escaping the docs/ root. Catches ../../../../etc/passwd-style traversal before any OS syscall.
โ Exit 3.
| Exit | Meaning |
|---|---|
0 |
All checks passed |
1 |
Quality issues found |
2 |
SECURITY โ leaked credential detected |
3 |
SECURITY โ system-path traversal detected |
Add
zenzic check referencesto your pre-commit hooks to catch leaks before git history.
๐ Multi-Engine Support
Zenzic reads config files as plain text โ never imports or executes your build framework:
| Engine | Adapter | Highlights |
|---|---|---|
| Docusaurus v3 | DocusaurusAdapter |
Versioned docs, @site/ alias, Ghost Route detection |
| MkDocs | MkDocsAdapter |
i18n suffix + folder modes, fallback_to_default |
| Zensical | ZensicalAdapter |
Transparent Proxy bridges mkdocs.yml if zensical.toml absent |
| Any folder | VanillaAdapter |
Zero-config, Directory Index Integrity โ no engine required |
Third-party adapters install via the zenzic.adapters entry-point group.
See the Developer Guide for the adapter API.
โ๏ธ Configuration
Zero-config by default. Priority: zenzic.toml > [tool.zenzic] in pyproject.toml > built-ins.
# zenzic.toml (all fields optional)
docs_dir = "docs"
fail_under = 80 # exit 1 if score < threshold; 0 = observe only
excluded_dirs = ["includes", "assets", "overrides"]
excluded_build_artifacts = ["pdf/*.pdf", "dist/*.zip"]
placeholder_patterns = ["coming soon", "todo", "stub"]
[build_context]
engine = "mkdocs" # mkdocs | docusaurus | zensical | vanilla
default_locale = "en"
locales = ["it"]
zenzic init # Generate zenzic.toml with auto-detected values
zenzic init --pyproject # Embed [tool.zenzic] in pyproject.toml
Custom lint rules โ declare project-specific patterns in zenzic.toml, no Python required:
[[custom_rules]]
id = "ZZ-NODRAFT"
pattern = "(?i)\\bDRAFT\\b"
message = "Remove DRAFT marker before publishing."
severity = "warning"
Rules fire identically across all adapters. No changes required after engine migration.
๐ CI/CD Integration
- name: ๐ก๏ธ Zenzic Sentinel
run: uvx zenzic check all --strict
# Exit 1 = quality ยท Exit 2 = leaked credential ยท Exit 3 = path traversal
# Exits 2 and 3 are never suppressible.
- name: Regression gate
run: |
uvx zenzic score --save # on main branch
uvx zenzic diff # on PR โ exit 1 if score drops
For badge automation and regression gates, see the CI/CD guide.
Full workflow: .github/workflows/ci.yml
๐ฆ Installation
# Zero-install, one-shot audit (recommended for CI and exploration)
uvx zenzic check all ./docs
# Global CLI tool
uv tool install zenzic
# Pinned dev dependency
uv add --dev zenzic
# pip
pip install zenzic
pip install "zenzic[mkdocs]" # + MkDocs build-time plugin
The
[mkdocs]extra adds the build-time plugin (zenzic.integrations.mkdocs). All engine adapters (Docusaurus, Zensical, Vanilla) are included in the base install.
Portability: Zenzic rejects absolute internal links (starting with /). Relative links
work at any hosting path. External https:// URLs are never affected.
๐ฅ๏ธ CLI Reference
# Checks
zenzic check links [--strict]
zenzic check orphans
zenzic check snippets
zenzic check placeholders
zenzic check assets
zenzic check references [--strict] [--links]
zenzic check all [--strict] [--exit-zero] [--format json] [--engine ENGINE]
zenzic check all [--exclude-dir DIR] [--include-dir DIR]
# Score & diff
zenzic score [--save] [--fail-under N]
zenzic diff [--threshold N]
# Autofix
zenzic clean assets [-y] [--dry-run]
# Init
zenzic init [--pyproject]
# Interactive showroom
zenzic lab [--act N] [--list]
๐ Visual Tour
โญโโโโโโโโโโโโโโโโโโโโโโโ ๐ก ZENZIC SENTINEL v0.6.1 โโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ docusaurus โข 38 files (18 docs, 20 assets) โข 0.9s โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโ docs/guides/setup.mdx โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โ 12: [Z001] 'quickstart.mdx' not found in docs โ
โ โ โ
โ 12 โ Read the [quickstart guide](quickstart.mdx) first. โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โ 1 error โข 1 file with findings โข FAILED โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Visit the documentation portal for interactive screenshots and rich examples.
๐บ๏ธ Roadmap v0.7.0
- Auto-fix Engine โ Automatic repair of broken links and orphaned anchors.
- IDE Extensions โ Real-time linting for VS Code and Cursor via LSP.
- AI Context Provider โ VSM export in LLM-friendly format for AI agents.
- Astro & VitePress Adapters โ Expanding the Safe Harbor to JS frameworks.
๐๏ธ Design Philosophy
Zenzic is built on three operational contracts:
Lint the Source, Not the Build. The VSM (Virtual Site Map) maps every .md file to its
canonical URL without running the build โ errors are caught before they reach production.
Zero-Trust Execution. No subprocesses, no arbitrary code execution, no build engine imports.
Docusaurus .ts/.js configs are parsed via static text analysis โ Node.js is never invoked.
Mandatory Exclusion at Every Entry Point. All file discovery goes through
LayeredExclusionManager โ a 4-level hierarchy (System โ VCS โ Config โ CLI). No global scan
without an explicit exclusion context.
See the Architecture Guide for the Two-Pass Reference Pipeline and VSM deep-dive.
๐ FAQ
Why not grep? Grep is blind to structure. Zenzic understands Docusaurus versioning,
MkDocs i18n fallbacks, and Ghost Routes โ pages that don't exist as files but are valid URLs.
Does it run my build engine? No. 100% subprocess-free. Static analysis on plain text only.
Can it handle thousands of files? Yes. Adaptive parallelism for discovery; O(1) VSM lookup
per link; content-addressable cache (SHA256(content + config + vsm_snapshot)) skips unchanged files.
Shield vs Blood Sentinel? Shield = secrets inside content (exit 2). Blood Sentinel = links pointing to OS system paths (exit 3). Both are non-suppressible.
No zenzic.toml needed? Correct. Zenzic identifies the engine from config files present and applies safe defaults. Run
zenzic init at any time to generate a pre-populated config file.
What is zenzic lab? A 9-act interactive showroom covering every engine and error class.
Run it once before integrating Zenzic into any project.
๐ ๏ธ Development
uv sync --all-groups
nox -s tests # pytest + coverage
nox -s lint # ruff
nox -s typecheck # mypy --strict
nox -s preflight # lint + format + typecheck + pytest + reuse
just verify # preflight + zenzic check all --strict (self-dogfood)
See the Contributing Guide for the Zenzic Way checklist and PR conventions.
๐ค Contributing
- Open an issue to discuss the change.
- Read the Contributing Guide โ Zenzic Way checklist, pure functions, no subprocesses, source-first.
- Every PR must pass
nox -s preflightand include REUSE/SPDX headers on new files.
See also: Code of Conduct ยท Security Policy
๐ Citing
A CITATION.cff is present at the root. Click "Cite this repository" on
GitHub for APA or BibTeX output.
๐ License
Apache-2.0 โ see LICENSE.
ยฉ 2026 PythonWoods. Engineered with precision.
Based in Italy ๐ฎ๐น ย ยทย Committed to the craft of Python development.
dev@pythonwoods.dev
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zenzic-0.6.1.tar.gz.
File metadata
- Download URL: zenzic-0.6.1.tar.gz
- Upload date:
- Size: 543.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1196f70da7facc4b67ad773664d75e4f58e6880f458b23fc00b1e4819bc48a16
|
|
| MD5 |
959aa9329b5883819eb16fe64397e6dc
|
|
| BLAKE2b-256 |
6532f2ce7ff366c216ebd994413eb70f03437828aaf58de66ed0d4791e3e140d
|
File details
Details for the file zenzic-0.6.1-py3-none-any.whl.
File metadata
- Download URL: zenzic-0.6.1-py3-none-any.whl
- Upload date:
- Size: 269.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
768a8c477ebdb7059c64646f3e521281931b3ecc10f9b35dad93b999ee299ab1
|
|
| MD5 |
f3f3c90ae33b5495eff591ad08f89cfa
|
|
| BLAKE2b-256 |
e6428bec93181b2869ee72a98305b91e95b3420119fdc2753a88253b7eeee0b4
|