콘텐츠로 이동

Context Gateway

Context Gateway는 런타임별 에이전트 파일을 하나의 정규 .memtomem/ 소스에서 동기화합니다. 여러 AI 런타임을 함께 쓰거나, 같은 스킬/커맨드 세트를 모든 체크아웃에서 사용하고 싶을 때 유용합니다.

AI 런타임마다 컨텍스트 파일 위치와 포맷이 다릅니다:

런타임예시 런타임 파일
Claude Code.claude/agents/*.md, .claude/skills/*/SKILL.md, .claude/commands/*.md
Codex CLI.agents/agents/*.toml, .agents/skills/*/SKILL.md
Gemini CLI.gemini/agents/*.md, .gemini/skills/*/SKILL.md, .gemini/commands/*.toml
Cursor / Windsurf / Claude Desktop런타임별 에이전트 정의 위치가 다름

정규 계층이 없으면 각 런타임 복사본이 쉽게 어긋납니다. Context Gateway를 사용하면 정규 파일을 수정하고 바깥 런타임 경로로 동기화합니다.

프로젝트 루트에서 실행합니다:

Terminal window
mm context detect
mm context init --scope project_shared --confirm-project-shared
mm context sync --scope project_shared
mm context diff --scope project_shared

각 명령의 역할:

명령목적
detectmemtomem이 볼 수 있는 기존 런타임 파일 표시
init.memtomem/ 아래 정규 파일 생성
sync정규 파일을 런타임별 경로로 fan-out
diff정규 파일과 런타임 복사본의 동기화 상태 확인

Context Gateway는 기억 쓰기와 같은 세 가지 티어 이름을 사용합니다:

티어정규 위치적합한 용도런타임 fan-out
user~/.memtomem/<artifact>/...여러 프로젝트에서 재사용하는 개인 에이전트, 스킬, 커맨드사용자 런타임 경로
project_shared<project>/.memtomem/<artifact>/...git에 커밋할 팀 공유 프로젝트 컨텍스트프로젝트 런타임 경로
project_local<project>/.memtomem/<artifact>.local/...한 체크아웃에서만 쓰는 비공개 초안에이전트, 스킬, 커맨드는 fan-out 없음

project_shared는 “git으로 추적됨”을 뜻합니다. 비밀값, 인증정보, 개인 초안, 검토 전 프롬프트는 넣지 마세요. 로컬에만 남겨야 하는 내용은 user 또는 project_local을 사용합니다.

프로젝트 에이전트를 팀과 공유

섹션 제목: “프로젝트 에이전트를 팀과 공유”
Terminal window
mm context init --include agents --scope project_shared --confirm-project-shared
mm context sync --include agents --scope project_shared

생성된 .memtomem/agents/ 파일은 검토 후 커밋합니다.

개인 스킬을 여러 프로젝트에서 사용

섹션 제목: “개인 스킬을 여러 프로젝트에서 사용”
Terminal window
mm context init --include skills --scope user
mm context sync --include skills --scope user

정규 스킬은 ~/.memtomem/skills/ 아래에 저장되고, 지원되는 사용자 런타임 경로로 fan-out됩니다.

Terminal window
mm context init --include agents --scope project_local
mm context diff --include agents --scope project_local

project_local 정규 파일은 gitignored이며 에이전트 / 스킬 / 커맨드 런타임 경로로 fan-out되지 않습니다. 준비가 끝나면 파일을 project_shared로 승격한 뒤 mm context sync --scope project_shared를 실행합니다.

기존 런타임 파일에서 정규 파일 시드

섹션 제목: “기존 런타임 파일에서 정규 파일 시드”

이미 특정 런타임에서 직접 작성한 에이전트나 스킬이 있다면 대상 티어를 지정해 init을 실행합니다. init은 정규 파일을 만들고, 감지된 런타임 파일을 가능한 경우 가져옵니다:

Terminal window
mm context detect --include agents,skills
mm context init --include agents,skills --scope project_shared --confirm-project-shared
mm context diff --include agents,skills --scope project_shared

커밋 전에 생성된 정규 파일을 검토하세요.

.memtomem/ # 정규 소스
├── agents/
├── skills/
└── commands/
mm context sync
.claude/ # Claude Code 런타임 파일
.agents/ # Codex 호환 런타임 파일
.gemini/ # Gemini 런타임 파일

sync는 정규 파일에서 런타임 파일로 가는 단방향 변환입니다. 기존 런타임 파일에서 정규 파일을 시드하려면 mm context init--include를 함께 사용합니다.

대상 런타임이 어떤 필드를 정확히 표현할 수 없으면 memtomem은 손실 정도를 분류합니다:

심각도동작
ignore지원하지 않는 필드를 건너뜀
warn경고 출력 후 계속
error변환 중단
Terminal window
mm web --open

Settings -> Context Gateway에서 프로젝트 선택, 티어 배지, 런타임 감지, 동기화 상태, 아티팩트별 상세 정보를 브라우저에서 확인할 수 있습니다.