Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
364 changes: 364 additions & 0 deletions .copilot-cli/1-overdue-orders.coder.cli.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .github/agents/architect.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
description: 'Architecture design agent for plugin-based modular systems following Clean Architecture principles with strict boundary enforcement'
tools: ['execute/getTerminalOutput', 'execute/runTask', 'execute/getTaskOutput', 'execute/createAndRunTask', 'execute/runInTerminal', 'read/getNotebookSummary', 'read/readFile', 'edit/createDirectory', 'edit/createFile', 'edit/editFiles', 'edit/editNotebook', 'github/issue_read']
model: Claude Sonnet 4.5 (copilot)
handoffs:
- label: Review Architecture Design
agent: architect
Expand Down
13 changes: 10 additions & 3 deletions .github/agents/code-reviewer.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
description: 'Code review agent that verifies implementations match design documents, enforce architectural constraints, and meet quality standards'
tools: ['execute/getTerminalOutput', 'execute/runTask', 'execute/getTaskOutput', 'execute/createAndRunTask', 'execute/runInTerminal', 'read/getNotebookSummary', 'read/readFile', 'edit/createDirectory', 'edit/createFile', 'edit/editFiles', 'edit/editNotebook', 'github/issue_read']
model: Claude Sonnet 4.6 (copilot)
required_skills:
- path: '.github/skills/code-review-report/SKILL.md'
when: 'always'
Expand Down Expand Up @@ -127,6 +126,7 @@ Enforce rules from `.github/copilot-instructions.md`:

### 2. Read Implementation
- Read every file in the provided file list
- Map each file to the commit_id from the provided commits list for context
- For each file, understand its role (contract, service, entity, interceptor, test, etc.)
- If build/test status failed, note failures upfront

Expand Down Expand Up @@ -173,9 +173,16 @@ Output a summary as following:

### Review Report

Output a structured review report in markdown format, and save it at `docs/code-reviews/{issueId}-code-reviewer_{timestamp}.md`.
Output a structured review report in the requested format. Save it at `docs/code-reviews/{issueId}-code-review_{timestamp}.{extension}`.

Use below table to determine the skill you will use to generate the report:

| Format | Skill | Extension |
|--------|-------|-----------|
| markdown | `code-review-md-report` | md |
| json | `code-review-json-report` | json |
| yaml | `code-review-yaml-report` | yaml |

Use the `code-review-report` skill to generate the report.
In case of not being able to use the skill, report a error and produce a simple markdown report.

## Error Recovery
Expand Down
1 change: 0 additions & 1 deletion .github/agents/coder.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
description: 'Implementation agent that converts detailed design specifications into working C# code following Clean Architecture principles and strict dependency rules'
tools: ['execute/getTerminalOutput', 'execute/runTask', 'execute/getTaskOutput', 'execute/createAndRunTask', 'execute/runInTerminal', 'read/getNotebookSummary', 'read/readFile', 'edit/createDirectory', 'edit/createFile', 'edit/editFiles', 'edit/editNotebook', 'github/issue_read']
model: Claude Sonnet 4.5 (copilot)
required_skills:
- path: '.github/skills/unit-testing/SKILL.md'
when: 'mode == "unit-tests"'
Expand Down
1 change: 0 additions & 1 deletion .github/agents/detailed-designer.agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
description: 'Detailed design agent that converts approved high-level architecture into implementable specifications with explicit contracts, error handling, and test strategies'
tools: ['execute/getTerminalOutput', 'execute/runTask', 'execute/getTaskOutput', 'execute/createAndRunTask', 'execute/runInTerminal', 'read/getNotebookSummary', 'read/readFile', 'edit/createDirectory', 'edit/createFile', 'edit/editFiles', 'edit/editNotebook', 'github/issue_read']
model: Claude Sonnet 4.5 (copilot)
handoffs:
- label: Review Detailed Design
agent: detailed-designer
Expand Down
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Domain-specific guidance documents located in `.github/skills/`. When a task mat
|-------|---------|
| **add-module-plugin** | Step-by-step guide for adding new modules: folder structure, plugin registration, `IModule` initialization, build-order dependencies in `.sln` |
| **unit-testing** | Test patterns using xUnit, NSubstitute, FluentAssertions: AAA structure, fake naming (`Stub`/`Mock`), collection assertions, `GetTarget` helpers |
| **code-review-report** | Structured code review report template for PR-importable Markdown output (GitHub / Azure DevOps compatible) |
| **code-review-md-report** | Structured code review report template for PR-importable Markdown output (GitHub / Azure DevOps compatible) |

Usage pattern in this file: `> For [topic], use the **skill-name** skill.`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,47 +1,40 @@
---
name: code-review-report
description: "Generate structured code review reports in Markdown format suitable for import into GitHub PRs or Azure DevOps pull requests. Produces per-file inline remarks and a summary that renders natively in PR comment threads."
version: 2.0.0
output_format: Markdown + JSON
platforms: GitHub, Azure DevOps
name: code-review-md-report
description: "Generate structured code review reports in Markdown format. Produces per-file inline remarks and a summary"
version: 1.0.0
output_format: Markdown
---

# Code Review Report Skill
# Code Review Markdown Report Skill

## Purpose

Generates a structured, portable code review report consisting of **two artifacts**:
Generates a structured, portable code review report consisting of **one artifact**:

1. **Markdown report** — human-readable, renders correctly as a GitHub or Azure DevOps PR comment; can be pasted directly or posted via `gh pr comment`
2. **JSON payload** — machine-ready structured data for programmatic import via `gh api` (GitHub) or `curl` (Azure DevOps REST API)

Both artifacts are saved to `docs/code-reviews/` and referenced in the chat summary.
The artifact is saved to `docs/code-reviews/` and referenced in the chat summary.

## When to Use

- After completing a code review with the `code-reviewer` agent
- When the review output must be shared in a pull request on GitHub or Azure DevOps
- When the review output is requested as a markdown report (e.g., "Generate a markdown code review report ...")
- When a persistent review artifact is needed for traceability

## Output Files
## Output File

| File | Path | Purpose |
|------|------|---------|
| Markdown report | `docs/code-reviews/{issueId}-review_{timestamp}.md` | Human-readable, paste into PR comment |
| JSON payload | `docs/code-reviews/{issueId}-review_{timestamp}.json` | Programmatic PR import (GitHub + Azure DevOps) |
Markdown report: `docs/code-reviews/{issueId}-code-review_{timestamp}.md` - Human-readable, paste into PR comment

**Timestamp format:** `yyyyMMdd-HHmm` (e.g., `20260225-1430`)

> Generate the JSON payload **only** when at least one remark has a resolvable file path. If all remarks are general (no file/line), produce only the Markdown report.

## Artifact 1 — Markdown Report Template
## Markdown Report Template

Use the following template **exactly** as the structure for the report file. Replace all `{placeholders}` with actual values. Omit sections that have no content (e.g., if no blockers, omit the blockers subsection) but always keep the top-level sections.

---

```markdown
# Code Review Report
# Code Review Markdown Report

| Field | Value |
|-------|-------|
Expand Down Expand Up @@ -87,6 +80,7 @@ Use the following template **exactly** as the structure for the report file. Rep
#### R{number}: {short title}

- **File:** `{relative/path/to/File.cs}`
- **Commit:** `{commit-id}`
- **Line(s):** {line or range}
- **Dimension:** {Design Conformance | Architecture Compliance | Code Quality | Test Quality | Scope & Hygiene}
- **Description:** {What is wrong and why it matters}
Expand All @@ -101,6 +95,7 @@ Use the following template **exactly** as the structure for the report file. Rep
#### R{number}: {short title}

- **File:** `{relative/path/to/File.cs}`
- **Commit:** `{commit-id}`
- **Line(s):** {line or range}
- **Dimension:** {dimension}
- **Description:** {description}
Expand All @@ -115,6 +110,7 @@ Use the following template **exactly** as the structure for the report file. Rep
#### R{number}: {short title}

- **File:** `{relative/path/to/File.cs}`
- **Commit:** `{commit-id}`
- **Line(s):** {line or range}
- **Dimension:** {dimension}
- **Description:** {description}
Expand Down Expand Up @@ -162,115 +158,6 @@ Use the following template **exactly** as the structure for the report file. Rep

---

## Artifact 2 — JSON Payload Template

The JSON payload serves a dual purpose: it is the body for the **GitHub PR Review API** and contains all data needed to reconstruct **Azure DevOps PR threads**. The agent fills this structure from the collected remarks.

```json
{
"_meta": {
"issueId": "{issueId}",
"issueTitle": "{issueTitle}",
"date": "{date}",
"timestamp": "{timestamp}",
"markdownReport": "docs/code-reviews/{issueId}-review_{timestamp}.md"
},
"verdict": "{APPROVE|REQUEST_CHANGES|COMMENT}",
"summary": "{2-4 sentence overview}",
"body": "{full markdown summary block — same as the Markdown report's Summary + Metrics + Verdict sections}",
"event": "{APPROVE|REQUEST_CHANGES|COMMENT}",
"metrics": {
"blockers": 0,
"warnings": 0,
"suggestions": 0,
"notes": 0
},
"remarks": [
{
"id": "R1",
"severity": "blocker",
"dimension": "Architecture Compliance",
"file": "Modules/Sales/Sales.Services/OrderingService.cs",
"line": 42,
"lineEnd": 42,
"title": "{short title}",
"description": "{full description}",
"suggestedFix": "{direction — no full code}"
}
]
}
```

### JSON Field Rules

| Field | Values | Notes |
|-------|--------|-------|
| `verdict` / `event` | `APPROVE`, `REQUEST_CHANGES`, `COMMENT` | `APPROVE WITH SUGGESTIONS` → use `COMMENT` |
| `severity` | `blocker`, `warning`, `suggestion`, `note` | Lowercase |
| `file` | Repo-root relative, forward slashes | e.g. `Modules/Sales/Sales.Services/Foo.cs` |
| `line` / `lineEnd` | Integer (1-based), or `null` if unknown | Set both to same value for single-line remarks |
| `suggestedFix` | Omit the field if remark is a `note` | |
| `body` | GFM Markdown string | Used as the top-level PR review body |

---

## CLI Import Commands

After the agent saves both files, output a **ready-to-run commands block** in the chat so the user can import the review into their PR immediately.

### GitHub — `gh` CLI

```bash
# Option A: Post the full Markdown report as a single PR comment
gh pr comment {PR_NUMBER} --body-file docs/code-reviews/{issueId}-review_{timestamp}.md

# Option B: Post as a formal PR review with inline file comments (uses GitHub Review API)
# Requires: GH_TOKEN with repo scope, jq installed
gh api repos/{OWNER}/{REPO}/pulls/{PR_NUMBER}/reviews \
--method POST \
--input docs/code-reviews/{issueId}-review_{timestamp}.json
```

> **Note for Option B:** The JSON payload's top-level structure matches the GitHub PR Review API.
> GitHub inline comments (`remarks[]`) require `path` (= `file`), `line`, and `body`.
> The `gh api --input` flag reads JSON directly from the file — no shell escaping needed.

### Azure DevOps — REST API via `curl`

```bash
# Post the full Markdown report as a PR thread (top-level comment)
curl -s -X POST \
"https://dev.azure.com/{ORG}/{PROJECT}/_apis/git/repositories/{REPO}/pullRequests/{PR_ID}/threads?api-version=7.1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AZURE_DEVOPS_TOKEN" \
--data-binary @- <<EOF
{
"comments": [{"content": $(jq -Rs . < docs/code-reviews/{issueId}-review_{timestamp}.md), "commentType": 1}],
"status": 1
}
EOF

# Post individual inline remarks from the JSON payload
# (run once per remark that has a non-null 'file' and 'line')
curl -s -X POST \
"https://dev.azure.com/{ORG}/{PROJECT}/_apis/git/repositories/{REPO}/pullRequests/{PR_ID}/threads?api-version=7.1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AZURE_DEVOPS_TOKEN" \
-d '{
"comments": [{"content": "{R1 body}", "commentType": 1}],
"threadContext": {
"filePath": "/{file}",
"rightFileStart": {"line": {line}, "offset": 1},
"rightFileEnd": {"line": {lineEnd}, "offset": 1}
},
"status": 1
}'
```

> The agent outputs **placeholder-filled** commands (with actual values substituted) so the user only needs to set environment variables (`OWNER`, `REPO`, `PR_NUMBER`, `AZURE_DEVOPS_TOKEN`) and run.

---

## Formatting Rules

### General
Expand All @@ -293,19 +180,6 @@ curl -s -X POST \
- Range: `L42-L58`
- If line number cannot be determined, use `(general)` and explain the scope in the description

### GitHub PR Compatibility
The report is designed to render correctly when pasted as a GitHub PR comment:
- Tables use standard GitHub-flavored Markdown (GFM)
- Emoji severities (🔴🟡🟢ℹ️) render natively
- No HTML tags — pure Markdown only
- Collapsible sections are NOT used (inconsistent support across platforms)
- Code references use backtick-wrapped paths, not links (links break across forks)

### Azure DevOps PR Compatibility
- Azure DevOps supports GFM in PR comments
- Same Markdown renders correctly in both platforms
- Avoid Mermaid diagrams in the report (not supported in Azure DevOps PR comments)

## Edge Cases

### No Remarks Found
Expand Down
Loading