Note
No IDE or local setup required. This repository is optimized for fully AI-assisted development using Claude Code. No local toolchain, no IDE, nothing to install — everything works completely through Claude.
srcmorph is a prompt-driven source-tree transformer: it walks a source tree and processes each
file through a configurable local LLM prompt — via llama.cpp
GGUF models, entirely local, no cloud calls — producing layered output: per-file, then per-package,
then per-project. Today it emits structured, AI-readable .ai.md Markdown summaries for fast semantic
code navigation; the same rule-routed pipeline (composable file-matching conditions, per-rule
model + prompt, oversize handling) is generic enough to eventually emit wikis, architecture docs,
diagrams, or even source-to-source transformations.
Migration note. This repository was restructured from a single Maven plugin into a reactor of three artifacts — see "Module overview" below. As part of that migration the Maven plugin was renamed from
net.ladenthin:llamacpp-ai-index-maven-plugintonet.ladenthin:srcmorph-maven-plugin(goal prefixsrcmorph, propertiessrcmorph.*). Existing consumers who still declare the old coordinates are not broken: the old artifactId was published once, at version1.0.4, as a tiny relocation-stub POM (<distributionManagement><relocation>) that redirects Maven to the new coordinates automatically — verified working end-to-end from a clean environment. No consumer action is required, though updating your own POM to the new coordinates directly is recommended. SeeCLAUDE.mdfor the full migration history.
| Module | Artifact | What it is |
|---|---|---|
srcmorph/ |
net.ladenthin:srcmorph |
The core library: a framework-free Java API (no Maven dependency) — the shared SrcMorphConfiguration plus the generate/aggregate-packages/aggregate-project/calibrate engines. Use this to embed srcmorph in your own tooling. |
srcmorph-cli/ |
net.ladenthin:srcmorph-cli |
A standalone CLI driven by one JSON or YAML configuration file. You build the runnable jar for your machine with one mvn package (examples/build-your-own-jar/). |
srcmorph-maven-plugin/ |
net.ladenthin:srcmorph-maven-plugin |
The Maven plugin, a thin wrapper around srcmorph — renamed from net.ladenthin:llamacpp-ai-index-maven-plugin (goal prefix srcmorph, was ai-index; properties srcmorph.*, were aiIndex.*). |
All three modules (plus the reactor parent pom) are released together from this one repository at
the same version. (A fourth, independently-versioned relocation-stub module for the retired
net.ladenthin:llamacpp-ai-index-maven-plugin coordinates was part of this reactor through the
1.1.1 release and has since been removed — its published 1.0.4 artifact remains permanently on
Maven Central regardless; see CLAUDE.md.)
<plugin>
<groupId>net.ladenthin</groupId>
<artifactId>srcmorph-maven-plugin</artifactId>
<version>1.3.0</version>
<configuration>
<generationProvider>mock</generationProvider>
<promptDefinitions>
<promptDefinition>
<key>file-body</key>
<!-- the system prompt; srcmorph sends the file name and source separately -->
<template>Summarize this file as structured markdown.</template>
</promptDefinition>
</promptDefinitions>
<fieldGenerations>
<fieldGeneration>
<promptKey>file-body</promptKey>
<aiDefinitionKey>coder</aiDefinitionKey>
<fallback>true</fallback>
</fieldGeneration>
</fieldGenerations>
<aiDefinitions>
<aiDefinition>
<key>coder</key>
<modelPath>/path/to/model.gguf</modelPath>
</aiDefinition>
</aiDefinitions>
</configuration>
</plugin>Run with mvn srcmorph:generate. Full goal/parameter reference, routing rules, GPU acceleration, and
model recommendations: srcmorph-maven-plugin/README.md.
Deprecated: old net.ladenthin:llamacpp-ai-index-maven-plugin coordinates (auto-relocates)
<plugin>
<groupId>net.ladenthin</groupId>
<artifactId>llamacpp-ai-index-maven-plugin</artifactId>
<version>1.0.4</version>
<!-- Maven Central redirects this artifact to net.ladenthin:srcmorph-maven-plugin:1.1.1 via a
published <distributionManagement><relocation> POM. Prefer declaring the new coordinates
above directly in new/updated POMs. -->
</plugin>srcmorph publishes no runnable jar: there are too many OS, CPU and GPU combinations to ship one per
machine. You build your own with Maven from
examples/build-your-own-jar/: its pom.xml takes srcmorph-cli
from Maven Central plus exactly the llama natives of your OS/arch (picked automatically), and
optionally one GPU module.
cd examples/build-your-own-jar
./build.sh # or build.bat; add e.g. -Dgpu=vulkan-linux-x86-64
java -jar target/srcmorph.jar ../config_All.jsonEvery examples/config_*.json/.yaml file works out of the box with the mock provider (no GGUF
model required) — see examples/ for the full set plus paired run_*.sh/run_*.bat
launcher scripts, and srcmorph-cli/README.md for the config-file
reference. A walkthrough for a Windows laptop with Vulkan is in
docs/windows-intel-core-ultra.md.
Without building anything, JBang can run the CLI straight from Maven
Central. It resolves srcmorph-cli with the CPU natives of every desktop platform, and a GPU
module is one more --deps jar:
jbang --deps net.ladenthin:llama:6.0.0:vulkan-linux-x86-64 net.ladenthin:srcmorph-cli:<version> config.json.
Maven is the supported path; JBang is a shortcut.
<dependency>
<groupId>net.ladenthin</groupId>
<artifactId>srcmorph</artifactId>
<version>1.3.0</version>
</dependency>SrcMorphConfiguration config = new SrcMorphConfiguration();
config.setBaseDirectory(new File("."));
// ... set outputDirectory, promptDefinitions, aiDefinitions, fieldGenerations ...
new GenerateEngine(config).execute();See srcmorph/README.md for the full API tour (the four engines, exception
types, and a complete embedding example).
srcmorph runs in three phases, building a navigable index from fine to coarse — see each module's own
README for the full details (routing rules, oversize strategies, exact-count facts, the project
overview) and CLAUDE.md for the architecture.
- File generation — scans configured source directories, writes one
.ai.mdfile per source file (deterministic metadata header + AI-generated Markdown body). - Package aggregation — traverses the generated
.ai.mdfiles, writes onepackage.ai.mdper directory with a deterministic child-link list plus an AI-generated summary. - Project index — harvests the one-line lead from every
package.ai.mdinto a singleproject.ai.mdtable of contents (deterministic; an optional one-call AI overview paragraph can be enabled).
Each phase is independently switchable and incremental (checksums skip unchanged files); a rule-based router lets one run send different files to different models and prompts by extension, size, age, or path.
Snapshots are published to the Central Snapshots repository from a manual Publish workflow run
on main with publish_to_central checked — not automatically on push:
https://central.sonatype.com/repository/maven-snapshots/net/ladenthin/
Current reactor version: 1.4.0-SNAPSHOT. Last released version: 1.3.0.
Somewhere in early 2026, the same idea apparently occurred more than once. This repository started with an implementation on March 15, 2026. Andrej Karpathy published his "LLM wiki" gist on April 4, 2026. Google Cloud eventually formalized the very same pattern into the Open Knowledge Format, announced on June 12, 2026.
Apache License 2.0