ワンクリックで
clean-architecture
Apply Clean Architecture boundaries to keep domain logic isolated from frameworks and infrastructure.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Apply Clean Architecture boundaries to keep domain logic isolated from frameworks and infrastructure.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | clean-architecture |
| description | Apply Clean Architecture boundaries to keep domain logic isolated from frameworks and infrastructure. |
| origin | FlowDeck |
When designing or implementing a new feature or service that needs clear separation of concerns, testability, and independence from frameworks, databases, or UI libraries.
// Domain Layer - Enterprise Business Rules (innermost circle)
class Order {
constructor(
private readonly id: string,
private readonly items: OrderItem[],
private readonly status: OrderStatus
) {}
get total(): number {
return this.items.reduce((sum, item) => sum + item.price * item.quantity, 0)
}
canBeFulfilled(): boolean {
return this.status === 'pending' && this.items.length > 0
}
}
// Application Layer - Application Business Rules
interface OrderRepository {
findById(id: string): Promise<Order | null>
save(order: Order): Promise<void>
}
interface NotificationService {
sendOrderConfirmation(order: Order): Promise<void>
}
class PlaceOrderUseCase {
constructor(
private readonly orderRepo: OrderRepository,
private readonly notifier: NotificationService
) {}
async execute(orderData: OrderData): Promise<Order> {
const order = new Order(orderData.id, orderData.items, 'pending')
if (!order.canBeFulfilled()) {
throw new InvalidOrderError('Order cannot be fulfilled')
}
await this.orderRepo.save(order)
await this.notifier.sendOrderConfirmation(order)
return order
}
}
// Infrastructure Layer - Interface Adapters (outermost circle)
class PostgresOrderRepository implements OrderRepository {
async findById(id: string): Promise<Order | null> {
// Database implementation
}
async save(order: Order): Promise<void> {
// Database implementation
}
}
class EmailNotificationService implements NotificationService {
async sendOrderConfirmation(order: Order): Promise<void> {
// Email implementation
}
}
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.