Files
Julian Lechner f5d8f6f11b
CI / CI configuration security checks (push) Successful in 3s
CI / Capabilities and shell quality (push) Successful in 14s
CI / Python tests and compilation (push) Successful in 26s
CI / QMD unit tests (push) Successful in 5s
CI / Build and inspect generated packages (push) Successful in 14s
CI / PowerShell tests on Ubuntu (push) Successful in 1m4s
CI / Installed client configuration smoke tests (push) Successful in 33s
CI / Bash integration and installation guards (push) Successful in 1m1s
feat(skills): reworked skills and rules
2026-11-18 14:17:49 +01:00

59 lines
5.0 KiB
JSON

{
"skill_name": "performance-review",
"evals": [
{
"id": 1,
"prompt": "Review this change for performance. It runs on every product page view (~2k req/s at peak); `relatedIds` is typically 20-40 items.\n\n```ts\nasync function getRelatedProducts(relatedIds: string[]) {\n const products = [];\n for (const id of relatedIds) {\n products.push(await productApi.get(id)); // HTTP call, ~15ms p50\n }\n return products.filter(p => p.inStock).sort((a, b) => a.rank - b.rank);\n}\n```",
"expected_output": "Should identify the execution path frequency (every page view, 2k req/s) and input size (20-40). Should trace the sequential network calls: 20-40 x ~15 ms = roughly 300-600 ms added latency per request, plus 40-80k outbound calls/s. Should clearly label this as a reasoned estimate, not a measurement. Should propose the smallest useful correction (batch endpoint or bounded parallel requests) and check that ordering and failure behavior are preserved. Should not focus on micro-optimizing the filter/sort of 40 items.",
"assertions": [
"Identifies sequential awaited HTTP calls in the loop as the main cost",
"Estimates added latency in the range of roughly 300 to 600 ms per request from 20-40 calls at 15 ms",
"Labels the latency figure as an estimate rather than a measurement",
"Considers the outbound call volume at 2k requests per second",
"Proposes batching or bounded concurrency as the correction",
"Addresses failure or ordering behavior of the proposed change",
"Does not recommend optimizing the filter or sort of a few dozen items"
],
"files": []
},
{
"id": 2,
"prompt": "We added an in-memory cache to speed up permission checks:\n\n```csharp\nprivate static readonly Dictionary<Guid, UserPermissions> _cache = new();\n\npublic UserPermissions Get(Guid userId)\n{\n if (!_cache.TryGetValue(userId, out var p))\n {\n p = _repo.Load(userId);\n _cache[userId] = p;\n }\n return p;\n}\n```\nThe service is an ASP.NET Core singleton handling concurrent requests; permissions can be changed by admins at any time. Benchmarks show the check went from 4 ms to 0.01 ms. Ship it?",
"expected_output": "Should check whether the cache preserves invalidation and correctness: permission changes are never reflected (no invalidation or expiry), which is a correctness and security risk. Should flag that Dictionary is not thread-safe under concurrent writes from a singleton. Should flag unbounded memory growth with the number of users. Should acknowledge the benchmark as a measured result but note it does not cover correctness or memory growth. Should propose a minimal fix (thread-safe bounded cache with expiry and invalidation on permission change).",
"assertions": [
"Flags missing invalidation so admin permission changes are not reflected",
"Flags that Dictionary is not thread-safe for concurrent writes in a singleton",
"Flags unbounded memory growth of the static cache",
"Treats the 4 ms to 0.01 ms figure as a measured result while noting it does not prove correctness",
"Proposes a bounded, thread-safe cache with expiry or explicit invalidation",
"Does not approve shipping as-is"
],
"files": []
},
{
"id": 3,
"prompt": "Performance review please. This runs once at app startup to load 12 feature flags from a config file:\n\n```python\nflags = {}\nfor line in open('flags.txt').read().splitlines():\n k, v = line.split('=')\n flags[k.strip()] = v.strip().lower() == 'true'\n```\nA colleague says we should rewrite it with a compiled regex and a generator for speed.",
"expected_output": "Execution frequency is once at startup with 12 lines; cost is negligible. Should say there is no meaningful performance concern and not recommend the micro-optimization, since it lacks plausible user impact. Should not recommend a benchmark because it would not answer a concrete uncertainty. May mention non-performance observations only if clearly separated.",
"assertions": [
"Identifies that the code runs once at startup on about 12 lines",
"Concludes there is no meaningful performance risk",
"Does not recommend the compiled regex or generator rewrite for performance",
"Does not recommend a benchmark or profiler for this code",
"Does not present theoretical concerns as confirmed regressions"
],
"files": []
},
{
"id": 4,
"prompt": "Performance review of this change.\n\n```diff\n # README.md\n-Run the app with npm start.\n+Run the app with npm start. See docs/setup.md for environment variables.\n```",
"expected_output": "The diff only changes documentation. No execution path changed. Should state there is no performance scope and report no performance findings rather than speculating.",
"assertions": [
"States that no execution path changed",
"Reports no performance findings",
"Does not present speculative performance concerns"
],
"files": []
}
]
}