What is a Guideline?
A guideline is a software development rule or best practice written in plain English that Pandorian’s AI automatically enforces across your codebase. Instead of relying on code reviews to catch issues, or configuring complex static analysis tools with dozens of rules, you simply describe what you want in natural language. Example Guidelines: “When initializing lists and dictionaries with known quantities, consider pre-sizing to reduce allocations and improve performance.” “All configuration values including URLs, timeouts, limits, and paths must be externalized to configuration files or environment-specific sources rather than embedded directly in source code.” Guidelines capture your team’s standards, architectural decisions, security requirements, and performance best practices in a centralized, enforceable format. They work across any programming language and automatically adapt to your codebase’s specific context.Anatomy of a Guideline
Every guideline consists of: Title: A clear, actionable name that describes the rule (e.g., “Pre-size Collections When Possible” or “Hardcoded Configuration Values Must Be Eliminated”) Description: Plain English explanation of what should or shouldn’t happen in your code. This is where you define the rule in natural language, including context, reasoning, and any exceptions. Tags: Metadata that helps organize and prioritize guidelines:- Category (Performance, Security, Configuration, Code Quality, etc.)
- Severity (Low, Medium, High, Critical)
- Language (Python, Java, JavaScript, or language-agnostic)
Why Plain English Works
Traditional static analysis tools require you to learn proprietary rule languages, configure complex patterns, or write custom checks. Pandorian inverts this model. You write guidelines the same way you’d explain them to a teammate: “Don’t hardcode API keys,” “Always validate user input before database queries,” “Use connection pooling for database access.” The AI handles the translation from intent to detection, adapting to different coding styles, frameworks, and contexts within your codebase. This means guidelines remain readable, maintainable, and accessible to your entire engineering organization, not just tooling experts.How Enforcement Works
Pandorian enforces guidelines through AI-powered static analysis that runs automatically across your repositories. Here’s how the system operates:1. Guideline Processing
When you create or update a guideline, Pandorian’s AI analyzes the description to understand:- The underlying pattern or anti-pattern to detect
- Code structures and language constructs involved
- Context that makes a violation legitimate vs. problematic
- Edge cases and exceptions implied by the guideline
2. Repository Scanning
Scans can be triggered:- On-demand through the Pandorian dashboard
- On Pull Requests via GitHub App integration
- On a schedule (daily, weekly, or custom intervals)
- Via CI/CD pipeline using Pandorian’s API
- Parses your codebase’s structure and dependencies
- Analyzes code against all active guidelines
- Identifies specific locations where violations occur
- Generates contextual explanations for each finding
- Provides fix generation capabilities where applicable
3. Violation Detection
A violation is identified when code patterns conflict with a guideline’s requirements. The AI doesn’t just match syntax; it understands semantic meaning. For example, the “Hardcoded Configuration Values” guideline detects:- Location: File path, line numbers, and code snippet
- Explanation: Why this code violates the guideline
- Impact: Potential consequences (security risk, performance degradation, etc.)
- Fix generation: Ability to generate context-aware remediation instructions
4. Integration Points
Enforcement happens across your development workflow: Pull Request Checks: Violations appear as PR comments with detailed context, allowing developers to address issues before merge. Dashboard Review: Engineering managers review aggregated violations and prioritize remediation efforts. Feedback Mechanism (Coming Soon): Mark violations as accepted, false positives, or provide feedback directly in the UI to help improve detection accuracy and document intentional exceptions. IDE Integration (Coming Soon): The VSCode plugin will show violations directly in your editor with inline context. CI/CD Gates: Configure pipelines to fail builds when high-severity violations are introduced, preventing issues from reaching production.Understanding Scans
A scan is Pandorian’s analysis of a repository against your active guidelines. Scans provide visibility into where your codebase diverges from established standards.Scan Types
Full Scan: Analyzes all repositories in your organization against all active guidelines. Best for comprehensive organizational audits, understanding technical debt across your entire codebase, and getting a complete view of standards compliance. Repository Scan: Analyzes a specific repository in its entirety against all active guidelines. Ideal for deep-diving into a particular codebase, onboarding new repositories, or conducting focused assessments of individual projects. PR Scan: Analyzes only the changes in a pull request against all active guidelines. Optimized for speed, these scans provide fast feedback during development without re-analyzing unchanged code.What Gets Scanned
Pandorian scans source code files across all languages in your repository. The system automatically:- Identifies file types and languages
- Applies language-specific and language-agnostic guidelines
- Respects
.gitignoreand Pandorian-specific exclusion rules - Focuses on application code (typically excludes
node_modules,vendor, etc.)
Scan Results
Each scan produces: Violation Summary: Total count by severity (Critical, High, Medium, Low), aggregated by guideline and by file. Detailed Findings: Individual violations with context, showing exactly where and why code violates guidelines. Fix Instructions: Context-aware remediation guidance that you can generate for each violation. Results remain accessible in the Pandorian dashboard, with historical data showing how your codebase evolves over time.Scan Performance
Scan duration varies based on repository size, complexity, and the number of active guidelines. Factors that influence scan time include:- Number of files and lines of code
- Programming languages and frameworks used
- Complexity of active guidelines
- System load and resource availability
Violations & Fixes
What Makes a Violation
A violation occurs when code doesn’t comply with a guideline’s requirements. Violations aren’t always bugs; they’re deviations from your team’s defined standards. This could mean:- A security anti-pattern that creates risk
- A performance pattern that degrades efficiency
- A configuration approach that complicates deployment
- An architectural decision that conflicts with team conventions
Understanding Violation Context
Each violation includes rich context: Code Location: Precise file path and line numbers, with the problematic code snippet highlighted. Guideline Reference: Which guideline was violated, with full description and rationale. Why It Matters: Explanation of the specific issue in this code, including potential consequences. Example: For “Hardcoded Configuration Values Must Be Eliminated”:Generate Fix Feature
For each violation, Pandorian can generate context-aware fix instructions tailored to your specific code. When you click “Generate Fix,” the system creates a detailed markdown file containing: Problem Analysis: A breakdown of why the current code violates the guideline, including the specific patterns detected and their implications. Recommended Approach: Step-by-step guidance on how to remediate the violation, explaining the reasoning behind each step. Implementation Examples: Code samples showing compliant patterns in your repository’s language and style, adapted to your specific context. Testing Considerations: Suggestions for how to verify the fix works correctly and doesn’t introduce regressions. This markdown file provides everything you need to understand and implement the fix yourself. You can also feed this markdown file directly to your AI code-writing tool (like GitHub Copilot, Cursor, or Claude), which will use the context-aware instructions to generate the actual code fix for you automatically. The instructions are context-aware, meaning they consider:- Your codebase’s existing patterns and conventions
- The specific frameworks and libraries you’re using
- Related code that might need coordinated changes
- Edge cases specific to your implementation
False Positives and False Negatives
No static analysis system achieves perfect accuracy. While Pandorian’s AI-powered approach significantly improves detection compared to traditional tools, you may occasionally encounter both false positives and false negatives. False Positives: Legitimate code flagged as a violation. This happens when the AI identifies a pattern that matches the guideline but doesn’t understand specific context that makes the code acceptable. When this occurs:- Refine the guideline: Update the guideline description to clarify exceptions and provide more context about when the pattern is acceptable
- Contact support: Share the false positive with our team to help improve detection accuracy (coming soon: mark violations as accepted directly in the UI)
- Temporary workaround: Document accepted violations in your team’s guidelines (coming soon: exclusion rules to skip specific patterns or files during scans)
- Refine the guideline: Make the description more explicit about patterns to detect
- Provide examples: Add specific code examples in the guideline description
- Report patterns: Let Pandorian know about missed patterns to improve detection
