Xavier Framework Documentation

Welcome to Xavier, the enterprise-grade SCRUM development framework designed for Claude Code integration.

πŸ“š Version: 1.1.10
πŸ”§ Requirements: Python 3.8+, Claude Code
πŸ“ License: MIT

What is Xavier?

Xavier is a revolutionary development framework that brings enterprise-grade software engineering practices to AI-assisted development. It enforces strict standards including:

  • 100% test coverage requirement
  • Test-first development (TDD)
  • Clean Code principles
  • SOLID design patterns
  • Sequential task execution
  • Full SCRUM methodology

Installation

Xavier can be installed with a single command in your project directory:

curl -sSL https://raw.githubusercontent.com/gumruyanzh/xavier/main/install.sh | bash

Manual Installation

For manual installation or customization:

  1. Clone the repository:
    git clone https://github.com/gumruyanzh/xavier.git
  2. Navigate to your project directory
  3. Run the installation script:
    ./xavier/install.sh

Verification

After installation, verify Xavier is working by opening Claude Code and typing:

/xavier-help

Configuration

Xavier uses a configuration file at .xavier/config.json to manage settings:

{
  "test_coverage_threshold": 100,
  "max_function_lines": 20,
  "max_class_lines": 200,
  "enforce_sequential": true,
  "test_first": true,
  "clean_code_validation": true,
  "velocity_tracking": true,
  "sprint_duration_days": 14
}

Configuration Options

Option Type Default Description
test_coverage_threshold number 100 Minimum test coverage percentage required
max_function_lines number 20 Maximum lines allowed per function
max_class_lines number 200 Maximum lines allowed per class
enforce_sequential boolean true Enforce sequential task execution
test_first boolean true Require tests before implementation

Your First Project

Let's walk through creating your first project with Xavier:

1. Create a User Story

/create-story "As a user, I want to login to the system" 8

2. Add Tasks

/create-task "Implement user authentication model" STORY-001 5
/create-task "Create login API endpoint" STORY-001 3
/create-task "Build login UI component" STORY-001 5

3. Create a Sprint

/create-sprint "Sprint 1: Authentication" 14

4. Start Development

/start-sprint SPRINT-001

Xavier will now guide you through test-first development, ensuring 100% coverage and Clean Code standards.

Architecture

Xavier follows a modular, agent-based architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Xavier Engine               β”‚
β”‚  (Core Orchestration & Control)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚                   β”‚             β”‚              β”‚
β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
β”‚Project β”‚      β”‚   Python    β”‚ β”‚  Golang β”‚  β”‚ Frontend  β”‚
β”‚Manager β”‚      β”‚  Engineer   β”‚ β”‚Engineer β”‚  β”‚ Engineer  β”‚
β”‚ Agent  β”‚      β”‚   Agent     β”‚ β”‚  Agent  β”‚  β”‚   Agent   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    

Core Components

  • Xavier Engine: Central orchestrator managing task execution and validation
  • Agent System: Specialized agents with strict language boundaries
  • SCRUM Manager: Complete SCRUM workflow implementation
  • Validation Pipeline: Enforces test coverage and Clean Code

Specialized Agents

Xavier employs specialized agents with strict responsibilities, now with colored visual identification for clear task tracking:

πŸ“Š [PM] Project Manager

Manages SCRUM ceremonies, sprint planning, and task prioritization. Magenta in CLI.

🐍 [PY] Python Engineer

Writes Python code exclusively, following PEP 8 and TDD. Green in CLI.

🐹 [GO] Golang Engineer

Develops Go code with proper error handling. Cyan in CLI.

🎨 [FE] Frontend Engineer

Creates React/TypeScript components. Yellow in CLI.

πŸ” [CTX] Context Manager

Analyzes codebase and finds patterns. Blue in CLI.

πŸ’Ž [RB] Ruby Engineer

Ruby/Rails development specialist. Red in CLI.

New: Visual Agent Tracking

Version 1.1.0 introduces colored agent visualization:

  • Agent Takeover: Colored boxes show when agents start tasks
  • Status Updates: Real-time indicators (βš™οΈ Working, πŸ§ͺ Testing, βœ… Complete)
  • Agent Handoffs: Visual transitions between specialists
  • Sprint Progress: Colored task counters and success indicators

SCRUM Workflow

Xavier implements the complete SCRUM methodology:

Story Points

Using Fibonacci scale: 1, 2, 3, 5, 8, 13, 21

Sprint Process

  1. Sprint Planning: Select stories based on velocity
  2. Daily Execution: Sequential task processing
  3. Sprint Review: Validate completed work
  4. Retrospective: Continuous improvement

Test-First Development

Xavier enforces strict TDD practices:

1. Red Phase

Write failing test first

2. Green Phase

Write minimal code to pass

3. Refactor Phase

Improve code quality

Coverage Requirements

  • 100% line coverage mandatory
  • All edge cases tested
  • Integration tests for APIs
  • E2E tests for UI components

Clean Code Standards

Xavier enforces Robert C. Martin's Clean Code principles:

Function Standards

  • Maximum 20 lines per function
  • Single responsibility principle
  • Descriptive naming
  • No side effects

Class Standards

  • Maximum 200 lines per class
  • High cohesion
  • Low coupling
  • Interface segregation

βœ… Good Example

def calculate_total_price(items: List[Item]) -> Decimal:
    """Calculate total price including tax."""
    subtotal = sum(item.price * item.quantity for item in items)
    tax = calculate_tax(subtotal)
    return subtotal + tax

❌ Bad Example

def process(data):
    # 50+ lines of mixed responsibilities
    # Database operations
    # Business logic
    # API calls
    # File I/O
    # etc...

Inversion of Control

Xavier implements IoC for better testability and flexibility:

from xavier.core import InjectionContainer

container = InjectionContainer()
container.register(DatabaseService, PostgresService)
container.register(EmailService, SendGridService)
container.register(CacheService, RedisService)

# Dependencies are injected automatically
@container.inject
class UserService:
    def __init__(self, db: DatabaseService, email: EmailService):
        self.db = db
        self.email = email

SOLID Principles

Xavier enforces all five SOLID principles:

S - Single Responsibility

Each class has one reason to change

O - Open/Closed

Open for extension, closed for modification

L - Liskov Substitution

Subtypes must be substitutable for base types

I - Interface Segregation

Many specific interfaces over general ones

D - Dependency Inversion

Depend on abstractions, not concretions

Extending Xavier

Create custom agents and validators:

Custom Agent Example

from xavier.agents import BaseAgent

class DataScienceAgent(BaseAgent):
    """Specialized agent for data science tasks."""

    language = "python"
    specialization = "data_science"

    def validate_code(self, code: str) -> bool:
        # Custom validation for data science code
        return self.check_imports(code, ["pandas", "numpy", "sklearn"])

    def generate_tests(self, code: str) -> str:
        # Generate data science specific tests
        return self.create_statistical_tests(code)

Custom Validator Example

from xavier.validators import BaseValidator

class SecurityValidator(BaseValidator):
    """Validate code for security best practices."""

    def validate(self, code: str) -> ValidationResult:
        issues = []

        if "eval(" in code:
            issues.append("Unsafe use of eval()")

        if "pickle.loads" in code:
            issues.append("Potential pickle vulnerability")

        return ValidationResult(
            passed=len(issues) == 0,
            issues=issues
        )