Communitygithub.com

AI 에이전트 도구 사용 패턴

도구 사용 패턴, 다단계 추론, 에이전트 오케스트레이션 및 구조화된 출력을 제공합니다.

AI 에이전트 도구 사용 패턴란 무엇인가요?

이 스킬은 AI 에이전트가 도구를 효과적으로 사용하고 복잡한 작업을 수행하는 방법을 설명합니다. 개발자는 타입이 지정된 함수 형태로 도구를 정의하고, 모델이 적절한 도구를 선택하여 호출하는 다단계 루프 패턴을 사용할 수 있습니다. 주요 기능으로는 Zod를 사용한 구조화된 출력, 최대 단계 수 제한으로 무한 루프 방지, 일시적 오류 처리를 위한 재시도 로직, 복잡한 작업을 하위 에이전트로 분할하는 오케스트레이션 등이 있습니다. Claude Code, Cursor, Codex와 같은 AI 에이전트 플랫폼에서 실시간 가시성을 위해 `streamText`와 `onToolCall`을 활용하며, 도구 결과 검증과 적절한 권한 범위 지정을 강조합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/ai-agents

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

AI 에이전트

규칙

  • 도구를 설명이 포함된 타입 함수로 정의 — 모델이 호출할 도구를 선택합니다
  • 도구 스키마: { name, description, parameters: zodSchema, execute: async (args) => result }
  • 다단계 루프: 메시지 전송 → 모델이 도구 호출 반환 → 도구 실행 → 결과를 다시 주입 → 완료될 때까지 반복
  • 무한 루프 방지를 위한 maxSteps 제한 — 복잡성에 따라 기본 5-10단계
  • Zod를 사용한 구조화된 출력: generateObject({ schema: z.object({...}) })로 보장된 형태 사용
  • 재시도 로직: 도구 실행을 try/catch로 감싸고 일시적 오류에 대해 지수 백오프로 2-3회 재시도
  • 에이전트 오케스트레이션: 복잡한 작업을 집중된 도구 세트를 가진 하위 에이전트로 분할, 코디네이터 에이전트가 위임
  • 모델에 피드백하기 전에 항상 도구 결과 검증 — 신뢰할 수 없는 데이터 정리
  • 에이전트 추론에 실시간 가시성을 위해 streamText와 onToolCall 사용

패턴

// 도구 정의
const tools = {
  searchDatabase: tool({
    description: "제품 데이터베이스 검색",
    parameters: z.object({ query: z.string(), limit: z.number().default(10) }),
    execute: async ({ query, limit }) => db.products.search(query, limit),
  }),
};

// 에이전트 루프
const result = await generateText({
  model,
  tools,
  maxSteps: 10,
  messages,
});

피해야 할 사항

  • 에이전트에 제한 없는 도구 접근 권한 부여 — 작업에 맞게 도구 범위 지정
  • maxSteps 누락 — 에이전트가 영원히 루프할 수 있음
  • 검증 없이 도구 출력 신뢰 — 결과에 따라 조치하기 전에 항상 확인
  • 모놀리식 에이전트 — 20개 이상의 도구를 가진 하나의 에이전트보다 집중된 하위 에이전트 선호

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

관련 스킬