Codebase decomposition into semantic layers
npm install @principal-ai/codebase-compositionCodebase decomposition into semantic layers for the Principal AI ecosystem.
This package decomposes and composes codebases into structured semantic layers, enabling sophisticated analysis through layer-by-layer examination of project architecture.
- Package Layer - Discover and analyze package.json, requirements.txt, Cargo.toml, etc.
- Framework Layer - Identify React, Vue, Angular, and other frameworks
- Type Layer - Extract TypeScript types and interfaces
- Version Control Layer - Git integration for ignore patterns and file filtering
- File Type Layer - Categorize and analyze different file types
- Dependency Layer - Track and analyze project dependencies
``bash`
bun install @principal-ai/codebase-composition
`typescript
import { PackageLayerModule, FrameworkLayerModule } from '@principal-ai/codebase-composition';
import { FileTree } from '@principal-ai/repository-abstraction';
// Use layer modules to analyze your codebase
const packageLayer = new PackageLayerModule();
const frameworkLayer = new FrameworkLayerModule();
// Analyze a file tree
const analysis = await packageLayer.analyze(fileTree);
`
- @principal-ai/repository-abstraction - For tree abstractionsignore
- - Gitignore pattern matchingjs-toml
- - TOML parsingpip-requirements-js
- - Python requirements parsingtypescript
- - Type extraction
`bashInstall dependencies
bun install
Private package - not for public distribution.