본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)19k · #10491

iii-architecture-patterns

하는 일

iii의 구성 요소를 조합해 워크플로, 반응형 백엔드, 이벤트 기반 시스템 같은 더 큰 백엔드 설계를 보여 줍니다. 단일 함수보다 큰 시스템을 설계하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓재시도와 단계별 추적이 필요한 여러 단계 작업이 있을 때.
  • ✓데이터가 바뀌어도 화면과 캐시를 최신 상태로 유지하고 싶을 때.
  • ✓여러 AI 에이전트가 서로 작업을 넘겨줘야 할 때.

스킬 링크

https://github.com/iii-hq/iii/blob/main/skills/iii-architecture-patterns/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/iii-hq/iii/blob/main/skills/iii-architecture-patterns/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“주문 처리를 위한 내구성 워크플로를 설계해 주세요. 재시도 기능과, 실패한 작업을 모아 두는 dead-letter 큐를 포함해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 요구 사항에 맞는 패턴을 고릅니다. 예를 들어 재시도가 필요하면 내구성 워크플로를, 다른 함수의 결과에 반응해야 하면 옵저버를 씁니다. 그다음 함수, 트리거, 큐, 상태를 조합해 설계를 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Architecture Patterns

Use this skill when the task is larger than one function or trigger. Pick the pattern from the requirement, then implement it with Function, Trigger, Worker, observers, state, queues, streams, and pub/sub.

Pattern Map

Requirement Pattern iii shape
Sequential work with retries, DLQ, step tracking Durable workflow Functions chained through named queues, progress in state
Keep views, metrics, cache, or clients in sync Reactive backend State triggers plus stream/pubsub side effects
React to another function's calls, results, or failures without changing it Observer side effect iii.observe({ function_id, on, filters }, target) (iii-observe)
Specialized AI agents hand work to each other Agentic backend One function per agent, queue handoffs, shared state
Commands publish events and projections update independently Event-driven CQRS Command functions, event log in state, subscribe triggers
Pure, traceable composition Effect pipeline Small functions composed synchronously with trigger()
Webhook/cron automation chains Low-code automation Trigger, transform, action nodes chained by enqueue

Durable Workflow

Use named queues when steps need different retry, FIFO, or concurrency policy.

TypeScript

import { registerWorker, TriggerAction } from "iii-sdk";

const iii = registerWorker("ws://localhost:49134", { workerName: "order-workflow" });

async function track(orderId: string, step: string, status: string) {
  await iii.trigger({
    function_id: "state::update",
    payload: { scope: "orders", key: orderId, ops: [{ type: "merge", path: ["steps"], value: { [step]: status } }] },
  });
}

iii.registerFunction("orders::validate", async (order) => {
  await track(order.id, "validate", "done");
  return iii.trigger({
    function_id: "orders::charge",
    payload: order,
    action: TriggerAction.Enqueue({ queue: "order-payment" }),
  });
});

iii.registerFunction("orders::charge", async (order) => {
  await track(order.id, "payment", "done");
  return iii.trigger({
    function_id: "orders::ship",
    payload: order,
    action: TriggerAction.Enqueue({ queue: "order-ship" }),
  });
});

Python

from iii import register_worker

iii = register_worker("ws://localhost:49134")

def track(order_id, step, status):
    iii.trigger({
        "function_id": "state::update",
        "payload": {
            "scope": "orders",
            "key": order_id,
            "ops": [{"type": "merge", "path": ["steps"], "value": {step: status}}],
        },
    })

def validate(order):
    track(order["id"], "validate", "done")
    return iii.trigger({
        "function_id": "orders::charge",
        "payload": order,
        "action": {"type": "enqueue", "queue": "order-payment"},
    })

iii.register_function("orders::validate", validate)

Rust

use iii_sdk::TriggerAction;
use iii_sdk::protocol::TriggerRequest;
use serde_json::json;

async fn enqueue_charge(iii: iii_sdk::IIIClient, order: serde_json::Value) -> Result<serde_json::Value, iii_sdk::Error> {
    iii.trigger(TriggerRequest {
        function_id: "state::update".into(),
        payload: json!({
            "scope": "orders",
            "key": order["id"],
            "ops": [{ "type": "merge", "path": ["steps"], "value": { "validate": "done" } }]
        }),
        action: None,
        timeout_ms: None,
    }).await?;

    iii.trigger(TriggerRequest {
        function_id: "orders::charge".into(),
        payload: order,
        action: Some(TriggerAction::Enqueue { queue: "order-payment".into() }),
        timeout_ms: None,
    }).await
}

Reactive Backend

Use state triggers when the requirement says "after create/update, do this", "avoid polling", or "push live updates".

iii.registerFunction("todos::on-change", async (event) => {
  await iii.trigger({
    function_id: "stream::send",
    payload: { stream_name: "todos-live", group_id: "default", data: event.new_value },
    action: TriggerAction.Void(),
  });
});

iii.registerTrigger({
  type: "state",
  function_id: "todos::on-change",
  config: { scope: "todos" },
});

Observer Side Effects

Use an observer when "after X runs (or fails), also do Y" and X should not know about Y: audit logs, alerts, projections, cache invalidation. Every function is observable since 0.25, and an observer failure never affects the observed cal

자주 묻는 질문

여기서 dead-letter 큐는 무엇인가요?

재시도 후에도 실패한 작업을 담아 두는 큐이며, 나중에 살펴볼 수 있습니다.

기존 함수를 수정하나요?

일부 패턴, 예를 들어 옵저버는 다른 함수의 호출에 반응하지만, 그 함수 자체는 바꾸지 않습니다.

어떤 패턴이 포함되나요?

내구성 워크플로, 반응형 백엔드, 옵저버, 에이전트 파이프라인, 이벤트 기반 설계, 효과 파이프라인, 자동화 체인입니다.

상세 정보

작성자의 원본 설명

Use when composing iii primitives into backend architectures: durable workflows, reactive backends, observer side effects, agentic pipelines, event-driven CQRS, effect pipelines, and trigger-transform-action automation.

repo: iii-hq/iii

인기도

GitHub 스타
19k
순위
#10491
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬