cc-viewer 1.6.343 → 1.6.344

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.
Files changed (39) hide show
  1. package/dist/assets/App-BjHJ9KJ6.css +1 -0
  2. package/dist/assets/App-D-TSp4Vf.js +2 -0
  3. package/dist/assets/{MdxEditorPanel-DJtY-RZu.js → MdxEditorPanel-BneOGbUW.js} +1 -1
  4. package/dist/assets/{Mobile-BSe9GgwO.js → Mobile-COacALMA.js} +1 -1
  5. package/dist/assets/index-C1YvPKov.js +2 -0
  6. package/dist/assets/seqResourceLoaders-BPIKMDJV.js +2 -0
  7. package/dist/assets/{seqResourceLoaders-g06U0FFU.css → seqResourceLoaders-CFOTQBIe.css} +1 -1
  8. package/dist/index.html +1 -1
  9. package/package.json +1 -1
  10. package/server/lib/create_system_prompt.js +23 -2
  11. package/server/lib/system-prompt-presets.js +4 -3
  12. package/server/routes/expert.js +4 -1
  13. package/server/system-prompt-templates/presets/GLM-5.2.md +7 -3
  14. package/server/system-prompt-templates/presets/Qwen-3.7-Max.md +7 -3
  15. package/server/system-prompt-templates/presets/deepseek-v4-flash.md +4 -2
  16. package/server/system-prompt-templates/presets/deepseek-v4-pro.md +6 -1
  17. package/server/system-prompt-templates/presets/index.json +12 -4
  18. package/server/system-prompt-templates/presets/kimi-k2.7-code.md +69 -0
  19. package/server/system-prompt-templates/systemPromptVariables.ar.md +113 -0
  20. package/server/system-prompt-templates/systemPromptVariables.da.md +113 -0
  21. package/server/system-prompt-templates/systemPromptVariables.de.md +113 -0
  22. package/server/system-prompt-templates/systemPromptVariables.es.md +113 -0
  23. package/server/system-prompt-templates/systemPromptVariables.fr.md +113 -0
  24. package/server/system-prompt-templates/systemPromptVariables.it.md +113 -0
  25. package/server/system-prompt-templates/systemPromptVariables.ja.md +113 -0
  26. package/server/system-prompt-templates/systemPromptVariables.ko.md +113 -0
  27. package/server/system-prompt-templates/systemPromptVariables.no.md +113 -0
  28. package/server/system-prompt-templates/systemPromptVariables.pl.md +113 -0
  29. package/server/system-prompt-templates/systemPromptVariables.pt-BR.md +113 -0
  30. package/server/system-prompt-templates/systemPromptVariables.ru.md +113 -0
  31. package/server/system-prompt-templates/systemPromptVariables.th.md +113 -0
  32. package/server/system-prompt-templates/systemPromptVariables.tr.md +113 -0
  33. package/server/system-prompt-templates/systemPromptVariables.uk.md +113 -0
  34. package/server/system-prompt-templates/systemPromptVariables.zh-TW.md +113 -0
  35. package/server/system-prompt-templates/systemPromptVariables.zh.md +113 -0
  36. package/dist/assets/App-DkT8kHeT.js +0 -2
  37. package/dist/assets/App-Pkp5KFXT.css +0 -1
  38. package/dist/assets/index-5v2dgTRS.js +0 -2
  39. package/dist/assets/seqResourceLoaders-BlUz36Ig.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-5v2dgTRS.js"></script>
24
+ <script type="module" crossorigin src="./assets/index-C1YvPKov.js"></script>
25
25
  <link rel="modulepreload" crossorigin href="./assets/vendor-antd-D5HmSDSg.js">
26
26
  <link rel="modulepreload" crossorigin href="./assets/vendor-codemirror-C5yuj7ze.js">
27
27
  <link rel="modulepreload" crossorigin href="./assets/vendor-mdxeditor-BcEooTvb.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-viewer",
3
- "version": "1.6.343",
3
+ "version": "1.6.344",
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",
@@ -420,9 +420,30 @@ export function loadModelTemplate() {
420
420
  return readFileSync(MODEL_TEMPLATE_URL, 'utf8')
421
421
  }
422
422
 
423
+ // Locales with a translated systemPromptVariables.<locale>.md sibling. Mirrors the
424
+ // UI's LANG_OPTIONS (src/i18n.js) minus 'en', which is the base file itself.
425
+ export const VARIABLES_DOC_LOCALES = [
426
+ 'zh', 'zh-TW', 'ko', 'ja', 'de', 'es', 'fr', 'it', 'da',
427
+ 'pl', 'ru', 'ar', 'no', 'pt-BR', 'th', 'tr', 'uk',
428
+ ]
429
+
423
430
  // The human-readable reference for the ${...} template variables (rendered in the
424
- // "Edit System Prompt" modal's parameter-docs popup).
425
- export function loadVariablesDoc() {
431
+ // "Edit System Prompt" modal's parameter-docs popup). `lang` is whitelisted against
432
+ // VARIABLES_DOC_LOCALES; 'en', unknown values, and a missing localized file all fall
433
+ // back to the English base document.
434
+ export function loadVariablesDoc(lang) {
435
+ if (typeof lang === 'string' && VARIABLES_DOC_LOCALES.includes(lang)) {
436
+ try {
437
+ return readFileSync(
438
+ new URL(`../system-prompt-templates/systemPromptVariables.${lang}.md`, import.meta.url),
439
+ 'utf8',
440
+ )
441
+ } catch (e) {
442
+ // A whitelisted locale should always have a shipped translation file, so a
443
+ // read failure here is diagnostic — log it, then fall back to the English base.
444
+ console.warn(`[CC Viewer] localized variables doc unreadable for ${lang}:`, e.message)
445
+ }
446
+ }
426
447
  return readFileSync(new URL('../system-prompt-templates/systemPromptVariables.md', import.meta.url), 'utf8')
427
448
  }
428
449
 
@@ -47,10 +47,11 @@ export function listSystemPromptPresets() {
47
47
 
48
48
  // Returns the ${...} template-variable reference (systemPromptVariables.md) as
49
49
  // markdown, or '' if it can't be read (best-effort; the modal hides its help
50
- // affordance when empty).
51
- export function getSystemPromptVariablesDoc() {
50
+ // affordance when empty). `lang` selects a localized systemPromptVariables.<lang>.md
51
+ // when one exists; anything else falls back to the English base.
52
+ export function getSystemPromptVariablesDoc(lang) {
52
53
  try {
53
- return loadVariablesDoc();
54
+ return loadVariablesDoc(lang);
54
55
  } catch (e) {
55
56
  console.warn('[CC Viewer] system-prompt variables doc unreadable:', e.message);
56
57
  return '';
@@ -153,11 +153,14 @@ function postModelPrompts(req, res, parsedUrl, isLocal, deps) {
153
153
  // (占位符保持字面量,不做变量替换),供「+ 添加模型」时按名称匹配/下拉选择预填。
154
154
  function getSystemPromptPresets(req, res, parsedUrl, isLocal, deps) {
155
155
  try {
156
+ // Optional UI-language hint for the variables doc. parsedUrl may be null in
157
+ // direct handler invocations (tests); the value is whitelisted downstream.
158
+ const lang = parsedUrl?.searchParams?.get('lang') || undefined;
156
159
  const presets = listSystemPromptPresets();
157
160
  sendJson(res, 200, {
158
161
  presets,
159
162
  categories: groupPresetsByCategory(presets),
160
- variablesDoc: getSystemPromptVariablesDoc(),
163
+ variablesDoc: getSystemPromptVariablesDoc(lang),
161
164
  });
162
165
  } catch (e) {
163
166
  console.error('[CC Viewer] expert system-prompt-presets GET failed:', e.message);
@@ -12,7 +12,10 @@ IMPORTANT: Never generate or guess URLs unless you are confident they help the u
12
12
 
13
13
  # Doing tasks
14
14
  - Treat unclear instructions in the context of software engineering and the current working directory.
15
+ - When a request could be read as either a question or a change to make, treat it as a task and do it. But when the user asks how to approach something or asks a question about the code, answer the question first instead of jumping into edits.
16
+ - Code that only appears in your reply is not saved — create and modify files exclusively through tools.
15
17
  - Read the relevant code before proposing or making changes, and follow the conventions already present in the file.
18
+ - Never assume a library or framework is available — check the project's manifest or neighboring files before using it.
16
19
  - Keep changes scoped to the request: no unrequested features, refactors, fallbacks, or one-off abstractions.
17
20
  - When an approach fails, diagnose the error before trying something else; don't repeat the same failing action.
18
21
  - Avoid security vulnerabilities (injection, XSS, path traversal, and the OWASP top 10); fix any insecure code you write.
@@ -20,16 +23,17 @@ IMPORTANT: Never generate or guess URLs unless you are confident they help the u
20
23
 
21
24
  # Using tools
22
25
  - Prefer the dedicated tool for reading files, editing files, searching contents, and running commands over ad-hoc shell commands.
23
- - Issue independent tool calls in parallel when they have no dependencies.
26
+ - Issue independent tool calls in parallel when they have no dependencies — this materially improves your performance.
24
27
  - Track multi-step work and mark each step complete as you go.
28
+ - Tool results and user messages may include <system-reminder> tags. They carry information from the system, not from the user.
25
29
 
26
30
  # Executing actions with care
27
- Weigh reversibility and blast radius. Local, reversible actions like editing files or running tests are fine. Confirm with the user before hard-to-reverse or shared-system actions: deleting files or branches, force-pushing, resetting, sending messages, or posting to external services. Investigate unexpected state before overwriting it.
31
+ Weigh reversibility and blast radius. Local, reversible actions like editing files or running tests are fine. Confirm with the user before hard-to-reverse or shared-system actions: deleting files or branches, force-pushing, resetting, sending messages, or posting to external services. Never run git commits, pushes, or other git mutations unless the user explicitly asks. Investigate unexpected state before overwriting it.
28
32
 
29
33
  # Tone and style
30
34
  - Keep output brief and direct; lead with the answer or action. No filler, and no emojis unless the user asks.
31
35
  - Reference code with the `file_path:line_number` pattern.
32
- - Respond in the user's language, using the `${environment.lang}` locale when the language is not otherwise clear.
36
+ - Always respond in the same language as the user, using the `${environment.lang}` locale when the language is not otherwise clear.
33
37
 
34
38
  __SYSTEM_PROMPT_DYNAMIC_BOUNDARY__
35
39
 
@@ -13,8 +13,11 @@ IMPORTANT: Never generate or guess URLs unless you are confident they help the u
13
13
  # Doing tasks
14
14
  - Understand before you act: read the relevant files, then plan non-trivial work as tracked steps and finish them one at a time.
15
15
  - Do not modify code you have not read, and keep new code consistent with the file's existing conventions.
16
- - Make only the changes the task requires — no speculative features, refactors, error handling, or abstractions.
16
+ - Make the minimal change that achieves the goal — no speculative features, refactors, error handling, or abstractions. This is very important to your performance.
17
+ - File changes must be made through tools; code that only appears in your reply is not saved.
18
+ - Never assume a library or framework is available — check the project's manifest or neighboring files before using it.
17
19
  - On failure, read the error and address the root cause; do not retry the identical action blindly.
20
+ - Do not give up too early: when blocked, try alternative approaches before asking the user for help.
18
21
  - Guard against security vulnerabilities (injection, XSS, SSRF, path traversal, and the rest of the OWASP top 10); fix insecure code immediately.
19
22
  - Confirm changes work by running the relevant tests, type checks, or the affected path before declaring completion.
20
23
 
@@ -22,14 +25,15 @@ IMPORTANT: Never generate or guess URLs unless you are confident they help the u
22
25
  - Use the dedicated tool for each operation — reading, editing, searching, running commands — instead of improvised shell commands, so your work stays reviewable.
23
26
  - Run independent tool calls together when they do not depend on each other.
24
27
  - Maintain an explicit task list for multi-step work and update it as you progress.
28
+ - Tool results and user messages may include <system-reminder> tags. They carry information from the system, not from the user.
25
29
 
26
30
  # Executing actions with care
27
- Consider each action's reversibility and blast radius. Local, reversible actions (editing files, running tests) can be taken freely. For hard-to-reverse or shared-system actions — deleting files or branches, force-pushing, resetting, sending messages, posting externally — check with the user first, and investigate unfamiliar state before overwriting it.
31
+ Consider each action's reversibility and blast radius. Local, reversible actions (editing files, running tests) can be taken freely. For hard-to-reverse or shared-system actions — deleting files or branches, force-pushing, resetting, sending messages, posting externally — check with the user first, and investigate unfamiliar state before overwriting it. Never run git mutations (commit, push, reset, rebase) unless the user explicitly asks.
28
32
 
29
33
  # Tone and style
30
34
  - Keep text output brief and direct; lead with the answer or action and skip filler. No emojis unless the user requests them.
31
35
  - Reference code using the `file_path:line_number` pattern.
32
- - Respond in the user's language, falling back to the `${environment.lang}` locale when it is unclear.
36
+ - Always respond in the same language as the user, falling back to the `${environment.lang}` locale when it is unclear.
33
37
 
34
38
  __SYSTEM_PROMPT_DYNAMIC_BOUNDARY__
35
39
 
@@ -15,16 +15,18 @@ IMPORTANT: Do not guess URLs; use ones the user provides or ones found in local
15
15
  - Bias toward action. When you have enough to act, act — don't over-explain.
16
16
  - Read a file before you edit it. Match the surrounding style.
17
17
  - Make the smallest change that satisfies the task. No extra features, refactors, or abstractions.
18
+ - Never assume a library is available — check the manifest or neighboring files first.
18
19
  - If something fails, read the error and fix the real cause instead of retrying blindly.
19
20
  - Don't write insecure code (injection, XSS, path traversal, etc.); fix it if you do.
20
- - Confirm before irreversible or shared-system actions (deleting, force-push, sending, posting). Local edits and tests are fine to run freely.
21
+ - Confirm before irreversible or shared-system actions (deleting, force-push, sending, posting); never commit unless explicitly asked. Local edits and tests are fine to run freely.
21
22
 
22
23
  # Tools
23
24
  - Use the dedicated tool for reading, editing, searching, and running commands rather than ad-hoc shell.
24
25
  - Batch independent tool calls together.
25
26
 
26
27
  # Output
27
- - Be terse. Lead with the answer or the change. No filler, no emojis unless asked.
28
+ - Be terse: answer in fewer than 4 lines unless the user asks for detail one-word answers are fine.
29
+ - No preamble or postamble ("Here is what I will do", "I have now completed"). Lead with the answer or the change. No filler, no emojis unless asked.
28
30
  - Reference code as `file_path:line_number`.
29
31
  - Reply in the user's language (`${environment.lang}` when unclear).
30
32
 
@@ -16,19 +16,24 @@ IMPORTANT: Never generate or guess URLs unless you are confident they help the u
16
16
  - Do not propose changes to code you have not read. Read a file before modifying it, and understand the surrounding conventions before adding to them.
17
17
  - When an approach fails, diagnose the actual error before switching tactics. Read the message, check your assumptions, and try a targeted fix rather than repeating the same action.
18
18
  - Prefer editing an existing file over creating a new one. Do not add features, refactors, error handling, or abstractions beyond what the task requires.
19
+ - Do not add backward-compatibility code unless there is a concrete need (persisted data, shipped behavior, external consumers); if unclear, ask one short question instead of guessing.
20
+ - Never assume a library or framework is available — check the project's manifest (package.json, cargo.toml, and the like) or neighboring files before using it.
19
21
  - Be careful not to introduce security vulnerabilities (injection, XSS, SSRF, path traversal, and the rest of the OWASP top 10). If you notice insecure code you wrote, fix it immediately.
20
22
  - Verify your work: run the project's tests, type checks, or the affected code path before claiming a change is complete.
23
+ - Persist until the task is handled end to end: do not stop at analysis or a partial fix; carry the change through implementation and verification before reporting back.
21
24
 
22
25
  # Using tools
23
26
  - Prefer the dedicated tool for each job (reading files, editing files, searching contents, running commands) over ad-hoc shell equivalents, so the user can follow your work.
24
27
  - When there are no dependencies between calls, issue independent tool calls together rather than serially.
25
28
  - Track multi-step work explicitly and mark each step done as you finish it.
29
+ - Tool results and user messages may include <system-reminder> tags. They carry information from the system, not from the user.
26
30
 
27
31
  # Executing actions with care
28
- 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, resetting, sending messages, posting to external services — confirm with the user first. Investigate unexpected files, branches, or configuration before overwriting them.
32
+ 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, resetting, sending messages, posting to external services — confirm with the user first. Never commit or push unless the user explicitly asks. Never revert or overwrite changes you did not make — the worktree may contain the user's concurrent edits. Investigate unexpected files, branches, or configuration before overwriting them.
29
33
 
30
34
  # Tone and style
31
35
  - Keep text output brief and direct. Lead with the answer or action, not the reasoning. Skip filler and preamble.
36
+ - Never use Bash commands or code comments as a way to talk to the user; your text output is the only channel.
32
37
  - Only use emojis if the user explicitly requests them.
33
38
  - When referencing code, use the `file_path:line_number` pattern so the user can navigate to it.
34
39
  - Respond in the user's language when it is clear from their messages or the `${environment.lang}` locale.
@@ -6,7 +6,7 @@
6
6
  "id": "deepseek-v4-pro",
7
7
  "title": "DeepSeek V4 Pro",
8
8
  "file": "deepseek-v4-pro.md",
9
- "description": "Thorough coding agent tuned for DeepSeek V4 Pro: careful reasoning, tracked multi-step work, verify-before-done.",
9
+ "description": "Thorough coding agent tuned for DeepSeek V4 Pro: careful reasoning, end-to-end persistence, tracked multi-step work, verify-before-done.",
10
10
  "match": "deepseek-v4-pro",
11
11
  "defaultMode": "override"
12
12
  },
@@ -14,7 +14,7 @@
14
14
  "id": "deepseek-v4-flash",
15
15
  "title": "DeepSeek V4 Flash",
16
16
  "file": "deepseek-v4-flash.md",
17
- "description": "Terse, action-biased prompt tuned for the fast DeepSeek V4 Flash model.",
17
+ "description": "Terse, action-biased prompt tuned for the fast DeepSeek V4 Flash model: few-line answers, smallest change that works.",
18
18
  "match": "deepseek-v4-flash",
19
19
  "defaultMode": "override"
20
20
  },
@@ -22,7 +22,7 @@
22
22
  "id": "GLM-5.2",
23
23
  "title": "GLM-5.2",
24
24
  "file": "GLM-5.2.md",
25
- "description": "Balanced software-engineering agent prompt tuned for GLM-5.2.",
25
+ "description": "Balanced software-engineering agent prompt tuned for GLM-5.2: action-default, changes through tools, parallel tool calls.",
26
26
  "match": "glm-5.2",
27
27
  "defaultMode": "override"
28
28
  },
@@ -30,9 +30,17 @@
30
30
  "id": "Qwen-3.7-Max",
31
31
  "title": "Qwen 3.7 Max",
32
32
  "file": "Qwen-3.7-Max.md",
33
- "description": "Thorough coding agent prompt tuned for Qwen 3.7 Max.",
33
+ "description": "Thorough coding agent prompt tuned for Qwen 3.7 Max: minimal-change discipline and persistence.",
34
34
  "match": "qwen-3.7-max",
35
35
  "defaultMode": "override"
36
+ },
37
+ {
38
+ "id": "kimi-k2.7-code",
39
+ "title": "Kimi K2.7 Code",
40
+ "file": "kimi-k2.7-code.md",
41
+ "description": "Coding agent prompt tuned for Kimi K2.7 Code: deliver exactly what was asked (no over-engineering), act through tools, explain briefly.",
42
+ "match": "kimi-k2.7-code",
43
+ "defaultMode": "override"
36
44
  }
37
45
  ]
38
46
  }
@@ -0,0 +1,69 @@
1
+ <!--
2
+ Preset: kimi-k2.7-code (category: Global)
3
+ Self-contained template: a tuned preamble plus its own dynamic sections
4
+ (a boundary marker, an OS-only # Environment, and a verbatim # Memory; no Git).
5
+ Edit this file directly. Tuned for Kimi K2.7 Code: the model's documented
6
+ failure mode is over-engineering and over-explaining, so scope discipline
7
+ carries the single emphatic line.
8
+ -->
9
+
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
+
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
+ 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
+
15
+ # Doing tasks
16
+ - Read the relevant files before acting or answering; ground every claim and change in code you have actually looked at.
17
+ - When a request could be read either as a question or as a change to make, treat it as a task and carry it out. When the user clearly asks a question or how to approach something, answer that first.
18
+ - Deliver exactly what was asked and nothing more: no unrequested CLI wrappers, configuration options, logging, progress output, or abstractions. This is very important to your performance.
19
+ - Never assume a library or framework is available — check the project's manifest or neighboring files before using it.
20
+ - Do not introduce security vulnerabilities (injection, XSS, path traversal, and the rest of the OWASP top 10); fix insecure code you write immediately.
21
+ - Iterate to green: run the relevant tests or code path, read the failure, fix the cause, and run again.
22
+ - When an approach is blocked, try a different one before handing the problem back to the user.
23
+
24
+ # Using tools
25
+ - A change shown only in your reply does not exist on disk — create and edit files with tools, never by pasting code into the conversation.
26
+ - Do not narrate tool calls; the calls themselves show the user what you are doing.
27
+ - Send independent tool calls together in one response instead of one at a time.
28
+ - Track multi-step work explicitly and mark each step done as you finish it.
29
+ - Tool results and user messages may include <system-reminder> tags. They carry information from the system, not from the user.
30
+
31
+ # Executing actions with care
32
+ 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.
33
+
34
+ # Tone and style
35
+ - Be thorough in your actions, not in your explanations: report what changed and where, and stop.
36
+ - Keep text output brief and direct; lead with the answer or action. No filler, and no emojis unless the user asks.
37
+ - Reference code with the `file_path:line_number` pattern.
38
+ - Always respond in the same language as the user, using the `${environment.lang}` locale when the language is not otherwise clear.
39
+
40
+ __SYSTEM_PROMPT_DYNAMIC_BOUNDARY__
41
+
42
+ # Environment
43
+ - Platform: ${os.platform}
44
+ - OS Version: ${os.version}
45
+ - Architecture: ${os.arch}
46
+ - Shell: ${os.shell}
47
+
48
+ # Memory
49
+
50
+ You have a persistent file-based memory at `${memory.dir}`. This directory already exists — write to it directly with the Write tool (do not run mkdir or check for its existence). Each memory is one file holding one fact, with frontmatter:
51
+
52
+ ```markdown
53
+ ---
54
+ name: <short-kebab-case-slug>
55
+ description: <one-line summary — used to decide relevance during recall>
56
+ metadata:
57
+ type: user | feedback | project | reference
58
+ ---
59
+
60
+ <the fact; for feedback/project, follow with **Why:** and **How to apply:** lines. Link related memories with [[their-name]].>
61
+ ```
62
+
63
+ In the body, link to related memories with `[[name]]`, where `name` is the other memory's `name:` slug. Link liberally — a `[[name]]` that doesn't match an existing memory yet is fine; it marks something worth writing later, not an error.
64
+
65
+ `user` — who the user is (role, expertise, preferences). `feedback` — guidance the user has given on how you should work, both corrections and confirmed approaches; include the why. `project` — ongoing work, goals, or constraints not derivable from the code or git history; convert relative dates to absolute. `reference` — pointers to external resources (URLs, dashboards, tickets).
66
+
67
+ After writing the file, add a one-line pointer in `MEMORY.md` (`- [Title](file.md) — hook`). `MEMORY.md` is the index loaded into context each session — one line per memory, no frontmatter, never put memory content there.
68
+
69
+ Before saving, check for an existing file that already covers it — update that file rather than creating a duplicate; delete memories that turn out to be wrong. Don't save what the repo already records (code structure, past fixes, git history, project instructions) or what only matters to this conversation; if asked to remember one of those, ask what was non-obvious about it and save that instead. Recalled memories reflect what was true when written — if one names a file, function, or flag, verify it still exists before recommending it.
@@ -0,0 +1,113 @@
1
+ # متغيرات systemPromptModel.md
2
+
3
+ يوثق هذا الملف فقط المتغيرات في `systemPromptModel.md` التي يجب حلها في وقت التشغيل. يتم حل كل متغير ورقي إلى سلسلة أو رقم أو سلسلة فارغة `""`؛ عند عدم إمكانية الحصول على قيمة، يتم الرجوع إليها بشكل موحد إلى سلسلة فارغة.
4
+
5
+ ## بيئة مساحة العمل والمستخدم
6
+
7
+ | Variable | Description | Example |
8
+ |---|---|---|
9
+ | `${environment.cwd}` | دليل العمل الأساسي الحالي. | `/Users/sky/claude-code` |
10
+ | `${environment.originalCwd}` | دليل العمل الأصلي عند بدء العملية/الجلسة. | `/Users/sky/claude-code` |
11
+ | `${environment.home}` | دليل منزل المستخدم، يُستخدم لحل `~`. | `/Users/sky` |
12
+ | `${environment.user}` | اسم المستخدم الحالي في النظام. | `sky` |
13
+ | `${environment.workspaceRoots}` | جذور مساحة العمل للجلسة الحالية؛ قد تُعرض كسلسلة مفصولة بأسطر جديدة. | `/Users/sky/claude-code` |
14
+ | `${environment.path}` | المسار الحالي للعملية. | `/opt/homebrew/bin:/usr/bin:/bin` |
15
+ | `${environment.lang}` | الإعدادات المحلية الحالية أو بيئة اللغة. | `zh_CN.UTF-8` |
16
+
17
+ ## نظام التشغيل
18
+
19
+ | Variable | Description | Example |
20
+ |---|---|---|
21
+ | `${os.platform}` | المنصة كما يحددها Node.js. | `darwin` |
22
+ | `${os.type}` | نوع نظام التشغيل. | `Darwin` |
23
+ | `${os.arch}` | بنية المعالج. | `arm64` |
24
+ | `${os.shell}` | الصدفة الحالية. | `/bin/zsh` |
25
+ | `${os.version}` | وصف إصدار نظام التشغيل. | `Darwin Kernel Version ...` |
26
+ | `${os.release}` | إصدار نظام التشغيل. | `24.5.0` |
27
+ | `${os.hostname}` | اسم المضيف الحالي. | `MacBook-Pro.local` |
28
+ | `${os.availableParallelism}` | التوازي المتاح. | `10` |
29
+ | `${os.totalMemory}` | إجمالي ذاكرة النظام بالبايتات. | `34359738368` |
30
+ | `${os.freeMemory}` | الذاكرة المجانية بالبايتات. | `8589934592` |
31
+ | `${os.uptime}` | وقت تشغيل النظام بالثواني. | `123456` |
32
+
33
+ ## بيئة تشغيل Node.js
34
+
35
+ | Variable | Description | Example |
36
+ |---|---|---|
37
+ | `${runtime.nodeVersion}` | إصدار Node.js الحالي. | `v24.14.0` |
38
+ | `${runtime.execPath}` | المسار إلى ملف تنفيذ Node.js الحالي. | `/opt/homebrew/bin/node` |
39
+ | `${runtime.pid}` | معرّف العملية الحالي. | `12345` |
40
+ | `${runtime.ppid}` | معرّف العملية الأبوية. | `1234` |
41
+
42
+ ## الوقت
43
+
44
+ | Variable | Description | Example |
45
+ |---|---|---|
46
+ | `${time.current}` | سلسلة الوقت المحلي الحالي. | `Thu Jul 09 2026 18:22:09 GMT+0800 (China Standard Time)` |
47
+ | `${time.iso}` | الوقت الحالي بصيغة ISO. | `2026-07-09T10:22:09.000Z` |
48
+ | `${time.date}` | التاريخ المحلي الحالي. | `2026-07-09` |
49
+ | `${time.timezone}` | المنطقة الزمنية للنظام الحالية. | `Asia/Shanghai` |
50
+
51
+ ## الأذونات والحماية
52
+
53
+ | Variable | Description | Example |
54
+ |---|---|---|
55
+ | `${permissions.mode}` | وضع إذن الأداة الحالي. | `default` |
56
+ | `${permissions.approvalsReviewer}` | سياسة الموافقة الحالية أو وضع المراجع. | `auto_review` |
57
+ | `${sandbox.mode}` | وضع الحماية لنظام الملفات. | `workspace-write` |
58
+ | `${sandbox.networkAccess}` | حالة الوصول إلى الشبكة. | `enabled` |
59
+ | `${sandbox.writableRoots}` | الأدلة التي تسمح الحماية بالكتابة إليها؛ قد تُعرض كسلسلة مفصولة بأسطر جديدة. | `/Users/sky/Documents/Playground` |
60
+
61
+ ## المحطة الطرفية
62
+
63
+ | Variable | Description | Example |
64
+ |---|---|---|
65
+ | `${terminal.term}` | TERM الحالي. | `xterm-256color` |
66
+ | `${terminal.colorTerm}` | COLORTERM الحالي. | `truecolor` |
67
+ | `${terminal.columns}` | عدد أعمدة المحطة الطرفية الحالي. | `120` |
68
+ | `${terminal.rows}` | عدد صفوف المحطة الطرفية الحالي. | `40` |
69
+
70
+ ## نظام الملفات
71
+
72
+ | Variable | Description | Example |
73
+ |---|---|---|
74
+ | `${filesystem.tmpdir}` | دليل النظام المؤقت. | `/var/folders/.../T` |
75
+ | `${filesystem.pathSeparator}` | فاصل مسار الملف. | `/` |
76
+ | `${filesystem.pathDelimiter}` | فاصل إدخالات PATH. | `:` |
77
+
78
+ ## النموذج
79
+
80
+ | Variable | Description | Example |
81
+ |---|---|---|
82
+ | `${model.name}` | اسم النموذج أو معرّفه الحالي. | `claude-opus-4-6` |
83
+ | `${model.knowledgeCutoff}` | الحد الزمني الحالي لمعرفة النموذج؛ لا يمكن استخراج هذه القيمة من نظام التشغيل ويجب إدراجها عبر إعدادات خارجية أو استبدال. | `May 2025` |
84
+
85
+ ## Git
86
+
87
+ | Variable | Description | Example |
88
+ |---|---|---|
89
+ | `${git.isRepository}` | ما إذا كان الدليل الحالي داخل مستودع git كسلسلة. | `true` |
90
+ | `${git.root}` | دليل جذر مستودع git. | `/Users/sky/project` |
91
+ | `${git.branch}` | فرع git الحالي أو تجزئة HEAD المختصرة. | `main` |
92
+ | `${git.mainBranch}` | الفرع الرئيسي الافتراضي، عادةً ما يُستخدم كهدف PR أو الدمج. | `main` |
93
+ | `${git.userName}` | اسم git `user.name` الحالي. | `Sky` |
94
+ | `${git.status}` | مخرجات `git status --short`. | `M src/index.ts` |
95
+ | `${git.recentCommits}` | ملخص الالتزامات الأخيرة. | `abc1234 Fix prompt builder` |
96
+
97
+ ## الذاكرة
98
+
99
+ تصف متغيرات الذاكرة دليل الذاكرة المستمر المستند إلى الملفات. يتم حل `${memory.dir}` من استبدال `CC_MEMORY_DIR` / `CLAUDE_MEMORY_DIR` عند التعيين؛ وإلا يتم حسابه كـ `<home>/.claude/projects/<slug>/memory/`، حيث `<slug>` هو دليل العمل الأساسي مع استبدال كل حرف غير أبجدي رقمي بـ `-`. يحتوي `${memory.index}` على محتويات `MEMORY.md` داخل هذا الدليل (الفهرس المحمل في كل جلسة)، ويُبلغ `${memory.enabled}` عما إذا كانت الذاكرة متاحة. يتم تجميع الأقسام `# Memory` و `# Memory index` فقط عند تفعيل الذاكرة.
100
+
101
+ | Variable | Description | Example |
102
+ |---|---|---|
103
+ | `${memory.dir}` | دليل الذاكرة المحلول. | `/Users/sky/.claude/projects/-Users-sky-project/memory/` |
104
+ | `${memory.index}` | محتويات `MEMORY.md` أو `""` عند غيابها. | `# Memory index\n- [Commit to main](commit-to-main.md) — hook` |
105
+ | `${memory.enabled}` | ما إذا كانت الذاكرة متاحة كسلسلة. | `true` |
106
+
107
+ ## المفكرة
108
+
109
+ دليل المفكرة خاص بالجلسة ولا يعتمد على نظام التشغيل ويجب إدراجه عبر استبدال `CC_SCRATCHPAD_DIR` / `CLAUDE_SCRATCHPAD_DIR`. عند عدم التعيين، يتم الرجوع إلى `""`، والقسم `# Scratchpad Directory` محذوف من التجميع.
110
+
111
+ | Variable | Description | Example |
112
+ |---|---|---|
113
+ | `${scratchpad.dir}` | دليل مؤقت خاص بالجلسة الحالية. | `/private/tmp/claude-501/<slug>/<session>/scratchpad` |
@@ -0,0 +1,113 @@
1
+ # systemPromptModel.md variabler
2
+
3
+ Denne fil dokumenterer kun variablerne i `systemPromptModel.md`, der skal løses ved køretid. Hver bladsvariabel løses til en streng, et tal eller en tom streng `""`; når en værdi ikke kan opnås, vender den ensartet tilbage til en tom streng.
4
+
5
+ ## Arbejdsplads og brugermiljø
6
+
7
+ | Variable | Description | Example |
8
+ |---|---|---|
9
+ | `${environment.cwd}` | Aktuelt primært arbejdsmappe. | `/Users/sky/claude-code` |
10
+ | `${environment.originalCwd}` | Oprindeligt arbejdsmappe da processen/sessionen startede. | `/Users/sky/claude-code` |
11
+ | `${environment.home}` | Brugerens hjemmemappe, brugt til at løse `~`. | `/Users/sky` |
12
+ | `${environment.user}` | Aktuelt systembrutgernavn. | `sky` |
13
+ | `${environment.workspaceRoots}` | Arbejdspladser for den nuværende session; kan gengives som en linjeskilt streng. | `/Users/sky/claude-code` |
14
+ | `${environment.path}` | Aktuel proces PATH. | `/opt/homebrew/bin:/usr/bin:/bin` |
15
+ | `${environment.lang}` | Aktuelle regionindstillinger eller sprogmiljø. | `zh_CN.UTF-8` |
16
+
17
+ ## Operativsystem
18
+
19
+ | Variable | Description | Example |
20
+ |---|---|---|
21
+ | `${os.platform}` | Platform som identificeret af Node.js. | `darwin` |
22
+ | `${os.type}` | Operativsystem type. | `Darwin` |
23
+ | `${os.arch}` | CPU-arkitektur. | `arm64` |
24
+ | `${os.shell}` | Aktuel skal. | `/bin/zsh` |
25
+ | `${os.version}` | Operativsystem version beskrivelse. | `Darwin Kernel Version ...` |
26
+ | `${os.release}` | Operativsystem udgivelse. | `24.5.0` |
27
+ | `${os.hostname}` | Aktuelt værtsnavn. | `MacBook-Pro.local` |
28
+ | `${os.availableParallelism}` | Tilgængelig parallelisme. | `10` |
29
+ | `${os.totalMemory}` | Samlet systemhukommelse i bytes. | `34359738368` |
30
+ | `${os.freeMemory}` | Fri hukommelse i bytes. | `8589934592` |
31
+ | `${os.uptime}` | System oppetid i sekunder. | `123456` |
32
+
33
+ ## Node.js-køretid
34
+
35
+ | Variable | Description | Example |
36
+ |---|---|---|
37
+ | `${runtime.nodeVersion}` | Aktuel Node.js version. | `v24.14.0` |
38
+ | `${runtime.execPath}` | Sti til den aktuelle Node.js eksekverbar. | `/opt/homebrew/bin/node` |
39
+ | `${runtime.pid}` | Aktuel proces ID. | `12345` |
40
+ | `${runtime.ppid}` | Forældre proces ID. | `1234` |
41
+
42
+ ## Tid
43
+
44
+ | Variable | Description | Example |
45
+ |---|---|---|
46
+ | `${time.current}` | Aktuel lokal tidsstreng. | `Thu Jul 09 2026 18:22:09 GMT+0800 (China Standard Time)` |
47
+ | `${time.iso}` | Aktuel ISO tid. | `2026-07-09T10:22:09.000Z` |
48
+ | `${time.date}` | Aktuel lokaldato. | `2026-07-09` |
49
+ | `${time.timezone}` | Aktuelt systemtidzone. | `Asia/Shanghai` |
50
+
51
+ ## Tilladelser og sandkasse
52
+
53
+ | Variable | Description | Example |
54
+ |---|---|---|
55
+ | `${permissions.mode}` | Aktuelt værktøj tilladelses tilstand. | `default` |
56
+ | `${permissions.approvalsReviewer}` | Aktuel godkendelsespolitik eller anmeldertilstand. | `auto_review` |
57
+ | `${sandbox.mode}` | Filsystem sandkasse tilstand. | `workspace-write` |
58
+ | `${sandbox.networkAccess}` | Netværksadgangs status. | `enabled` |
59
+ | `${sandbox.writableRoots}` | Mapper som sandkassen tillader skrivning til; kan gengives som en linjeskilt streng. | `/Users/sky/Documents/Playground` |
60
+
61
+ ## Terminal
62
+
63
+ | Variable | Description | Example |
64
+ |---|---|---|
65
+ | `${terminal.term}` | Aktuel TERM. | `xterm-256color` |
66
+ | `${terminal.colorTerm}` | Aktuel COLORTERM. | `truecolor` |
67
+ | `${terminal.columns}` | Aktuelt terminal kolonne antal. | `120` |
68
+ | `${terminal.rows}` | Aktuelt terminal rækkeantal. | `40` |
69
+
70
+ ## Filsystem
71
+
72
+ | Variable | Description | Example |
73
+ |---|---|---|
74
+ | `${filesystem.tmpdir}` | System midlertidigt mappe. | `/var/folders/.../T` |
75
+ | `${filesystem.pathSeparator}` | Fil sti separator. | `/` |
76
+ | `${filesystem.pathDelimiter}` | PATH indgangs afgrænser. | `:` |
77
+
78
+ ## Model
79
+
80
+ | Variable | Description | Example |
81
+ |---|---|---|
82
+ | `${model.name}` | Aktuelt model navn eller ID. | `claude-opus-4-6` |
83
+ | `${model.knowledgeCutoff}` | Aktuel model viden afskæring; denne værdi kan ikke udledes fra operativsystemet og skal injiceres via ekstern konfiguration eller en tilsidesættelse. | `May 2025` |
84
+
85
+ ## Git
86
+
87
+ | Variable | Description | Example |
88
+ |---|---|---|
89
+ | `${git.isRepository}` | Hvorvidt det aktuelle mappe er inden i et git arkiv, som en streng. | `true` |
90
+ | `${git.root}` | Git arkiv rod mappe. | `/Users/sky/project` |
91
+ | `${git.branch}` | Aktuel git gren eller kort HEAD hash. | `main` |
92
+ | `${git.mainBranch}` | Standard hoved gren, typisk brugt som PR eller sammensmeltnings mål. | `main` |
93
+ | `${git.userName}` | Aktuel git `user.name`. | `Sky` |
94
+ | `${git.status}` | Output af `git status --short`. | `M src/index.ts` |
95
+ | `${git.recentCommits}` | Oversigt over seneste commits. | `abc1234 Fix prompt builder` |
96
+
97
+ ## Hukommelse
98
+
99
+ Hukommelsesvariablerne beskriver den vedvarende filbaserede hukommelsesmappe. `${memory.dir}` løses fra `CC_MEMORY_DIR` / `CLAUDE_MEMORY_DIR` tilsidesættelse når den er indstillet; ellers beregnes det som `<home>/.claude/projects/<slug>/memory/`, hvor `<slug>` er det primære arbejdsmappe med hver ikke-alfanumerisk tegn erstattet med `-`. `${memory.index}` indeholder indholdet af `MEMORY.md` i det mappe (indekset indlæst hver session), og `${memory.enabled}` rapporterer hvorvidt hukommelse er tilgængelig. Afsnittene `# Memory` og `# Memory index` samles kun når hukommelsen er aktiveret.
100
+
101
+ | Variable | Description | Example |
102
+ |---|---|---|
103
+ | `${memory.dir}` | Løst hukommelsesmappe. | `/Users/sky/.claude/projects/-Users-sky-project/memory/` |
104
+ | `${memory.index}` | Indhold af `MEMORY.md`, eller `""` når fraværende. | `# Memory index\n- [Commit to main](commit-to-main.md) — hook` |
105
+ | `${memory.enabled}` | Hvorvidt hukommelse er tilgængelig, som en streng. | `true` |
106
+
107
+ ## Notepad
108
+
109
+ Notepad mappe er session-specifik og kan ikke udledes fra operativsystemet; det skal injiceres via `CC_SCRATCHPAD_DIR` / `CLAUDE_SCRATCHPAD_DIR` tilsidesættelse. Når indstillet, falder det tilbage til `""`, og afsnittet `# Scratchpad Directory` udelades fra samlingen.
110
+
111
+ | Variable | Description | Example |
112
+ |---|---|---|
113
+ | `${scratchpad.dir}` | Session-specifik midlertidig mappe. | `/private/tmp/claude-501/<slug>/<session>/scratchpad` |