aico-cli 2.0.37 → 2.0.40

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.
@@ -14,7 +14,7 @@ import { join, dirname, basename } from 'pathe';
14
14
  import { fileURLToPath } from 'node:url';
15
15
  import { EventEmitter } from 'node:events';
16
16
 
17
- const version = "2.0.37";
17
+ const version = "2.0.40";
18
18
 
19
19
  function displayBanner(subtitle) {
20
20
  const defaultSubtitle = "\u4E00\u952E\u914D\u7F6E\u4F60\u7684\u5F00\u53D1\u73AF\u5883";
@@ -4703,7 +4703,7 @@ const DEFAULT_FILE_COPY_CONFIGS = [
4703
4703
  destination: join(CLAUDE_DIR, "personality.md"),
4704
4704
  type: "file",
4705
4705
  options: {
4706
- mergeStrategy: "merge",
4706
+ mergeStrategy: "copy",
4707
4707
  backupBeforeCopy: true,
4708
4708
  deleteBeforeCopy: true
4709
4709
  }
@@ -4713,7 +4713,7 @@ const DEFAULT_FILE_COPY_CONFIGS = [
4713
4713
  destination: join(CLAUDE_DIR, "language.md"),
4714
4714
  type: "file",
4715
4715
  options: {
4716
- mergeStrategy: "merge",
4716
+ mergeStrategy: "copy",
4717
4717
  backupBeforeCopy: true,
4718
4718
  deleteBeforeCopy: true
4719
4719
  }
@@ -4723,7 +4723,7 @@ const DEFAULT_FILE_COPY_CONFIGS = [
4723
4723
  destination: join(CLAUDE_DIR, "CLAUDE.md"),
4724
4724
  type: "file",
4725
4725
  options: {
4726
- mergeStrategy: "merge",
4726
+ mergeStrategy: "copy",
4727
4727
  backupBeforeCopy: true,
4728
4728
  deleteBeforeCopy: true
4729
4729
  }
@@ -4733,7 +4733,7 @@ const DEFAULT_FILE_COPY_CONFIGS = [
4733
4733
  destination: join(CLAUDE_DIR, "settings.json"),
4734
4734
  type: "file",
4735
4735
  options: {
4736
- mergeStrategy: "merge",
4736
+ mergeStrategy: "copy",
4737
4737
  backupBeforeCopy: true,
4738
4738
  deleteBeforeCopy: true
4739
4739
  }
@@ -4742,10 +4742,7 @@ const DEFAULT_FILE_COPY_CONFIGS = [
4742
4742
  function getFileCopyConfigsForTarget(target = "claude") {
4743
4743
  const targetDir = getTargetDir(target);
4744
4744
  const targetConfig = TARGET_CONFIGS[target];
4745
- const fileRenames = targetConfig.fileRenames || {};
4746
- const getDestFileName = (sourceFileName) => {
4747
- return fileRenames[sourceFileName] || sourceFileName;
4748
- };
4745
+ const templateSubDir = target;
4749
4746
  return [
4750
4747
  {
4751
4748
  source: "templates/agents",
@@ -4792,7 +4789,7 @@ function getFileCopyConfigsForTarget(target = "claude") {
4792
4789
  destination: join(targetDir, "personality.md"),
4793
4790
  type: "file",
4794
4791
  options: {
4795
- mergeStrategy: "merge",
4792
+ mergeStrategy: "copy",
4796
4793
  backupBeforeCopy: true,
4797
4794
  deleteBeforeCopy: true
4798
4795
  }
@@ -4802,27 +4799,29 @@ function getFileCopyConfigsForTarget(target = "claude") {
4802
4799
  destination: join(targetDir, "language.md"),
4803
4800
  type: "file",
4804
4801
  options: {
4805
- mergeStrategy: "merge",
4802
+ mergeStrategy: "copy",
4806
4803
  backupBeforeCopy: true,
4807
4804
  deleteBeforeCopy: true
4808
4805
  }
4809
4806
  },
4807
+ // 使用目标特定的主配置文件 (CLAUDE.md 或 CODEBUDDY.md)
4810
4808
  {
4811
- source: "templates/CLAUDE.md",
4812
- destination: join(targetDir, getDestFileName("CLAUDE.md")),
4809
+ source: `templates/${templateSubDir}/${targetConfig.mainConfigFile}`,
4810
+ destination: join(targetDir, targetConfig.mainConfigFile),
4813
4811
  type: "file",
4814
4812
  options: {
4815
- mergeStrategy: "merge",
4813
+ mergeStrategy: "copy",
4816
4814
  backupBeforeCopy: true,
4817
4815
  deleteBeforeCopy: true
4818
4816
  }
4819
4817
  },
4818
+ // 使用目标特定的 settings.json,直接替换而不是合并
4820
4819
  {
4821
- source: "templates/settings.json",
4820
+ source: `templates/${templateSubDir}/settings.json`,
4822
4821
  destination: join(targetDir, "settings.json"),
4823
4822
  type: "file",
4824
4823
  options: {
4825
- mergeStrategy: "merge",
4824
+ mergeStrategy: "copy",
4826
4825
  backupBeforeCopy: true,
4827
4826
  deleteBeforeCopy: true
4828
4827
  }
@@ -5004,6 +5003,12 @@ function mergeSettingsFile(templatePath, targetPath) {
5004
5003
  existingSettings.permissions?.allow
5005
5004
  );
5006
5005
  }
5006
+ if (templateSettings.hooks) {
5007
+ mergedSettings.hooks = templateSettings.hooks;
5008
+ }
5009
+ if (templateSettings.statusLine) {
5010
+ mergedSettings.statusLine = templateSettings.statusLine;
5011
+ }
5007
5012
  writeJsonConfig(targetPath, mergedSettings);
5008
5013
  } catch (error) {
5009
5014
  console.error("\u5408\u5E76\u8BBE\u7F6E\u5931\u8D25", error);
@@ -5099,7 +5104,7 @@ class ConfigInstaller extends AbstractInstaller {
5099
5104
  }
5100
5105
  this.copyConfigFilesWithOptions(options);
5101
5106
  const apiConfig = options.configData?.apiConfig;
5102
- if (apiConfig) {
5107
+ if (apiConfig && target !== "codebuddy") {
5103
5108
  configureApi(apiConfig, target);
5104
5109
  }
5105
5110
  const targetName = TARGET_CONFIGS[target].dirName;
@@ -5113,29 +5118,19 @@ class ConfigInstaller extends AbstractInstaller {
5113
5118
  }
5114
5119
  /**
5115
5120
  * 使用可配置的文件复制机制
5121
+ * 注意:目标特定的文件(如 settings.json, CODEBUDDY.md)已经在 getFileCopyConfigs 中配置
5122
+ * 不再复制整个 templates 目录,避免覆盖目标特定文件
5116
5123
  */
5117
5124
  copyConfigFilesWithOptions(options) {
5118
5125
  const target = this.getTarget();
5119
- const targetDir = this.getTargetDirectory();
5120
- const customConfigs = [
5121
- ...this.getFileCopyConfigs(),
5122
- {
5123
- source: "templates",
5124
- destination: targetDir,
5125
- type: "directory",
5126
- options: {
5127
- filter: (path) => !path.includes("/backup"),
5128
- mergeStrategy: "copy"
5129
- }
5130
- }
5131
- ];
5126
+ const configs = this.getFileCopyConfigs();
5132
5127
  if (options.onlyMdFiles) {
5133
- const filteredConfigs = customConfigs.filter(
5128
+ const filteredConfigs = configs.filter(
5134
5129
  (config) => config.source.endsWith(".md") || config.type === "directory"
5135
5130
  );
5136
5131
  copyConfigFilesWithConfig(filteredConfigs, target);
5137
5132
  } else {
5138
- copyConfigFilesWithConfig(customConfigs, target);
5133
+ copyConfigFilesWithConfig(configs, target);
5139
5134
  }
5140
5135
  }
5141
5136
  /**
@@ -5144,7 +5139,7 @@ class ConfigInstaller extends AbstractInstaller {
5144
5139
  async applyCompanyConfig(silent = false) {
5145
5140
  try {
5146
5141
  const apiConfig = {
5147
- url: "http://11.0.166.20:13456",
5142
+ url: "http://11.0.166.23:13456",
5148
5143
  key: "sk-4730d06849b5fea00f551bd60a0902e1"
5149
5144
  };
5150
5145
  const configuredApi = configureApi(apiConfig, this.getTarget());
@@ -5361,7 +5356,7 @@ class ConfigCheckerInstaller extends AbstractInstaller {
5361
5356
  if (!baseUrl) {
5362
5357
  return "none";
5363
5358
  }
5364
- if (baseUrl.includes("11.0.166.20")) {
5359
+ if (baseUrl.includes("11.0.166.23")) {
5365
5360
  return "company";
5366
5361
  }
5367
5362
  return "personal";
@@ -6017,7 +6012,7 @@ class InstallationComposer {
6017
6012
  configData: {
6018
6013
  ...options.configData,
6019
6014
  apiConfig: {
6020
- url: "http://11.0.166.20:13456",
6015
+ url: "http://11.0.166.23:13456",
6021
6016
  key: "sk-4730d06849b5fea00f551bd60a0902e1"
6022
6017
  }
6023
6018
  }
@@ -6031,16 +6026,16 @@ class InstallationComposer {
6031
6026
  const configInstaller = new ConfigInstaller(this.context);
6032
6027
  await configInstaller.applyCompanyConfig();
6033
6028
  updateClaudeConfigEnv({
6034
- ANTHROPIC_BASE_URL: "http://11.0.166.20:13456",
6029
+ ANTHROPIC_BASE_URL: "http://11.0.166.23:13456",
6035
6030
  ANTHROPIC_AUTH_TOKEN: "sk-4730d06849b5fea00f551bd60a0902e1"
6036
6031
  }, "claude");
6037
6032
  await this.installToTarget("codebuddy", companySteps, configOptions, {
6038
- ANTHROPIC_BASE_URL: "http://11.0.166.20:13456",
6033
+ ANTHROPIC_BASE_URL: "http://11.0.166.23:13456",
6039
6034
  ANTHROPIC_AUTH_TOKEN: "sk-4730d06849b5fea00f551bd60a0902e1"
6040
6035
  });
6041
6036
  this.installCodebuddyCodeSilently();
6042
6037
  this.updateGlobalConfig(true);
6043
- spinner.succeed("\u516C\u53F8\u914D\u7F6E\u5B89\u88C5\u5B8C\u6210 (claude + codebuddy)");
6038
+ spinner.succeed("\u516C\u53F8\u914D\u7F6E\u5B89\u88C5\u5B8C\u6210");
6044
6039
  } catch (error) {
6045
6040
  spinner.fail("\u516C\u53F8\u914D\u7F6E\u5B89\u88C5\u5931\u8D25");
6046
6041
  throw error;
@@ -6088,7 +6083,7 @@ class InstallationComposer {
6088
6083
  });
6089
6084
  this.installCodebuddyCodeSilently();
6090
6085
  this.updateGlobalConfig(true);
6091
- spinner.succeed("\u4E2A\u4EBA\u914D\u7F6E\u5B89\u88C5\u5B8C\u6210 (claude + codebuddy)");
6086
+ spinner.succeed("\u4E2A\u4EBA\u914D\u7F6E\u5B89\u88C5\u5B8C\u6210");
6092
6087
  } catch (error) {
6093
6088
  spinner.fail("\u4E2A\u4EBA\u914D\u7F6E\u5B89\u88C5\u5931\u8D25");
6094
6089
  throw error;
@@ -6136,7 +6131,9 @@ class InstallationComposer {
6136
6131
  () => new MCPInstaller(targetContext)
6137
6132
  );
6138
6133
  await targetExecutor.executeBatch(steps, options);
6139
- updateClaudeConfigEnv(envVars, target);
6134
+ if (target !== "codebuddy") {
6135
+ updateClaudeConfigEnv(envVars, target);
6136
+ }
6140
6137
  }
6141
6138
  /**
6142
6139
  * 配置 CCR 用于个人设置
package/dist/index.d.mts CHANGED
@@ -113,7 +113,7 @@ interface FileCopyConfig {
113
113
  declare const DEFAULT_FILE_COPY_CONFIGS: FileCopyConfig[];
114
114
  /**
115
115
  * 根据目标生成文件复制配置
116
- * 支持文件重命名(如 CLAUDE.md -> CODEBUDDY.md)
116
+ * 使用目标特定的模板目录 (templates/claude templates/codebuddy)
117
117
  */
118
118
  declare function getFileCopyConfigsForTarget(target?: InstallationTarget): FileCopyConfig[];
119
119
  declare function copyConfigFilesWithConfig(configs?: FileCopyConfig[], target?: InstallationTarget): void;
@@ -123,6 +123,7 @@ declare function updateDefaultModel(model: 'opus' | 'sonnet'): void;
123
123
  /**
124
124
  * Merge settings.json intelligently
125
125
  * Preserves user's environment variables and custom configurations
126
+ * Always uses template's hooks and statusLine to ensure correct paths
126
127
  */
127
128
  declare function mergeSettingsFile(templatePath: string, targetPath: string): void;
128
129
  /**
package/dist/index.d.ts CHANGED
@@ -113,7 +113,7 @@ interface FileCopyConfig {
113
113
  declare const DEFAULT_FILE_COPY_CONFIGS: FileCopyConfig[];
114
114
  /**
115
115
  * 根据目标生成文件复制配置
116
- * 支持文件重命名(如 CLAUDE.md -> CODEBUDDY.md)
116
+ * 使用目标特定的模板目录 (templates/claude templates/codebuddy)
117
117
  */
118
118
  declare function getFileCopyConfigsForTarget(target?: InstallationTarget): FileCopyConfig[];
119
119
  declare function copyConfigFilesWithConfig(configs?: FileCopyConfig[], target?: InstallationTarget): void;
@@ -123,6 +123,7 @@ declare function updateDefaultModel(model: 'opus' | 'sonnet'): void;
123
123
  /**
124
124
  * Merge settings.json intelligently
125
125
  * Preserves user's environment variables and custom configurations
126
+ * Always uses template's hooks and statusLine to ensure correct paths
126
127
  */
127
128
  declare function mergeSettingsFile(templatePath: string, targetPath: string): void;
128
129
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aico-cli",
3
- "version": "2.0.37",
3
+ "version": "2.0.40",
4
4
  "packageManager": "pnpm@9.15.9",
5
5
  "description": "AI CLI",
6
6
  "repository": {
@@ -0,0 +1,2 @@
1
+ @language.md
2
+ @personality.md
@@ -0,0 +1,98 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
+ "env": {
4
+ "DISABLE_TELEMETRY": "1",
5
+ "DISABLE_ERROR_REPORTING": "1",
6
+ "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
7
+ "ANTHROPIC_BASE_URL": "http://127.0.0.1:3456",
8
+ "ANTHROPIC_AUTH_TOKEN": "sk-aico-x-ccr"
9
+ },
10
+ "includeCoAuthoredBy": false,
11
+ "permissions": {
12
+ "allow": [
13
+ "Bash",
14
+ "LS",
15
+ "Read",
16
+ "Agent",
17
+ "Write",
18
+ "Edit",
19
+ "MultiEdit",
20
+ "Glob",
21
+ "Grep",
22
+ "WebFetch",
23
+ "WebSearch",
24
+ "TodoWrite",
25
+ "NotebookRead",
26
+ "NotebookEdit",
27
+ "mcp__intention-coding",
28
+ "mcp__context7",
29
+ "mcp__open-websearch",
30
+ "mcp__chrome-devtools"
31
+ ],
32
+ "deny": []
33
+ },
34
+ "hooks": {
35
+ "PreToolUse": [
36
+ {
37
+ "matcher": "Edit|Write",
38
+ "hooks": [
39
+ {
40
+ "type": "command",
41
+ "command": "npx tsx ~/.claude/hooks/scripts/PreToolUse/pre-tool-use.ts",
42
+ "timeout": 10
43
+ }
44
+ ]
45
+ }
46
+ ],
47
+ "PostToolUse": [
48
+ {
49
+ "matcher": "Edit|Write",
50
+ "hooks": [
51
+ {
52
+ "type": "command",
53
+ "command": "npx tsx ~/.claude/hooks/scripts/PostToolUse/post-tool-use.ts",
54
+ "timeout": 10
55
+ }
56
+ ]
57
+ }
58
+ ],
59
+ "UserPromptSubmit": [
60
+ {
61
+ "hooks": [
62
+ {
63
+ "type": "command",
64
+ "command": "npx tsx ~/.claude/hooks/scripts/UserPromptSubmit/user-prompt-submit.ts",
65
+ "timeout": 10
66
+ }
67
+ ]
68
+ }
69
+ ],
70
+ "Notification": [
71
+ {
72
+ "hooks": [
73
+ {
74
+ "type": "command",
75
+ "command": "npx tsx ~/.claude/hooks/scripts/Notification/notification.ts",
76
+ "timeout": 10
77
+ }
78
+ ]
79
+ }
80
+ ],
81
+ "Stop": [
82
+ {
83
+ "hooks": [
84
+ {
85
+ "type": "command",
86
+ "command": "npx tsx ~/.claude/hooks/scripts/Stop/stop.ts",
87
+ "timeout": 10
88
+ }
89
+ ]
90
+ }
91
+ ]
92
+ },
93
+ "statusLine": {
94
+ "type": "command",
95
+ "command": "~/.claude/ccline/ccline",
96
+ "padding": 0
97
+ }
98
+ }
@@ -0,0 +1,2 @@
1
+ @language.md
2
+ @personality.md
@@ -0,0 +1,128 @@
1
+ {
2
+ "sandbox": {
3
+ "enabled": true,
4
+ "autoAllowBashIfSandboxed": true,
5
+ "network": {
6
+ "allowedDomains": [],
7
+ "deniedDomains": [],
8
+ "allowLocalBinding": false,
9
+ "allowUnixSockets": [],
10
+ "allowAllUnixSockets": false
11
+ },
12
+ "filesystem": {
13
+ "denyRead": [
14
+ "~/.ssh",
15
+ "~/.aws",
16
+ "~/.gcp"
17
+ ],
18
+ "allowWrite": [
19
+ ".",
20
+ "/dev/stdout",
21
+ "/dev/stderr",
22
+ "/dev/null",
23
+ "/dev/tty",
24
+ "/dev/dtracehelper",
25
+ "/dev/autofs_nowait",
26
+ "/tmp/codebuddy",
27
+ "/private/tmp/codebuddy",
28
+ "~/.npm/_logs",
29
+ "~/.codebuddy/debug",
30
+ "~/.codebuddy/statsig"
31
+ ],
32
+ "denyWrite": []
33
+ },
34
+ "excludedCommands": [],
35
+ "allowUnsandboxedCommands": true,
36
+ "enableWeakerNestedSandbox": false
37
+ },
38
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
39
+ "includeCoAuthoredBy": false,
40
+ "permissions": {
41
+ "allow": [
42
+ "Bash",
43
+ "LS",
44
+ "Read",
45
+ "Agent",
46
+ "Write",
47
+ "Edit",
48
+ "MultiEdit",
49
+ "Glob",
50
+ "Grep",
51
+ "WebFetch",
52
+ "WebSearch",
53
+ "TodoWrite",
54
+ "NotebookRead",
55
+ "NotebookEdit",
56
+ "mcp__intention-coding",
57
+ "mcp__context7",
58
+ "mcp__open-websearch",
59
+ "mcp__chrome-devtools"
60
+ ],
61
+ "deny": []
62
+ },
63
+ "hooks": {
64
+ "PreToolUse": [
65
+ {
66
+ "matcher": "Edit|Write",
67
+ "hooks": [
68
+ {
69
+ "type": "command",
70
+ "command": "npx tsx ~/.codebuddy/hooks/scripts/PreToolUse/pre-tool-use.ts",
71
+ "timeout": 10
72
+ }
73
+ ]
74
+ }
75
+ ],
76
+ "PostToolUse": [
77
+ {
78
+ "matcher": "Edit|Write",
79
+ "hooks": [
80
+ {
81
+ "type": "command",
82
+ "command": "npx tsx ~/.codebuddy/hooks/scripts/PostToolUse/post-tool-use.ts",
83
+ "timeout": 10
84
+ }
85
+ ]
86
+ }
87
+ ],
88
+ "UserPromptSubmit": [
89
+ {
90
+ "hooks": [
91
+ {
92
+ "type": "command",
93
+ "command": "npx tsx ~/.codebuddy/hooks/scripts/UserPromptSubmit/user-prompt-submit.ts",
94
+ "timeout": 10
95
+ }
96
+ ]
97
+ }
98
+ ],
99
+ "Notification": [
100
+ {
101
+ "hooks": [
102
+ {
103
+ "type": "command",
104
+ "command": "npx tsx ~/.codebuddy/hooks/scripts/Notification/notification.ts",
105
+ "timeout": 10
106
+ }
107
+ ]
108
+ }
109
+ ],
110
+ "Stop": [
111
+ {
112
+ "hooks": [
113
+ {
114
+ "type": "command",
115
+ "command": "npx tsx ~/.codebuddy/hooks/scripts/Stop/stop.ts",
116
+ "timeout": 10
117
+ }
118
+ ]
119
+ }
120
+ ]
121
+ },
122
+ "statusLine": {
123
+ "type": "command",
124
+ "command": "~/.codebuddy/ccline/ccline",
125
+ "padding": 0
126
+ },
127
+ "enterpriseEndpoint": "https://e.cnpc.com.cn/"
128
+ }
@@ -38,19 +38,19 @@
38
38
  "hooks": [
39
39
  {
40
40
  "type": "command",
41
- "command": "node -e \"require('child_process').execSync('npx tsx ' + require('path').join(require('os').homedir(), '.claude/hooks/scripts/PreToolUse/pre-tool-use.ts'), {stdio: 'inherit'})\"",
41
+ "command": "npx tsx ~/.claude/hooks/scripts/PreToolUse/pre-tool-use.ts",
42
42
  "timeout": 10
43
43
  }
44
44
  ]
45
45
  }
46
46
  ],
47
- "PostToolUse":[
47
+ "PostToolUse": [
48
48
  {
49
49
  "matcher": "Edit|Write",
50
50
  "hooks": [
51
51
  {
52
52
  "type": "command",
53
- "command": "node -e \"require('child_process').execSync('npx tsx ' + require('path').join(require('os').homedir(), '.claude/hooks/scripts/PostToolUse/post-tool-use.ts'), {stdio: 'inherit'})\"",
53
+ "command": "npx tsx ~/.claude/hooks/scripts/PostToolUse/post-tool-use.ts",
54
54
  "timeout": 10
55
55
  }
56
56
  ]
@@ -61,7 +61,7 @@
61
61
  "hooks": [
62
62
  {
63
63
  "type": "command",
64
- "command": "node -e \"require('child_process').execSync('npx tsx ' + require('path').join(require('os').homedir(), '.claude/hooks/scripts/UserPromptSubmit/user-prompt-submit.ts'), {stdio: 'inherit'})\"",
64
+ "command": "npx tsx ~/.claude/hooks/scripts/UserPromptSubmit/user-prompt-submit.ts",
65
65
  "timeout": 10
66
66
  }
67
67
  ]
@@ -72,7 +72,7 @@
72
72
  "hooks": [
73
73
  {
74
74
  "type": "command",
75
- "command": "node -e \"require('child_process').execSync('npx tsx ' + require('path').join(require('os').homedir(), '.claude/hooks/scripts/Notification/notification.ts'), {stdio: 'inherit'})\"",
75
+ "command": "npx tsx ~/.claude/hooks/scripts/Notification/notification.ts",
76
76
  "timeout": 10
77
77
  }
78
78
  ]
@@ -83,7 +83,7 @@
83
83
  "hooks": [
84
84
  {
85
85
  "type": "command",
86
- "command": "node -e \"require('child_process').execSync('npx tsx ' + require('path').join(require('os').homedir(), '.claude/hooks/scripts/Stop/stop.ts'), {stdio: 'inherit'})\"",
86
+ "command": "npx tsx ~/.claude/hooks/scripts/Stop/stop.ts",
87
87
  "timeout": 10
88
88
  }
89
89
  ]
@@ -95,4 +95,4 @@
95
95
  "command": "~/.claude/ccline/ccline",
96
96
  "padding": 0
97
97
  }
98
- }
98
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 五域科技
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: tech-whitepaper
3
+ description: 生成专业级技术白皮书的能力技能。适用于需要为软件产品、AI平台、技术解决方案创建高质量技术白皮书的场景。输出纯HTML格式,包含:现代简约设计系统、Mermaid架构图、图片灯箱交互、响应式布局。当用户需要生成技术白皮书、产品文档、技术方案说明书时使用此技能。
4
+ license: Complete terms in LICENSE.txt
5
+ ---
6
+
7
+ # 技术白皮书生成技能
8
+
9
+ 为软件产品生成专业级纯HTML技术白皮书,具备现代简约设计风格、可视化架构图和交互式图片查看功能。
10
+
11
+ ## 核心能力
12
+
13
+ 1. **设计系统**:统一视觉语言,CSS变量驱动,单栏大留白布局
14
+ 2. **架构图**:集成Mermaid流程图,自动渲染技术架构
15
+ 3. **图片交互**:悬停放大、点击灯箱查看大图
16
+ 4. **响应式**:适配桌面和移动端阅读
17
+
18
+ ## 使用流程
19
+
20
+ ### Step 1: 项目分析
21
+
22
+ 在生成白皮书前,必须深入分析项目:
23
+
24
+ ```
25
+ 1. 读取项目根目录的 README.md、package.json 等元信息
26
+ 2. 扫描源代码结构,识别核心模块和架构模式
27
+ 3. 查找已有的图片资源(如 docs/image/、assets/)
28
+ 4. 理解技术栈:前端框架、后端服务、数据库、AI能力等
29
+ ```
30
+
31
+ ### Step 2: 内容规划
32
+
33
+ 技术白皮书标准章节结构:
34
+
35
+ 1. **产品概述** - 产品定位、核心价值主张
36
+ 2. **核心价值/亮点** - 差异化竞争优势(3-6个要点)
37
+ 3. **产品组成** - 模块架构、组件说明
38
+ 4. **产品生态展望** - 未来规划、扩展能力
39
+ 5. **技术架构** - 系统架构图、技术栈详解
40
+ 6. **智能体架构**(AI产品)- Agent系统设计
41
+ 7. **智能体编排架构**(AI产品)- 工作流引擎
42
+ 8. **知识库架构**(AI产品)- RAG/向量/图谱
43
+ 9. **智能路由架构**(AI产品)- 模型路由策略
44
+ 10. **主要功能** - 功能特性矩阵
45
+ 11. **部署场景** - 部署架构、环境要求
46
+ 12. **技术支持** - 服务体系、联系方式
47
+
48
+ ### Step 3: 生成白皮书
49
+
50
+ 使用 [HTML模板](assets/whitepaper-template.html) 作为基础,按以下原则定制:
51
+
52
+ **设计原则**:
53
+ - 以读者为中心,每个元素服务于信息传达
54
+ - 单栏布局 + 大留白 + 无衬线字体
55
+ - 鲜明品牌色 + 简约扁平化图表
56
+ - 杜绝无意义装饰,全文统一视觉语言
57
+
58
+ **Mermaid图表**:
59
+ - 使用 `<pre class="mermaid">` 标签(非div)
60
+ - 代码从第一列开始,无缩进
61
+ - 简化节点标签,避免特殊字符
62
+
63
+ **图片处理**:
64
+ - 嵌入项目中所有相关截图
65
+ - 使用 `<figure>` + `<figcaption>` 结构
66
+ - 图片网格用 `.image-grid` 类
67
+
68
+ **品牌定制**:
69
+ - 替换公司名称、产品名称
70
+ - 更新品牌色(修改CSS变量 `--brand-primary` 等)
71
+ - 添加演示地址、联系方式
72
+
73
+ ### Step 4: 输出验证
74
+
75
+ 生成后检查:
76
+ - [ ] Mermaid图表正确渲染(非代码文本)
77
+ - [ ] 图片悬停有放大效果
78
+ - [ ] 图片点击打开灯箱
79
+ - [ ] 响应式布局在移动端正常
80
+ - [ ] 所有链接可点击
81
+
82
+ ## 资源文件
83
+
84
+ - **assets/whitepaper-template.html** - 完整HTML模板,包含设计系统和交互脚本
85
+ - **references/design-system.md** - 设计系统详解与定制指南
86
+ - **references/mermaid-patterns.md** - 常用Mermaid架构图模式