スキル一覧に戻る
DBS-Dev2000

code-review

by DBS-Dev2000

Version-controlled repository for Claude Code and Claude Desktop agents and skills

0🍴 0📅 2026年1月24日
GitHubで見るManusで実行

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 SayClaude Interprets As
Code review 5378Work Item ID 5378
Review 5378Work Item ID 5378
Code review changeset 25078Changeset ID 25078
Review CS 25078Changeset ID 25078
CR 5378Work 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)

  1. Extract numeric ID from URL: https://www.wrike.com/open.htm?id=4339655699 -> 4339655699
  2. Convert using wrike_convert_numeric_id with idType: ApiV2Task
  3. Fetch details using wrike_get_tasks
  4. 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 PathLocal 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

SeverityDescriptionExamples
CriticalSecurity flaws, data loss, system failuresSQL injection, auth bypass, unhandled exceptions in critical paths
HighBugs, major logic errors, performance issuesNull reference risks, infinite loops, N+1 queries
MediumCode smells, missing validation, maintainabilityNo input validation, duplicate code, unclear naming
LowStyle suggestions, minor improvementsFormatting, unnecessary comments, minor refactoring

Verdict Rules

VerdictWhen to Use
ApprovedNo issues, or only Low severity
Approved with CommentsHas Medium/High but doesn't block merge
Changes RequestedHigh issues that must be fixed
VetoCritical security issues - DO NOT MERGE

Report Template (v4)

Notion Formatting Rules (CRITICAL)

RuleDescription
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 workTriple backticks for code fences are supported
Emojis workUnicode 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
ComponentFormatExample
ChangesetIDNumeric25044
DeveloperNamePascalCase, no spacesAlokMishra
Full filename{ID}-{Name}.md25044-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

ResourceID
Code Review Reports Folder2e7c2c7a-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

スコア

総合スコア

45/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です