indexion

repository·main·Indexed 40 days ago

https://github.com/trkbt10/indexion

A source code exploration and documentation tool that uses Knowledge Graph Format (KGF) to build dynamic codebase maps. It features semantic search and function indexing via `indexion digest` (supporting TF-IDF and OpenAI embeddings), dependency graph generation with `indexion doc graph`, and automated README generation from source comments using `indexion doc readme`. It also includes `indexion explore` for analyzing pairwise file similarity to identify code patterns and duplications.

Tokens
124.4K
Snippets
292
Records
755
Agent score
97%

What's inside indexion

  1. Overview of indexion features

    main

    indexion is a source code exploration and documentation tool designed to build dynamic maps of codebases. It provides several core capabilities for developers:

    • Similarity Analysis: Identifies duplicated or similar code patterns.
    • Refactoring Planning: Generates actionable checklists for refactoring tasks.
    • Documentation Generation: Uses KGF-based intelligent extraction to generate documentation.
    • Semantic Search: Enables natural language search across code, wikis, and documentation.
    • Structural Code Search: Provides KGF-aware token pattern matching via a grep-like interface.
    • MCP Integration: Allows exposing indexion tools to AI assistants like Claude Code or Cursor.
    • Wiki System: Includes an internal wiki with support for GitHub/GitLab export.
    • Multi-language Support: Supports over 25 languages through extensible KGF specifications.
  2. Overview of the indexion CLI

    main
    The indexion CLI is a source code exploration and documentation tool written in MoonBit. It is organized as a tree of MoonBit packages where main.mbt serves as the entry point. The CLI uses @argparse for command parsing and dispatches to various subcommands for tasks ranging from code analysis and planning to wiki management and serving a REST API.
  3. Overview of indexion Claude Code skills

    main

    The indexion project provides a suite of specialized skills for the Claude Code plugin. These skills are designed to automate complex developer workflows such as code similarity analysis, KGF-aware searching, documentation lifecycle management, and refactoring planning.

    Each skill is a self-contained directory containing a SKILL.md file that defines its metadata and usage. Skills are automatically triggered by Claude Code based on their description metadata, or they can be invoked explicitly using slash commands.

    /indexion-explore
    /indexion-grep
    /indexion-wiki
    /indexion-plan-refactor
  4. Overview of the DeepWiki Frontend

    main

    The packages/wiki package is a React Single Page Application (SPA) that serves as the visual interface for indexion. It provides tools for exploring code, visualizing dependencies, and viewing auto-generated documentation.

    Key features include:

    • Code Explorer: A file similarity explorer with tree, table, and 2D graph views.
    • 3D Dependency Graph: An interactive 3D visualization of dependencies using Three.js.
    • Auto-generated Wiki: A documentation viewer for project content.
    • Settings: Configuration management (available in live-server mode).

    The frontend communicates with the indexion serve backend using the @indexion/api-client package.

  5. Overview of indexion

    main
    indexion is a source code exploration and documentation tool designed to help developers build dynamic maps of their codebase. It provides advanced capabilities for understanding code structure, finding patterns, and generating documentation through Knowledge Graph Format (KGF) based extraction.
  6. Use indexion spec for specification-driven analysis

    main
    The indexion spec toolset is designed for specification-driven analysis. It allows developers to verify that implementations conform to specifications, align existing specification documents with actual code, and draft Software Design Documents (SDDs) based on existing documentation.
  7. Use the pipeline API for file discovery and KGF registry loading

    main

    The pipeline module provides a set of functions and structures to discover files, build path signals (extensions and basenames), and manage a KGF (Knowledge Graph Format) registry.

    Key workflows include:

    1. File Discovery: Use discover_files to collect file paths from input paths. You can configure this behavior using DiscoverOptions and the default function.
    2. Indexing: Use build_kgf_index to create a KGFIndex by reading only the headers of KGF files. This is more efficient than parsing full files.
    3. Registry Loading: Once an index is built, use load_registry_from_index to load the registry. This function uses get_matching_kgf_paths to only parse KGF files that match the signals derived from your discovered files.
    4. Signal Matching: The pipeline uses build_path_signals to create matching criteria from file paths, which are then used to filter the KGF index via sources_match_signals.
  8. KGF Features and API Overview

    main
    The Knowledge Graph Framework (KGF) features provide a suite of utilities for analyzing and manipulating tokenized source code. The API includes functions for parsing call expressions, extracting function signatures, identifying declaration and visibility keywords, and performing text edits based on character offsets. It also supports structural comparison by converting token slices into TreeNode objects for APTED comparison.
  9. Use indexion digest to build and query a function index

    main

    The indexion digest command allows you to build and query a purpose-based function index. It extracts function-level content from a CodeGraph, computes embeddings using either TF-IDF or OpenAI, and creates a queryable vector index. It supports incremental updates and multiple embedding providers.

    indexion digest <subcommand> [options] <directory>
  10. Use the tokenizer API for text processing

    main

    The tokenizer module provides a suite of functions for breaking down text into manageable units (tokens) for various downstream tasks like TF-IDF vectorization, CJK (Chinese/Japanese/Korean) processing, and general word tokenization.

    Key capabilities include:

    • TF-IDF Preparation: Use tokenize_for_tfidf and normalize_text to prepare text for vectorization.
    • CJK Support: Use extract_character_bigrams and is_cjk_char to handle character-based languages.
    • Word Tokenization: Use extract_word_tokens and is_word_char to identify and extract word-level units.
    • Text Normalization: Use to_lower for ASCII-only lowercase conversion.
  11. Use the render API to generate documentation

    main

    The render module provides tools to transform DocOutput into various formats, including Markdown and JSON. You can control the content of the generated documentation (such as dependency diagrams, call graphs, and cross-references) using specific getter functions and the RenderOptions struct.

    Key capabilities include:

    • Converting output to Markdown via to_markdown.
    • Extracting raw data via get_json_data or creating JSON-only output with with_json.
    • Retrieving specific sections like get_api_reference or get_cross_references.
    • Accessing visual diagrams such as get_dependency_diagram, get_call_graph, or get_type_hierarchy.