Version: 0.31.0
Status: Production Ready π
Goal: Autonomous AI Software Architect for Multi-Repo Projects
flowchart TB
subgraph Luma["Luma Workflow Guardian"]
SM[State Manager]
GP[GitHub Project Sync]
PC[Pre-flight Checker]
CIC[CI Checker]
PCTX[Project Context]
UI["Terminal UI (ui.py)"]
ACT["Actions Logic (actions/)"]
end
subgraph Agents["LLM Agents"]
Analyst
Coder
Reviewer
end
SM <--> LS[.luma_state.json]
GP <--> GH[GitHub API / gh CLI]
PC --> CIC
PCTX --> Agents
ACT --> SM
UI --> ACT
Agents --> ACT
- State Manager: Tracks project status (Idle, Coding, PR Pending) via
.luma_state.json. - GitHub Project Sync: Deep integration with GitHub Projects (Kanban) with automatic repository and Kanban detection. π
- Pre-flight Checker: Enforces definition of done (Tests, Lint, etc.) before PR.
- CI Checker: Runs CI checks (linting, testing) as a background process. π
- Project Context: Provides LLM agents with context from across multiple specified repositories. π
- Worktree Orchestrator: Multi-agent support for Git worktrees, enabling isolated development environments. π
- SBE Generator: AI-powered Specification by Example for pre-coding phase.
- Smart Fallback: Error Classification, Rate Limit circumvention, specific per-model timeouts, and fallback index reset on provider change.
- Modular Codebase: Clean separation of concerns (
ui.py,actions/,config.py).
stateDiagram-v2
[*] --> idle
idle --> selecting: Select Issue
selecting --> coding: Start Coding
coding --> reviewing: Code Review
reviewing --> preflight: Run Checks
preflight --> pr_pending: Checks Passed
pr_pending --> idle: PR Merged
| State | Description |
|---|---|
idle |
Waiting for new task |
selecting |
Browsing Kanban for 'Ready' issues |
coding |
Active development (Analyst/Coder/Reviewer active) |
reviewing |
AI Review and PR preparation |
preflight |
Pre-PR validation |
pr_pending |
PR created, waiting for merge |
Luma/
βββ luma_core/
β βββ actions/ # Modular business logic for menu actions
β βββ cli_wrapper.py # [NEW] VCS CLI abstraction layer
β βββ config.py # Centralized configuration (supports deep merging)
β βββ sbe.py # SBE core module
β βββ ui.py # UI & Display logic
β βββ state_manager.py # State management
β βββ github_project.py # GitHub/GitLab Sync
β βββ preflight_checker.py # Validation
β βββ ci_checker.py # [NEW] CI checks logic
β βββ project_context.py # [NEW] Multi-repo context loader for agents
β βββ error_classifier.py # Error identification for Fallback
β βββ platform_detector.py # [NEW] Platform detection and unified PR functions
β βββ tools.py # Agent tools
β βββ agents/
β βββ analyst.py # Issue analysis agent
β βββ sbe_agent.py # SBE generator agent
β βββ ... # Other agents
βββ docs/
β βββ templates/
β βββ sbe_template.md # SBE template
βββ v1_legacy/ # Archived V1 code
βββ AGENTS.md # Project conventions & agent roles
βββ main.py # Entry Controller
βββ README.md # Documentation
- Python 3.9+
- VCS CLI: Must be authenticated with one of:
- GitHub CLI (
gh): Default option for GitHub repositories - GitLab CLI (
glab): Alternative for GitLab repositories
- GitHub CLI (
- LLM Keys:
.envconfigured withGOOGLE_API_KEY(single) orGOOGLE_API_KEYS(multi-key comma-separated). SupportsOPENROUTER_API_KEYandCODEX_CLI_API_KEY.
Configure your preferred VCS CLI in .env:
# Use GitHub CLI (default)
VCS_CLI=gh
GITHUB_TOKEN=your_github_token
# Or use GitLab CLI
VCS_CLI=glab
GITLAB_TOKEN=your_gitlab_tokenLuma uses Story Points to estimate complexity and uncertainty, not elapsed time.
| Points | Meaning | Typical Shape |
|---|---|---|
1 |
Very small | Clear, routine, almost no surprises |
2 |
Small | Slightly more detail, still straightforward |
3 |
Medium | Multiple steps or a few decisions |
5 |
Large | Needs planning, has real uncertainty |
8 |
Very large | Risky or broad enough that it should likely be split |
Quick rule of thumb:
- Use
1when the work is obvious and tightly scoped. - Use
2when it is still small, but not trivial. - Use
3when there are multiple steps, moving parts, or decision points. - Use
5when planning is required and uncertainty is meaningful. - Use
8when the scope is broad, risky, or should be broken down first.
Notes:
- In this repo, work smaller than
1should usually still be rounded up to1. - Story Points are not calendar time. A one-day task can still be
3or5if uncertainty and coordination are high.
Further reading:
You can run Luma from any project or directory on your system using the global CLI shortcut:
lumaTo configure this shortcut on your machine, create a script at ~/.local/bin/luma pointing to your Luma installation, make it executable (chmod +x), and ensure ~/.local/bin is in your shell's $PATH.
Alternatively, run Luma directly from its home directory:
# Start the Workflow Guardian
python main.pyLuma also supports a machine-readable headless contract for external callers such as Zenith.
Use metadata mode to verify the running Luma revision and contract before invoking actions:
python main.py --meta --jsonSuccessful output is emitted on stdout as JSON:
{
"status": "success",
"mode": "metadata",
"result": {
"version": "0.31.0",
"git_commit": "7346548185cd82dd8bea308f65015a256bc50646",
"dirty": true,
"contract_version": "2.0",
"supported_actions": ["code_review", "guided_workflow", "create_issue", "select_issue"],
"python_version": "3.9.6"
}
}Field contract:
version: Luma version resolved from the repository version sources.git_commit: CurrentHEADcommit hash.dirty: Whether the repository has local uncommitted changes.contract_version: External CLI contract version for compatibility checks.supported_actions: Stable list of headless actions supported by this Luma build.python_version: Python runtime version for the current process.
Metadata mode is intentionally machine-readable. Use --meta --json and do not combine --meta with --auto or --action.
Use headless action mode for external automation:
python main.py --auto --action code_review --json --project 12--headless is supported as an alias for --auto:
python main.py --headless --action code_review --json --project 12Enhanced project selection with stable selectors:
# Use stable prefixed selectors for reliable project identification
python main.py --auto --action code_review --json --project repo:luma
python main.py --auto --action code_review --json --project path:/Users/oatrice/Software-projects/Luma-worktrees/luma1
python main.py --auto --action code_review --json --project slug:luma-ai-architectContract guarantees:
- In headless
--jsonmode,stdoutis reserved for machine-readable JSON only. - Diagnostics, warnings, and startup noise are routed to
stderr. - Interactive mode remains unchanged when headless flags are not used.
- State Management: Robust JSON-based state tracking.
- GitHub Integration: Syncs issues and moves Kanban cards.
- Pre-flight Checker: Auto-validates code before PR.
- UI Upgrade: "Boxed" UI with emoji and responsive width.
- Modular Architecture: Easy to extend and maintain.
- SBE Generator: AI-powered Specification by Example (Menu: S).
- Draft Code Review: Generate rich PR context with one click (Menu: D).
- Spec-Driven Dev: Native integration of GitHub Spec Kit (Spec -> Plan -> Build).
- Smart Fallback: Optimized fallback chain with intelligent Rate Limit handling.
- Cross-Repo Context & Planning: Agents can plan and access context across multiple repositories. π
- Background CI: CI checks now run as a background process for a non-blocking workflow. π
- Automated Issue Metrics: Automatically calculates, prompts for, and fills story points and effort. π
- LLM Key Rotation: Supports multiple Google API keys with automatic failover and cooldown. π
- Standardized Logging: Clear visibility of which account/model is being used per request, with enhanced error handling and logging for Gemini CLI. π
- Auto-Export Failed Prompts: Automatically exports failed LLM prompts with human-readable timestamps for debugging. π
- Headless CLI Logging: Action-level logging for headless CLI executions, directing diagnostics to stderr. π
- Reviewing Phase: Dedicated state for AI code review with direct PR creation support. π
- Portable dotfiles bootstrap: Template for creating portable dotfiles with AI integration. π
- Expanded Headless Contract: Support for guided workflow, issue creation, and issue selection. π
- Dynamic Project Resolution: Enhanced project key detection via path logic. π
- Auto-Project Integration: New issues are automatically added to the configured GitHub Project. π
- Worktree Orchestration: Multi-agent support for Git worktrees. π
- Automatic Detection: Automatic GitHub repository and Kanban board discovery. π
- Project Management: Centralized project configuration via
.luma/projects.json. π - Project-Aware AI Brain Sync: AI brain sessions filtered by current project context. π
- Enhanced Header UX: CLI header displays folder path, GitHub Project info, and worktree detection. π
- Stable Project Selectors: Reliable headless project selection using repo, path, or slug prefixes. π
- VCS CLI Abstraction: Support for both GitHub CLI (
gh) and GitLab CLI (glab) with configurable selection. π - Platform Detection: Automatic detection of GitHub vs GitLab repositories for unified operations. π
- GitLab Support: Full support for GitLab repositories including merge request creation and status checking. π
- Universal Add/Remove Issues: Add and remove issue options now available in all workflow phases, removing the previous CODING/PREFLIGHT restriction. π
- AI Artifact Lifecycle: Automatically inject and maintain
.gitignorerules for AI ephemeral artifacts, controlled by config toggle. π