Skip to content
FunCoding

maintenance

Orchestrates 30 check scripts across 9 categories (code, tests, docs, SKILLs, deps, infra). Use when asked to run maintenance, check quality, verify docs, audit SKILLs, or clean up artifacts.

Star
1,152
License
Apache-2.0
Last commit
Oct 13, 2026

coworker/skills/maintenance/SKILL.md

View on GitHub

Maintenance

A config-driven, cross-platform maintenance system that periodically verifies code quality, document correctness, and SKILL documentation AI-friendliness. The orchestrator reads bin/maintenance/config.psd1, runs check scripts on a schedule, persists results to shared state, and reports through multiple formatters (console, JSON, markdown, GitHub annotations).

When to Use

  • "run maintenance"
  • "run CI checks" / "run nightly checks"
  • "check code quality"
  • "verify SKILL frontmatter"
  • "audit documentation links"
  • "check for dead code"
  • "run coverage check"
  • "clean up build artifacts"
  • "add a new maintenance check"
  • "force-run all maintenance tasks"
  • "check the maintenance state"

How It Works

The orchestrator (bin/maintenance/orchestrator.ps1) is the central entry point. It reads task definitions from config.psd1, checks the shared state file to avoid redundant re-runs (unless -Force), executes each task with the configured interval, collects result objects, and routes them through reporters.

Result object contract — every check script emits a PSCustomObject:

@{
    CheckId    = "A1"
    Name       = "Compilation Check"
    Status     = "passed"  # passed | failed | skipped | error
    DurationMs = 1234
    ExitCode   = 0
    Details    = "Maven + Cargo compile OK"
    Results    = @( @{ Item="..."; Status="passed"; Message="..." } )
    Artifacts  = @( "bin/maintenance/logs/A1-20260714.json" )
    Timestamp  = "2026-07-14T14:30:22Z"
}

Usage

All commands are run from the repository root.

Orchestrator (primary entry point)

# One pass (run pending tasks, skip if still within interval)
pwsh bin/maintenance/orchestrator.ps1 -Once

# Continuous loop (dev mode — warn only, never fails)
pwsh bin/maintenance/orchestrator.ps1

# Force all tasks regardless of last-run state
pwsh bin/maintenance/orchestrator.ps1 -Force -Once

# CI mode (strict — first failure exits 1)
MAINTENANCE_MODE=ci pwsh bin/maintenance/orchestrator.ps1 -Once

# Nightly mode (collects all failures, reports at end)
MAINTENANCE_MODE=nightly pwsh bin/maintenance/orchestrator.ps1 -Once

CI entry points

# Per-commit safety checks (fast)
pwsh bin/maintenance/ci/invoke-ci-checks.ps1

# Full nightly suite (thorough)
pwsh bin/maintenance/ci/invoke-nightly-checks.ps1

Running individual checks

# Syntax-check all PS1 scripts
pwsh bin/maintenance/checks/check-ps1-syntax.ps1

# Validate SKILL.md YAML frontmatter
pwsh bin/maintenance/checks/check-skill-frontmatter.ps1

# Validate internal doc links
pwsh bin/maintenance/checks/check-doc-links-internal.ps1

# Check version consistency across files
pwsh bin/maintenance/checks/check-version-consistency.ps1

# Run code coverage check
pwsh bin/maintenance/checks/check-coverage.ps1

# Detect dead code
pwsh bin/maintenance/checks/check-dead-code.ps1

# Clean stale build artifacts (dry-run first)
pwsh bin/maintenance/checks/clean-build-artifacts.ps1

Execution Modes

ModeBehaviorTrigger
ciStrict: any failure exits 1 immediately. Implies -Force.MAINTENANCE_MODE=ci
nightlyRelaxed: collects all failures, reports at end.MAINTENANCE_MODE=nightly
devWarn only: never fails; all issues are warnings.Default

Check Categories

IDCategoryCountFrequency
ACode Quality & Correctness7CI + Nightly + Weekly
BTest Health4CI + Nightly + Weekly
CDocumentation4CI + Nightly + Hourly
DSKILL Documentation3CI + Nightly + Weekly
EVersion & Release3CI + Nightly + Release
FDependency Management3Nightly + Weekly
GInfrastructure Health3CI + Nightly
HOperational Health3Nightly + Weekly
IAI-Assisted Quality2On-demand + Scheduled

Complete Check Inventory

ScriptCategoryIntervalDescription
check-compilation.ps1A5 minMaven + Cargo compilation
check-fast-tests.ps1B10 minFast JUnit unit tests
check-rust-cli.ps1A1 hrcargo test + cargo clippy
check-doc-links-internal.ps1C1 hrInternal documentation links
check-skill-frontmatter.ps1D1 hrSKILL.md YAML frontmatter
check-version-consistency.ps1E1 hrVersion alignment across files
check-ps1-syntax.ps1A1 hrParse all PS1 for syntax errors
check-dockerfile.ps1G1 hrDocker image builds
check-coverage.ps1B24 hrCode coverage vs thresholds
check-test-tags.ps1B24 hrJUnit test tag taxonomy
check-skill-structure.ps1D24 hrSKILL.md section structure
check-dependency-vulns.ps1F24 hrCVE vulnerability scan
check-maven-deps.ps1F24 hrMaven dependency convergence
check-cargo-audit.ps1F24 hrRust cargo audit
check-doc-links-external.ps1C24 hrExternal URL validation
check-bilingual-readme.ps1C24 hrREADME.md ↔ README.zh.md
check-log-sizes.ps1H24 hrLog directory size audit
check-deprecated-apis.ps1A7 daysDeprecated API usage
check-dead-code.ps1A7 daysDead code and unused imports
check-skill-ai-quality.ps1D7 daysSKILL.md AI quality assessment
check-license-compliance.ps1E7 daysDependency license compatibility
clean-build-artifacts.ps1H7 daysRemove stale build artifacts
clean-temp-files.ps1H7 daysRemove stale temp/lock files

Additional on-demand checks not in the default config: check-changelog-staleness.ps1, check-ci-workflows.ps1, check-e2e-tests.ps1, check-integration-tests.ps1, check-qodana.ps1, check-readme-staleness.ps1, check-release-assets.ps1.

Shared State

The orchestrator persists run history to bin/maintenance/state/maintenance-state.json, which is tracked in git so the whole team shares one view.

How skip logic works: A task is skipped if it ran within its configured IntervalSeconds. This means CI nightly running check-coverage prevents a developer's orchestrator from re-running it within 24 hours. Force mode (-Force) or CI mode bypass this entirely.

File locking prevents corruption when two processes write simultaneously. Stale locks (older than 60 seconds) are automatically broken.

Thresholds

All numeric thresholds live in bin/maintenance/thresholds/thresholds.psd1. Override any value via environment variable:

MAINTENANCE_Coverage_Global=0.75 pwsh bin/maintenance/orchestrator.ps1 -Once
MAINTENANCE_LogHealth_MaxTotalMB=200 pwsh bin/maintenance/orchestrator.ps1 -Once

Adding a New Check

  1. Create bin/maintenance/checks/check-my-thing.ps1 following the result object contract
  2. Add a task entry to bin/maintenance/config.psd1 with Name, Description, Enabled, IntervalSeconds, ScriptPath
  3. If it's a CI-level check, add it to bin/maintenance/ci/invoke-ci-checks.ps1
  4. If it's a nightly check, add it to bin/maintenance/ci/invoke-nightly-checks.ps1

Reporters

ScriptOutput
reporters/report-console.ps1Colorized terminal output
reporters/report-json.ps1JSON files under logs/
reporters/report-github-annotations.ps1CI workflow commands
reporters/report-summary.ps1Markdown summary

Directory Layout

bin/maintenance/
├── config.psd1              # Task definitions and intervals
├── orchestrator.ps1         # Master scheduler
├── common/
│   ├── MaintenanceUtil.ps1  # Logging, results, threshold helpers
│   └── MaintenanceState.ps1 # State I/O with file locking
├── checks/                  # 30 check/clean scripts
├── reporters/               # Output formatters
├── ci/                      # CI entry points
├── state/
│   └── maintenance-state.json  # Shared run history (git-tracked)
└── thresholds/
    └── thresholds.psd1      # Numeric thresholds

Dependencies

  • PowerShell Core 6+ (pwsh)
  • Git (repository root resolution)
  • Maven Wrapper (mvnw / mvnw.cmd)
  • Cargo (Rust CLI checks)
  • Docker (Qodana, integration tests, Dockerfile checks)
  • Python 3 (bin/quality/fix-links.py)
  • ripgrep (rg) recommended for fast content search

Similar Skills

test-driven-development

OBobra/superpowers298k2,631 new stars in the last 7 days

migrate-to-shoehorn

MAmattpocock/skills288k10,178 new stars in the last 7 days

agent-runtime-gateway-smoke-test

AFaffaan-m/ECC278k4,046 new stars in the last 7 days

Featured

accessibility

Audit accessibility on Web, iOS, and Android to meet WCAG 2.2, with keyboard navigation and screen-reader support.

AFaffaan-m/ECC278k4,046 new stars in the last 7 days

ai-regression-testing

AFaffaan-m/ECC278k4,046 new stars in the last 7 days

Official

firecrawl-build-interact

FIfirecrawl/firecrawl191k2,010 new stars in the last 7 days