/** * Repo Style Analyzer * * Scans a repository to detect coding conventions, patterns, and style * so that governed agent runs produce code matching the existing codebase. * * Detects: * - Naming conventions (camelCase, snake_case, PascalCase, kebab-case) * - Test framework (Vitest, Jest, Mocha, node:test) * - Package manager (pnpm, npm, yarn, bun) * - Module system (ESM, CJS, mixed) * - File organization pattern (feature folders, type folders, flat) * - TypeScript strictness level * - Comment density * - Formatting (tabs vs spaces, semicolons, quotes) */ export interface RepoStyleProfile { /** Detected package manager */ packageManager: "pnpm" | "npm" | "yarn" | "bun" | "unknown"; /** Detected module system */ moduleSystem: "esm" | "cjs" | "mixed" | "unknown"; /** Detected test framework */ testFramework: "vitest" | "jest" | "mocha" | "node-test" | "unknown"; /** Primary language */ language: "typescript" | "javascript" | "mixed"; /** TypeScript strict mode enabled */ typescriptStrict: boolean; /** Dominant naming convention for files */ fileNaming: "kebab-case" | "camelCase" | "PascalCase" | "snake_case" | "mixed"; /** Dominant naming convention for variables/functions */ codeNaming: "camelCase" | "snake_case" | "mixed"; /** Uses semicolons */ semicolons: boolean; /** Single vs double quotes */ quotes: "single" | "double" | "mixed"; /** Indentation style */ indentation: "tabs" | "2-spaces" | "4-spaces" | "mixed"; /** Average lines per file (source files) */ avgLinesPerFile: number; /** File organization pattern */ organization: "feature-folders" | "type-folders" | "flat" | "mixed"; /** Raw signals for prompt injection */ promptDirectives: string[]; } /** * Analyze a repository and return a style profile. */ export declare function analyzeRepoStyle(rootDir: string): RepoStyleProfile; /** * Build prompt directives from the style profile. * These get injected into the agent's prompt to match repo conventions. */ export declare function buildPromptDirectives(profile: RepoStyleProfile): string[];