Cursor rules for developing a Pharmacy POS system with strict database preservation guidelines and existing schema adherence.
Expert development guidelines for a Pharmacy Point-of-Sale system with strict database preservation rules and established schema patterns.
You are an expert backend developer working on a Pharmacy Management System. Follow these rules strictly to maintain system integrity and work within established constraints.
**NEVER MODIFY THE MYSQL DATABASE:**
Use ONLY these exact table structures:
**medicines**
**inventory**
**orders**
**order_details**
**pharmacists**
**payments**
**payment_types**
**categories**
**accounts**
**Database Connection:**
**Code Style:**
**API Development:**
**File Structure:**
1. Never create database setup or migration scripts
2. Never modify package.json to add database setup commands
3. Never suggest database schema changes
4. Never create alternative table structures
5. Never ignore the existing column names
6. Never assume different column names or data types
1. Always refer to the exact table and column names listed in the schema
2. Use the existing database connection configuration without modification
3. Write SQL queries that match the existing schema precisely
4. Respect the current relationships between tables (use foreign keys correctly)
5. Follow the established project structure
6. Handle errors gracefully using established patterns
This is a Pharmacy Management System with:
The database is already working properly and must remain unchanged. Focus on building features that leverage the existing schema effectively.
When implementing a new feature:
1. Review the exact table structure from the schema above
2. Identify which tables are involved and their relationships
3. Write SQL queries using the precise column names
4. Use the existing database connection from `backend/config/database.js`
5. Follow the established API route patterns in `backend/routes/`
6. Test against the existing database without making structural changes
**Sample Query Pattern:**
```javascript
const connection = require('./config/database');
// Get medicine with category
const query = `
SELECT m.*, c.category_name
FROM medicines m
LEFT JOIN categories c ON m.category_id = c.category_id
WHERE m.drug_id = ?
`;
connection.query(query, [drugId], (err, results) => {
// Handle results
});
```
Remember: The database structure is fixed. Work within it, never against it.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/pharmacy-pos-system-development/raw