@samiyev/guardian
Version:
Research-backed code quality guardian for AI-assisted development. Detects hardcodes, secrets, circular deps, framework leaks, entity exposure, and 9 architecture violations. Enforces Clean Architecture/DDD principles. Works with GitHub Copilot, Cursor, W
108 lines • 7.26 kB
TypeScript
/**
* CLI Constants
*
* Following Clean Code principles:
* - No magic strings
* - Single source of truth
* - Easy to maintain and translate
*/
export declare const CLI_COMMANDS: {
readonly NAME: "guardian";
readonly CHECK: "check";
};
export declare const CLI_DESCRIPTIONS: {
readonly MAIN: string;
readonly CHECK: string;
readonly PATH_ARG: "Path to analyze (e.g., ./src or ./packages/api)";
readonly EXCLUDE_OPTION: "Exclude dirs/patterns (default: node_modules,dist,build,coverage,tests,**/*.test.ts)";
readonly VERBOSE_OPTION: "Show additional help and analysis details";
readonly NO_HARDCODE_OPTION: "Skip hardcode detection (only check architecture)";
readonly NO_ARCHITECTURE_OPTION: "Skip architecture checks (only check hardcodes)";
readonly MIN_SEVERITY_OPTION: "Filter by severity: critical|high|medium|low (e.g., --min-severity high)";
readonly ONLY_CRITICAL_OPTION: "Show only 🔴 CRITICAL issues (shortcut for --min-severity critical)";
readonly LIMIT_OPTION: "Limit violations shown per category (e.g., -l 10 shows first 10)";
};
export declare const CLI_OPTIONS: {
readonly EXCLUDE: "-e, --exclude <dirs...>";
readonly VERBOSE: "-v, --verbose";
readonly NO_HARDCODE: "--no-hardcode";
readonly NO_ARCHITECTURE: "--no-architecture";
readonly MIN_SEVERITY: "--min-severity <level>";
readonly ONLY_CRITICAL: "--only-critical";
readonly LIMIT: "-l, --limit <number>";
};
export declare const SEVERITY_DISPLAY_LABELS: {
readonly CRITICAL: "🔴 CRITICAL";
readonly HIGH: "🟠 HIGH";
readonly MEDIUM: "🟡 MEDIUM";
readonly LOW: "🟢 LOW";
};
export declare const SEVERITY_SECTION_HEADERS: {
readonly CRITICAL: "\n═══════════════════════════════════════════\n🔴 CRITICAL SEVERITY\n═══════════════════════════════════════════";
readonly HIGH: "\n═══════════════════════════════════════════\n🟠 HIGH SEVERITY\n═══════════════════════════════════════════";
readonly MEDIUM: "\n═══════════════════════════════════════════\n🟡 MEDIUM SEVERITY\n═══════════════════════════════════════════";
readonly LOW: "\n═══════════════════════════════════════════\n🟢 LOW SEVERITY\n═══════════════════════════════════════════";
};
export declare const CLI_ARGUMENTS: {
readonly PATH: "<path>";
};
export declare const DEFAULT_EXCLUDES: readonly ["node_modules", "dist", "build", "coverage", "tests", "test", "__tests__", "examples", "**/*.test.ts", "**/*.test.js", "**/*.spec.ts", "**/*.spec.js"];
export declare const CLI_MESSAGES: {
readonly ANALYZING: "\n🛡️ Guardian - Analyzing your code...\n";
readonly METRICS_HEADER: "📊 Project Metrics:";
readonly LAYER_DISTRIBUTION_HEADER: "\n📦 Layer Distribution:";
readonly VIOLATIONS_HEADER: "\n⚠️ Found";
readonly CIRCULAR_DEPS_HEADER: "\n🔄 Found";
readonly NAMING_VIOLATIONS_HEADER: "\n📝 Found";
readonly HARDCODE_VIOLATIONS_HEADER: "\n🔍 Found";
readonly NO_ISSUES: "\n✅ No issues found! Your code looks great!";
readonly ISSUES_TOTAL: "\n❌ Found";
readonly TIP: "\n💡 Tip: Fix these issues to improve code quality and maintainability.\n";
readonly HELP_FOOTER: "\nRun with --help for more options";
readonly ERROR_PREFIX: "Error analyzing project:";
};
export declare const CLI_LABELS: {
readonly FILES_ANALYZED: "Files analyzed:";
readonly TOTAL_FUNCTIONS: "Total functions:";
readonly TOTAL_IMPORTS: "Total imports:";
readonly FILES: "files";
readonly ARCHITECTURE_VIOLATIONS: "architecture violations:";
readonly CIRCULAR_DEPENDENCIES: "circular dependencies:";
readonly NAMING_VIOLATIONS: "naming convention violations:";
readonly HARDCODE_VIOLATIONS: "hardcoded values:";
readonly ISSUES_TOTAL: "issues total";
};
export declare const CLI_HELP_TEXT: {
readonly POSITION: "after";
readonly EXAMPLES_HEADER: "\nEXAMPLES:\n";
readonly EXAMPLE_BASIC: " $ guardian check ./src # Analyze src directory\n";
readonly EXAMPLE_CRITICAL: " $ guardian check ./src --only-critical # Show only critical issues\n";
readonly EXAMPLE_SEVERITY: " $ guardian check ./src --min-severity high # Show high and critical\n";
readonly EXAMPLE_LIMIT: " $ guardian check ./src --limit 10 # Limit output to 10 per category\n";
readonly EXAMPLE_NO_HARDCODE: " $ guardian check ./src --no-hardcode # Skip hardcode detection\n";
readonly EXAMPLE_NO_ARCHITECTURE: " $ guardian check ./src --no-architecture # Skip architecture checks\n";
readonly EXAMPLE_EXCLUDE: " $ guardian check ./src -e dist build # Exclude additional dirs\n\n";
readonly FIX_HEADER: "HOW TO FIX COMMON ISSUES:\n";
readonly FIX_HARDCODE: " Hardcoded values → Extract to constants file\n";
readonly FIX_CIRCULAR: " Circular deps → Break cycle by extracting shared code\n";
readonly FIX_FRAMEWORK: " Framework leaks → Move Express/NestJS imports to infrastructure layer\n";
readonly FIX_NAMING: " Naming violations → Rename file (e.g., UserEntity.ts, CreateUserUseCase.ts)\n";
readonly FIX_ENTITY: " Entity exposure → Create DTO and map entity to DTO before returning\n";
readonly FIX_DEPENDENCY: " Dependency direction → Move import to correct layer (domain ← app ← infra)\n";
readonly FIX_REPOSITORY: " Repository pattern → Create IUserRepository in domain, implement in infra\n\n";
readonly FOOTER: "Each violation includes a 💡 Suggestion with specific fix instructions.\n";
readonly AI_AGENT_HEADER: "AI AGENT INSTRUCTIONS:\n";
readonly AI_AGENT_INTRO: " When an AI coding assistant (Claude, Copilot, Cursor, etc.) uses Guardian:\n\n";
readonly AI_AGENT_STEP1: " STEP 1: Run initial scan\n";
readonly AI_AGENT_STEP1_CMD: " $ guardian check ./src --only-critical --limit 5\n\n";
readonly AI_AGENT_STEP2: " STEP 2: For each violation in output:\n";
readonly AI_AGENT_STEP2_DETAIL: string;
readonly AI_AGENT_STEP3: " STEP 3: After fixing, verify:\n";
readonly AI_AGENT_STEP3_CMD: " $ guardian check ./src --only-critical\n\n";
readonly AI_AGENT_STEP4: " STEP 4: Expand scope progressively:\n";
readonly AI_AGENT_STEP4_CMDS: string;
readonly AI_AGENT_OUTPUT: " OUTPUT FORMAT (parse this):\n";
readonly AI_AGENT_OUTPUT_DETAIL: string;
readonly AI_AGENT_PRIORITY: " PRIORITY ORDER: CRITICAL → HIGH → MEDIUM → LOW\n\n";
};
//# sourceMappingURL=constants.d.ts.map