@d5render/cli 0.1.57 → 0.1.60
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/.skills/code-review/SKILL.md +34 -6
- package/bin/copilot.js +737 -740
- package/bin/d5cli +9 -9
- package/package.json +1 -2
- package/.github/instructions/code-review.instructions.md +0 -43
package/bin/d5cli
CHANGED
|
@@ -51,9 +51,9 @@ function toEnv(key, defaultValue) {
|
|
|
51
51
|
}
|
|
52
52
|
function buildEnv() {
|
|
53
53
|
const envArg = argv.find((arg) => arg.startsWith("--customizenv="));
|
|
54
|
-
let envJson
|
|
55
|
-
if (envArg) envJson
|
|
56
|
-
return envJson
|
|
54
|
+
let envJson = {};
|
|
55
|
+
if (envArg) envJson = JSON.parse(envArg.replace("--customizenv=", ""));
|
|
56
|
+
return envJson;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
//#endregion
|
|
@@ -107,7 +107,7 @@ function installCopilot() {
|
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region package.json
|
|
109
109
|
var name = "@d5render/cli";
|
|
110
|
-
var version = "0.1.
|
|
110
|
+
var version = "0.1.60";
|
|
111
111
|
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region packages/gitlab/url.ts
|
|
@@ -220,14 +220,14 @@ async function deploy() {
|
|
|
220
220
|
async function need() {
|
|
221
221
|
if (!env.CI) return true;
|
|
222
222
|
const { CI_MERGE_REQUEST_IID, CI_COMMIT_SHA } = env;
|
|
223
|
-
const file
|
|
223
|
+
const file = join(TEMP, "CODEREVIEW");
|
|
224
224
|
if (CI_MERGE_REQUEST_IID) {
|
|
225
|
-
let appended = `${existsSync(file
|
|
225
|
+
let appended = `${existsSync(file) ? readFileSync(file, "utf8") : ""}\n${CI_MERGE_REQUEST_IID}`.split("\n");
|
|
226
226
|
const max = 1e4;
|
|
227
227
|
if (appended.length > max) appended = appended.slice(-max);
|
|
228
228
|
if (!existsSync(TEMP)) mkdirSync(TEMP, { recursive: true });
|
|
229
|
-
writeFileSync(file
|
|
230
|
-
console.log("merge pipeline, recorded IID:", CI_MERGE_REQUEST_IID, "to:", file
|
|
229
|
+
writeFileSync(file, appended.join("\n"), "utf8");
|
|
230
|
+
console.log("merge pipeline, recorded IID:", CI_MERGE_REQUEST_IID, "to:", file);
|
|
231
231
|
return true;
|
|
232
232
|
}
|
|
233
233
|
if (!CI_COMMIT_SHA) return true;
|
|
@@ -238,7 +238,7 @@ async function need() {
|
|
|
238
238
|
}).toString().match(/See merge request[\s\S]+!(\d+)/);
|
|
239
239
|
if (!match) return true;
|
|
240
240
|
const iid = match[1];
|
|
241
|
-
const yes = (existsSync(file
|
|
241
|
+
const yes = (existsSync(file) ? readFileSync(file, "utf8") : "").split("\n").includes(iid);
|
|
242
242
|
if (yes) {
|
|
243
243
|
console.warn(`Merge Request !${iid} has been AI reviewed before.`);
|
|
244
244
|
const mergeURL = visitPipeline(iid).url;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "jasirou",
|
|
6
6
|
"main": "./bin/d5cli",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.60",
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
10
10
|
"@types/node": "^25.0.3",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"zod": "^4.3.5"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
".github/instructions/code-review.instructions.md",
|
|
22
21
|
".github/instructions/severity.instructions.md",
|
|
23
22
|
".skills/devops",
|
|
24
23
|
".skills/code-review",
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
applyTo: "**"
|
|
3
|
-
excludeAgent: ["code-review"]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
1. **MUST** Take the file as the review target:
|
|
7
|
-
- The focus of this review is on the content involved in the diff but the evaluation dimensions need to be based on the file content.
|
|
8
|
-
- When the diff in the discrepancy report differs from the document content, the diff is only used as a line number reference.
|
|
9
|
-
- The actual content that needs to be reviewed should be **based on the document content**.
|
|
10
|
-
2. Establish context by **reading relevant files**, files that are **imported/used by** the diff files or are **structurally neighboring** them (e.g., related configuration or test files).
|
|
11
|
-
3. **Ensure the relationship diagram of the diff is complete:**
|
|
12
|
-
- After establishing the context, analyze the complete context of the difference code to ensure a relatively complete code relationship diagram can be built.
|
|
13
|
-
- If the content is incomplete, supplement the context and rebuild the relationship diagram.
|
|
14
|
-
4. Read the commit message as the basic understanding of the current change
|
|
15
|
-
5. Determine technology the repository belongs, draw upon your understanding of that technology, provide recommendations on cutting-edge technologies and best practices:
|
|
16
|
-
- **Consult the workspace introduction** yourself.
|
|
17
|
-
- Consult cutting-edge industry documentation yourself.
|
|
18
|
-
6. **Execute as many relevant commands as possible to enrich your context.**
|
|
19
|
-
7. **Prioritize Analysis Focus**:
|
|
20
|
-
- For all collected code, meticulously trace the logic to uncover functional bugs and correctness issues.
|
|
21
|
-
- Pay attention to the **correctness** of the analytical logic, the **efficiency** of the code, and its **long-term maintainability**.
|
|
22
|
-
- Concentrate your deepest analysis on the application code (non-test files).
|
|
23
|
-
- Actively consider edge cases, off-by-one errors, race conditions, and improper null/error handling.
|
|
24
|
-
- **focusing on major errors**, identify potential bugs, architectural impact, security vulnerabilities, performance bottlenecks, and clarity issues.
|
|
25
|
-
- focusing on last commit when the same functionality rolling commits occur.
|
|
26
|
-
8. **Maintain skepticism but verify carefully**:
|
|
27
|
-
- Gather as much context as possible for the code you suspect, raise questions only after **ensuring you have a sufficient understanding** of the business logic.
|
|
28
|
-
- If doubts persist even after establishing a complete context, lower the severity rating of the issue.
|
|
29
|
-
9. **Strictly** classify the severity according to the content of **file: [severity.instructions.md](./severity.instructions.md)**.
|
|
30
|
-
10. **Further summary report:**
|
|
31
|
-
- **Tone/Content:** **DO NOT** add comments that:
|
|
32
|
-
- Tell the user to "check," "confirm," "verify," or "ensure" something.
|
|
33
|
-
- Explain what the code change does or validate its purpose.
|
|
34
|
-
- Explain the code to the author (they are assumed to know their own code).
|
|
35
|
-
- Comment on missing trailing newlines or other purely stylistic issues that do not affect code execution or readability in a meaningful way.
|
|
36
|
-
- **Technical Detail:**
|
|
37
|
-
- Pay **meticulous attention to line numbers and indentation** in code suggestions; they **must** be correct and match the surrounding code.
|
|
38
|
-
- **NEVER** comment on license headers, copyright headers, or anything related to future dates/versions (e.g., "this date is in the future").
|
|
39
|
-
- **NEVER** comment on the presence or absence of comments in the code.
|
|
40
|
-
- **Formatting/Structure:**
|
|
41
|
-
- Keep the **change summary** concise (aim for a single sentence).
|
|
42
|
-
- Keep **comment bodies concise** and focused on a single issue.
|
|
43
|
-
- When similar issues occur frequently, please review the code to determine if it meets the change objectives.
|