ix

GitHub

基于持久化代码图谱的静态分析技能,通过Ix CLI执行符号解释、调用追踪、影响范围评估及代码异味检测。适用于理解代码结构、关系及变更影响,避免盲目搜索或猜测,提升代码库认知效率。

skills/ix/SKILL.md ix-infrastructure/Ix

Trigger Scenarios

需要理解代码库中特定符号的定义与作用 追踪系统内部的数据流或调用链 评估代码修改前的潜在影响范围 查找函数/模块的调用者或被调用者 识别代码异味或架构热点

Install

npx skills add ix-infrastructure/Ix --skill ix -g -y
More Options

Use without installing

npx skills use ix-infrastructure/Ix@ix

指定 Agent (Claude Code)

npx skills add ix-infrastructure/Ix --skill ix -a claude-code -g -y

安装 repo 全部 skill

npx skills add ix-infrastructure/Ix --all -g -y

预览 repo 内 skill

npx skills add ix-infrastructure/Ix --list

SKILL.md

Frontmatter
{
    "name": "ix",
    "license": "Apache-2.0",
    "metadata": {
        "source": "https:\/\/github.com\/ix-infrastructure\/Ix",
        "version": "1.0.0"
    },
    "description": "This skill should be used when answering structural questions about a codebase: understanding what a symbol is, tracing flows, measuring change impact, finding callers\/callees\/imports, or detecting code smells. It drives the Ix CLI (ix map\/explain\/trace\/impact\/search\/rank\/smells) against a persistent code graph stored in a local backend, instead of grepping or guessing. Run scripts\/bootstrap.sh once to install the CLI and start the backend, then ix map on the repo root."
}

Ix — Persistent Codebase Map

Overview

Ix parses a repository with tree-sitter (26 languages), builds a graph of its symbols, calls, and imports, and stores it in a local backend (ArangoDB via Docker). Query that graph with ix commands to answer bounded, structural questions instead of reading files blindly. The graph persists between sessions.

Use this skill whenever the question is about structure, relationships, or impact: what a symbol is, what calls it, what it calls, how data flows, what breaks if a change lands, which files are most depended-on, or where the smells are.

When to Use

  • Answering "what is this / what does it touch" questions about a symbol, class, or module.
  • Tracing how a flow moves through the system.
  • Estimating blast radius before a change.
  • Finding callers, callees, imports, and dependents.
  • Detecting smells, ranking hotspots, and scoring subsystems.
  • Onboarding to an unfamiliar codebase.

Do not use this skill for prose-style or history questions — use it for structural, graph-backed answers.

Quick Start (first run)

Map the target repo with the bootstrap script:

bash scripts/bootstrap.sh [repo-root] [--no-map]                                            # Bash / Git Bash / macOS / Linux
powershell -ExecutionPolicy Bypass -File scripts/bootstrap.ps1 [repo-root] [-NoMap]         # Windows PowerShell

The bootstrap checks Node >= 22, git, Docker, and ripgrep; installs the ix CLI if missing; starts the local Docker backend; and maps the repo by default. Re-run scripts/bootstrap.sh on each new repo to register and map it.

Refresh the graph after code changes:

ix map --silent

Core Workflow

Map → Explain → Trace → Impact

Step Command Example
Build/refresh the graph ix map ix map .
Understand a component ix explain ix explain IngestionService
Trace a flow ix trace ix trace user_login_flow
Analyze impact ix impact ix impact verify_token --format llm

Using the Skill

  1. Start with high-level commands for one-shot answers: ix overview, ix impact, ix rank.
  2. Drill down with primitives — ix search, ix callers, ix callees, ix contains, ix imports, ix imported-by, ix depends — reusing exact entity IDs from prior JSON output.
  3. Prefer --format llm when reading output yourself (token-minimal); use --format json when chaining commands or extracting a field. See references/output-formats.md.
  4. For the full command surface, decomposition recipes, and best practices, load references/commands.md.
  5. If the backend is unreachable or a command fails, load references/troubleshooting.md.

Rules

  1. Before answering codebase questions, run targeted ix commands. Do not answer from training data alone.
  2. After noticing contradictory information, run ix conflicts and present the results.
  3. Never guess codebase facts — if Ix has structured data, use it.
  4. Immediately after modifying code, run ix map --silent to re-ingest.
  5. When Ix reports low confidence, mention the uncertainty to the user, suggest re-running ix map, and never present low-confidence data as established fact.

References

  • references/commands.md — full command routing tables, decomposition recipes, best practices, and the do-not-use list. Load before running any command beyond the core four above.
  • references/output-formats.md--format llm|json|text rules, commands that do not implement llm, and Pro-gated commands. Load when formatting output or when a "requires Ix Pro" error appears.
  • references/troubleshooting.md — prerequisites, backend health checks, ix doctor, and environment flags. Load when a command fails or the backend is unreachable.

Scripts

  • scripts/bootstrap.sh — cross-platform first-run setup (bash; works on macOS, Linux, and Windows under Git Bash / MSYS2 / WSL).
  • scripts/bootstrap.ps1 — native Windows PowerShell first-run setup.

Version History

  • fa6ad7b Current 2026-08-12 09:08

Metadata

Files
0
Version
fa6ad7b
Hash
98602253
Indexed
2026-08-12 09:08

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-12 21:42
浙ICP备14020137号-1 $お客様$