| name | remediate |
| allowed-tools | Bash, Read, Write, Edit, Glob, Grep |
| description | Execute dependency remediation from an analysis report with validation, risk-tiered commits, and code fixes. Applies updates incrementally with build verification after each change. Use when the user has a dependency analysis report and wants to apply the recommended updates, or says "remediate", "fix dependencies", "apply updates". Not for: scanning dependencies (use dependency-scan), or general code fixes unrelated to dependency versions. |
OSDU Remediation Workflow
Execute a dependency remediation plan from an analysis report, applying updates incrementally with validation after each change.
Risk Tiers
| Tier | Score | Strategy | Commits |
|---|
| LOW | 0-1 | Batch together | Single commit |
| MEDIUM | 2-3 | Individual | One commit per update |
| HIGH | 4+ | Research first | One commit per update |
Options
| Flag | Description |
|---|
--low | Apply LOW risk updates only (default) |
--medium | Apply LOW + MEDIUM risk updates |
--high | Apply LOW + MEDIUM + HIGH risk updates |
--all | Same as --high |
--dry-run | Show what would be applied without changes |
Execution Phases
Phase 0: Parse Arguments
Extract report file path and flags.
Phase 1: Parse Report
Read the "For /remediate Command" section. Extract updates by risk level with package, from-version, to-version, CVE, fix-location.
Phase 1.5: Version Verification (CRITICAL)
Before applying any update, verify target versions exist in Maven Central:
uv run skills/maven/scripts/check.py check \
-d {groupId}:{artifactId} -v {current-version} --json
Phase 2: Preparation
- Check clean git status
- Checkout main/master, pull latest
- Validate baseline — spawn build-runner sub-agent:
Read charter: agents/build-runner.agent.md
Task: Validate {project} using javatest.py --validate
- Create remediation branch:
agent/dep-remediation-{YYYYMMDD}
Phase 3: LOW Risk Updates (Batch)
- Apply all verified LOW risk updates to pom.xml
- Spawn build-runner to validate
- On success → single commit:
chore(deps): apply low-risk security updates
- On failure → bisect, skip problematic update
Phase 4: MEDIUM Risk Updates (One-by-One)
Each update gets its own cycle: Apply → Build → Test → Commit → Next
- Apply ONE update
- Spawn build-runner to compile
- Spawn build-runner to test
- On success → commit:
chore(deps): update <package> to <version>
- On failure → analyze, fix if localized, or skip
Phase 5: HIGH Risk Updates (Research First)
- Research breaking changes
- Apply update
- Fix compilation iteratively
- Fix tests
- Commit with BREAKING CHANGE footer if needed
Phase 6: Final Validation
Spawn build-runner to validate full build. Compare to baseline.
Phase 7: Generate Summary
Report applied, skipped, deferred updates with commit hashes.
Phase 8: Update Report File
Append remediation results to the original report.
Multi-Repo Considerations
In a multi-repo workspace:
- Identify which project the report targets
- If updating a shared library (os-core-common), note downstream impact
- After remediating a shared library, suggest running baseline builds on dependent services
- Track cross-repo dependency chains: library → service builds
Commit Convention
chore(deps): description
[optional body with CVE references]