
code-review
by DBS-Dev2000
Version-controlled repository for Claude Code and Claude Desktop agents and skills
SKILL.md
name: code-review description: Automated TFVC code review for Azure DevOps changesets with Snyk security scanning and Notion integration
Code Review Skill
Execute automated code review for a TFVC changeset with security scanning and Notion reporting.
Usage
/code-review <code-review-id> # Default: looks up Code Review Request work item
/code-review --changeset <changeset-id> # Direct changeset ID
/code-review latest # Latest Kraken changeset
Input Interpretation
| You Say | Claude Interprets As |
|---|---|
Code review 5378 | Work Item ID 5378 |
Review 5378 | Work Item ID 5378 |
Code review changeset 25078 | Changeset ID 25078 |
Review CS 25078 | Changeset ID 25078 |
CR 5378 | Work Item ID 5378 |
Why Work Item ID is default: Code Review Requests contain the changeset ID in Microsoft.VSTS.CodeReview.Context field, plus developer info and Wrike task links.
Complete Workflow (MANDATORY)
Step 1: Read PAT Token
PAT=$(cat "C:/Development/CodeReview/.pat")
Step 2: Resolve to Changeset ID
If Work Item ID (default):
curl -s -u ":$PAT" "https://dev.azure.com/poweredbyprisma/Kraken/_apis/wit/workitems/{CODE_REVIEW_ID}?api-version=7.0"
Extract changeset from: fields["Microsoft.VSTS.CodeReview.Context"]
If --changeset flag: Use the provided changeset ID directly
If latest:
curl -s -u ":$PAT" "https://dev.azure.com/poweredbyprisma/_apis/tfvc/changesets?searchCriteria.itemPath=\$/Kraken&\$top=1&api-version=7.0"
Step 3: Fetch Changeset Info
# Get changeset details
curl -s -u ":$PAT" "https://dev.azure.com/poweredbyprisma/Kraken/_apis/tfvc/changesets/{CHANGESET_ID}?api-version=7.0"
# Get changed files
curl -s -u ":$PAT" "https://dev.azure.com/poweredbyprisma/_apis/tfvc/changesets/{CHANGESET_ID}/changes?api-version=7.0"
# Get file content
curl -s -u ":$PAT" "https://dev.azure.com/poweredbyprisma/_apis/tfvc/items?path={ENCODED_PATH}&versionDescriptor.version={CHANGESET_ID}&versionDescriptor.versionType=changeset&api-version=7.0"
Step 4: Look Up Wrike Ticket (if URL in comment)
- Extract numeric ID from URL:
https://www.wrike.com/open.htm?id=4339655699->4339655699 - Convert using
wrike_convert_numeric_idwithidType: ApiV2Task - Fetch details using
wrike_get_tasks - Summarize the objective - What is the developer trying to accomplish?
Step 5: Review ALL Files in Changeset
Include ALL file types: *.cs, *.js, *.ts, *.tsx, *.jsx, *.cshtml, *.css, *.json
For each issue, provide:
- File name (e.g.,
Marriott.cs) - Line number(s) (e.g.,
Line 1632-1635) - Code snippet showing the issue
- Fix recommendation with corrected code
Step 6: Run Snyk Security Scan
snyk_code_scan with path=<mapped_local_path>
Step 7: Save Report
Save to: C:\Development\CodeReview\Reviews\{ChangesetID}-{DeveloperName}.md
Step 8: Upload to Notion (REQUIRED)
pwsh -Command "cd C:\Development\CodeReview; . .\notion-codereview-clean.ps1; New-NotionReportPage -Changeset 'XXXXX' -Developer 'Full Name' -Date 'YYYY-MM-DD' -Content (Get-Content 'Reviews\XXXXX-FullName.md' -Raw)"
Step 9: Report Completion
Display summary with verdict AND Notion report page URL
Path Mapping
| Server Path | Local Path |
|---|---|
$/Kraken/Development/... | C:\Development\PoweredByPrisma\Kraken\Development\... |
$/Kraken/Source/... | C:\Development\PoweredByPrisma\Kraken\Source\... |
For Snyk scanning, also check: C:\Development\PoweredByPrisma\Kraken\Development\{Author Name}\Main 2.0 - Code Review
Project Detection (from TFVC paths)
$/Kraken/-> "Kraken"$/DokShop/-> "DokShop"$/GISP/-> "GISP"
Severity Definitions
| Severity | Description | Examples |
|---|---|---|
| Critical | Security flaws, data loss, system failures | SQL injection, auth bypass, unhandled exceptions in critical paths |
| High | Bugs, major logic errors, performance issues | Null reference risks, infinite loops, N+1 queries |
| Medium | Code smells, missing validation, maintainability | No input validation, duplicate code, unclear naming |
| Low | Style suggestions, minor improvements | Formatting, unnecessary comments, minor refactoring |
Verdict Rules
| Verdict | When to Use |
|---|---|
Approved | No issues, or only Low severity |
Approved with Comments | Has Medium/High but doesn't block merge |
Changes Requested | High issues that must be fixed |
Veto | Critical security issues - DO NOT MERGE |
Report Template (v4)
Notion Formatting Rules (CRITICAL)
| Rule | Description |
|---|---|
No **bold** | Write Changes: not **Changes:** - asterisks show as literal text |
Avoid || | Pipe characters are table separators - use "OR" instead |
| Links work | [text](url) links are supported |
| Code blocks work | Triple backticks for code fences are supported |
| Emojis work | Unicode emojis display correctly |
Template Structure
# Code Review: CS-{ChangesetID}
## Review Info
| Field | Value |
|-------|-------|
| Developer | {Name} |
| Date | {YYYY-MM-DD} |
| Files | {X} reviewed, {Y} skipped |
| Work Item | [{ID}](https://dev.azure.com/PoweredByPrisma/Kraken/_workitems/edit/{ID}) |
| Wrike | [{TaskID}](https://www.wrike.com/open.htm?id={TaskID}) |
| Commit | {commit message} |
---
## Overview
{Brief description of what this changeset does}
| Status | Objective |
|--------|-----------|
| [check] | {Objective 1 - met} |
| [check] | {Objective 2 - met} |
| [warn] | {Objective 3 - partially met} |
| [x] | {Objective 4 - not met} |
---
## Changes
### {Filename1}
| Property | Value |
|----------|-------|
| Path | `{Project/Path/To/File.cs}` |
| Type | edit / add / delete |
| Lines | {XX-YY} |
Changes:
{Description of what changed}
Assessment: {Brief assessment of the change quality}
---
## Issues Found
| Severity | Line | Issue | Recommendation |
|----------|------|-------|----------------|
| High | 125 | {Issue description} | {Fix suggestion} |
| Medium | 340 | {Issue description} | {Fix suggestion} |
| Low | 89 | {Issue description} | {Fix suggestion} |
---
## Security Scan (Snyk)
| File | New Issues | Pre-existing |
|------|------------|--------------|
| {File1.cs} | 0 | 0 |
| {File2.cs} | 0 | 11 |
---
## Summary
| Severity | Count | In Changed Code |
|----------|-------|-----------------|
| Critical | 0 | 0 |
| High | 0 | 0 |
| Medium | 0 | 0 |
| Low | 0 | 0 |
---
## Verdict
| Decision | Status |
|----------|--------|
| APPROVED | No blocking issues |
| APPROVED WITH COMMENTS | - |
| CHANGES REQUESTED | - |
| VETO | - |
---
## Skipped Files
Files modified but not code-reviewed:
- `{file1.json}` - Configuration
- `{file2.csproj}` - Project file
---
*Claude Code - Enterprise Code Reviewer*
File Naming Convention
{ChangesetID}-{DeveloperName}.md
| Component | Format | Example |
|---|---|---|
| ChangesetID | Numeric | 25044 |
| DeveloperName | PascalCase, no spaces | AlokMishra |
| Full filename | {ID}-{Name}.md | 25044-AlokMishra.md |
Directory Structure
C:\Development\CodeReview\
+-- .claude/ # Claude project config
+-- .pat # TFS Personal Access Token
+-- .notion-token # Notion Integration Token
+-- Reviews/ # Completed code review reports
| +-- {ChangesetID}-{Developer}.md
+-- temp/ # Source files for active reviews
+-- notion-codereview-clean.ps1 # Notion integration module (PS7+)
+-- tfvc-code-review.ps1 # TFVC integration script
+-- review-changeset.bat # Review launcher
Notion Integration
IMPORTANT: Do NOT use the Notion MCP for creating pages - it has a JSON serialization bug. Use PowerShell 7 (pwsh) instead.
Notion Resource IDs
| Resource | ID |
|---|---|
| Code Review Reports Folder | 2e7c2c7a-5990-81db-8f1a-d8433677cfdf |
What Gets Created
Each code review creates a report page in Notion under the Reports folder:
- Title format:
CS-{Changeset} - {Developer} - {Date} - Contains: Full markdown review content converted to Notion blocks
- Auto-truncates to 100 blocks if content exceeds Notion's limit
Quick Reference
# Notion ID (copy-paste ready)
Reports Folder: 2e7c2c7a-5990-81db-8f1a-d8433677cfdf
# Verdicts (exact strings)
Approved
Approved with Comments
Changes Requested
Veto
# Projects (exact strings)
Kraken
DokShop
GISP
Important Notes
- ONLY look in Kraken project unless explicitly told otherwise
- Review ALL file types in the changeset (not just .cs files)
- Include line numbers for every issue found
- Always look up Wrike ticket if URL is in changeset comment
- Assess objective completion before diving into code details
- Upload to Notion is REQUIRED as the final step
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon