Communitygithub.com

컨텍스트 엔지니어링

컨텍스트 사용 한도 확인, 남은 시간 모니터링, 토큰 소비 최적화, 컨텍스트 실패 디버깅. 컨텍스트 비율, 속도 제한, 사용 경고, 컨텍스트 최적화, 에이전트 아키텍처, 메모리 시스템에 대해 물을 때 사용합니다.

컨텍스트 엔지니어링란 무엇인가요?

이 스킬은 LLM 작업의 추론 품질을 극대화하면서 토큰 사용을 최소화하는 '컨텍스트 엔지니어링' 원칙을 다룹니다. 에이전트 시스템 설계/디버깅, 컨텍스트 제한으로 인한 성능 저하 해결, 비용/지연 시간 최적화, 멀티 에이전트 조정, 메모리 시스템 구축, 에이전트 평가 등에 사용됩니다. 핵심 원칙은 컨텍스트 품질이 양보다 중요하며, 주의력은 유한하기 때문에 핵심 정보를 컨텍스트 시작/끝에 배치하고 점진적으로 공개하는 '4-버킷 전략(쓰기, 선택, 압축, 격리)'을 제안합니다. 시스템은 PostToolUse 훅을 통해 사용량 인식 정보를 자동 주입하며, 70% 및 90% 임계값에서 경고 및 최적화를 유도하고 Anthropic OAuth API와 상태 파일을 데이터 소스로 활용합니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/majiayu000/claude-skill-registry-data/tree/HEAD/context-management/context-engineering-hoanghd218-landing-page-ai-kien-2

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

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

문서

컨텍스트 엔지니어링은(는) 무엇을 하나요?

컨텍스트 엔지니어링은 LLM 작업을 위해 가장 작은 고신호 토큰 집합을 선별합니다. 목표: 토큰 사용을 최소화하면서 추론 품질을 극대화합니다.

활성화 시점

  • 에이전트 시스템 설계/디버깅
  • 컨텍스트 제한이 성능을 제약할 때
  • 비용/지연 시간 최적화
  • 멀티 에이전트 조정 구축
  • 메모리 시스템 구현
  • 에이전트 성능 평가
  • LLM 기반 파이프라인 개발

핵심 원칙

  1. 컨텍스트 품질 > 양 - 고신호 토큰이 포괄적인 콘텐츠보다 낫습니다.
  2. 주의력은 유한함 - U자 곡선은 시작/끝 위치를 선호합니다.
  3. 점진적 공개 - 정보를 적시에 로드합니다.
  4. 격리는 성능 저하를 방지 - 작업을 하위 에이전트에 분할합니다.
  5. 최적화 전에 측정 - 기준을 알아야 합니다.

중요:

  • 간결함을 위해 문법을 희생하세요.
  • 높은 품질을 유지하면서 토큰 효율성을 보장하세요.
  • 이 규칙을 하위 에이전트에 전달하세요.

빠른 참조

주제사용 시점참고 자료
기초컨텍스트 구조, 주의 메커니즘 이해context-fundamentals.md
성능 저하실패 디버깅, 중간 손실, 오염context-degradation.md
최적화압축, 마스킹, 캐싱, 분할context-optimization.md
압축긴 세션, 요약 전략context-compression.md
메모리세션 간 지속성, 지식 그래프memory-systems.md
멀티 에이전트조정 패턴, 컨텍스트 격리multi-agent-patterns.md
평가에이전트 테스트, LLM-as-Judge, 지표evaluation.md
도구 설계도구 통합, 설명 엔지니어링tool-design.md
파이프라인프로젝트 개발, 배치 처리project-development.md
런타임 인식사용 한도, 컨텍스트 창 모니터링runtime-awareness.md

주요 지표

  • 토큰 사용률: 70%에서 경고, 80%에서 최적화 트리거
  • 토큰 분산: 에이전트 성능 분산의 80% 설명
  • 멀티 에이전트 비용: 단일 에이전트 기준선의 약 15배
  • 압축 목표: 50-70% 감소, 품질 손실 <5%
  • 캐시 적중 목표: 안정적인 작업 부하에서 70%+

4-버킷 전략

  1. 쓰기: 컨텍스트를 외부에 저장 (스크래치패드, 파일)
  2. 선택: 관련 컨텍스트만 가져오기 (검색, 필터링)
  3. 압축: 정보를 보존하면서 토큰 줄이기 (요약)
  4. 격리: 하위 에이전트 간 분할 (파티셔닝)

안티 패턴

  • 선별된 컨텍스트 대신 포괄적인 컨텍스트
  • 중간 위치에 중요한 정보 배치
  • 한도 도달 전 압축 트리거 없음
  • 병렬화 가능한 작업에 단일 에이전트 사용
  • 명확한 설명이 없는 도구

지침

  1. 중요한 정보는 컨텍스트 시작/끝에 배치
  2. 70-80% 사용률에서 압축 구현
  3. 역할극이 아닌 컨텍스트 격리를 위해 하위 에이전트 사용
  4. 4-질문 프레임워크(무엇, 언제, 입력, 반환)로 도구 설계
  5. 요청당 토큰이 아닌 작업당 토큰 최적화
  6. 프로브 기반 평가로 검증
  7. 프로덕션에서 KV-캐시 적중률 모니터링
  8. 최소한으로 시작하고, 필요할 때만 복잡성 추가

런타임 인식

시스템은 PostToolUse 훅을 통해 사용량 인식을 자동으로 주입합니다:

<usage-awareness>
Claude Usage Limits: 5h=45%, 7d=32%
Context Window Usage: 67%
</usage-awareness>

임계값:

  • 70%: 경고 - 최적화/압축 고려
  • 90%: 심각 - 즉시 조치 필요

데이터 소스:

  • 사용 한도: Anthropic OAuth API (https://api.anthropic.com/api/oauth/usage)
  • 컨텍스트 창: 상태 라인 임시 파일 (/tmp/ck-context-{session_id}.json)

스크립트

Individual skills in this repo

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

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Analyzes current state and user query to answer BMad questions or recommend the next workflow or agent. Use when user says what should I do next, what do I do now, or asks a question about BMad

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Portfolio allocation and rebalancing optimizer. Manages asset allocation across stocks/cash/bonds, performs periodic rebalancing, and ensures diversification according to market regime and risk tolerance.

majiayu000/claude-skill-registry-data

Create a hilarious and ultra-realistic video of an anthropomorphic animal acting like a human vlogger in a real-world setting.

majiayu000/claude-skill-registry-data

Speech-to-text transcription and translation via OpenAI Audio API -- models, response formats, timestamps, prompting, streaming, chunking, and diarization

majiayu000/claude-skill-registry-data

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

majiayu000/claude-skill-registry-data

小省导购员数字人带货版即梦视频提示词生成系统,基于四大智能体协同(提示词生成师、质量管控师、知识库运维师、跨环节适配师),按照"主体+运动+场景+(镜头语言+光影+氛围)"公式输出中英文双版提示词,适配5s短视频。确保人物一致性、视觉连贯性、情绪连贯性,支持知识库智能复用和跨工具适配(Suno音乐、AI绘画),为数字人带货视频提供高质量提示词生成服务。

majiayu000/claude-skill-registry-data

Upload and manage files using Google Gemini File API via scripts/. Use for uploading images, audio, video, PDFs, and other files for use with Gemini models. Supports file upload, status checking, and file management. Triggers on "upload file", "file API", "upload image", "upload PDF", "upload video", "file management".

majiayu000/claude-skill-registry-data

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry-data

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry-data

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

majiayu000/claude-skill-registry-data

Conduct domain and industry research. Use when the user says "lets create a research report on [domain or industry]

majiayu000/claude-skill-registry-data

Conduct market research on competition and customers. Use when the user says "create a market research report about [business idea]".

majiayu000/claude-skill-registry-data

Conduct technical research on technologies and architecture. Use when the user says "create a technical research report on [topic]".

majiayu000/claude-skill-registry-data

Builds, edit or validate Agent Skill through conversational discovery. Use when the user requests to "Create an Agent", "Optimize an Agent" or "Edit an Agent".

관련 스킬