@haaaiawd/anws 2.2.0 → 2.2.2

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 (28) hide show
  1. package/README.md +180 -343
  2. package/bin/cli.js +112 -112
  3. package/lib/changelog.js +258 -258
  4. package/lib/copy.js +116 -109
  5. package/lib/diff.js +11 -0
  6. package/lib/manifest.js +4 -1
  7. package/lib/update.js +319 -319
  8. package/package.json +4 -3
  9. package/templates/.agents/skills/anws-system/SKILL.md +9 -7
  10. package/templates/.agents/skills/code-reviewer/SKILL.md +102 -327
  11. package/templates/.agents/skills/concept-modeler/SKILL.md +19 -17
  12. package/templates/.agents/skills/craft-authoring/SKILL.md +123 -0
  13. package/templates/.agents/skills/e2e-testing-guide/SKILL.md +59 -0
  14. package/templates/.agents/skills/system-designer/SKILL.md +6 -6
  15. package/templates/.agents/skills/system-designer/references/system-design-template.md +17 -17
  16. package/templates/.agents/skills/task-planner/SKILL.md +113 -113
  17. package/templates/.agents/skills/task-planner/references/TASK_TEMPLATE.md +82 -82
  18. package/templates/.agents/workflows/blueprint.md +284 -284
  19. package/templates/.agents/workflows/challenge.md +450 -491
  20. package/templates/.agents/workflows/change.md +263 -286
  21. package/templates/.agents/workflows/craft.md +243 -664
  22. package/templates/.agents/workflows/design-system.md +624 -624
  23. package/templates/.agents/workflows/explore.md +400 -371
  24. package/templates/.agents/workflows/forge.md +444 -413
  25. package/templates/.agents/workflows/genesis.md +342 -395
  26. package/templates/.agents/workflows/probe.md +21 -16
  27. package/templates/.agents/workflows/quickstart.md +123 -138
  28. package/templates/AGENTS.md +149 -134
package/bin/cli.js CHANGED
@@ -1,112 +1,112 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const { parseArgs } = require('node:util');
5
- const path = require('node:path');
6
- const { listTargets, getTarget } = require('../lib/adapters');
7
- const { blank, error, info, logo } = require('../lib/output');
8
-
9
- // ─── 版本号从 package.json 读取 ─────────────────────────────────────────────
10
- const { version } = require(path.join(__dirname, '..', 'package.json'));
11
- const TARGET_IDS = listTargets().map((target) => target.id);
12
-
13
- // ─── 帮助文本 ─────────────────────────────────────────────────────────────────
14
- const HELP = `
15
- USAGE
16
- anws <command> [options]
17
-
18
- COMMANDS
19
- init Install one or more target AI IDE workflow projections
20
- update Scan installed targets from install-lock or directory layout and update them
21
-
22
- OPTIONS
23
- -v, --version Print version number
24
- -h, --help Show this help message
25
- --target Target AI IDE(s) for init, comma-separated (${TARGET_IDS.join(', ')})
26
-
27
- SUPPORTED TARGETS
28
- windsurf workflows + skills
29
- antigravity workflows + skills
30
- cursor commands + skills
31
- claude commands + skills
32
- copilot prompts + skills
33
- codex preview, skills-only bundle via anws-system
34
- opencode commands + skills
35
- trae skills-only bundle via anws-system
36
- qoder commands + skills
37
- kilo workflows + skills
38
-
39
- EXAMPLES
40
- anws init # Choose target IDEs and install their managed workflow projections
41
- anws init --target windsurf,codex,opencode
42
- anws update # One-click update for all matched targets from install-lock, fallback scan, or drift repair
43
- `.trimStart();
44
-
45
- // ─── 参数解析 ─────────────────────────────────────────────────────────────────
46
- const { values, positionals } = parseArgs({
47
- args: process.argv.slice(2),
48
- options: {
49
- version: { type: 'boolean', short: 'v', default: false },
50
- help: { type: 'boolean', short: 'h', default: false },
51
- yes: { type: 'boolean', short: 'y', default: false },
52
- target: { type: 'string' },
53
- check: { type: 'boolean', default: false },
54
- },
55
- strict: false,
56
- allowPositionals: true,
57
- });
58
-
59
- if (values.yes) {
60
- global.__ANWS_FORCE_YES = true;
61
- }
62
-
63
- if (values.target !== undefined) {
64
- const targetIds = values.target.split(',').map((item) => item.trim()).filter(Boolean);
65
- targetIds.forEach((targetId) => getTarget(targetId));
66
- global.__ANWS_TARGET_IDS = Array.from(new Set(targetIds));
67
- }
68
-
69
- // ─── 命令路由 ─────────────────────────────────────────────────────────────────
70
- async function main() {
71
- if (values.version) {
72
- console.log(version);
73
- process.exit(0);
74
- }
75
-
76
- if (values.help || positionals.length === 0) {
77
- logo();
78
- blank();
79
- console.log(HELP.trimEnd());
80
- process.exit(0);
81
- }
82
-
83
- const command = positionals[0];
84
-
85
- switch (command) {
86
- case 'init':
87
- await require('../lib/init')();
88
- break;
89
-
90
- case 'update':
91
- if (values.target !== undefined) {
92
- error('`anws update --target` has been removed. Use `anws update` to update all matched targets.');
93
- process.exit(1);
94
- }
95
- if (values.check) {
96
- error('`anws update --check` has been removed. Use `anws update` directly.');
97
- process.exit(1);
98
- }
99
- await require('../lib/update')();
100
- break;
101
-
102
- default:
103
- error(`Unknown command: "${command}"`);
104
- info('Run `anws --help` to see available commands.');
105
- process.exit(1);
106
- }
107
- }
108
-
109
- main().catch((err) => {
110
- error(`Unexpected error: ${err.message}`);
111
- process.exit(1);
112
- });
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { parseArgs } = require('node:util');
5
+ const path = require('node:path');
6
+ const { listTargets, getTarget } = require('../lib/adapters');
7
+ const { blank, error, info, logo } = require('../lib/output');
8
+
9
+ // ─── 版本号从 package.json 读取 ─────────────────────────────────────────────
10
+ const { version } = require(path.join(__dirname, '..', 'package.json'));
11
+ const TARGET_IDS = listTargets().map((target) => target.id);
12
+
13
+ // ─── 帮助文本 ─────────────────────────────────────────────────────────────────
14
+ const HELP = `
15
+ USAGE
16
+ anws <command> [options]
17
+
18
+ COMMANDS
19
+ init Install one or more target AI IDE workflow projections
20
+ update Scan installed targets from install-lock or directory layout and update them
21
+
22
+ OPTIONS
23
+ -v, --version Print version number
24
+ -h, --help Show this help message
25
+ --target Target AI IDE(s) for init, comma-separated (${TARGET_IDS.join(', ')})
26
+
27
+ SUPPORTED TARGETS
28
+ windsurf workflows + skills
29
+ antigravity workflows + skills
30
+ cursor commands + skills
31
+ claude commands + skills
32
+ copilot prompts + skills
33
+ codex preview, skills-only bundle via anws-system
34
+ opencode commands + skills
35
+ trae skills-only bundle via anws-system
36
+ qoder commands + skills
37
+ kilo workflows + skills
38
+
39
+ EXAMPLES
40
+ anws init # Choose target IDEs and install their managed workflow projections
41
+ anws init --target windsurf,codex,opencode
42
+ anws update # One-click update for all matched targets from install-lock, fallback scan, or drift repair
43
+ `.trimStart();
44
+
45
+ // ─── 参数解析 ─────────────────────────────────────────────────────────────────
46
+ const { values, positionals } = parseArgs({
47
+ args: process.argv.slice(2),
48
+ options: {
49
+ version: { type: 'boolean', short: 'v', default: false },
50
+ help: { type: 'boolean', short: 'h', default: false },
51
+ yes: { type: 'boolean', short: 'y', default: false },
52
+ target: { type: 'string' },
53
+ check: { type: 'boolean', default: false },
54
+ },
55
+ strict: false,
56
+ allowPositionals: true,
57
+ });
58
+
59
+ if (values.yes) {
60
+ global.__ANWS_FORCE_YES = true;
61
+ }
62
+
63
+ if (values.target !== undefined) {
64
+ const targetIds = values.target.split(',').map((item) => item.trim()).filter(Boolean);
65
+ targetIds.forEach((targetId) => getTarget(targetId));
66
+ global.__ANWS_TARGET_IDS = Array.from(new Set(targetIds));
67
+ }
68
+
69
+ // ─── 命令路由 ─────────────────────────────────────────────────────────────────
70
+ async function main() {
71
+ if (values.version) {
72
+ console.log(version);
73
+ process.exit(0);
74
+ }
75
+
76
+ if (values.help || positionals.length === 0) {
77
+ logo();
78
+ blank();
79
+ console.log(HELP.trimEnd());
80
+ process.exit(0);
81
+ }
82
+
83
+ const command = positionals[0];
84
+
85
+ switch (command) {
86
+ case 'init':
87
+ await require('../lib/init')();
88
+ break;
89
+
90
+ case 'update':
91
+ if (values.target !== undefined) {
92
+ error('`anws update --target` has been removed. Use `anws update` to update all matched targets.');
93
+ process.exit(1);
94
+ }
95
+ if (values.check) {
96
+ error('`anws update --check` has been removed. Use `anws update` directly.');
97
+ process.exit(1);
98
+ }
99
+ await require('../lib/update')();
100
+ break;
101
+
102
+ default:
103
+ error(`Unknown command: "${command}"`);
104
+ info('Run `anws --help` to see available commands.');
105
+ process.exit(1);
106
+ }
107
+ }
108
+
109
+ main().catch((err) => {
110
+ error(`Unexpected error: ${err.message}`);
111
+ process.exit(1);
112
+ });