Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Improved `clawpatch fix` handoff context and patch-attempt changed-file auditing for dirty-worktree fixes.
- Improved Node workspace mapping with richer package overview features, generic extension package context, semantic large-source splits, and stricter generated/build ownership hygiene.
- Improved Kotlin JVM and Android semantic role mapping for Gradle projects, including Android plugin aliases, local type handling, comment/string parsing, and role fallback edges, thanks @mrmans0n.
- Added C#/.NET detection, conservative `dotnet build` / `dotnet test` defaults, ASP.NET Core route mapping, C#/F#/Visual Basic source groups, and .NET test-project mapping including TUnit, thanks @SimonGuldager with ideas from @danielmarbach.

## 0.2.0 - 2026-05-17

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ validation commands and records a patch attempt under `.clawpatch/`.
imports, interfaces, inheritance, supertypes, and method signatures
- Kotlin Android semantic roles for UI entrypoints, ViewModels, data
boundaries, external clients, and dependency injection, including Metro
- C#/.NET projects from `.sln`, `.slnx`, `.csproj`, `.fsproj`, and `.vbproj`
files, with conservative `dotnet build` / `dotnet test` defaults
- ASP.NET Core controllers, minimal API endpoints, C#/F#/Visual Basic source
groups, and .NET test projects
- Ruby project metadata, executables, source groups, RSpec/Minitest suites
- Elixir Mix/Phoenix projects, contexts, Phoenix web slices, runtime config,
Ecto migrations, project scripts, and ExUnit suites
Expand Down
13 changes: 13 additions & 0 deletions docs/feature-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ Supported deterministic mappers today:
Rails configs, routes, views, assets, and database files
- Rust Cargo commands, libraries, workspace crates, and integration tests
- C/C++ standalone `main()` files, CMake targets, and autotools targets
- C#/.NET projects from `.sln`, `.slnx`, `.csproj`, `.fsproj`, and `.vbproj`,
ASP.NET Core controllers, minimal API endpoints, C#/F#/Visual Basic source
groups, and .NET test projects
- SwiftPM executable targets, library targets, and test suites
- nested SwiftPM packages
- Apple/Xcode projects from `project.yml`, `.xcodeproj`, or `.xcworkspace`
Expand Down Expand Up @@ -128,6 +131,14 @@ Android UI entrypoints, ViewModels, data boundaries, or dependency injection.
Kotlin dependency-injection evidence includes Hilt, Dagger, Koin, and Metro
annotations and imports.

C#/.NET mapping reads solution/project files and C#/F#/Visual Basic source
without executing MSBuild. It emits project records, bounded source groups,
test-project records, ASP.NET Core controller routes, and minimal API routes. Default
validation commands are only generated when there is a single clear solution or
project target; ambiguous workspaces stay command-null rather than guessing.
Common generated outputs such as `bin/`, `obj/`, `TestResults/`, and `.g.cs`
files are skipped.

C/C++ mapping covers generic project shapes only: standalone source files with
`main()`, CMake `add_executable` / `add_library`, and autotools `bin_PROGRAMS` /
`lib_LTLIBRARIES`. It deliberately avoids project-specific C dialects such as
Expand Down Expand Up @@ -156,5 +167,7 @@ Known gaps:
- no Django route mapper yet
- Laravel route parsing is convention-based, does not execute Laravel route discovery,
and may omit prefixes applied by `Route::group(...)` wrappers
- C#/.NET mapping does not evaluate MSBuild conditions, imported props/targets,
or runtime route conventions
- no import graph expansion beyond nearby tests yet
- agent mapping depends on provider quality and validates paths but not semantic intent
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ stderr so pipes stay parseable.

## What clawpatch does

- **Semantic feature mapping.** Detects npm bins, Next.js routes, React Router routes, Python packages and Flask/FastAPI routes, Ruby/Rails slices, Laravel/PHP slices, Java/Kotlin Gradle modules, Go packages, Rust crates, C/C++ build targets, SwiftPM targets, and common config files as reviewable units.
- **Semantic feature mapping.** Detects npm bins, Next.js routes, React Router routes, Python packages and Flask/FastAPI routes, Ruby/Rails slices, Laravel/PHP slices, Java/Kotlin Gradle modules, C#/.NET projects and ASP.NET endpoints, Go packages, Rust crates, C/C++ build targets, SwiftPM targets, and common config files as reviewable units.
- **Automated code review.** Reviews features with AI providers (Codex CLI today), persists findings with severity, category, and line locations.
- **Explicit fix workflow.** `clawpatch fix` runs validated patches for one finding at a time, never commits or pushes automatically.
- **Stable state model.** All features, findings, patches live in `.clawpatch/` as JSON, resumable across runs.
- **Safety first.** Review is read-only, fix refuses dirty worktrees, never auto-commits, validates before accepting patches.
- **Multi-language.** JavaScript/TypeScript, Python, Ruby, PHP/Laravel, Java/Kotlin, Go, Rust, C/C++, and Swift today; more mappers planned.
- **Multi-language.** JavaScript/TypeScript, Python, Ruby, PHP/Laravel, Java/Kotlin, C#/.NET, Go, Rust, C/C++, and Swift today; more mappers planned.

## Pick your path

Expand Down
1 change: 1 addition & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ This discovers reviewable features:
- Next.js routes
- Go packages and commands
- Java/Kotlin Gradle modules
- C#/.NET projects, ASP.NET endpoints, source groups, and test projects
- Python packages, console scripts, Flask/FastAPI routes, and pytest suites
- JVM semantic role groups
- Ruby packages, Rails apps, executables, and tests
Expand Down
16 changes: 15 additions & 1 deletion src/agent-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const sourceExtensions = new Set([
".cxx",
".ex",
".exs",
".fs",
".fsi",
".go",
".h",
".heex",
Expand All @@ -73,15 +75,22 @@ const sourceExtensions = new Set([
".swift",
".ts",
".tsx",
".vb",
]);

const manifestNames = new Set([
"Cargo.toml",
"CMakeLists.txt",
"Package.swift",
"Directory.Build.props",
"Directory.Build.targets",
"Directory.Packages.props",
"Directory.Packages.targets",
"NuGet.config",
"build.gradle",
"build.gradle.kts",
"composer.json",
"global.json",
"go.mod",
"mix.exs",
"package.json",
Expand Down Expand Up @@ -389,7 +398,7 @@ async function repoInventory(
weak: weak.weak,
weakReason: weak.reason,
allFiles: new Set(files),
manifests: files.filter((file) => manifestNames.has(file.split("/").at(-1) ?? "")),
manifests: files.filter(isManifestFile),
topLevelDirs: uniqueStrings(files.map((file) => file.split("/")[0] ?? "").filter(Boolean)),
fileSamples: files.slice(0, 400),
sourceFileSamples: sourceFiles.slice(0, 500),
Expand Down Expand Up @@ -470,6 +479,11 @@ function isSourceFile(path: string): boolean {
return ext !== undefined && sourceExtensions.has(ext);
}

function isManifestFile(path: string): boolean {
const name = path.split("/").at(-1) ?? "";
return manifestNames.has(name) || /\.(?:sln|slnx|csproj|fsproj|vbproj)$/iu.test(name);
}

function isTestFile(path: string): boolean {
return /(^|\/)(test|tests|__tests__)(\/|$)|(?:^|[._-])(?:test|spec)\.[^/]+$/iu.test(path);
}
Expand Down
Loading