# Aura Guard

> 토큰 예산 모니터. 컨텍스트 사용량 감시 및 컴팩트 방어 시스템 지원. Internal skill — not user-invocable.

- **Type:** Skill
- **Install:** `agentstack add skill-smorky850612-aurakit-aura-guard`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [smorky850612](https://agentstack.voostack.com/s/smorky850612)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [smorky850612](https://github.com/smorky850612)
- **Source:** https://github.com/smorky850612/Aurakit/tree/main/skills/aura-guard
- **Website:** https://aurakit.aurax-dev.workers.dev/

## Install

```sh
agentstack add skill-smorky850612-aurakit-aura-guard
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# AuraKit Guard — 컴팩트 방어 시스템

> 컨텍스트 창 과부하를 방지하는 자동 방어 레이어.
> 이 스킬은 내부적으로 동작하며 사용자가 직접 호출하지 않는다.

---

## 컴팩트 방어 아키텍처

```
세션 시작
    │
    ▼
컨텍스트 사용량 모니터링
    │
    ├─ 65% 미만 → 정상 작업 계속
    │
    └─ 65% 도달 ─────────────────────────────────────────┐
                                                          │
                                              CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=65
                                                          │
                                                          ▼
                                              pre-compact-snapshot.sh (PreCompact hook)
                                              ├─ 현재 스냅샷 백업
                                              ├─ transcript 요약 (claude -p)
                                              └─ .aura/snapshots/current.md 저장
                                                          │
                                                          ▼
                                                   /compact 자동 실행
                                                          │
                                                          ▼
                                              post-compact-restore.sh (PostCompact hook)
                                              ├─ .aura/snapshots/current.md 읽기
                                              └─ 내용을 stdout → Claude 컨텍스트 주입
                                                          │
                                                          ▼
                                              새 컨텍스트에서 이전 상태 복구됨
```

---

## 환경변수 설정

```bash
# ~/.bashrc 또는 ~/.zshrc에 추가 (init.sh가 자동 추가)
export CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=65
```

이 설정으로 컨텍스트 65% 시점에 자동 컴팩트가 트리거된다.
기본값(90%)보다 일찍 압축하여 컨텍스트 손실을 방지한다.

---

## 토큰 사용량 확인 방법

Claude Code에서 `/context` 명령으로 현재 컨텍스트 사용량을 확인할 수 있다.

```
/context  →  현재 토큰 사용량 및 남은 용량 표시
```

---

## Hook 연동

| Hook 이벤트 | 파일 | 동작 |
|------------|------|------|
| PreCompact | pre-compact-snapshot.sh | 스냅샷 저장 |
| PostCompact | post-compact-restore.sh | 스냅샷 복구 + 컨텍스트 주입 |

---

## 스냅샷 파일 관리

```
.aura/snapshots/
├── current.md              ← 가장 최신 스냅샷 (항상 덮어씀)
├── SNAPSHOT-20250115-143022.md  ← 이전 스냅샷 백업
├── SNAPSHOT-20250115-152841.md
└── ...
```

- `current.md`: 현재 작업 상태. PostCompact 후 컨텍스트에 주입됨
- `SNAPSHOT-*.md`: 자동 백업. 수동 복구 시 참조

---

## 토큰 절약 원칙 (AuraKit 전체)

| 원칙 | 절감량 |
|------|--------|
| Hook-First (bash hook으로 검증) | ~60% |
| Context:fork 에이전트 격리 | ~25% |
| Fail-Only 출력 | ~10% |
| Progressive Disclosure | ~5% |

---

*AuraKit — Context Budget Guard: 65% 방어선으로 무손실 작업 보장*

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [smorky850612](https://github.com/smorky850612)
- **Source:** [smorky850612/Aurakit](https://github.com/smorky850612/Aurakit)
- **License:** MIT
- **Homepage:** https://aurakit.aurax-dev.workers.dev/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-smorky850612-aurakit-aura-guard
- Seller: https://agentstack.voostack.com/s/smorky850612
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
