adspecs 0.1.39 → 0.1.41
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.qoder-plugin/plugin.json +1 -1
- package/.workbuddy-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/bin/adspecs.js +2 -2
- package/hooks/commit-queue.js +4 -5
- package/hooks/hooks.json +11 -11
- package/hooks/platform.js +6 -2
- package/hooks/session-logger.js +2 -1
- package/hooks/session-start.js +10 -33
- package/hooks/wiki-queue.js +2 -1
- package/package.json +65 -65
- package/references/vue3-front-standard/INDEX.md +54 -0
- package/references/vue3-front-standard/api-i18n-rules.md +65 -0
- package/references/vue3-front-standard/gushen-components.md +174 -0
- package/references/vue3-front-standard/page-development-rules.md +262 -0
- package/references/vue3-front-standard/page-template-index.md +374 -0
- package/references/vue3-front-standard/project-overview.md +48 -0
- package/skills/project-init/SKILL.md +25 -21
- package/src/lib/scaffolder.js +43 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adspecs",
|
|
3
3
|
"displayName": "adspecs AI 工程规范驱动开发插件",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.41",
|
|
5
5
|
"description": "AI-first specification-driven development plugin for ECP platform full-lifecycle development",
|
|
6
6
|
"descriptionZh": "AI优先的工程规范驱动开发插件,覆盖需求分析、PRD、系统设计、任务拆解、TDD、代码评审、Wiki同步全流程",
|
|
7
7
|
"author": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adspecs",
|
|
3
3
|
"displayName": "adspecs AI 工程规范驱动开发插件",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.41",
|
|
5
5
|
"description": "AI-first specification-driven development plugin for ECP platform full-lifecycle development",
|
|
6
6
|
"descriptionZh": "AI优先的工程规范驱动开发插件,覆盖需求分析、PRD、系统设计、任务拆解、TDD、代码评审、Wiki同步全流程",
|
|
7
7
|
"author": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adspecs",
|
|
3
3
|
"displayName": "adspecs AI 工程规范驱动开发插件",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.41",
|
|
5
5
|
"description": "AI-first specification-driven development plugin for ECP platform full-lifecycle development",
|
|
6
6
|
"descriptionZh": "AI优先的工程规范驱动开发插件,覆盖需求分析、PRD、系统设计、任务拆解、TDD、代码评审、Wiki同步全流程",
|
|
7
7
|
"author": {
|
package/README.md
CHANGED
|
@@ -291,7 +291,7 @@ adspecs init
|
|
|
291
291
|
| `front-demo/` | Vue 3 前端演示项目(Vite + TS + Element Plus) |
|
|
292
292
|
| `antd-front-demo/` | Ant Design React 前端演示项目 |
|
|
293
293
|
| `ant6-front-standard/` | Ant Design 6 前端编码规范(12 篇) |
|
|
294
|
-
| `vue3-front-
|
|
294
|
+
| `vue3-front-standard/` | Vue 3 前端编码规范 |
|
|
295
295
|
| `python-end-standard/` | Python 后端参考 |
|
|
296
296
|
| `yudaocloud-end-standard/` | 芋道 Cloud 后端集成参考 |
|
|
297
297
|
| `tools/` | 辅助工具集 |
|
package/bin/adspecs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const { Command } = require('commander');
|
|
@@ -25,7 +25,7 @@ program
|
|
|
25
25
|
.option('--company <name>', '公司名称', 'XX有限公司')
|
|
26
26
|
.option('--confidentiality <level>', '文件密级: 公开|内部资料|机密|绝密', '内部资料')
|
|
27
27
|
.option('--mode <mode>', '初始化模式: simple|classic|full|demo')
|
|
28
|
-
.option('--front-demo <stack>', '前端演示技术栈: vue|antd'
|
|
28
|
+
.option('--front-demo <stack>', '前端演示技术栈: vue|antd')
|
|
29
29
|
.option('--modules <list>', '后端模块列表(逗号分隔,格式 {port}-crm-{name}:{package})')
|
|
30
30
|
.option('--non-interactive', '非交互模式,所有未提供的参数使用默认值')
|
|
31
31
|
.option('--force', '跳过冲突决策,所有已存在区域直接重新创建')
|
package/hooks/commit-queue.js
CHANGED
|
@@ -20,7 +20,8 @@ const platform = require('./platform');
|
|
|
20
20
|
|
|
21
21
|
// ── 配置 ──────────────────────────────────────────────
|
|
22
22
|
// 队列文件放在目标项目根目录的平台状态目录下。
|
|
23
|
-
//
|
|
23
|
+
// 项目根由 platform.getProjectRoot() 解析:优先 CLAUDE_PROJECT_DIR 环境变量,兜底 cwd
|
|
24
|
+
// (会话中途 cd 到子目录时,状态文件仍落在真正的项目根,避免队列分裂)。
|
|
24
25
|
const PROJECT_ROOT = platform.getProjectRoot();
|
|
25
26
|
const QUEUE_DIR = platform.getStateDir(PROJECT_ROOT);
|
|
26
27
|
const QUEUE_FILE = path.join(QUEUE_DIR, '.commit-candidates');
|
|
@@ -212,10 +213,8 @@ function checkAndReport() {
|
|
|
212
213
|
});
|
|
213
214
|
|
|
214
215
|
console.log('');
|
|
215
|
-
console.log('[commit-queue]
|
|
216
|
-
console.log('[commit-queue] /
|
|
217
|
-
console.log('[commit-queue] To commit directly (no worktree):');
|
|
218
|
-
console.log('[commit-queue] /ai-softengineer:git-commit');
|
|
216
|
+
console.log('[commit-queue] 提交已编译通过的功能:');
|
|
217
|
+
console.log('[commit-queue] /adspecs-git-commit');
|
|
219
218
|
console.log('══════════════════════════════════════════════════════');
|
|
220
219
|
console.log('');
|
|
221
220
|
}
|
package/hooks/hooks.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "跨平台 Hook 配置 — 同时支持 Claude Code、Qoder 和 WorkBuddy
|
|
2
|
+
"_comment": "跨平台 Hook 配置 — 同时支持 Claude Code、Qoder 和 WorkBuddy。本文件是插件自身 hooks/hooks.json(由 Claude Code 自动发现),命令一律用 ${CLAUDE_PLUGIN_ROOT} 锚定脚本路径,不依赖会话 CWD(历史版本使用相对路径 hooks/xxx.js,当会话中途 cd 到子目录时会解析失败 MODULE_NOT_FOUND)。项目根定位由脚本内 platform.getProjectRoot() 负责:优先 CLAUDE_PROJECT_DIR 环境变量、兜底 process.cwd()。/project-init 复制到目标项目根的 hooks/hooks.json 副本(供 Qoder/WorkBuddy 加载)由 scaffolder 重写为绝对路径。",
|
|
3
3
|
"hooks": {
|
|
4
4
|
"SessionStart": [
|
|
5
5
|
{
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/session-start.js"
|
|
9
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.js\""
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"type": "command",
|
|
13
|
-
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/wiki-queue.js init"
|
|
13
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/wiki-queue.js\" init"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"type": "command",
|
|
17
|
-
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/commit-queue.js init"
|
|
17
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/commit-queue.js\" init"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"type": "command",
|
|
21
|
-
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/session-logger.js init"
|
|
21
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session-logger.js\" init"
|
|
22
22
|
}
|
|
23
23
|
]
|
|
24
24
|
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"hooks": [
|
|
29
29
|
{
|
|
30
30
|
"type": "command",
|
|
31
|
-
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/session-logger.js mark"
|
|
31
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session-logger.js\" mark"
|
|
32
32
|
}
|
|
33
33
|
]
|
|
34
34
|
}
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"hooks": [
|
|
41
41
|
{
|
|
42
42
|
"type": "command",
|
|
43
|
-
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/wiki-queue.js enqueue"
|
|
43
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/wiki-queue.js\" enqueue"
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
46
|
"conditions": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"hooks": [
|
|
53
53
|
{
|
|
54
54
|
"type": "command",
|
|
55
|
-
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/commit-queue.js enqueue"
|
|
55
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/commit-queue.js\" enqueue"
|
|
56
56
|
}
|
|
57
57
|
],
|
|
58
58
|
"conditions": {
|
|
@@ -65,15 +65,15 @@
|
|
|
65
65
|
"hooks": [
|
|
66
66
|
{
|
|
67
67
|
"type": "command",
|
|
68
|
-
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/wiki-queue.js report"
|
|
68
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/wiki-queue.js\" report"
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
"type": "command",
|
|
72
|
-
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/commit-queue.js report"
|
|
72
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/commit-queue.js\" report"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"type": "command",
|
|
76
|
-
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/session-logger.js report"
|
|
76
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session-logger.js\" report"
|
|
77
77
|
}
|
|
78
78
|
]
|
|
79
79
|
}
|
package/hooks/platform.js
CHANGED
|
@@ -72,12 +72,16 @@ function getPluginRoot(hooksDir) {
|
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* 获取目标项目根目录
|
|
75
|
-
*
|
|
75
|
+
* 优先 CLAUDE_PROJECT_DIR(Claude Code 执行 hook 时注入,恒指向会话项目根),
|
|
76
|
+
* 兜底 process.cwd()。
|
|
77
|
+
* 背景:旧实现仅用 cwd——会话中途 cd 到子目录(如 front-demo/)后,Stop hook 会把
|
|
78
|
+
* .wiki-update-queue / marker / 日志等状态误写进子目录,产生项目状态分裂。
|
|
79
|
+
* Qoder/WorkBuddy 不注入该环境变量,行为与旧版一致。
|
|
76
80
|
*
|
|
77
81
|
* @returns {string}
|
|
78
82
|
*/
|
|
79
83
|
function getProjectRoot() {
|
|
80
|
-
return process.cwd();
|
|
84
|
+
return process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
/**
|
package/hooks/session-logger.js
CHANGED
|
@@ -18,7 +18,8 @@ const path = require('path');
|
|
|
18
18
|
const platform = require('./platform');
|
|
19
19
|
|
|
20
20
|
// ── 路径解析 ──────────────────────────────────────────────
|
|
21
|
-
//
|
|
21
|
+
// 项目根由 platform.getProjectRoot() 解析:优先 CLAUDE_PROJECT_DIR,兜底 cwd
|
|
22
|
+
// (不用 __dirname——它指向插件目录而非目标项目)
|
|
22
23
|
const PROJECT_ROOT = platform.getProjectRoot();
|
|
23
24
|
const STATE_DIR = platform.getStateDir(PROJECT_ROOT);
|
|
24
25
|
const MARKER_FILE = path.join(STATE_DIR, '.session-save-marker');
|
package/hooks/session-start.js
CHANGED
|
@@ -1,40 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* SessionStart Hook —
|
|
4
|
+
* SessionStart Hook — 会话启动占位脚本
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* 原设计:注入 using-adspecs/SKILL.md 引导内容。
|
|
7
|
+
* 当前状态:using-adspecs skill 不存在,会话引导已由 session-logger.js init 承担
|
|
8
|
+
* (注入 AI 会话日志保存指南)。
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* 保留此脚本文件是为了 hooks.json 中 SessionStart 事件的结构完整性,
|
|
11
|
+
* 后续若需要新增会话启动时的上下文注入可在此扩展。
|
|
12
|
+
*
|
|
13
|
+
* 跨平台兼容:Claude Code / Qoder / WorkBuddy
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const platform = require('./platform');
|
|
16
|
-
|
|
17
|
-
// ── 路径解析 ──────────────────────────────────────────
|
|
18
|
-
// 使用平台工具解析插件根目录(兼容环境变量和 __dirname 回退)
|
|
19
|
-
const PLUGIN_ROOT = platform.getPluginRoot(__dirname);
|
|
20
|
-
const SKILL_PATH = path.join(PLUGIN_ROOT, 'skills', 'using-adspecs', 'SKILL.md');
|
|
21
|
-
|
|
22
|
-
// ── 读取技能内容 ──────────────────────────────────────
|
|
23
|
-
var skillContent;
|
|
24
|
-
try {
|
|
25
|
-
skillContent = fs.readFileSync(SKILL_PATH, 'utf8');
|
|
26
|
-
} catch (err) {
|
|
27
|
-
// 技能文件不存在,静默跳过
|
|
28
|
-
process.exit(0);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (!skillContent || skillContent.trim() === '') {
|
|
32
|
-
process.exit(0);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// ── 输出 Hook Context ─────────────────────────────────
|
|
36
|
-
// 使用平台统一输出协议(hookSpecificOutput.additionalContext)
|
|
37
|
-
platform.outputContext(
|
|
38
|
-
'SessionStart',
|
|
39
|
-
'<EXTREMELY-IMPORTANT>\n' + skillContent + '\n</EXTREMELY-IMPORTANT>'
|
|
40
|
-
);
|
|
16
|
+
// 直接退出,不输出任何内容
|
|
17
|
+
process.exit(0);
|
package/hooks/wiki-queue.js
CHANGED
|
@@ -19,7 +19,8 @@ const platform = require('./platform');
|
|
|
19
19
|
|
|
20
20
|
// ── 配置 ──────────────────────────────────────────────
|
|
21
21
|
// 队列文件放在目标项目根目录的平台状态目录下。
|
|
22
|
-
//
|
|
22
|
+
// 项目根由 platform.getProjectRoot() 解析:优先 CLAUDE_PROJECT_DIR 环境变量,兜底 cwd
|
|
23
|
+
// (会话中途 cd 到子目录时,状态文件仍落在真正的项目根,避免队列分裂)。
|
|
23
24
|
const PROJECT_ROOT = platform.getProjectRoot();
|
|
24
25
|
const QUEUE_DIR = platform.getStateDir(PROJECT_ROOT);
|
|
25
26
|
const QUEUE_FILE = path.join(QUEUE_DIR, '.wiki-update-queue');
|
package/package.json
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "adspecs",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "AI first 工程规范驱动开发插件 — 支持 npm 安装和 CLI 初始化",
|
|
5
|
-
"bin": {
|
|
6
|
-
"adspecs": "bin/adspecs.js"
|
|
7
|
-
},
|
|
8
|
-
"main": "./src/utils.js",
|
|
9
|
-
"files": [
|
|
10
|
-
"bin/",
|
|
11
|
-
"src/",
|
|
12
|
-
".claude-plugin/",
|
|
13
|
-
".qoder-plugin/",
|
|
14
|
-
".codebuddy-plugin/",
|
|
15
|
-
".workbuddy-plugin/",
|
|
16
|
-
".adspecs/",
|
|
17
|
-
"skills/",
|
|
18
|
-
"hooks/",
|
|
19
|
-
"references/",
|
|
20
|
-
"scripts/postinstall.js",
|
|
21
|
-
"scripts/sync-version.js",
|
|
22
|
-
"CLAUDE.md",
|
|
23
|
-
"README.md",
|
|
24
|
-
"INSTALL.md",
|
|
25
|
-
"CHANGELOG.md",
|
|
26
|
-
"LICENSE"
|
|
27
|
-
],
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=18.0.0"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"test": "node --test src/**/*.test.js",
|
|
33
|
-
"postinstall": "node scripts/postinstall.js",
|
|
34
|
-
"prepublishOnly": "node scripts/prepublish-check.js",
|
|
35
|
-
"version": "node scripts/sync-version.js && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json .qoder-plugin/plugin.json .codebuddy-plugin/plugin.json .workbuddy-plugin/plugin.json",
|
|
36
|
-
"sync-version": "node scripts/sync-version.js"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"commander": "^12.0.0",
|
|
40
|
-
"@inquirer/prompts": "^7.0.0",
|
|
41
|
-
"chalk": "^4.1.2"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {},
|
|
44
|
-
"keywords": [
|
|
45
|
-
"adspecs",
|
|
46
|
-
"claude-code",
|
|
47
|
-
"qoder",
|
|
48
|
-
"workbuddy",
|
|
49
|
-
"plugin",
|
|
50
|
-
"scaffold",
|
|
51
|
-
"cli",
|
|
52
|
-
"project-init",
|
|
53
|
-
"ai-first"
|
|
54
|
-
],
|
|
55
|
-
"author": "Qingwen Chen <cqinwn@qq.com>",
|
|
56
|
-
"license": "Apache-2.0",
|
|
57
|
-
"repository": {
|
|
58
|
-
"type": "git",
|
|
59
|
-
"url": "https://gitee.com/yuebon/adp-plugins.git"
|
|
60
|
-
},
|
|
61
|
-
"homepage": "https://gitee.com/yuebon/adp-plugins#readme",
|
|
62
|
-
"bugs": {
|
|
63
|
-
"url": "https://gitee.com/yuebon/adp-plugins/issues"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "adspecs",
|
|
3
|
+
"version": "0.1.41",
|
|
4
|
+
"description": "AI first 工程规范驱动开发插件 — 支持 npm 安装和 CLI 初始化",
|
|
5
|
+
"bin": {
|
|
6
|
+
"adspecs": "bin/adspecs.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "./src/utils.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"src/",
|
|
12
|
+
".claude-plugin/",
|
|
13
|
+
".qoder-plugin/",
|
|
14
|
+
".codebuddy-plugin/",
|
|
15
|
+
".workbuddy-plugin/",
|
|
16
|
+
".adspecs/",
|
|
17
|
+
"skills/",
|
|
18
|
+
"hooks/",
|
|
19
|
+
"references/",
|
|
20
|
+
"scripts/postinstall.js",
|
|
21
|
+
"scripts/sync-version.js",
|
|
22
|
+
"CLAUDE.md",
|
|
23
|
+
"README.md",
|
|
24
|
+
"INSTALL.md",
|
|
25
|
+
"CHANGELOG.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18.0.0"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"test": "node --test src/**/*.test.js",
|
|
33
|
+
"postinstall": "node scripts/postinstall.js",
|
|
34
|
+
"prepublishOnly": "node scripts/prepublish-check.js",
|
|
35
|
+
"version": "node scripts/sync-version.js && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json .qoder-plugin/plugin.json .codebuddy-plugin/plugin.json .workbuddy-plugin/plugin.json",
|
|
36
|
+
"sync-version": "node scripts/sync-version.js"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"commander": "^12.0.0",
|
|
40
|
+
"@inquirer/prompts": "^7.0.0",
|
|
41
|
+
"chalk": "^4.1.2"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"adspecs",
|
|
46
|
+
"claude-code",
|
|
47
|
+
"qoder",
|
|
48
|
+
"workbuddy",
|
|
49
|
+
"plugin",
|
|
50
|
+
"scaffold",
|
|
51
|
+
"cli",
|
|
52
|
+
"project-init",
|
|
53
|
+
"ai-first"
|
|
54
|
+
],
|
|
55
|
+
"author": "Qingwen Chen <cqinwn@qq.com>",
|
|
56
|
+
"license": "Apache-2.0",
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "https://gitee.com/yuebon/adp-plugins.git"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://gitee.com/yuebon/adp-plugins#readme",
|
|
62
|
+
"bugs": {
|
|
63
|
+
"url": "https://gitee.com/yuebon/adp-plugins/issues"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# 前端规则文件索引
|
|
2
|
+
|
|
3
|
+
本目录包含 `sie-front-demo` 的 AI 开发规则。生成或修改代码前,先按任务类型读取对应规则。
|
|
4
|
+
|
|
5
|
+
## 文件组织
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
.claude/rules/
|
|
9
|
+
├── INDEX.md
|
|
10
|
+
├── project-overview.md
|
|
11
|
+
├── gushen-components.md
|
|
12
|
+
├── page-development-rules.md
|
|
13
|
+
├── api-i18n-rules.md
|
|
14
|
+
└── page-template-index.md
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 推荐读取顺序
|
|
18
|
+
|
|
19
|
+
### 新增普通业务页面
|
|
20
|
+
|
|
21
|
+
1. `project-overview.md`
|
|
22
|
+
2. `page-development-rules.md`
|
|
23
|
+
3. `gushen-components.md`
|
|
24
|
+
4. `api-i18n-rules.md`
|
|
25
|
+
5. `page-template-index.md`
|
|
26
|
+
|
|
27
|
+
### 新增列表页
|
|
28
|
+
|
|
29
|
+
1. `gushen-components.md`
|
|
30
|
+
2. `page-development-rules.md`
|
|
31
|
+
3. `api-i18n-rules.md`
|
|
32
|
+
4. `page-template-index.md`
|
|
33
|
+
|
|
34
|
+
### 新增表单或流程页面
|
|
35
|
+
|
|
36
|
+
1. `page-development-rules.md`
|
|
37
|
+
2. `api-i18n-rules.md`
|
|
38
|
+
3. `page-template-index.md`
|
|
39
|
+
|
|
40
|
+
### 选择复杂页面模板
|
|
41
|
+
|
|
42
|
+
1. `page-template-index.md`
|
|
43
|
+
2. 根据选中的模式补读 `gushen-components.md` 或 `api-i18n-rules.md`
|
|
44
|
+
|
|
45
|
+
### 使用 `@gushen` 组件
|
|
46
|
+
|
|
47
|
+
1. `gushen-components.md`
|
|
48
|
+
2. 如规则不足,读取 `node_modules/@gushen/*/src` 中对应组件源码。
|
|
49
|
+
|
|
50
|
+
## 维护要求
|
|
51
|
+
|
|
52
|
+
- 新增规则文件时,同步更新本索引和根目录 `claude.md`。
|
|
53
|
+
- 修改页面模板候选时,同步更新 `page-template-index.md`。
|
|
54
|
+
- 组件依赖升级后,重新读取 `node_modules/@gushen/*/src`,再更新 `gushen-components.md`。
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# API 与多语言规则
|
|
2
|
+
|
|
3
|
+
## API 文件
|
|
4
|
+
|
|
5
|
+
新增 API 放在 `src/api/<module>/<page>/index.ts` 或已有模块目录下。
|
|
6
|
+
|
|
7
|
+
推荐写法:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import request from '@/utils/request'
|
|
11
|
+
|
|
12
|
+
export function findPagination(data: any) {
|
|
13
|
+
return request({
|
|
14
|
+
url: '/api/demoa/example/find-pagination',
|
|
15
|
+
method: 'post',
|
|
16
|
+
data,
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 请求规则
|
|
22
|
+
|
|
23
|
+
- POST 保存、更新、分页查询按现有接口要求传 `data`。
|
|
24
|
+
- 保存/更新业务对象通常使用 `{ params: formData }` 包装。
|
|
25
|
+
- GET 查询单条使用 `params`,不要拼接复杂 query 字符串。
|
|
26
|
+
- 不确定后端前缀时,先参考同模块 API 文件,不要凭空新增服务前缀。
|
|
27
|
+
- 需要动态域名时,参考旧页面中的 `window.getVersionTypeApiUrl(...)` 用法。
|
|
28
|
+
|
|
29
|
+
## 成功判断
|
|
30
|
+
|
|
31
|
+
- Composition API 页面优先 import `reqIsSucceed`。
|
|
32
|
+
- Options API 旧页面可使用 `this.reqIsSucceed(res)`。
|
|
33
|
+
- 不要在新页面里散落 `res.code === 800`、`res.status === 'S'`;只有维护旧接口或流程接口时才沿用既有判断。
|
|
34
|
+
|
|
35
|
+
## 错误处理
|
|
36
|
+
|
|
37
|
+
- 保存、删除、提交等用户操作需要 loading 防重复点击。
|
|
38
|
+
- 失败时显示后端 `msg` 或明确错误提示。
|
|
39
|
+
- 不要吞掉 catch;至少恢复 loading 状态。
|
|
40
|
+
|
|
41
|
+
## 多语言
|
|
42
|
+
|
|
43
|
+
本工程语言包位于:
|
|
44
|
+
|
|
45
|
+
- `src/lang/zh-cn.ts`
|
|
46
|
+
- `src/lang/en-us.ts`
|
|
47
|
+
- `src/lang/zh-tw.ts`
|
|
48
|
+
- `src/lang/modules/<module>/<locale>.ts`
|
|
49
|
+
|
|
50
|
+
规则:
|
|
51
|
+
|
|
52
|
+
- 新增用户可见文案优先放入模块语言包。
|
|
53
|
+
- 至少补齐 `zh-cn`、`en-us`、`zh-tw`;如果现有模块已有 `hu-hu`、`vi-vn`,同步评估是否需要补。
|
|
54
|
+
- 模板中使用 `$t('module.key')` 或 `t('module.key')`。
|
|
55
|
+
- 表格列名、按钮、提示、确认文案、校验信息都属于用户可见文案。
|
|
56
|
+
|
|
57
|
+
## 路由标题
|
|
58
|
+
|
|
59
|
+
路由 `meta.title` 使用中文标题;`meta.enTitle` 在当前工程常见为多语言 JSON 字符串:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
enTitle: '{"zh-tw":"消息中心","en-us":"letters","hu-hu":"Üzenetközpont","vi-vn":"Trung tâm thông điệp"}'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
新增路由时保持和邻近路由一致。
|