Expand description
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 rskim_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) { /* ... */ }"§Design Principles
- Zero-copy where possible - Use
&strslices, avoid allocations - Result types everywhere - NO panics (enforced by clippy)
- Dependency injection - NO global state
- Type-first - Complete type schema before implementation
Structs§
- Parser
- Wrapper around tree-sitter Parser with language context
- Transform
Config - Configuration for transformation
- Transform
Result - Result of transformation with optional metadata
Enums§
- Language
- Supported programming languages and markup formats
- Mode
- Output transformation mode
- Skim
Error - Error types for Skim operations
Functions§
- detect_
language - Detect language from file extension
- detect_
language_ from_ path - Detect language from file path
- supported_
languages - Get list of supported languages
- transform
- Transform source code based on mode
- transform_
auto - Transform source code with automatic language detection from file path
- transform_
detailed - Transform source code with full result metadata
- transform_
with_ config - Transform source code with custom configuration
- version
- Get library version
Type Aliases§
- Result
- Result type alias for Skim operations