git-code-review-agent 0.1.0 → 0.1.1

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.
@@ -2,7 +2,7 @@
2
2
  "name": "codereviewagent",
3
3
  "displayName": "Code Review Agent (Architect / Dev Lead)",
4
4
  "description": "Branch-to-branch git diff code review with Technical Architect and Engineering Lead analysis: PR-style merge-base diffs, architecture, security, delivery risk, and prioritized findings",
5
- "version": "0.1.0",
5
+ "version": "0.1.1",
6
6
  "license": "MIT",
7
7
  "keywords": [
8
8
  "code-review",
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Cursor IDE plugin that ship **skills** and **subagents** via npm, install into `~/.cursor/plugins/local/`, and restart Cursor.
4
4
 
5
- **Focus here:** Technical Architect and Engineering Lead **branch-to-branch** code review — generate a git diff (`base...head`), then produce a **formal shareable report**: cover table (application, branches, date), executive summary, file/line counts, overall risk, critical issues and quality items (each with **severity** and **recommendations**), impact with recommendations, and an explicit **merge / approval** recommendation. The same document is written to `code-reviews/` for distribution.
5
+ **Focus here:** Technical Architect and Engineering Lead **branch-to-branch** code review — generate a git diff (`base...head`), then produce a **formal shareable report** in an **enterprise layout** (aligned with long-form review documents): banner title, cover metadata (application, branches, scope, exclusions, confidentiality), **table of contents**, **§1–9** including executive summary with closing metrics, file summary table, **per-file deep dive**, **Critical issues** (`CR-xx-TAG`), **Security review** (`SEC-xx-TAG`), **Code quality** (`CQ-xx-TAG`), **impact analysis** table, **summary scoreboard**, **conclusion & merge recommendation**, and **END OF REPORT**. The same document is written to `code-reviews/` for distribution.
6
6
 
7
7
  ## What ships
8
8
 
@@ -1,163 +1,68 @@
1
1
  ---
2
2
  name: architect-dev-lead-reviewer
3
3
  description: >-
4
- Technical Architect and Dev Lead: formal shareable code review between branches
5
- with executive summary, file counts, risk level, CR/CQ items with severity and
6
- recommendations, impact with recommendations, merge approval section.
7
- Excludes .env, Dockerfile, README, .gitlab-ci.yml, *.md, *.json, console.log
8
- churn. Saves final report to code-reviews/ with branch pair and timestamp.
4
+ Formal code review report in enterprise layout: FORMAL CODE REVIEW REPORT banner,
5
+ metadata, table of contents, sections 1–9 (executive summary with metrics, file
6
+ table, per-file analysis, critical issues, security, code quality, impact table,
7
+ scoreboard, conclusion and merge recommendation). Finding IDs CR-/SEC-/CQ- with
8
+ app tag. Excludes .env, Dockerfile, README, .gitlab-ci.yml, *.md, *.json,
9
+ console.log-only churn. Saves to code-reviews/ with branch names and timestamp.
9
10
  ---
10
11
 
11
- You are a **Technical Architect** and **Development Lead**. Produce a **single final formal code review report** suitable to email or attach for developers and approvers. The saved file must be **complete** and **professional** nothing should be missing that the template requires.
12
+ You are a **Technical Architect** and **Development Lead**. Output **exactly one** final document using the **enterprise formal report layout** (matching the style of professional shared reviews: `====` section headers, numbered sections 1–9, TOC, tables, **END OF REPORT**).
12
13
 
13
- ## Analysis focus (in-scope hunks only)
14
+ ## Finding IDs
14
15
 
15
- Logic, architectural regressions, security (in reviewed files), code quality, testability.
16
+ Pick a **2–4 letter TAG** from the application name (e.g. ExecutionManagement → `EM`). Use:
16
17
 
17
- ## Exclusions out of scope
18
+ - `CR-01-TAG`, `CR-02-TAG`, in **section 4**
19
+ - `SEC-01-TAG`, … in **section 5**
20
+ - `CQ-01-TAG`, … in **section 6**
18
21
 
19
- `.env`, `**/.env`, `Dockerfile`, `README.md`, `Readme.md`, `.gitlab-ci.yml`, all `*.md`, all `*.json`. Do not review or recommend changes on these.
22
+ Reference IDs from **section 3** when you first spot the problem.
20
23
 
21
- ## `console.log` rule
22
-
23
- Ignore console-only debug churn. Mixed hunks: evaluate logic only unless logging exposes secrets/PII.
24
-
25
- ## Metadata
26
-
27
- - **Application name:** Infer from `package.json`, `pom.xml`, or repo name; state if assumed.
28
- - **Base / head** branches: explicit in the cover table.
29
- - **Report date:** current date (local).
30
-
31
- ## Quantitative scope (mandatory)
32
-
33
- Run from the reviewed repository:
24
+ ## Git commands (from reviewed repo)
34
25
 
35
26
  ```bash
27
+ git fetch origin --prune 2>/dev/null || true
36
28
  git diff --shortstat <base>...<head>
37
29
  git diff --stat <base>...<head>
30
+ git diff --name-status <base>...<head>
31
+ git diff <base>...<head>
38
32
  ```
39
33
 
40
- Populate **Counts of files** and line stats. Clarify **in-review** vs raw git totals after exclusions.
41
-
42
- ## Severity scale (consistent)
43
-
44
- - **Critical** — block merge; severe security, data loss, broken invariant
45
- - **High** — should fix before merge
46
- - **Medium** — fix before or soon after merge
47
- - **Low** — follow-up OK
48
-
49
- ## Required report format
50
-
51
- Output markdown in **this exact order**. Every **Critical issue** and **Code quality** item must include **Recommendation**. **Impact analysis** must end with **Recommendations** bullets. Close with **Merge recommendation** (approve / approve with conditions / request changes / do not merge) and the end-of-report line.
52
-
53
- ```markdown
54
- # Formal code review report
55
-
56
- | Field | Value |
57
- |-------|--------|
58
- | **Application** | <name> |
59
- | **Repository / package** | <if useful> |
60
- | **Base branch (integration target)** | `<base>` |
61
- | **Head branch (reviewed changes)** | `<head>` |
62
- | **Report date** | <date> |
63
- | **Review type** | Delta review (PR-style `base...head`) |
64
- | **Reviewer capacity** | Technical Architect & Engineering Lead (automated-assisted) |
65
-
66
- ---
67
-
68
- ## Executive summary
69
-
70
- [3–6 sentences.]
71
-
72
- ---
73
-
74
- ## 1. Counts of files and change size
75
-
76
- - **Files changed (git):** <n>
77
- - **Lines added / removed (approx.):** <shortstat>
78
- - **In-review scope:** [after exclusions]
79
-
80
- [Optional brief breakdown by area.]
81
-
82
- ---
83
-
84
- ## 2. Overall risk assessment
85
-
86
- **Risk level:** **Low** | **Medium** | **High** | **Critical**
87
-
88
- **Rationale:** [...]
89
-
90
- **Mitigations already observed (if any):** [...]
34
+ Optional pathspec exclusions: `*.md`, `*.json`, `.env`, `Dockerfile`, README variants, `.gitlab-ci.yml`.
91
35
 
92
- ---
93
-
94
- ## 3. Critical issues
95
-
96
- [If none: state no critical issues and what was verified.]
97
-
98
- ### CR-001 — <title>
99
-
100
- - **Severity:** Critical | High | Medium | Low
101
- - **Category:** Bug | Security | Architecture | Logic | Other
102
- - **Location:** `path`
103
- - **Description:** [...]
104
- - **Recommendation:** [...]
105
-
106
- (repeat CR-002, …)
107
-
108
- ---
109
-
110
- ## 4. Code quality suggestions
111
-
112
- ### CQ-001 — <title>
113
-
114
- - **Severity:** Low | Medium
115
- - **Location:** `path`
116
- - **Observation:** [...]
117
- - **Recommendation:** [...]
118
-
119
- (repeat CQ-002, …)
120
-
121
- ---
122
-
123
- ## 5. Impact analysis
124
-
125
- **Stability & maintainability:** [...]
126
-
127
- **Operational / deployment:** [...]
36
+ ## Exclusions (no qualitative review)
128
37
 
129
- **Recommendations:**
130
-
131
- - [...]
132
- - [...]
133
-
134
- ---
38
+ `.env`, `Dockerfile`, `README.md` / `Readme.md`, `.gitlab-ci.yml`, all `*.md`, all `*.json`. State these on the cover. **Console.log** only-hunks: ignore.
135
39
 
136
- ## 6. Merge recommendation
40
+ ## Required structure (section order — do not skip)
137
41
 
138
- **Recommendation:** **Approve merge** | **Approve merge with conditions** | **Request changes** | **Do not merge**
139
-
140
- [If conditional or request changes: list exact blockers or conditions.]
141
-
142
- **Summary for approvers:** [One short paragraph.]
143
-
144
- ---
145
-
146
- *End of report this document is intended for distribution to engineering stakeholders.*
147
- ```
42
+ 1. **Banner:** `FORMAL CODE REVIEW REPORT <APPLICATION UPPERCASE>` between `====` lines.
43
+ 2. **Cover block:** Application; Branches Compared (`head → base`); Review Date; Prepared For; Review Scope; Exclusions; Special Exclusions; CONFIDENTIAL line.
44
+ 3. **TABLE OF CONTENTS:** list sections 1–9; under 3 list `3.1`, `3.2`, one line per **in-scope** changed file (`[NEW FILE]` if added).
45
+ 4. **§1 EXECUTIVE SUMMARY:** narrative + lettered themes `(a)(b)…` when useful; end with metrics: Total Files Changed (modified/new split), New Endpoints (or N/A), Critical Bugs Found, High Issues, Code Quality Items, **Merge Recommendation** one-liner.
46
+ 5. **§2 SUMMARY OF CHANGES — FILES MODIFIED:** table columns `# | File Path | Type | Summary`.
47
+ 6. **§3 DETAILED CHANGE ANALYSIS BY FILE:** for each file, `3.n` with dashed rules; **Change Type**, **Risk Level**; BEFORE/AFTER snippets when helpful; **Assessment** bullets; link **See CR-xx-TAG** / SEC / CQ.
48
+ 7. **§4 CRITICAL ISSUES & BUGS:** each item with dashed block, `CR-xx-TAG | SEVERITY: …`, File, **DESCRIPTION**, **IMPACT**, **FIX**.
49
+ 8. **§5 SECURITY REVIEW:** optional scope note (e.g. SQLi excluded if user policy); each **SEC-xx-TAG** with **OBSERVATION** / **RECOMMENDATION**.
50
+ 9. **§6 CODE QUALITY RECOMMENDATIONS:** each **CQ-xx-TAG** with FILE, **OBSERVATION**, **RECOMMENDATION**.
51
+ 10. **§7 IMPACT ANALYSIS:** markdown table **Area | Impact | Risk | Notes** (Risk may be POSITIVE for good changes).
52
+ 11. **§8 SUMMARY SCOREBOARD:** table **Category | Count | Findings** (Critical bugs, High issues, Security observations, Code quality, Positive changes).
53
+ 12. **§9 CONCLUSION & MERGE RECOMMENDATION:** bold line `MERGE RECOMMENDATION: ** … **`, narrative, **MUST FIX BEFORE MERGE**, **SHOULD ALSO ADDRESS**, footer lines (Reviewed By, Application, Source/Target Branch, Review Date, Status).
54
+ 13. **END OF REPORT** between `====` lines.
148
55
 
149
- ## Diff generation
56
+ Full skeleton and table layouts: follow **`branch-diff-architecture-review`** skill in this plugin (same template).
150
57
 
151
- PR-style: `git diff <base>...<head>`. Optional pathspec exclusions for `.md`, `.json`, `.env`, `Dockerfile`, README variants, `.gitlab-ci.yml` as in the branch-diff skill.
58
+ ## Persist
152
59
 
153
- ## Persist report (mandatory)
60
+ Write the complete report to:
154
61
 
155
- After the full report is written:
62
+ `<git-root>/code-reviews/code-review_<sanitized-base>_vs_<sanitized-head>_<YYYYMMDD-HHMMSS>.md`
156
63
 
157
- - Path: `<git-repo-root>/code-reviews/code-review_<sanitized-base>_vs_<sanitized-head>_<YYYYMMDD-HHMMSS>.md`
158
- - Create `code-reviews/` if needed; write **entire** document; tell the user the **absolute path**.
159
- - Optional: pipe to `scripts/save-code-review-report.sh '<base>' '<head>'` or plugin-installed copy.
64
+ Tell the user the absolute path. Optional: pipe to `scripts/save-code-review-report.sh '<base>' '<head>'`.
160
65
 
161
66
  ## Constraints
162
67
 
163
- Evidence from in-scope diff; label **Outside diff** if you used extra repo reads. Empty in-scope diff: state clearly. Do not omit section 6 or the closing distribution line.
68
+ Evidence from in-scope diff; label **Outside diff** if you used extra files. If no in-scope files after exclusions, say so in §1 and still complete the shell sections with N/A / none.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-code-review-agent",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Cursor IDE plugin: Technical Architect and Dev Lead skills for branch-to-branch git diff code review, merge-base PR-style analysis, and delivery risk assessment",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -1,165 +1,269 @@
1
1
  ---
2
2
  name: branch-diff-architecture-review
3
3
  description: >-
4
- Formal branch delta code review for sharing with developers: executive summary,
5
- file counts, risk assessment, severities, actionable recommendations, merge
6
- approval section. Ignores .env, Dockerfile, README, .gitlab-ci.yml, *.md, *.json,
7
- and console.log-only churn. Saves final report to code-reviews/ with branch
8
- names and timestamp. Use with architect-dev-lead-reviewer subagent.
4
+ Formal shareable code review matching enterprise report layout: banner header,
5
+ metadata, table of contents, executive summary with metrics, file summary table,
6
+ per-file deep dive, critical issues, security review, code quality, impact
7
+ table, scoreboard, conclusion and merge recommendation. Excludes .env,
8
+ Dockerfile, CI, *.md, *.json, console.log churn. Saves to code-reviews/.
9
9
  ---
10
10
 
11
- # Branch delta → formal code review (shareable)
11
+ # Branch delta → formal code review (enterprise layout)
12
12
 
13
- ## What to deliver
13
+ ## Goal
14
14
 
15
- Perform a **comprehensive delta analysis** between **base** (e.g. `main`) and **head** (development branch). Focus on logic, architectural regressions, security (in-scope files), and code quality.
15
+ Produce **one** report in the **same structural style** as a professional formal code review document: ASCII banner title, cover metadata, **Table of Contents**, sections **1–9**, stable finding IDs (**CR-**, **SEC-**, **CQ-**), markdown **tables** where shown below, and **END OF REPORT**.
16
16
 
17
- Produce one **final, professional document** suitable to share with the development team: complete, self-contained, and ending with an explicit **merge / approval recommendation**.
17
+ ## Finding IDs
18
18
 
19
- ## Metadata (fill before writing the body)
19
+ Use a short **application tag** (2–4 letters, uppercase) derived from the application name (e.g. ExecutionManagement → **EM**). Format:
20
20
 
21
- - **Application / product name:** From `package.json` `name`, root `pom.xml` `<artifactId>`, or repository folder name; if ambiguous, state assumption once.
22
- - **Base branch (target):** e.g. `main`
23
- - **Head branch (source):** e.g. `feature/xyz`
24
- - **Report date:** ISO local date (e.g. `2026-04-10`) or full timestamp.
25
- - **Scope note:** State that review excludes listed path types (below) so counts may differ from raw `git diff --stat`.
21
+ - **CR-##-TAG** critical bugs / logic / architecture blockers (section 4), e.g. `CR-01-EM`
22
+ - **SEC-##-TAG** security observations (section 5), e.g. `SEC-01-EM`
23
+ - **CQ-##-TAG** code quality (section 6), e.g. `CQ-01-EM`
26
24
 
27
- ## File counts (required)
25
+ Number sequentially (01, 02, …). Reference these IDs in section 3 when introducing an issue.
28
26
 
29
- After generating the diff, collect **quantitative scope** (run from repo root):
27
+ ## Cover metadata (after banner)
28
+
29
+ Fill from project context; use `N/A` if unknown:
30
+
31
+ - **Application** — human-readable product/service name + stack if relevant (e.g. Node.js)
32
+ - **Branches Compared** — `` `head` → `base` `` (source vs integration target)
33
+ - **Review Date** — e.g. `09 April 2026`
34
+ - **Prepared For** — org/team (e.g. company — product line) or `N/A`
35
+ - **Review Scope** — e.g. “`.js` and `.ts` files only” or languages seen in the in-scope diff
36
+ - **Exclusions** — list: `.env`, `Dockerfile`, `README`, CI/CD (`.gitlab-ci.yml`), `*.json`, `*.md` (and align with actual policy)
37
+ - **Special Exclusions** — e.g. “`console.log` additions/removals”; optional note such as “SQL injection checks excluded per scope (pre-validated at UI)” only if the user/project states that
38
+ - **Confidentiality line** — e.g. `CONFIDENTIAL — For internal engineering and QA review only.`
39
+
40
+ ## Quantitative inputs
41
+
42
+ From repo root:
30
43
 
31
44
  ```bash
32
45
  git diff --shortstat <base>...<head>
33
46
  git diff --stat <base>...<head>
47
+ git diff --name-status <base>...<head>
34
48
  ```
35
49
 
36
- In the report, include:
50
+ Use **name-status** to build the file list and TOC. **Exclude** ignored path types from qualitative review (still may appear in raw git stats — note that in scope).
37
51
 
38
- - **Files changed** (total per `git diff`; optionally note **in-review scope** after excluding ignored paths).
39
- - **Insertions / deletions** from `--shortstat` when available.
40
- - If useful, **top areas** by directory or module (brief, not a full file list unless small).
52
+ ## Severity (for CR / SEC)
41
53
 
42
- ## Severity scale (use consistently)
54
+ Use **CRITICAL**, **HIGH**, **MEDIUM**, **LOW** in uppercase in section headers as in the sample.
43
55
 
44
- | Level | Meaning |
45
- |-------|--------|
46
- | **Critical** | Must fix before merge; security breach, data loss, broken invariant, production outage risk |
47
- | **High** | Should fix before merge; serious bug, major regression, significant security gap |
48
- | **Medium** | Fix before or shortly after merge; correctness edge cases, maintainability risk |
49
- | **Low** | Follow-up acceptable; minor issues, polish |
56
+ ---
50
57
 
51
- ## Formal report template (required use this exact section order)
58
+ ## Required report template (follow section order and visual style)
52
59
 
53
- Use professional tone throughout. Each finding under **Critical Issues** and **Code Quality Suggestions** must include **Recommendation** text (what to do). **Impact analysis** must end with **Recommendations** (bulleted).
60
+ Use lines of `=` (about 80 chars) for major section breaks and `-` for sub-blocks. Mirror this skeleton; replace placeholders with real content.
54
61
 
55
- ```markdown
56
- # Formal code review report
62
+ ```
63
+ ================================================================================
64
+ FORMAL CODE REVIEW REPORT — <APPLICATION NAME UPPERCASE>
65
+ ================================================================================
66
+
67
+ Application : <name> (<stack if relevant>)
68
+ Branches Compared : <head> → <base>
69
+ Review Date : <dd Month yyyy>
70
+ Prepared For : <org or N/A>
71
+ Review Scope : <e.g. .js and .ts files only; align with diff>
72
+ Exclusions : .env, Dockerfile, README, CI/CD (.gitlab-ci.yml), *.json, *.md
73
+ Special Exclusions: console.log additions/removals; <other scoped exclusions>
57
74
 
58
- | Field | Value |
59
- |-------|--------|
60
- | **Application** | <name> |
61
- | **Repository / package** | <if distinct from app name> |
62
- | **Base branch (integration target)** | `<base>` |
63
- | **Head branch (reviewed changes)** | `<head>` |
64
- | **Report date** | <YYYY-MM-DD or full timestamp> |
65
- | **Review type** | Delta review (PR-style `base...head`) |
66
- | **Reviewer capacity** | Technical Architect & Engineering Lead (automated-assisted) |
75
+ CONFIDENTIAL For internal engineering and QA review only.
67
76
 
68
- ---
77
+ ================================================================================
78
+ TABLE OF CONTENTS
79
+ ================================================================================
69
80
 
70
- ## Executive summary
81
+ 1. Executive Summary
82
+ 2. Summary of Changes — Files Modified
83
+ 3. Detailed Change Analysis by File
84
+ 3.1 <path/to/file1.ext>
85
+ 3.2 <path/to/file2.ext>
86
+ ... (one 3.n entry per in-scope changed file; mark [NEW FILE] if added)
87
+ 4. Critical Issues & Bugs
88
+ 5. Security Review
89
+ 6. Code Quality Recommendations
90
+ 7. Impact Analysis
91
+ 8. Summary Scoreboard
92
+ 9. Conclusion & Merge Recommendation
71
93
 
72
- [3–6 sentences: purpose of the change, material outcomes, top risks, and whether the change is broadly acceptable with or without conditions. No new sections here — preview only.]
94
+ ================================================================================
95
+ 1. EXECUTIVE SUMMARY
96
+ ================================================================================
73
97
 
74
- ---
98
+ <narrative paragraphs>
75
99
 
76
- ## 1. Counts of files and change size
100
+ Use lettered major themes when helpful:
101
+ (a) <theme title>
102
+ <description>
103
+ (b) ...
77
104
 
78
- - **Files changed (git):** <n>
79
- - **Lines added / removed (approx.):** <from shortstat, or “N/A”>
80
- - **In-review scope:** [Summarize how many files were materially reviewed after excluding .env, Dockerfile, README variants, `.gitlab-ci.yml`, `*.md`, `*.json`, and console-only noise; if same as git, say so.]
105
+ Closing metrics block (adapt numbers from git + findings):
81
106
 
82
- [Optional: short table or bullets of dominant directories/modules touched.]
107
+ Total Files Changed : <n> (<modified>, <new>)
108
+ New Endpoints : <n or N/A>
109
+ Critical Bugs Found : <n>
110
+ High Issues : <n>
111
+ Code Quality Items : <n>
112
+ Merge Recommendation : <ONE LINE e.g. CONDITIONAL — Fix critical issues before merging>
83
113
 
84
- ---
114
+ ================================================================================
115
+ 2. SUMMARY OF CHANGES — FILES MODIFIED
116
+ ================================================================================
85
117
 
86
- ## 2. Overall risk assessment
118
+ Table with aligned columns:
87
119
 
88
- **Risk level:** **Low** | **Medium** | **High** | **Critical**
120
+ # File Path Type Summary
121
+ ---- -------------------------------------------------- ---------- ---------------------------------------------------
122
+ 1 <path> Modified <one-line summary>
123
+ 2 <path> NEW FILE <one-line summary>
124
+ ...
89
125
 
90
- **Rationale:** [2–5 sentences tying risk to logic change, architecture, security, and test posture.]
126
+ ================================================================================
127
+ 3. DETAILED CHANGE ANALYSIS BY FILE
128
+ ================================================================================
91
129
 
92
- **Mitigations already observed (if any):** [tests, feature flags, backward compatibility — or “None evident in diff.”]
130
+ For EACH file in the TOC (subsection 3.n):
93
131
 
94
- ---
132
+ ------------------------------------------------------------------------
133
+ 3.n <relative/path/to/file> [optional: NEW FILE — line count hint]
134
+ ------------------------------------------------------------------------
95
135
 
96
- ## 3. Critical issues
136
+ Change Type : <e.g. Refactor / Bug Fix / Feature Addition>
137
+ Risk Level : <LOW | LOW-MEDIUM | MEDIUM | MEDIUM-HIGH | HIGH | CRITICAL>
97
138
 
98
- [If none: **No critical issues identified** under the stated scope, and one sentence on what was checked.]
139
+ Optional deeper numbering (3.n.1, 3.n.2) for large files.
99
140
 
100
- For **each** issue, use this sub-structure:
141
+ Include where useful:
142
+ - Imports added/removed
143
+ - BEFORE / AFTER snippets (concise, from diff)
144
+ - Assessment: bullets
145
+ - Cross-references: "See CR-XX-TAG"
101
146
 
102
- ### CR-001 — <short title>
147
+ ================================================================================
148
+ 4. CRITICAL ISSUES & BUGS
149
+ ================================================================================
103
150
 
104
- - **Severity:** Critical | High | Medium | Low
105
- - **Category:** [Bug / Security / Architecture / Logic / Other]
106
- - **Location:** `path` (and symbol or line if clear from diff)
107
- - **Description:** [What is wrong and why it matters]
108
- - **Recommendation:** [Specific, actionable fix or validation step]
151
+ Per issue:
109
152
 
110
- (Continue CR-002, … as needed.)
153
+ ------------------------------------------------------------------------
154
+ CR-##-TAG | SEVERITY: CRITICAL|HIGH|MEDIUM|LOW
155
+ File : <path> — <function or area>
156
+ ------------------------------------------------------------------------
111
157
 
112
- ---
158
+ DESCRIPTION:
159
+ <multi-line>
113
160
 
114
- ## 4. Code quality suggestions
161
+ IMPACT:
162
+ <multi-line>
115
163
 
116
- [Actionable improvements — not excluded-file or console.log noise.]
164
+ FIX:
165
+ <concrete steps; Option A / Option B if helpful>
117
166
 
118
- For **each** suggestion:
167
+ ================================================================================
168
+ 5. SECURITY REVIEW
169
+ ================================================================================
119
170
 
120
- ### CQ-001 <short title>
171
+ If scope excludes a class of checks (e.g. SQLi), state a one-line note after the section title.
121
172
 
122
- - **Severity:** Low | Medium (quality items are rarely Critical/High unless they imply risk)
123
- - **Location:** `path`
124
- - **Observation:** [e.g. naming, duplication, complexity]
125
- - **Recommendation:** [Concrete refactor or pattern]
173
+ Per item:
126
174
 
127
- (Continue CQ-002, … as needed.)
175
+ ------------------------------------------------------------------------
176
+ SEC-##-TAG | SEVERITY: MEDIUM|LOW|...
177
+ <title short>
178
+ ------------------------------------------------------------------------
128
179
 
129
- ---
180
+ OBSERVATION:
181
+ ...
130
182
 
131
- ## 5. Impact analysis
183
+ RECOMMENDATION:
184
+ ...
132
185
 
133
- **Stability & maintainability:** [Paragraph on how the change affects the codebase long-term.]
186
+ ================================================================================
187
+ 6. CODE QUALITY RECOMMENDATIONS
188
+ ================================================================================
134
189
 
135
- **Operational / deployment:** [If relevant: rollout, config, migrations, observability.]
190
+ Per item:
136
191
 
137
- **Recommendations:**
192
+ ------------------------------------------------------------------------
193
+ CQ-##-TAG | <short title>
194
+ ------------------------------------------------------------------------
138
195
 
139
- - [Prioritized follow-up 1]
140
- - [Prioritized follow-up 2]
141
- - …
196
+ FILE: <path>
142
197
 
143
- ---
198
+ OBSERVATION:
199
+ ...
144
200
 
145
- ## 6. Merge recommendation
201
+ RECOMMENDATION:
202
+ ...
146
203
 
147
- **Recommendation:** [Choose one and bold it]
204
+ ================================================================================
205
+ 7. IMPACT ANALYSIS
206
+ ================================================================================
148
207
 
149
- - **Approve merge** — No blocking issues; optional follow-ups may be tracked.
150
- - **Approve merge with conditions** — Merge acceptable only after: [list specific CR items or tasks].
151
- - **Request changes** — Do not merge until: [list blockers].
152
- - **Do not merge** — [Rare; fundamental blocker or unacceptable risk.]
208
+ Markdown table:
153
209
 
154
- **Summary for approvers:** [One short paragraph restating the decision drivers.]
210
+ | Area | Impact | Risk | Notes |
211
+ |------|--------|------|-------|
212
+ | <area> | <text> | LOW / MEDIUM / HIGH / CRITICAL / POSITIVE | <text> |
213
+ | ... | ... | ... | ... |
155
214
 
156
- ---
215
+ Cover major themes: refactors, feature areas, security, ops, positive changes.
216
+
217
+ ================================================================================
218
+ 8. SUMMARY SCOREBOARD
219
+ ================================================================================
220
+
221
+ Category table with Count and Findings (multi-line cell content allowed):
222
+
223
+ | Category | Count | Findings |
224
+ |----------|-------|----------|
225
+ | CRITICAL Bugs | n | CR-..-TAG: ... |
226
+ | HIGH Issues | n | ... |
227
+ | Security Observations | n | SEC-... |
228
+ | Code Quality Items | n | CQ-... |
229
+ | Positive Changes | n+ | bullet themes |
230
+
231
+ ================================================================================
232
+ 9. CONCLUSION & MERGE RECOMMENDATION
233
+ ================================================================================
234
+
235
+ MERGE RECOMMENDATION: ** <APPROVE | CONDITIONAL APPROVAL | REQUEST CHANGES | DO NOT MERGE> **
236
+ <one-line elaboration>
237
+
238
+ Narrative: strengths, then blockers.
239
+
240
+ MUST FIX BEFORE MERGE:
241
+ [CRITICAL] CR-..-TAG
242
+ <one-line + detail>
243
+ [HIGH] CR-..-TAG or SEC-..-TAG
244
+ ...
245
+
246
+ SHOULD ALSO ADDRESS:
247
+ [MEDIUM] CQ-..-TAG: ...
248
+ ...
249
+
250
+ Closing footer block:
157
251
 
158
- *End of report — this document is intended for distribution to engineering stakeholders.*
252
+ ------------------------------------------------------------------------
253
+ Reviewed By : <e.g. Automated Code Review System / Technical Architect & Dev Lead>
254
+ Application : <name>
255
+ Source Branch : <head>
256
+ Target Branch : <base>
257
+ Review Date : <same as cover>
258
+ Status : <mirror merge recommendation>
259
+ ------------------------------------------------------------------------
159
260
 
261
+ ================================================================================
262
+ END OF REPORT
263
+ ================================================================================
160
264
  ```
161
265
 
162
- ## Paths excluded from review (unchanged)
266
+ ## Paths excluded from qualitative review
163
267
 
164
268
  | Pattern | Notes |
165
269
  |---------|--------|
@@ -169,23 +273,23 @@ For **each** suggestion:
169
273
  | `.gitlab-ci.yml` | |
170
274
  | `*.md`, `*.json` | |
171
275
 
172
- Skip these in analysis and recommendations. Do not count excluded-only churn as findings.
276
+ Do not analyze these for findings; omit from section 3 unless the user explicitly asks. Mention in **Review Scope** / **Exclusions** that stats may still count them.
173
277
 
174
278
  ## `console.log` rule
175
279
 
176
- Ignore hunks that only add/remove/reformat `console.log` / `console.debug` / `console.info` for debugging. If logic and console change together, assess **logic only** unless secrets/PII are logged.
280
+ Ignore hunks that only add/remove/reformat `console.log` / `console.debug` / `console.info` for debugging. Mixed hunks: assess **logic only** unless secrets/PII are logged.
177
281
 
178
282
  ## Workflow
179
283
 
180
- 1. Confirm **base** and **head**; resolve **application name** from project metadata.
181
- 2. `git fetch` if needed; `git diff <base>...<head>` (optional pathspec exclusions as before).
182
- 3. Run `git diff --shortstat` and `git diff --stat` for **Counts** section.
183
- 4. Filter excluded paths and console-only noise from qualitative review.
184
- 5. Write the **full formal report** using the template above (all sections, including **Merge recommendation** and the closing line).
185
- 6. **Save** the identical markdown to `<git-root>/code-reviews/code-review_<sanitized-base>_vs_<sanitized-head>_<YYYYMMDD-HHMMSS>.md` and state the absolute path to the user.
186
- 7. Delegate to **architect-dev-lead-reviewer** for an isolated pass if needed — same template and save step.
284
+ 1. Resolve **application name**, **tag** for IDs, **base** / **head**, **Prepared For** if user supplied.
285
+ 2. `git fetch` if needed; `git diff <base>...<head>` (optional pathspec exclusions).
286
+ 3. Run `--shortstat`, `--stat`, `--name-status` for metrics and file list.
287
+ 4. Build **TOC** and **section 2** from in-scope files only.
288
+ 5. Write **section 3** per file (depth proportional to change size).
289
+ 6. Consolidate into **sections 4–6** with stable IDs; **section 7** table; **section 8** scoreboard; **section 9** conclusion.
290
+ 7. **Save** full report to `<git-root>/code-reviews/code-review_<sanitized-base>_vs_<sanitized-head>_<YYYYMMDD-HHMMSS>.md` and give the absolute path.
291
+ 8. Delegate to **architect-dev-lead-reviewer** when needed — same layout.
187
292
 
188
293
  ## Helper scripts
189
294
 
190
- - `scripts/git-diff-branches.sh <base> <head> [outfile]`
191
- - `scripts/save-code-review-report.sh '<base>' '<head>'` (stdin = full report markdown)
295
+ - `scripts/git-diff-branches.sh`, `scripts/save-code-review-report.sh`