@principal-ai/codebase-composition
v0.2.28
Published
Codebase decomposition into semantic layers
Readme
@principal-ai/codebase-composition
Codebase decomposition into semantic layers for the Principal AI ecosystem.
Overview
This package decomposes and composes codebases into structured semantic layers, enabling sophisticated analysis through layer-by-layer examination of project architecture.
Key Features
- 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
Installation
bun install @principal-ai/codebase-compositionUsage
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);Dependencies
@principal-ai/repository-abstraction- For tree abstractionsignore- Gitignore pattern matchingjs-toml- TOML parsingpip-requirements-js- Python requirements parsingtypescript- Type extraction
Development
# Install dependencies
bun install
# Build the package
bun run build
# Run tests
bun test
# Type checking
bun run typecheck
# Watch mode for development
bun run devLicense
Private package - not for public distribution.
