apple-design-skill 0.0.2 → 0.0.3
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/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +6 -0
- package/README.md +16 -11
- package/bin/apple-design-skill.mjs +21 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.3
|
|
4
|
+
|
|
5
|
+
- Default all CLI commands to user scope and the Codex, Claude Code and Cursor targets; keep `--global` and `--all` as explicit equivalents.
|
|
6
|
+
- Support `--project` for the current project and `--project PATH` for a specific project, with `--agent` limiting the selected tools in either scope.
|
|
7
|
+
- Document the default change from 0.0.2 and earlier, and verify user/project isolation across installation, activation, listing and uninstall.
|
|
8
|
+
|
|
3
9
|
## 0.0.2
|
|
4
10
|
|
|
5
11
|
- Remove multi-agent collaboration guidance and related package and plugin descriptions.
|
package/README.md
CHANGED
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
[快速开始](#快速开始) · [使用前后对比](#使用前后对比) · [安装与版本管理](docs/installation.md) · [参与贡献](CONTRIBUTING.md)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
一条命令安装给当前用户的 Codex、Claude Code 和 Cursor,跨项目使用(Node.js 22+):
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
npx apple-design-skill@latest install
|
|
16
|
+
npx apple-design-skill@latest install
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
只安装给某个工具,或安装到项目目录?见[快速开始](#快速开始)。
|
|
20
20
|
|
|
21
21
|
## 使用前后对比
|
|
22
22
|
|
|
@@ -46,20 +46,25 @@ python3 -m http.server 4177 --bind 127.0.0.1 --directory examples/agent-learning
|
|
|
46
46
|
|
|
47
47
|
## 快速开始
|
|
48
48
|
|
|
49
|
-
需要 **Node.js 22
|
|
49
|
+
需要 **Node.js 22+**。默认安装到用户目录,可在任意目录执行:
|
|
50
50
|
|
|
51
51
|
```sh
|
|
52
|
-
# Codex
|
|
53
|
-
npx apple-design-skill@latest install
|
|
52
|
+
# 默认:用户级安装,供 Codex、Claude Code、Cursor 使用
|
|
53
|
+
npx apple-design-skill@latest install
|
|
54
54
|
|
|
55
|
-
#
|
|
55
|
+
# 只安装给指定工具
|
|
56
|
+
npx apple-design-skill@latest install --agent codex
|
|
56
57
|
npx apple-design-skill@latest install --agent claude
|
|
57
|
-
|
|
58
|
-
# Cursor
|
|
59
58
|
npx apple-design-skill@latest install --agent cursor
|
|
59
|
+
|
|
60
|
+
# 仅安装到当前项目
|
|
61
|
+
npx apple-design-skill@latest install --project
|
|
62
|
+
|
|
63
|
+
# 安装到指定项目,也可同时选择工具
|
|
64
|
+
npx apple-design-skill@latest install --project ./my-project --agent codex
|
|
60
65
|
```
|
|
61
66
|
|
|
62
|
-
|
|
67
|
+
默认目标为 `~/.agents/skills`(Codex)、`~/.claude/skills`(Claude Code)、`~/.cursor/skills`(Cursor)中的 `apple-design-skill`。`--global` 和 `--all` 可显式声明默认行为;`--agent` 限定工具,`--project [路径]` 切换到项目目录。先查看目标路径可追加 `--dry-run`。npm 下载本包不会自动写入技能目录,`install` 命令才会执行安装。
|
|
63
68
|
|
|
64
69
|
安装后,在新会话中给出具体任务:
|
|
65
70
|
|
|
@@ -69,7 +74,7 @@ npx apple-design-skill@latest install --agent cursor
|
|
|
69
74
|
特别检查下拉按钮与展开菜单,并验证键盘选择、关闭方式和窄屏布局。
|
|
70
75
|
```
|
|
71
76
|
|
|
72
|
-
Codex 可显式调用 `$apple-design-skill`,Claude Code 可调用 `/apple-design-skill
|
|
77
|
+
Codex 可显式调用 `$apple-design-skill`,Claude Code 可调用 `/apple-design-skill`。固定版本、项目级安装、重复入口、升级与回退见[安装指南](docs/installation.md)。
|
|
73
78
|
|
|
74
79
|
## 适合哪些任务
|
|
75
80
|
|
|
@@ -7,6 +7,7 @@ import { execute, resolveTargets, validateName, validateVersion } from '../lib/i
|
|
|
7
7
|
|
|
8
8
|
const packageRoot = fileURLToPath(new URL('../', import.meta.url));
|
|
9
9
|
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
10
|
+
const defaultAgents = ['codex', 'claude', 'cursor'];
|
|
10
11
|
const help = `apple-design-skill ${pkg.version}
|
|
11
12
|
|
|
12
13
|
Usage:
|
|
@@ -17,9 +18,9 @@ Usage:
|
|
|
17
18
|
|
|
18
19
|
Options:
|
|
19
20
|
--agent NAME[,NAME] codex, claude, cursor, universal (repeatable)
|
|
20
|
-
--all Codex + Claude Code + Cursor
|
|
21
|
-
--
|
|
22
|
-
--
|
|
21
|
+
--all Codex + Claude Code + Cursor (default)
|
|
22
|
+
--global User scope, in your home directory (default)
|
|
23
|
+
--project [PATH] Project scope; omit PATH to use the current directory
|
|
23
24
|
--name NAME Skill name; use a distinct name for side-by-side versions
|
|
24
25
|
--force Back up and replace existing or locally modified files
|
|
25
26
|
--dry-run Show planned changes without writing files
|
|
@@ -27,12 +28,19 @@ Options:
|
|
|
27
28
|
-v, --version Print npm package version
|
|
28
29
|
-h, --help Show help
|
|
29
30
|
|
|
30
|
-
Default
|
|
31
|
+
Default: install for Codex, Claude Code and Cursor in your home directory.
|
|
32
|
+
Codex: ~/.agents/skills
|
|
33
|
+
Claude Code: ~/.claude/skills
|
|
34
|
+
Cursor: ~/.cursor/skills
|
|
35
|
+
Use --agent to select tools, or --agent universal for only .agents/skills.
|
|
36
|
+
All commands use the same scope and target defaults; use --project for project copies.
|
|
31
37
|
No files are installed by npm postinstall; run the install command explicitly.
|
|
32
38
|
|
|
33
39
|
Examples:
|
|
34
|
-
npx apple-design-skill@${pkg.version} install
|
|
35
|
-
npx apple-design-skill@${pkg.version} install --agent claude
|
|
40
|
+
npx apple-design-skill@${pkg.version} install
|
|
41
|
+
npx apple-design-skill@${pkg.version} install --agent claude
|
|
42
|
+
npx apple-design-skill@${pkg.version} install --project
|
|
43
|
+
npx apple-design-skill@${pkg.version} install --agent codex --project ./my-project
|
|
36
44
|
npx apple-design-skill@${pkg.version} install --name apple-design-pinned
|
|
37
45
|
npx apple-design-skill@latest use ${pkg.version} --all
|
|
38
46
|
`;
|
|
@@ -49,7 +57,7 @@ try {
|
|
|
49
57
|
if (!['install', 'use', 'list', 'uninstall'].includes(command)) throw new Error(`Unknown command: ${command}`);
|
|
50
58
|
const requestedVersion = command === 'use' ? argv.shift() : pkg.version;
|
|
51
59
|
if (command === 'use') validateVersion(requestedVersion);
|
|
52
|
-
let scopeRoot =
|
|
60
|
+
let scopeRoot = homedir();
|
|
53
61
|
let scopeFlag;
|
|
54
62
|
const agents = [];
|
|
55
63
|
const options = { command, packageRoot, version: requestedVersion, name: 'apple-design-skill', force: false, dryRun: false };
|
|
@@ -61,11 +69,14 @@ try {
|
|
|
61
69
|
for (let i = 0; i < argv.length; i++) {
|
|
62
70
|
const arg = argv[i];
|
|
63
71
|
if (arg === '--agent') { agents.push(...next(arg, i++).split(',')); }
|
|
64
|
-
else if (arg === '--all') { agents.push(
|
|
72
|
+
else if (arg === '--all') { agents.push(...defaultAgents); }
|
|
65
73
|
else if (arg === '--project' || arg === '--global') {
|
|
66
74
|
if (scopeFlag) throw new Error('Choose one of --project or --global');
|
|
67
75
|
scopeFlag = arg;
|
|
68
|
-
|
|
76
|
+
if (arg === '--project') {
|
|
77
|
+
const path = argv[i + 1] && !argv[i + 1].startsWith('-') ? argv[++i] : '.';
|
|
78
|
+
scopeRoot = resolve(path);
|
|
79
|
+
} else scopeRoot = homedir();
|
|
69
80
|
} else if (arg === '--name') { options.name = next(arg, i++); }
|
|
70
81
|
else if (arg === '--force') options.force = true;
|
|
71
82
|
else if (arg === '--dry-run') options.dryRun = true;
|
|
@@ -74,7 +85,7 @@ try {
|
|
|
74
85
|
}
|
|
75
86
|
validateName(options.name);
|
|
76
87
|
options.scopeRoot = resolve(scopeRoot);
|
|
77
|
-
options.targets = resolveTargets(options.scopeRoot, agents.length ? agents :
|
|
88
|
+
options.targets = resolveTargets(options.scopeRoot, agents.length ? agents : defaultAgents, options.name);
|
|
78
89
|
const result = execute(options);
|
|
79
90
|
if (json) process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
80
91
|
else {
|
package/package.json
CHANGED