Skip to content

Commit 0ad4f3e

Browse files
committed
docs: add navigation restructure guidelines and update CI docs
- Add nav restructure guidelines to AGENT.md (nav-only approach, orphan detection script, URL verification) - Update CLAUDE.md CI section to reflect current validation-only workflow - Update current tabs list to match new 7-tab structure - Add restructuring navigation checklist to common tasks
1 parent c51f1fc commit 0ad4f3e

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

AGENT.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,37 @@ For struct/nested columns, document subfields with dot-notation when they are qu
150150
- Linking to `/folder/index` instead of `/folder`
151151
- dbt YAML includes columns that may not be present in exported MDW schema (verify against config + warehouse when possible)
152152

153+
## Navigation Restructure Guidelines
154+
155+
When reorganizing `docs.json` navigation:
156+
157+
### Safe Approach: Nav-Only Refactor
158+
1. **Change only `docs.json`** - Don't move files in the first pass
159+
2. **Run validation after every change** - `python3 -m json.tool docs.json` + nav ref check
160+
3. **Audit for orphan pages** - Compare files on disk vs pages in navigation
161+
162+
### Orphan Page Detection
163+
After restructuring, verify no pages were dropped:
164+
```bash
165+
# Find .mdx files not in docs.json (potential orphans)
166+
comm -23 <(find . -name "*.mdx" -not -path "./snippets/*" | sed 's|^\./||;s|\.mdx$||' | sort) \
167+
<(python3 -c "import json; exec('''
168+
def extract(obj, refs):
169+
if isinstance(obj, str) and not obj.startswith(\"http\"): refs.append(obj)
170+
elif isinstance(obj, list): [extract(i, refs) for i in obj]
171+
elif isinstance(obj, dict): [extract(v, refs) for k,v in obj.items() if k in (\"tabs\",\"pages\",\"navigation\",\"groups\")]
172+
return refs
173+
print(\"\\n\".join(sorted(extract(json.load(open(\"docs.json\")), []))))
174+
''')" | sort)
175+
```
176+
177+
### URL Verification
178+
**Never hallucinate URLs** - Always derive URLs from actual file paths:
179+
- File: `help-center/faq/data-faqs/why-dont-new-customers-match.mdx`
180+
- URL: `https://docs.sourcemedium.com/help-center/faq/data-faqs/why-dont-new-customers-match`
181+
182+
The validation script checks file existence, NOT URL correctness. When opening pages for QA, copy paths from `docs.json` or file listings.
183+
153184
### Recommended deterministic audit (monorepo)
154185

155186
If `../dbt_project.yml` exists, compare docs table YAML blocks against dbt YAML columns,

CLAUDE.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ The navigation uses a `tabs > groups > pages` hierarchy:
9898
```
9999

100100
**Current Tabs:**
101-
- What Is SourceMedium (help-center)
102-
- Onboarding
103-
- Data Integrations & Inputs
104-
- Data Transformation
105-
- Data Activation
106-
- MTA
101+
- Overview (getting started, core concepts)
102+
- Connect Your Data (integrations, configuration)
103+
- Understand Your Data (transformations, attribution)
104+
- Use Your Data (MDW, dashboards, data tables)
105+
- Reference (metrics, dimensions, data dictionary)
106+
- Help (FAQs, troubleshooting)
107+
- MTA (multi-touch attribution)
107108

108109
**Important:** Page references are paths WITHOUT `.mdx` extension. They must match actual file paths.
109110

@@ -181,12 +182,13 @@ Common icons: `plug`, `chart-line`, `question-mark`, `book`, `gear`, `heart-puls
181182

182183
## CI/CD Quality Checks
183184

184-
PRs trigger `.github/workflows/docs-quality.yml` which validates:
185+
PRs trigger `.github/workflows/mintlify-docs-update.yml` which validates:
185186

186-
1. **Spell Check** (codespell) - Catches typos
187-
2. **Link Check** (lychee) - Validates internal/external URLs
188-
3. **JSON Validation** - Ensures docs.json is valid
189-
4. **Navigation Validation** - All page refs point to existing files
187+
1. **JSON Validation** - Ensures docs.json is valid
188+
2. **Navigation Validation** - All page refs point to existing files
189+
3. **Mintlify Validation** - Runs `mintlify validate` (non-blocking due to pre-existing MDX issues)
190+
191+
**Note:** Mintlify auto-deploys on merge to master. The CI workflow is validation-only—no build/deploy steps needed.
190192

191193
**Ignored terms** (add to workflow if needed): smcid, sourcemedium, hdyhau, utm, cogs, ltv, roas, aov, klaviyo, shopify, etc.
192194

@@ -224,7 +226,14 @@ PRs trigger `.github/workflows/docs-quality.yml` which validates:
224226

225227
### Adding a new FAQ
226228
1. Create file in appropriate `help-center/faq/<category>/` folder
227-
2. Add to `docs.json` under "What Is SourceMedium" tab > FAQs group
229+
2. Add to `docs.json` under "Help" tab > appropriate FAQ group
230+
231+
### Restructuring Navigation
232+
When reorganizing `docs.json`:
233+
1. **Nav-only first** - Change docs.json without moving files
234+
2. **Validate after each change** - Run JSON + nav ref validation
235+
3. **Check for orphans** - See AGENT.md for orphan detection script
236+
4. **Single location per page** - Each page should appear in exactly one place in nav
228237

229238
### Adding images
230239
1. Place in `images/article-imgs/` (or `platform-logos/` for logos)

0 commit comments

Comments
 (0)