cc-viewer 1.8.15 → 1.8.19
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/concepts/ar/UltraPlan.md +1 -1
- package/concepts/da/UltraPlan.md +1 -1
- package/concepts/de/UltraPlan.md +1 -1
- package/concepts/en/UltraPlan.md +1 -1
- package/concepts/es/UltraPlan.md +1 -1
- package/concepts/fr/UltraPlan.md +1 -1
- package/concepts/it/UltraPlan.md +1 -1
- package/concepts/ja/UltraPlan.md +1 -1
- package/concepts/ko/UltraPlan.md +1 -1
- package/concepts/no/UltraPlan.md +1 -1
- package/concepts/pl/UltraPlan.md +1 -1
- package/concepts/pt-BR/UltraPlan.md +1 -1
- package/concepts/ru/UltraPlan.md +1 -1
- package/concepts/th/UltraPlan.md +1 -1
- package/concepts/tr/UltraPlan.md +1 -1
- package/concepts/uk/UltraPlan.md +1 -1
- package/concepts/zh/UltraPlan.md +1 -1
- package/concepts/zh-TW/UltraPlan.md +1 -1
- package/dist/assets/App-C9Tx6Iqw.js +2 -0
- package/dist/assets/{MdxEditorPanel-Ddpu5ELR.js → MdxEditorPanel-DU_5CRtW.js} +1 -1
- package/dist/assets/{Mobile-DA0yMMgI.js → Mobile--EECC49-.js} +1 -1
- package/dist/assets/{ProxyStatsModal-DKKfSpXx.js → ProxyStatsModal-DJu0xq3Z.js} +1 -1
- package/dist/assets/index-CJdRSHTP.js +2 -0
- package/dist/assets/{seqResourceLoaders-B_FSQh3U.css → seqResourceLoaders-BumAjQDW.css} +2 -2
- package/dist/assets/seqResourceLoaders-C5UX6ecI.js +2 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/server/lib/git-diff.js +49 -20
- package/server/lib/log-watcher.js +9 -1
- package/server/routes/im.js +15 -2
- package/server/system-prompt-templates/presets/GLM-5.2.md +0 -1
- package/server/system-prompt-templates/presets/GLM-5.3.md +0 -1
- package/server/system-prompt-templates/presets/Qwen-3.md +0 -1
- package/server/system-prompt-templates/presets/deepseek-v4-flash.md +0 -1
- package/server/system-prompt-templates/presets/deepseek-v4-pro.md +0 -1
- package/server/system-prompt-templates/presets/kimi-k2.7-code.md +0 -1
- package/server/system-prompt-templates/presets/kimi-k3.md +1 -1
- package/server/system-prompt-templates/systemPromptModel.md +0 -1
- package/ultraAgents/code-expert.json +1 -1
- package/dist/assets/App-DxDo_tCQ.js +0 -2
- package/dist/assets/index-BCpkzaVk.js +0 -2
- package/dist/assets/seqResourceLoaders-BkzxH2jr.js +0 -2
package/dist/index.html
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
// 整体显示大小已弃用 CSS zoom:Electron 改用 webFrame.setZoomFactor(首屏抢占见
|
|
22
22
|
// electron/tab-content-preload.js),纯浏览器交由用户用浏览器自带快捷键缩放,故此处不再设 zoom。
|
|
23
23
|
</script>
|
|
24
|
-
<script type="module" crossorigin src="./assets/index-
|
|
24
|
+
<script type="module" crossorigin src="./assets/index-CJdRSHTP.js"></script>
|
|
25
25
|
<link rel="modulepreload" crossorigin href="./assets/vendor-antd-DKIytXho.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="./assets/vendor-codemirror-4qgXq03k.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="./assets/vendor-mdxeditor-D5Z5D9fq.js">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-viewer",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.19",
|
|
4
4
|
"description": "Claude Code logging, visualization, and management toolkit — launch a web viewer alongside Claude Code with full request/response tracing, proxy, and mobile support",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "server.js",
|
package/server/lib/git-diff.js
CHANGED
|
@@ -71,8 +71,12 @@ export function countUntrackedLines(cwd, file) {
|
|
|
71
71
|
* them. Returns an empty list when HEAD cannot be resolved (unborn branch) or
|
|
72
72
|
* the log command fails.
|
|
73
73
|
*
|
|
74
|
-
* Each commit includes its changed files
|
|
75
|
-
*
|
|
74
|
+
* Each commit includes its changed files (with real A/M/D/R status) plus per-commit
|
|
75
|
+
* insertions/deletions. A single `git log --numstat` would give stats but no status,
|
|
76
|
+
* and rename lines would carry a pseudo-path (`src/{a.js => b.js}`), so the file list
|
|
77
|
+
* still comes from one `git log --name-status` call and the stats from a second
|
|
78
|
+
* `git log --numstat` call, joined by commit hash. Passing `--no-renames` to both
|
|
79
|
+
* keeps rename entries as plain A + D real paths instead.
|
|
76
80
|
*
|
|
77
81
|
* @param {string} cwd
|
|
78
82
|
* @param {object} [opts]
|
|
@@ -108,33 +112,53 @@ export async function getUnpushedCommits(cwd, { maxCommits = 100 } = {}) {
|
|
|
108
112
|
const hasUpstream = !!upstream;
|
|
109
113
|
const resultBranch = detached ? null : branch;
|
|
110
114
|
|
|
111
|
-
// Use
|
|
115
|
+
// Use unit separators between fields and a sentinel between commits to avoid
|
|
112
116
|
// getting fooled by tabs/newlines inside commit subjects.
|
|
113
117
|
// Format: <hash>\x1f<author>\x1f<date>\x1f<subject>\n
|
|
114
|
-
//
|
|
115
|
-
//
|
|
118
|
+
// name-status pass: one `<status>\t<path>` line per file (R###\told\tnew for
|
|
119
|
+
// renames). numstat pass: one `<added>\t<removed>\t<path>` line per file
|
|
120
|
+
// (binary files report `-\t-\t<path>`). Commits separated by `\x1e`.
|
|
121
|
+
// `--no-renames` turns renames into plain A + D entries so every path is real.
|
|
116
122
|
const COMMIT_SEP = '\x1e';
|
|
117
123
|
const FIELD_SEP = '\x1f';
|
|
118
|
-
|
|
124
|
+
const prettyArg = `--pretty=format:${COMMIT_SEP}%H${FIELD_SEP}%an${FIELD_SEP}%aI${FIELD_SEP}%s`;
|
|
125
|
+
const logArgs = ['log', `--max-count=${maxCommits}`, '--no-renames'];
|
|
126
|
+
const execOpts = { cwd, encoding: 'utf-8', timeout: 8000, maxBuffer: 10 * 1024 * 1024 };
|
|
127
|
+
let nameStatusOut = '';
|
|
128
|
+
let numstatOut = '';
|
|
119
129
|
try {
|
|
120
|
-
const r = await execFileAsync(
|
|
121
|
-
|
|
122
|
-
[
|
|
123
|
-
'log',
|
|
124
|
-
`--max-count=${maxCommits}`,
|
|
125
|
-
`--pretty=format:${COMMIT_SEP}%H${FIELD_SEP}%an${FIELD_SEP}%aI${FIELD_SEP}%s`,
|
|
126
|
-
'--name-status',
|
|
127
|
-
...rangeArgs,
|
|
128
|
-
],
|
|
129
|
-
{ cwd, encoding: 'utf-8', timeout: 8000, maxBuffer: 10 * 1024 * 1024 }
|
|
130
|
-
);
|
|
131
|
-
stdout = r.stdout;
|
|
130
|
+
const r = await execFileAsync('git', [...logArgs, prettyArg, '--name-status', ...rangeArgs], execOpts);
|
|
131
|
+
nameStatusOut = r.stdout;
|
|
132
132
|
} catch {
|
|
133
133
|
return { commits: [], hasUpstream, branch: resultBranch, upstream };
|
|
134
134
|
}
|
|
135
|
+
try {
|
|
136
|
+
const r = await execFileAsync('git', [...logArgs, prettyArg, '--numstat', ...rangeArgs], execOpts);
|
|
137
|
+
numstatOut = r.stdout;
|
|
138
|
+
} catch {
|
|
139
|
+
numstatOut = ''; // stats are best-effort — keep the file list even if numstat fails
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Sum per-commit line stats from the numstat pass, keyed by full hash.
|
|
143
|
+
const statsByHash = new Map();
|
|
144
|
+
for (const block of numstatOut.split(COMMIT_SEP)) {
|
|
145
|
+
if (!block) continue;
|
|
146
|
+
const lines = block.split(/\r?\n/);
|
|
147
|
+
const parts = (lines[0] || '').split(FIELD_SEP);
|
|
148
|
+
if (parts.length < 4) continue;
|
|
149
|
+
let insertions = 0;
|
|
150
|
+
let deletions = 0;
|
|
151
|
+
for (let i = 1; i < lines.length; i++) {
|
|
152
|
+
const cols = lines[i].split('\t');
|
|
153
|
+
if (cols.length < 3) continue;
|
|
154
|
+
insertions += parseInt(cols[0], 10) || 0; // binary '-' → NaN → 0
|
|
155
|
+
deletions += parseInt(cols[1], 10) || 0;
|
|
156
|
+
}
|
|
157
|
+
statsByHash.set(parts[0], { insertions, deletions });
|
|
158
|
+
}
|
|
135
159
|
|
|
136
160
|
const commits = [];
|
|
137
|
-
const blocks =
|
|
161
|
+
const blocks = nameStatusOut.split(COMMIT_SEP).filter(Boolean);
|
|
138
162
|
for (const block of blocks) {
|
|
139
163
|
// git on Windows 在 piped 模式输出 CRLF;split('\n') 会让 fp 末尾带 \r,前端文件名乱码。
|
|
140
164
|
const lines = block.split(/\r?\n/);
|
|
@@ -149,10 +173,13 @@ export async function getUnpushedCommits(cwd, { maxCommits = 100 } = {}) {
|
|
|
149
173
|
const tab = line.indexOf('\t');
|
|
150
174
|
if (tab < 0) continue;
|
|
151
175
|
const st = line.substring(0, tab).trim();
|
|
152
|
-
|
|
176
|
+
// name-status rename rows carry two paths (old\tnew); with --no-renames
|
|
177
|
+
// they should not appear, but keep the new path if one ever slips through.
|
|
178
|
+
const fp = line.substring(tab + 1).split('\t').pop();
|
|
153
179
|
if (!fp) continue;
|
|
154
180
|
files.push({ status: st[0] || 'M', file: fp });
|
|
155
181
|
}
|
|
182
|
+
const stats = statsByHash.get(hash) || { insertions: 0, deletions: 0 };
|
|
156
183
|
commits.push({
|
|
157
184
|
hash,
|
|
158
185
|
shortHash: hash.substring(0, 7),
|
|
@@ -160,6 +187,8 @@ export async function getUnpushedCommits(cwd, { maxCommits = 100 } = {}) {
|
|
|
160
187
|
date,
|
|
161
188
|
subject,
|
|
162
189
|
files,
|
|
190
|
+
insertions: stats.insertions,
|
|
191
|
+
deletions: stats.deletions,
|
|
163
192
|
});
|
|
164
193
|
}
|
|
165
194
|
|
|
@@ -5,6 +5,7 @@ import { reconstructEntries } from '@ccv/core/delta-reconstructor';
|
|
|
5
5
|
import { enrichEntry } from './enrich-plan-input.js';
|
|
6
6
|
import { enrichEntry as enrichWorkflowEntry } from './enrich-workflow.js';
|
|
7
7
|
import { sseWrite } from './wire-compress.js';
|
|
8
|
+
import { reportSwallowed } from '@ccv/core/error-report';
|
|
8
9
|
|
|
9
10
|
// 1.7.0: the v1 log-file tail (fs.watch + byte cursors + rotation follow)
|
|
10
11
|
// retired with the v1 write path — the live channel is server/lib/v2/
|
|
@@ -66,8 +67,15 @@ function _safeSseWrite(clients, client, payload) {
|
|
|
66
67
|
// streams. The drain listener below stays on the res: the encoder is
|
|
67
68
|
// piped into it, so socket drain still propagates.
|
|
68
69
|
ok = sseWrite(client, payload);
|
|
69
|
-
} catch {
|
|
70
|
+
} catch (err) {
|
|
71
|
+
// A throwing write means this connection is unusable. Removing it from
|
|
72
|
+
// `clients` alone left the socket open and the 30s ping timer alive: the
|
|
73
|
+
// browser kept renewing its heartbeat watchdog on those pings, so it never
|
|
74
|
+
// reconnected and the chat panel stalled forever while the terminal WS
|
|
75
|
+
// stayed healthy. Report and CLOSE so the client's auto-reconnect fires.
|
|
76
|
+
reportSwallowed('sse.safe-write', err);
|
|
70
77
|
_removeClient(clients, client);
|
|
78
|
+
try { client.end(); } catch {}
|
|
71
79
|
return false;
|
|
72
80
|
}
|
|
73
81
|
if (!ok) {
|
package/server/routes/im.js
CHANGED
|
@@ -173,8 +173,21 @@ function imConfigPost(req, res, parsedUrl, isLocal, deps) {
|
|
|
173
173
|
// bind-first-conversation(im-bridge-core.js)——首个向机器人发消息的会话被绑定,该会话内任何人
|
|
174
174
|
// 都可无审批驱动本地会话。这里打一条服务端审计(curl/headless 启用走不到前端 toast),
|
|
175
175
|
// PreToolUse permissions.deny 硬拦截(perm-bridge/im-deny,独立于白名单)仍然生效。
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
//
|
|
177
|
+
// 部分更新兜底:只携带 enabled(如会话弹窗的「停止」只发 {enabled:false, applyProcess:true})的 body
|
|
178
|
+
// 不能让 saveConfig→normalize 把缺省字段落成默认值——cred 字段(appKey/appId/botId)、白名单、
|
|
179
|
+
// region、ackCard/aiCard、maxChunkChars 都会被重置,仅 secret 字段有空值保留。检测「是否触及 enabled
|
|
180
|
+
// 之外的字段」,未触及则合并 loadConfig 的已存值(read-merge-write),只翻 enabled。设置面板的全量
|
|
181
|
+
// buildBody 触及业务字段 → 维持原样逐字节不变。
|
|
182
|
+
const desc = getDescriptor(id);
|
|
183
|
+
// `in` throws on a non-object JSON body (null / "str" / 42 / true), and the throw inside this
|
|
184
|
+
// async readBody callback writes no response → the client hangs. Neutralize to {} first
|
|
185
|
+
// (normalize() used to guard with `cfg ? … : undefined`; keep that tolerance here).
|
|
186
|
+
const incomingObj = (incoming && typeof incoming === 'object' && !Array.isArray(incoming)) ? incoming : {};
|
|
187
|
+
const touchesOthers = desc.fields.some((f) => f.key !== 'enabled' && f.key in incomingObj);
|
|
188
|
+
const effective = touchesOthers ? incomingObj : { ...loadConfig(id), enabled: !!incomingObj.enabled };
|
|
189
|
+
if (effective.enabled) warnIfEmptyAllowlist(id, effective);
|
|
190
|
+
const saved = saveConfig(id, effective);
|
|
178
191
|
// applyProcess(默认 true,保持旧调用方语义):前端 onBlur 自动保存传 false → 仅存盘、不驱动进程,
|
|
179
192
|
// 否则每次输入框失焦都会重启 worker。显式「启动/停止」按钮则不传(=true),沿用下述驱动逻辑。
|
|
180
193
|
// 注:applyProcess 是未知字段,saveConfig/normalize 不会把它写盘。
|
|
@@ -7,7 +7,6 @@ Edit this file directly.
|
|
|
7
7
|
|
|
8
8
|
You are ${model.name}, an interactive agent that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
|
|
9
9
|
|
|
10
|
-
IMPORTANT: Assist with defensive software engineering work. Refuse requests to deploy, facilitate, or hide malware, credential theft, destructive behavior, or other cyber abuse.
|
|
11
10
|
IMPORTANT: Never generate or guess URLs unless you are confident they help the user with programming. Prefer URLs the user provides or ones found in local files.
|
|
12
11
|
|
|
13
12
|
# Doing tasks
|
|
@@ -9,7 +9,6 @@ Edit this file directly.
|
|
|
9
9
|
|
|
10
10
|
You are ${model.name}, an interactive agent that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
|
|
11
11
|
|
|
12
|
-
IMPORTANT: Assist with defensive software engineering work. Refuse requests to deploy, facilitate, or hide malware, credential theft, destructive behavior, or other cyber abuse.
|
|
13
12
|
IMPORTANT: Never generate or guess URLs unless you are confident they help the user with programming. Prefer URLs the user provides or ones found in local files.
|
|
14
13
|
|
|
15
14
|
# Doing tasks
|
|
@@ -7,7 +7,6 @@ Edit this file directly.
|
|
|
7
7
|
|
|
8
8
|
You are ${model.name}, an interactive coding agent that helps users carry software engineering tasks through to completion. Use the instructions below and the tools available to you to work directly in the user's project.
|
|
9
9
|
|
|
10
|
-
IMPORTANT: Assist with defensive software engineering work. Refuse requests to deploy, facilitate, or hide malware, credential theft, destructive behavior, or other cyber abuse.
|
|
11
10
|
IMPORTANT: Never generate or guess URLs unless you are confident they help the user with programming. Prefer URLs the user provides or ones found in local files.
|
|
12
11
|
|
|
13
12
|
# Doing tasks
|
|
@@ -8,7 +8,6 @@ action-biased.
|
|
|
8
8
|
|
|
9
9
|
You are ${model.name}, a fast interactive coding agent. Act quickly and precisely on software engineering tasks using the tools available to you.
|
|
10
10
|
|
|
11
|
-
IMPORTANT: Assist with defensive software engineering work only. Refuse malware, credential theft, or destructive requests.
|
|
12
11
|
IMPORTANT: Do not guess URLs; use ones the user provides or ones found in local files.
|
|
13
12
|
|
|
14
13
|
# How to work
|
|
@@ -8,7 +8,6 @@ inherit the shared sections from ../systemPromptModel.md — see toFullTemplate.
|
|
|
8
8
|
|
|
9
9
|
You are ${model.name}, an interactive coding agent that helps users complete software engineering tasks end to end. Use the instructions below and the tools available to you to do real work in the user's project, not just to describe it.
|
|
10
10
|
|
|
11
|
-
IMPORTANT: Assist with defensive software engineering work. Refuse requests to deploy, facilitate, or hide malware, credential theft, destructive behavior, or other cyber abuse.
|
|
12
11
|
IMPORTANT: Never generate or guess URLs unless you are confident they help the user with programming. Prefer URLs the user provides or ones found in local files.
|
|
13
12
|
|
|
14
13
|
# Working approach
|
|
@@ -9,7 +9,6 @@ carries the single emphatic line.
|
|
|
9
9
|
|
|
10
10
|
You are ${model.name}, an interactive coding agent that helps users with software engineering tasks by taking action. Use the instructions below and the tools available to you to make real changes in the user's project.
|
|
11
11
|
|
|
12
|
-
IMPORTANT: Assist with defensive software engineering work. Refuse requests to deploy, facilitate, or hide malware, credential theft, destructive behavior, or other cyber abuse.
|
|
13
12
|
IMPORTANT: Never generate or guess URLs unless you are confident they help the user with programming. Prefer URLs the user provides or ones found in local files.
|
|
14
13
|
|
|
15
14
|
# Doing tasks
|
|
@@ -8,7 +8,6 @@ Kimi K3: keep scope tight, act through tools, and explain briefly.
|
|
|
8
8
|
|
|
9
9
|
You are ${model.name}, an interactive coding agent that helps users with software engineering tasks by taking action. Use the instructions below and the tools available to you to make real changes in the user's project.
|
|
10
10
|
|
|
11
|
-
IMPORTANT: Assist with defensive software engineering work. Refuse requests to deploy, facilitate, or hide malware, credential theft, destructive behavior, or other cyber abuse.
|
|
12
11
|
IMPORTANT: Never generate or guess URLs unless you are confident they help the user with programming. Prefer URLs the user provides or ones found in local files.
|
|
13
12
|
|
|
14
13
|
# Doing tasks
|
|
@@ -37,6 +36,7 @@ IMPORTANT: Never generate or guess URLs unless you are confident they help the u
|
|
|
37
36
|
- Do not wait passively for a teammate to report back: teammates sometimes finish their task without sending you a message. No notification ≠ not done — check `~/.claude/projects/<slug>/<session>/subagents/agent-*.jsonl` (or SendMessage the teammate) before waiting.
|
|
38
37
|
- When a teammate goes quiet, ask it directly for its result or status — treat silence as "finished or stuck", never as "still working". Read results back with `tail -N <file> | jq -r 'select(.type=="assistant") | .message.content[] | select(.type=="text") | .text'` — never Read the whole jsonl.
|
|
39
38
|
- Before telling the user a delegated task is blocked or incomplete, ping the teammate once; escalate to the user only if it still does not respond. After 2 empty wait rounds, change strategy; after ~10 minutes, do it yourself or tell the user. Never idle-poll.
|
|
39
|
+
- When waiting for an async result (teammate/subagent report, background task), do not poll by repeatedly calling tools. These results arrive automatically as messages — stop calling tools, end your turn, and let them arrive. Reserve Monitor-style event-driven waiting for external state only (files, processes, ports). If you catch yourself checking the same thing's progress two turns in a row, that is polling — stop immediately.
|
|
40
40
|
|
|
41
41
|
# Executing actions with care
|
|
42
42
|
Consider the reversibility and blast radius of each action. Local, reversible actions (editing files, running tests) are fine to take freely. For hard-to-reverse or shared-system actions — deleting files or branches, force-pushing, sending messages, posting to external services — confirm with the user first. Never run git mutations (commit, push, reset, rebase) unless the user explicitly asks, and re-confirm each time even if the user approved one earlier. Investigate unexpected state before overwriting it.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
You are an interactive agent that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
|
|
3
3
|
|
|
4
|
-
IMPORTANT: Assist with defensive software engineering work. Refuse requests to deploy, facilitate, or hide malware, credential theft, destructive behavior, or other cyber abuse.
|
|
5
4
|
IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
|
|
6
5
|
|
|
7
6
|
# System
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"tr": "Kıdemli mühendis: çoklu ajan keşfi, plan incelemesi ve yüksek kaliteli uygulama — kod incelemesi, yeniden düzenleme, performans, sürdürülebilirlik.",
|
|
42
42
|
"uk": "Senior-інженер: багатоагентне дослідження, рев'ю плану та якісна реалізація — рев'ю коду, рефакторинг, продуктивність, супровід."
|
|
43
43
|
},
|
|
44
|
-
"content": "<system-reminder>\n[SCOPED INSTRUCTION] The following instructions apply only to the next 1–3 interactions. Once the task is complete, these instructions should gradually decrease in priority and no longer affect subsequent interactions. You should be adept at utilizing tools such as `AskUserQuestion`, `EnterPlanMode`, and `TeamCreate`, rather than relying solely on plain text processing. Before execution, you must ensure that the `EnterPlanMode`, `ExitPlanMode`, `SendMessage`, `TaskCreate`, `TaskUpdate`, `TaskStop`, `TaskGet`, `TaskOutput` and `TaskList` tools are loaded.\n\nPre-requisite: Use `AskUserQuestion` to clarify user intent whenever the request is ambiguous (target element, interaction style, scope of platforms, etc.). Skip only if the intent is unambiguous.\n\nLeverage a multi-agent exploration mechanism to formulate a highly detailed implementation plan.\n\nInstructions:\n1. Use the `Agent` tool to spawn parallel agents that simultaneously explore different aspects of the codebase:\n- If necessary, assign a preliminary researcher to use the `webSearch` tool to first investigate cutting-edge solutions in the relevant industry domain;\n- One agent responsible for understanding the relevant existing code and architecture;\n- One agent responsible for identifying all files that need to be modified;\n- One agent responsible for identifying potential risks, edge cases, and dependencies;\n- You may add other roles or deploy additional agents beyond the three listed above; the maximum number of concurrently dispatched agents is 5.\n\n2. Synthesize the findings from all agents into a detailed, step-by-step implementation plan.\n\n3. Use the `Agent` tool to spawn 2-3 review agents that examine the plan from different perspectives, checking for missing steps, potential risks, or corresponding mitigation strategies.\n\n4. Integrate the feedback gathered during the review process, then call `ExitPlanMode` to submit your final plan.\n\n5. Once `ExitPlanMode` returns a result:\n- If approved: proceed to execute the plan within this session.\n- If rejected: revise the plan based on the feedback provided and call `ExitPlanMode` again.\n- If an error occurs (including receiving a \"Not in Plan Mode\" message): do **not** follow the suggestions provided in the error message; instead, prompt the user for further instructions.\n\nYour final plan must include the following elements:\n- A clear summary of the implementation strategy;\n- An ordered list of files to be created or modified, with precise details of the required changes for each file;\n- A step-by-step execution sequence;\n- Testing and validation procedures;\n- Potential risks and their corresponding mitigation strategies;\n\n6. After the final plan has been successfully executed:\nFirst run `git diff --quiet && git diff --cached --quiet` (or equivalent) to detect whether the working tree actually has non-trivial changes; if there are no real changes (or only whitespace/comment-only edits), skip the UltraReview step.\nOtherwise, if the project is managed with Git:\nInitiate a team (`TeamCreate`), dynamically allocating the number of teammates based on task complexity (5 is recommended);\nIf the `TeamCreate` tool is unavailable, spawn teammates directly with the `Agent` tool (note: as teammates, not plain subagents);\nTask: Conduct a Code Review of the current git changes from multiple perspectives;\nPre-requisites:\n- The git repository may be located in a subdirectory of the current directory; prefer `git rev-parse --show-toplevel` (fall back to recursive lookup) before proceeding;\n- In the case of multiple repositories, tasks may be executed separately;\nThe team's goal is to analyze the current Git change log and validate each modification from different perspectives, specifically including:\n- Whether requirements/objectives have been met and functionality is complete;\n- Whether newly added code introduces side effects, breaks existing functionality, or poses potential risks;\n- Code quality: naming, readability, complexity, technical debt, maintainability;\n- Testing and documentation: whether there is adequate test coverage, and whether critical logic has necessary comments or documentation;\n- Dependencies and compatibility: whether new dependencies or version compatibility issues have been introduced;\nWorkflow:\n- Each teammate, according to their own role, covers the review dimensions one by one and independently outputs a report;\n- After consolidating the reports, perform a cross-review to identify conflicts or shared concerns;\n- Distill specific, actionable modification suggestions and annotate them with priority levels (P0/P1/P2/P3);\n- Upon completion, adopt P0 items
|
|
44
|
+
"content": "<system-reminder>\n[SCOPED INSTRUCTION] The following instructions apply only to the next 1–3 interactions. Once the task is complete, these instructions should gradually decrease in priority and no longer affect subsequent interactions. You should be adept at utilizing tools such as `AskUserQuestion`, `EnterPlanMode`, and `TeamCreate`, rather than relying solely on plain text processing. Before execution, you must ensure that the `EnterPlanMode`, `ExitPlanMode`, `SendMessage`, `TaskCreate`, `TaskUpdate`, `TaskStop`, `TaskGet`, `TaskOutput` and `TaskList` tools are loaded.\n\nPre-requisite: Use `AskUserQuestion` to clarify user intent whenever the request is ambiguous (target element, interaction style, scope of platforms, etc.). Skip only if the intent is unambiguous.\n\nLeverage a multi-agent exploration mechanism to formulate a highly detailed implementation plan.\n\nInstructions:\n1. Use the `Agent` tool to spawn parallel agents that simultaneously explore different aspects of the codebase:\n- If necessary, assign a preliminary researcher to use the `webSearch` tool to first investigate cutting-edge solutions in the relevant industry domain;\n- One agent responsible for understanding the relevant existing code and architecture;\n- One agent responsible for identifying all files that need to be modified;\n- One agent responsible for identifying potential risks, edge cases, and dependencies;\n- You may add other roles or deploy additional agents beyond the three listed above; the maximum number of concurrently dispatched agents is 5.\n\n2. Synthesize the findings from all agents into a detailed, step-by-step implementation plan.\n\n3. Use the `Agent` tool to spawn 2-3 review agents that examine the plan from different perspectives, checking for missing steps, potential risks, or corresponding mitigation strategies.\n\n4. Integrate the feedback gathered during the review process, then call `ExitPlanMode` to submit your final plan.\n\n5. Once `ExitPlanMode` returns a result:\n- If approved: proceed to execute the plan within this session.\n- If rejected: revise the plan based on the feedback provided and call `ExitPlanMode` again.\n- If an error occurs (including receiving a \"Not in Plan Mode\" message): do **not** follow the suggestions provided in the error message; instead, prompt the user for further instructions.\n\nYour final plan must include the following elements:\n- A clear summary of the implementation strategy;\n- An ordered list of files to be created or modified, with precise details of the required changes for each file;\n- A step-by-step execution sequence;\n- Testing and validation procedures;\n- Potential risks and their corresponding mitigation strategies;\n\n6. After the final plan has been successfully executed:\nFirst run `git diff --quiet && git diff --cached --quiet` (or equivalent) to detect whether the working tree actually has non-trivial changes; if there are no real changes (or only whitespace/comment-only edits), skip the UltraReview step.\nOtherwise, if the project is managed with Git:\nInitiate a team (`TeamCreate`), dynamically allocating the number of teammates based on task complexity (5 is recommended);\nIf the `TeamCreate` tool is unavailable, spawn teammates directly with the `Agent` tool (note: as teammates, not plain subagents);\nTask: Conduct a Code Review of the current git changes from multiple perspectives;\nPre-requisites:\n- The git repository may be located in a subdirectory of the current directory; prefer `git rev-parse --show-toplevel` (fall back to recursive lookup) before proceeding;\n- In the case of multiple repositories, tasks may be executed separately;\nThe team's goal is to analyze the current Git change log and validate each modification from different perspectives, specifically including:\n- Whether requirements/objectives have been met and functionality is complete;\n- Whether newly added code introduces side effects, breaks existing functionality, or poses potential risks;\n- Code quality: naming, readability, complexity, technical debt, maintainability;\n- Testing and documentation: whether there is adequate test coverage, and whether critical logic has necessary comments or documentation;\n- Dependencies and compatibility: whether new dependencies or version compatibility issues have been introduced;\nWorkflow:\n- Each teammate, according to their own role, covers the review dimensions one by one and independently outputs a report;\n- After consolidating the reports, perform a cross-review to identify conflicts or shared concerns;\n- Distill specific, actionable modification suggestions and annotate them with priority levels (P0/P1/P2/P3);\n- Upon completion, adopt P0 items; adopt P1 and P2 items selectively based on evaluation; disregard P3 items.\n- After execution is complete, close the team (`TeamDelete`);\n- If the `TeamDelete` tool is unavailable, notify each teammate to exit individually;\n</system-reminder>"
|
|
45
45
|
}
|