Skip to content

Commands

flowchart TD
  subgraph Discovery["Discovery"]
      brainstorm["maina brainstorm"]
      ticket["maina ticket"]
  end
  subgraph Planning["Planning"]
      plan["maina plan"]
      design["maina design"]
      spec["maina spec"]
  end
  subgraph Execution["Execution"]
      implement["implement (TDD)"]
      verify["maina verify"]
      review["maina review"]
      fix["fix findings"]
  end
  subgraph Ship["Ship"]
      commit["maina commit"]
      review2["maina review"]
      pr["maina pr"]
  end
  subgraph Wiki["Wiki"]
      wikiInit["maina wiki init"]
      wikiQuery["maina wiki query"]
      wikiLint["maina wiki lint"]
  end

  brainstorm --> ticket --> plan --> design --> spec
  spec --> implement --> verify --> review --> fix
  fix --> commit --> review2 --> pr
  pr --> wikiInit --> wikiQuery --> wikiLint

  style Discovery fill:#1e3a5f,stroke:#3b82f6,color:#93c5fd
  style Planning fill:#3b1f5e,stroke:#8b5cf6,color:#c4b5fd
  style Execution fill:#1a3a2a,stroke:#22c55e,color:#86efac
  style Ship fill:#164e63,stroke:#22d3ee,color:#a5f3fc
  style Wiki fill:#4a1942,stroke:#e879f9,color:#f0abfc

Maina has 38+ commands organized into seven workflow phases. Every command draws from the three engines — Context, Prompt, and Verify — as needed.

Eight commands support --json for machine-readable output (JSON envelope with { data, error, meta }): analyze, commit, context, doctor, review, slop, stats, and verify.

CommandDescription
maina setupGuided first-time setup — detects IDE, configures MCP, runs init + doctor

Start here. Explore ideas before committing to implementation.

CommandDescriptionContext Needs
maina brainstormInteractive idea exploration — generates a structured GitHub issue with user stories, acceptance criteria, edge cases. The starting point for every feature.None

Set up your project and define architecture.

CommandDescriptionContext Needs
maina initBootstrap Maina in any repo. Creates .maina/ directory, constitution, AGENTS.md, default prompts.None
maina init --installAuto-install missing verification tools after bootstrapping.None
maina configureInteractive project settings — update constitution, conventions, visual URLs, tool preferences.None
maina ticketCreate a GitHub Issue with automatic module tagging. Use --repo for cross-repo issue creation with aliases from .maina/config.json.Semantic (module structure)
maina contextGenerate focused codebase context. Loads all 4 layers in exploration mode (80% budget).All 4 layers (exploration)
maina explainVisualize codebase structure with Mermaid dependency diagrams and module summaries.Semantic (dependency graph)
maina designCreate an Architecture Decision Record (ADR) with HLD/LLD sections. Use --hld for AI generation. Use --auto for fully automated ADR creation from plan context.Semantic (existing ADRs)
maina review-designReview an ADR against existing decisions and the project constitution. Blocks empty ADRs.Semantic (ADRs + constitution)

Plan, specify, and commit.

CommandDescriptionContext Needs
maina planCreate a feature branch with auto-numbered directory and structured spec/plan/tasks. Resets workflow context.Working + Semantic
maina specGenerate TDD test stubs from plan. Scores spec quality across clarity, testability, completeness. Use --auto for fully automated spec generation without prompts.Working + Episodic
maina commitRun syntax guard, parallel verification (19+ tools), then git commit. Records stats + workflow step.Working only (fast)

Prove correctness before merge.

CommandDescriptionContext Needs
maina verifyFull verification pipeline (19+ tools). Diff-only by default.Working + Semantic
maina verify --deepAdd standard-tier AI semantic review (spec compliance, architecture).Working + Semantic
maina verify --cloudSubmit diff to Maina Cloud for hosted verification. No local tool installs required.Working
maina verify --visualAdd Playwright visual regression checks against baselines.Working + Visual baselines
maina slopStandalone AI slop pattern detection. --all for all tracked files.Working
maina reviewComprehensive two-stage code review: spec compliance first, then code quality.Working + Semantic
maina analyzeCheck cross-artifact consistency: spec, plan, tasks, and code must align.Semantic (all artifacts)
maina prCreate a pull request with two-stage review + verification proof artifacts in the body.All 4 layers

Authenticate, sync prompts, and manage teams.

CommandDescription
maina loginGitHub OAuth device flow. Stores token in ~/.maina/auth.json.
maina logoutClear stored credentials from ~/.maina/auth.json.
maina sync pushUpload local prompts and constitution to the Maina cloud.
maina sync pullDownload team prompts and merge with local copies (conflict resolution included).
maina teamShow team info, members, and roles.
maina team invite <email>Send an invite to join the team.

Compile and query codebase knowledge.

CommandDescriptionContext Needs
maina wiki initCompile codebase knowledge wiki from code, plans, specs, ADRs, workflowsWorking, Semantic
maina wiki compileIncremental recompilation. --full for complete. --ai for LLM enhancement. --dry-run to preview.Working
maina wiki query <question>AI-powered search across wiki articles. --save to persist answer.Wiki (L5)
maina wiki statusHealth dashboard: articles by type, coverage, staleness, last compileNone
maina wiki lintCheck wiki for stale articles, broken links, spec drift, decision violationsWorking, Semantic
maina wiki ingest <source>Add external docs to wiki/raw/ for compilationNone

Tune, learn, and diagnose.

CommandDescription
maina learnAnalyze feedback patterns across tasks and workflow steps. Propose prompt improvements via A/B testing. Use --no-interactive for CI.
maina visual updateCapture current screenshots as visual baselines for regression testing.
maina prompt edit <task>Open a custom prompt template in $EDITOR.
maina cache statsShow cache hit rate, total entries, tokens saved.
maina statsShow commit verification metrics, trends, and quality evolution.
maina benchmarkRun verification benchmarks comparing tools.
maina doctorCheck tool installation status (19+ tools) and engine health.
maina statusShow current workflow state, active feature branch, and verification summary.

Maina’s verify pipeline runs 19+ tools in parallel:

ToolTypeLanguage
BiomeSyntax guardTypeScript/JavaScript
ruffLinterPython
go vetLinterGo
clippyLinterRust
PHPStan/PsalmStatic analysisPHP
TypeScript (tsc)Type checkingTypeScript
SemgrepSAST (2000+ rules)All
TrivyDependency CVEsAll
SecretlintSecret detectionAll
SonarQubeQuality gatesAll
StrykerMutation testingTypeScript/JavaScript
diff-coverCoverage on changed linesAll
Consistency checkCross-artifact alignmentAll
ZAPDAST / web security scanningAll
LighthousePerformance and accessibility auditsWeb
AI reviewSemantic code reviewAll
Slop detectorAI-generated pattern detectionAll
PlaywrightVisual regression testingWeb

Tools are auto-detected and auto-skipped if not installed. Run maina doctor to see status.

Maina detects your project language from marker files and adapts:

LanguageMarker FilesSyntax Tool
TypeScripttsconfig.json, package.jsonBiome
Pythonpyproject.toml, setup.py, requirements.txtruff
Gogo.modgo vet
RustCargo.tomlclippy
PHPcomposer.jsonPHPStan / Psalm
C# (.NET).sln, .csproj, global.jsondotnet format
Java/Kotlinpom.xml, build.gradleCheckstyle

Every command records its outcome to .maina/workflow/current.md. This rolling summary is forwarded between steps so each phase has context from prior phases. Background RL feedback records every step for prompt evolution.

All commands return structured exit codes for CI integration:

CodeMeaningDescription
0PassedNo error-severity findings
1FindingsError-severity findings found
2Tool failureA verification tool crashed
3Config errorMissing config, bad arguments
Terminal window
maina init --install # Bootstrap + install verification tools
maina configure # Set architecture constraints and conventions
maina doctor # Verify tool health
Terminal window
maina plan my-feature # Start feature with structured planning
maina spec # Generate TDD test stubs
# ... write code ...
maina commit # Verify (19+ tools) and commit
maina pr # Create PR with verification proof
Terminal window
maina configure # Set visual URLs
maina visual update # Capture baseline screenshots
# ... make changes ...
maina verify --visual # Compare against baselines
Terminal window
maina learn # Analyze per-step feedback and evolve prompts
maina stats # Track improvement over time