api-design
REST API design best practices covering versioning, error handling, pagination, and OpenAPI documentation. Use when designing or…
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
Claude Code
$ npx -y skills add akaszubski/autonomous-dev --skill library-design-patterns --agent claude-code
Codex
$ npx skills add akaszubski/autonomous-dev --skill library-design-patterns -a codex -y
Cursor
$ npx skills add akaszubski/autonomous-dev --skill library-design-patterns -a cursor -y
Gemini CLI
$ npx skills add akaszubski/autonomous-dev --skill library-design-patterns -a gemini-cli -y
GitHub Copilot
$ npx skills add akaszubski/autonomous-dev --skill library-design-patterns -a github-copilot -y
OpenCode
$ npx skills add akaszubski/autonomous-dev --skill library-design-patterns -a opencode -y
Windsurf
$ npx skills add akaszubski/autonomous-dev --skill library-design-patterns -a windsurf -y
name: library-design-patterns description: "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." allowed-tools: [Read]
Standardized architectural patterns for Python library design in the autonomous-dev plugin ecosystem. Promotes reusability, testability, security, and maintainability through proven design patterns.
---
**Definition**: Separate core logic (library) from user interface (CLI script) to maximize reusability and testability.
**Structure**:
**Benefits**:
**Example**:
plugin_updater.py # Core library - pure logic update_plugin.py # CLI interface - user interaction
**When to Use**:
**See**: `docs/two-tier-design.md`, `templates/library-template.py`, `examples/two-tier-example.py`
---
**Definition**: Start with simple validation (strings), progressively add stronger validation (Path objects, whitelists) without breaking existing code.
**Progression**: 1. **Level 1 (Strings)**: Accept string paths, basic validation 2. **Level 2 (Path Objects)**: Convert to pathlib.Path, add existence checks 3. **Level 3 (Whitelist Validation)**: Restrict to approved directories, prevent path traversal
**Benefits**:
**Example**:
# Level 1: Accept strings
def process(file: str) -> Result:
return _process_path(file)
# Level 2: Upgrade to Path objects
def process(file: Union[str, Path]) -> Result:
path = Path(file) if isinstance(file, str) else file
if not path.exists():
raise FileNotFoundError(f"File not found: {path}")
return _process_path(path)
# Level 3: Add whitelist validation
def process(file: Union[str, Path], *, allowed_dirs: Optional[List[Path]] = None) -> Result:
path = Path(file) if isinstance(file, str) else file
if allowed_dirs and not any(path.is_relative_to(d) for d in allowed_dirs):
raise SecurityError(f"Path outside allowed directories: {path}")
if not path.exists():
raise FileNotFoundError(f"File not found: {path}")
return _process_path(path)**See**: `docs/progressive-enhancement.md`, `examples/progressive-enhancement-example.py`
---
**Definition**: Design enhancements (features beyond core functionality) to never block core operations. If enhancement fails, core feature should still succeed.
**Principles**:
**Benefits**:
**Example**:
def implement_feature(spec: FeatureSpec) -> Result:
# Core operation (must succeed)
result = _implement_core_logic(spec)
# Enhancement: Auto-commit (may fail)
try:
if auto_commit_enabled():
commit_changes(result.files)
except Exception as e:
logger.warning(f"Auto-commit failed: {e}")
logger.info("Manual fallback: git add . && git commit")
# Feature succeeded regardless of enhancement
return result**See**: `docs/non-blocking-enhancements.md`, `examples/non-blocking-example.py`
---
**Definition**: Build security validation into library architecture from the start. Validate all inputs, sanitize outputs, audit all operations.
**Core Principles**:
**Security Layers**: 1. **Input Validation**: Type checking, range validation, format verification 2. **Path Validation**: Whitelist checking, symlink resolution, boundary verification 3. **Command Validation**: Argument array construction, shell prevention 4. **Output Sanitization**: Log message escaping, error message filtering 5. **Audi
A harness that wraps Claude Code with enforcement, specialist agents, and alignment gates to deliver consistent, production-grade software engineering outcomes.
REST API design best practices covering versioning, error handling, pagination, and OpenAPI documentation. Use when designing or…
Subprocess safety, GitHub CLI integration, retry logic, authentication, rate limiting, and timeout handling. Use when integrating…
File-by-file architecture planning with ADR format, dependency ordering, and testability gates. Use when designing system…
10-point code review checklist covering correctness, tests, error handling, type hints, naming, security, and performance. Use…
One topic, one home. Routes content to its canonical store (CLAUDE.md, PROJECT.md, MEMORY.md, docs/, memory/) and audits for…
Systematic debugging methodology — reproduce, isolate, bisect, fix, verify. Use when diagnosing failures, tracing errors, or…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.