AI skill for writing senior-engineer quality code using SOLID principles, TDD, and clean architecture. Benefits operations teams by improving code quality and maintainability. Integrates with development workflows and connects to code repositories.
git clone https://github.com/ramziddin/solid-skills.gitAI skill for writing senior-engineer quality code using SOLID principles, TDD, and clean architecture. Benefits operations teams by improving code quality and maintainability. Integrates with development workflows and connects to code repositories.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/ramziddin/solid-skillsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Write a Python class for a [COMPANY] inventory management system that adheres to SOLID principles. Use Test-Driven Development (TDD) and clean architecture. The class should handle [INDUSTRY]-specific inventory tracking, including [DATA] validation and error handling. Provide unit tests and a brief explanation of how each SOLID principle is applied.
```python
# Inventory Management System - SOLID Principles Implementation
class InventoryManager:
def __init__(self, inventory_repository):
self.inventory_repository = inventory_repository
def update_inventory(self, item_id, quantity):
if not self._validate_quantity(quantity):
raise ValueError("Invalid quantity")
self.inventory_repository.update(item_id, quantity)
def _validate_quantity(self, quantity):
return quantity > 0
# Unit Tests
import unittest
from unittest.mock import MagicMock
class TestInventoryManager(unittest.TestCase):
def setUp(self):
self.mock_repository = MagicMock()
self.inventory_manager = InventoryManager(self.mock_repository)
def test_update_inventory_valid_quantity(self):
self.inventory_manager.update_inventory(1, 10)
self.mock_repository.update.assert_called_once_with(1, 10)
def test_update_inventory_invalid_quantity(self):
with self.assertRaises(ValueError):
self.inventory_manager.update_inventory(1, -5)
# SOLID Principles Explanation
- **Single Responsibility Principle (SRP)**: The InventoryManager class has a single responsibility of managing inventory updates.
- **Open/Closed Principle (OCP)**: The class is open for extension (e.g., adding new validation rules) but closed for modification.
- **Liskov Substitution Principle (LSP)**: The InventoryManager can be substituted with any class that adheres to the same interface.
- **Interface Segregation Principle (ISP)**: The class depends on a specific interface (InventoryRepository) rather than a general one.
- **Dependency Inversion Principle (DIP)**: The class depends on abstractions (InventoryRepository) rather than concrete implementations.
```We help brands & institutions organize data, gain insight, engage customers, improve workflow, get more done.
IronCalc is a spreadsheet engine and ecosystem
Service Management That Turns Chaos Into Control
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power