Get Started

Configuration

Customize Memoria's behavior with a .memoria.json configuration file.

Creating a Config File

Create a .memoria.json file in your project root to customize thresholds, ignore patterns, and risk weights.

{
  "thresholds": {
    "couplingPercent": 60,
    "driftDays": 14,
    "analysisWindow": 90
  },
  "ignore": [
    "node_modules/**",
    "*.test.ts",
    "*.spec.ts"
  ],
  "panicKeywords": [
    "FIXME",
    "HACK",
    "XXX",
    "BUG"
  ],
  "riskWeights": {
    "coupling": 0.4,
    "drift": 0.3,
    "panic": 0.3
  }
}

Configuration Options

Thresholds

OptionDefaultDescription
couplingPercent60Minimum co-change percentage to flag files as coupled
driftDays14Days since last modification to consider a file "stale"
analysisWindow90Number of days of git history to analyze

Ignore Patterns

The ignore array uses glob patterns to exclude files from analysis:

{
  "ignore": [
    "node_modules/**",
    "dist/**",
    "build/**",
    "*.test.ts",
    "*.spec.ts",
    "**/__tests__/**",
    "*.d.ts"
  ]
}

Panic Keywords

Customize the keywords that contribute to a file's "panic score". These indicate areas of technical debt or instability:

{
  "panicKeywords": [
    "FIXME",
    "HACK",
    "XXX",
    "BUG",
    "TODO",
    "BROKEN",
    "DEPRECATED"
  ]
}

Risk Weights

Adjust how different factors contribute to the overall risk score. Weights should sum to 1.0:

{
  "riskWeights": {
    "coupling": 0.4,
    "drift": 0.3,
    "panic": 0.3
  }
}
WeightDescription
couplingHow much file coupling affects risk score
driftHow much file staleness affects risk score
panicHow much panic keywords affect risk score

Environment Variables

You can also configure Memoria via environment variables:

VariableDescription
MEMORIA_DEBUGEnable debug logging (set to "true")
MEMORIA_CONFIGPath to custom config file location

Per-Project Configuration

Each project can have its own .memoria.json. Memoria automatically detects and uses the config file in the current working directory.

Config Priority

Project-level config (.memoria.json) takes precedence over environment variables, which take precedence over defaults.

Minimal Configuration

For most projects, you only need to customize ignore patterns:

{
  "ignore": [
    "node_modules/**",
    "dist/**"
  ]
}
Configuration | Memoria | Memoria