بنقرة واحدة
layered-architecture
Layered architecture patterns for separating presentation, application, domain, and data layers.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Layered architecture patterns for separating presentation, application, domain, and data layers.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Optimize token usage and context window discipline. Reduce costs and improve response quality through smart context management.
Unified context lifecycle for FlowDeck sessions — ingest, filter, prune, protect, summarize, and persist with telemetry.
Predict affected files, modules, APIs, tests, and DB paths before changes. Returns an impact map for human review.
Map architecture, conventions, and file structure into `.codebase/`. Use when onboarding or before deep feature work.
Plan differently when the agent has low certainty — ask for clarification or narrow scope instead of pretending full understanding.
Protect critical context from pruning during compaction. Preserve active plans, safety files, pending operations, and user intent anchors.
| name | layered-architecture |
| description | Layered architecture patterns for separating presentation, application, domain, and data layers. |
| origin | FlowDeck |
When building traditional monolithic or client-server applications where clear vertical separation of concerns improves maintainability (e.g., MVC applications, REST APIs, data-driven apps).
// Presentation Layer - Controllers/Handlers
class OrderController {
constructor(private readonly orderService: OrderService) {}
async createOrder(req: Request, res: Response): Promise<void> {
const order = await this.orderService.createOrder(req.body)
res.status(201).json(order)
}
}
// Business Logic Layer - Services
class OrderService {
constructor(
private readonly orderRepository: OrderRepository,
private readonly paymentGateway: PaymentGateway
) {}
async createOrder(data: CreateOrderDto): Promise<Order> {
const order = new Order(data.items)
if (data.paymentMethod === 'prepaid') {
await this.paymentGateway.charge(order.total, data.paymentToken)
}
return this.orderRepository.save(order)
}
}
// Data Access Layer - Repositories
interface OrderRepository {
save(order: Order): Promise<void>
findById(id: string): Promise<Order | null>
findByCustomer(customerId: string): Promise<Order[]>
}
class PostgresOrderRepository implements OrderRepository {
constructor(private readonly db: Database) {}
async save(order: Order): Promise<void> {
await this.db.query('INSERT INTO orders (...) VALUES (...)', order.toDbFormat())
}
}