rskim-core 0.2.0

Core library for smart code reading and transformation
Documentation

Skim Core - Smart code reading and transformation library

Overview

skim-core is a pure library for transforming source code by stripping implementation details while preserving structure, signatures, and types. Optimized for AI/LLM context windows.

Architecture

IMPORTANT: This is a LIBRARY with NO I/O.

  • Accepts &str (source code), not file paths
  • Returns Result<String>, not stdout writes
  • Pure transformations, no side effects

CLI/SDK/MCP interfaces handle I/O separately.

Example

use skim_core::{transform, Language, Mode};

let source = "function add(a: number, b: number) { return a + b; }";
let result = transform(source, Language::TypeScript, Mode::Structure)?;

// Result: "function add(a: number, b: number) { /* ... */ }"
# Ok::<(), skim_core::SkimError>(())

Design Principles

  1. Zero-copy where possible - Use &str slices, avoid allocations
  2. Result types everywhere - NO panics (enforced by clippy)
  3. Dependency injection - NO global state
  4. Type-first - Complete type schema before implementation