adspecs 0.1.18 → 0.1.20

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 (88) hide show
  1. package/.adspecs/extensions/git/commands/adspecs.git.initialize.md +4 -4
  2. package/.adspecs/extensions/git/extension.yml +1 -1
  3. package/.adspecs/extensions/git/git-config.yml +17 -2
  4. package/.adspecs/extensions.yml +32 -0
  5. package/.adspecs/feature.json +16 -16
  6. package/.adspecs/feature.yml +28 -28
  7. package/.adspecs/paths.json +17 -0
  8. package/.adspecs/templates/02-/344/272/247/345/223/201/351/234/200/346/261/202/350/257/264/346/230/216/344/271/246/346/250/241/346/235/277.md +4 -0
  9. package/.adspecs/workflows/adspecs/workflow.yml +5 -4
  10. package/.claude-plugin/marketplace.json +23 -23
  11. package/.claude-plugin/plugin.json +18 -18
  12. package/.qoder-plugin/plugin.json +31 -31
  13. package/CLAUDE.md +1 -5
  14. package/README.md +395 -395
  15. package/bin/adspecs.js +129 -129
  16. package/hooks/commit-queue.js +245 -245
  17. package/hooks/hooks.json +63 -63
  18. package/hooks/session-start.js +44 -44
  19. package/hooks/wiki-queue.js +127 -127
  20. package/package.json +61 -61
  21. package/references/ant6-front-standard/index.md +99 -99
  22. package/references/antd-front-demo/.env.develop +12 -0
  23. package/references/antd-front-demo/.env.production +5 -0
  24. package/references/antd-front-demo/package-lock.json +2 -2
  25. package/references/antd-front-demo/package.json +1 -1
  26. package/references/antd-front-demo/public/mockServiceWorker.js +361 -361
  27. package/references/ecp-end-standard/index.md +63 -63
  28. package/references/python-end-standard/01-Python/345/220/216/347/253/257/347/274/226/347/240/201/350/247/204/350/214/203.md +372 -372
  29. package/references/python-end-standard/02-/346/225/260/346/215/256/345/272/223/350/256/276/350/256/241/344/270/216/344/275/277/347/224/250/350/247/204/350/214/203.md +226 -226
  30. package/references/python-end-standard/03-Celery/345/274/202/346/255/245/344/273/273/345/212/241/350/247/204/350/214/203.md +237 -237
  31. package/references/python-end-standard/04-Redis/344/275/277/347/224/250/350/247/204/350/214/203.md +231 -231
  32. package/scripts/postinstall.js +107 -107
  33. package/scripts/sync-version.js +105 -105
  34. package/skills/.claude/.wiki-update-queue +26 -26
  35. package/skills/adspecs-constitution/SKILL.md +157 -0
  36. package/skills/adspecs-export-word/SKILL.md +498 -498
  37. package/skills/adspecs-export-word/references/md-to-docx.js +862 -862
  38. package/skills/adspecs-export-word/references/package-lock.json +220 -220
  39. package/skills/adspecs-export-word/references/package.json +10 -10
  40. package/skills/adspecs-front-prototype/SKILL.md +405 -0
  41. package/skills/adspecs-git-commit/SKILL.md +23 -8
  42. package/skills/adspecs-git-initialize/SKILL.md +54 -0
  43. package/skills/adspecs-plan/SKILL.md +59 -69
  44. package/skills/adspecs-prd/SKILL.md +13 -5
  45. package/skills/adspecs-prd-to-demo/SKILL.md +532 -0
  46. package/skills/adspecs-tasks/SKILL.md +175 -204
  47. package/skills/adspecs-update-status/SKILL.md +382 -382
  48. package/skills/adspecs-utest/SKILL.md +107 -116
  49. package/skills/grill-me/SKILL.md +7 -0
  50. package/skills/grill-me/agents/openai.yaml +5 -0
  51. package/skills/playwright-cli/SKILL.md +420 -0
  52. package/skills/playwright-cli/references/element-attributes.md +23 -0
  53. package/skills/playwright-cli/references/playwright-tests.md +39 -0
  54. package/skills/playwright-cli/references/request-mocking.md +87 -0
  55. package/skills/playwright-cli/references/running-code.md +241 -0
  56. package/skills/playwright-cli/references/session-management.md +225 -0
  57. package/skills/playwright-cli/references/storage-state.md +275 -0
  58. package/skills/playwright-cli/references/test-generation.md +433 -0
  59. package/skills/playwright-cli/references/tracing.md +139 -0
  60. package/skills/playwright-cli/references/video-recording.md +143 -0
  61. package/skills/playwright-trace/SKILL.md +171 -0
  62. package/skills/project-init/references/front-demo/.claude/settings.local.json +9 -0
  63. package/skills/wiki-update/SKILL.md +232 -232
  64. package/src/commands/doctor.js +197 -197
  65. package/src/commands/init.js +83 -83
  66. package/src/commands/plugin.js +165 -165
  67. package/src/commands/update.js +87 -87
  68. package/src/lib/area-scanner.js +129 -129
  69. package/src/lib/copier.js +104 -104
  70. package/src/lib/dir-utils.js +133 -133
  71. package/src/lib/json-merge.js +114 -114
  72. package/src/lib/paths-defaults.js +37 -37
  73. package/src/lib/prompts.js +347 -345
  74. package/src/lib/readme-gen.js +143 -143
  75. package/src/lib/report.js +327 -327
  76. package/src/lib/scaffolder.js +518 -518
  77. package/src/lib/short-name.js +36 -36
  78. package/src/utils.js +80 -80
  79. package/references/antd-front-demo/.env +0 -15
  80. package/references/antd-front-demo/src/pages/aps/coil/components/CoilDrawer.tsx +0 -141
  81. package/references/antd-front-demo/src/pages/aps/coil/index.tsx +0 -209
  82. package/references/antd-front-demo/src/pages/aps/optimization/index.tsx +0 -192
  83. package/references/antd-front-demo/src/pages/aps/order/components/OrderDrawer.tsx +0 -251
  84. package/references/antd-front-demo/src/pages/aps/order/index.tsx +0 -273
  85. package/references/antd-front-demo/src/pages/aps/param/index.tsx +0 -153
  86. package/references/antd-front-demo/src/pages/aps/plan/components/CuttingPlanVisualization.tsx +0 -821
  87. package/references/antd-front-demo/src/pages/aps/plan/index.tsx +0 -254
  88. package/references/antd-front-demo/src/pages/aps/task/index.tsx +0 -190
@@ -1,44 +1,44 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * SessionStart Hook — 注入 using-adspecs 技能引导内容
5
- *
6
- * 在每次会话启动时,读取 using-adspecs/SKILL.md 并输出为
7
- * Claude Code hook additionalContext,确保 Agent 在任何任务开始前
8
- * 都知道需要检查并使用 ADSpecs 技能。
9
- *
10
- * 机制参考:Superpowers hooks/session-start
11
- */
12
-
13
- const fs = require('fs');
14
- const path = require('path');
15
-
16
- // ── 路径解析 ──────────────────────────────────────────
17
- // hooks/ 在项目根下,__dirname 总是指向 hooks/ 目录
18
- const PLUGIN_ROOT = path.join(__dirname, '..');
19
- const SKILL_PATH = path.join(PLUGIN_ROOT, 'skills', 'using-adspecs', 'SKILL.md');
20
-
21
- // ── 读取技能内容 ──────────────────────────────────────
22
- var skillContent;
23
- try {
24
- skillContent = fs.readFileSync(SKILL_PATH, 'utf8');
25
- } catch (err) {
26
- // 技能文件不存在,静默跳过
27
- process.exit(0);
28
- }
29
-
30
- if (!skillContent || skillContent.trim() === '') {
31
- process.exit(0);
32
- }
33
-
34
- // ── 输出 Hook Context ─────────────────────────────────
35
- // Claude Code hook command 输出 JSON 到 stdout,
36
- // hookSpecificOutput.additionalContext 会被注入到 Agent 上下文
37
- var output = {
38
- hookSpecificOutput: {
39
- hookEventName: 'SessionStart',
40
- additionalContext: '<EXTREMELY-IMPORTANT>\n' + skillContent + '\n</EXTREMELY-IMPORTANT>'
41
- }
42
- };
43
-
44
- process.stdout.write(JSON.stringify(output));
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * SessionStart Hook — 注入 using-adspecs 技能引导内容
5
+ *
6
+ * 在每次会话启动时,读取 using-adspecs/SKILL.md 并输出为
7
+ * Claude Code hook additionalContext,确保 Agent 在任何任务开始前
8
+ * 都知道需要检查并使用 ADSpecs 技能。
9
+ *
10
+ * 机制参考:Superpowers hooks/session-start
11
+ */
12
+
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+
16
+ // ── 路径解析 ──────────────────────────────────────────
17
+ // hooks/ 在项目根下,__dirname 总是指向 hooks/ 目录
18
+ const PLUGIN_ROOT = path.join(__dirname, '..');
19
+ const SKILL_PATH = path.join(PLUGIN_ROOT, 'skills', 'using-adspecs', 'SKILL.md');
20
+
21
+ // ── 读取技能内容 ──────────────────────────────────────
22
+ var skillContent;
23
+ try {
24
+ skillContent = fs.readFileSync(SKILL_PATH, 'utf8');
25
+ } catch (err) {
26
+ // 技能文件不存在,静默跳过
27
+ process.exit(0);
28
+ }
29
+
30
+ if (!skillContent || skillContent.trim() === '') {
31
+ process.exit(0);
32
+ }
33
+
34
+ // ── 输出 Hook Context ─────────────────────────────────
35
+ // Claude Code hook command 输出 JSON 到 stdout,
36
+ // hookSpecificOutput.additionalContext 会被注入到 Agent 上下文
37
+ var output = {
38
+ hookSpecificOutput: {
39
+ hookEventName: 'SessionStart',
40
+ additionalContext: '<EXTREMELY-IMPORTANT>\n' + skillContent + '\n</EXTREMELY-IMPORTANT>'
41
+ }
42
+ };
43
+
44
+ process.stdout.write(JSON.stringify(output));
@@ -1,127 +1,127 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Wiki Update Queue — 跨平台 Hook 脚本
5
- *
6
- * 在 SessionStart / PostToolUse / Stop 三个 Hook 事件中管理 .wiki-update-queue 队列文件。
7
- * 使用 Node.js(而非平台特定 Shell)确保 Windows / macOS / Linux 三平台兼容。
8
- *
9
- * 用法:
10
- * node hooks/wiki-queue.js init — SessionStart: 创建队列文件
11
- * node hooks/wiki-queue.js enqueue — PostToolUse: 追加变更文件路径到队列
12
- * node hooks/wiki-queue.js report — Stop: 检查队列并输出提示
13
- */
14
-
15
- const fs = require('fs');
16
- const path = require('path');
17
-
18
- // ── 配置 ──────────────────────────────────────────────
19
- // 队列文件放在目标项目根目录的 .claude/ 下。
20
- // 使用 process.cwd() 获取目标项目根目录(Claude Code 运行 hook 时 CWD 即为目标项目)。
21
- // 注意:不能用 __dirname,因为 __dirname 指向的是插件安装目录,而非用户的目标项目。
22
- const PROJECT_ROOT = process.cwd();
23
- const QUEUE_DIR = path.join(PROJECT_ROOT, '.claude');
24
- const QUEUE_FILE = path.join(QUEUE_DIR, '.wiki-update-queue');
25
-
26
- // ── 工具函数 ──────────────────────────────────────────
27
-
28
- /** 确保 .claude 目录和队列文件存在 */
29
- function ensureQueueFile() {
30
- fs.mkdirSync(QUEUE_DIR, { recursive: true });
31
- if (!fs.existsSync(QUEUE_FILE)) {
32
- fs.writeFileSync(QUEUE_FILE, '', 'utf8');
33
- }
34
- }
35
-
36
- /** 追加文件路径到队列(去重、过滤空行) */
37
- function appendToQueue(files) {
38
- if (!files || (typeof files === 'string' && files.trim() === '')) {
39
- return;
40
- }
41
-
42
- fs.mkdirSync(QUEUE_DIR, { recursive: true });
43
-
44
- // 标准化:按行拆分,过滤空行
45
- const newFiles = files
46
- .split(/\r?\n/)
47
- .map(function (f) { return f.trim(); })
48
- .filter(Boolean);
49
-
50
- if (newFiles.length === 0) {
51
- return;
52
- }
53
-
54
- // 读取已有队列,去重追加
55
- /** @type {Set<string>} */
56
- var seen = new Set();
57
- if (fs.existsSync(QUEUE_FILE)) {
58
- var existing = fs.readFileSync(QUEUE_FILE, 'utf8')
59
- .split(/\r?\n/)
60
- .map(function (f) { return f.trim(); })
61
- .filter(Boolean);
62
- existing.forEach(function (f) { seen.add(f); });
63
- }
64
-
65
- var appended = 0;
66
- newFiles.forEach(function (f) {
67
- if (!seen.has(f)) {
68
- fs.appendFileSync(QUEUE_FILE, f + '\n', 'utf8');
69
- seen.add(f);
70
- appended++;
71
- }
72
- });
73
-
74
- if (appended > 0) {
75
- console.log('[wiki-update] ' + appended + ' file(s) added to sync queue.');
76
- }
77
- }
78
-
79
- /** 检查队列并在有待处理项时输出提示 */
80
- function checkAndReport() {
81
- if (!fs.existsSync(QUEUE_FILE)) {
82
- return;
83
- }
84
-
85
- var content;
86
- try {
87
- content = fs.readFileSync(QUEUE_FILE, 'utf8').trim();
88
- } catch (_err) {
89
- return;
90
- }
91
-
92
- if (!content) {
93
- return;
94
- }
95
-
96
- var lines = content.split(/\r?\n/).filter(Boolean);
97
- var count = lines.length;
98
-
99
- if (count > 0) {
100
- console.log('[wiki-update] ' + count + ' file(s) queued for wiki sync.');
101
- console.log('[wiki-update] Run: /wiki-update --mode=incremental --flush');
102
- }
103
- }
104
-
105
- // ── 主入口 ────────────────────────────────────────────
106
-
107
- var action = process.argv[2];
108
-
109
- switch (action) {
110
- case 'init':
111
- ensureQueueFile();
112
- break;
113
-
114
- case 'enqueue':
115
- // CLAUDE_TOOL_OUTPUT_FILES 由 Claude Code Hook 运行时注入为环境变量
116
- appendToQueue(process.env.CLAUDE_TOOL_OUTPUT_FILES || '');
117
- break;
118
-
119
- case 'report':
120
- checkAndReport();
121
- break;
122
-
123
- default:
124
- console.error('[wiki-update] Unknown action: ' + (action || '(none)'));
125
- console.error('[wiki-update] Usage: node hooks/wiki-queue.js init|enqueue|report');
126
- process.exit(1);
127
- }
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Wiki Update Queue — 跨平台 Hook 脚本
5
+ *
6
+ * 在 SessionStart / PostToolUse / Stop 三个 Hook 事件中管理 .wiki-update-queue 队列文件。
7
+ * 使用 Node.js(而非平台特定 Shell)确保 Windows / macOS / Linux 三平台兼容。
8
+ *
9
+ * 用法:
10
+ * node hooks/wiki-queue.js init — SessionStart: 创建队列文件
11
+ * node hooks/wiki-queue.js enqueue — PostToolUse: 追加变更文件路径到队列
12
+ * node hooks/wiki-queue.js report — Stop: 检查队列并输出提示
13
+ */
14
+
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+
18
+ // ── 配置 ──────────────────────────────────────────────
19
+ // 队列文件放在目标项目根目录的 .claude/ 下。
20
+ // 使用 process.cwd() 获取目标项目根目录(Claude Code 运行 hook 时 CWD 即为目标项目)。
21
+ // 注意:不能用 __dirname,因为 __dirname 指向的是插件安装目录,而非用户的目标项目。
22
+ const PROJECT_ROOT = process.cwd();
23
+ const QUEUE_DIR = path.join(PROJECT_ROOT, '.claude');
24
+ const QUEUE_FILE = path.join(QUEUE_DIR, '.wiki-update-queue');
25
+
26
+ // ── 工具函数 ──────────────────────────────────────────
27
+
28
+ /** 确保 .claude 目录和队列文件存在 */
29
+ function ensureQueueFile() {
30
+ fs.mkdirSync(QUEUE_DIR, { recursive: true });
31
+ if (!fs.existsSync(QUEUE_FILE)) {
32
+ fs.writeFileSync(QUEUE_FILE, '', 'utf8');
33
+ }
34
+ }
35
+
36
+ /** 追加文件路径到队列(去重、过滤空行) */
37
+ function appendToQueue(files) {
38
+ if (!files || (typeof files === 'string' && files.trim() === '')) {
39
+ return;
40
+ }
41
+
42
+ fs.mkdirSync(QUEUE_DIR, { recursive: true });
43
+
44
+ // 标准化:按行拆分,过滤空行
45
+ const newFiles = files
46
+ .split(/\r?\n/)
47
+ .map(function (f) { return f.trim(); })
48
+ .filter(Boolean);
49
+
50
+ if (newFiles.length === 0) {
51
+ return;
52
+ }
53
+
54
+ // 读取已有队列,去重追加
55
+ /** @type {Set<string>} */
56
+ var seen = new Set();
57
+ if (fs.existsSync(QUEUE_FILE)) {
58
+ var existing = fs.readFileSync(QUEUE_FILE, 'utf8')
59
+ .split(/\r?\n/)
60
+ .map(function (f) { return f.trim(); })
61
+ .filter(Boolean);
62
+ existing.forEach(function (f) { seen.add(f); });
63
+ }
64
+
65
+ var appended = 0;
66
+ newFiles.forEach(function (f) {
67
+ if (!seen.has(f)) {
68
+ fs.appendFileSync(QUEUE_FILE, f + '\n', 'utf8');
69
+ seen.add(f);
70
+ appended++;
71
+ }
72
+ });
73
+
74
+ if (appended > 0) {
75
+ console.log('[wiki-update] ' + appended + ' file(s) added to sync queue.');
76
+ }
77
+ }
78
+
79
+ /** 检查队列并在有待处理项时输出提示 */
80
+ function checkAndReport() {
81
+ if (!fs.existsSync(QUEUE_FILE)) {
82
+ return;
83
+ }
84
+
85
+ var content;
86
+ try {
87
+ content = fs.readFileSync(QUEUE_FILE, 'utf8').trim();
88
+ } catch (_err) {
89
+ return;
90
+ }
91
+
92
+ if (!content) {
93
+ return;
94
+ }
95
+
96
+ var lines = content.split(/\r?\n/).filter(Boolean);
97
+ var count = lines.length;
98
+
99
+ if (count > 0) {
100
+ console.log('[wiki-update] ' + count + ' file(s) queued for wiki sync.');
101
+ console.log('[wiki-update] Run: /wiki-update --mode=incremental --flush');
102
+ }
103
+ }
104
+
105
+ // ── 主入口 ────────────────────────────────────────────
106
+
107
+ var action = process.argv[2];
108
+
109
+ switch (action) {
110
+ case 'init':
111
+ ensureQueueFile();
112
+ break;
113
+
114
+ case 'enqueue':
115
+ // CLAUDE_TOOL_OUTPUT_FILES 由 Claude Code Hook 运行时注入为环境变量
116
+ appendToQueue(process.env.CLAUDE_TOOL_OUTPUT_FILES || '');
117
+ break;
118
+
119
+ case 'report':
120
+ checkAndReport();
121
+ break;
122
+
123
+ default:
124
+ console.error('[wiki-update] Unknown action: ' + (action || '(none)'));
125
+ console.error('[wiki-update] Usage: node hooks/wiki-queue.js init|enqueue|report');
126
+ process.exit(1);
127
+ }
package/package.json CHANGED
@@ -1,61 +1,61 @@
1
- {
2
- "name": "adspecs",
3
- "version": "0.1.18",
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
- ".adspecs/",
15
- "skills/",
16
- "hooks/",
17
- "references/",
18
- "scripts/postinstall.js",
19
- "scripts/sync-version.js",
20
- "CLAUDE.md",
21
- "README.md",
22
- "INSTALL.md",
23
- "CHANGELOG.md",
24
- "LICENSE"
25
- ],
26
- "engines": {
27
- "node": ">=18.0.0"
28
- },
29
- "scripts": {
30
- "test": "node --test src/**/*.test.js",
31
- "postinstall": "node scripts/postinstall.js",
32
- "prepublishOnly": "node scripts/prepublish-check.js",
33
- "version": "node scripts/sync-version.js && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json .qoder-plugin/plugin.json",
34
- "sync-version": "node scripts/sync-version.js"
35
- },
36
- "dependencies": {
37
- "commander": "^12.0.0",
38
- "@inquirer/prompts": "^7.0.0",
39
- "chalk": "^4.1.2"
40
- },
41
- "devDependencies": {},
42
- "keywords": [
43
- "adspecs",
44
- "claude-code",
45
- "plugin",
46
- "scaffold",
47
- "cli",
48
- "project-init",
49
- "ai-first"
50
- ],
51
- "author": "Qingwen Chen <cqinwn@qq.com>",
52
- "license": "Apache-2.0",
53
- "repository": {
54
- "type": "git",
55
- "url": "https://gitee.com/yuebon/adspecs.git"
56
- },
57
- "homepage": "https://gitee.com/yuebon/adspecs#readme",
58
- "bugs": {
59
- "url": "https://gitee.com/yuebon/adspecs/issues"
60
- }
61
- }
1
+ {
2
+ "name": "adspecs",
3
+ "version": "0.1.20",
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
+ ".adspecs/",
15
+ "skills/",
16
+ "hooks/",
17
+ "references/",
18
+ "scripts/postinstall.js",
19
+ "scripts/sync-version.js",
20
+ "CLAUDE.md",
21
+ "README.md",
22
+ "INSTALL.md",
23
+ "CHANGELOG.md",
24
+ "LICENSE"
25
+ ],
26
+ "engines": {
27
+ "node": ">=18.0.0"
28
+ },
29
+ "scripts": {
30
+ "test": "node --test src/**/*.test.js",
31
+ "postinstall": "node scripts/postinstall.js",
32
+ "prepublishOnly": "node scripts/prepublish-check.js",
33
+ "version": "node scripts/sync-version.js && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json .qoder-plugin/plugin.json",
34
+ "sync-version": "node scripts/sync-version.js"
35
+ },
36
+ "dependencies": {
37
+ "commander": "^12.0.0",
38
+ "@inquirer/prompts": "^7.0.0",
39
+ "chalk": "^4.1.2"
40
+ },
41
+ "devDependencies": {},
42
+ "keywords": [
43
+ "adspecs",
44
+ "claude-code",
45
+ "plugin",
46
+ "scaffold",
47
+ "cli",
48
+ "project-init",
49
+ "ai-first"
50
+ ],
51
+ "author": "Qingwen Chen <cqinwn@qq.com>",
52
+ "license": "Apache-2.0",
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "https://gitee.com/yuebon/adspecs.git"
56
+ },
57
+ "homepage": "https://gitee.com/yuebon/adspecs#readme",
58
+ "bugs": {
59
+ "url": "https://gitee.com/yuebon/adspecs/issues"
60
+ }
61
+ }