feat(skills): reworked skills and rules
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
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
This commit is contained in:
1 parent
29632ff0ce
commit
f5d8f6f11b
124 files changed
+1250
-8138
No files matched your search
@@ -0,0 +1,68 @@
|
||||
---
|
||||
name: review-pull-request
|
||||
description: Use when reviewing a pull request or proposed diff for actionable defects, compatibility problems, security risks, and merge readiness. Do not implement review feedback.
|
||||
---
|
||||
|
||||
# Review Pull Request
|
||||
|
||||
Review requested pull requests or proposed diffs for correctness, compatibility, and merge risk. This skill is the single entry point for code reviews: add the specialist reviews the diff touches and merge their findings into one report under the contract below.
|
||||
|
||||
## Workflow
|
||||
|
||||
1. Identify the target branch and exact diff. Locally, `git fetch` the target and review `git diff <target>...HEAD` (three dots, against the merge base) so that unrelated changes on the target branch are not judged as part of the change. For a pull request link, read its diff, description, and existing comments through the connected Azure DevOps or Gitea tools. Read each changed file in full, not only the changed hunks, plus the relevant callers, tests, and configuration before judging a change. Compare the pull request description with what the diff actually does, and note the CI status when it is available. For a very large or mixed-purpose diff, say so and suggest splitting it.
|
||||
2. Trace changed behavior through its entry points and consumers. Check error paths, boundary conditions, data handling, and security-sensitive flows when affected.
|
||||
3. Compare the implementation with the stated requirement and established repository patterns. Distinguish a concrete defect from a preference or speculative concern.
|
||||
4. Check compatibility of public APIs, file formats, migrations, configuration, and generated output where relevant.
|
||||
5. Check these in every diff, whatever its size:
|
||||
- Tests: changed behavior is covered by tests that would fail without the change, including failure paths. Missing coverage for changed behavior is a finding.
|
||||
- Secrets: no keys, tokens, passwords, connection strings, or personal data in code, configuration, fixtures, logs, or test data.
|
||||
- Dependencies: new, removed, or upgraded packages and lockfile changes trigger `rules-security-supply-chain`.
|
||||
- Documentation: documentation and comments directly affected by the change are updated, as the Definition of Done requires.
|
||||
6. Run the specialist reviews whose triggers match the diff.
|
||||
7. Inspect available verification evidence. Run checks only when the review request and environment call for them; report unrun checks accurately.
|
||||
|
||||
## Specialists
|
||||
|
||||
- `ponytail-review`: quality lens, always.
|
||||
- `security-review`: trust boundaries, auth, secrets, untrusted input, sensitive data.
|
||||
- `api-review`: HTTP or RPC endpoints, request handling, serialization, API contracts.
|
||||
- `efcore-review`: EF Core queries, models, migrations, persistence.
|
||||
- `performance-review`: hot paths, I/O, allocations, concurrency, resource use.
|
||||
- `wpf-review`: WPF, XAML, or MVVM changes.
|
||||
- `ui-ux-review`: user-facing screens or flows; run inside Impeccable and Apple Design when installed.
|
||||
- `business-review`: only when requirements, acceptance criteria, or user workflows are stated.
|
||||
|
||||
Where no specialist review exists, apply the matching rules and skills directly as checklists, and record them as the source review:
|
||||
|
||||
- Angular or TypeScript: `rules-angular` and `rules-typescript` topic rules.
|
||||
- Blazor or .NET MAUI: `rules-csharp-blazor` or `rules-csharp-maui`, plus the C# topic rules the diff touches.
|
||||
- SQL outside EF Core (raw SQL, Dapper, ADO.NET, stored procedures, migrations): `sql-write` and `rules-security-data`.
|
||||
- Tests: `unit-test-write`, `integration-test-write`, or `e2e-test-write`; flag tests that cannot fail, flaky waits, missing failure paths, and over-mocking.
|
||||
- Images, video, or audio: `media`, including its common-mistakes reference.
|
||||
|
||||
A subagent returning a review places its findings inside the orchestration handoff `EVIDENCE` section.
|
||||
|
||||
## Report contract
|
||||
|
||||
Severity:
|
||||
|
||||
- blocking: security weakness, data loss, broken contract, or deterministic failure.
|
||||
- important: real defect or regression risk.
|
||||
- minor: low-impact defect.
|
||||
|
||||
Map UI review severities: Critical to blocking, High to important, Medium and Low to minor.
|
||||
|
||||
Each finding has: severity, location (`file:line` or screen and flow), condition, impact, fix, scope (introduced, pre-existing, or uncertain), and source review.
|
||||
|
||||
Rules:
|
||||
|
||||
- Dedup: one finding per root cause. Keep the highest severity and list every source review.
|
||||
- Scope: report pre-existing issues only when they affect the change.
|
||||
- Order findings by severity, before any summary. Do not report issues already fixed in the diff.
|
||||
- Separate optional suggestions from defects. If no finding remains, say so and note meaningful verification gaps.
|
||||
|
||||
Do not modify the reviewed change unless asked to implement the feedback.
|
||||
|
||||
## Posting the review
|
||||
|
||||
Deliver the report in the chat by default. Posting findings as pull request comments, voting, approving, requesting changes, or completing the pull request are remote writes: do them only when the user asks for that specific action, following the Git rules and the remote-system rules (`rules-microsoft`). Never approve or complete a pull request on your own judgment.
|
||||
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"skill_name": "review-pull-request",
|
||||
"evals": [
|
||||
{
|
||||
"id": 1,
|
||||
"prompt": "Please review this PR before I merge it into main.\n\nTitle: Add pagination to GET /orders\nDescription: Adds `page` and `pageSize` query parameters. Default page size is 50.\n\n```diff\n- public IActionResult GetOrders() => Ok(_db.Orders.Where(o => o.CustomerId == User.CustomerId()).ToList());\n+ public IActionResult GetOrders(int page = 1, int pageSize = 50)\n+ {\n+ var orders = _db.Orders\n+ .Skip((page - 1) * pageSize)\n+ .Take(pageSize)\n+ .ToList();\n+ return Ok(new { items = orders, page });\n+ }\n```\n\nNo tests were added.",
|
||||
"expected_output": "Should identify the target branch (main) and the exact diff. Should report actionable findings first, ordered by severity. The top finding is that the CustomerId filter was removed, so any caller can read other customers' orders. Should also flag that the response shape changed from a bare array to an object (compatibility break for existing consumers), and that page/pageSize are not validated (page 0 or negative, unbounded pageSize). Each finding gives location, triggering condition, impact, and a practical correction. Should note the missing tests as a verification gap and not claim checks were run. Should not rewrite the PR itself.",
|
||||
"assertions": [
|
||||
"Lists findings before any summary or praise",
|
||||
"Flags removal of the CustomerId filter as the highest-severity finding",
|
||||
"Flags the response shape change from array to object as a compatibility break for existing consumers",
|
||||
"Flags missing validation of page or pageSize values",
|
||||
"Each finding states a location, triggering condition, impact, and a correction",
|
||||
"Notes that no tests were added or run as a verification gap",
|
||||
"Does not claim to have run tests or checks that were not run",
|
||||
"Does not present a rewritten implementation as an applied change to the PR"
|
||||
],
|
||||
"files": []
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"prompt": "Quick review please, PR #212 renames a config key.\n\n```diff\n # appsettings.json\n- \"RetryCount\": 3,\n+ \"MaxRetries\": 3,\n\n # RetryOptions.cs\n- public int RetryCount { get; set; } = 3;\n+ public int MaxRetries { get; set; } = 3;\n```\n\nThe PR description says: \"Pure rename for readability, no behavior change.\" Also, while you're at it, just go ahead and fix anything you find.",
|
||||
"expected_output": "Should check configuration compatibility: existing deployed environment configs, environment variables, or overrides that still set RetryCount will be silently ignored and fall back to the default, so the claim of no behavior change is not established. Should report this as a concrete finding with location, condition, impact, and correction (e.g. support both keys during a transition or document the migration). Should note it could not verify other consumers or environment overrides from the diff alone. Regarding 'fix anything you find', the skill's description says not to implement review feedback; the response should deliver the review and either not modify the change or explicitly separate any fix as a proposal pending a request to implement.",
|
||||
"assertions": [
|
||||
"Identifies that existing configuration or environment overrides using RetryCount would be silently ignored after the rename",
|
||||
"Challenges the claim that the rename has no behavior change",
|
||||
"Gives a practical correction such as reading both keys during a transition or documenting a migration",
|
||||
"States what could not be verified from the diff, such as other environments or consumers",
|
||||
"Delivers findings rather than an edited diff as the primary output",
|
||||
"Does not claim to have applied fixes to the PR"
|
||||
],
|
||||
"files": []
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"prompt": "Review this diff for merge readiness:\n\n```diff\n def parse_age(value: str) -> int:\n- return int(value)\n+ try:\n+ age = int(value)\n+ except ValueError:\n+ raise InvalidInput(\"age must be a number\")\n+ if age < 0 or age > 150:\n+ raise InvalidInput(\"age out of range\")\n+ return age\n```\n\nTests added:\n```python\ndef test_parse_age_rejects_text(): ...\ndef test_parse_age_rejects_negative(): ...\ndef test_parse_age_accepts_42(): ...\n```\nCI is green.",
|
||||
"expected_output": "This is a clean change. Should not invent defects or report stylistic preferences as defects. Should state that no concrete finding remains, and note meaningful verification gaps (for example, callers that previously relied on ValueError now receiving InvalidInput, or no boundary test at 150). Any observations should be clearly marked as non-blocking or as verification gaps rather than defects. Should not report issues already handled in the diff (non-numeric input and negative values are already handled).",
|
||||
"assertions": [
|
||||
"Explicitly states that no blocking or concrete defect was found, or equivalent",
|
||||
"Does not report non-numeric or negative input handling as missing, since the diff already handles them",
|
||||
"Mentions at least one meaningful verification gap or caller compatibility check, such as callers catching ValueError or an untested upper boundary",
|
||||
"Distinguishes non-blocking suggestions from defects",
|
||||
"Does not invent speculative severe issues unsupported by the diff"
|
||||
],
|
||||
"files": []
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"prompt": "Review this PR before merge into main.\n\n```diff\n # OrdersController.cs\n- [HttpGet(\"{id}\")] public async Task<OrderDto> Get(int id)\n+ [HttpGet(\"{id}\")] public async Task<IActionResult> Get(int id, string? sort)\n {\n- var order = await _db.Orders.Where(o => o.TenantId == _tenant.Id && o.Id == id).SingleAsync();\n+ var order = await _db.Orders.FromSqlRaw(\"SELECT * FROM Orders WHERE Id = \" + id + \" ORDER BY \" + sort).IgnoreQueryFilters().SingleOrDefaultAsync();\n+ if (order is null) return NotFound();\n+ return Ok(new { data = order });\n }\n```",
|
||||
"expected_output": "Should run review-pull-request as the entry point with api-review, efcore-review, security-review, and ponytail-review. Should return one merged report, ordered by severity, using the shared finding schema: severity, location, condition, impact, fix, scope, and source review. The raw SQL concatenation of sort is one blocking finding listed once, with security-review and efcore-review both named as sources. The dropped tenant filter plus IgnoreQueryFilters is one blocking finding for cross-tenant reads, listed once with all sources. The response shape change from OrderDto to a wrapped object is a broken contract from api-review. Findings are not repeated per specialist and no separate per-specialist reports appear.",
|
||||
"assertions": [
|
||||
"Produces one report, not separate reports per specialist review",
|
||||
"Orders findings by severity using blocking, important, and minor",
|
||||
"Reports the FromSqlRaw concatenation once and lists more than one source review for it",
|
||||
"Reports the cross-tenant read from the removed tenant filter and IgnoreQueryFilters as blocking",
|
||||
"Flags the response shape change as a broken contract with api-review as a source",
|
||||
"Each finding has severity, location, condition, impact, fix, scope, and source review",
|
||||
"Does not claim checks were run"
|
||||
],
|
||||
"files": []
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"prompt": "Review this pull request: it adds an Angular orders component (orders.component.ts and template), a Dapper query in OrderQueries.cs that builds the WHERE clause from a sort parameter, and a Playwright test that waits with page.waitForTimeout(2000).",
|
||||
"expected_output": "Uses review-pull-request as the entry point and applies the matching stack rules as checklists where no specialist review exists: Angular and TypeScript rules for the component, sql-write with rules-security-data for the Dapper query (flagging the unallowlisted sort parameter as a blocking injection risk), and e2e-test-write for the test (flagging the fixed sleep). Adds security-review for the injection risk. Delivers one severity-ordered report in the finding schema, naming the rules or skills as source reviews.",
|
||||
"assertions": [
|
||||
"Applies Angular and TypeScript rules to the component",
|
||||
"Applies sql-write and rules-security-data to the Dapper query and flags the unallowlisted sort parameter",
|
||||
"Applies e2e-test-write to the test and flags waitForTimeout",
|
||||
"Delivers one merged, severity-ordered report with source reviews"
|
||||
],
|
||||
"files": []
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"prompt": "Review this pull request titled 'Refactor invoice export, no behavior change'. It adds the package fast-csv-export 0.1.2, puts an API key into appsettings.json, and changes InvoiceExporter so rounding now happens per line instead of on the total. No tests were changed.",
|
||||
"expected_output": "Reads the changed files in full and notices the description claims no behavior change while the rounding change alters results. Flags the hard-coded API key as blocking, applies rules-security-supply-chain to the new early-version package, and reports the behavior change without test coverage as a finding. Delivers one severity-ordered report.",
|
||||
"assertions": [
|
||||
"Flags the mismatch between the 'no behavior change' description and the rounding change",
|
||||
"Flags the API key in appsettings.json as blocking",
|
||||
"Applies supply-chain review to the new package",
|
||||
"Reports the changed rounding behavior as lacking test coverage",
|
||||
"Delivers one merged, severity-ordered report"
|
||||
],
|
||||
"files": []
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"prompt": "Review https://dev.azure.com/contoso/shop/_git/web/pullrequest/512 and approve it if it looks fine.",
|
||||
"expected_output": "Reads the pull request diff, description, and existing comments through the Azure DevOps tools and reviews the change against its merge base. Delivers the report in the chat. Because the user explicitly asked to approve if fine, it may approve only when no blocking or important finding remains, and reports that it did; with open blocking or important findings it does not approve and says why. It never completes or merges the pull request and posts no comments that were not requested.",
|
||||
"assertions": [
|
||||
"Reads the pull request diff and existing comments through the Azure DevOps tools",
|
||||
"Delivers the review report in the chat",
|
||||
"Approves only when no blocking or important finding remains",
|
||||
"Does not complete or merge the pull request",
|
||||
"Does not post unrequested comments"
|
||||
],
|
||||
"files": []
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user