adspecs 0.1.19 → 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 (67) hide show
  1. package/.adspecs/feature.json +16 -16
  2. package/.adspecs/feature.yml +28 -28
  3. package/.adspecs/paths.json +17 -17
  4. package/.claude-plugin/marketplace.json +23 -23
  5. package/.claude-plugin/plugin.json +18 -18
  6. package/.qoder-plugin/plugin.json +31 -31
  7. package/CLAUDE.md +1 -5
  8. package/README.md +395 -395
  9. package/bin/adspecs.js +129 -129
  10. package/hooks/commit-queue.js +245 -245
  11. package/hooks/hooks.json +63 -63
  12. package/hooks/session-start.js +44 -44
  13. package/hooks/wiki-queue.js +127 -127
  14. package/package.json +61 -61
  15. package/references/ant6-front-standard/index.md +99 -99
  16. package/references/antd-front-demo/public/mockServiceWorker.js +361 -361
  17. package/references/ecp-end-standard/index.md +63 -63
  18. 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
  19. 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
  20. 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
  21. package/references/python-end-standard/04-Redis/344/275/277/347/224/250/350/247/204/350/214/203.md +231 -231
  22. package/scripts/postinstall.js +107 -107
  23. package/scripts/sync-version.js +105 -105
  24. package/skills/.claude/.wiki-update-queue +26 -26
  25. package/skills/adspecs-constitution/SKILL.md +157 -0
  26. package/skills/adspecs-export-word/SKILL.md +498 -498
  27. package/skills/adspecs-export-word/references/md-to-docx.js +862 -862
  28. package/skills/adspecs-export-word/references/package-lock.json +220 -220
  29. package/skills/adspecs-export-word/references/package.json +10 -10
  30. package/skills/adspecs-front-prototype/SKILL.md +405 -405
  31. package/skills/adspecs-plan/SKILL.md +59 -69
  32. package/skills/adspecs-prd/SKILL.md +13 -5
  33. package/skills/adspecs-prd-to-demo/SKILL.md +532 -0
  34. package/skills/adspecs-tasks/SKILL.md +175 -204
  35. package/skills/adspecs-update-status/SKILL.md +382 -382
  36. package/skills/adspecs-utest/SKILL.md +107 -116
  37. package/skills/grill-me/SKILL.md +7 -0
  38. package/skills/grill-me/agents/openai.yaml +5 -0
  39. package/skills/playwright-cli/SKILL.md +420 -0
  40. package/skills/playwright-cli/references/element-attributes.md +23 -0
  41. package/skills/playwright-cli/references/playwright-tests.md +39 -0
  42. package/skills/playwright-cli/references/request-mocking.md +87 -0
  43. package/skills/playwright-cli/references/running-code.md +241 -0
  44. package/skills/playwright-cli/references/session-management.md +225 -0
  45. package/skills/playwright-cli/references/storage-state.md +275 -0
  46. package/skills/playwright-cli/references/test-generation.md +433 -0
  47. package/skills/playwright-cli/references/tracing.md +139 -0
  48. package/skills/playwright-cli/references/video-recording.md +143 -0
  49. package/skills/playwright-trace/SKILL.md +171 -0
  50. package/skills/project-init/references/front-demo/.claude/settings.local.json +9 -0
  51. package/skills/wiki-update/SKILL.md +232 -232
  52. package/src/commands/doctor.js +197 -197
  53. package/src/commands/init.js +83 -83
  54. package/src/commands/plugin.js +165 -165
  55. package/src/commands/update.js +87 -87
  56. package/src/lib/area-scanner.js +129 -129
  57. package/src/lib/copier.js +104 -104
  58. package/src/lib/dir-utils.js +133 -133
  59. package/src/lib/json-merge.js +114 -114
  60. package/src/lib/paths-defaults.js +37 -37
  61. package/src/lib/prompts.js +347 -347
  62. package/src/lib/readme-gen.js +143 -143
  63. package/src/lib/report.js +327 -327
  64. package/src/lib/scaffolder.js +518 -518
  65. package/src/lib/short-name.js +36 -36
  66. package/src/utils.js +80 -80
  67. package/references/antd-front-demo/.env +0 -15
package/bin/adspecs.js CHANGED
@@ -1,129 +1,129 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const { Command } = require('commander');
5
- const path = require('path');
6
- const fs = require('fs');
7
-
8
- // 读取 package.json 获取版本号
9
- const pkgPath = path.resolve(__dirname, '..', 'package.json');
10
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
11
-
12
- const program = new Command();
13
-
14
- program
15
- .name('adspecs')
16
- .description('adspecs — AI first 工程规范驱动开发 CLI')
17
- .version(pkg.version, '-v, --version', '输出版本号');
18
-
19
- // ============ init 命令 ============
20
- program
21
- .command('init')
22
- .description('初始化项目目录结构(等价于 Claude Code 的 /project-init 技能)')
23
- .option('--project-name <name>', '项目名称')
24
- .option('--project-dir <dir>', '项目目录名(留空=当前目录)')
25
- .option('--company <name>', '公司名称', 'XX有限公司')
26
- .option('--confidentiality <level>', '文件密级: 公开|内部资料|机密|绝密', '内部资料')
27
- .option('--mode <mode>', '初始化模式: simple|classic|full|demo')
28
- .option('--front-demo <stack>', '前端演示技术栈: vue|antd', 'vue')
29
- .option('--modules <list>', '后端模块列表(逗号分隔,格式 {port}-crm-{name}:{package})')
30
- .option('--non-interactive', '非交互模式,所有未提供的参数使用默认值')
31
- .option('--force', '跳过冲突决策,所有已存在区域直接重新创建')
32
- .option('-y, --yes', '自动确认执行(跳过执行前确认步骤,但保留冲突决策提示)')
33
- .action(async (options) => {
34
- try {
35
- const initCmd = require('../src/commands/init');
36
- await initCmd(options);
37
- } catch (err) {
38
- console.error('❌ 初始化失败:', err.message);
39
- if (process.env.DEBUG) console.error(err.stack);
40
- process.exit(1);
41
- }
42
- });
43
-
44
- // ============ plugin 命令组 ============
45
- const pluginCmd = program
46
- .command('plugin')
47
- .description('Claude Code 插件管理');
48
-
49
- pluginCmd
50
- .command('install')
51
- .description('注册当前 adspecs 为 Claude Code 插件')
52
- .option('--scope <scope>', '安装范围: user|project', 'user')
53
- .action(async (options) => {
54
- try {
55
- const pluginCmd = require('../src/commands/plugin');
56
- await pluginCmd.install(options);
57
- } catch (err) {
58
- console.error('❌ 插件注册失败:', err.message);
59
- if (process.env.DEBUG) console.error(err.stack);
60
- process.exit(1);
61
- }
62
- });
63
-
64
- pluginCmd
65
- .command('uninstall')
66
- .description('从 Claude Code 中卸载 adspecs 插件')
67
- .option('--scope <scope>', '卸载范围: user|project', 'user')
68
- .action(async (options) => {
69
- try {
70
- const pluginCmd = require('../src/commands/plugin');
71
- await pluginCmd.uninstall(options);
72
- } catch (err) {
73
- console.error('❌ 插件卸载失败:', err.message);
74
- if (process.env.DEBUG) console.error(err.stack);
75
- process.exit(1);
76
- }
77
- });
78
-
79
- // ============ doctor 命令 ============
80
- program
81
- .command('doctor')
82
- .description('检查环境依赖(Node.js、git、Python、PowerShell 等)')
83
- .action(async () => {
84
- try {
85
- const doctorCmd = require('../src/commands/doctor');
86
- await doctorCmd();
87
- } catch (err) {
88
- console.error('❌ 环境检查失败:', err.message);
89
- if (process.env.DEBUG) console.error(err.stack);
90
- process.exit(1);
91
- }
92
- });
93
-
94
- // ============ update 命令 ============
95
- program
96
- .command('update')
97
- .description('升级 adspecs 到最新版本(等价于 npm install -g adspecs@latest)')
98
- .option('--version <version>', '升级到指定版本(默认 latest)')
99
- .action(async (options) => {
100
- try {
101
- const updateCmd = require('../src/commands/update');
102
- await updateCmd(options);
103
- } catch (err) {
104
- console.error('❌ 升级失败:', err.message);
105
- if (process.env.DEBUG) console.error(err.stack);
106
- process.exit(1);
107
- }
108
- });
109
-
110
- // ============ 帮助信息增强 ============
111
- program.addHelpText('after', `
112
- 示例:
113
- $ adspecs init # 交互式初始化
114
- $ adspecs init --mode simple # 快速初始化(交互选择其余参数)
115
- $ adspecs init --non-interactive # 完全非交互(使用默认值)
116
- $ adspecs init --project-name "我的项目" --mode full --front-demo antd
117
- $ adspecs plugin install # 注册为 Claude Code 插件(默认 user 范围)
118
- $ adspecs plugin install --scope project # 仅注册到当前项目
119
- $ adspecs plugin install --scope user # 注册到当前用户(全局可用)
120
- $ adspecs plugin uninstall --scope project # 从当前项目卸载
121
- $ adspecs doctor # 检查环境依赖
122
- $ adspecs update # 升级到最新版本
123
- $ adspecs update --version 0.2.0 # 升级到指定版本
124
-
125
- 文档:
126
- https://gitee.com/yuebon/adspecs
127
- `);
128
-
129
- program.parse();
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { Command } = require('commander');
5
+ const path = require('path');
6
+ const fs = require('fs');
7
+
8
+ // 读取 package.json 获取版本号
9
+ const pkgPath = path.resolve(__dirname, '..', 'package.json');
10
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
11
+
12
+ const program = new Command();
13
+
14
+ program
15
+ .name('adspecs')
16
+ .description('adspecs — AI first 工程规范驱动开发 CLI')
17
+ .version(pkg.version, '-v, --version', '输出版本号');
18
+
19
+ // ============ init 命令 ============
20
+ program
21
+ .command('init')
22
+ .description('初始化项目目录结构(等价于 Claude Code 的 /project-init 技能)')
23
+ .option('--project-name <name>', '项目名称')
24
+ .option('--project-dir <dir>', '项目目录名(留空=当前目录)')
25
+ .option('--company <name>', '公司名称', 'XX有限公司')
26
+ .option('--confidentiality <level>', '文件密级: 公开|内部资料|机密|绝密', '内部资料')
27
+ .option('--mode <mode>', '初始化模式: simple|classic|full|demo')
28
+ .option('--front-demo <stack>', '前端演示技术栈: vue|antd', 'vue')
29
+ .option('--modules <list>', '后端模块列表(逗号分隔,格式 {port}-crm-{name}:{package})')
30
+ .option('--non-interactive', '非交互模式,所有未提供的参数使用默认值')
31
+ .option('--force', '跳过冲突决策,所有已存在区域直接重新创建')
32
+ .option('-y, --yes', '自动确认执行(跳过执行前确认步骤,但保留冲突决策提示)')
33
+ .action(async (options) => {
34
+ try {
35
+ const initCmd = require('../src/commands/init');
36
+ await initCmd(options);
37
+ } catch (err) {
38
+ console.error('❌ 初始化失败:', err.message);
39
+ if (process.env.DEBUG) console.error(err.stack);
40
+ process.exit(1);
41
+ }
42
+ });
43
+
44
+ // ============ plugin 命令组 ============
45
+ const pluginCmd = program
46
+ .command('plugin')
47
+ .description('Claude Code 插件管理');
48
+
49
+ pluginCmd
50
+ .command('install')
51
+ .description('注册当前 adspecs 为 Claude Code 插件')
52
+ .option('--scope <scope>', '安装范围: user|project', 'user')
53
+ .action(async (options) => {
54
+ try {
55
+ const pluginCmd = require('../src/commands/plugin');
56
+ await pluginCmd.install(options);
57
+ } catch (err) {
58
+ console.error('❌ 插件注册失败:', err.message);
59
+ if (process.env.DEBUG) console.error(err.stack);
60
+ process.exit(1);
61
+ }
62
+ });
63
+
64
+ pluginCmd
65
+ .command('uninstall')
66
+ .description('从 Claude Code 中卸载 adspecs 插件')
67
+ .option('--scope <scope>', '卸载范围: user|project', 'user')
68
+ .action(async (options) => {
69
+ try {
70
+ const pluginCmd = require('../src/commands/plugin');
71
+ await pluginCmd.uninstall(options);
72
+ } catch (err) {
73
+ console.error('❌ 插件卸载失败:', err.message);
74
+ if (process.env.DEBUG) console.error(err.stack);
75
+ process.exit(1);
76
+ }
77
+ });
78
+
79
+ // ============ doctor 命令 ============
80
+ program
81
+ .command('doctor')
82
+ .description('检查环境依赖(Node.js、git、Python、PowerShell 等)')
83
+ .action(async () => {
84
+ try {
85
+ const doctorCmd = require('../src/commands/doctor');
86
+ await doctorCmd();
87
+ } catch (err) {
88
+ console.error('❌ 环境检查失败:', err.message);
89
+ if (process.env.DEBUG) console.error(err.stack);
90
+ process.exit(1);
91
+ }
92
+ });
93
+
94
+ // ============ update 命令 ============
95
+ program
96
+ .command('update')
97
+ .description('升级 adspecs 到最新版本(等价于 npm install -g adspecs@latest)')
98
+ .option('--version <version>', '升级到指定版本(默认 latest)')
99
+ .action(async (options) => {
100
+ try {
101
+ const updateCmd = require('../src/commands/update');
102
+ await updateCmd(options);
103
+ } catch (err) {
104
+ console.error('❌ 升级失败:', err.message);
105
+ if (process.env.DEBUG) console.error(err.stack);
106
+ process.exit(1);
107
+ }
108
+ });
109
+
110
+ // ============ 帮助信息增强 ============
111
+ program.addHelpText('after', `
112
+ 示例:
113
+ $ adspecs init # 交互式初始化
114
+ $ adspecs init --mode simple # 快速初始化(交互选择其余参数)
115
+ $ adspecs init --non-interactive # 完全非交互(使用默认值)
116
+ $ adspecs init --project-name "我的项目" --mode full --front-demo antd
117
+ $ adspecs plugin install # 注册为 Claude Code 插件(默认 user 范围)
118
+ $ adspecs plugin install --scope project # 仅注册到当前项目
119
+ $ adspecs plugin install --scope user # 注册到当前用户(全局可用)
120
+ $ adspecs plugin uninstall --scope project # 从当前项目卸载
121
+ $ adspecs doctor # 检查环境依赖
122
+ $ adspecs update # 升级到最新版本
123
+ $ adspecs update --version 0.2.0 # 升级到指定版本
124
+
125
+ 文档:
126
+ https://gitee.com/yuebon/adspecs
127
+ `);
128
+
129
+ program.parse();