osm-edit-mcp / rules
Cursor rule4 starsChanged 3 months agoMITView on GitHub
- Reads credentials
Where 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 1,533 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 repository7 other files it gives its agents.
- .cursor/rules/configuration-management.mdcCursor rule
- .cursor/rules/mcp-development.mdcCursor rule
- .cursor/rules/mcp-implementation-patterns.mdcCursor rule
- .cursor/rules/osm-development-safety.mdcCursor rule
- .cursor/rules/osm-edit-safety.mdcCursor rule
- .cursor/rules/osm-mcp-project-structure.mdcCursor rule
- osm-edit-mcp-setupSkill
The file
Show its rules and text
We split this testing-and-quality.mdc into the rules it gives an agent
35 rules. About 0 are common, 30 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈30
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 26
Follow TESTING_CHECKLIST.md for systematic manual validation:
- Distinctive: line 30
Automated Testing: Run comprehensive test suite
- Distinctive: line 52
Test dev/prod switching in .env:
- Distinctive: line 64
Verify log levels in .env:
- Very specific: line 75
Use known good IDs that exist on api06.dev.openstreetmap.org:
- Distinctive: line 81
Use valid, safe test coordinates:
- Distinctive: line 87
Test with appropriately sized bounding boxes:
- Distinctive: line 114
All errors should return structured responses:
- Distinctive: line 145
Never log OAuth tokens or secrets
- Distinctive: line 146
Verify .env is not committed to version control
- Distinctive: line 147
Test with invalid credentials (should fail gracefully)
- Very specific: line 148
Verify keyring usage when USE_KEYRING=true
- Distinctive: line 151
Test with malicious coordinate values
- Distinctive: line 152
Test with oversized input data
- Distinctive: line 153
Test with special characters in tags
- Distinctive: line 154
Verify SQL injection protection
- Distinctive: line 158
Verify HTTPS usage for all API calls
- Distinctive: line 159
Check that sensitive data isn't logged
- Distinctive: line 160
Test with malformed API responses
- Distinctive: line 166
Document baseline success rate
- Distinctive: line 173
Update test expectations if needed
- Distinctive: line 177
Test dev/prod configuration switching
- Distinctive: line 178
Verify all safety features enabled
- Distinctive: line 179
Test OAuth flow if configured
- Distinctive: line 207
Start: Run baseline tests
- Very specific: line 209
Test: Add test case to test_comprehensive.py
- Distinctive: line 210
Validate: Run full test suite
- Distinctive: line 211
Document: Update README.md if needed
- Distinctive: line 214
Reproduce: Use tests to confirm bug
- Distinctive: line 217
Regression: Run full test suite
- Distinctive: line 218
Document: Update test expectations
- Very specific: line 222
Change: Update .env or server.py
- Distinctive: line 223
Validate: Test new configuration
- Distinctive: line 224
Document: Update README.md with new options
- Distinctive: line 225
Compatibility: Ensure backward compatibility
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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
---
description:
globs:
alwaysApply: false
---
# Testing and Quality Assurance Guide
## Comprehensive Testing Framework
### Automated Testing with test_comprehensive.py
The [test_comprehensive.py](mcp:test_comprehensive.py) provides systematic testing of all 31 MCP tools:
```bash
# Run full test suite
python test_comprehensive.py
# Expected output: JSON report, logs, and console summary
```
#### Test Categories
1. **Read Operations (Tests 1-15)**: Safe operations that should mostly pass
2. **Write Operations (Tests 16-27)**: OAuth-protected, expected to fail without auth
3. **Natural Language (Tests 28-31)**: Input validation and processing
### Manual Testing with TESTING_CHECKLIST.md
Follow [TESTING_CHECKLIST.md](mcp:TESTING_CHECKLIST.md) for systematic manual validation:
#### Testing Phases
1. **Pre-test Setup**: Configuration verification
2. **Automated Testing**: Run comprehensive test suite
3. **Manual Testing**: Phase-by-phase validation
4. **Configuration Testing**: Dev/prod switching
5. **Error Handling**: Edge cases and failures
6. **Performance Testing**: Response times and memory
7. **Security Testing**: Credential handling and validation
### Test Results Analysis
Review [TEST_RESULTS_SUMMARY.md](mcp:TEST_RESULTS_SUMMARY.md) for:
- ✅ **Working tools** (ready for use)
- ❌ **Expected failures** (OAuth-dependent, normal)
- 🔧 **Issues to debug** (actual problems requiring fixes)
## Quality Standards
### Test Success Criteria
- **Read operations**: ≥80% success rate
- **Write operations**: Expected 401/auth failures
- **Validation tools**: 100% success rate
- **Error handling**: Graceful failures with informative messages
### Configuration Testing
Test dev/prod switching in [.env](mcp:.env):
```bash
# Test development mode
OSM_USE_DEV_API=true
python -c "from src.osm_edit_mcp.server import config; print(config.current_api_base_url)"
# Test production mode (careful!)
OSM_USE_DEV_API=false
python -c "from src.osm_edit_mcp.server import config; print(config.current_api_base_url)"
```
### Logging Level Testing
Verify log levels in [.env](mcp:.env):
```bash
LOG_LEVEL=DEBUG # Should show detailed debug info
LOG_LEVEL=INFO # Should show operation info
LOG_LEVEL=WARNING # Should show only warnings/errors
LOG_LEVEL=ERROR # Should show only errors
```
## Test Data Management
### Valid Test Data for Dev Server
Use known good IDs that exist on `api06.dev.openstreetmap.org`:
- **Node**: 150537 (working in tests)
- **Way**: Need to find valid dev server way ID
- **Relation**: Need to find valid dev server relation ID
### Test Coordinates
Use valid, safe test coordinates:
- **London**: 51.5074, -0.1278 (working)
- **New York**: 40.7580, -73.9855 (working)
- **Paris**: 48.8566, 2.3522 (alternative)
### Bounding Box Testing
Test with appropriately sized bounding boxes:
```bash
# Small area (working for some operations)
"-0.1279,-0.1278,51.5074,51.5075"
# Larger area (may work better for dev server)
"-0.13,-0.12,51.50,51.51"
```
## Error Handling Quality
### Expected Error Patterns
Tools should handle these error types gracefully:
#### HTTP Errors
- **401 Unauthorized**: OAuth required (expected for write operations)
- **404 Not Found**: Element doesn't exist (handle gracefully)
- **400 Bad Request**: Invalid parameters (informative error)
- **429 Rate Limited**: Too many requests (retry logic)
#### Input Validation Errors
- Invalid coordinates (lat/lon out of range)
- Missing required parameters
- Malformed data structures
- Invalid OSM element references
### Error Response Quality
All errors should return structured responses:
```python
{
"success": False,
"error": "Technical error details for debugging",
"message": "Human-readable explanation for users"
}
```
## Performance Standards
### Response Time Expectations
- **Simple operations**: < 1 second
- **Complex searches**: < 5 seconds
- **Large data exports**: < 30 seconds
- **Authentication**: < 2 seconds
### Memory Usage
- **Base server**: < 100MB
- **During testing**: < 500MB
- **Large operations**: < 1GB
### API Rate Limiting
Respect OSM API limits configured in [.env](mcp:.env):
- `RATE_LIMIT_PER_MINUTE=60`
- `MAX_CHANGESET_SIZE=50`
- Handle 429 responses gracefully
## Security Testing
### Credential Security
- Never log OAuth tokens or secrets
- Verify [.env](mcp:.env) is not committed to version control
- Test with invalid credentials (should fail gracefully)
- Verify keyring usage when `USE_KEYRING=true`
### Input Sanitization
- Test with malicious coordinate values
- Test with oversized input data
- Test with special characters in tags
- Verify SQL injection protection
### API Security
- Test parameter tampering
- Verify HTTPS usage for all API calls
- Check that sensitive data isn't logged
- Test with malformed API responses
## Continuous Quality Assurance
### Before Code Changes
1. Run [test_comprehensive.py](mcp:test_comprehensive.py)
2. Document baseline success rate
3. Note any failing tests
### After Code Changes
1. Re-run [test_comprehensive.py](mcp:test_comprehensive.py)
2. Compare results with baseline
3. Investigate any new failures
4. Update test expectations if needed
### Before Deployment
1. Complete [TESTING_CHECKLIST.md](mcp:TESTING_CHECKLIST.md)
2. Test dev/prod configuration switching
3. Verify all safety features enabled
4. Test OAuth flow if configured
5. Performance test with realistic data
## Test Result Documentation
### Generated Test Reports
- **test_report.json**: Detailed JSON with all test results
- **test_results.log**: Comprehensive execution logs
- **Console output**: Summary with pass/fail status
### Tracking Test Health
Monitor these metrics over time:
- Overall success rate (target: maintain or improve)
- Response times (target: stable or decreasing)
- Error rates by category
- New tool test coverage
### Issue Tracking
For failed tests, document:
- Error type and frequency
- Steps to reproduce
- Potential fixes
- Workarounds available
- Impact on functionality
## Development Testing Workflow
### Feature Development
1. **Start**: Run baseline tests
2. **Develop**: Implement new feature following patterns in [server.py](mcp:src/osm_edit_mcp/server.py)
3. **Test**: Add test case to [test_comprehensive.py](mcp:test_comprehensive.py)
4. **Validate**: Run full test suite
5. **Document**: Update [README.md](mcp:README.md) if needed
### Bug Fixes
1. **Reproduce**: Use tests to confirm bug
2. **Fix**: Implement solution
3. **Verify**: Confirm fix with tests
4. **Regression**: Run full test suite
5. **Document**: Update test expectations
### Configuration Changes
1. **Test current**: Baseline with existing config
2. **Change**: Update [.env](mcp:.env) or [server.py](mcp:src/osm_edit_mcp/server.py)
3. **Validate**: Test new configuration
4. **Document**: Update [README.md](mcp:README.md) with new options
5. **Compatibility**: Ensure backward compatibility
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.

