Automated CI that audits .mdx documentation files against the Sui Documentation Style Guide using Claude.
- A PR is opened or updated with
.mdxfile changes - The workflow sends each changed file + the style guide to Claude
- Claude reports all violations (every rule is mandatory)
- Results are posted as a PR comment
- The job fails if any violations are found
In Settings > Secrets and variables > Actions > Secrets:
| Secret | Description |
|---|---|
ANTHROPIC_API_KEY |
Anthropic API key for Claude |
GITHUB_TOKEN is provided automatically.
To block merges on violations: Settings > Branches > Branch protection rules > main > enable "Require status checks" > add Style guide audit.
Triggers automatically on any PR that changes .mdx files or anything under docs/.
Go to Actions > Docs Style Guide Audit > Run workflow and provide:
- Repo:
MystenLabs/sui(or any repo) - PR number: the PR to audit
export ANTHROPIC_API_KEY="sk-ant-..."
# Create a file list
echo "docs/content/some-page.mdx" > /tmp/files.txt
export CHANGED_FILES=/tmp/files.txt
export GITHUB_WORKSPACE=/path/to/repo
python scripts/style-guide-audit.pystyle-guide-checker/
├── .github/workflows/docs-style-guide.yml # CI workflow
├── scripts/style-guide-audit.py # Audit script (sends files to Claude)
├── sui-documentation-style-guide.skill # The style guide rules
└── README.md
Edit sui-documentation-style-guide.skill. The YAML frontmatter is stripped at runtime — only the markdown body is sent to Claude as the audit reference.
Change the paths filter in the workflow and the .endswith(".mdx") check in the script.