/maintain
Run periodic health checks on your AgileFlow installation. Use weekly or monthly to keep your setup healthy and optimize performance.
Quick Start
/agileflow:maintainThis runs all maintenance checks and reports health status.
Parameters
No arguments required. The command runs the full maintenance suite automatically.
What Gets Checked
Maintenance performs 6 health checks:
- Update Check - Compare installed vs npm latest version
- Configuration Validity - Validate hooks and metadata integrity
- Status.json Health - Check size, story count, archival needs
- Session Cleanup - Detect stale or orphaned sessions
- Expertise Staleness - Check for outdated expertise files
- Metrics Report - Show velocity, completion rates, trends
Checks in Detail
Update Check
Compares your installed version with the latest available:
- Shows installed version
- Shows latest available version
- Reports update command if newer available
Configuration Validity
Validates all configuration files:
- Metadata JSON syntax and schema
- Settings JSON for hook configuration
- Config.yaml presence
- Reports any misconfigurations
Status.json Health
Monitors story tracking file:
- File size warning: >50KB (large, consider archival)
- File size critical: >100KB (needs archival)
- Counts stories by status (ready, in progress, blocked, completed)
- Detects invalid/orphaned stories
Session Cleanup
Detects stale sessions:
- Registered sessions count
- Sessions inactive >7 days
- Suggests cleanup when needed
- Identifies uncommitted changes
Expertise Staleness
Checks expertise files for updates:
- Total expertise files
- Files >30 days old
- Recommends refresh for stale files
- Reports missing required fields
Metrics Report
Shows project velocity and health:
- Stories completed this week
- Current work in progress count
- WIP limit adherence
- Blocked stories requiring attention
Output Format
Healthy System
š§ AgileFlow Maintenance Check
==============================
2026-01-27 09:15:32
š¦ Update Check
---------------
Installed: v2.94.1
Latest: v2.94.1
ā
Up to date
āļø Configuration Validity
--------------------------
ā
Metadata valid (schema: 2.94.0)
ā
Settings valid (6 hooks configured)
ā
Config.yaml present
š Status.json Health
---------------------
File size: 45KB
Total stories: 127
⢠In Progress: 2
⢠Blocked: 0
⢠Ready: 5
⢠Completed: 120
ā
File size healthy
š Session Health
-----------------
Registered sessions: 1
ā
No stale sessions
š§ Expertise Files
------------------
Total expertise files: 26
ā
Expertise files up to date
š Project Metrics
------------------
Completed this week: 8 stories
Current WIP: 2
ā
WIP within limit (2 / 3)
š Maintenance Summary
======================
ā
System is healthy!
No maintenance actions required.
Run /agileflow:diagnose for detailed system health check.
System Needing Attention
š§ AgileFlow Maintenance Check
==============================
š¦ Update Check
---------------
Installed: v2.93.0
Latest: v2.94.1
ā ļø Update available!
Run: npx agileflow update
š Status.json Health
---------------------
File size: 156KB
ā ļø File size exceeds 100KB - archival recommended
Run: bash scripts/archive-completed-stories.sh
š Session Health
-----------------
ā ļø 2 stale session(s) (>7 days inactive)
Run: /agileflow:session:cleanup
š Project Metrics
------------------
Current WIP: 5
ā ļø WIP exceeds limit (5 > 3)
ā ļø 2 blocked story/stories need attention
š Maintenance Summary
======================
ā ļø Found 6 item(s) needing attention
Recommended actions (4):
⢠Update AgileFlow: npx agileflow update
⢠Archive old stories: bash scripts/archive-completed-stories.sh
⢠Clean up sessions: /agileflow:session:cleanup
⢠Review expertise: /agileflow:validate-expertise
Run /agileflow:diagnose for detailed system health check.
Status Indicators
| Indicator | Meaning |
|---|---|
| ā | Healthy - no action needed |
| ā ļø | Needs attention - specific recommendation provided |
| ā¹ļø | Informational - optional or non-critical |
Common Recommendations
Update Available
ā ļø Update available!
Run: npx agileflow update
Install the latest version to get improvements and bug fixes.
Archive Needed
ā ļø File size exceeds 100KB - archival recommended
Run: bash scripts/archive-completed-stories.sh
Archiving moves old completed stories to monthly archives, keeping status.json lean.
Session Cleanup
ā ļø 2 stale session(s) (>7 days inactive)
Run: /agileflow:session:cleanup
Clean up sessions that haven't been used recently.
WIP Limit Exceeded
ā ļø WIP exceeds limit (5 > 3)
You're working on more stories than recommended. Focus on completing in-progress work.
Blocked Stories
ā ļø 2 blocked story/stories need attention
Unblock stories or resolve their dependencies.
Maintenance Schedule
Weekly
Run /agileflow:maintain weekly to:
- Track velocity and WIP
- Detect blockers early
- Stay aware of stale sessions
Monthly
Run /agileflow:maintain monthly to:
- Review comprehensive metrics
- Archive old stories if needed
- Update expertise files if stale
- Check for security updates
Quarterly
Combine with other maintenance:
- Full system diagnostics (
/agileflow:diagnose) - Configuration review (
/agileflow:configure) - Expertise refresh (
/agileflow:validate-expertise)
Best Practices
- Run regularly - Weekly or monthly for ongoing health
- Act on recommendations - Address warnings promptly
- Monitor trends - Track velocity and WIP over time
- Keep it clean - Archive old stories, clean sessions
- Stay updated - Install updates when available
When to Run
- Startup health check - After installation complete
- Routine maintenance - Weekly or monthly
- Troubleshooting - When issues arise
- Before major work - Before starting new epics
- Post-release - After deploying to verify health
Related Commands
/install- Validate initial installation/diagnose- Full system diagnostics/configure- Configure features/board- View current status
On This Page
/maintainQuick StartParametersWhat Gets CheckedChecks in DetailUpdate CheckConfiguration ValidityStatus.json HealthSession CleanupExpertise StalenessMetrics ReportOutput FormatHealthy SystemSystem Needing AttentionStatus IndicatorsCommon RecommendationsUpdate AvailableArchive NeededSession CleanupWIP Limit ExceededBlocked StoriesMaintenance ScheduleWeeklyMonthlyQuarterlyBest PracticesWhen to RunRelated Commands