create-atomic-context-provider
하는 일
에이전트가 실행될 때마다 시스템 프롬프트에 제목이 있는 블록을 추가하는 컨텍스트 제공자를 작성하는 방법을 설명합니다. 현재 정보나 검색된 정보를 에이전트가 알기를 원하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓개발자가 호출할 때마다 에이전트가 현재 시간이나 사용자 신원을 알기를 원할 때.
- ✓개발자가 검색된 문서를 에이전트 프롬프트에 넣고 싶을 때.
- ✓두 에이전트가 같은 세션 정보를 공유해야 할 때.
스킬 링크
https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/create-atomic-context-provider/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“현재 사용자의 이름과 저장된 선호를 제 에이전트에 알려 주는 컨텍스트 제공자를 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 데이터가 어디에서 오는지, 얼마나 최신이어야 하는지 묻고, 제목이 있는 블록을 반환하는 제공자 클래스를 작성한 뒤 에이전트에 등록하라고 안내합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Create an Atomic Agents Context Provider
A context provider injects a named, titled block into the agent's system prompt at every run(). The base prompt stays static; the context is what changes between calls.
For deep material (caching strategies, async data sources, multi-agent sharing patterns), the authority is ../framework/references/context-providers.md. This skill is the action-oriented path: clarify → write → register.
When this fires vs the umbrella framework skill
- This skill: the user wants to add a provider — "inject the user's name", "make the agent see the current time", "feed retrieved docs into the prompt", "share session state across two agents".
frameworkskill: questions about Atomic Agents in general, or about something other than authoring a provider.
Phase 1 — Clarify
Bundle into one message:
- What goes into the prompt? One sentence. Defines the provider's job.
- Where does the data come from? In-memory state mutated by your code? A vector DB lookup? A REST call? A clock?
- How fresh must it be? Per-
run()(default), every N seconds (cache), or refreshed externally before each call (async data). - Which agent(s)? One agent, or shared across multiple agents?
Skip what's already obvious from context.
Phase 2 — Plan
Confirm in one short block:
- File:
<project>/context_providers.py(or alongside the agent that owns it). - Class:
<Topic>Ctx(BaseDynamicContextProvider). - Title (rendered as the section header in the prompt) — must be unique across providers on the same agent.
- Update mechanism: mutate fields between
run()calls (most common), set via a method, orawait refresh()for async sources.
Phase 3 — Implement
Skeleton
from atomic_agents.context import BaseDynamicContextProvider
class UserCtx(BaseDynamicContextProvider):
def __init__(self):
super().__init__(title="User Context")
self.name: str = ""
self.role: str = ""
def get_info(self) -> str:
if not self.name:
return "No user is logged in."
return f"User: {self.name} (role: {self.role})"
get_info() is synchronous and runs on every agent.run() — keep it cheap. No HTTP, no DB queries, no file I/O. Cache slow sources (see "Cached" pattern below). For async data sources, await provider.refresh() from your loop before calling the agent.
Common patterns
Time — read-only, no state mutation needed:
from datetime import datetime, timezone
class TimeCtx(BaseDynamicContextProvider):
def __init__(self):
super().__init__(title="Current Time")
def get_info(self) -> str:
return datetime.now(timezone.utc).isoformat()
RAG / retrieved docs — set externally, read inside get_info():
class RAGCtx(BaseDynamicContextProvider):
def __init__(self):
super().__init__(title="Retrieved Documents")
self.docs: list[dict] = []
def set(self, docs: list[dict]) -> None:
self.docs = docs
def get_info(self) -> str:
if not self.docs:
return "No relevant documents retrieved."
return "\n\n".join(f"[{d['source']}] {d['content']}" for d in self.docs)
# In the calling code, just before agent.run():
rag.set(vector_db.search(query, k=4))
agent.run(query_input)
Session — mutable key/value state shared across agents:
class SessionCtx(BaseDynamicContextProvider):
def __init__(self):
super().__init__(title="Session")
self._data: dict[str, str] = {}
def set(self, key: str, value: str) -> None:
self._data[key] = value
def get_info(self) -> str:
if not self._data:
return "No session state."
return "\n".join(f"- {k}: {v}" for k, v in self._data.items())
Cached — for slow sources (DB schema, expensive computation):
import time
class DBSchemaCtx(BaseDynamicContextProvider):
def __init__(self, conn, ttl_seconds: int = 300):
super().__init__(title="Database Schema")
self._conn = conn
self._ttl = ttl_seconds
self._cached: str = ""
self._at: float = 0.0
def get_info(self) -> str:
now = time.time()
if not self._cached or now - self._at > self._ttl:
self._cached = render_schema(self._conn)
self._at = now
return self._cached
Async source — refresh outside, read sync inside:
clas
자주 묻는 질문
컨텍스트 제공자란 무엇인가요?
에이전트가 실행될 때 시스템 프롬프트에 이름이 있는 섹션을 추가하는 코드입니다.
기본 프롬프트를 바꾸나요?
아니요. 기본 프롬프트는 그대로 두고, 호출마다 주입되는 컨텍스트만 바뀝니다.
하나의 제공자를 여러 에이전트가 쓸 수 있나요?
네. 스킬은 여러 에이전트 사이에서 제공자를 공유하는 방법을 다룹니다.
상세 정보
작성자의 원본 설명
Build a `BaseDynamicContextProvider` that injects a named, titled block into an agent's system prompt at every `run()` — current time, user identity, retrieved RAG docs, session state, cached DB schema. Use when the user asks to "add a context provider", "inject X into the prompt", "give the agent dynamic context", "wire up RAG", "make a `BaseDynamicContextProvider`", or runs `/atomic-agents:create-atomic-context-provider`.
repo: Eigenwise/atomic-agents
인기도
- GitHub 스타
- 6.3k
- 순위
- #14238
- 라이선스
- MIT
- 업데이트
- 2026. 10. 29.
댓글
- …
이 저장소의 다른 스킬
create-atomic-agent
6.3k에이전트가 타입이 지정된 입력과 출력, 시스템 프롬프트, 선택한 AI 제공자로 새 Atomic Agents 에이전트를 만드는 데 도움을 줍니다.
create-atomic-schema
6.3k에이전트와 도구를 위한 타입이 있는 입력 및 출력 스키마를 명확한 필드 설명과 함께 설계하도록 돕습니다.
create-atomic-tool
6.3k에이전트가 호출할 수 있는 API 래퍼나 계산기 같은, 타입이 있는 Atomic Agents 도구를 만들도록 돕습니다.
framework
6.3k에이전트가 스키마, 에이전트, 도구, 프롬프트, 제공자 설정을 포함해 Atomic Agents Python 프레임워크를 올바르게 사용하도록 돕습니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.