Backend project rules for price repository with SVG graph output, comprehensive documentation standards, and API endpoint documentation requirements
Cursor rules for backend projects with emphasis on SVG graph generation, structured documentation, and comprehensive API endpoint documentation.
When working in this codebase, follow these rules strictly:
1. **Default SVG Output**: When generating graphs from any script, output format MUST be SVG (.svg) by default unless technically impossible.
2. **Format Justification**: If another format is required, include justification in the script or accompanying documentation.
3. **Implementation**: Ensure all plotting libraries are configured for SVG output (e.g., matplotlib's `savefig('output.svg', format='svg')`).
#### Directory Organization
1. Create main documentation directory: `documentacion/` at project root
2. Create subdirectories per subproject: `documentacion/{subproject}/`
3. Maintain README.md at project root
4. Create specific README.md in each `documentacion/{subproject}/`
#### Required Documents Per Subproject
Create these documents for each subproject:
1. **README.md**: General description, purpose, and structure overview
2. **arquitectura.md**: Detailed architectural design
3. **definicion_tecnica.md**: Exhaustive, abstract technical specification enabling reconstruction in another technology
4. **endpoints.md**: Complete endpoint documentation (APIs only)
#### Documentation Standards
#### Required Structure Per Endpoint
```markdown
**METHOD** `/route/endpoint`
Description of the endpoint.
#### Headers
```
Authorization: Bearer <token>
Content-Type: application/json
```
#### Parameters
```json
{
"field": "value"
}
```
#### Successful Response (200)
```json
{
"success": true,
"data": {}
}
```
#### Error Response (400)
```json
{
"success": false,
"message": "Error description"
}
```
#### Endpoint Characteristics
```
#### Required Sections in endpoints.md
1. **General Information**: Base URL, authentication, formats
2. **Grouped Endpoints**: By functionality (Authentication, Users, etc.)
3. **Error Codes**: HTTP and system-specific codes
4. **Usage Examples**: Complete flows
5. **Document Navigation**: Links to related documentation
#### Complete Error Documentation
Document ALL possible error responses:
1. **Commit Messages**: Use descriptive commits up to 255 characters
2. **Branching**: Follow established branching conventions
3. **Gitignore**: Keep .gitignore updated
4. **Sensitive Files**: Never commit sensitive files
#### Critical Commit Rules
1. **Before Committing**: Verify endpoint documentation is updated
2. **Include Documentation**: Include updated documentation in the same commit as code changes
3. **Acceptance Flow**: When accepting a feature, update documentation first, then proceed with commit
1. Optimize database queries
2. Implement caching when appropriate
3. Minimize unnecessary dependencies
4. Monitor API performance
1. **Implementing New Endpoint**:
- Write endpoint code
- Create/update endpoints.md with full documentation
- Test all response codes (success and errors)
- Update arquitectura.md if architecture changed
- Commit code + documentation together
2. **Generating Graphs**:
- Configure output as SVG by default
- If using matplotlib: `plt.savefig('output.svg', format='svg')`
- Document format choice in script comments
3. **Creating New Subproject**:
- Create `documentacion/{subproject}/` directory
- Create all required documents (README, arquitectura, definicion_tecnica, endpoints if API)
- Interlink documents
- Update main README.md
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/cursor-backend-development-rules-greenbornprecios/raw