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
- Resolve this skill directory and prefer the bundled
scripts/static-index.sh helper.
- Search by type or natural-language query.
- Confirm the returned file exists.
- Read only the relevant section. Avoid printing credentials or unrelated
personal data.
Commands
# 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.
1---2name: static-index3description: 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.4---56# Static Context Index78Return the minimum relevant global context path, then read only what the current9task needs. Never assume a listed type exists; verify it first.1011## Workflow12131. Resolve this skill directory and prefer the bundled14 `scripts/static-index.sh` helper.152. Search by type or natural-language query.163. Confirm the returned file exists.174. Read only the relevant section. Avoid printing credentials or unrelated18 personal data.1920## Commands2122```bash23# Discover the actual files currently present. Installed skills are excluded.24scripts/static-index.sh list2526# Search paths by user intent. The query is matched as a literal string, both27# against the type keywords and, when none match, against file contents.28scripts/static-index.sh search "보안 규칙"29scripts/static-index.sh search "IaC 배포"3031# A search that matches nothing also returns non-zero, so exit status alone32# distinguishes "no such context" from a hit.3334# Resolve one known type. A missing optional file returns non-zero.35scripts/static-index.sh get security36scripts/static-index.sh get iac37scripts/static-index.sh get notion38```3940Supported types are `whoami`, `security`, `context`, `iac`, `services`,41`obsidian`, `notion`, `vault`, `korean`, `readme`, and `persona`. The repository may42contain only a subset; `list` is the source of truth.4344## Boundaries4546- `~/.agents/skills` is Codex's user skill directory, not static context. Every47 candidate that `list`, `refresh`, `search`, or `get` would return is excluded48 by its own real location, so neither a directory symlink nor a file symlink49 nor a symlink chain pointing into that tree reintroduces it under another50 name. A candidate whose real location cannot be resolved is dropped rather51 than published. Refusing a candidate never hides a legitimate file of the same52 name deeper in the tree: `get` and `search` fall through to it, so they agree53 with `list` instead of reporting the type missing.54- When several files share a name, the shallowest path wins and ties break55 lexicographically, so a nested backup copy is never served in place of the56 live root file.57- Do not create missing files unless the user asks to configure that context.58- Do not expose secret values from Vault, Notion, or other integration files in59 summaries.60- Do not refresh `.index.json` unless a persistent index was requested; normal61 `list`, `search`, and `get` operations are read-only.62- `refresh` builds into a sibling temporary file and renames it into place, and63 fails without touching the existing index when the directory walk fails. An64 empty `files` array therefore means the directory really is empty.6566## Resource6768- `scripts/static-index.sh`: Bash 3.2-compatible context discovery helper.69- `tests/test-static-index.sh`: hermetic behavioural tests. Each case builds its70 own throwaway `AGENTS_DIR`, so the suite never touches `~/.agents`.