AI pair programming assistant configured for a Stock Verification System with FastAPI backend, React Native frontend, MongoDB writes, and read-only SQL Server ERP integration.
AI pair programming assistant configured for a Stock Verification System with strict architectural constraints and dual-database pattern.
This skill configures Aider to work on a stock verification application with:
**CRITICAL CONSTRAINTS:**
1. **SQL Server is READ-ONLY** - All write operations MUST go to MongoDB
2. **Always use parameterized queries (?)** for SQL - NEVER string concatenation
3. **JWT auth required** for all `/api/*` endpoints
4. **Follow existing code patterns** in the codebase
5. **Run tests before suggesting changes**
When working on this codebase:
1. **Model Configuration**
- Use Claude Sonnet 4 for primary edits with diff format
- Enable diff display to show all changes clearly
- Enable shell command suggestions when appropriate
2. **Reference Documentation (Read-Only)**
- Consult these files for context but never modify:
- `README.md` - Project overview
- `ARCHITECTURE.md` - System architecture
- `API_CONTRACTS.md` - API specifications
- `API_REFERENCE.md` - API documentation
- `.cursorrules` - Cursor IDE rules
- `.github/copilot-instructions.md` - Copilot guidance
3. **Database Access Patterns**
- For SQL Server queries:
```python
# CORRECT: Parameterized query
cursor.execute("SELECT * FROM Products WHERE id = ?", (product_id,))
# WRONG: String concatenation (SQL injection risk)
cursor.execute(f"SELECT * FROM Products WHERE id = {product_id}")
```
- For MongoDB writes:
```python
# Use Motor async driver
await db.collection.insert_one(document)
```
4. **Authentication Pattern**
- All API endpoints under `/api/*` require JWT authentication
- Check existing auth middleware for implementation pattern
- Verify token validation before processing requests
5. **Code Quality Workflow**
- Run linters before committing:
- Python: `cd backend && ruff check --fix {fname}`
- TypeScript: `cd frontend && npm run lint -- --fix`
- Run tests: `make test`
- Full CI check: `make ci`
6. **Testing Commands**
- Backend unit tests: `cd backend && pytest tests/ -v`
- Frontend tests: `cd frontend && npm test`
- Always run relevant tests after making changes
7. **Git Workflow**
- Manual commits (auto-commits disabled for review)
- Attribute commits to proper author/committer
- Use `.gitignore` and `.aiderignore` for exclusions
- Keep working directory clean before starting changes
8. **Code Map Configuration**
- Uses 2048 tokens for context mapping
- Auto-refresh enabled for current file context
- Helps maintain awareness of related code
**Adding a new API endpoint:**
```
Add a GET /api/products/{id} endpoint that:
1. Validates JWT token
2. Reads product from SQL Server (read-only)
3. Returns JSON response
4. Includes error handling
```
**Implementing a write operation:**
```
Create a POST /api/stock/verify endpoint that:
1. Validates JWT
2. Reads current stock from SQL Server
3. Writes verification result to MongoDB
4. Returns confirmation
```
**Fixing a security issue:**
```
Find and fix any SQL queries using string formatting instead of parameterized queries
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/aider-stock-verification-system/raw