Sitelet https://github.com/askpt/code-metrics/pull/685
Skip to content

docs: Add code review skill for enhanced verification process - #685

Merged
askpt merged 1 commit into
mainfrom
agents/create-code-review-skill
Sep 26, 2026
Merged

askpt merged 1 commit into
mainfrom
agents/create-code-review-skill

Conversation

@askpt

@askpt askpt commented Sep 26, 2026

Copy link
Copy Markdown
Owner

This pull request introduces a new skill for code review located in the .agents/skills/code-review directory. The skill aims to improve the review process by incorporating specific checks and guidelines tailored to the repository's needs.

Changes made:

  • Created the main skill file SKILL.md detailing the workflow and rules for code review.
  • Added evaluation fixtures in the evals/ directory to test various scenarios, including cognitive complexity and cross-analyzer parity.
  • Developed reference documents, including cognitive-complexity-rules.md and review-checklist.md, to provide guidelines and examples for reviewers.
  • Updated CONTRIBUTING.md and copilot-instructions.md to include pointers to the new skill and its usage.

Key Features:

  • The skill supports both local branch diffs and GitHub PR reviews.
  • It includes a comprehensive checklist for cognitive complexity and other common issues.
  • The skill is designed to be interactive-first but also safe for unattended use.
  • Verification steps are mandatory before issuing a verdict, ensuring thorough checks.

This addition is expected to streamline the code review process and enhance the quality of code submissions.

Copilot AI balanced review requested due to automatic review settings September 26, 2026 12:26
@askpt
askpt enabled auto-merge (squash) September 26, 2026 12:26
@codecov

codecov Bot commented Sep 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.74%. Comparing base (0aaca96) to head (4dd8e41).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #685   +/-   ##
=======================================
  Coverage   98.74%   98.74%           
=======================================
  Files          12       12           
  Lines        3977     3977           
  Branches      457      457           
=======================================
  Hits         3927     3927           
  Misses         50       50           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@askpt
askpt merged commit eb8e8f3 into main Sep 26, 2026
18 checks passed
@askpt
askpt deleted the agents/create-code-review-skill branch September 26, 2026 12:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Core workflow rules contain contradictory or inaccurate guidance, and one evaluation fixture uses a nonexistent dependency version.

Review effort: Balanced
Findings: 8 Low severity

Open (8)
What changed in this PR

Adds repository-specific guidance for consistent, verified code reviews.

Changes:

  • Adds a review workflow covering verification and repository conventions.
  • Documents complexity rules and review checks.
  • Adds five evaluation fixtures and contributor guidance.
File Description
CONTRIBUTING.md Links the review skill.
.github/​copilot-instructions.md Documents skill directories.
.agents/​skills/​code-review/​SKILL.md Defines the review workflow.
references/​review-checklist.md Adds rule-specific checks.
references/​cognitive-complexity-rules.md Documents analyzer scoring behavior.
evals/​README.md Explains fixture usage.
evals/​01-else-nesting-regression/​input.diff Adds an else-nesting regression case.
evals/​01-else-nesting-regression/​expected.md Defines expected findings.
evals/​02-fix-with-sibling-drift/​input.diff Adds a parity-drift case.
evals/​02-fix-with-sibling-drift/​expected.md Defines expected findings.
evals/​03-dependabot-native-bump/​input.diff Adds a dependency-bump case.
evals/​03-dependabot-native-bump/​expected.md Defines expected findings.
evals/​04-setting-default-drift/​input.diff Adds a configuration-drift case.
evals/​04-setting-default-drift/​expected.md Defines expected findings.
evals/​05-generated-file-hand-edit/​input.diff Adds a generated-file case.
evals/​05-generated-file-hand-edit/​expected.md Defines expected findings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


| Class (how to detect) | Check only this | Then |
|-----------------------|-----------------|------|
| dependabot — `author.login` is `dependabot[bot]`, title `build(deps…)` / `ci(deps)` | `package.json` and `package-lock.json` agree on the new version; a `tree-sitter*` bump updates the matching `allowScripts` key `name@version` (npm 12 skips the native build otherwise); a pinned action SHA keeps its `# vX.Y.Z` comment; `statusCheckRollup` is green | Verdict from these checks only. Skip Steps 3–5. |
| Class (how to detect) | Check only this | Then |
|-----------------------|-----------------|------|
| dependabot — `author.login` is `dependabot[bot]`, title `build(deps…)` / `ci(deps)` | `package.json` and `package-lock.json` agree on the new version; a `tree-sitter*` bump updates the matching `allowScripts` key `name@version` (npm 12 skips the native build otherwise); a pinned action SHA keeps its `# vX.Y.Z` comment; `statusCheckRollup` is green | Verdict from these checks only. Skip Steps 3–5. |
| release-please — title `chore(main): release x.y.z` | `package.json` version, `.github/.release-please-manifest.json` and the top `CHANGELOG.md` entry agree; **no other file** changed | `COMMENT`; never edit its files |
Run these in the worktree that contains the change. Never infer a result from reading.

```bash
npm ci --no-audit --no-fund # only if node_modules is missing or package-lock.json is in the diff
|---|-----------------|-------|-----|
| R1 | `src/metricsAnalyzer/languages/*Analyzer.ts` | Increments follow `references/cognitive-complexity-rules.md`: structural constructs `1 + nesting`; `else`/`else if`, ternary, boolean-operator *runs* and labeled jumps flat `+1`; an else-if body is visited without a second nesting bump; same-operator chains counted once via `isOutermostInSameOperatorChain`; new nesting constructs added to `NESTING_TYPES` | 🔴 |
| R2 | Any change to how one analyzer scores a construct | Probe that construct in all seven analyzers (Step 5). Disagreement **introduced** by the diff → 🟠. Pre-existing disagreement left untouched → 🟡 informational, named as follow-up, never blocking | 🟠/🟡 |
| R3 | Runtime behavior change under `src/**` | For `src/metricsAnalyzer/**` and `src/lruCache.ts`: an exact-complexity assertion (`assert.strictEqual(result.complexity, N)` plus `details` reasons) is added in `src/unit/unit.test.ts` — tests only in `src/test/**` do not count toward the c8 gate. For `src/extension.ts`, `src/configuration.ts`, `src/providers/**` (c8-excluded, need the `vscode` module): the test belongs in `src/test/**` instead. A new `/* c8 ignore */` carries a comment saying why the branch is unreachable | 🟠 |
| R5 | A `codeMetrics.*` setting or its default | Identical in `package.json` `contributes.configuration`, `src/configuration.ts` (default and validation) and the README "Extension Settings" list. The `package.json` value is what users get at runtime; `DEFAULT_CONFIG` is only a fallback, so a change made there alone does nothing and breaks `src/test/configuration.test.ts` | 🟠 |
| R6 | `CHANGELOG.md`, `.github/.release-please-manifest.json`, `.github/workflows/*.lock.yml` | Hand edits outside a release-please PR are wrong: the first two come from release-please, `.lock.yml` from `gh aw compile` of its sibling `.md`. A `.lock.yml` change without its `.md` (or the reverse) is drift | 🟠 |
| R7 | PR title | Type matches content: `fix:` changes runtime behavior in `src/` and adds a regression test; `feat:` adds a user-visible capability and updates README; `refactor:`/`perf:` leave exact-complexity assertions unchanged; `test:`/`docs:`/`ci:`/`build:`/`chore:` touch no `src/` runtime file. `feat` bumps minor, `fix`/`perf` patch, `!` major; `docs`/`test`/`ci`/`build`/`style` are hidden from the changelog | 🟠 |
| R8 | Any TypeScript | Generic correctness with the local traps: `line`/`column` are 0-based; `node.children` allocates in hot loops (use `childCount`/`child(i)`); `substring` where `node.type` suffices; eslint `eqeqeq`, `curly`, `semi` are **warn-only** so CI stays green — you are the gate; glob or regex built from user settings must escape metacharacters | 🟡 |
Comment on lines +23 to +24
- `1 + this.acc.nesting` on something the baseline lists as flat (`else`, `else if`, ternary,
boolean run, labeled jump) → 🔴.
Comment on lines +73 to +74
Worked example: #682 added eviction coverage for `pruneAnalysisCacheForDocument` purely to keep
the branch threshold green — that is the standard.
Comment on lines +161 to +162
- `line`/`column` in `MetricsDetail` are 0-based; anything that adds `+1` for display must do so
only at the VS Code boundary in `src/providers/**`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants