ai-code-reviewer-plus 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/ai-code-reviewer-plus/CLAUDE.md +36 -0
- package/.claude/skills/ai-code-reviewer-plus/skill.md +77 -0
- package/.claude-plugin/marketplace.json +14 -0
- package/.claude-plugin/plugin.json +9 -0
- package/LICENSE +21 -0
- package/README.md +263 -0
- package/dist/analyzers/index.d.ts +31 -0
- package/dist/analyzers/index.test.d.ts +1 -0
- package/dist/chunk-VRJ4NJAF.mjs +670 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +315 -0
- package/dist/cli.mjs +121 -0
- package/dist/collectors/diff-collector.d.ts +19 -0
- package/dist/collectors/diff-collector.test.d.ts +1 -0
- package/dist/collectors/project-detector.d.ts +8 -0
- package/dist/collectors/project-detector.test.d.ts +1 -0
- package/dist/errors.d.ts +46 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +713 -0
- package/dist/index.mjs +40 -0
- package/dist/types.d.ts +146 -0
- package/dist/utils/config.d.ts +16 -0
- package/dist/utils/format.d.ts +24 -0
- package/dist/utils/format.test.d.ts +1 -0
- package/package.json +75 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigError,
|
|
3
|
+
GitCommandError,
|
|
4
|
+
ParseError,
|
|
5
|
+
VERSION,
|
|
6
|
+
analyzeCode,
|
|
7
|
+
analyzeDiffs,
|
|
8
|
+
collectCommitDiff,
|
|
9
|
+
collectDiff,
|
|
10
|
+
detectProject,
|
|
11
|
+
formatDiffSummary,
|
|
12
|
+
formatDuration,
|
|
13
|
+
formatFinding,
|
|
14
|
+
formatReviewReport,
|
|
15
|
+
formatSummary,
|
|
16
|
+
getAvailableRules,
|
|
17
|
+
getDefaultConfig,
|
|
18
|
+
loadConfigFile,
|
|
19
|
+
mergeConfig
|
|
20
|
+
} from "./chunk-VRJ4NJAF.mjs";
|
|
21
|
+
export {
|
|
22
|
+
ConfigError,
|
|
23
|
+
GitCommandError,
|
|
24
|
+
ParseError,
|
|
25
|
+
VERSION,
|
|
26
|
+
analyzeCode,
|
|
27
|
+
analyzeDiffs,
|
|
28
|
+
collectCommitDiff,
|
|
29
|
+
collectDiff,
|
|
30
|
+
detectProject,
|
|
31
|
+
formatDiffSummary,
|
|
32
|
+
formatDuration,
|
|
33
|
+
formatFinding,
|
|
34
|
+
formatReviewReport,
|
|
35
|
+
formatSummary,
|
|
36
|
+
getAvailableRules,
|
|
37
|
+
getDefaultConfig,
|
|
38
|
+
loadConfigFile,
|
|
39
|
+
mergeConfig
|
|
40
|
+
};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Code Reviewer — Core type definitions
|
|
3
|
+
*/
|
|
4
|
+
/** Review dimension categories */
|
|
5
|
+
export type ReviewDimension = 'correctness' | 'security' | 'performance' | 'maintainability' | 'best-practices';
|
|
6
|
+
/** Severity classification for findings */
|
|
7
|
+
export type SeverityLevel = 'BLOCKER' | 'HIGH' | 'MEDIUM' | 'LOW' | 'SUGGESTION';
|
|
8
|
+
/** Single review finding/result */
|
|
9
|
+
export interface ReviewFinding {
|
|
10
|
+
/** Rule ID (e.g., SEC-001) */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Review dimension */
|
|
13
|
+
dimension: ReviewDimension;
|
|
14
|
+
/** Severity level */
|
|
15
|
+
severity: SeverityLevel;
|
|
16
|
+
/** Short title */
|
|
17
|
+
title: string;
|
|
18
|
+
/** Detailed description */
|
|
19
|
+
description: string;
|
|
20
|
+
/** File path */
|
|
21
|
+
file: string;
|
|
22
|
+
/** Line number (optional) */
|
|
23
|
+
line?: number;
|
|
24
|
+
/** Column number (optional) */
|
|
25
|
+
column?: number;
|
|
26
|
+
/** Code snippet showing the issue */
|
|
27
|
+
codeSnippet?: string;
|
|
28
|
+
/** Fix suggestion */
|
|
29
|
+
suggestion?: string;
|
|
30
|
+
/** Example fix code */
|
|
31
|
+
fixExample?: string;
|
|
32
|
+
/** AI confidence level */
|
|
33
|
+
confidence: 'high' | 'medium' | 'low';
|
|
34
|
+
/** Evidence chain (commit/PR/Issue reference) */
|
|
35
|
+
evidence?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Full review result for a diff */
|
|
38
|
+
export interface ReviewResult {
|
|
39
|
+
/** All findings across dimensions */
|
|
40
|
+
findings: ReviewFinding[];
|
|
41
|
+
/** Files reviewed */
|
|
42
|
+
filesReviewed: string[];
|
|
43
|
+
/** Review duration in ms */
|
|
44
|
+
duration: number;
|
|
45
|
+
/** Summary statistics */
|
|
46
|
+
summary: {
|
|
47
|
+
total: number;
|
|
48
|
+
blockers: number;
|
|
49
|
+
high: number;
|
|
50
|
+
medium: number;
|
|
51
|
+
low: number;
|
|
52
|
+
suggestions: number;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** A single hunk within a file diff */
|
|
56
|
+
export interface DiffHunk {
|
|
57
|
+
/** Header line, e.g. "@@ -10,4 +12,6 @@" */
|
|
58
|
+
header: string;
|
|
59
|
+
oldStart: number;
|
|
60
|
+
oldCount: number;
|
|
61
|
+
newStart: number;
|
|
62
|
+
newCount: number;
|
|
63
|
+
/** Lines with prefix: ' ' (context), '+' (add), '-' (delete) */
|
|
64
|
+
lines: string[];
|
|
65
|
+
}
|
|
66
|
+
/** Diff for a single file */
|
|
67
|
+
export interface ParsedDiff {
|
|
68
|
+
/** File path (relative) */
|
|
69
|
+
file: string;
|
|
70
|
+
/** Renamed from (if applicable) */
|
|
71
|
+
from?: string;
|
|
72
|
+
/** File status */
|
|
73
|
+
status: 'added' | 'deleted' | 'modified' | 'renamed';
|
|
74
|
+
/** Addition count */
|
|
75
|
+
additions: number;
|
|
76
|
+
/** Deletion count */
|
|
77
|
+
deletions: number;
|
|
78
|
+
/** Diff hunks */
|
|
79
|
+
hunks: DiffHunk[];
|
|
80
|
+
}
|
|
81
|
+
/** Detected project information */
|
|
82
|
+
export interface ProjectInfo {
|
|
83
|
+
/** Project type */
|
|
84
|
+
type: 'vue' | 'react' | 'node' | 'go' | 'python' | 'unknown';
|
|
85
|
+
/** Specific framework (vue3, react18, express, etc.) */
|
|
86
|
+
framework?: string;
|
|
87
|
+
/** Primary language */
|
|
88
|
+
language: string;
|
|
89
|
+
/** Package manager (npm/pnpm/yarn/pip/go mod) */
|
|
90
|
+
packageManager?: string;
|
|
91
|
+
/** Root directory */
|
|
92
|
+
root: string;
|
|
93
|
+
}
|
|
94
|
+
/** Reviewer configuration */
|
|
95
|
+
export interface ReviewerConfig {
|
|
96
|
+
/** Rule configuration */
|
|
97
|
+
rules: {
|
|
98
|
+
/** Enabled rule IDs */
|
|
99
|
+
enabled: string[];
|
|
100
|
+
/** Disabled rule IDs */
|
|
101
|
+
disabled: string[];
|
|
102
|
+
/** Severity level overrides */
|
|
103
|
+
severityOverrides: Record<string, SeverityLevel>;
|
|
104
|
+
};
|
|
105
|
+
/** Paths to exclude from review */
|
|
106
|
+
excludePaths: string[];
|
|
107
|
+
/** Maximum findings per file */
|
|
108
|
+
maxFindingsPerFile: number;
|
|
109
|
+
/** Output format */
|
|
110
|
+
outputFormat: 'markdown' | 'json';
|
|
111
|
+
/** Target branch for diff comparison */
|
|
112
|
+
targetBranch?: string;
|
|
113
|
+
}
|
|
114
|
+
/** Options for review operations */
|
|
115
|
+
export interface ReviewOptions {
|
|
116
|
+
/** Repository root path */
|
|
117
|
+
root: string;
|
|
118
|
+
/** Target branch to compare against */
|
|
119
|
+
targetBranch?: string;
|
|
120
|
+
/** Specific files to review */
|
|
121
|
+
files?: string[];
|
|
122
|
+
/** Specific commit hash to review */
|
|
123
|
+
commitHash?: string;
|
|
124
|
+
/** Custom configuration */
|
|
125
|
+
config?: Partial<ReviewerConfig>;
|
|
126
|
+
}
|
|
127
|
+
/** Options for file-level review */
|
|
128
|
+
export interface FileReviewOptions {
|
|
129
|
+
/** Repository root path */
|
|
130
|
+
root: string;
|
|
131
|
+
/** File path to review */
|
|
132
|
+
file: string;
|
|
133
|
+
/** Custom configuration */
|
|
134
|
+
config?: Partial<ReviewerConfig>;
|
|
135
|
+
}
|
|
136
|
+
/** Options for commit-level review */
|
|
137
|
+
export interface CommitReviewOptions {
|
|
138
|
+
/** Repository root path */
|
|
139
|
+
root: string;
|
|
140
|
+
/** Commit hash */
|
|
141
|
+
hash: string;
|
|
142
|
+
/** Custom configuration */
|
|
143
|
+
config?: Partial<ReviewerConfig>;
|
|
144
|
+
}
|
|
145
|
+
/** Version constant */
|
|
146
|
+
export declare const VERSION: "0.1.0";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration management for AI Code Reviewer
|
|
3
|
+
*/
|
|
4
|
+
import type { ReviewerConfig } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Deep merge user config with defaults
|
|
7
|
+
*/
|
|
8
|
+
export declare function mergeConfig(user: Partial<ReviewerConfig>): ReviewerConfig;
|
|
9
|
+
/**
|
|
10
|
+
* Get default configuration (fresh copy)
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDefaultConfig(): ReviewerConfig;
|
|
13
|
+
/**
|
|
14
|
+
* Load configuration from YAML file (simplified YAML parsing)
|
|
15
|
+
*/
|
|
16
|
+
export declare function loadConfigFile(root: string, fileName?: string): Partial<ReviewerConfig>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting utility functions for AI Code Reviewer
|
|
3
|
+
*/
|
|
4
|
+
import type { ParsedDiff, ReviewFinding, ReviewResult } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Format a single finding as Markdown
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatFinding(finding: ReviewFinding): string;
|
|
9
|
+
/**
|
|
10
|
+
* Format review summary as Markdown
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatSummary(result: ReviewResult): string;
|
|
13
|
+
/**
|
|
14
|
+
* Format full review result as Markdown report
|
|
15
|
+
*/
|
|
16
|
+
export declare function formatReviewReport(result: ReviewResult): string;
|
|
17
|
+
/**
|
|
18
|
+
* Format parsed diff as short summary
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatDiffSummary(diff: ParsedDiff): string;
|
|
21
|
+
/**
|
|
22
|
+
* Format duration in ms to human-readable
|
|
23
|
+
*/
|
|
24
|
+
export declare function formatDuration(ms: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ai-code-reviewer-plus",
|
|
3
|
+
"description": "AI-powered intelligent code reviewer — multi-dimensional semantic analysis, five-tier severity classification, actionable fix suggestions via Claude Code Skill",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"bin": {
|
|
6
|
+
"ai-code-reviewer-plus": "./dist/cli.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"require": "./dist/index.js",
|
|
14
|
+
"import": "./dist/index.mjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
".claude",
|
|
20
|
+
".claude-plugin"
|
|
21
|
+
],
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@eslint-sets/eslint-config": "^6.3.1",
|
|
24
|
+
"@types/node": "^26.1.0",
|
|
25
|
+
"eslint": "^9.39.4",
|
|
26
|
+
"npm-run-all": "^4.1.5",
|
|
27
|
+
"prettier": "^3.9.4",
|
|
28
|
+
"prettier-config-common": "^1.5.0",
|
|
29
|
+
"rm-all": "^1.1.1",
|
|
30
|
+
"tsup": "^8.5.1",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
|
+
"vitepress": "^1.6.4",
|
|
33
|
+
"vitest": "^3.2.6"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18.20"
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": false,
|
|
39
|
+
"keywords": [
|
|
40
|
+
"ai-code-reviewer-plus",
|
|
41
|
+
"code-review",
|
|
42
|
+
"intelligent-review",
|
|
43
|
+
"semantic-analysis",
|
|
44
|
+
"pr-review",
|
|
45
|
+
"claude-code",
|
|
46
|
+
"claude-code-skill"
|
|
47
|
+
],
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"author": "saqqdy<https://github.com/saqqdy>",
|
|
50
|
+
"homepage": "https://github.com/saqqdy/ai-code-reviewer-plus#readme",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/saqqdy/ai-code-reviewer-plus/issues"
|
|
53
|
+
},
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://github.com/saqqdy/ai-code-reviewer-plus.git"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "run-s clean build:bundle build:types",
|
|
60
|
+
"build:bundle": "tsup",
|
|
61
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
62
|
+
"clean": "rm-all dist",
|
|
63
|
+
"dev": "tsup --watch",
|
|
64
|
+
"lint": "eslint --fix .",
|
|
65
|
+
"prettier": "prettier --write \"**/*.{js,ts,mjs,yml,json,md}\"",
|
|
66
|
+
"test": "vitest run",
|
|
67
|
+
"test:watch": "vitest",
|
|
68
|
+
"test:coverage": "vitest run --coverage",
|
|
69
|
+
"dist": "run-s lint build",
|
|
70
|
+
"typecheck": "tsc --noEmit",
|
|
71
|
+
"docs:dev": "vitepress dev docs",
|
|
72
|
+
"docs:build": "vitepress build docs",
|
|
73
|
+
"docs:preview": "vitepress preview docs"
|
|
74
|
+
}
|
|
75
|
+
}
|