← ClaudeAtlas

library-design-patternslisted

Two-tier design, progressive enhancement, non-blocking patterns, and security-first architecture for Python libraries. Use when creating or refactoring Python libraries. TRIGGER when: library design, module architecture, reusable component, two-tier. DO NOT TRIGGER when: simple scripts, config files, documentation-only changes.
akaszubski/autonomous-dev · ★ 29 · Web & Frontend · score 68
Install: claude install-skill akaszubski/autonomous-dev
# Library Design Patterns Skill Standardized architectural patterns for Python library design in the autonomous-dev plugin ecosystem. Promotes reusability, testability, security, and maintainability through proven design patterns. ## When This Skill Activates - Creating new Python libraries - Refactoring existing libraries - Designing reusable components - Implementing CLI interfaces - Validating library architecture - Keywords: "library", "module", "two-tier", "progressive enhancement", "cli", "api" --- ## Core Design Patterns ### 1. Two-Tier Design Pattern **Definition**: Separate core logic (library) from user interface (CLI script) to maximize reusability and testability. **Structure**: - **Tier 1 (Core Library)**: Pure Python module with business logic, no I/O assumptions - **Tier 2 (CLI Interface)**: Thin wrapper script for command-line usage, handles argparse and user interaction **Benefits**: - Reusability: Core logic can be imported and reused in other contexts - Testability: Pure functions are easier to unit test without mocking I/O - Separation of Concerns: Business logic separate from presentation layer - Maintainability: Changes to CLI don't affect core logic and vice versa **Example**: ``` plugin_updater.py # Core library - pure logic update_plugin.py # CLI interface - user interaction ``` **When to Use**: - Any library that might be used both programmatically and from command line - Complex business logic that needs thorough testing - Fe