arch-clean
arch-clean
Purpose
This skill implements Clean Architecture principles in codebases, focusing on hexagonal patterns with ports/adapters, dependency inversion, use cases, entities, and testability. It refactors or generates code to enforce separation of concerns, making systems modular and easier to test.
When to Use
Use this skill when refactoring monolithic apps to improve maintainability, starting new projects requiring high testability, or integrating external dependencies without tight coupling. Apply it in scenarios with complex business logic, such as e-commerce backends, or when adapting legacy code to modern architectures like microservices.
Key Capabilities
- Generate port interfaces for adapters, ensuring dependency inversion (e.g., defines contracts like
interface UserPort { fetchUser(id: string): User; }). - Create use case classes that orchestrate entities and ports, promoting single responsibility.
- Invert dependencies by wrapping external libraries in adapters, e.g., converting a direct database call to a port implementation.
- Enforce testability by structuring code for unit testing, such as mocking ports in use cases.
- Validate architecture rules, like checking that inner layers don't depend on outer ones, via static analysis.
Usage Patterns
Invoke this skill via OpenClaw's CLI for quick refactoring or through API for automated pipelines. Start by analyzing the codebase with a scan command, then apply transformations. For scripts, pipe outputs to build tools like Make or Gradle. Always specify the target directory and language (e.g., TypeScript or Java) to avoid defaults. Use in CI/CD for pre-commit hooks to enforce architecture.
More from alphaonedev/openclaw-graph
playwright-scraper
Playwright web scraping: dynamic content, auth flows, pagination, data extraction, screenshots
1.4Kgcp-iam
Manages identity and access control for Google Cloud resources using IAM policies and roles.
370humanize-ai-text
AI text humanization: reduce AI-detection patterns, natural phrasing, tone adjustment
262macos-automation
AppleScript, JXA, Shortcuts, Automator, osascript, System Events, accessibility API
173tavily-web-search
Tavily: web search optimized for AI agents, answer synthesis, domain filtering, depth control
155clawflows
OpenClaw workflow automation: multi-step task chains, conditional logic, triggers, schedule
102