|
1 | 1 | --- |
2 | 2 | description: Useful for updating auto-generated navigation and validating links in the contributor docs |
| 3 | +globs: CONTRIBUTOR-DOCS/** |
3 | 4 | alwaysApply: false |
4 | 5 | --- |
5 | 6 |
|
6 | 7 | # Contributor docs navigation and link validation |
7 | 8 |
|
8 | | -## When to apply this rule |
| 9 | +## When to run the nav script |
9 | 10 |
|
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 |
13 | 13 | - Regenerate contributor docs |
14 | | -- Validate/verify links in contributor docs |
| 14 | +- Validate or verify links in contributor docs |
15 | 15 | - 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" |
17 | 17 |
|
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 |
21 | 21 |
|
22 | 22 | ## What to do |
23 | 23 |
|
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). |
32 | 32 |
|
33 | | -## Self-correction procedure |
| 33 | +Full instructions: `CONTRIBUTOR-DOCS/01_contributor-guides/07_authoring-contributor-docs/01_ai-agent-instructions.md` (Role 1: Operator). |
34 | 34 |
|
35 | | -If the instructions file is not found at the expected path: |
| 35 | +## If the instructions file is missing |
36 | 36 |
|
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. |
43 | 41 |
|
44 | 42 | ## Quick reference |
45 | 43 |
|
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