Skip to content

Commit d7ee333

Browse files
authored
Merge pull request #15795 from ethereum/llms-file-command
Slash command to keep llms.txt file updated
2 parents 37bd816 + ad7cb15 commit d7ee333

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

.claude/commands/update-llms-txt.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Update LLMS.txt Command
2+
3+
This command helps maintain the `public/llms.txt` file by monitoring key navigation files:
4+
5+
1. **Main Navigation**: `src/components/Nav/useNavigation.ts`
6+
2. **Developer Docs**: `src/data/developer-docs-links.yaml`
7+
3. **Footer Links**: `src/components/Footer.tsx`
8+
9+
## How it works
10+
11+
- Adds missing links to appropriate sections
12+
- Preserves existing descriptions and organization
13+
- Follows established llms.txt structure
14+
- **Prefers static markdown files URLs over html URLs** for better LLM comprehension
15+
16+
## Implementation
17+
18+
When this command is executed, I will:
19+
20+
### Step 1: Parse Navigation Files
21+
22+
**Main Navigation** (`src/components/Nav/useNavigation.ts`):
23+
24+
```javascript
25+
// Extract linkSections object structure
26+
// Parse learn, use, build, participate sections
27+
// Get href, label, and description for each link
28+
```
29+
30+
**Developer Docs** (`src/data/developer-docs-links.yaml`):
31+
32+
```yaml
33+
# Parse foundational-topics, ethereum-stack, advanced, design-fundamentals
34+
# Extract href and id mappings
35+
# Build hierarchical structure
36+
```
37+
38+
**Footer Links** (`src/components/Footer.tsx`):
39+
40+
```javascript
41+
// Extract linkSections and dipperLinks arrays
42+
// Get all footer navigation items
43+
// Include external links (blog, ESP, Devcon)
44+
```
45+
46+
### Step 2: Analyze Current llms.txt
47+
48+
- Parse existing sections and their links
49+
- Extract current URLs and descriptions
50+
- Identify section organization and hierarchy
51+
52+
### Step 3: URL to Markdown File Mapping
53+
54+
**Priority: Static markdown files URLs over web html URLs**
55+
56+
For each link, I will:
57+
58+
1. Check if corresponding markdown file exists in `public/content/`. **Ignore translations**: Skip `public/content/translations/` directory (60+ language versions)
59+
2. Use a URL pointing to the markdown file for the page: `https://ethereum.org/content/[page]/index.md`
60+
3. Fall back to web URL only if no markdown file exists
61+
4. Example: `https://ethereum.org/learn/``https://ethereum.org/content/learn/index.md`
62+
5. Example2: `https://ethereum.org/guides/how-to-use-a-wallet/``https://ethereum.org/content/guides/how-to-use-a-wallet/index.md`
63+
64+
### Step 4: Smart Link Categorization
65+
66+
New links are categorized using these rules:
67+
68+
1. **Learn Section**: `/learn/`, `/what-is-*`, `/guides/`, `/quizzes/`, `/glossary/`
69+
2. **Use Section**: `/get-eth`, `/wallets/`, `/dapps/`, `/staking/`, use cases
70+
3. **Build Section**: `/developers/`, `/enterprise/`, developer tools
71+
4. **Participate Section**: `/community/`, `/contributing/`, `/foundation/`
72+
5. **Research Section**: `/whitepaper`, `/roadmap/`, `/eips/`, `/governance/`
73+
74+
### Step 5: Validation & Quality Checks
75+
76+
- Verify all markdown files exist in `public/content/`
77+
- Check for duplicate links within sections
78+
- Validate section organization and hierarchy
79+
- Ensure descriptions are informative and concise
80+
81+
### Step 6: Execute Action
82+
83+
Update llms.txt file with improved structure and validated links
84+
85+
---
86+
87+
The command ensures the llms.txt file remains comprehensive and current with minimal manual maintenance.

0 commit comments

Comments
 (0)