ln-830-code-modernization-coordinator
Modernizes codebase via OSS replacement and bundle optimization. Use when acting on audit findings to reduce custom code.
What this skill does
> **Paths:** File paths (`references/`, `../ln-*`) are relative to this skill directory.
# ln-830-code-modernization-coordinator
**Type:** L2 Domain Coordinator
**Category:** 8XX Optimization
Runtime-backed coordinator for code modernization. Delegates OSS replacement and bundle-size work to isolated child runs, records machine-readable worker summaries, and emits a final coordinator summary.
---
## Overview
| Aspect | Details |
|--------|---------|
| **Input** | Audit report, target module, or modernization scope |
| **Output** | Aggregated modernization report with durable worker artifacts |
| **Workers** | ln-831 (OSS replacer), ln-832 (bundle optimizer) |
| **Runtime** | `.hex-skills/modernization/runtime/runs/{run_id}/` |
---
## Workflow
**Phases:** Pre-flight -> Analyze Input -> Delegate Workers -> Collect Results -> Verify Summary -> Report
---
## Runtime Contract
**MANDATORY READ:** Load `references/ci_tool_detection.md`
**MANDATORY READ:** Load `references/coordinator_runtime_contract.md`, `references/modernization_runtime_contract.md`, `references/coordinator_summary_contract.md`
Runtime CLI:
```bash
node references/scripts/modernization-runtime/cli.mjs start --identifier repo-modernization --manifest-file <file>
node references/scripts/modernization-runtime/cli.mjs status --identifier repo-modernization
node references/scripts/modernization-runtime/cli.mjs checkpoint --phase PHASE_2_DELEGATE_WORKERS --payload '{...}'
node references/scripts/modernization-runtime/cli.mjs record-worker-result --payload '{...}'
node references/scripts/modernization-runtime/cli.mjs record-summary --payload '{...}'
node references/scripts/modernization-runtime/cli.mjs advance --to PHASE_3_COLLECT_RESULTS
node references/scripts/modernization-runtime/cli.mjs complete
```
Required state fields:
- `worker_plan`
- `worker_results`
- `child_runs`
- `verification_passed`
- `report_ready`
- `summary_recorded`
Domain checkpoints:
- `PHASE_1_ANALYZE_INPUT`: target modules, worker selection, stack detection
- `PHASE_2_DELEGATE_WORKERS`: one `child_run` per delegated worker with worker name, `runId`, and `summaryArtifactPath`
- `PHASE_3_COLLECT_RESULTS`: recorded worker summaries and unresolved failures
- `PHASE_4_VERIFY_SUMMARY`: final report path, verification verdict, summary readiness
Guard rules:
- do not advance from `PHASE_2_DELEGATE_WORKERS` until every planned worker emitted a valid `modernization-worker` summary
- do not complete until the final report checkpoint exists and the `modernization-coordinator` summary was recorded
- consume worker JSON summaries only; never infer worker status from prose output
---
## Phase 0: Pre-flight
Confirm the modernization request has a valid scope and a deterministic runtime target.
| Check | Required | Action if Missing |
|-------|----------|-------------------|
| Audit report or target module | Yes | Block modernization |
| Project path | Yes | Block modernization |
| Verification command available | Yes | Block if workers cannot verify changes |
| Existing active run for identifier | No | Pause if conflicting run exists |
---
## Phase 1: Analyze Input
Select workers based on project type and findings.
Worker selection:
| Condition | ln-831 | ln-832 |
|-----------|--------|--------|
| Audit findings include OSS candidates | Yes | No |
| JS/TS project with `package.json` | No | Yes |
| Both conditions true | Yes | Yes |
| Explicit target module only | Yes | Optional if bundle impact exists |
Stack detection:
| Indicator | Stack | ln-832 Eligible |
|-----------|-------|----------------|
| `package.json` + JS/TS files | JS/TS | Yes |
| `*.csproj` | .NET | No |
| `requirements.txt` or `pyproject.toml` | Python | No |
| `go.mod` | Go | No |
Checkpoint payload must include:
- `input_source`
- `worker_plan`
- `stack_detection`
- `skipped_reasons`
---
## Phase 2: Delegate Workers
Delegate one child run per selected worker. Child runs are deterministic and artifact-driven.
Delegate using the concrete worker identities selected by the routing rules below. Do not synthesize family placeholders or guessed skill IDs in prompts.
Delegation context:
| Field | Type | Description |
|-------|------|-------------|
| `projectPath` | string | Absolute path to the target project |
| `auditReport` | string | Path to audit output when applicable |
| `targetModule` | string | Optional focused module path |
| `identifier` | string | Stable worker identifier |
| `runId` | string | Deterministic child run id |
| `summaryArtifactPath` | string | Exact JSON path for the worker summary |
| `options` | object | Verification flags and worker-specific settings |
Delegation rules:
- launch `ln-831` before `ln-832` when both are selected
- `ln-832` consumes the project state produced by accepted modernization changes, not a guessed baseline
- checkpoint every child run before waiting on its result
- record every emitted worker summary with `record-worker-result`
---
## Phase 3: Collect Results
Aggregate validated worker summaries only.
Worker summary fields consumed by the coordinator:
| Field | Description |
|-------|-------------|
| `producer_skill` | worker identity (`ln-831` or `ln-832`) |
| `summary_kind` | must be `modernization-worker` |
| `identifier` | stable worker identifier |
| `payload.status` | completed, partial, or failed |
| `payload.changes_applied` | kept changes |
| `payload.changes_discarded` | discarded experiments |
| `payload.verification` | build/test verification result |
| `payload.artifact_path` | worker-owned durable report path |
| `payload.warnings` | non-blocking issues |
Collection output:
- `worker_results`
- `success_count`
- `partial_count`
- `failed_count`
- `warnings`
---
## Phase 4: Verify Summary
Prepare the final modernization report and verify the coordinator can finish deterministically.
Verification checklist:
- every planned worker produced one valid summary envelope
- aggregate counts match recorded worker results
- final report path exists or is ready to be written
- `report_ready` and `verification_passed` are true before completion
Failure handling:
1. Keep successful worker results intact.
2. Mark failed workers explicitly in the coordinator report.
3. Do not invent rollback actions beyond what workers already verified.
---
## Phase 5: Report
Coordinator report schema:
| Field | Description |
|-------|-------------|
| `input_source` | audit report or target module |
| `workers_activated` | delegated workers |
| `modules_replaced` | OSS replacements applied |
| `loc_removed` | custom code removed |
| `bundle_reduction` | final bundle reduction summary |
| `verification_passed` | aggregate verification verdict |
| `per_worker[]` | machine-readable worker result summaries |
| `warnings[]` | cross-worker warnings |
Completion sequence:
1. Write the durable report.
2. Checkpoint the report path and verification verdict.
3. Record the `modernization-coordinator` summary envelope with `record-summary`.
4. Complete runtime only after the report checkpoint and coordinator summary exist.
---
## Configuration
```yaml
Options:
audit_report: "docs/project/codebase_audit.md"
target_module: ""
enable_oss_replacer: true
enable_bundle_optimizer: true
run_tests: true
run_build: true
```
---
## Error Handling
Recoverable:
| Error | Recovery |
|-------|----------|
| ln-831 partial result | Continue with ln-832 if still applicable |
| ln-832 failure | Preserve ln-831 result and report partial modernization |
| Build failure in one worker | Keep failure in coordinator report, continue collection |
Fatal:
| Error | Action |
|-------|--------|
| No workers activated | Finish with empty-result report |
| Runtime validation failure | Pause run and require intervention |
| Missing worker summary for planned child run | Do not advance from collection |
---
## References
- `../ln-831-oss-replacer/SKILL.md`
- `../ln-832-bundle-optimizer/SKILL.md`
- `../ln-645-arRelated in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.