Destynova2/cli-code-skills / cli-audit-xray
cli-audit-xray
VerifiedReveal hidden semantic, mathematical, dataflow, resource-flow, and operational structure in code. Produces optimization candidates with explicit invariants, risks, validation methods, and handoffs. Use when analyzing a function, hot path, AI inference pipeline, compiler/runtime bottleneck, DevSecOps pipeline, LLM gateway, distributed system, or complex business logic for missed optimization opportunities. Also triggers on "semantic xray", "semantic optimization graph", "hidden structure", "optimization cards", "dataflow optimization", "resource flow", "repeated computation", "unnecessary allocation", "cache placement", "CPU/GPU boundary", "prove this optimization", "is this rewrite safe", or "find optimizations humans miss".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.9 KB |
| references/examples.md | markdown | 2.6 KB |
| references/optimization-families.md | markdown | 2.5 KB |
| references/risk-rules.md | markdown | 2.1 KB |
| references/semantic-optimization-graph.md | markdown | 2.9 KB |
references/risk-rules.md
View on GitHub# Risk Rules
> **When to read:** During `cli-audit-xray` Step 4 when classifying optimization candidates.
## Candidate Status
| Status | Meaning | Typical next step |
|---|---|---|
| `provable_under_assumptions` | Local rewrite is valid if stated assumptions hold | Add unit/property tests; consider patch |
| `benchmarkable` | Semantics are plausible but performance depends on runtime facts | Run `cli-forge-perf` protocol |
| `needs_invariant` | Rewrite depends on a fact not present in code/contracts | Add/verify contract with `cli-audit-drift` |
| `risky` | Could be valid but hidden behavior may break it | Narrow scope, add tests, review boundary |
| `invalid` | Likely behavior-changing | Do not apply |
## Floating-Point and Numeric Risk
Check:
- NaN and infinity;
- signed zero;
- rounding;
- overflow and underflow;
- precision loss;
- operation order;
- tolerance thresholds;
- backend-specific kernel behavior.
Do not use real-number algebra as proof for floating-point code.
## Side-Effect Risk
Before moving, fusing, removing, caching, or deduplicating code, check for:
- logging and metrics;
- mutation and aliasing;
- global state;
- time and randomness;
- network, file, database, or device I/O;
- exceptions and panic order;
- async cancellation;
- lock acquisition/release order.
## Security Boundary Risk
Treat these as semantics, not overhead:
- authn/authz;
- DLP and policy checks;
- audit events;
- tenant scoping;
- secret redaction;
- validation before use;
- replay protection;
- rate limits and backpressure.
Moving a check earlier may be good. Moving it later is usually dangerous. Removing a duplicate check is only safe if the checks are at the same trust boundary and enforce the same policy over the same canonical input.
## Confidence Guidance
Use `../../shared/triage.md` for report confidence. Within optimization cards:
- `0.85-1.00`: exact local evidence and assumptions directly checkable;
- `0.65-0.84`: strong pattern, but runtime or cross-file facts still needed;
- `0.40-0.64`: plausible hypothesis with missing invariants;
- `<0.40`: exploratory idea; do not rank as a near-term fix.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize 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. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |