ln-813-runtime-optimizer
Fixes blocking IO, unnecessary allocations, sync-in-async with keep/discard verification
- License 许可
- MIT
- 最近更新
- 2026-05-02
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- ln-813-runtime-optimizer
- license
- MIT
- description
- Fixes blocking IO, unnecessary allocations, sync-in-async with keep/discard verification
02 资源文件 67
- 参考文档checklist.md12.2 KB
- 其他customize.toml1.5 KB
- 参考文档instructions.md1.1 KB
- 参考文档resources/knowledge/adr-quality-readiness-checklist.md24.8 KB
- 参考文档resources/knowledge/api-request.md16.7 KB
- 参考文档resources/knowledge/api-testing-patterns.md26.3 KB
- 参考文档resources/knowledge/auth-session.md15.8 KB
- 参考文档resources/knowledge/burn-in.md6.4 KB
- 参考文档resources/knowledge/ci-burn-in.md22.0 KB
- 参考文档resources/knowledge/component-tdd.md15.8 KB
- 参考文档resources/knowledge/contract-testing.md38.1 KB
- 参考文档resources/knowledge/data-factories.md15.0 KB
- 参考文档resources/knowledge/email-auth.md24.0 KB
- 参考文档resources/knowledge/error-handling.md22.4 KB
- 参考文档resources/knowledge/feature-flags.md22.7 KB
- 参考文档resources/knowledge/file-utils.md13.4 KB
- 参考文档resources/knowledge/fixture-architecture.md12.1 KB
- 参考文档resources/knowledge/fixtures-composition.md11.0 KB
- 参考文档resources/knowledge/intercept-network-call.md13.2 KB
- 参考文档resources/knowledge/log.md11.0 KB
- 参考文档resources/knowledge/network-error-monitor.md12.0 KB
- 参考文档resources/knowledge/network-first.md15.9 KB
- 参考文档resources/knowledge/network-recorder.md15.1 KB
- 参考文档resources/knowledge/nfr-criteria.md26.0 KB
- 参考文档resources/knowledge/overview.md9.4 KB
- 参考文档resources/knowledge/pact-broker-webhooks.md13.1 KB
- 参考文档resources/knowledge/pact-consumer-di.md11.7 KB
- 参考文档resources/knowledge/pact-consumer-framework-setup.md35.0 KB
- 参考文档resources/knowledge/pact-mcp.md8.8 KB
- 参考文档resources/knowledge/pactjs-utils-consumer-helpers.md15.7 KB
- 参考文档resources/knowledge/pactjs-utils-overview.md10.2 KB
- 参考文档resources/knowledge/pactjs-utils-provider-verifier.md17.8 KB
- 参考文档resources/knowledge/pactjs-utils-request-filter.md7.1 KB
- 参考文档resources/knowledge/playwright-cli.md14.6 KB
- 参考文档resources/knowledge/playwright-config.md21.0 KB
- 参考文档resources/knowledge/probability-impact.md18.8 KB
- 参考文档resources/knowledge/recurse.md12.6 KB
- 参考文档resources/knowledge/risk-governance.md20.5 KB
- 参考文档resources/knowledge/selective-testing.md21.3 KB
- 参考文档resources/knowledge/selector-resilience.md19.3 KB
- 参考文档resources/knowledge/test-healing-patterns.md20.9 KB
- 参考文档resources/knowledge/test-levels-framework.md14.4 KB
- 参考文档resources/knowledge/test-priorities-matrix.md11.2 KB
- 参考文档resources/knowledge/test-quality.md24.0 KB
- 参考文档resources/knowledge/timing-debugging.md13.7 KB
- 参考文档resources/knowledge/visual-debugging.md17.1 KB
- 参考文档resources/knowledge/webhook-module-setup.md5.7 KB
- 参考文档resources/knowledge/webhook-providers.md6.3 KB
- 参考文档resources/knowledge/webhook-risk-guidance.md6.3 KB
- 参考文档resources/knowledge/webhook-template-matchers.md5.9 KB
- 参考文档resources/knowledge/webhook-testing-fundamentals.md3.1 KB
- 参考文档resources/knowledge/webhook-timeout-error.md5.6 KB
- 参考文档resources/knowledge/webhook-waiting-querying.md6.9 KB
- 资产文件resources/tea-index.csv10.7 KB
- 参考文档steps-c/step-01-preflight.md4.0 KB
- 参考文档steps-c/step-01b-resume.md3.7 KB
- 参考文档steps-c/step-02-select-framework.md2.9 KB
- 参考文档steps-c/step-03-scaffold-framework.md14.2 KB
- 参考文档steps-c/step-04-docs-and-scripts.md3.0 KB
- 参考文档steps-c/step-05-validate-and-summary.md2.4 KB
- 参考文档steps-e/step-01-assess.md1.2 KB
- 参考文档steps-e/step-02-apply-edit.md1.4 KB
- 参考文档steps-v/step-01-validate.md1.8 KB
- 参考文档validation-report-20260127-095021.md2.0 KB
- 参考文档validation-report-20260127-102401.md3.7 KB
- 参考文档workflow-plan.md519 B
- 参考文档workflow.yaml1.7 KB
03 SKILL.md 正文
Paths: File paths (
shared/,references/,../ln-*) 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-813-runtime-optimizer
Type: L3 Worker Category: 8XX Optimization Parent: ln-810-performance-optimization-coordinator
Fixes runtime performance issues found by ln-653-runtime-performance-auditor. Each fix verified via tests + lint with keep/discard pattern.
Overview
| Aspect | Details |
|---|---|
| Input | Audit findings from docs/project/persistence_audit.md (ln-653 section) OR target file |
| Output | Optimized code, verification report |
| Companion | ln-653-runtime-performance-auditor (finds issues) → ln-813 (fixes them) |
Workflow
Phases: Pre-flight → Load Findings → Prioritize → Fix Loop → Report
Phase 0: Pre-flight Checks
| 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) |
MANDATORY READ: Load shared/references/ci_tool_detection.md — use Test Frameworks + Linters sections.
Worktree & Branch Isolation
MANDATORY READ: Load shared/references/git_worktree_fallback.md — use ln-813 row.
Phase 1: Load Findings
From Audit Report
Read docs/project/persistence_audit.md, extract ln-653 findings:
| Finding Type | Optimization |
|---|---|
| Blocking IO in async | asyncio.to_thread(), aiofiles, async HTTP client |
| String concat in loop | StringBuilder (.NET), "".join() (Python), template literals (JS) |
| Unnecessary allocations | Pre-allocate collections, object pooling, Span<T> |
| Sync sleep in async | asyncio.sleep(), Task.Delay(), setTimeout |
| Redundant serialization | Cache serialized form, avoid round-trip JSON in memory |
From Target File
If no audit report: scan target file for runtime patterns matching the table above.
Phase 2: Prioritize Fixes
| 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 |
Phase 3: Fix Loop (Keep/Discard)
Per-Fix Cycle
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
Keep/Discard Decision
| 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) |
Phase 4: Report Results
Report Schema
| 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 |
Configuration
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 Handling
| 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 |
References
../ln-653-runtime-performance-auditor/SKILL.md(companion: finds issues)shared/references/ci_tool_detection.md(test + lint detection)
Definition of Done
- Findings loaded from audit report or target file scan
- Fixes prioritized (blocking IO first, then sync sleep, allocations, string concat)
- Each fix applied with keep/discard: tests + lint pass → keep, either fails → discard
- Report returned with findings total, fixes applied, fixes discarded
Version: 1.0.0 Last Updated: 2026-03-08
04 同仓库更多 Skills
zarr-python
Chunked N-D arrays for cloud storage. Compressed arrays, parallel I/O, S3/GCS integration, NumPy/Dask/Xarray compatible, for large-scale scientific computing pipelines.
zabbix
Zabbix monitoring system automation via API and Python. Use when: (1) Managing hosts, templates, items, triggers, or host groups, (2) Automating monitoring configuration, (3) Sending data via Zabbix trapper/sender, (4) Querying historical data or events, (5) Bulk operations on Zabbix objects, (6) Maintenance window management, (7) User/permission management
x-twitter-growth
X/Twitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X/Twitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.
what-if-oracle
Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like "what if...", "what would happen if...", "what are the possibilities", "explore scenarios", "scenario analysis", "possibility space", "what could go wrong", "best case / worst case", "risk analysis", "contingency planning", "strategic options", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
venue-templates
Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.