mcp-sap-docs / rules
Cursor rule243 starsChanged 6 months agoApache-2.0View on GitHub
For centralized configuration management and metadata-driven features. @file src/metadata.json @file src/lib/metadata.ts @file src/lib/config.ts @file docs/METADATA-CONSOLIDATION.md @file docs/ARCHITECTURE.md @file docs/DEV.md
We split this 50-metadata-config.mdc into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Add source definition to src/metadata.json
- Distinctive: line 34
Add to contextBoosts if context-specific scoring needed
- Distinctive: line 35
Add to libraryMappings if ID mapping required
- Distinctive: line 36
No code changes needed - APIs handle automatically
- Very specific: line 39
Single Source: All source configs in metadata.json only
- Distinctive: line 40
Type Safety: Use metadata APIs, never direct JSON access
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
# Metadata & Configuration (Rule)
For centralized configuration management and metadata-driven features.
## Metadata System Architecture
- **Central Config**: `src/metadata.json` - Single source of truth
- **Type-Safe APIs**: `src/lib/metadata.ts` - 12 comprehensive functions
- **Core Settings**: `src/lib/config.ts` - System-level configuration only
- **Runtime Loading**: Metadata loaded once at startup with fallbacks
## Configuration Structure
```json
{
"sources": [/* 12 documentation sources with full metadata */],
"contextBoosts": {/* Context-specific scoring boosts */},
"libraryMappings": {/* Source ID to library ID mappings */},
"contextEmojis": {/* UI presentation emojis */},
"synonyms": [/* Query expansion synonyms */],
"acronyms": {/* Acronym expansions */}
}
```
## Metadata APIs (12 functions)
- **URL Configuration**: `getDocUrlConfig()`, `getAllDocUrlConfigs()`
- **Source Paths**: `getSourcePath()`, `getAllSourcePaths()`
- **Context Boosts**: `getContextBoosts()`, `getAllContextBoosts()`
- **Library Mappings**: `getLibraryMapping()`, `getAllLibraryMappings()`
- **UI Elements**: `getContextEmoji()`, `getAllContextEmojis()`
- **Source Lookup**: `getSourceByLibraryId()`, `getSourceById()`
## Adding New Sources
1. Add source definition to `src/metadata.json`
2. Include: id, libraryId, sourcePath, baseUrl, pathPattern, anchorStyle, boost, tags
3. Add to contextBoosts if context-specific scoring needed
4. Add to libraryMappings if ID mapping required
5. No code changes needed - APIs handle automatically
## Configuration Best Practices
- **Single Source**: All source configs in metadata.json only
- **Type Safety**: Use metadata APIs, never direct JSON access
- **Fallbacks**: APIs return sensible defaults for missing data
- **Validation**: Metadata loading includes error handling
- **Environment**: Core settings can be overridden via env vars
## Migration from Hardcoded Config
- **Before**: Scattered configs in multiple files (~250+ lines)
- **After**: Centralized metadata with type-safe access
- **Benefits**: Maintainable, extensible, no code changes for new sources
@file src/metadata.json
@file src/lib/metadata.ts
@file src/lib/config.ts
@file docs/METADATA-CONSOLIDATION.md
@file docs/ARCHITECTURE.md
@file docs/DEV.mdWhere files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/00-overview.mdcCursor rule
- .cursor/rules/10-search-stack.mdcCursor rule
- .cursor/rules/20-tools-and-apis.mdcCursor rule
- .cursor/rules/30-tests-and-output.mdcCursor rule
- .cursor/rules/40-deploy.mdcCursor rule
- .cursor/rules/60-adding-github-sources.mdcCursor rule
- .cursor/rules/70-tool-usage-guide.mdcCursor rule
- .cursor/rules/80-abap-integration.mdcCursor rule
- ui5-version-upgradeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

