A deterministic, signal-rich repository analyzer. Point it at a folder and it produces a structured report — languages, components, frameworks, infrastructure — designed to give an LLM everything it needs to reason about an application's significant layers (frontend / backend / mobile / infra).
The tool reports facts and structure only. It never labels a component "frontend" or decides which layers matter. That judgment is left to the LLM (or human) that consumes the report. There is deliberately no
LayerHintanywhere.
Most stack detectors bake in opinions. This one is built around a single rule:
Adding a new language or framework = adding a data entry, not writing code.
Language detection is seeded from github-linguist; technology detection
is seeded from specfy/stack-analyser. Both are data files shipped as
embedded resources, and both are extensible at runtime via --rules.
As a .NET tool (published to nuget.org):
dotnet tool install -g ivy-stack-analyzer
ivy-stack-analyzer ./my-repoAs a library (NuGet package Ivy.StackAnalyzer):
dotnet add package Ivy.StackAnalyzerRequires the .NET 10 SDK.
dotnet build Ivy.StackAnalyzer.slnx
dotnet test Ivy.StackAnalyzer.slnxivy-stack-analyzer <path> [options]
-o, --output yaml | json # default: yaml
--out <file> # write to a file instead of stdout
--rules <dir> # extra detector / language definitions (repeatable)
--include-vendored # include vendored / generated directories
--no-gitignore # ignore .gitignore while walkingdotnet run --project src/Ivy.StackAnalyzer.Console -- ./my-reposummary:
totalFiles: 8
analyzedFiles: 8
primaryLanguages: [TypeScript, C#]
componentCount: 3
components:
- relativePath: apps/web
technologies:
- { name: Next.js, category: framework, confidence: high, evidence: "npm dep 'next'; next.config.mjs" }
- { name: Tailwind, category: styling, confidence: high, evidence: "npm dep 'tailwindcss'" }
- relativePath: src/Api
technologies:
- { name: ASP.NET Core, category: framework, confidence: high, evidence: "Sdk=Microsoft.NET.Sdk.Web" }
- { name: Entity Framework Core, category: orm, confidence: high }
infrastructure:
- { kind: Postgres, category: database, evidence: "docker-compose image 'Postgres'" }Note: react is reported as superseded by Next.js (dominant-framework ranking),
so it does not appear separately.
using Ivy.StackAnalyzer;
var detection = new Analyzer().Analyze("path/to/repo");
foreach (var component in detection.Components)
Console.WriteLine($"{component.RelativePath}: {string.Join(", ", component.Technologies.Select(t => t.Name))}");See AnalyzerOptions for configuration (IncludeVendored, RespectGitignore,
MaxReadmeLines, MaxDependenciesPerManifest, AdditionalRuleDirectories).
A seven-stage pipeline (Pipeline.cs):
- Walk —
FileSystemScannerenumerates files, pruning vendored/generated dirs (data/vendor.yml) and honoring.gitignore. - Classify —
LanguageClassifierresolves each file's language viadata/languages.yml(filename → extension → shebang). Extensions shared by several languages (.m,.pl,.v,.h, …) are disambiguated by content using a github-linguist-style heuristics layer (data/heuristics.yml,Heuristics.cs). - Componentize —
ComponentDetectorturns manifest-bearing directories into components, attributes every file to its nearest-ancestor root, and flags monorepo aggregators (IsWorkspaceRoot) and auxiliary subtrees (IsAuxiliary). - Parse —
IManifestParserregistry extracts dependencies (npm, NuGet, PyPI, Go, Cargo, Maven/Gradle — incl.libs.versions.tomlcatalogs, Composer, RubyGems, Pub, Hex, plus Julia, Crystal, Nim, CPAN, Rebar, opam/dune, Swift PM, Zig, Cabal). - Detect —
RuleEnginematchesdata/detectors/*.ymlagainst each component, applyingsupersedesranking;ITechnologyDetectoris the code escape hatch. - Infra —
InfraScannersurfaces Docker, Compose, Kubernetes, Helm, Terraform, CI, and databases declared in compose files. - Assemble — into the
StackDetectionreport.
| To add… | Do this |
|---|---|
| A language | Add an entry to a languages.yml in a --rules directory |
| A framework / library | Add a rule to detectors/*.yml in a --rules directory |
| An ecosystem | Implement IManifestParser and register it |
| Bespoke logic | Implement ITechnologyDetector |
The MatchSpec rule schema is a superset of specfy's format, adding sdk
(MSBuild SDK attribute), depPrefix, pathGlobs, supersedes, and contentRegex
(a regex matched against a bounded sample of a component's source text — the escape
hatch for technologies whose only on-disk signal lives in source code, e.g. a C
#include or a Swift import).
This project derives data from two MIT-licensed projects:
- github-linguist —
data/languages.ymlanddata/vendor.yml. - specfy/stack-analyser —
data/detectors/*.yml.
See THIRD-PARTY-NOTICES.md. Ivy.StackAnalyzer itself is licensed under the terms in LICENSE.