Skip to content

Commit 528f2bc

Browse files
committed
Update Claude's link guidance
1 parent 5f757f9 commit 528f2bc

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.claude/scripts/resolve-doc-url.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# Resolve a documentation URL to its source markdown file
3-
# Usage: resolve-doc-url.sh "/path/to/page/"
3+
# Usage: resolve-doc-url.sh "/url/path/"
44

55
if [ -z "$1" ]; then
66
echo "Usage: resolve-doc-url.sh <url>"

CLAUDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Before creating a new file, use Glob to explore the directory structure and unde
8181
* **Headings** – H1 is generated from the front‑matter title. Subsequent headings increment by one level at a time. Don't use bold or italics as a replacement for headings. Use title case. Never start headings with numerals.
8282
* **Lists and tables** – Bullet lists use asterisks; ordered lists use numbers followed by a period. If there are more than three data points per item, use a table instead. Use the same syntax and structure for all list items in a given list. Use complete sentences to introduce lists and tables, not partial sentences completed with the list items.
8383
* **Indentation** – Four spaces for sub-lists and nested content. Alerts in lists are an exception: don't indent alert lines but do omit preceding blank line.
84-
* **Links**Use absolute paths starting with a leading slash (`/deployment/`). Use descriptive link text such as the page title, not "click here". To link to a heading, add an anchor ID (`{#anchor-id}`) next to the heading and use that ID in the URL (for example, `[Section title](/path/to/page#anchor-id)` to link to a heading in another page or `[Section title](#anchor-id)` to link to a heading in the same page).
84+
* **Links**Link using the target page's `url` front matter field, not its file system path (e.g., `/deployment/` from front matter, not `content/en/docs/deployment/_index.md`). Use descriptive link text such as the page title, not "click here". To link to a heading, add an anchor ID (`{#anchor-id}`) next to the heading and use that ID in the URL (for example, `[Prerequisites](/deployment/mendix-cloud/#prerequisites)` to link to a heading in another page or `[Prerequisites](#prerequisites)` to link to a heading in the same page).
8585
* **Images** – Always include `alt` text (or `alt=""` if decorative). Use W3C guidelines. Reference images with the `figure` shortcode.
8686
* **Code** – Use fenced code blocks with language specifier. Do not modify text that appears in code formatting (inline backticks or code blocks), even to fix apparent inconsistencies or apply naming conventions.
8787

@@ -105,18 +105,18 @@ Call tools in parallel for independent operations (reading multiple files, multi
105105

106106
### Tool Selection
107107

108+
* **Helper Scripts**
109+
* For URL resolution, use `bash .claude/scripts/resolve-doc-url.sh` instead of spawning agents. This resolves documentation URLs (e.g., `/community-tools/contribute-to-mendix-docs/`) to their source Markdown files and ensures Grep uses efficient flags consistently.
108110
* **Read** – Use to view specific files you know the path to
109111
* **Edit** – Use to modify existing files with targeted changes
110112
* **Glob** – Use to find files by pattern (e.g., `*.md`, `**/*config*`)
111113
* **Grep** – Use to search file contents for specific text or patterns
112114
* **Write** – Use only for creating new files (prefer Edit for existing files)
113-
* **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.
114115

115116
### Cross-Reference Verification
116117

117118
When following or verifying documentation links:
118-
* Use `.claude/scripts/resolve-doc-url.sh "/path/to/page/"` to quickly find the source file for a URL
119-
* This is more efficient than Grep for URL-to-file lookups
119+
* Use `bash .claude/scripts/resolve-doc-url.sh "/url/path/"` to quickly find the source file for a URL
120120

121121
When modifying URLs or anchor IDs:
122122
1. Use Grep to search for the old URL/anchor across all documentation files

0 commit comments

Comments
 (0)