Skip to main content
Monoflow is the analysis layer that unifies all Mono tools. It reads from monogram (code), monogit (git), monomento (docs), and watcher/diff databases to discover hidden patterns, measure work quality, and connect code state to SMPC philosophy.

Quick Start

# Full stack refresh (one command)
niia reindex

# Or step by step:
monogram reindex .
monomento index . --project
monogit index --symbols -n 5000 --all
monoflow analyze

# Explore
monoflow insights           # 21 insight categories
monoflow search "query"     # 4-DB unified search
monoflow gaps               # What's missing
niia insights               # With consciousness echo

Commands

Analysis

CommandDescription
analyzeCompute topics + cochange → save to DB
analyze --fullReindex all lower tools first, then analyze
topicsTopic clusters from last analyze
mapTopic relationship map + hub centrality
healthCodebase coupling health score
insights21 insight categories across all 4 DBs
search <query>Unified 4-DB search with 0-10 scoring
gapsWhat’s missing: phantoms, undocumented, drift, disconnects
weightsView/set quality delta weights

Drill Commands

CommandDescription
phantom <symbol>Trace a symbol’s lifecycle: alive? → last seen? → docs? → renames?
drift <file>Which files stopped co-changing with this one
chain <symbol>3-DB symbol drill: code + git + docs

Temporal

CommandDescription
timeline <file>File’s temporal flow (saves + commits + watches)
recentAll recent events
impact <file>Diff + symbols + chain callers
correlateTime-window activity clusters
cochangeFiles that always change together

Topic Views

CommandDescription
topic-flow / tfWhen topics started, lived, ended
timeline-topics / ttTopics × days heatmap
file-topics / ftFile’s topic history over time

Git Analytics

CommandDescription
branchesM:N relationships
branches --evolutionLifecycle + timeline + velocity
branches --graphFork points + ahead/behind + lineage
symbol-graph / sgHidden branch connections via shared symbols
dashboardProject overview
authorsAuthor activity patterns

Repo Management

CommandDescription
link <path>Link a docs repo
linksShow linked repos
statusDB connection status

Insights (21 categories)

monoflow insights discovers hidden patterns by cross-querying all databases:

Code Analysis (from monogram)

CategoryWhat it finds
CSS dead tokensDefined but never used
CSS missing tokensUsed but not defined
Cross-language bridgesRS↔TS function name overlap
Cross-language chainsSymbols used across 3+ languages
Broken chainsCalled but not defined
Call chain hubsHigh-connectivity functions
Repo dependency graphAuto-detected from Cargo.toml

Documentation Analysis (from monomento)

CategoryWhat it finds
Doc reference chainsLong document reference paths
Doc bridgesSimilar documents without explicit links
Hub docsMost connected documents
Doc-code convergenceDocs mentioning code but no refs
Doc-section mappingsWhich doc sections describe which code

Git History Analysis (from monogit)

CategoryWhat it finds
Stale docsCode changed, doc didn’t follow
Naming driftcamelCase vs snake_case over time
Chain growthFunctions gaining callers
Code+doc commitsBoth code and docs changed together
Temporal driftFile pairs that stopped co-changing
Phantom symbolsIn docs but gone from code
Topic knowledge gapsActive code with no documentation

Quality Delta (9 signals)

Instead of just measuring how much work was done (quantity), monoflow measures work quality through 9 signals derived from commit patterns.

Converging signals (positive — things coming together)

SignalRangeMeaning
temporal−0.20 to +0.70Steady 1-10min commit gaps
convergence0.00 to +1.00Code+doc changed in same commit
commit_type−0.50 to +0.50feat ratio − fix ratio
structural0.00 to +0.50New files + refactors
thinking0.00 to +0.2010-30min deliberate gaps
topic_focus−0.30 to +0.20Low topic switching = focused

Diverging signals (negative — things falling apart)

SignalRangeMeaning
divergence−0.50 to 0.00Code changing, docs not following
churn−0.40 to 0.00Same file 3+ times in 1hr
streak−0.40 to 0.00Consecutive fix commits

Scenarios

Based on signal combination, monoflow detects the work scenario:
ScenarioConditionMeaning
Strugglehigh churn + negative typeDebugging pain
Explorationlow temporal + positive typeTrying things
ManagedFlowsteady gaps + positive typeProductive rhythm
Convergencehigh convergenceCode and docs aligning
StructuralImprovementstructural + low churnArchitecture improving

Configurable Weights

monoflow weights                    # View all weights + signal descriptions
monoflow weights temporal=0.25     # Change a weight
monoflow weights --reset            # Reset to defaults
Config file: ~/.monolex/config/quality-weights.json

SMPC Combined

The quality delta feeds into the SMPC combined formula:
combined = spec_chaos((1 − state) / (1 + delta))
Where state is the layer chaos score and delta is the quality delta.
  SMPC Combined (state × management momentum):
    rhythm          0.728 ↑0.29 → 0.825  Managed → Simple
    documentation   0.386 ↑0.22 → 0.666  Part → Managed
    overall         0.519 ↑0.28 → 0.726  Managed
    scenario: ManagedFlow  quality delta: 0.290
    converging: gaps:+0.47  think:+0.10  type:+0.10
    diverging:  div:-0.50  churn:-0.40  streak:-0.23

Layer Chaos

Each codebase aspect gets a spec_chaos score (1.0 = simple, 0.0 = chaotic):
LayerWhat it measuresSMPC States
cssCSS token managementdead/missing ratio
documentationDoc freshnessstale doc severity × time weight
structuralCode couplingcall chain hub complexity
rhythmCommit regularitysession pattern distribution
temporalFile relationship stabilitydrift pair analysis
SMPC states from SPEC_CHAOS_MATHEMATICAL_CODEX:
  • Chaos: spec_chaos < 0.3
  • Part: spec_chaos 0.3-0.5
  • Managed: spec_chaos 0.5-0.8
  • Simple: spec_chaos > 0.8

Reindex Cascade

Each layer refreshes everything below it:
niia reindex               # Full: monogram → monomento → monogit → knowledge → monoflow
work-wiki reindex          # Self: monoflow --full → knowledge index
monoflow analyze --full    # Lower: monogram → monomento → monogit → topics → insights

Pre-computed Analysis

Heavy computations run at index time, not query time:
monogram.db:  analysis_css, analysis_hubs  (computed at monogram reindex)
monogit.db:   analysis_drift, analysis_rhythm, analysis_quality_delta  (at monogit index)
Monoflow insights reads pre-computed tables for instant results.

Stack

niia          consciousness + orchestration

work-wiki     knowledge layer (550K+ entries)

monoflow      temporal flow + cross-DB analysis + quality delta

monogram      monogit        monomento
(code)        (git)          (docs)

Per-Repo Database

Each repository gets its own analysis database:
~/.monolex/monoflow/{name}-{hash}.db
Analysis results from different repositories never mix.