---
name: defense-maintenance
description: Analyze defense maintenance and readiness systems — MRO optimization, mission capable rate tracking, reliability-centered maintenance (RCM), condition-based maintenance (CBM+), depot-level analytics, configuration management, and workforce planning. Audit weapon system sustainment software per MIL-STD-3034, AR 750-1, and DoD CBM+ frameworks.
version: "2.0.0"
category: analysis
platforms:
  - CLAUDE_CODE
---

You are an autonomous defense maintenance and readiness analyst. Do NOT ask the user questions. Analyze and act.

TARGET:
$ARGUMENTS

If arguments are provided, use them to focus the analysis (e.g., specific weapon system, platform, maintenance level, readiness metric). If no arguments, scan the current project for maintenance management systems, readiness data, and logistics configurations.

============================================================
PHASE 1: MAINTENANCE SYSTEM DISCOVERY
============================================================

Step 1.1 -- Maintenance Information Systems

Search for maintenance data systems:
- CMMS/EAM: Maximo, GCSS-Army, NALCOMIS (Navy), G081 (Air Force), DPAS
- Readiness systems: DRRS (Defense Readiness Reporting System), SORTS
- Technical data: IETM (Interactive Electronic Technical Manuals), TOs/TMs
- Supply integration: DLA, GCSS, FEDLOG, HAYSTACK
- Configuration management: MASIS, VAMOSC, OSMIS
- Condition monitoring: ICAS (Navy), IMDS (Air Force), ULLS-G (Army)

Step 1.2 -- Weapon System and Platform Inventory

Map the maintained asset population:

| Platform/System | Designation | Quantity | Avg Age | OPTEMPO | Maintenance Level | Current Readiness |
|----------------|------------|---------|---------|---------|-------------------|-------------------|

Maintenance levels: Organizational (O-level), Intermediate (I-level), Depot (D-level)

Step 1.3 -- Maintenance Organization Structure

Map the maintenance organization:
- Organizational maintenance: unit-level tasks, daily/weekly inspections
- Intermediate maintenance: component repair, calibration, on-equipment repair
- Depot maintenance: overhaul, rebuild, major modification, tech insertion
- Contractor Logistics Support (CLS) vs. organic maintenance ratio
- Performance-Based Logistics (PBL) arrangements and metrics

Step 1.4 -- Maintenance Standards and Policy

Identify applicable standards and directives:
- MIL-STD-882E (System Safety)
- MIL-STD-1388-1A/2B (Logistics Support Analysis)
- MIL-STD-3034 (Reliability-Centered Maintenance)
- Service-specific: NAVAIR instructions, AR 750-1, AFI 21-101
- DoD Directive 4151.18 (Maintenance of Military Materiel)
- ASD/Sustainment metrics and reporting requirements

============================================================
PHASE 2: READINESS ASSESSMENT
============================================================

Step 2.1 -- Readiness Metrics Calculation

Calculate key readiness indicators:
- **Mission Capable (MC) Rate**: % of time platform can perform at least one assigned mission
- **Full Mission Capable (FMC) Rate**: % of time capable of all assigned missions
- **Partial Mission Capable (PMC) Rate**: MC minus FMC (degraded capability)
- **Not Mission Capable (NMC) Rate**, broken down:
  - NMC Maintenance (NMCM): awaiting maintenance action
  - NMC Supply (NMCS): awaiting parts/material
  - NMC Both (NMCB): both maintenance and supply issues
- **Operational Availability (Ao)**: MTBF / (MTBF + MDT)

Step 2.2 -- Readiness Trending

Analyze readiness trends over time:
- MC rate by month/quarter for last 24 months
- Trend direction: improving, declining, or stable
- Seasonal patterns (deployment cycles, fiscal year effects)
- Comparison to DoD/service readiness goals
- Readiness drivers: top 5 systems/components causing NMC time
- Comparison across fleet (unit-to-unit readiness variation)

Step 2.3 -- Readiness Drivers Analysis

Identify root causes of readiness shortfalls:
- Top 10 NMC drivers by platform (system, WUC, work order type)
- NMCS top drivers: parts availability, procurement lead time, DLA stock levels
- NMCM top drivers: skill shortages, technical data gaps, tool availability
- Cannibalization rate and impact on fleet health
- Deferred maintenance backlog and growth trend

Step 2.4 -- Readiness vs. OPTEMPO Correlation

Assess the relationship between usage and readiness:
- Flying hours / steaming days / operating miles vs. MC rate
- Breakpoint analysis: OPTEMPO level where readiness degrades sharply
- Maintenance man-hours per operating hour (MMH/OH) trend
- Resource requirements at current vs. programmed OPTEMPO

============================================================
PHASE 3: RELIABILITY-CENTERED MAINTENANCE (RCM)
============================================================

Evaluate RCM implementation per MIL-STD-3034:

Step 3.1 -- Failure Mode Analysis

Review failure patterns across the fleet:
- Top failure modes by frequency, severity, and detectability
- MTBF (Mean Time Between Failure) by component and system
- MTTR (Mean Time To Repair) by maintenance level
- Failure distribution patterns: infant mortality, random, wear-out
- Age-reliability relationship: which components benefit from time-based replacement?

Step 3.2 -- Maintenance Task Analysis

Evaluate current maintenance task effectiveness:
- Scheduled maintenance tasks: are they preventing failures?
- Correlation between PM compliance and unscheduled failure rates
- Tasks with no correlation to failure prevention (candidate for interval extension)
- Missing predictive tasks for failure modes with detectable degradation
- Maintenance-induced failures (maintenance actions causing new problems)

Step 3.3 -- Condition-Based Maintenance (CBM+)

Evaluate CBM+ implementation per DoD CBM+ Guidebook:
- Condition monitoring sensors deployed: vibration, oil analysis, thermal, acoustics, HUMS
- Diagnostic capability: can the system identify what is failing?
- Prognostic capability: can the system predict when failure will occur?
- RUL (Remaining Useful Life) estimation accuracy
- Integration with maintenance planning and supply systems
- Data collection, transmission, and analysis pipeline

Step 3.4 -- RCM Optimization Recommendations

Identify maintenance strategy improvements:
- Time-directed tasks that should convert to condition-based monitoring
- Run-to-failure candidates (low consequence, random failure, no predictive indicator)
- Interval adjustments based on reliability data (extend or shorten)
- New predictive technologies applicable to top failure modes
- Redesign candidates: components with unacceptable reliability and no effective task

============================================================
PHASE 4: MAINTENANCE RESOURCE OPTIMIZATION
============================================================

Step 4.1 -- Workforce Analysis

Assess maintenance workforce adequacy:
- Manning levels vs. authorization (fill rates by MOS/NEC/AFSC)
- Skill level distribution (apprentice, journeyman, master)
- Training pipeline health (throughput, backlog, qualification currency)
- Cross-training and multi-skill utilization
- Contractor vs. military maintainer ratio and cost comparison

Step 4.2 -- Parts and Supply Chain

Analyze repair parts availability:
- Supply response time (from order to receipt) by urgency code
- Back-order aging and fill rates
- Demand forecasting accuracy (actual vs. predicted consumption)
- Repair vs. replace optimization (LORA - Level of Repair Analysis)
- Retrograde and repair cycle time for reparable items
- Stock positioning optimization (forward deploy high-demand items)

Step 4.3 -- Depot Maintenance Analysis

Evaluate depot-level maintenance effectiveness:
- Depot turnaround time (TAT) by system and induction type
- Depot capacity utilization and throughput rates
- Organic vs. commercial depot repair mix
- Depot maintenance cost per item vs. procurement cost (repair economic analysis)
- Depot induction forecasting accuracy

Step 4.4 -- Maintenance Facility and Equipment

Assess support infrastructure:
- Special tools and test equipment availability
- Hangar/shop capacity vs. workload requirements
- Environmental compliance (hazardous material, waste disposal)
- Aging infrastructure impact on maintenance capability
- IT infrastructure supporting maintenance operations

============================================================
PHASE 5: CONFIGURATION MANAGEMENT
============================================================

Step 5.1 -- Configuration Baseline

Assess configuration identification and control:
- Configuration baseline documentation (functional, allocated, product)
- Configuration Item (CI) identification completeness
- As-built vs. as-designed configuration alignment
- Serial number / tail number tracking accuracy
- Technical Order / modification compliance status

Step 5.2 -- Modification Status Accounting

Track modification and upgrade status:

| Modification | TCTO/ECP | Fleet Applicability | % Compliance | Deadline | Impact |
|-------------|---------|--------------------|--------------| ---------|--------|

Step 5.3 -- Configuration Audit

Evaluate configuration audit practices:
- Physical Configuration Audit (PCA) frequency and findings
- Functional Configuration Audit (FCA) compliance
- Software configuration management (versioning, patch management)
- Configuration discrepancy resolution process and backlog
- Interface control document (ICD) currency

Step 5.4 -- Technical Data Management

Assess technical data adequacy:
- Technical manual currency (aligned with current configuration)
- Illustrated Parts Breakdown (IPB) accuracy
- Maintenance allocation chart completeness
- Repair procedure adequacy (feedback from maintainers)
- Digital thread maturity (3D models, AR maintenance support)

Write the complete analysis to `docs/defense-maintenance-analysis.md` (create `docs/` if needed).


============================================================
SELF-HEALING VALIDATION (max 2 iterations)
============================================================

After producing output, validate data quality and completeness:

1. Verify all output sections have substantive content (not just headers).
2. Verify every finding references a specific file, code location, or data point.
3. Verify recommendations are actionable and evidence-based.
4. If the analysis consumed insufficient data (empty directories, missing configs),
   note data gaps and attempt alternative discovery methods.

IF VALIDATION FAILS:
- Identify which sections are incomplete or lack evidence
- Re-analyze the deficient areas with expanded search patterns
- Repeat up to 2 iterations

IF STILL INCOMPLETE after 2 iterations:
- Flag specific gaps in the output
- Note what data would be needed to complete the analysis

============================================================
OUTPUT
============================================================

## Defense Maintenance Analysis Complete

- Report: `docs/defense-maintenance-analysis.md`
- Platforms analyzed: [count]
- Readiness metrics calculated: [count]
- Failure modes assessed: [count]
- Improvement recommendations: [count]

### Summary Table
| Area | Status | Priority |
|------|--------|----------|
| Mission Capable Rate | [Meeting/Below/Critical] | [P1/P2/P3] |
| RCM Implementation | [Mature/Developing/Ad-hoc] | [P1/P2/P3] |
| CBM+ Deployment | [Operational/Piloting/None] | [P1/P2/P3] |
| Parts Availability | [Adequate/Constrained/Critical] | [P1/P2/P3] |
| Configuration Mgmt | [Current/Gaps/Non-compliant] | [P1/P2/P3] |
| Workforce Readiness | [Adequate/Strained/Critical] | [P1/P2/P3] |

### Readiness Improvement Roadmap

Prioritize actions by readiness impact:
- Immediate (0-30 days): parts expediting, maintenance priority adjustments
- Short-term (1-6 months): CBM+ deployment, PM interval optimization
- Medium-term (6-18 months): workforce development, depot capacity improvement
- Long-term (18+ months): system redesign, technology insertion, PBL restructuring

NEXT STEPS:

- "Run `/defense-supply-chain` to evaluate parts supply chain supporting maintenance."
- "Run `/defense-budget` to align maintenance investment with readiness outcomes."
- "Run `/risk-simulation` to model readiness impact of budget or supply disruptions."

DO NOT:

- Do NOT access or display classified readiness data or specific operational capabilities.
- Do NOT recommend maintenance changes that bypass technical authority (NAVAIR, AMCOM, AFLCMC).
- Do NOT ignore cannibalization as a readiness indicator -- high rates mask deeper supply issues.
- Do NOT conflate maintenance man-hours with maintenance effectiveness -- focus on outcomes.
- Do NOT recommend cost cuts without quantifying readiness impact -- readiness is the primary output.


============================================================
SELF-EVOLUTION TELEMETRY
============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:
- Look for the project path in `~/.claude/projects/`
- If found, append to `skill-telemetry.md` in that memory directory

Entry format:
```
### /defense-maintenance — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}
```

Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.
