{"id":"4f88c8b0-44c1-436e-95b5-e1c7c724d86f","shortId":"WTLayr","kind":"skill","title":"oracle-architect","tagline":"DDD and hexagonal architecture with functional core pattern. Use when designing features, modeling domains, breaking down tasks, or understanding component responsibilities.","description":"# Architect Skill\n\nDomain-Driven Design and hexagonal architecture with functional core pattern for feature design.\n\n## Architecture Model\n\nUnified view of functional core and effectful edge:\n\n```\n          Effectful Edge (IO)              Functional Core (Pure)\n┌─────────────────────────────────┐    ┌──────────────────────────┐\n│  Router    → request parsing    │    │  Service  → orchestration│\n│  Consumer  → event handling     │───▶│  Entity   → domain rules │\n│  Client    → external APIs      │    │            → validation  │\n│  Producer  → event publishing   │◀───│            → transforms  │\n│  Repository→ data persistence   │    │                          │\n└─────────────────────────────────┘    └──────────────────────────┘\n```\n\n**Key Principle:** Business logic lives in the functional core (Service + Entity). IO operations live in the effectful edge. Core defines interfaces; edge implements them (dependency inversion).\n\n## Functional Core\n\nPure, deterministic components containing all business logic.\n\n### Service Layer\n\n**Responsibility:** Orchestrate business operations, coordinate between entities and repositories.\n\n**Characteristics:**\n- Pure functions that take data and return results\n- No IO operations (database, HTTP, file system)\n- Calls repositories through interfaces (dependency injection)\n- Composes entity operations into workflows\n- Returns success/error results\n\n**Example:**\n```typescript\nclass OrderService {\n  async createOrder(request: CreateOrderRequest): Promise<Result<Order>> {\n    // Validate with entity\n    const order = Order.fromRequest(request);\n    const validation = order.validate();\n    if (!validation.ok) return validation;\n\n    // Check business rules\n    const inventory = await this.inventoryRepo.checkAvailability(order.items);\n    if (!inventory.available) return Err('Items not available');\n\n    // Coordinate persistence\n    await this.inventoryRepo.reserve(order.items);\n    const saved = await this.orderRepo.save(order.toRecord());\n\n    return Ok(Order.fromRecord(saved));\n  }\n}\n```\n\n### Entity Layer\n\n**Responsibility:** Domain models, validation, business rules, data transformations.\n\n**Characteristics:**\n- Pure data structures with behavior\n- All validation logic\n- Data transformations (fromRequest, toRecord, toResponse)\n- Business rules and invariants\n- No IO, no framework dependencies\n\n**Example:**\n```typescript\nclass Order {\n  constructor(\n    public readonly id: string,\n    public readonly customerId: string,\n    public readonly items: OrderItem[],\n    public readonly status: OrderStatus,\n    public readonly total: number\n  ) {}\n\n  static fromRequest(req: CreateOrderRequest): Order {\n    return new Order(\n      generateId(),\n      req.customerId,\n      req.items.map(i => new OrderItem(i)),\n      'pending',\n      req.items.reduce((sum, i) => sum + i.price * i.quantity, 0)\n    );\n  }\n\n  toRecord(): OrderRecord {\n    return {\n      id: this.id,\n      customer_id: this.customerId,\n      items: JSON.stringify(this.items),\n      status: this.status,\n      total: this.total\n    };\n  }\n\n  validate(): Result<Order> {\n    if (this.items.length === 0) {\n      return Err('Order must have at least one item');\n    }\n    if (this.total < 0) {\n      return Err('Order total cannot be negative');\n    }\n    return Ok(this);\n  }\n\n  canCancel(): boolean {\n    return ['pending', 'confirmed'].includes(this.status);\n  }\n}\n```\n\n## Effectful Edge\n\nIO-performing components that interact with the outside world.\n\n### Router\n\n**Responsibility:** HTTP request handling, parsing, response formatting.\n\n**Characteristics:**\n- Parses HTTP requests into domain types\n- Calls service layer with parsed data\n- Formats service results into HTTP responses\n- Handles HTTP-specific concerns (status codes, headers)\n- No business logic\n\n**Example:**\n```typescript\nrouter.post('/orders', async (req, res) => {\n  const result = await orderService.createOrder(req.body);\n\n  if (result.ok) {\n    res.status(201).json(result.value.toResponse());\n  } else {\n    res.status(400).json({ error: result.error });\n  }\n});\n```\n\n### Repository\n\n**Responsibility:** Data persistence and retrieval.\n\n**Characteristics:**\n- Implements data access interface used by services\n- Converts between domain entities and database records\n- Handles database queries and transactions\n- No business logic or validation\n\n**Example:**\n```typescript\nclass OrderRepository {\n  async save(record: OrderRecord): Promise<OrderRecord> {\n    return await db.orders.create(record);\n  }\n\n  async findById(id: string): Promise<OrderRecord | null> {\n    return await db.orders.findOne({ id });\n  }\n}\n```\n\n## Component Matrix\n\nQuick reference for where things belong:\n\n| Concern | Component | Layer | Testability |\n|---------|-----------|-------|-------------|\n| Domain model | Entity | Core | Unit test (pure) |\n| Validation | Entity | Core | Unit test (pure) |\n| Business rules | Entity | Core | Unit test (pure) |\n| Orchestration | Service | Core | Unit test (stub repos) |\n| Data transforms | Entity | Core | Unit test (pure) |\n| HTTP parsing | Router | Edge | Integration test |\n| Data access | Repository | Edge | Integration test |\n| External APIs | Client | Edge | Integration test |\n| Event handling | Consumer | Edge | Integration test |\n| Event publishing | Producer | Edge | Integration test |\n\n## Task Breakdown\n\n### Bottom-Up Dependency Ordering\n\nImplementation order follows dependency chain:\n\n```\n1. Entity   → Domain models, validation, transforms\n2. Repository → Data access interfaces and implementations\n3. Service  → Business logic orchestration\n4. Router   → HTTP endpoints\n```\n\n**Rationale:** Each layer depends on layers below. Can't implement service without entity, can't implement router without service.\n\n### Task Granularity\n\n**One task per layer:**\n- Implement Order entity with validation\n- Implement OrderRepository with data access\n- Implement OrderService with business logic\n- Implement order API endpoints\n\n**For complex features, break down further:**\n- Entity: Order, OrderItem, OrderStatus\n- Repository: OrderRepository, InventoryRepository\n- Service: OrderService, PaymentService\n- Router: Order routes, Payment routes\n\n## Architect → Testing Flow\n\nArchitectural decisions inform testing strategy:\n\n```\nArchitect Outputs           →    Testing Inputs\n────────────────────────────────────────────────\nComponent responsibilities  →    What to test\nLayer boundaries           →    Where to test\nPure vs effectful          →    Unit vs integration\nEntity transformations     →    Property-based tests\nService orchestration      →    Stub-driven tests\n```\n\nThe testing skill uses architectural structure to determine:\n- What gets unit tested (core) vs integration tested (edge)\n- Where to place test boundaries\n- What to stub and what to test for real\n- What test cases validate business rules\n\n## Reference Materials\n\nFor detailed patterns and examples:\n\n- **See [references/ddd-patterns.md](references/ddd-patterns.md)** - Aggregates, Value Objects, Domain Events, Bounded Contexts, composition patterns\n- **See [references/data-modeling.md](references/data-modeling.md)** - Entity design principles, schema patterns, access pattern optimization, data transformation\n- **See [references/api-design.md](references/api-design.md)** - REST conventions, request/response contracts, error handling, versioning patterns","tags":["oracle","architect","atelier","martinffx","agent-skills","agentic-coding","anthropic","claude-code","claude-skills","code-review","codex","codex-skill"],"capabilities":["skill","source-martinffx","skill-oracle-architect","topic-agent-skills","topic-agentic-coding","topic-anthropic","topic-claude-code","topic-claude-skills","topic-code-review","topic-codex","topic-codex-skill","topic-opencode","topic-prompt-engineering","topic-sdd","topic-spec-driven-development"],"categories":["atelier"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/martinffx/atelier/oracle-architect","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add martinffx/atelier","source_repo":"https://github.com/martinffx/atelier","install_from":"skills.sh"}},"qualityScore":"0.461","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 23 github stars · SKILL.md body (7,372 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:05:22.734Z","embedding":null,"createdAt":"2026-05-10T07:03:11.617Z","updatedAt":"2026-05-18T19:05:22.734Z","lastSeenAt":"2026-05-18T19:05:22.734Z","tsv":"'/orders':391 '0':288,308,320 '1':555 '2':561 '201':403 '3':568 '4':573 '400':408 'access':421,520,564,611,746 'aggreg':729 'api':70,526,619 'architect':3,25,642,650 'architectur':7,33,41,645,686 'async':159,392,447,456 'avail':193 'await':184,196,201,397,453,464 'base':674 'behavior':223 'belong':474 'boolean':332 'bottom':546 'bottom-up':545 'bound':734 'boundari':660,703 'break':18,624 'breakdown':544 'busi':81,112,118,180,214,232,386,439,492,570,615,717 'call':141,365 'cancancel':331 'cannot':325 'case':715 'chain':554 'characterist':125,218,358,418 'check':179 'class':157,243,445 'client':68,527 'code':383 'complex':622 'compon':23,109,343,467,476,654 'compos':147 'composit':736 'concern':381,475 'confirm':335 'const':168,172,182,199,395 'constructor':245 'consum':62,533 'contain':110 'context':735 'contract':757 'convent':755 'convert':426 'coordin':120,194 'core':10,36,47,55,87,97,106,482,488,495,501,509,694 'createord':160 'createorderrequest':162,269 'custom':294 'customerid':252 'data':77,130,216,220,227,370,414,420,506,519,563,610,749 'databas':137,431,434 'db.orders.create':454 'db.orders.findone':465 'ddd':4 'decis':646 'defin':98 'depend':103,145,240,548,553,580 'design':14,30,40,742 'detail':722 'determin':689 'determinist':108 'domain':17,28,66,211,363,428,479,557,732 'domain-driven':27 'driven':29,680 'edg':50,52,96,100,339,516,522,528,534,540,698 'effect':49,51,95,338,666 'els':406 'endpoint':576,620 'entiti':65,89,122,148,167,208,429,481,487,494,508,556,589,604,627,670,741 'err':190,310,322 'error':410,758 'event':63,73,531,537,733 'exampl':155,241,388,443,725 'extern':69,525 'featur':15,39,623 'file':139 'findbyid':457 'flow':644 'follow':552 'format':357,371 'framework':239 'fromrequest':229,267 'function':9,35,46,54,86,105,127 'generateid':274 'get':691 'granular':597 'handl':64,354,377,433,532,759 'header':384 'hexagon':6,32 'http':138,352,360,375,379,513,575 'http-specif':378 'i.price':286 'i.quantity':287 'id':248,292,295,458,466 'implement':101,419,550,567,586,592,602,607,612,617 'includ':336 'inform':647 'inject':146 'input':653 'integr':517,523,529,535,541,669,696 'interact':345 'interfac':99,144,422,565 'invari':235 'inventori':183 'inventory.available':188 'inventoryrepositori':633 'invers':104 'io':53,90,135,237,341 'io-perform':340 'item':191,256,297,317 'json':404,409 'json.stringify':298 'key':79 'layer':115,209,367,477,579,582,601,659 'least':315 'live':83,92 'logic':82,113,226,387,440,571,616 'materi':720 'matrix':468 'model':16,42,212,480,558 'must':312 'negat':327 'new':272,278 'null':462 'number':265 'object':731 'ok':205,329 'one':316,598 'oper':91,119,136,149 'optim':748 'oracl':2 'oracle-architect':1 'orchestr':61,117,499,572,677 'order':169,244,270,273,311,323,549,551,603,618,628,638 'order.fromrecord':206 'order.fromrequest':170 'order.items':186,198 'order.torecord':203 'order.validate':174 'orderitem':257,279,629 'orderrecord':290,450,461 'orderrepositori':446,608,632 'orderservic':158,613,635 'orderservice.createorder':398 'orderstatus':261,630 'output':651 'outsid':348 'pars':59,355,359,369,514 'pattern':11,37,723,737,745,747,761 'payment':640 'paymentservic':636 'pend':281,334 'per':600 'perform':342 'persist':78,195,415 'place':701 'principl':80,743 'produc':72,539 'promis':163,451,460 'properti':673 'property-bas':672 'public':246,250,254,258,262 'publish':74,538 'pure':56,107,126,219,485,491,498,512,664 'queri':435 'quick':469 'rational':577 'readon':247,251,255,259,263 'real':712 'record':432,449,455 'refer':470,719 'references/api-design.md':752,753 'references/data-modeling.md':739,740 'references/ddd-patterns.md':727,728 'repo':505 'repositori':76,124,142,412,521,562,631 'req':268,393 'req.body':399 'req.customerid':275 'req.items.map':276 'req.items.reduce':282 'request':58,161,171,353,361 'request/response':756 'res':394 'res.status':402,407 'respons':24,116,210,351,356,376,413,655 'rest':754 'result':133,154,164,305,373,396 'result.error':411 'result.ok':401 'result.value.toresponse':405 'retriev':417 'return':132,152,177,189,204,271,291,309,321,328,333,452,463 'rout':639,641 'router':57,350,515,574,593,637 'router.post':390 'rule':67,181,215,233,493,718 'save':200,207,448 'schema':744 'see':726,738,751 'servic':60,88,114,366,372,425,500,569,587,595,634,676 'skill':26,684 'skill-oracle-architect' 'source-martinffx' 'specif':380 'static':266 'status':260,300,382 'strategi':649 'string':249,253,459 'structur':221,687 'stub':504,679,706 'stub-driven':678 'success/error':153 'sum':283,285 'system':140 'take':129 'task':20,543,596,599 'test':484,490,497,503,511,518,524,530,536,542,643,648,652,658,663,675,681,683,693,697,702,710,714 'testabl':478 'thing':473 'this.customerid':296 'this.id':293 'this.inventoryrepo.checkavailability':185 'this.inventoryrepo.reserve':197 'this.items':299 'this.items.length':307 'this.orderrepo.save':202 'this.status':301,337 'this.total':303,319 'topic-agent-skills' 'topic-agentic-coding' 'topic-anthropic' 'topic-claude-code' 'topic-claude-skills' 'topic-code-review' 'topic-codex' 'topic-codex-skill' 'topic-opencode' 'topic-prompt-engineering' 'topic-sdd' 'topic-spec-driven-development' 'torecord':230,289 'torespons':231 'total':264,302,324 'transact':437 'transform':75,217,228,507,560,671,750 'type':364 'typescript':156,242,389,444 'understand':22 'unifi':43 'unit':483,489,496,502,510,667,692 'use':12,423,685 'valid':71,165,173,178,213,225,304,442,486,559,606,716 'validation.ok':176 'valu':730 'version':760 'view':44 'vs':665,668,695 'without':588,594 'workflow':151 'world':349","prices":[{"id":"5200a18b-7922-4358-87e9-6004f77375e1","listingId":"4f88c8b0-44c1-436e-95b5-e1c7c724d86f","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"martinffx","category":"atelier","install_from":"skills.sh"},"createdAt":"2026-05-10T07:03:11.617Z"}],"sources":[{"listingId":"4f88c8b0-44c1-436e-95b5-e1c7c724d86f","source":"github","sourceId":"martinffx/atelier/oracle-architect","sourceUrl":"https://github.com/martinffx/atelier/tree/main/skills/oracle-architect","isPrimary":false,"firstSeenAt":"2026-05-10T07:03:11.617Z","lastSeenAt":"2026-05-18T19:05:22.734Z"}],"details":{"listingId":"4f88c8b0-44c1-436e-95b5-e1c7c724d86f","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"martinffx","slug":"oracle-architect","github":{"repo":"martinffx/atelier","stars":23,"topics":["agent-skills","agentic-coding","anthropic","claude-code","claude-skills","code-review","codex","codex-skill","opencode","prompt-engineering","sdd","spec-driven-development"],"license":"mit","html_url":"https://github.com/martinffx/atelier","pushed_at":"2026-05-18T06:56:45Z","description":"An atelier for Opencode, Claude Code, and other coding agents: spec-driven workflows, deep thinking, and code quality.","skill_md_sha":"1de957c628599b1b259a680b846c4b73d01edde5","skill_md_path":"skills/oracle-architect/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/martinffx/atelier/tree/main/skills/oracle-architect"},"layout":"multi","source":"github","category":"atelier","frontmatter":{"name":"oracle-architect","description":"DDD and hexagonal architecture with functional core pattern. Use when designing features, modeling domains, breaking down tasks, or understanding component responsibilities."},"skills_sh_url":"https://skills.sh/martinffx/atelier/oracle-architect"},"updatedAt":"2026-05-18T19:05:22.734Z"}}