프롬프트 조립
기준일: 2026-07-26
난이도: 중급
공식 기준: Prompt Assembly
개요
시스템 프롬프트 레이어 조립, 캐시 안정성, SOUL/MEMORY/스킬/컨텍스트 파일 주입을 설명합니다.
핵심 개념
| 레이어 | 내용 |
|---|---|
| Identity / SOUL | 정체성 |
| Tool guidance | 도구 사용 지침 |
| MEMORY / USER | 동결 스냅샷 |
| Skills index | 목록만 |
| Context files | AGENTS.md 등 |
| Ephemeral | 시각·세션 메타 |
상세
캐시되는 시스템 프롬프트 레이어
원문 절: Cached system prompt layers
- Concrete example: assembled system prompt — 공식 하위 절. 구현·설정 세부 원문 참조.
- stable
- context
- volatile
Persistent Memory
- 이 절의 절차·표·코드는 공식 원문을 기준으로 적용한다.
User Profile
- 이 절의 절차·표·코드는 공식 원문을 기준으로 적용한다.
Skills (mandatory)
- 이 절의 절차·표·코드는 공식 원문을 기준으로 적용한다.
AGENTS.md
- 이 절의 절차·표·코드는 공식 원문을 기준으로 적용한다.
플랫폼 힌트 커스터마이즈
원문 절: Customizing platform hints
- stable
platform_hints:
whatsapp:
append: >
When tabular output would be useful, invoke the table_formatting
skill instead of emitting a Markdown table.
slack:
replace: "You are on Slack. Keep responses tight and avoid wide tables."
telegram: "Prefer short messages; split long answers." # shorthand = append
프롬프트에 SOUL.md가 나타나는 방식
원문 절: How SOUL.md appears in the prompt
- 이 절의 절차·표·코드는 공식 원문을 기준으로 적용한다.
# From agent/prompt_builder.py (simplified)
def load_soul_md() -> Optional[str]:
soul_path = get_hermes_home() / "SOUL.md"
if not soul_path.exists():
return None
content = soul_path.read_text(encoding="utf-8").strip()
content = _scan_context_content(content, "SOUL.md") # Security scan
content = _truncate_content(content, "SOUL.md") # Cap defaults to 20k chars, configurable
return content
컨텍스트 파일 주입 방식
원문 절: How context files are injected
- Context file discovery details — 공식 하위 절. 구현·설정 세부 원문 참조.
- priority system
- Security scanned
- Truncated
- YAML frontmatter stripped
| Priority | Files | Search scope | Notes |
|---|---|---|---|
| 1 | .hermes.md, HERMES.md |
CWD up to git root | Hermes-native project config |
| 2 | AGENTS.md |
CWD only | Common agent instruction file |
| 3 | CLAUDE.md |
CWD only | Claude Code compatibility |
| 4 | .cursorrules, .cursor/rules/*.mdc |
CWD only | Cursor compatibility |
API-call-time-only layers
- user message
Memory snapshots
- volatile tier
Context files
.hermes.md/HERMES.md(walks to git root)AGENTS.md(CWD at startup; subdirectories discovered progressively during the session via `agent/subdirectory_hints...CLAUDE.md(CWD only).cursorrules/.cursor/rules/*.mdc(CWD only)
Skills index
- 이 절의 절차·표·코드는 공식 원문을 기준으로 적용한다.
Supported prompt customization surfaces
- Use these surfaces first — 공식 하위 절. 구현·설정 세부 원문 참조.
- When to edit code instead — 공식 하위 절. 구현·설정 세부 원문 참조.
Why prompt assembly is split this way
- 이 절의 절차·표·코드는 공식 원문을 기준으로 적용한다.
Related docs
- 이 절의 절차·표·코드는 공식 원문을 기준으로 적용한다.
체크리스트
- 공식 원문 Prompt Assembly과 대조했다
- 관련 코드·설정·권한을 로컬에서 확인했다
- 보안·opt-in·allowlist 정책을 지켰다
- 스모크 테스트 또는 단계 검증을 수행했다
다음 단계
- 공식 문서: Prompt Assembly
- Hermes Agent 소개
- 트러블슈팅
기준일: 2026-07-26 — 공식 문서 동기화 코퍼스