Loading...
Loading...
Fixes blocking IO, unnecessary allocations, sync-in-async with keep/discard verification
npx skill4agent add levnikolaevich/claude-code-skills ln-813-runtime-optimizerPaths: File paths (,shared/,references/) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.../ln-*
| Aspect | Details |
|---|---|
| Input | Audit findings from |
| Output | Optimized code, verification report |
| Companion | ln-653-runtime-performance-auditor (finds issues) → ln-813 (fixes them) |
| Check | Required | Action if Missing |
|---|---|---|
| Audit findings OR target file | Yes | Block optimization |
| Test infrastructure | Yes | Block (need tests for verification) |
| Linter available | No | Skip lint step in verification |
| Git clean state | Yes | Block (need clean baseline for revert) |
shared/references/ci_tool_detection.mdshared/references/git_worktree_fallback.mddocs/project/persistence_audit.md| Finding Type | Optimization |
|---|---|
| Blocking IO in async | |
| String concat in loop | |
| Unnecessary allocations | Pre-allocate collections, object pooling, |
| Sync sleep in async | |
| Redundant serialization | Cache serialized form, avoid round-trip JSON in memory |
| Priority | Criteria |
|---|---|
| 1 (highest) | Blocking IO in async context (blocks event loop) |
| 2 | Sync sleep in async (starves thread pool) |
| 3 | Allocations in hot loop (GC pressure) |
| 4 | String concatenation patterns |
| 5 | Other micro-optimizations |
FOR each finding (F1..FN):
1. APPLY: Edit code (surgical change)
2. VERIFY: Run tests
IF tests FAIL → DISCARD (revert) → next finding
3. VERIFY: Run lint (if available)
IF lint FAIL → DISCARD (revert) → next finding
4. BOTH PASS → KEEP
5. LOG: Record fix for report| Condition | Decision |
|---|---|
| No tests cover affected file/function | SKIP finding — log as "uncovered, skipped" |
| Tests + lint pass | KEEP |
| Tests fail | DISCARD + log reason |
| Lint fail (new warnings) | DISCARD + log reason |
| Lint unavailable | KEEP (tests sufficient) |
| Field | Description |
|---|---|
| source | Audit report path or target file |
| findings_total | Total findings from audit |
| fixes_applied | Successfully kept fixes |
| fixes_discarded | Failed fixes with reasons |
| fix_details[] | Per-fix: finding type, file, before/after description |
Options:
# Source
audit_report: "docs/project/persistence_audit.md"
target_file: ""
# Verification
run_tests: true
run_lint: true
# Scope
fix_types:
- blocking_io
- sync_sleep
- unnecessary_alloc
- string_concat
- redundant_serialization| Error | Cause | Solution |
|---|---|---|
| No audit findings | ln-653 not run or no issues | Report "no findings to optimize" |
| Async rewrite complex | Deep call chain affected | Log as manual step, skip |
| Framework-specific pattern | Unknown async framework | Query Context7/Ref for docs |
../ln-653-runtime-performance-auditor/SKILL.mdshared/references/ci_tool_detection.md