- name
- rea-analysis-optimization
- description
- Optimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.
REA analysis optimization
Find a concrete source of unnecessary work, change it at its owner, and verify equivalent completed investigations. A useful outcome can also be a measured decision to leave an implementation alone.
Follow the checkout's performance priorities, tool design, and testing guide. This skill supplies an optimization workflow, not additional permission to execute targets, publish, or merge. Use the current contracts, provider prerequisites, and user authorization.
Reserve performance measurements for changes that target performance or have a concrete regression concern. Routine cleanup uses correctness checks and does not require this optimization workflow or synthetic benchmarks merely because helper calls, imports, or representations change.
Read the Kuna case study when selecting a reuse strategy or interpreting a benchmark. Its pinned observations illustrate tradeoffs; they are not current-provider guarantees or universal speedups.
Pin the question and the correctness oracle
Describe the analyst's completed task, including the facts and relationships needed to answer it, requested detail, source access, and meaningful unknowns. Choose a representative real artifact and a small or empty case. Record the baseline revision, target digest, engine identity, options, host, and entrypoint. Use a separate checkout for changes without disturbing other work.
Establish an oracle independent of the changed implementation: source-built fixture expectations, independently mapped file bytes, or a native producer paired with checks of its interpretation. Comparing two wrappers around the same faulty decoder does not establish correctness. Preserve address widths, same-address alternatives, unresolved endpoints, coverage, and source linkage. An empty result proves absence only within the actually examined scope.
Locate the earliest unnecessary work
Trace one public CLI or MCP task through shared application code to its producer. Measure relevant phases: admission and identity checks, native analysis, decoding, lookup, projection, serialization, Evidence retention, and cleanup. Include catalog discovery and extra calls when they affect the completed task.
Use the evidence to choose the smallest structural correction: