원클릭으로
hexagonal-architecture
Ports-and-adapters architecture patterns for testable, framework-independent domain logic.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Ports-and-adapters architecture patterns for testable, framework-independent domain logic.
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 | hexagonal-architecture |
| description | Ports-and-adapters architecture patterns for testable, framework-independent domain logic. |
| origin | FlowDeck |
When building applications that must remain flexible to changing external systems (databases, APIs, UI frameworks) and need to support multiple entry points (ports) for the same business logic.
// Domain Core - Pure business logic, no infrastructure dependencies
class Transfer {
constructor(
public readonly fromAccountId: string,
public readonly toAccountId: string,
public readonly amount: number
) {}
execute(accounts: Map<string, Account>): TransferResult {
const from = accounts.get(this.fromAccountId)
const to = accounts.get(this.toAccountId)
if (!from || !to) {
return TransferResult.failed('Account not found')
}
if (!from.canDebit(this.amount)) {
return TransferResult.failed('Insufficient funds')
}
from.debit(this.amount)
to.credit(this.amount)
return TransferResult.success()
}
}
// Inbound Port (Primary Port) - Interface for driving operations
interface TransferUseCase {
execute(transfer: Transfer): TransferResult
}
// Outbound Port (Secondary Port) - Interface for driven operations
interface AccountRepository {
findById(id: string): Promise<Account | null>
save(account: Account): Promise<void>
}
interface EventBus {
publish(event: DomainEvent): Promise<void>
}
// Primary Adapter - REST API
class TransferController implements TransferUseCase {
constructor(private readonly accounts: AccountRepository) {}
async execute(transfer: Transfer): Promise<TransferResult> {
const allAccounts = await this.accounts.findById(transfer.fromAccountId)
// ... handle via injected port
}
}
// Secondary Adapter - PostgreSQL implementation
class PostgresAccountRepository implements AccountRepository {
constructor(private readonly db: Database) {}
// ... implementation
}