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
| Option | Default | Description |
|---|---|---|
couplingPercent | 60 | Minimum co-change percentage to flag files as coupled |
driftDays | 14 | Days since last modification to consider a file "stale" |
analysisWindow | 90 | Number 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
}
}| Weight | Description |
|---|---|
coupling | How much file coupling affects risk score |
drift | How much file staleness affects risk score |
panic | How much panic keywords affect risk score |
Environment Variables
You can also configure Memoria via environment variables:
| Variable | Description |
|---|---|
MEMORIA_DEBUG | Enable debug logging (set to "true") |
MEMORIA_CONFIG | Path 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/**"
]
}