Skip to content

Commit 79f49c8

Browse files
chore: update cursor rule for CONTRIBUTOR-DOCS
1 parent 4c9d67e commit 79f49c8

File tree

1 file changed

+25
-32
lines changed

1 file changed

+25
-32
lines changed
Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,45 @@
11
---
22
description: Useful for updating auto-generated navigation and validating links in the contributor docs
3+
globs: CONTRIBUTOR-DOCS/**
34
alwaysApply: false
45
---
56

67
# Contributor docs navigation and link validation
78

8-
## When to apply this rule
9+
## When to run the nav script
910

10-
Recognize and apply this rule when the user requests any of the following:
11-
- Update contributor docs navigation
12-
- Update nav / TOC / breadcrumbs in contributor docs
11+
**1. When the user asks** for any of the following:
12+
- Update contributor docs navigation / nav / TOC / breadcrumbs
1313
- Regenerate contributor docs
14-
- Validate/verify links in contributor docs
14+
- Validate or verify links in contributor docs
1515
- Fix broken links in contributor docs
16-
- Any mention of "CONTRIBUTOR-DOCS" or "contributor docs" with "update", "nav", "links", or "verify"
16+
- CONTRIBUTOR-DOCS or contributor docs with "update", "nav", "links", or "verify"
1717

18-
## Instructions location
19-
20-
**Primary path:** `CONTRIBUTOR-DOCS/01_contributor-guides/07_authoring-contributor-docs/01_ai-agent-instructions.md`
18+
**2. When you change CONTRIBUTOR-DOCS structure or content:**
19+
- Add, remove, rename, or move files or folders under `CONTRIBUTOR-DOCS/`
20+
- Change document H1, H2, or H3 headings
2121

2222
## What to do
2323

24-
1. **Verify the instructions file exists** at the path above
25-
- If the file exists, read it and follow the instructions for "Role 1: Operator"
26-
- If the file does NOT exist, see "Self-correction procedure" below
27-
28-
2. **Follow the AI agent instructions** to:
29-
- Run the nav update script (which automatically validates links)
30-
- Handle any broken links that are reported
31-
- Report results to the user
24+
1. **Run the nav script** from the authoring-contributor-docs folder:
25+
```bash
26+
cd CONTRIBUTOR-DOCS/01_contributor-guides/07_authoring-contributor-docs
27+
node update-nav.js ../../
28+
```
29+
2. **Confirm** the script completes without errors.
30+
3. **Fix any link verification errors** reported by the script (fix straightforward cases; consult the user for ambiguous ones).
31+
4. **Report results** to the user (files updated, link counts, any remaining issues).
3232

33-
## Self-correction procedure
33+
Full instructions: `CONTRIBUTOR-DOCS/01_contributor-guides/07_authoring-contributor-docs/01_ai-agent-instructions.md` (Role 1: Operator).
3434

35-
If the instructions file is not found at the expected path:
35+
## If the instructions file is missing
3636

37-
1. Search for the file using: `glob_file_search` with pattern `**/ai-agent-instructions.md`
38-
2. Filter results to find the one in `CONTRIBUTOR-DOCS/` folder
39-
3. Read the found file to confirm it contains the nav update instructions
40-
4. **Update this rule file** with the new path by modifying the "Primary path" line above
41-
5. Inform the user that you've updated the rule with the new location
42-
6. Continue with the nav update process
37+
If the file above is not found:
38+
1. Search for `**/ai-agent-instructions.md` and find the one in CONTRIBUTOR-DOCS.
39+
2. Read it to confirm it contains the nav update instructions.
40+
3. Update this rule with the correct path, inform the user, then run the nav process.
4341

4442
## Quick reference
4543

46-
The nav update process typically involves:
47-
- Running a Node.js script in the authoring-contributor-docs folder
48-
- The script automatically updates breadcrumbs, TOC, and validates all links
49-
- If broken links are found, fix straightforward issues automatically
50-
- Only consult the user for ambiguous cases
51-
52-
Execution time is typically 20-200ms for the entire CONTRIBUTOR-DOCS tree.
44+
- Script updates breadcrumbs, TOC, and validates all links (~20–200ms for the tree).
45+
- Fix broken links automatically when the fix is clear; ask the user when the target is gone or intent is unclear.

0 commit comments

Comments
 (0)