# Static Index

> Locates existing global context files under ~/.agents without assuming that optional files exist. Use when a task needs the user's profile, security rules, IaC conventions, service registry, Notion/Obsidian/Vault configuration, personas, or a direct "내 정보" or "글로벌 설정" lookup. Do not use it to enumerate installed skills.

- Skill: `jiunbae/static-index` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add jiunbae/static-index`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jiunbae/static-index/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: jiunbae (https://skillmd.com/u/jiunbae)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/jiunbae/static-index

---


# Static Context Index

Return the minimum relevant global context path, then read only what the current
task needs. Never assume a listed type exists; verify it first.

## Workflow

1. Resolve this skill directory and prefer the bundled
   `scripts/static-index.sh` helper.
2. Search by type or natural-language query.
3. Confirm the returned file exists.
4. Read only the relevant section. Avoid printing credentials or unrelated
   personal data.

## Commands

```bash
# Discover the actual files currently present. Installed skills are excluded.
scripts/static-index.sh list

# Search paths by user intent. The query is matched as a literal string, both
# against the type keywords and, when none match, against file contents.
scripts/static-index.sh search "보안 규칙"
scripts/static-index.sh search "IaC 배포"

# A search that matches nothing also returns non-zero, so exit status alone
# distinguishes "no such context" from a hit.

# Resolve one known type. A missing optional file returns non-zero.
scripts/static-index.sh get security
scripts/static-index.sh get iac
scripts/static-index.sh get notion
```

Supported types are `whoami`, `security`, `context`, `iac`, `services`,
`obsidian`, `notion`, `vault`, `korean`, `readme`, and `persona`. The repository may
contain only a subset; `list` is the source of truth.

## Boundaries

- `~/.agents/skills` is Codex's user skill directory, not static context. Every
  candidate that `list`, `refresh`, `search`, or `get` would return is excluded
  by its own real location, so neither a directory symlink nor a file symlink
  nor a symlink chain pointing into that tree reintroduces it under another
  name. A candidate whose real location cannot be resolved is dropped rather
  than published. Refusing a candidate never hides a legitimate file of the same
  name deeper in the tree: `get` and `search` fall through to it, so they agree
  with `list` instead of reporting the type missing.
- When several files share a name, the shallowest path wins and ties break
  lexicographically, so a nested backup copy is never served in place of the
  live root file.
- Do not create missing files unless the user asks to configure that context.
- Do not expose secret values from Vault, Notion, or other integration files in
  summaries.
- Do not refresh `.index.json` unless a persistent index was requested; normal
  `list`, `search`, and `get` operations are read-only.
- `refresh` builds into a sibling temporary file and renames it into place, and
  fails without touching the existing index when the directory walk fails. An
  empty `files` array therefore means the directory really is empty.

## Resource

- `scripts/static-index.sh`: Bash 3.2-compatible context discovery helper.
- `tests/test-static-index.sh`: hermetic behavioural tests. Each case builds its
  own throwaway `AGENTS_DIR`, so the suite never touches `~/.agents`.

