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

60 lines
5.9 KiB
JSON

{
"skill_name": "api-review",
"evals": [
{
"id": 1,
"prompt": "Review this new endpoint:\n\n```csharp\n[Authorize]\n[HttpGet(\"/api/documents/{id}\")]\npublic async Task<IActionResult> Get(Guid id)\n{\n var doc = await _db.Documents.FindAsync(id);\n if (doc == null) return NotFound(new { error = $\"Document {id} not found in tenant {doc.TenantId}\" });\n return Ok(doc);\n}\n```\n\nOther endpoints in this API return errors as RFC 7807 `ProblemDetails` and only return DTOs, never entities.",
"expected_output": "Should trace the request through authentication, authorization, and data access. Top finding: no tenant or ownership check at the point of data access, so any authenticated user can read any document by id (IDOR). Should flag the NullReferenceException in the not-found branch (doc.TenantId when doc is null) producing a 500 instead of 404. Should flag the inconsistent error shape vs ProblemDetails and returning the entity directly (over-exposure, serialization of navigation properties). Each finding with location, triggering request, consumer impact, and correction. Should distinguish defects from optional suggestions.",
"assertions": [
"Reports the missing tenant or ownership check as a security defect",
"Gives a triggering request such as an authenticated user requesting another tenant's document id",
"Flags the null dereference of doc.TenantId in the not-found branch",
"Flags the error body as inconsistent with the ProblemDetails contract",
"Flags returning the entity instead of a DTO as data exposure or contract risk",
"Each finding includes location, impact, and a practical correction",
"Lists defects before optional design suggestions"
],
"files": []
},
{
"id": 2,
"prompt": "Contract change for review. Our public OpenAPI spec v1 is consumed by partner integrations.\n\nBefore:\n```yaml\nCustomer:\n properties:\n id: { type: integer }\n email: { type: string }\n phone: { type: string, nullable: true }\n```\nAfter:\n```yaml\nCustomer:\n required: [id, email, phone]\n properties:\n id: { type: integer }\n email: { type: string }\n phone: { type: string }\n createdAt: { type: string, format: date-time }\n```\nThe PR title is \"Tidy up Customer schema\". The generated TypeScript client in `clients/ts` was not regenerated.",
"expected_output": "Should compare schemas with existing consumers and the published contract. Should flag that phone is now required and non-nullable, which breaks existing clients that send or receive null and breaks request validation for partners. Should note adding createdAt is additive (likely compatible for responses, but if Customer is also a request body it may become required for writes). Should flag the stale generated client. Should consider versioning for older clients. Should distinguish defects from optional suggestions.",
"assertions": [
"Flags phone changing from nullable to required non-null as a breaking change for existing consumers",
"Explains the impact on partner integrations that send or receive null phone values",
"Identifies that adding createdAt is additive or discusses its effect on request bodies",
"Flags that the generated TypeScript client was not regenerated",
"Recommends a compatibility approach such as keeping phone nullable or versioning the API",
"Does not describe the change as a harmless tidy-up"
],
"files": []
},
{
"id": 3,
"prompt": "Can you review the API side of this? We added `POST /api/payments` which charges the card and returns 201. Mobile clients retry automatically on network timeouts. There's no request id or idempotency key in the request. The handler is below:\n\n```ts\nrouter.post('/api/payments', auth, async (req, res) => {\n const { amount, cardToken } = req.body;\n const charge = await psp.charge(cardToken, amount);\n await db.payments.insert({ userId: req.user.id, amount, chargeId: charge.id });\n res.status(201).json({ id: charge.id });\n});\n```",
"expected_output": "Should identify the retry/idempotency problem: automatic retries on timeout can create duplicate charges because there is no idempotency key. Should flag missing validation of amount (missing, negative, non-numeric, oversized) and cardToken. Should consider failure between charge and insert (charged but not recorded). Findings with triggering request, impact, and correction (idempotency key header, validation, error handling). Should ensure validation errors do not disclose sensitive data.",
"assertions": [
"Flags that client retries can produce duplicate charges due to missing idempotency",
"Recommends an idempotency key or equivalent deduplication",
"Flags missing validation of amount, such as negative, missing, or non-numeric values",
"Identifies the failure window where the charge succeeds but the database insert fails",
"Each finding includes a triggering request and a practical correction",
"Distinguishes confirmed defects from optional design suggestions"
],
"files": []
},
{
"id": 4,
"prompt": "Run an API review on this diff.\n\n```diff\n # src/app/profile/profile.component.html\n-<button (click)=\"save()\">Save</button>\n+<button mat-raised-button color=\"primary\" (click)=\"save()\">Save changes</button>\n```",
"expected_output": "The diff only changes an Angular template button. No endpoint, request handling, serialization, or API contract changed. Should state that api-review has no scope here and report no API findings, rather than inventing contract or security issues. May suggest the UI review lens instead.",
"assertions": [
"States that the diff touches no API endpoint, serializer, or contract",
"Reports no API findings",
"Does not invent contract, auth, or validation issues"
],
"files": []
}
]
}