diff --git a/.claude/scripts/README.md b/.claude/scripts/README.md new file mode 100644 index 00000000000..66d4c1e58cc --- /dev/null +++ b/.claude/scripts/README.md @@ -0,0 +1,38 @@ +# Claude Helper Scripts + +Utility scripts to support Claude Code when working with this documentation repository. + +## resolve-doc-url.sh + +Resolves a documentation URL to its source markdown file. + +### Usage + +```bash +.claude/scripts/resolve-doc-url.sh "/path/to/page/" +``` + +### Examples + +```bash +# Find the file for a specific URL +.claude/scripts/resolve-doc-url.sh "/community-tools/contribute-to-mendix-docs/" +# Output: content/en/docs/community-tools/contribute-to-mendix-docs/_index.md + +# Check if a URL exists +.claude/scripts/resolve-doc-url.sh "/some/page/" +# Exit code 0 if found, 1 if not found +``` + +### Benefits + +- **Fast**: Uses grep optimized for file-only output +- **Token-efficient**: Returns only the file path, no surrounding context +- **Reliable**: Matches exact URL in front matter using fixed-string search + +### When to Use + +- Following cross-references between documentation pages +- Validating internal links +- Finding files by their published URL +- Checking if a URL is already in use diff --git a/.claude/scripts/resolve-doc-url.sh b/.claude/scripts/resolve-doc-url.sh new file mode 100644 index 00000000000..4af6c42229e --- /dev/null +++ b/.claude/scripts/resolve-doc-url.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Resolve a documentation URL to its source markdown file +# Usage: resolve-doc-url.sh "/path/to/page/" + +if [ -z "$1" ]; then + echo "Usage: resolve-doc-url.sh " + echo "Example: resolve-doc-url.sh '/community-tools/contribute-to-mendix-docs/'" + exit 1 +fi + +# Search for the URL in front matter +# Using grep with -l (files only) and -F (fixed string) for speed +grep -rl --include="*.md" "^url: $1$" content/en/docs/ + +# Exit code 0 if found, 1 if not found diff --git a/.claude/skills/docs-pr-review/SKILL.md b/.claude/skills/docs-pr-review/SKILL.md new file mode 100644 index 00000000000..90a0bbcee7b --- /dev/null +++ b/.claude/skills/docs-pr-review/SKILL.md @@ -0,0 +1,16 @@ +--- +name: docs-pr-review +description: Analyzes all changes in a pull request and generates suggestions for improvements, clarifications, inconsistencies, and structural changes without making any edits. Use when the user asks to review, analyze, audit, or provide feedback on a pull request, or when they want suggestions before making changes. +user-invocable: true +disable-model-invocation: false +--- + +Compare changes between the current branch and the base branch (typically `development`). Read the complete final state of each modified file, not just the diff, to ensure changes don't introduce inconsistencies with unchanged content. + +Analyze all the changes in the current pull request or branch and return a list of suggestions or questions about any points to clarify, potential inconsistencies, and sections to restructure, add, or remove. Read the whole of each document modified in the pull request to ensure the changes do not make inconsistencies. + +Follow links to other documents in the repo to check for inconsistencies if they seem to provide important related information. + +Do not worry about possible invalid internal links to anchors in the repo as these will be picked up by a separate testing tool after the site has been built. + +Make no edits. diff --git a/.claude/skills/docs-review/SKILL.md b/.claude/skills/docs-review/SKILL.md index 4d48a03cb34..b8986ed2659 100644 --- a/.claude/skills/docs-review/SKILL.md +++ b/.claude/skills/docs-review/SKILL.md @@ -1,6 +1,6 @@ --- name: docs-review -description: Analyzes a single documentation page and generates suggestions for improvements, clarifications, inconsistencies, and structural changes without making any edits. Use when the user asks to review, analyze, audit, or provide feedback on documentation, or when they want suggestions before making changes. +description: Analyzes a single documentation page and generates suggestions for improvements, clarifications, inconsistencies, and structural changes without making any edits. Use when the user asks to review, analyze, audit, or provide feedback on a documentation page or section, or when they want suggestions before making changes. user-invocable: true disable-model-invocation: false --- diff --git a/CLAUDE.md b/CLAUDE.md index c40b545f277..acd302592d0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -110,9 +110,14 @@ Call tools in parallel for independent operations (reading multiple files, multi * **Glob** – Use to find files by pattern (e.g., `*.md`, `**/*config*`) * **Grep** – Use to search file contents for specific text or patterns * **Write** – Use only for creating new files (prefer Edit for existing files) +* **Helper Scripts** – Use `.claude/scripts/resolve-doc-url.sh` to resolve documentation URLs (e.g., `/path/to/page/`) to their source markdown files. This is faster and more token-efficient than using Grep to search front matter. ### Cross-Reference Verification +When following or verifying documentation links: +* Use `.claude/scripts/resolve-doc-url.sh "/path/to/page/"` to quickly find the source file for a URL +* This is more efficient than Grep for URL-to-file lookups + When modifying URLs or anchor IDs: 1. Use Grep to search for the old URL/anchor across all documentation files 2. Identify all references that need updating diff --git a/content/en/docs/community-tools/contribute-to-mendix-docs/using-ai-tools.md b/content/en/docs/community-tools/contribute-to-mendix-docs/using-ai-tools.md index c9197cf665b..5a3bd95464c 100644 --- a/content/en/docs/community-tools/contribute-to-mendix-docs/using-ai-tools.md +++ b/content/en/docs/community-tools/contribute-to-mendix-docs/using-ai-tools.md @@ -55,6 +55,7 @@ This repository includes custom Claude Code skills optimized for documentation w * `/docs-enhance` - Performs comprehensive editing including reorganization, restructuring, and stronger phrasing * `/docs-review` - Analyzes documentation and generates suggestions for improvements * `/docs-add` - Adds new content to an existing page while preserving original structure +* `/docs-pr-review` - Reviews all changes in the PR rather than just a single document These skills are available to all contributors using Claude Code with this repository.