Skip to main content

software-architecture-monolith

Guides the design and implementation of monolithic architecture, focusing on best practices and pitfalls in monolithic systems.

跳到安装

来源信息

仓库
paulpas/agent-skill-router
最近来源活动
2026年6月10日 18:00
检测到的 SKILL.md 语言
英语
星标
4
分支
1

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
software-architecture-monolith
description
Guides the design and implementation of monolithic architecture, focusing on best practices and pitfalls in monolithic systems.
license
MIT
compatibility
opencode
metadata
{"version":"1.0.0","domain":"coding","triggers":"monolith, monolithic architecture, monolith design, monolith patterns","archetypes":["tactical","generation"],"anti_triggers":["brainstorming","vague ideation","code golf","over-engineering"],"response_profile":{"verbosity":"low","directive_strength":"high","abstraction_level":"operational"},"role":"implementation","scope":"implementation","output-format":"code","related-skills":"software-architecture-microservices, software-architecture-event-driven, software-architecture-hexagonal"}
# Monolithic Architecture archetypes: tactical, educational anti_triggers: microservices response_profile: verbosity: medium directive_strength: high abstraction_level: tactical Guides the design and implementation of monolithic architecture, focusing on best practices and pitfalls in monolithic systems. ## When to Use ### Key Takeaways - Use this skill when building applications that require fast development cycles. - Suitable for applications that are less complex and easier to manage with traditional patterns. ### Archetypes - **Tactical**: Helps guide application developers in making choices around monolithic designs. - **Educational**: Offers insights into best practices for building in a monolithic style. ### Anti-Triggers - **Microservices**: Avoid contexts that suggest migration to services without clear benefits. ### Response Profile - **Verbosity**: Medium - **Directive Strength**: High - **Abstraction Level**: Tactical - When building small to medium-sized applications. - For applications that require a quick go-to-market strategy. - When simplicity is prioritized over scalability. ## Core Workflow 1. **Model the Application** – Design the complete application in a single repository. 2. **Define Interfaces** – Create clear dependencies within the app. 3. **Optimize as Necessary** – Profile and refactor for performance improvements. ## Implementation Patterns ### Additional Examples of Monolithic Architecture 1. **Order Management Example** – Here’s an example of managing orders within a monolithic architecture: ```python class OrderService: def __init__(self): self.orders = [] def add_order(self, order): self.orders.append(order) # Logic to persist order in a database print(f'Added order: {order}') # Example of Order and OrderService classes usage: order_service = OrderService() order_service.add_order({"item": "Laptop", "quantity": 1}) ``` 2. **Product Catalog Example** – A common approach for managing product catalogs: ```python class Product: def __init__(self, name, price): self.name = name self.price = price class ProductService: def __init__(self): self.products = [] def add_product(self, product): self.products.append(product) # Logic to save product to the database print(f'Added product: {product.name}') # Example usage: product_service = ProductService() product_service.add_product(Product('Smartphone', 599.99)) ``` 3. **Performance Optimization Example** – Using efficient memory management and caching strategies: ```python class Cache: def __init__(self): self.data = {} def get(self, key): return self.data.get(key) def set(self, key, value): self.data[key] = value # Logic for caching results ``` 4. **Best Practices** – A guide for scalability and maintainability of the monolith: - Implement logging and tracing strategies to detect bottlenecks. - Define clear module boundaries and document architectural decisions. - Ensure that performance is regularly reviewed and optimized as the application grows. ### Enhanced Examples of Monolithic Architecture 1. **Order Management Example** – Here’s an example of managing orders within a monolithic architecture: ```python class OrderService: def __init__(self): self.orders = [] def add_order(self, order): self.orders.append(order) # Logic to persist order in a database print(f'Added order: {order}') # Example of Order and OrderService classes usage: order_service = OrderService() order_service.add_order({"item": "Laptop", "quantity": 1}) ``` This shows how orders can be added and managed directly within a single application flow. 2. **Product Catalog Example** – A common approach for managing product catalogs: ```python class Product: def __init__(self, name, price): self.name = name self.price = price class ProductService: def __init__(self): self.products = [] def add_product(self, product): self.products.append(product) # Logic to save product to the database print(f'Added product: {product.name}') # Example usage: product_service = ProductService() product_service.add_product(Product('Smartphone', 599.99)) ``` 3. **Performance Optimization Example** – Using efficient memory management and caching strategies: ```python class Cache: def __init__(self): self.data = {} def get(self, key): return self.data.get(key) def set(self, key, value): self.data[key] = value # Logic for caching results ``` 4. **Best Practices** – A guide for scalability and maintainability of the monolith: - Implement logging and tracing strategies to detect bottlenecks. - Define clear module boundaries and document architectural decisions. - Ensure that performance is regularly reviewed and optimized as the application grows. ### Pattern 1: Modular Monolith ```python class Order: def __init__(self, item, quantity): self.item = item self.quantity = quantity class OrderService: def __init__(self): self.orders = [] def add_order(self, order): self.orders.append(order) # Persist order in a monolithic database ``` ## Constraints ### MUST DO - Keep architecture well-documented. - Separate concerns via modules within the monolith.
在 GitHub 查看